Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
zh-cn:tips [2012/04/28 17:30] – [处理 ACPI 电源按钮事件,显示 Xfce 注销选项] haobugzh-cn:tips [2015/03/10 04:50] – [Do maths with xfrun4/appfinder] yjwork
Line 198: Line 198:
    * 一般设置:设置//按下电源按钮时//为//询问//    * 一般设置:设置//按下电源按钮时//为//询问//
    * 关闭“电源管理器”    * 关闭“电源管理器”
-   在文件 **/etc/acpi/events/power_button**修改  //action// 字段的值为 ///bin/true// +   如果您安装有 ACPI 脚本,从 **/etc/acpi/events/** 停用或更新电源按钮脚本, 修改  //action// 字段的值为 ///bin/true//:
 <file> <file>
 event=button/power.* event=button/power.*
Line 210: Line 210:
  
 使用 '#' 作为在 xfrun4 中打开一个用户手册页的快捷方式。例如,#man 使用 '#' 作为在 xfrun4 中打开一个用户手册页的快捷方式。例如,#man
 +
 +===== Do maths with xfrun4/appfinder =====
 +  * What you get: input simple mathematical expression, like 5+5 or (5+5)/3 or .5*10, in xfrun4/appfinder, and get the result as notification.
 +  * 要求: notify-send
 +  * 在您的家目录,保存此脚本为 bcme.sh :
 +
 +  #!/bin/sh
 +  
 +  precision=2        # number of digit for floating value
 +  notify_time=20000  # number of milisecond the notification show
 +  
 +  res=`echo "scale=$precision;$@" | bc`  
 +  notify-send -t $notify_time "$res" "=$@"
 +
 +  *在应用程序查找器添加自定义动作 :
 +    * 类型 : 正则表达式
 +    * 类型 : ^([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 "$1" && echo missing panel id  && exit 1
 +test ! -z "`echo $1 | sed s/[0-9]*//g`" && echo bad panel id  && exit 1
 +
 +CHANNEL=xfce4-panel
 +PANELID=$1
 +PROP=/panels/panel-$PANELID/autohide
 +
 +if `xfconf-query -c $CHANNEL -p $PROP >/dev/null 2>&1`; then
 +    xfconf-query -c $CHANNEL -T -p $PROP
 +else
 +    xfconf-query -c $CHANNEL -n -p $PROP -t bool -s false
 +fi
 +</code>