Skip to content

Commit d1a828e

Browse files
committed
update
1 parent ccf5477 commit d1a828e

24 files changed

Lines changed: 772 additions & 341 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
```bash
2+
git clone --recurse-submodules --depth 1 --shallow-submodules
3+
```
4+
15
# Files for Backing Up and Reproducing My NixOS System on WSL
6+
27
[![Build and Tag ISO](https://github.com/PandeCode/dotnix/actions/workflows/build_iso.yml/badge.svg)](https://github.com/PandeCode/dotnix/actions/workflows/build_iso.yml)
8+
39
> Very much a WIP
410
511
Building the iso fails locally so git commits beging with "build-iso" trigger and action that build the iso.

bin/_tool_riot

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,47 @@
11
#!/bin/sh
22

3-
data=$(slurp -f "%x %y %w %h")
3+
wm=$(echo "$XDG_CURRENT_DESKTOP $DESKTOP_SESSION $XDG_SESSION_DESKTOP" | tr '[:upper:]' '[:lower:]')
44

5-
X=$(echo "$data" | awk '{ print($1) }')
6-
Y=$(echo "$data" | awk '{ print($2) }')
7-
WIDTH=$(echo "$data" | awk '{ print($3) }')
8-
HEIGHT=$(echo "$data" | awk '{ print($4) }')
5+
if echo "$wm" | grep -q "hypr"; then
6+
# Hyprland branch
7+
data=$(slurp -f "%x %y %w %h")
98

10-
hyprctl dispatch setfloating
11-
hyprctl dispatch resizeactive exact "$WIDTH" "$HEIGHT"
12-
hyprctl dispatch moveactive exact "$X" "$Y"
9+
X=$(echo "$data" | awk '{ print($1) }')
10+
Y=$(echo "$data" | awk '{ print($2) }')
11+
WIDTH=$(echo "$data" | awk '{ print($3) }')
12+
HEIGHT=$(echo "$data" | awk '{ print($4) }')
13+
14+
hyprctl dispatch setfloating
15+
hyprctl dispatch resizeactive exact "$WIDTH" "$HEIGHT"
16+
hyprctl dispatch moveactive exact "$X" "$Y"
17+
18+
elif echo "$wm" | grep -q "i3"; then
19+
# i3 branch
20+
data=$(slop -b 3 -c 0.96,0.5,0.09 -t 0 -f "%x %y %w %h")
21+
22+
X=$(echo "$data" | awk '{ print($1) }')
23+
Y=$(echo "$data" | awk '{ print($2) }')
24+
WIDTH=$(echo "$data" | awk '{ print($3) }')
25+
HEIGHT=$(echo "$data" | awk '{ print($4) }')
26+
27+
i3-msg focus prev
28+
i3-msg floating enable
29+
i3-msg move window position "$X" "$Y"
30+
i3-msg resize set "$WIDTH" "$HEIGHT"
31+
32+
elif echo "$wm" | grep -q "sway"; then
33+
data=$(slurp -f "%x %y %w %h")
34+
35+
X=$(echo "$data" | awk '{ print($1) }')
36+
Y=$(echo "$data" | awk '{ print($2) }')
37+
WIDTH=$(echo "$data" | awk '{ print($3) }')
38+
HEIGHT=$(echo "$data" | awk '{ print($4) }')
39+
40+
swaymsg floating enable
41+
swaymsg move position "$X" "$Y"
42+
swaymsg resize set "$WIDTH" "$HEIGHT"
43+
44+
else
45+
echo "Unsupported or unknown window manager."
46+
exit 1
47+
fi

bin/ping.sh

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ RED=#ff5555
44
GREEN=#50fa7b
55
YELLOW=#f1fa8c
66
WHITE=#f8f8f2
7+
78
NO_NET="󰪎"
89
BEST_NET="󰀳"
910
OK_NET="󰖟"
1011
BAD_NET="󱂠"
12+
1113
PING_HOST=$ZELLIJ_PING_HOST
1214

1315
is_number() {
@@ -23,15 +25,14 @@ if [ -z "$ping_host" ]; then ping_host="9.9.9.9"; fi
2325

2426
ping_count=3
2527
ping_wait_time=255
26-
2728
ping_log_file="/tmp/ping.log"
2829
ping_result_file="/tmp/ping_result"
2930
ping_pid_file="/tmp/ping.pid"
3031

3132
ping_not_running() {
3233
local pid
33-
pid=$(cat $ping_pid_file)
34-
! ps -p "$pid" >/dev/null
34+
pid=$(cat $ping_pid_file 2>/dev/null)
35+
! ps -p "$pid" >/dev/null 2>&1
3536
}
3637

3738
read_cached_result() {
@@ -43,8 +44,7 @@ read_cached_result() {
4344
}
4445

4546
read_ping_result() {
46-
result=$(cut -sd / -f 5 $ping_log_file | cut -d . -f 1)
47-
47+
result=$(cut -sd / -f 5 $ping_log_file 2>/dev/null | cut -d . -f 1)
4848
if is_number "$result"; then
4949
echo "$result"
5050
else
@@ -64,7 +64,6 @@ execute_ping() {
6464
colorize_ping_value() {
6565
local ping=$1
6666
local result
67-
6867
if [ "$ping" -lt 1 ] || [ "$ping" -ge 1000 ]; then
6968
result=$RED
7069
elif [ "$ping" -lt 100 ]; then
@@ -74,14 +73,12 @@ colorize_ping_value() {
7473
elif [ "$ping" -lt 1000 ]; then
7574
result=$YELLOW
7675
fi
77-
7876
echo "$result"
7977
}
8078

8179
ping_icon() {
8280
local ping=$1
8381
local result
84-
8582
if [ "$ping" -lt 1 ] || [ "$ping" -ge 1000 ]; then
8683
result="$NO_NET"
8784
elif [ "$ping" -lt 100 ]; then
@@ -91,14 +88,12 @@ ping_icon() {
9188
elif [ "$ping" -lt 1000 ]; then
9289
result="$BAD_NET"
9390
fi
94-
9591
echo $result
9692
}
9793

9894
format_ping_value() {
9995
local value=$1
10096
local result
101-
10297
if [ "$value" -eq -1 ]; then
10398
result="N/A"
10499
elif [ "$value" -ge 1000 ]; then
@@ -108,7 +103,6 @@ format_ping_value() {
108103
else
109104
result=$(printf %3d "$value")
110105
fi
111-
112106
echo "$result"
113107
}
114108

@@ -120,29 +114,36 @@ addPadding() {
120114
fi
121115
}
122116

123-
icon=${1:no}
117+
# Parse command line arguments
118+
icon=${1:-no}
119+
color=${2:-yes}
124120

125121
main() {
126122
local ping_result
127-
128123
if ping_not_running; then
129124
ping_result=$(read_ping_result)
130125
update_cached_result "$ping_result"
131-
132126
execute_ping
133-
134127
else
135128
ping_result=$(read_cached_result)
136129
fi
137130

138131
ping_value=$ping_result
139132
ping_result="$(format_ping_value "$ping_result")"
140133

141-
if [[ "$icon" == "no" ]]; then
142-
echo -n "$(colorize_ping_value "$ping_value") ${ping_result}"
143-
else
144-
echo -n "$(colorize_ping_value "$ping_value") $(ping_icon "$ping_value") ${ping_result}"
134+
# Determine color prefix
135+
local color_prefix=""
136+
if [[ "$color" == "yes" ]]; then
137+
color_prefix="$(colorize_ping_value "$ping_value") "
138+
fi
139+
140+
# Determine icon
141+
local icon_part=""
142+
if [[ "$icon" == "yes" ]]; then
143+
icon_part="$(ping_icon "$ping_value") "
145144
fi
145+
146+
echo -n "${color_prefix}${icon_part}${ping_result}"
146147
}
147148

148149
main

bin/riot_i3.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

config/i3status-rs/config.toml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
[icons]
2+
icons = "awesome6"
3+
4+
# Current window title
5+
[[block]]
6+
block = "custom"
7+
command = "xtitle -s | cut -c1-50"
8+
interval = 1
9+
format = "$text"
10+
hide_when_empty = true
11+
12+
[[block]]
13+
block = "custom"
14+
command = "curl -s 'https://wttr.in?format=%c+%t+%h' 2>/dev/null || echo '🌡️ --'"
15+
interval = 1800
16+
format = " $text "
17+
18+
[[block]]
19+
block = "custom"
20+
json = true
21+
interval = 60
22+
command = '''
23+
PING=$(ping -c4 1.1.1.1 | tail -n1 | cut -d'/' -f5)
24+
25+
# Fallback if ping fails
26+
if [[ -z "$PING" ]]; then
27+
ICON="󰪎" # No network
28+
COLOR="#ff5555"
29+
TEXT="N/A"
30+
else
31+
ICON="󰀂" # Default icon
32+
COLOR="#ffffff"
33+
TEXT="${PING} ms"
34+
35+
# Classify ping and update icon/color
36+
if [[ $(echo "$PING < 50" | bc) -eq 1 ]]; then
37+
ICON="󰀓" # Excellent (strong signal)
38+
COLOR="#50fa7b"
39+
elif [[ $(echo "$PING < 100" | bc) -eq 1 ]]; then
40+
ICON="󰖩" # Okay (average signal)
41+
COLOR="#f1fa8c"
42+
else
43+
ICON="󱂠" # Bad (high latency)
44+
COLOR="#ff5555"
45+
fi
46+
fi
47+
48+
echo "{\"icon\":\"$ICON\",\"text\":\"$TEXT\",\"color\":\"$COLOR\"}"
49+
'''
50+
51+
[[block]]
52+
block = "custom"
53+
command = "lyrics-line.sh"
54+
interval = 3
55+
format = "$text"
56+
hide_when_empty = true
57+
58+
[[block]]
59+
block = "temperature"
60+
format = " $icon $max "
61+
good = 50.0
62+
idle = 65.0
63+
info = 75.0
64+
warning = 85.0
65+
interval = 10
66+
67+
# CPU usage
68+
[[block]]
69+
block = "cpu"
70+
format = " $icon $utilization "
71+
format_alt = " $icon $barchart "
72+
interval = 2
73+
74+
# Memory usage
75+
[[block]]
76+
block = "memory"
77+
format = " $icon $mem_used.eng(w:3)/$mem_total.eng(w:3) "
78+
format_alt = " $icon_swap $swap_used.eng(w:3)/$swap_total.eng(w:3) "
79+
warning_mem = 80.0
80+
critical_mem = 95.0
81+
interval = 5
82+
83+
# Load average
84+
[[block]]
85+
block = "load"
86+
format = " $icon $1m "
87+
info = 0.7
88+
warning = 1.0
89+
critical = 2.0
90+
interval = 5
91+
92+
# Disk space
93+
[[block]]
94+
block = "disk_space"
95+
path = "/"
96+
format = " $icon $used.eng(w:2)/$total.eng(w:2) ($percentage) "
97+
info_type = "available"
98+
warning = 20.0
99+
alert = 10.0
100+
interval = 60
101+
102+
# Network
103+
[[block]]
104+
block = "net"
105+
format = " $icon {$signal_strength $ssid|Wired} $speed_down.eng(prefix:K w:4) ↓ $speed_up.eng(prefix:K w:4) ↑ "
106+
format_alt = " $icon $ip "
107+
interval = 5
108+
109+
# Bluetooth
110+
[[block]]
111+
block = "bluetooth"
112+
format = " $icon "
113+
format_alt = " $icon $name "
114+
disconnected_format = ""
115+
116+
# Volume
117+
[[block]]
118+
block = "sound"
119+
format = " $icon $output_name $volume "
120+
format_alt = " $icon $output_description "
121+
headphones_indicator = true
122+
show_volume_when_muted = false
123+
max_vol = 100
124+
step_width = 5
125+
126+
# Microphone
127+
[[block]]
128+
block = "sound"
129+
driver = "pulse"
130+
device_kind = "source"
131+
format = " $icon $volume "
132+
hide_when_muted = true
133+
134+
[[block]]
135+
block = "battery"
136+
format = " $icon $percentage {$time |}"
137+
info = 60
138+
good = 60
139+
warning = 30
140+
critical = 15
141+
142+
[[block]]
143+
block = "backlight"
144+
format = " $icon $brightness "
145+
device = "intel_backlight"
146+
minimum = 5
147+
maximum = 100
148+
cycle = [5, 25, 50, 75, 100]
149+
150+
151+
[[block]]
152+
block = "time"
153+
interval = 5
154+
format = " $timestamp.datetime(f:'%a %d/%m %R') "

config/picom/picom.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ rules = (
136136
match = "window_type = 'dropdown_menu' || window_type = 'popup_menu' || window_type = 'menu'";
137137
opacity = 0.9;
138138
}, {
139-
match = "window_type = 'dock' || window_type = 'desktop'";
139+
match = "window_type = 'dock' || window_type = 'desktop' || class_g = 'dwm' ";
140140
blur-background = false;
141141
corner-radius = 0;
142142
}, {
@@ -222,7 +222,7 @@ rules = (
222222
});
223223
}, {
224224
# Disable blur for drawing/annotation tools
225-
match = "class_g = 'raydraw' || class_g = 'gromit-mpx' || class_g = 'xournalpp' || class_g = 'krita' || class_g = 'gimp'";
225+
match = "class_g = 'raypets' || class_g = 'Pqiv' || class_g = 'slop' || class_g = 'raydraw' || class_g = 'Gromit-mpx' || class_g = 'xournalpp' || class_g = 'krita' || class_g = 'gimp' || class_g = 'steam_app_default' ";
226226
blur-background = false;
227227
shadow = false;
228228
}, {
@@ -232,7 +232,7 @@ rules = (
232232
blur-background = true;
233233
}, {
234234
# Media players - disable blur for performance
235-
match = "class_g = 'mpv' || class_g = 'vlc' || class_g = 'firefox' && name *= 'YouTube'";
235+
match = "class_g = 'steam_app_default' || class_g = 'Gromit-mpx' || class_g = 'mpv' || class_g = 'vlc' || class_g = 'firefox' && name *= 'YouTube'";
236236
blur-background = false;
237237
unredir-if-possible = true;
238238
}, {

0 commit comments

Comments
 (0)