Linux笔记 - tilda配置
2021/12/6 7:19:11
本文主要是介绍Linux笔记 - tilda配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Linux笔记 - tilda配置
上篇Linux笔记 - inotifywait + rsync 同步文件夹提到的tilda配置,现在接着写:
需求:
- 按F12运行tilda终端,并同时启动sdcv。这个其实在Linux笔记 - 翻译软件:星际译王(Stardict)中已经实现。
- 按F7、F8、F9、F10分别在屏幕不同位置开大概1/4屏幕大小的终端,按F3、F4在屏幕上下各开半屏幕大小的终端。
生成配置文件:
将以下代码保存为 tilda_config.sh
,并运行。
#!/bin/bash # 负责生成tilda配置文件。 # xrandr 查看当前屏幕分辨率 which xrandr if [ $? == '1' ]; then sudo dnf install -y xrandr fi screenWight=`xrandr | grep current | cut -d, -f2 | cut -d" " -f3` screenHeight=`xrandr | grep current | cut -d, -f2 | cut -d" " -f5` # sdcv + tilda which sdcv tilda if [ $? == '1' -o $? == '2' ]; then sudo dnf install -y sdcv tilda fi # tilda config: if [ ! -d ~/.config/tilda ]; then mkdir -pv ~/.config/tilda fi # if [ ! -f ~/.config/tilda/config_F12 ] ; then cat >~/.config/tilda/config_F12<<EOF command="sdcv" run_command=true key="F12" x_pos=$[$screenWight*7/10] y_pos=$[$screenHeight*6/10] width_percentage=644245094 height_percentage=858993458 auto_hide_on_focus_lost=true auto_hide_on_mouse_leave=true hidden=true # enable_transparency=true # back_alpha=52428 EOF fi # tilda left, right, top, bottom # 111....111 (31bit) w=2147483647 # F7 if [ ! -f ~/.config/tilda/config_F7 ] ; then cat >~/.config/tilda/config_F7<<EOF key="F7" x_pos=$[$screenWight*0/10] y_pos=$[$screenHeight*0/10] width_percentage=$[$w*45/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi # F8: if [ ! -f ~/.config/tilda/config_F8 ] ; then cat >~/.config/tilda/config_F8<<EOF key="F8" x_pos=$[$screenWight*5/10] y_pos=$[$screenHeight*0/10] width_percentage=$[$w*45/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi # F9 if [ ! -f ~/.config/tilda/config_F9 ] ; then cat >~/.config/tilda/config_F9<<EOF key="F9" x_pos=$[$screenWight*0/10] y_pos=$[$screenHeight*5/10] width_percentage=$[$w*45/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi # F10 if [ ! -f ~/.config/tilda/config_F10 ] ; then cat >~/.config/tilda/config_F10<<EOF key="F10" x_pos=$[$screenWight*5/10] y_pos=$[$screenHeight*5/10] width_percentage=$[$w*45/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi # F3 if [ ! -f ~/.config/tilda/config_F3 ] ; then cat >~/.config/tilda/config_F3<<EOF key="F3" x_pos=$[$screenWight*0/10] y_pos=$[$screenHeight*0/10] width_percentage=$[$w*99/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi # F4 if [ ! -f ~/.config/tilda/config_F4 ] ; then cat >~/.config/tilda/config_F4<<EOF key="F4" x_pos=$[$screenWight*0/10] y_pos=$[$screenHeight*51/100] width_percentage=$[$w*99/100] height_percentage=$[$w*45/100] hidden=true above=false EOF fi
gnome自启动
上篇已经提到,这里再简单讲讲:
- 运行
gnome-tweak
,自启动那里添加终端。如有,忽略。 - 修改
.config/autostart/org.gnome.Terminal.desktop
中的一行:Exec=/home/xxxx/bin/gnome-start.sh
- 将以下代码添加到 gnome-start.sh中:
# 由于之前我已经设置好了sdcv+tilda,这里注释掉。 # tilda -g ~/.config/tilda/config_F12 >> /dev/null& tilda -g ~/.config/tilda/config_F7 >> /dev/null& tilda -g ~/.config/tilda/config_F8 >> /dev/null& tilda -g ~/.config/tilda/config_F9 >> /dev/null& tilda -g ~/.config/tilda/config_F10 >> /dev/null& tilda -g ~/.config/tilda/config_F3 >> /dev/null& tilda -g ~/.config/tilda/config_F4 >> /dev/null&
这篇关于Linux笔记 - tilda配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-11Linux部署Scrapy学习:入门级指南
- 2024-09-11Linux部署Scrapy:入门级指南
- 2024-08-21【Linux】分区向左扩容的方法
- 2024-08-21【Linux】gnome桌面环境切换KDE Plasma
- 2024-08-19如何安装 VMware Tools (macOS, Linux, Windows)
- 2024-08-15Linux部署Scrapy教程:入门级指南
- 2024-07-29linux命令行下好用的性能监控工具atop
- 2024-07-04Linux系统上离线升级SSH服务的具体操作步骤-icode9专业技术文章分享
- 2024-06-0600-macOS和Linux安装和管理多个Python版本
- 2024-03-30[译]漫画SELinux概念