Added config for i3 lockscreen

This commit is contained in:
Fabio Scotto di Santolo
2025-08-31 15:43:49 +02:00
parent 159d16d4bd
commit c8bf641ab3
4 changed files with 95 additions and 108 deletions

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env bash
# Compositor
picom --config ~/.config/picom/picom.conf &
# Polybar
~/.config/polybar/launch.sh
# Notifications
dunst &
# Wallpaper
feh --bg-scale ~/.config/i3/wallpaper.jpg &
# Audio
pipewire &
# pipewire-pulse &
# Clipboard manager
# xfce4-clipman &
# Screenshot tool
flameshot &
# GTK settings
xsettingsd &
# Lock screen auto
xautolock -time 5 -locker "i3lock-color -c 000000" -detectsleep &
# Network manager applet
nm-applet &
# Autotiling
i3-auto-layout --limit 2 &

View File

@@ -10,7 +10,6 @@
# #
# Import Catppuccin theme defined colors # Import Catppuccin theme defined colors
#include themes/catppuccin-mocha
set $rosewater #f5e0dc set $rosewater #f5e0dc
set $flamingo #f2cdcd set $flamingo #f2cdcd
set $pink #f5c2e7 set $pink #f5c2e7
@@ -81,6 +80,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 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 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 XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# bindsym XF86MonBrightnessUp exec --no-startup-id swayosd-client --brightness +5
# bindsym XF86MonBrightnessDown exec --no-startup-id swayosd-client --brightness -5
bindsym $mod+Mod1+l exec ~/.config/i3/scripts/lockscreen.sh
# use these keys for focus, movement, and resize directions when reaching for # use these keys for focus, movement, and resize directions when reaching for
# the arrows is not convenient # the arrows is not convenient
@@ -90,17 +92,14 @@ set $up k
set $right l set $right l
# use Mouse+Mod4 to drag floating windows to their wanted position # use Mouse+Mod4 to drag floating windows to their wanted position
floating_modifier Mod4 floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar, # 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. # or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar tiling_drag modifier titlebar
set $term 'kitty' set $term 'alacritty'
set $menu 'rofi -show drun'
set $browser 'firefox' set $browser 'firefox'
set $notification 'dunst'
set $filemanager 'yazi'
set $editor 'emacs' set $editor 'emacs'
# Windows configuration # Windows configuration
@@ -127,85 +126,82 @@ for_window [class="Mpv"] floating enable, resize set 960 540
# Workspaces # Workspaces
assign [class="Emacs"] 1 assign [class="Emacs"] 1
assign [class="Firefox"] 2 assign [class="Firefox"] 2 # FIXME: change class name
assign [class="Telegram"] 3 assign [class="Telegram"] 3
focus_follows_mouse no focus_follows_mouse no
# start a terminal # start a terminal
bindsym Mod4+Return exec $term bindsym $mod+Return exec $term
# kill focused window # kill focused window
bindsym Mod4+Shift+q kill bindsym $mod+Shift+q kill
# start dmenu (a program launcher) # start default menu application
bindsym Mod4+d exec --no-startup-id $menu bindsym $mod+d exec "rofi -show drun"
bindsym $mod+Shift+s exec "rofi -show ssh"
# A more modern dmenu replacement is rofi: bindsym $mod+Shift+w exec "rofi -show window"
# bindsym Mod4+d exec "rofi -modi drun,run -show drun" bindsym $mod+Shift+f exec "rofi -show filebrowser"
# 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.
# bindsym Mod4+d exec --no-startup-id i3-dmenu-desktop
bindsym $mod+Shift+b exec $browser bindsym $mod+Shift+b exec $browser
bindsym Print exec flameshot gui
# bindsym $mod+Shift+v exec xfce4-clipman-history # bindsym $mod+Shift+v exec xfce4-clipman-history
bindsym $mod+Shift+f exec $filemanager
# change focus # change focus
bindsym Mod4+$left focus left bindsym $mod+$left focus left
bindsym Mod4+$down focus down bindsym $mod+$down focus down
bindsym Mod4+$up focus up bindsym $mod+$up focus up
bindsym Mod4+$right focus right bindsym $mod+$right focus right
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym Mod4+Left focus left bindsym $mod+Left focus left
bindsym Mod4+Down focus down bindsym $mod+Down focus down
bindsym Mod4+Up focus up bindsym $mod+Up focus up
bindsym Mod4+Right focus right bindsym $mod+Right focus right
# move focused window # move focused window
bindsym Mod4+Shift+$left move left bindsym $mod+Shift+$left move left
bindsym Mod4+Shift+$down move down bindsym $mod4+Shift+$down move down
bindsym Mod4+Shift+$up move up bindsym $mod+Shift+$up move up
bindsym Mod4+Shift+$right move right bindsym $mod+Shift+$right move right
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym Mod4+Shift+Left move left bindsym $mod+Shift+Left move left
bindsym Mod4+Shift+Down move down bindsym $mod+Shift+Down move down
bindsym Mod4+Shift+Up move up bindsym $mod+Shift+Up move up
bindsym Mod4+Shift+Right move right bindsym $mod+Shift+Right move right
# split in horizontal orientation # split in horizontal orientation
#bindsym Mod4+h split h # bindsym $mod+h split h
# split in vertical orientation # split in vertical orientation
bindsym Mod4+v split v bindsym $mod+v split v
# enter fullscreen mode for the focused container # enter fullscreen mode for the focused container
bindsym Mod4+f fullscreen toggle bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split) # change container layout (stacked, tabbed, toggle split)
bindsym Mod4+s layout stacking bindsym $mod+s layout stacking
bindsym Mod4+w layout tabbed bindsym $mod+w layout tabbed
bindsym Mod4+e layout toggle split bindsym $mod+e layout toggle split
# toggle tiling / floating # toggle tiling / floating
bindsym Mod4+Shift+space floating toggle bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows # change focus between tiling / floating windows
bindsym Mod4+space focus mode_toggle bindsym $mod+space focus mode_toggle
# focus the parent container # focus the parent container
bindsym Mod4+a focus parent bindsym $mod+a focus parent
# focus the child container # focus the child container
#bindsym Mod4+d focus child #bindsym Mod4+d focus child
# move the currently focused window to the scratchpad # move the currently focused window to the scratchpad
bindsym Mod4+Shift+minus move scratchpad bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window. # Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them. # If there are multiple scratchpad windows, this command cycles through them.
bindsym Mod4+minus scratchpad show bindsym $mod+minus scratchpad show
# Define names for default workspaces for which we configure key bindings later on. # Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places. # We use variables to avoid repeating the names in multiple places.
@@ -221,38 +217,38 @@ set $ws9 "9"
set $ws10 "10" set $ws10 "10"
# switch to workspace # switch to workspace
bindsym Mod4+1 workspace number $ws1 bindsym $mod+1 workspace number $ws1
bindsym Mod4+2 workspace number $ws2 bindsym $mod+2 workspace number $ws2
bindsym Mod4+3 workspace number $ws3 bindsym $mod+3 workspace number $ws3
bindsym Mod4+4 workspace number $ws4 bindsym $mod+4 workspace number $ws4
bindsym Mod4+5 workspace number $ws5 bindsym $mod+5 workspace number $ws5
bindsym Mod4+6 workspace number $ws6 bindsym $mod+6 workspace number $ws6
bindsym Mod4+7 workspace number $ws7 bindsym $mod+7 workspace number $ws7
bindsym Mod4+8 workspace number $ws8 bindsym $mod+8 workspace number $ws8
bindsym Mod4+9 workspace number $ws9 bindsym $mod+9 workspace number $ws9
bindsym Mod4+0 workspace number $ws10 bindsym $mod+0 workspace number $ws10
# move focused container to workspace # move focused container to workspace
bindsym Mod4+Shift+1 move container to workspace number $ws1 bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym Mod4+Shift+2 move container to workspace number $ws2 bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym Mod4+Shift+3 move container to workspace number $ws3 bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym Mod4+Shift+4 move container to workspace number $ws4 bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym Mod4+Shift+5 move container to workspace number $ws5 bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym Mod4+Shift+6 move container to workspace number $ws6 bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym Mod4+Shift+7 move container to workspace number $ws7 bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym Mod4+Shift+8 move container to workspace number $ws8 bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym Mod4+Shift+9 move container to workspace number $ws9 bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym Mod4+Shift+0 move container to workspace number $ws10 bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+period workspace next bindsym $mod+period workspace next
bindsym $mod+comma workspace prev bindsym $mod+comma workspace prev
# reload the configuration file # reload the configuration file
bindsym Mod4+Shift+c reload bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym Mod4+Shift+r restart bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session) # exit i3 (logs you out of your X session)
bindsym Mod4+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'"
# resize window (you can also use the mouse for that) # resize window (you can also use the mouse for that)
mode "resize" { mode "resize" {
@@ -276,16 +272,16 @@ mode "resize" {
# back to normal: Enter or Escape or Mod4+r # back to normal: Enter or Escape or Mod4+r
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
bindsym Mod4+r mode "default" bindsym $mod+r mode "default"
} }
bindsym Mod4+r mode "resize" bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status # Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available) # finds out, if available)
bar { # bar {
# status_command i3bar # status_command i3bar
} # }
####################################################################### #######################################################################
# automatically start i3-config-wizard to offer the user to create a # automatically start i3-config-wizard to offer the user to create a
@@ -297,5 +293,22 @@ bar {
# #
# Please remove the following exec line: # Please remove the following exec line:
####################################################################### #######################################################################
exec i3-config-wizard # exec i3-config-wizard
### Apply wallpaper
exec feh --bg-scale ~/.config/i3/wallpaper.jpg
### Run status bar
exec ~/.config/polybar/launch.sh
### Run in background X11 compositor
exec picom --config ~/.config/picom/picom.conf
### Run in background notification daemon
exec $notification
### Enable autolock
exec xautolock -time 5 -locker ~/.config/i3/scripts/lockscreen.sh -detectsleep
### Screenshot tool
exec flameshot

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

View File

@@ -0,0 +1,9 @@
#/usr/bin/env bash
BACKGROUND="${XDG_CONFIG_HOME:-${HOME}/.config}/i3/lockscreen.jpg"
i3lock --image="${BACKGROUND}" \
--color=000000 \
--max \
--ignore-empty-password \
--show-failed-attempts \
--clock