alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
sway: fix force feedback notifier
author
lassulus
date
10 months ago
(Dec 12, 2025, 11:12 AM CET)
commit
8e39b5a1
8e39b5a12d3cb2f5ec9179c5fd4f7c2f0dfa6061
parent
cbee259b
cbee259b266daf045470c94fea3c25a80ed8876a
+17
-7
1 changed file
Expand all
Collapse all
Unified
Split
2configs
desktops
sway
default.nix
+17
-7
2configs/desktops/sway/default.nix
View file
Reviewed
···
54
54
description = "Trigger rumble on urgent windows";
55
55
partOf = [ "sway-session.target" ];
56
56
wantedBy = [ "sway-session.target" ];
57
57
-
unitConfig = {
58
58
-
ConditionPathExists = [
59
59
-
"/dev/input/event2"
60
60
-
"/sys/class/input/event2/device/capabilities/ff"
61
61
-
];
62
62
-
};
63
57
serviceConfig = {
64
58
Type = "simple";
65
59
ExecStart = lib.getExe (
···
71
65
self.packages.${pkgs.system}.gpd-rumble
72
66
];
73
67
text = ''
68
68
+
# Find first force-feedback capable device
69
69
+
FF_DEVICE=""
70
70
+
for ev in /sys/class/input/event*; do
71
71
+
if [ -f "$ev/device/capabilities/ff" ] && [ "$(cat "$ev/device/capabilities/ff")" != "0" ]; then
72
72
+
FF_DEVICE="/dev/input/''${ev##*/}"
73
73
+
break
74
74
+
fi
75
75
+
done
76
76
+
77
77
+
if [ -z "$FF_DEVICE" ]; then
78
78
+
echo "No force-feedback device found, exiting"
79
79
+
exit 0
80
80
+
fi
81
81
+
82
82
+
echo "Using force-feedback device: $FF_DEVICE"
83
83
+
74
84
swaymsg -t subscribe -m '["window"]' | \
75
85
jq --unbuffered -r 'select(.change == "urgent" and .container.urgent == true) | "urgent"' | \
76
86
while read -r _; do
77
77
-
gpd-rumble 200 100 &
87
87
+
gpd-rumble 200 100 "$FF_DEVICE" &
78
88
done
79
89
'';
80
90
}