1

I am trying to bind some keys to shutdown the pc instead to write "shutdown now" in terminal.

I have this in my config file to i3:

bindsym $mod+Shift+d exec shutdown now

This piece of code is not working.

Isn't this supposed to write on terminal "shutdown now" when I press mod+shift+d?

Lukas
  • 49
  • 2
  • 10

1 Answers1

1

try

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

I use this mode

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"
wdog
  • 612
  • 6
  • 7
  • I know this is an old question but it would be nice if @Lukas could confirm if this works for him. For me the answer of @wdog works perfectly. `systemctl poweroff -i` is exactly what I need to execute with the i3's binding. – Ivanhercaz Sep 25 '19 at 11:13