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
zh-cn:tips [2012/04/28 17:16] – [Solution 1] haobugzh-cn:tips [2026/10/04 18:03] (current) – Add deprecation banner epetriglia
Line 1: Line 1:
 ====== 提示与技巧 ====== ====== 提示与技巧 ======
 +
 +<note warning>We are deprecating the localised wiki.xfce.org pages in favour of the official documentation, which is always kept up to date. This page will be deleted on 1 November 2026. A copy will be preserved on archive.org for historical purposes.</note>
  
 此页面包含了 Xfce 桌面环境的多种技巧。 此页面包含了 Xfce 桌面环境的多种技巧。
Line 138: Line 140:
  
 如果你想在你按下电源按钮时显示注销菜单,并且你的机器支持 ACPI,那就按下面的步骤做吧: 如果你想在你按下电源按钮时显示注销菜单,并且你的机器支持 ACPI,那就按下面的步骤做吧:
-========================================================================+
 ==== 解决方案 1 ==== ==== 解决方案 1 ====
    * ''/etc/acpi/events/powerbtn''    * ''/etc/acpi/events/powerbtn''
Line 148: Line 150:
 # 你也可以用 %e 这个占位符来把整个内核事件消息传给你指定的程序。 # 你也可以用 %e 这个占位符来把整个内核事件消息传给你指定的程序。
  
-# 我们需要 "button power.*" 和 "button/power.*" 作出反应,+# 我们需要对 "button power.*" 和 "button/power.*" 都作出反应,
 # 因为内核做了改动。 # 因为内核做了改动。
  
Line 193: Line 195:
 chmod +x /usr/local/sbin/xfce4-user-session-shutdown.sh /usr/local/sbin/xfce4-shutdown-as-user.sh chmod +x /usr/local/sbin/xfce4-user-session-shutdown.sh /usr/local/sbin/xfce4-shutdown-as-user.sh
 </code> </code>
-==== Solution 2 ==== +==== 解决方案 2 ==== 
-   * Open Settings Manager (or by command : xfce4-settings-manager ) +   * 打开“设置管理器”(或者用命令:xfce4-settings-manager) 
-   * Open Power Manager settings +   * 打开“电源管理器” 
-   * In General : set //When power button is pressed// to //Ask// +   * 一般设置:设置//按下电源按钮时//为//询问// 
-   * Close Power Manager settings +   * 关闭“电源管理器” 
-   * In the file **/etc/acpi/events/power_button** , change the //action// field to ///bin/true// :+   * 如果您安装有 ACPI 脚本,从 **/​etc/​acpi/​events/​** 停用或更新电源按钮脚本, 修改  //action// 字段的值为 ///bin/true//:
 <file> <file>
 event=button/power.* event=button/power.*
Line 210: Line 212:
  
 使用 '#' 作为在 xfrun4 中打开一个用户手册页的快捷方式。例如,#man 使用 '#' 作为在 xfrun4 中打开一个用户手册页的快捷方式。例如,#man
 +
 +===== 使用 xfrun4/应用程序查找器 做数学运算 =====
 +  * 能干嘛: 在xfrun4/应用程序查找器 中,输入简单的数学运算式子,比如  5+5 或 (5+5)/3 或 .5*10, 运算结果将显示在桌面通知中.
 +  * 需要有此命令: 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>