Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
zh-cn:tips [2012/04/28 16:36] – [Use the desktop margin] haobug | zh-cn:tips [2015/03/10 05:06] (current) – [Do maths with xfrun4/appfinder] yjwork | ||
---|---|---|---|
Line 135: | Line 135: | ||
空白边的大小以像素为单位,所以在比较新近的显示器上,以分辨率1680 x 1050为例, ‘10’ 会留出大约 1/8 英寸(0.3175厘米)的空白。注意,已经打开的窗口在最小化再还原后才会生效。另外还要注意,这只应用于最大化的窗口 —— 你可以手工地改变窗口的大小到屏幕边缘。 | 空白边的大小以像素为单位,所以在比较新近的显示器上,以分辨率1680 x 1050为例, ‘10’ 会留出大约 1/8 英寸(0.3175厘米)的空白。注意,已经打开的窗口在最小化再还原后才会生效。另外还要注意,这只应用于最大化的窗口 —— 你可以手工地改变窗口的大小到屏幕边缘。 | ||
- | ===== Handle acpi event for power button, show Xfce logout options | + | ===== 处理 ACPI 电源按钮事件,显示 |
- | If you would like the xfce logout menu to show up when you press your power button, and your machine has acpi support, then do the following: | + | 如果你想在你按下电源按钮时显示注销菜单,并且你的机器支持 ACPI,那就按下面的步骤做吧: |
- | ==== Solution | + | ==== 解决方案 |
* ''/ | * ''/ | ||
- | < | + | < |
# / | # / | ||
- | # This is called when the user presses the power button and calls | + | # 当用户按下电源按钮时这文件会被调用并且调用 |
- | # / | + | # / |
- | # Optionally you can specify the placeholder | + | # 你也可以用 |
- | # through the whole kernel event message to the program you've | + | |
- | # specified. | + | # 我们需要对 |
- | + | # 因为内核做了改动。 | |
- | # We need to react on " | + | |
- | # of kernel changes. | + | |
event=button[ /]power | event=button[ /]power | ||
Line 158: | Line 156: | ||
* ''/ | * ''/ | ||
- | < | + | < |
# | # | ||
# xfce4-shutdown-as-user.sh | # xfce4-shutdown-as-user.sh | ||
# | # | ||
- | # Check how many users are currently logged into X. | + | # 检查当前有多少用户登录了 |
- | # If only one user is logged in, run a script which sets | + | # 就执行脚本设置环境来调用 |
- | # up the environment to call xfce4-session-logout. | + | |
LOGGED_IN_USER=`ls -trl / | LOGGED_IN_USER=`ls -trl / | ||
Line 175: | Line 172: | ||
* ''/ | * ''/ | ||
- | < | + | < |
#!/bin/sh | #!/bin/sh | ||
# xfce4-user-session-shutdown.sh | # xfce4-user-session-shutdown.sh | ||
# | # | ||
- | # Set up the environment so that DISPLAY | + | # 设置环境变量,使 |
- | # SESSION_MANAGER are valid, and xfce4-session-logout | + | # 并且可以执行 |
HOST=`hostname` | HOST=`hostname` | ||
SESSION_ID=`ls -t / | SESSION_ID=`ls -t / | ||
- | # Note that distros use different syntax for the SESSION_MANAGER | + | # 注意,发行版们的 |
- | # If this does not work, then try something like SESSION_MANAGER=" | + | # 如果这个不能用,请试着修改为类似于 |
- | # instead. You can always find the correct format for your distribution by looking at the | + | # SESSION_MANAGER=" |
- | # value of SESSION_MANAGER in a X session. | + | # 通过在 X 会话中查看 SESSION_MANAGER 的值,你总可以找到你的发行版的正确的格式 |
DISPLAY=:0 SESSION_MANAGER=" | DISPLAY=:0 SESSION_MANAGER=" | ||
</ | </ | ||
- | | + | |
- | < | + | < |
chmod +x / | chmod +x / | ||
</ | </ | ||
- | ==== Solution | + | ==== 解决方案 |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
< | < | ||
event=button/ | event=button/ | ||
Line 212: | Line 210: | ||
使用 '#' | 使用 '#' | ||
+ | |||
+ | ===== 使用 xfrun4/ | ||
+ | * 能干嘛: 在xfrun4/ | ||
+ | * 需要有此命令: | ||
+ | * 在您的家目录, | ||
+ | |||
+ | #!/bin/sh | ||
+ | | ||
+ | precision=2 | ||
+ | notify_time=20000 | ||
+ | | ||
+ | res=`echo " | ||
+ | notify-send -t $notify_time " | ||
+ | |||
+ | *在应用程序查找器添加自定义动作 : | ||
+ | * 类型 : 正则表达式 | ||
+ | * 类型 : ^([0-9]|\(|\.).* | ||
+ | * 命令 : /bin/sh ~/bcme.sh \0 | ||
+ | * (勾选) 在命令历史中保存匹配的 | ||
+ | |||
+ | |||
+ | ====== Xfconf ===== | ||
+ | |||
+ | ===== Toggle panel autohide ===== | ||
+ | |||
+ | Short Bash script to toggle the autohide property of a panel, so you can bind for example a keyboard shortcut to quickly show and hide a panel. | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | |||
+ | test -z " | ||
+ | test ! -z "`echo $1 | sed s/ | ||
+ | |||
+ | CHANNEL=xfce4-panel | ||
+ | PANELID=$1 | ||
+ | PROP=/ | ||
+ | |||
+ | if `xfconf-query -c $CHANNEL -p $PROP >/ | ||
+ | xfconf-query -c $CHANNEL -T -p $PROP | ||
+ | else | ||
+ | xfconf-query -c $CHANNEL -n -p $PROP -t bool -s false | ||
+ | fi | ||
+ | </ |