diff --git a/dunst/.config/dunst/dunstrc b/dunst/.config/dunst/dunstrc.template similarity index 92% rename from dunst/.config/dunst/dunstrc rename to dunst/.config/dunst/dunstrc.template index 83bda61..d64e58c 100644 --- a/dunst/.config/dunst/dunstrc +++ b/dunst/.config/dunst/dunstrc.template @@ -1,10 +1,8 @@ -## Modified By Aditya Shakya ... - [global] monitor = 0 follow = mouse -geometry = "250x50-20+40" +geometry = "330x50-20+40" indicate_hidden = yes shrink = no transparency = 0 @@ -12,8 +10,8 @@ notification_height = 0 separator_height = 4 padding = 16 horizontal_padding = 16 -frame_width = 2 -frame_color = "#43B581" +frame_width = 1 +frame_color = "#285577" separator_color = frame sort = yes idle_threshold = 120 @@ -32,7 +30,7 @@ icon_position = left max_icon_size = 32 ## 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 history_length = 20 dmenu = /usr/bin/dmenu -p dunst: diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 29fa95d..0c33568 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -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 # Notification Manager +exec --no-startup-id envsubst < ~/.config/dunst/dunstrc.template > ~/.config/dunst/dunstrc exec --no-startup-id dunst --config $HOME/.config/dunst/dunstrc # Pulseaudio diff --git a/i3/.config/i3/scripts/brightnessControl.sh b/i3/.config/i3/scripts/brightnessControl.sh index 89c78a7..ce6bd0d 100755 --- a/i3/.config/i3/scripts/brightnessControl.sh +++ b/i3/.config/i3/scripts/brightnessControl.sh @@ -9,17 +9,57 @@ # https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a 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 { - icon="preferences-system-brightness-lock" - brightness=$(get_brightness) - # Make the bar with the special character ─ (it's not dash -) - # https://en.wikipedia.org/wiki/Box-drawing_character - bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g') + if [ ! -d "/sys/class/backlight/intel_backlight/" ]; then + notif_icon="display-brightness-disabled-dark" + notif_text="Disabled" + else + brightness=$(get_brightness) + if [ $brightness -le 0 ] ; then + notif_icon="display-brightness-none-dark" + 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 - dunstify -i "$icon" -r 5555 -u normal " $bar" + dunstify -i "$notif_icon" -r 5555 -u normal "$notif_text" } case $1 in diff --git a/i3/.config/i3/scripts/volumeControl.sh b/i3/.config/i3/scripts/volumeControl.sh index 86ff4df..ee61a7e 100755 --- a/i3/.config/i3/scripts/volumeControl.sh +++ b/i3/.config/i3/scripts/volumeControl.sh @@ -17,19 +17,49 @@ function is_mute { 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 { - iconSound="audio-volume-high" - iconMuted="audio-volume-muted" if is_mute ; then - dunstify -i $iconMuted -r 2593 -u normal "mute" + notif_icon="audio-volume-muted-dark" + notif_text="Muted" else volume=$(get_volume) - # Make the bar with the special character ─ (it's not dash -) - # https://en.wikipedia.org/wiki/Box-drawing_character - bar=$(seq --separator="─" 0 "$((volume / 5))" | sed 's/[0-9]//g') - # Send the notification - dunstify -i $iconSound -r 2593 -u normal " $bar" + if [ $volume -le 0 ] ; then + notif_icon="audio-volume-none-dark" + else + if [ $volume -le 30 ] ; then + 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 + notif_text="$(draw_bar $volume 5)" fi + # Send the notification + dunstify -i $notif_icon -r 2593 -u normal "$notif_text" } case $1 in diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-high-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-high-dark.png new file mode 100644 index 0000000..332eeb8 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-high-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-low-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-low-dark.png new file mode 100644 index 0000000..eb6aa30 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-low-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-medium-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-medium-dark.png new file mode 100644 index 0000000..d2d001d Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-medium-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-muted-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-muted-dark.png new file mode 100644 index 0000000..eb06d62 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-muted-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-none-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-none-dark.png new file mode 100644 index 0000000..2225da0 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-none-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-overamplified-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-overamplified-dark.png new file mode 100644 index 0000000..b594028 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/audio-volume-overamplified-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-disabled-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-disabled-dark.png new file mode 100644 index 0000000..700abf7 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-disabled-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-high-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-high-dark.png new file mode 100644 index 0000000..420d8db Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-high-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-low-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-low-dark.png new file mode 100644 index 0000000..730fe87 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-low-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-medium-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-medium-dark.png new file mode 100644 index 0000000..b88447f Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-medium-dark.png differ diff --git a/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-none-dark.png b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-none-dark.png new file mode 100644 index 0000000..434f025 Binary files /dev/null and b/icons/.icons/Adwaita-dark-custom/32x32/status/display-brightness-none-dark.png differ