Skip to content

Instantly share code, notes, and snippets.

@SaBenBurra
Last active February 25, 2024 14:03
Show Gist options
  • Save SaBenBurra/415ffe319acc422878a9dd840a65dc56 to your computer and use it in GitHub Desktop.
Save SaBenBurra/415ffe319acc422878a9dd840a65dc56 to your computer and use it in GitHub Desktop.
my i3wm config file
set $mod Mod1
#default_border none font pango:monospace 8
exec --no-startup-id dex-autostart --autostart --environment i3
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
exec --no-startup-id nm-applet
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
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
floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Shift+q kill
#ROFI
bindsym $mod+d exec --no-startup-id rofi -show drun
# change focus on fullscreen
bindsym $mod+Super+h fullscreen toggle, focus left, fullscreen toggle
bindsym $mod+Super+j fullscreen toggle, focus down, fullscreen toggle
bindsym $mod+Super+k fullscreen toggle, focus up, fullscreen toggle
bindsym $mod+Super+l fullscreen toggle, focus right, fullscreen toggle
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+scedilla move right
# split in horizontal orientation
bindsym $mod+b split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $ws_anytype "99"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+Tab workspace number $ws_anytype
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
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'"
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
bindsym button1 nop
status_command i3status
position bottom
bindsym --release button3 exec --no-startup-id import /tmp/latest-screenshot.png
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
font pango:DejaVu Sans Mono 10
}
## Shutdown ---
mode "exit: [l]ogout, [r]eboot, [s]hutdown, [p]ause" {
bindsym l exec i3-msg exit
bindsym r exec /sbin/reboot
bindsym s exec /sbin/shutdown now
bindsym p exec systemctl suspend
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+x mode "exit: [l]ogout, [r]eboot, [s]hutdown, [p]ause"
exec --no-startup-id /usr/lib/gsd-xsettings
## Popup windows set as floating window
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_role="Organizer"] floating enable
for_window [window_role="About"] floating enable
for_window [window_role="toolbox"] floating enable
for_window [window_role="page-info"] floating enable
for_window [window_role="webconsole"] floating enable
## Window specific sizes and positions
for_window [instance="blueman-manager"] floating enable, resize set 640 480, move absolute position center
for_window [instance = "pavucontrol"] floating enable, resize set 600 400, move absolute position 250 ppt 250 ppt
for_window [instance = "gnome-calculator"] floating enable, resize set 300 100, move absolute position 250 ppt 250 ppt
for_window [instance="jetbrains-studio"] floating enable, resize set 300 100, move absolute position center
for_window [instance="xpad"] floating enable, resize set 300 100, move absolute position center
for_window [instance="xdm-app"] floating enable, resize set 300 400, move absolute position center
for_window [instance="xdman-Main"] floating enable, move absolute position right
for_window [title="Add" instance="anki"] floating enable, resize set 600 700, move absolute position center
for_window [title="Browse" instance="anki"] floating enable, resize set 1200 700, move absolute position center
for_window [title="Preferences" instance="anki"] floating enable, resize set 1200 700, move absolute position center
for_window [title="Statistics" instance="anki"] floating enable, resize set 800 1000, move absolute position center
for_window [title="Browse and Select a File" instance="display-im6.q16"] floating enable, resize set 400 500, move absolute position center
for_window [title="Confirm" instance="display-im6.q16"] floating enable, resize set 300 150, move absolute position center
for_window [title="Dialog" instance="display-im6.q16"] floating enable, resize set 300 150, move absolute position center
# App shortcuts
bindsym Mod4+b exec --no-startup-id pgrep -x blueman-manager >/dev/null && exit 1 || blueman-manager
bindsym Mod4+s exec --no-startup-id pgrep -x pavucontrol >/dev/null && exit 1 || pavucontrol
bindsym Mod4+v exec --no-startup-id pgrep -x volumeicon >/dev/null && pkill "volumeicon"|| volumeicon
## Screen lock
bindsym Control+Mod1+l exec "i3lock-fancy"
## Spotify control
bindsym Mod4+1 exec /home/burra/bin/spotify_control previous
bindsym Mod4+2 exec /home/burra/bin/spotify_control next
bindsym Mod4+3 exec /home/burra/bin/spotify_control playpause
## Media shortcuts
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
## Window resizing
bindsym $mod+Ctrl+Right resize shrink width 1 px or 1 ppt
bindsym $mod+Ctrl+Up resize grow height 1 px or 1 ppt
bindsym $mod+Ctrl+Down resize shrink height 1 px or 1 ppt
bindsym $mod+Ctrl+Left resize grow width 1 px or 1 ppt
## Screenshots
bindsym Print exec --no-startup-id maim "/home/$USER/Pictures/$(date).png"
bindsym $mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) "/home/$USER/Pictures/$(date).png"
bindsym Shift+Print exec --no-startup-id maim --select "/home/$USER/Pictures/$(date).png"
## Clipboard Sreenshots
bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/png
bindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
## Brightness
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 3 # increase screen brightness
bindsym XF86Mail exec --no-startup-id light -A 3 # increase screen brightness
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 3 # decrease screen brightness
bindsym XF86HomePage exec --no-startup-id light -U 3 # decrease screen brightness
## Window specific workspaces
for_window [class="discord"] move to workspace $ws5
for_window [class="anytype"] move to workspace $ws_anytype
bindsym $mod+Shift+w kill floating
## Startup Apps
exec --no-startup-id nitrogen --set-auto ~/Pictures/wallpapers/wallpaper.png
exec --no-startup-id volumeicon
exec --no-startup-id blueman-applet
exec --no-startup-id xpad
# exec --no-startup-id discord
exec --no-startup-id anytype
popup_during_fullscreen smart
exec --no-startup-id /home/$USER/.config/i3/startup.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment