i3: Save terminal related stuff in variables

This commit is contained in:
2025-05-15 16:07:12 +02:00
parent f202f987c5
commit 87ecc40627

View File

@@ -12,6 +12,11 @@ default_border pixel 1
hide_edge_borders smart
set $TERMINAL st
set $TERM_CLASS st-256color
set $TERM_DIR_FLAG -d
set $TERM_TITLE_FLAG -t
set $TERM_TRANSPARENCY_FLAG -A
set $TERM_CMD_FLAG -e
# Focus should not follow mouse
# focus_follows_mouse no
@@ -29,7 +34,7 @@ exec_always --no-startup-id ~/.config/i3/monitor-setup.sh &
# Keybindins ###################################################################
# Terminal
bindsym $mod+Return exec $TERMINAL -d "$(xcwd)"
bindsym $mod+Return exec $TERMINAL $TERM_DIR_FLAG "$(xcwd)"
bindsym $mod+Shift+Return exec $TERMINAL
# Program launcher
@@ -201,7 +206,7 @@ bindsym $mod+Shift+m move scratchpad
bindsym $mod+Shift+o scratchpad show
# scratchpad-terminal
for_window [class="^$TERMINAL-256color$" title="^scratchpad-terminal$"] \
for_window [class="^$TERM_CLASS$" title="^scratchpad-terminal$"] \
move scratchpad, \
scratchpad show, \
sticky enable, \
@@ -210,11 +215,11 @@ for_window [class="^$TERMINAL-256color$" title="^scratchpad-terminal$"] \
move position center
# Toggle the scratchpad-terminal or create a new one if none exists.
bindsym $mod+comma exec \
i3-msg '[class="^$TERMINAL-256color$" title="^scratchpad-terminal$"] \
i3-msg '[class="^$TERM_CLASS$" title="^scratchpad-terminal$"] \
scratchpad show' \
|| $TERMINAL -A 0.45 \
-d "$(xcwd)" \
-t scratchpad-terminal
|| $TERMINAL $TERM_TRANSPARENCY_FLAG 0.45 \
$TERM_DIR_FLAG "$(xcwd)" \
$TERM_TITLE_FLAG scratchpad-terminal
for_window [class="^TelegramDesktop$"] \
move scratchpad, \
@@ -237,13 +242,13 @@ bindsym $mod+Shift+b exec \
i3-msg '[class="^Bitwarden$"] scratchpad show' \
|| bitwarden-desktop
for_window [class="^$TERMINAL-256color$" title="^polybar-datetime-calendar$"] \
for_window [class="^$TERM_CLASS$" title="^polybar-datetime-calendar$"] \
floating enable, \
border pixel 3, \
resize set 378 300, \
move position 1411 32
for_window [class="^$TERMINAL-256color$" title="^polybar-wlan$"] \
for_window [class="^$TERM_CLASS$" title="^polybar-wlan$"] \
floating enable, \
border pixel 3, \
resize set 1125 750, \
@@ -259,12 +264,12 @@ bindsym --release Shift+Print exec cd ~/media/pics/screens/ && scrot -s -f
bindsym $mod+z exec ~/.local/bin/zoom-links
# Monitor selection with fzf
for_window [class="^$TERMINAL-256color$" title="^fzf-monitor-setup$"] \
for_window [class="^$TERM_CLASS$" title="^fzf-monitor-setup$"] \
floating enable, \
border pixel 3, \
resize set 378 300, \
move position 1 32
bindsym $mod+m exec \
pkill -f fzf-monitor-setup -O 1 \
|| $TERMINAL -t fzf-monitor-setup -e \
|| $TERMINAL $TERM_TITLE_FLAG fzf-monitor-setup $TERM_CMD_FLAG \
sh -c "~/.local/bin/monitor-setup && ~/.config/polybar/launch.sh"