Skip to content

Commit 8c33dc0

Browse files
deepu105kRHYME7
authored andcommitted
Workflow script fixes (#887)
* fix: follow symlinks to work with stow and fix typo * feat: expose workflow set function to be used from other scripts * fix: gamemode script cleanup * feat: match with gamemode set via gamemode script * feat: improved workflows --------- Co-authored-by: Khing <[email protected]>
1 parent 9c9249b commit 8c33dc0

File tree

5 files changed

+47
-17
lines changed

5 files changed

+47
-17
lines changed

β€ŽConfigs/.config/hypr/workflows/gaming.confβ€Ž

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,27 @@ decoration {
1010
shadow {
1111
enabled = 0
1212
}
13-
blur:enabled = 0
13+
blur {
14+
enabled = 0
15+
xray = 1
16+
}
1417
rounding = 0
18+
active_opacity = 1
19+
inactive_opacity = 1
20+
fullscreen_opacity = 1
1521
}
1622

1723
general {
18-
gaps_in = 0
19-
gaps_out = 0
20-
border_size = 1
24+
gaps_in = 0
25+
gaps_out = 0
26+
border_size = 1
2127
}
2228

2329
animations:enabled = 0
30+
31+
layerrule = noanim,waybar
32+
layerrule = noanim,swaync-notification-window
33+
layerrule = noanim,swww-daemon
34+
layerrule = noanim,rofi
35+
36+
windowrule = opaque,class:(.*) # ensure all windows are opaque

β€ŽConfigs/.config/hypr/workflows/powersaver.confβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,24 @@ decoration {
99
shadow {
1010
enabled = 0
1111
}
12-
blur:enabled = 0
12+
blur {
13+
enabled = 0
14+
xray = 1
15+
}
1316
rounding = 0
1417
active_opacity = 1
1518
inactive_opacity = 1
1619
fullscreen_opacity = 1
17-
fullscreen_opacity = 1
1820
}
1921

2022
general {
21-
gaps_in = 0
22-
gaps_out = 0
23-
border_size = 1
23+
gaps_in = 0
24+
gaps_out = 0
25+
border_size = 1
2426
}
2527

2628
animations:enabled = 0
29+
misc:vfr = true
2730

2831
layerrule = noanim,waybar
2932
layerrule = noanim,swaync-notification-window

β€ŽConfigs/.config/hypr/workflows/snappy.confβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ rounding = 0
99
}
1010

1111
general {
12-
gaps_in = 0
13-
gaps_out = 0
14-
border_size = 1
12+
gaps_in = 0
13+
gaps_out = 0
14+
border_size = 1
1515
}
1616

1717
animations:enabled = 0

β€ŽConfigs/.local/lib/hyde/gamemode.shβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$HYPRGAMEMODE" = 1 ]; then
77
hyprctl -q --batch "\
88
keyword animations:enabled 0;\
99
keyword decoration:shadow:enabled 0;\
10-
keyword decoration:shadow:xray 1;\
10+
keyword decoration:blur:xray 1;\
1111
keyword decoration:blur:enabled 0;\
1212
keyword general:gaps_in 0;\
1313
keyword general:gaps_out 0;\
@@ -16,7 +16,6 @@ if [ "$HYPRGAMEMODE" = 1 ]; then
1616
keyword decoration:active_opacity 1 ;\
1717
keyword decoration:inactive_opacity 1 ;\
1818
keyword decoration:fullscreen_opacity 1 ;\
19-
keyword decoration:fullscreen_opacity 1 ;\
2019
keyword layerrule noanim,waybar ;\
2120
keyword layerrule noanim,swaync-notification-window ;\
2221
keyword layerrule noanim,swww-daemon ;\

β€ŽConfigs/.local/lib/hyde/workflows.shβ€Ž

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Usage: $0 [OPTIONS]
2424
2525
Options:
2626
--select | -S Select a workflow from the available options
27+
--set Set the given workflow
2728
--waybar Get workflow info for Waybar
2829
--help | -h Show this help message
2930
@@ -36,7 +37,7 @@ if [ -z "${*}" ]; then
3637
fi
3738

3839
# Define long options
39-
LONG_OPTS="select,waybar,help"
40+
LONG_OPTS="select,set:,waybar,help"
4041
SHORT_OPTS="Sh"
4142
# Parse options
4243
PARSED=$(getopt --options ${SHORT_OPTS} --longoptions "${LONG_OPTS}" --name "$0" -- "$@")
@@ -67,7 +68,7 @@ fn_select() {
6768
workflow_icon=$(get_hyprConf "WORKFLOW_ICON" "$workflow_path")
6869
workflow_icon=${workflow_icon:0:1}
6970
workflow_list="${workflow_list}\n${workflow_icon}\t ${workflow_name}"
70-
done < <(find "$workflows_dir" -type f -name "*.conf" 2>/dev/null)
71+
done < <(find "$workflows_dir" -follow -type f -name "*.conf" 2>/dev/null)
7172

7273
# Set rofi scaling
7374
font_scale="${ROFI_WORKFLOW_SCALE}"
@@ -144,7 +145,7 @@ fn_update() {
144145
#*β”‚ β”‚
145146
#*β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
146147
147-
\$WORKFLOW = ${ucrrent_workflow}
148+
\$WORKFLOW = ${current_workflow}
148149
\$WORKFLOW_ICON = ${current_icon}
149150
\$WORKFLOW_DESCRIPTION = ${current_description}
150151
\$WORKFLOWS_PATH = ./workflows/${current_workflow}.conf
@@ -177,6 +178,20 @@ while true; do
177178
pkill -RTMIN+7 waybar
178179
fi
179180

181+
exit 0
182+
;;
183+
--set)
184+
if [ -z "$2" ]; then
185+
echo "Error: --set requires a workflow name"
186+
exit 1
187+
fi
188+
set_conf "HYPR_WORKFLOW" "$2"
189+
fn_update
190+
# refresh waybar module only if waybar is running
191+
if pgrep -x waybar >/dev/null; then
192+
pkill -RTMIN+7 waybar
193+
fi
194+
180195
exit 0
181196
;;
182197
--help | -h)

0 commit comments

Comments
Β (0)