Last active
December 10, 2018 11:53
-
-
Save hlev/4dc7dd83dc3c104769f999063b3bbe6b to your computer and use it in GitHub Desktop.
i3 config snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom app launcher | |
set $ides "IDEs [p]hpstorm [c]lion [i]ntellij" | |
bindsym $mod+i mode $ides | |
mode $ides { | |
bindsym p exec --no-startup-id "i3-msg 'workspace 2; exec /opt/jetbrains/phpstorm_latest/bin/phpstorm.sh; mode \\"default\\"'" | |
bindsym c exec --no-startup-id "i3-msg 'workspace 2; exec /opt/jetbrains/clion_latest/bin/clion.sh; mode \\"default\\"'" | |
bindsym i exec --no-startup-id "i3-msg 'workspace 2; exec /opt/jetbrains/intellij_latest/bin/idea.sh; mode \\"default\\"'" | |
bindsym Return mode "default" | |
bindsym Escape mode "default" | |
} | |
# Thinkpad mute/vol+-/micmute keys | |
#bindcode 198 exec --no-startup-id "pactl set-source-mute 1 toggle" | |
#bindcode 121 exec "pactl set-sink-mute 0 toggle" | |
#bindcode 122 exec "pactl set-sink-volume 0 -5%" | |
#bindcode 123 exec "pactl set-sink-volume 0 +5%" | |
bindsym XF86AudioMicMute exec --no-startup-id "pactl set-source-mute 1 toggle" | |
bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute @DEFAULT_SINK@ toggle" | |
bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume @DEFAULT_SINK@ -5%" | |
bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume @DEFAULT_SINK@ +5%" | |
# System ops menu | |
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown | |
mode "$mode_system" { | |
bindsym l exec --no-startup-id i3exit lock, mode "default" | |
bindsym e exec --no-startup-id i3exit logout, mode "default" | |
bindsym s exec --no-startup-id i3exit suspend, mode "default" | |
bindsym h exec --no-startup-id i3exit hibernate, mode "default" | |
bindsym r exec --no-startup-id i3exit reboot, mode "default" | |
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" | |
# back to normal: Enter or Escape | |
bindsym Return mode "default" | |
bindsym Escape mode "default" | |
} | |
bindsym $mod+Pause mode "$mode_system" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
lock() { | |
i3lock | |
} | |
case "$1" in | |
lock) | |
lock | |
;; | |
logout) | |
i3-msg exit | |
;; | |
suspend) | |
lock && systemctl suspend | |
;; | |
hibernate) | |
lock && systemctl hibernate | |
;; | |
reboot) | |
systemctl reboot | |
;; | |
shutdown) | |
systemctl poweroff | |
;; | |
*) | |
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" | |
exit 2 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://faq.i3wm.org/question/239/how-do-i-suspendlockscreen-and-logout.1.html for more lock/suspend options.