1313set $BAR_SIZE 14
1414
1515# Get all screens
16- ; export SC_LAP=$( xrandr | grep " connected" | sed -n '1 p' | awk '{print $1;}')
17- ; export SC_M1=$( xrandr | grep " connected" | sed -n '2 p' | awk '{print $1;}')
18- ; export SC_M2=$( xrandr | grep " connected" | sed -n '3 p' | awk '{print $1;}')
19- ; export SC_M3=$( xrandr | grep " connected" | sed -n '4 p' | awk '{print $1;}')
20-
21- set $SC_LAP {{$SC_LAP}}
22- set $SC_M1 {{$SC_M1}}
23- set $SC_M2 {{$SC_M2}}
24- set $SC_M3 {{$SC_M3}}
25-
26- ; export SC_M1_X=$( xrandr --current | grep '+' | grep -v "connected" | sed -n '2 p' | awk '{print $1}' | cut -d 'x' -f1)
27- ; export SC_M2_X=$( xrandr --current | grep '+' | grep -v "connected" | sed -n '3 p' | awk '{print $1}' | cut -d 'x' -f1)
28- ; export SC_M3_X=$( xrandr --current | grep '+' | grep -v "connected" | sed -n '4 p' | awk '{print $1}' | cut -d 'x' -f1)
29-
30- set $SC_M1_X {{$SC_M1_X}}
31- set $SC_M2_X {{$SC_M2_X}}
32- set $SC_M3_X {{$SC_M3_X}}
33-
34- # Get unique IDs for monitors
35- # xrandr --prop | tr '\n' '\r' | sed 's/\r[0-9a-zA-Z-]* disconnected[^\r]*\(\r\t[^\r]*\)*//g;s/\(\r[0-9a-zA-Z-]*\) connected[^\r]*\r\tEDID: \(\(\r\t\t[0-9a-f]*\)*\)\(\r\s[^\r]*\)*/\1 \2/g;s/^Screen[^\r]*\r//;s/\r\t\t//g' | tr '\r' '\n'
36-
37- ; if [ -n "$SC_M3" ]; then # if at least 4 screens
38- ; # replace laptop with leftmost screen
39- exec_always --no-startup-id "xrandr --output {{$SC_LAP}} --off"
40- ; export SC1=$SC_M1
41- ; export SC2=$SC_M2
42- ; export SC3=$SC_M3
43- exec_always --no-startup-id "xrandr --output {{$SC1}} --auto --output {{$SC2}} --auto --right-of {{$SC1}} --primary --output {{$SC3}} --auto --right-of {{$SC2}}"
44- exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/5760/nature/*
45- ; elif [ -n "$SC_M2" ]; then # 3 screens
46- ; if [[ "$SC_M1_X" == "3440" && "$SC_M2_X" == "3440" ]]; then # Both external screens are wide
47- ; # replace laptop with leftmost screen
48- # exec_always --no-startup-id "xrandr --output {{$SC_LAP}} --off"
49- ; export SC1=$SC_M1
50- ; export SC2=$SC_M2
51- # exec_always --no-startup-id "xrandr --output {{$SC_LAP}} --off --output {{$SC1}} --auto --primary --output {{$SC2}} --auto --right-of {{$SC1}} "
52- ; # export SCTMP=$SC1
53- ; # export SC1=$SC2
54- ; # export SC2=$SCTMP
55- exec_always --no-startup-id "xrandr --output {{$SC_LAP}} --off --output {{$SC1}} --auto --primary --rotate left --output {{$SC2}} --auto --pos 1440x1000"
56- # exec_always --no-startup-id "xrandr --output {{$SC_LAP}} --auto --primary --output {{$SC1}} --off --output {{$SC2}} --off"
57- exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/4k/nature/*
58- ; else
59- ; export SC1=$SC_LAP
60- ; export SC2=$SC_M1
61- ; export SC3=$SC_M2
62- exec_always --no-startup-id "xrandr --output {{$SC1}} --auto --output {{$SC2}} --auto --right-of {{$SC1}} --primary --output {{$SC3}} --auto --right-of {{$SC2}}"
63- exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/5760/nature/*
64- ; fi
65- ; elif [ -n "$SC_M1" ]; then # 2 screens
66- ; export SC1=$SC_LAP
67- ; export SC2=$SC_M1
68- exec_always --no-startup-id "xrandr --output {{$SC1}} --auto --output {{$SC2}} --auto --right-of {{$SC1}} --primary "
69- exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/5760/nature/*
70- ; else
71- ; export SC1=$SC_LAP
72- exec_always --no-startup-id "xrandr --output {{$SC1}} --auto --primary"
73- exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/1080/nature/*
74- ; fi
75-
76- # xrandr --output {{$SC1}} --auto --output {{$SC2}} --off
16+ exec_always --no-startup-id "{{$($HOME/.config/i3/scripts/monitors.sh)}}"
17+ ; export SC1=$(cat /tmp/monitors/SC1)
18+ ; export SC2=$(cat /tmp/monitors/SC2)
19+ ; export SC3=$(cat /tmp/monitors/SC3)
20+ ; export WALLPAPER_SIZE=$(cat /tmp/monitors/wallpapers_size)
21+
22+ exec_always --no-startup-id feh --bg-scale --no-xinerama --randomize $WALLPAPERS/{{$WALLPAPER_SIZE}}/nature/*
7723
7824set $SC1 {{$SC1}}
7925set $SC2 {{$SC2}}
@@ -186,10 +132,12 @@ exec_always --no-startup-id xss-lock -- lock
186132
187133# Set layouts for monitors to assign programs to specific positions
188134# exec --no-startup-id i3-msg 'workspace $WS001; append_layout $LAYOUTS/chromium.json'
189- exec --no-startup-id i3-msg 'workspace $WS001; append_layout $LAYOUTS/brave.json'
135+ # exec --no-startup-id i3-msg 'workspace $WS001; append_layout $LAYOUTS/brave.json'
136+ exec --no-startup-id i3-msg 'workspace $WS001; append_layout $LAYOUTS/edge.json'
190137#exec --no-startup-id i3-msg 'workspace $WS002; append_layout $LAYOUTS/gnome-terminal.json'
191138exec --no-startup-id i3-msg 'workspace $WS011; append_layout $LAYOUTS/pavucontrol.json'
192139#exec --no-startup-id i3-msg 'workspace $WS014; append_layout $LAYOUTS/firefox.json'
140+ exec --no-startup-id i3-msg 'workspace $WS016; append_layout $LAYOUTS/1pass.json'
193141
194142# Set standard workspaces for programs
195143# small screen
@@ -201,8 +149,8 @@ for_window [title="^Microsoft\\ Teams.*$"] move to workspace $WS01
201149for_window [instance="^crx_cifhbcnohmdccbgoicgdjpfamggdegmo$"] move to workspace $WS015
202150
203151for_window [class="^Microsoft\ Teams.*$"] move to workspace $WS015
204- for_window [class="^KeePassXC$"] move to workspace $WS016
205- for_window [class="^1Password$"] move to workspace $WS016
152+ # for_window [class="^KeePassXC$"] move to workspace $WS016
153+ # for_window [class="^1Password$" floating] move to workspace $WS016
206154
207155
208156
@@ -223,13 +171,19 @@ for_window [class="^.*"] border pixel 5
223171no_focus [window_role="pop-up"]
224172for_window [title="^https://hangouts.google.com - Google Hangouts - Mozilla Firefox$"] floating disable
225173
226- bindsym $mod+c exec brave --profile-directory=Default
227- bindsym $mod+Shift+c exec brave --incognito --profile-directory=Default
228- bindsym $mod+x exec brave --profile-directory="Profile 1"
229- bindsym $mod+Shift+x exec brave --incognito --profile-directory="Profile 1"
174+ # bindsym $mod+c exec brave-browser --profile-directory=Default
175+ # bindsym $mod+Shift+c exec brave-browser --incognito --profile-directory=Default
176+ # bindsym $mod+x exec brave-browser --profile-directory="Profile 1"
177+ # bindsym $mod+Shift+x exec brave-browser --incognito --profile-directory="Profile 1"
178+
179+ bindsym $mod+c exec microsoft-edge
180+ bindsym $mod+Shift+c exec microsoft-edge --incognito
181+ bindsym $mod+x exec brave-browser --profile-directory="Profile 1"
182+ bindsym $mod+Shift+x exec brave-browser --incognito --profile-directory="Profile 1"
230183
231184# Start programs
232- exec --no-startup-id "brave"
185+ # exec --no-startup-id "brave-browser --profile-directory=Default"
186+ exec --no-startup-id "microsoft-edge"
233187exec --no-startup-id "spotify"
234188exec --no-startup-id "pavucontrol"
235189# exec --no-startup-id "teams"
@@ -259,6 +213,7 @@ exec --no-startup-id "python3 ~/bin/defender-alert.py"
259213exec_always --no-startup-id "xset mouse 2 0"
260214exec_always --no-startup-id "xset r rate 280 40"
261215
216+ exec --no-startup-id "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
262217
263218#Automatic back-and-forth when switching to the current workspace
264219# https://i3wm.org/docs/userguide.html#workspace_auto_back_and_forth
@@ -267,5 +222,5 @@ exec_always --no-startup-id "xset r rate 280 40"
267222bindsym $mod+n exec $SCRIPTS/wifi.sh
268223
269224# Open todo.md
270- bindsym $mod+o exec --no-startup-id "alacritty -e bash -c 'i3 floating toggle && nvim ~/todo.yaml'"
225+ bindsym $mod+o exec --no-startup-id "alacritty -e bash -c 'source ~/.profile && i3 floating toggle && nvim ~/todo.yaml'"
271226
0 commit comments