系统相关
首页 > 系统相关> > Linux笔记 - tilda配置

Linux笔记 - tilda配置

作者:互联网

Linux笔记 - tilda配置

上篇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自启动

上篇已经提到,这里再简单讲讲:

# 由于之前我已经设置好了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&

标签:gnome,dev,tilda,笔记,Linux,null,config,sdcv
来源: https://www.cnblogs.com/qydw000/p/15645803.html