Skip to content

Commit f35b252

Browse files
committed
Work config
1 parent e953bb9 commit f35b252

13 files changed

Lines changed: 541 additions & 114 deletions

File tree

2

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
INSTANCE="${BLOCK_INSTANCE:-instance}"
4+
STEP="${step:-5}" # use "step" set in i3blocks.conf, with 5 as default
5+
6+
echo 1 $BLOCK_BUTTON
7+
echo 1 $BLOCK_BUTTON
8+
9+
# First round the old volume down to the next "$STEP"
10+
INSTANCE=$(pacmd info | grep Default\ sink | grep -oE '[^ ]+$')
11+
INSTANCE_NUM=$(pactl list short | grep "${INSTANCE}\s" | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,')
12+
13+
# Round to nearest ${STEP}
14+
volume=$(pactl list sinks | perl -000ne "if(/#$INSTANCE_NUM\s/)"'{/(\d*)%/; print "$1\n"}')
15+
volume=$(echo "$volume/$STEP*$STEP" | bc)
16+
pactl set-sink-volume ${INSTANCE} $volume%
17+
18+
# Process the "mouse event"
19+
# scroll up
20+
if [[ "${BLOCK_BUTTON}" -eq 4 ]]; then
21+
pactl set-sink-volume ${INSTANCE} +$STEP%
22+
pactl set-sink-mute ${INSTANCE} off
23+
24+
# right click
25+
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
26+
pactl set-sink-mute ${INSTANCE} toggle
27+
28+
# scroll down
29+
elif [[ "${BLOCK_BUTTON}" -eq 5 ]]; then
30+
pactl set-sink-volume ${INSTANCE} -$STEP%
31+
pactl set-sink-mute ${INSTANCE} off
32+
fi
33+
34+
# Recalculate the mute status and volume
35+
status=$(pactl list sinks | perl -000ne "if(/#$INSTANCE_NUM\s/)"'{/Mute: (no|yes)/; print "$1\n"}')
36+
volume=$(pactl list sinks | perl -000ne "if(/#$INSTANCE_NUM\s/)"'{/(\d*)%/; print "$1\n"}')
37+
38+
RED=$( xrdb -query | grep ^\*color1: | cut -f 2)
39+
WHITE=$( xrdb -query | grep ^\*color15: | cut -f 2)
40+
41+
# print the status text
42+
if [[ "${status}" == "no" ]]; then
43+
if [[ "${volume}" == "0" ]]; then
44+
echo "${volume}%"
45+
echo "${volume}%"
46+
elif [[ "${volume}" -lt 70 ]]; then
47+
echo "${volume}%"
48+
echo "${volume}%"
49+
else
50+
echo "${volume}%"
51+
echo "${volume}%"
52+
fi
53+
echo $WHITE
54+
else
55+
echo " MUTE"
56+
echo " MUTE"
57+
echo $RED
58+
fi

i3_gen/i3.config/config.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ client.urgent $bright $bright $dark $bright $bright
231231
# Enable transparent terminal
232232
# TODO: enable with proper config: see home desktop
233233
exec_always --no-startup-id "picom --config $CONFIG/compton.conf -b"
234-
exec_always --no-startup-id "conky"
234+
exec --no-startup-id "conky"
235235

236236
exec_always --no-startup-id "flameshot"
237237

i3_gen/i3.config/machine_specific/wessel.huntandhackett.com

Lines changed: 25 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,13 @@
1313
set $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

7824
set $SC1 {{$SC1}}
7925
set $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'
191138
exec --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
201149
for_window [instance="^crx_cifhbcnohmdccbgoicgdjpfamggdegmo$"] move to workspace $WS015
202150

203151
for_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
223171
no_focus [window_role="pop-up"]
224172
for_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"
233187
exec --no-startup-id "spotify"
234188
exec --no-startup-id "pavucontrol"
235189
# exec --no-startup-id "teams"
@@ -259,6 +213,7 @@ exec --no-startup-id "python3 ~/bin/defender-alert.py"
259213
exec_always --no-startup-id "xset mouse 2 0"
260214
exec_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"
267222
bindsym $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

i3_gen/i3blocks.config/i3blocks.conf.template

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ signal=10
115115
[wifi]
116116
interval=5
117117

118-
[laundry]
119-
command=laundry
120-
interval=60
118+
# [laundry]
119+
# command=laundry
120+
# interval=60
121121

122122
[battery]
123123
interval=1
@@ -128,17 +128,17 @@ interval=1
128128
# [cpu_usage]
129129
# interval=1
130130

131-
[mgit]
132-
interval=30
131+
# [mgit]
132+
# interval=30
133133

134134
[gh]
135135
interval=2
136136

137137
# [do]
138138
# interval=2
139139

140-
[cloudbuild]
141-
interval=10
140+
# [cloudbuild]
141+
# interval=10
142142

143143
[chess]
144144
interval=10

0 commit comments

Comments
 (0)