diff options
Diffstat (limited to 'i3/.config')
| -rw-r--r-- | i3/.config/i3/config | 47 | ||||
| -rwxr-xr-x | i3/.config/i3/scripts/power_timer.sh | 19 |
2 files changed, 60 insertions, 6 deletions
diff --git a/i3/.config/i3/config b/i3/.config/i3/config index d19c3d3..6d1ded8 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -21,22 +21,25 @@ font pango:Hasklug Nerd Font Mono 12 # Start XDG autostart .desktop files using dex. See also # https://wiki.archlinux.org/index.php/XDG_Autostart -exec --no-startup-id dex --autostart --environment i3 +#exec --no-startup-id dex --autostart --environment i3 exec --no-startup-id pulseaudio --start & -exec_always --no-startup-id feh --bg-scale ~/.config/background/bg1.jpg +exec --no-startup-id /usr/bin/openrazer-daemon +exec --no-startup-id brightnessctl set 40% +exec_always --no-startup-id feh --bg-scale ~/.config/backgrounds/bg3.jpg exec_always --no-startup-id ~/.config/polybar/launch.sh -exec_always --no-startup-id "picom --config ~/.config/picom/picom.conf" +#exec_always --no-startup-id "picom --config ~/.config/picom/picom.conf" # The combination of xss-lock, nm-applet and pactl is a popular choice, so # they are included here as an example. Modify as you see fit. # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork +exec --no-startup-id xss-lock -- physlock -m -d +exec --no-startup-id ~/.config/i3/scripts/power_timer.sh # NetworkManager is the most popular way to manage wireless networks on Linux, # and nm-applet is a desktop environment-independent system tray GUI for it. -exec --no-startup-id nm-applet +#exec --no-startup-id nm-applet # Autofocus on hover, also when switching workspaces focus_follows_mouse yes @@ -102,6 +105,9 @@ bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s +5% +bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 5%- + # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -217,7 +223,36 @@ bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart # exit i3 (logs you out of your X session) -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'" +#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'" + + + + +# Define the menu labels +set $sysmenu System: (l)ock, (e)xit i3, (s)uspend, (r)eboot, (Shift+s)hutdown + +mode "$sysmenu" { + # Lock the screen + bindsym l exec --no-startup-id physlock -p "Authentication required" -m -d, mode "default" + + # THE CHOICE YOU WANTED: Just exit i3 (Logout) + bindsym e exec --no-startup-id i3-msg exit, mode "default" + + # Power states (using elogind) + bindsym s exec --no-startup-id loginctl suspend, mode "default" + bindsym r exec --no-startup-id loginctl reboot, mode "default" + bindsym Shift+s exec --no-startup-id loginctl poweroff, mode "default" + + # Return to default mode (Cancel) + bindsym Return mode "default" + bindsym Escape mode "default" +} + +# Bind it to a key - replacing the default exit behavior +bindsym $mod+Shift+e mode "$sysmenu" + + + # resize window (you can also use the mouse for that) mode "resize" { diff --git a/i3/.config/i3/scripts/power_timer.sh b/i3/.config/i3/scripts/power_timer.sh new file mode 100755 index 0000000..bb1166a --- /dev/null +++ b/i3/.config/i3/scripts/power_timer.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Define your timeouts (in seconds) +AC_LOCK=600 # 10 minutes on AC +AC_DPMS=610 + +BATT_LOCK=120 # 2 minutes on Battery +BATT_DPMS=130 + +# Check if AC adapter is online +AC_ONLINE= $(cat /sys/class/power_supply/A*/online 2>/dev/null) + +if [ "$AC_ONLINE" = "1" ]; then + xset s $AC_LOCK + xset dpms $AC_DPMS $AC_DPMS $AC_DPMS +else + xset s $BATT_LOCK + xset dpms $BATT_DPMS $BATT_DPMS $BATT_DPMS +fi |
