xfce4 任务栏和面板:开启 / 隐藏 (**)

Ubuntu 自定义、快捷键、显示 /关闭:官方默认的左侧 dock 菜单,Top bar (**)gnome-shell-extension-manager  https://blog.csdn.net/ken2232/article/details/137141689

通用原理:

  • 使用命令行的方式来取代 gui 方式进行设置。命令行方式,便于生成 快捷键。
  • 有些设置,只有命令行;甚至需要用户自己安装扩展,以便获得所需的命令。
  • 简单时用命令行,复杂是用 shell 文件。
  • 有些发行版,可能默认就自带了 dock 隐藏之类的快捷键功能。选择合适的发行版和桌面,有时可以减少很多的麻烦。
  • 不同的发行版,不同的桌面,设置的命令和方法,又有所不同,麻烦。

Xfconf-query 官方手册 https://docs.xfce.org/xfce/xfconf/xfconf-query

  https://xfce.readthedocs.io/en/latest/xfce/faq/index.html?highlight=xfconf-query

  • 通过 xfconf-query ,使用命令行的方式来设置 pannel 的隐藏与否。
  • 命令行,便于生成 快捷键。而不是使用  gui 界面来

  https://askubuntu.com/questions/244466/can-i-unhide-the-panel-in-xfce-using-a-key-press-rather-than-using-mouse-cursor

More details on the xfconf-query command can be found in the Xfce documentation or from this thread in the Xfce forum.

Hide Xfce4 Panel on keyboard shortcut  https://forum.xfce.org/viewtopic.php?id=11220

xfce4任务栏和面板被隐藏了! 

按Alt.+F2打开运行程序,输入 xfce4-panel,就可以了

$ xfce4-panel -h
Usage:
  xfce4-panel [OPTION…] [ARGUMENTS...]

Help Options:
  -h, --help                         Show help options
  --help-all                         Show all help options
  --help-gtk                         Show GTK+ Options
  --help-sm-client                   Show session management options

Application Options:
  -p, --preferences=PANEL-NUMBER     Show the 'Panel Preferences' dialog
  -a, --add-items=PANEL-NUMBER       Show the 'Add New Items' dialog
  -s, --save                         Save the panel configuration
  --add=PLUGIN-NAME                  Add a new plugin to the panel
  -r, --restart                      Restart the running panel instance
  -q, --quit                         Quit the running panel instance
  -d, --disable-wm-check             Do not wait for a window manager on startup
  -V, --version                      Print version information and exit
  --display=DISPLAY

要点:

mxlinux xface 的设置步骤

1. 确定 xface 的版本号

~# xfce4-panel --version

不同的版本号,命令不一样:https://askubuntu.com/questions/244466/can-i-unhide-the-panel-in-xfce-using-a-key-press-rather-than-using-mouse-cursor

2. 获得当前发行版的命令设置参数: /panels/panel-1/autohide-behavior 

这里使用这个命令就可以了:

xfconf-query -c xfce4-panel -p /panels -l -v

输出信息:

~# xfconf-query -c xfce4-panel -p /panels -l -v
/panels                            <<UNSUPPORTED>>
/panels/panel-1/autohide-behavior  0
/panels/panel-1/background-rgba    <<UNSUPPORTED>>
/panels/panel-1/background-style   0
/panels/panel-1/disable-struts     false
/panels/panel-1/length             100
/panels/panel-1/mode               2
/panels/panel-1/nrows              1
/panels/panel-1/plugin-ids         <<UNSUPPORTED>>
/panels/panel-1/position           p=5;x=0;y=0
/panels/panel-1/position-locked    true
/panels/panel-1/size               35

下面这个命令,可以获得更多的信息:

xfconf-query -c xfce4-panel -lv

3. 确定完整的命令格式

The new values are:

  • 0 = Hide never
  • 1 = Hide Intelligently
  • 2 = Hide always 

xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior -s 0
xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior -s 1
xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior -s 2

与下面参考的区别:

mxlinux 21. 使用的是:panel-1

而参考:Commands for Xfce 4.12 through Xfce 4.14: 给出的是:panel-0

------

参考:Commands for Xfce 4.12 through Xfce 4.14:  https://askubuntu.com/questions/244466/can-i-unhide-the-panel-in-xfce-using-a-key-press-rather-than-using-mouse-cursor

Commands for Xfce 4.12 through Xfce 4.14:

The following commands are now used to set the auto-hide properties:

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 0
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 1
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 2

4. 设置快捷键

启用 panel 的命令:

xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior -s 0

自动隐藏 panel 的命令:

xfconf-query -c xfce4-panel -p /panels/panel-1/autohide-behavior -s 2
注意:

关闭 panel,在这里采用“自动隐藏”的好处:假如忘记了自己所设置的快捷键,则仍然可以正常使用 panel。

----------------------------------------------------------------

Can I unhide the panel in Xfce using a key press rather than using mouse cursor hover to reveal it?   https://askubuntu.com/questions/244466/can-i-unhide-the-panel-in-xfce-using-a-key-press-rather-than-using-mouse-cursor

Commands for Xfce 4.12 through Xfce 4.14:

The following commands are now used to set the auto-hide properties:

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 0
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 1
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 2

xfce keyboard shortcuts  https://defkey.com/xfce-shortcuts?filter=basic

1. 如何通过命令行的方式来设置上图中的菜单?

2. 使用自定义快捷键来运行上述的命令 ?

3. 问题是:魔改版的 xface 桌面,其命令行设置方法,可能与 xface 官方的默认命令不一样 ?

从命令行隐藏xfce4-panel  https://cloud.tencent.com/developer/ask/sof/102945015

我来这里也是这么想的。显然没有直接的命令,但是编写shell脚本非常简单

INFO=$(xwininfo -name xfce4-panel)
STATE=$(echo "$INFO" | grep "Map State:" | head -n1 | awk -F: '{print $2}' | xargs)
WID=$(echo "$INFO" | grep "Window id:" | head -n1 | awk -F: '{print $3}' | awk '{print $1}')
if test "$STATE" = "IsViewable"; then
  xdotool windowminimize "$WID"
else
  xdotool windowmap "$WID"
fi

  https://stackoverflow.com/questions/3752767

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值