Updated dunst config, volume and brightness scripts with proper custom Adwaita icons

master
Meliurwen 4 years ago
parent ee5eb90e41
commit 4c9feb3b99
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 10
      dunst/.config/dunst/dunstrc.template
  2. 1
      i3/.config/i3/config
  3. 52
      i3/.config/i3/scripts/brightnessControl.sh
  4. 46
      i3/.config/i3/scripts/volumeControl.sh
  5. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-high-dark.png
  6. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-low-dark.png
  7. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-medium-dark.png
  8. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-muted-dark.png
  9. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-none-dark.png
  10. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-overamplified-dark.png
  11. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-disabled-dark.png
  12. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-high-dark.png
  13. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-low-dark.png
  14. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-medium-dark.png
  15. BIN
      icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-none-dark.png

@ -1,10 +1,8 @@
## Modified By Aditya Shakya ...
[global] [global]
monitor = 0 monitor = 0
follow = mouse follow = mouse
geometry = "250x50-20+40" geometry = "330x50-20+40"
indicate_hidden = yes indicate_hidden = yes
shrink = no shrink = no
transparency = 0 transparency = 0
@ -12,8 +10,8 @@ notification_height = 0
separator_height = 4 separator_height = 4
padding = 16 padding = 16
horizontal_padding = 16 horizontal_padding = 16
frame_width = 2 frame_width = 1
frame_color = "#43B581" frame_color = "#285577"
separator_color = frame separator_color = frame
sort = yes sort = yes
idle_threshold = 120 idle_threshold = 120
@ -32,7 +30,7 @@ icon_position = left
max_icon_size = 32 max_icon_size = 32
## Paths to default icons. ## Paths to default icons.
icon_folders = /usr/share/icons/Adwaita/32x32/status/:/usr/share/icons/Adwaita/32x32/devices/ icon_path = ${HOME}/.icons/Adwaita-dark-custom/32x32/status/:/usr/share/icons/hicolor/scalable/apps/:/usr/share/icons/hicolor/48x48/apps/
sticky_history = yes sticky_history = yes
history_length = 20 history_length = 20
dmenu = /usr/bin/dmenu -p dunst: dmenu = /usr/bin/dmenu -p dunst:

@ -233,6 +233,7 @@ exec --no-startup-id feh --bg-fill $HOME/Scaricati/northern_lights_by_aenami_dbb
exec --no-startup-id compton --config $HOME/.config/compton/config exec --no-startup-id compton --config $HOME/.config/compton/config
# Notification Manager # Notification Manager
exec --no-startup-id envsubst < ~/.config/dunst/dunstrc.template > ~/.config/dunst/dunstrc
exec --no-startup-id dunst --config $HOME/.config/dunst/dunstrc exec --no-startup-id dunst --config $HOME/.config/dunst/dunstrc
# Pulseaudio # Pulseaudio

@ -9,17 +9,57 @@
# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a # https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
function get_brightness { function get_brightness {
xbacklight -get | cut -d '.' -f 1 #xbacklight -get | cut -d '.' -f 1 # This seems to no longer work on Intel graphics
max_bright=$(cat /sys/class/backlight/intel_backlight/max_brightness)
act_bright=$(cat /sys/class/backlight/intel_backlight/actual_brightness)
# To round down/up/nearest in sh: https://stackoverflow.com/a/2395294
# In this case we round to the nearest: (num + (denom / 2)) / denom
echo $(( (act_bright*100+(max_bright/2))/max_bright ))
}
function draw_bar {
percentual=$1
slices=$2
lvl=$((percentual / slices))
empty=$(((100 / slices) - lvl))
lvl_bar=""
for X in $(seq "$lvl"); do
lvl_bar="$lvl_bar$(printf '\u2588')"
done
empty_bar=""
for X in $(seq "$empty"); do
empty_bar="$empty_bar$(printf '\u2591')"
done
echo "$lvl_bar$empty_bar"
} }
function send_notification { function send_notification {
icon="preferences-system-brightness-lock" if [ ! -d "/sys/class/backlight/intel_backlight/" ]; then
notif_icon="display-brightness-disabled-dark"
notif_text="Disabled"
else
brightness=$(get_brightness) brightness=$(get_brightness)
# Make the bar with the special character ─ (it's not dash -) if [ $brightness -le 0 ] ; then
# https://en.wikipedia.org/wiki/Box-drawing_character notif_icon="display-brightness-none-dark"
bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g') else
if [ $brightness -le 30 ] ; then
notif_icon="display-brightness-low-dark"
else
if [ $brightness -le 85 ] ; then
notif_icon="display-brightness-medium-dark"
else
if [ $brightness -le 100 ] ; then
notif_icon="display-brightness-high-dark"
else
notif_icon="display-brightness-overamplified-dark"
fi
fi
fi
fi
notif_text=$(draw_bar $brightness 5)
fi
# Send the notification # Send the notification
dunstify -i "$icon" -r 5555 -u normal " $bar" dunstify -i "$notif_icon" -r 5555 -u normal "$notif_text"
} }
case $1 in case $1 in

@ -17,19 +17,49 @@ function is_mute {
amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null
} }
function draw_bar {
percentual=$1
slices=$2
lvl=$((percentual / slices))
empty=$(((100 / slices) - lvl))
lvl_bar=""
for X in $(seq "$lvl"); do
lvl_bar="$lvl_bar$(printf '\u2588')"
done
empty_bar=""
for X in $(seq "$empty"); do
empty_bar="$empty_bar$(printf '\u2591')"
done
echo "$lvl_bar$empty_bar"
}
function send_notification { function send_notification {
iconSound="audio-volume-high"
iconMuted="audio-volume-muted"
if is_mute ; then if is_mute ; then
dunstify -i $iconMuted -r 2593 -u normal "mute" notif_icon="audio-volume-muted-dark"
notif_text="Muted"
else else
volume=$(get_volume) volume=$(get_volume)
# Make the bar with the special character ─ (it's not dash -) if [ $volume -le 0 ] ; then
# https://en.wikipedia.org/wiki/Box-drawing_character notif_icon="audio-volume-none-dark"
bar=$(seq --separator="─" 0 "$((volume / 5))" | sed 's/[0-9]//g') else
# Send the notification if [ $volume -le 30 ] ; then
dunstify -i $iconSound -r 2593 -u normal " $bar" notif_icon="audio-volume-low-dark"
else
if [ $volume -le 85 ] ; then
notif_icon="audio-volume-medium-dark"
else
if [ $volume -le 100 ] ; then
notif_icon="audio-volume-high-dark"
else
notif_icon="audio-volume-overamplified-dark"
fi
fi
fi fi
fi
notif_text="$(draw_bar $volume 5)"
fi
# Send the notification
dunstify -i $notif_icon -r 2593 -u normal "$notif_text"
} }
case $1 in case $1 in

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Loading…
Cancel
Save