【问题标题】:Key bind to shutdown pc键绑定到关机电脑
【发布时间】:2018-10-12 22:02:07
【问题描述】:

我正在尝试绑定一些键来关闭电脑,而不是在终端中写入“立即关闭”。

我在 i3 的配置文件中有这个:

bindsym $mod+Shift+d exec shutdown now

这段代码不起作用。

当我按 mod+shift+d 时,这不是应该在终端“立即关闭”上写吗?

【问题讨论】:

    标签: i3


    【解决方案1】:

    试试

    bindsym $mod+Shift+d exec systemctl poweroff -i

    我用这个模式

    set $mode_system System (l) lock, (e) logout, (r) reboot, (Shift+s) shutdown
    mode "$mode_system" {
        bindsym l exec --no-startup-id $Locker, mode "default"
        bindsym e exec --no-startup-id i3-msg exit, mode "default"        
        bindsym r exec --no-startup-id systemctl reboot, mode "default"
        bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
    
        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
    }
    
    bindsym $mod+y mode "$mode_system"
    

    【讨论】:

    • 我知道这是一个老问题,但如果@Lukas 能确认这是否适合他,那就太好了。对我来说,@wdog 的答案非常有效。 systemctl poweroff -i 正是我需要用 i3 的绑定来执行的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多