dotfiles/i3/config
Irrlicht 1c69d03b26 [i3] Include shortcuts.conf by default for computer dependant shortcuts
- Piston: configure keyboard media control via dbus
2025-06-10 18:26:57 +02:00

181 lines
5.9 KiB
Text

# i3 config file (v4)
# Modifier
set $mod Mod4
set $term alacritty
font pango:Adwaita Mono 16
# 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_always "setxkbmap -layout us,fr -variant ,ergol -option 'grp:win_space_toggle'"
# 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@ +5% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $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 set 2%+
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 2%-
include shortcuts.conf
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+Shift+q kill
# Lock screen
bindsym $mod+Shift+f exec loginctl lock-session
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id rofi -show drun
# Start emoji picker
bindsym $mod+i exec rofi -modi emoji -show emoji -emoji-mode copy
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
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+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right
# alternatively, you can use the cursor keys:
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 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
# workspace layout is stacking by default
workspace_layout tabbed
# Define workspace number. It defines their order.
set $ws-work-num 1
set $ws-web-num 4
set $ws-image-num 2
set $ws-game-num 3
set $ws-com-num 5
set $ws-tools-num 6
set $ws-music-num 7
set $ws-8 8
set $ws-9 9
set $ws-10 10
# switch to workspace
bindsym $mod+$ws-work-num workspace $ws-work-num
bindsym $mod+$ws-image-num workspace $ws-image-num
bindsym $mod+$ws-game-num workspace $ws-game-num
bindsym $mod+$ws-web-num workspace $ws-web-num
bindsym $mod+$ws-com-num workspace $ws-com-num
bindsym $mod+$ws-tools-num workspace $ws-tools-num
bindsym $mod+$ws-music-num workspace $ws-music-num
bindsym $mod+8 workspace $ws-8
bindsym $mod+9 workspace $ws-9
bindsym $mod+0 workspace $ws-10
# move focused container to workspace
bindsym $mod+Shift+$ws-work-num move container to workspace $ws-work-num
bindsym $mod+Shift+$ws-image-num move container to workspace $ws-image-num
bindsym $mod+Shift+$ws-game-num move container to workspace $ws-game-num
bindsym $mod+Shift+$ws-web-num move container to workspace $ws-web-num
bindsym $mod+Shift+$ws-com-num move container to workspace $ws-com-num
bindsym $mod+Shift+$ws-tools-num move container to workspace $ws-tools-num
bindsym $mod+Shift+$ws-music-num move container to workspace $ws-music-num
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# 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'"
bindsym $mod+r mode "resize"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Vim style key for resizing
bindsym h resize grow width 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink 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"
}
#########################
# Start-up applications #
# No bar defined, we use polybar. See ~/.config/polybar
exec_always --no-startup-id ~/.config/polybar/launch.sh
exec --no-startup-id ~/.feh-bg
exec --no-startup-id xss-lock -l --session=$XDG_SESSION_ID -- i3lock -n -i ~/pictures/backgrounds/desktop/lock.png
exec --no-startup-id nm-applet
exec --no-startup-id dunst
include autostart.conf
include layout.conf