dotfiles/.config/i3/config
2023-12-13 18:22:53 +11:00

324 lines
12 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
#set $term xfce4-terminal
set $term alacritty
set $termalt urxvt
set $web firefox
set $file ranger
set $lock slock
set $code codium
set $guieditor geany
set $calc /home/ben/.local/bin/bc-launcher
set $music /home/ben/.local/bin/ncmpcpp-launcher
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# 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
# network manager applet: manage wifi, ethernet and vpns
exec --no-startup-id nm-applet
# bluetooth manager applet: manage bluetooth pairing and connections
#exec --no-startup-id blueman-applet
# udiskie: manage usb storage devices
exec --no-startup-id udiskie -a -n -t
# dunst: a notification daemon
exec --no-startup-id dunst
# Use pactl to adjust volume in PulseAudio.
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
bindsym $mod+greater exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym $mod+less exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
# backlight brightness
bindsym XF86MonBrightnessDown exec brightnessctl set 5%- # decrease screen brightness
bindsym XF86MonBrightnessUp exec brightnessctl set +5% # increase screen brightness
bindsym $mod+F8 exec brightnessctl set 5-% # decrease screen brightness
bindsym $mod+F9 exec brightnessctl set +5% # increase screen brightness
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec $termalt
# start a web browser
bindsym $mod+F1 exec $web
# start a file manager
bindsym $mod+F2 exec $file
# start an ide
bindsym $mod+F3 exec $code
# start a gui notepad
bindsym $mod+F4 exec $guieditor
# kill focused window
bindsym $mod+Shift+q kill
# start rofi in drun mode (a program launcher)
bindsym $mod+d exec --no-startup-id "rofi -show drun -font \\"DejaVu 9\\" -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
#bindsym $mod+shift+d exec selected=$(ls ~/rdp/ntschools/|rofi -dmenu -p "Run: ")&&zsh ~/rdp/ntschools/$selected
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split v ;; exec $term
# split in vertical orientation
bindsym $mod+v split h ;; exec $term
# 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+Shift+a focus child
# calculator scratchpad
bindsym $mod+c [title="calc-launcher"] scratchpad show; [title="calc-launcher"] move position center
for_window [title="calc-launcher"] floating enable
for_window [title="calc-launcher"] resize set 800 600
for_window [title="calc-launcher"] move scratchpad
for_window [title="calc-launcher"] border pixel 5
#exec --no-startup-id $term -T "calc-launcher" -e "$calc"
exec --no-startup-id $term -t "calc-launcher" -e "$calc"
# dropdown scratchpad
bindsym $mod+x [title="dropdown"] scratchpad show; [title="dropdown"] move position center
for_window [title="dropdown"] floating enable
for_window [title="dropdown"] resize set 1280 800
for_window [title="dropdown"] move scratchpad
for_window [title="dropdown"] border pixel 5
#exec --no-startup-id $term -T "dropdown"
exec --no-startup-id $term -t "dropdown"
# music scratchpad
bindsym $mod+m [title="music-launcher"] scratchpad show; [title="music-launcher"] move position center
for_window [title="music-launcher"] floating enable
for_window [title="music-launcher"] resize set 800 600
for_window [title="music-launcher"] move scratchpad
for_window [title="music-launcher"] border pixel 5
#exec --no-startup-id $term -T "music-launcher" -e "$music"
exec --no-startup-id $term -t "music-launcher" -e "$music"
# f5vpn scratchpad
bindsym $mod+F10 [title="F5 VPN"] scratchpad show; [title="F5 VPN"] move position center
for_window [title="F5 VPN"] floating enable
for_window [title="F5 VPN"] resize set 800 600
for_window [title="F5 VPN"] move scratchpad
for_window [title="F5 VPN"] border pixel 5
# restore scratchpads
#bindsym $mod+F11 exec --no-startup-id $term -T "music-launcher" -e "$music"
bindsym $mod+F11 exec --no-startup-id $term -t "music-launcher" -e "$music"
#bindsym $mod+F12 exec --no-startup-id $term -T "calc-launcher" -e "$calc"
bindsym $mod+F12 exec --no-startup-id $term -t "calc-launcher" -e "$calc"
# mpd/mpc commands
bindsym $mod+p exec mpc --host $HOME/.config/mpd/socket toggle
# 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: shell"
set $ws2 "2: web"
set $ws3 "3: code"
set $ws4 "4: lab"
set $ws5 "5: games"
set $ws6 "6: rdp"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2; layout tabbed
bindsym $mod+3 workspace $ws3; layout tabbed
bindsym $mod+4 workspace $ws4; layout tabbed
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# move focused workspace between monitors
bindsym $mod+Ctrl+greater move workspace to output right
bindsym $mod+Ctrl+less move workspace to output left
# print screen
bindsym --release Print exec "spectacle"
bindsym --release $mod+Print exec "maim -s $HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
bindsym --release $mod+Shift+Print exec "maim -s | xclip -selection clipboard -t image/png"
bindsym --release $mod+Shift+s exec "maim -s | xclip -selection clipboard -t image/png"
bindsym --release $mod+Alt+Print exec "maim $HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"
#bindsym --release $mod+Alt+Print exec "maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png"
# lock screen
#bindsym $mod+l --release exec $lock
bindsym $mod+l --release exec betterlockscreen -l dim
# 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'"
# for_windows settings
for_window [class="urxvt"] border pixel 5
for_window [title="Mozilla Firefox"] move container to workspace $ws2
for_window [title="Chromium"] move container to workspace $ws2
for_window [class="VSCodium"] move container to workspace $ws3
for_window [title="Visual Studio Code"] move container to workspace $ws3
for_window [title="Mozilla Thunderbird"] move container to workspace $ws4
for_window [class="xfreerdp"] floating disable move container to workspace $ws6
for_window [class="Steam"] floating disable move container to workspace $ws5
for_window [title="Picture-in-Picture"] sticky enable
for_window [title="noVNC"] sticky enable floating enable
for_window [title="Proxmox Console"] sticky enable floating enable
for_window [title="feh"] sticky enable floating enable
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right 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"
# monitor-mode settings
mode "monitor-mode" {
# external-only (1), laptop-only (2) or both (3)
bindsym 1 exec ~/.local/bin/screen-external.sh
bindsym 2 exec ~/.local/bin/screen-laptop.sh
bindsym 3 exec ~/.local/bin/screen-dual.sh
bindsym 4 exec ~/.local/bin/screen-dock.sh
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+t mode "default"
}
bindsym $mod+t mode "monitor-mode"
# class border bground text indicator child_border
client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4
client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A
client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36
client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555
client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36
client.background #F8F8F2
#exec_always --no-startup-id $HOME/.config/polybar/start
bar {
status_command i3status
colors {
background #282A36
statusline #F8F8F2
separator #44475A
focused_workspace #44475A #44475A #F8F8F2
active_workspace #282A36 #44475A #F8F8F2
inactive_workspace #282A36 #282A36 #BFBFBF
urgent_workspace #FF5555 #FF5555 #F8F8F2
binding_mode #FF5555 #FF5555 #F8F8F2
}
}