1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-04-20 00:37:44 +02:00

Compare commits

...

7 Commits

Author SHA1 Message Date
fc52081c30 dunst: hard edges 2023-10-22 01:22:21 +02:00
TiynGER
1949e8e8a9 xorg: corrected run order 2023-10-22 01:20:15 +02:00
12cb200ba8 dunst: added dnd mode 2023-10-22 01:16:03 +02:00
7756ef5d6d sound and microphone toggle notification optimized 2023-10-22 00:43:54 +02:00
8fbffbc7c6 statusbar: battery script changed 2023-10-22 00:35:00 +02:00
7cddd5c649 statusbar: battery script changed 2023-10-22 00:19:06 +02:00
6568cefd80 statusbar: battery script changed 2023-10-22 00:05:00 +02:00
7 changed files with 62 additions and 12 deletions

View File

@ -10,6 +10,7 @@
padding = 10 padding = 10
horizontal_padding = 10 horizontal_padding = 10
frame_width = 2 frame_width = 2
corner_radius = 0
frame_color = "#555555" frame_color = "#555555"
separator_color = "#555555" separator_color = "#555555"
@ -66,10 +67,18 @@
frame_color = "#8c3d45" frame_color = "#8c3d45"
timeout = 0 timeout = 0
[normal_urgency_sound] [sound_normal]
msg_urgency = "normal" msg_urgency = "normal"
script = ~/.config/dunst/alert_normal.sh script = ~/.config/dunst/alert_normal.sh
[critical_urgency_sound] [sound_critical]
msg_urgency = "critical" msg_urgency = "critical"
script = ~/.config/dunst/alert_high.sh script = ~/.config/dunst/alert_high.sh
[dnd_normal]
msg_urgency = "normal"
skip_display = true
[dnd_low]
msg_urgency = "low"
skip_display = true

View File

@ -3,6 +3,8 @@
xset r rate 300 50 & # Speed xrate up xset r rate 300 50 & # Speed xrate up
unclutter & # Remove mouse when idle unclutter & # Remove mouse when idle
dunst & # dunst for notifications dunst & # dunst for notifications
dunstctl rule dnd_low disable & # disable dnd for low urgencies
dunstctl rule dnd_normal disable & # disable dnd for normal urgencies
redshift & # redshift for saving your eyes redshift & # redshift for saving your eyes
$STATUSBAR & # for refreshing the statusbar $STATUSBAR & # for refreshing the statusbar
xcompmgr & # compositor for transparency xcompmgr & # compositor for transparency

View File

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
if amixer get Capture | tail -2 | grep -q '\[on\]'; then if amixer get Capture | tail -2 | grep -q '\[on\]'; then
notify-send -u low 'Audio' 'Sound active\nMicrophone muted'
paplay ~/.local/bin/tools/audio/mic_muted.wav paplay ~/.local/bin/tools/audio/mic_muted.wav
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
else else
notify-send -u low 'Audio' 'Sound active\nMicrophone active'
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
amixer set Capture cap >/dev/null 2>&1 amixer set Capture cap >/dev/null 2>&1
paplay ~/.local/bin/tools/audio/mic_activated.wav paplay ~/.local/bin/tools/audio/mic_activated.wav

View File

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
if amixer get Master | tail -2 | grep -q '\[on\]'; then if amixer get Master | tail -2 | grep -q '\[on\]'; then
notify-send -u low 'sxhkd' 'Sound muted\nMicrophone muted' notify-send -u low 'sxhkd' 'Sound muted\nMicrophone muted'
paplay ~/.local/bin/tools/audio/sound_muted.wav
amixer set Master mute >/dev/null 2>&1 amixer set Master mute >/dev/null 2>&1
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
else else
notify-send -u low 'sxhkd' 'Sound active\nMicrophone muted'
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
paplay ~/.local/bin/tools/audio/sound_resumed.wav paplay ~/.local/bin/tools/audio/sound_resumed.wav

7
.local/bin/tools/dnd_start Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
notify-send -u low "dunst" "Do not disturb started"
dunstctl history-clear
dunstctl rule dnd_low enable
dunstctl rule dnd_normal enable
dunstctl rule sound_normal disable

10
.local/bin/tools/dnd_stop Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
dunstctl rule dnd_low disable
dunstctl rule dnd_normal disable
dunstctl rule sound_normal enable
hist_size=$(dunstctl history | jq '.data[0] | length')
for i in `seq $hist_size`; do
dunstctl history-pop
done
notify-send -u low "dunst" "Do not disturb stopped"

View File

@ -1,9 +1,35 @@
#!/usr/bin/env sh #!/bin/sh
capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit acpi=$(acpi -b)
status=$(cat /sys/class/power_supply/"$1"/status)
icon=$(echo "$status" | sed -e "s/,//;s/Discharging/^b#282828^^c#dfdfdf^  ^d^/;s/Not charging/^b#282828^^c#dfdfdf^  ^d^/;s/Charging/^b#282828^^c#dfdfdf^  ^d^/;s/Unknown/^b#282828^^c#dfdfdf^  ^d^/;s/Full/^b#282828^^c#dfdfdf^ ⚡ ^d^/;s/ 0*/ /g;s/ :/ /g") if [ "$acpi" = "" ]; then
capacity=$(echo "$capacity" | sed -e 's/$//' ) echo ""
return
fi
total=$(echo $acpi | sed 's/.*:\ //')
status="$(echo $total | cut -d',' -f1)"
capacity="$(echo $total | cut -d',' -f2 | sed 's/%//')"
if [ "$status" = "Discharging" ] && [ $capacity -le 15 ] ; then
notify-send -u critical "Battery" "Below 15%"
fi
case "$status" in
"Discharging")
icon="^b#282828^^c#dfdfdf^  ^d^";;
"Not charging")
icon="^b#282828^^c#dfdfdf^  ^d^";;
"Charging")
icon="^b#282828^^c#dfdfdf^  ^d^";;
"Unknown")
icon="^b#282828^^c#dfdfdf^  ^d^";;
"Full")
icon="^b#282828^^c#dfdfdf^ ⚡ ^d^";;
esac
capacity=$(echo "$capacity" | sed -e 's/$//')
capacity=$(printf %3s $capacity | tr ' ' ' ') capacity=$(printf %3s $capacity | tr ' ' ' ')
echo "$icon $capacity%" echo "$icon $capacity%"