上篇Linux笔记 - inotifywait + rsync 同步文件夹提到的tilda配置,现在接着写:
将以下代码保存为 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-tweak
,自启动那里添加终端。如有,忽略。.config/autostart/org.gnome.Terminal.desktop
中的一行:Exec=/home/xxxx/bin/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&