i3-nagbar 调用的 i3lock 在后台启动

i3-nagbar 调用的 i3lock 在后台启动

我正在尝试使用 i3⁻nagbar 命令设置锁定脚本。我当前的代码:

i3-nagbar -b "lock" "i3lock" -b "shutdown" "shutdown -h 0"

当关机按钮起作用时,锁定按钮只会闪烁 i3lock 屏幕,然后返回终端。有什么想法吗?

答案1

我不完全确定原因,但如果你使用-B而不是-b那么它可以正常工作。从手册页:

       -b, --button button action
           Create a button with text button. The action are the shell commands that will be executed by this button. Multiple buttons can be defined. Will launch the shell commands inside a terminal emulator, using i3-sensible-terminal.

       -B, --button-no-terminal button action
           Same as above, but will execute the shell commands directly, without launching a terminal emulator.

我有效的命令是:

bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit' -B 'Lock Screen' 'i3lock -c 000000'"

相关内容