personal dotfiles: my Hyprland config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

#Misc script for oneplus 6 until sway supports this device
noise() {
	rm -f "$XDG_CONFIG_HOME"/sxmo/.noring
	notify-send -e -t 1000 -a switch noise
}
rumble() {
	rm -f "$XDG_CONFIG_HOME"/sxmo/.novibrate
	touch "$XDG_CONFIG_HOME"/sxmo/.noring
	sxmo_vibrate 50 15000
	notify-send -e -t 1000 -a switch rumble
}
silent() {
	touch "$XDG_CONFIG_HOME"/sxmo/.noring
	touch "$XDG_CONFIG_HOME"/sxmo/.novibrate
	notify-send -e -t 1000 -a switch silent
}
evtest /dev/input/by-path/platform-alert-slider-event |stdbuf -o L grep -i -o 'Value *\d' | while read -r line; do
	if echo "$line" | grep -q '0'; then
		noise
	elif echo "$line" | grep -q '1'; then
		rumble
	elif echo "$line" | grep -q '2'; then
		silent
	fi
done