diff --git a/dwm/bin/dmenu-powermenu b/dwm/bin/dmenu-powermenu index 4799fcc..5f17cb0 100755 --- a/dwm/bin/dmenu-powermenu +++ b/dwm/bin/dmenu-powermenu @@ -1,6 +1,5 @@ #!/bin/sh - case "$(printf "Shutdown\nRestart\nLogout\nSuspend\nLock" | dmenu \ -nb "${COLOR_BACKGROUND:-#151515}" \ -nf "${COLOR_DEFAULT:-#aaaaaa}" \ diff --git a/dwm/bin/picom b/dwm/bin/picom new file mode 100755 index 0000000..83f4761 --- /dev/null +++ b/dwm/bin/picom @@ -0,0 +1,3 @@ +#!/bin/sh + +~/Documents/linux/apps/picom/build/src/picom -b --animations --animation-window-mass 0.5 --animation-for-open-window zoom --animation-stiffnes 500 diff --git a/dwm/bin/volume b/dwm/bin/volume new file mode 100755 index 0000000..b11d8ab --- /dev/null +++ b/dwm/bin/volume @@ -0,0 +1,106 @@ +#!/bin/bash + +iDIR="$HOME/.config/hypr/mako/icons" + +# Get Volume +get_volume() { + volume=$(pamixer --get-volume) + echo "$volume" +} + +# Get icons +get_icon() { + current=$(get_volume) + if [[ "$current" -eq "0" ]]; then + echo "$iDIR/volume-mute.png" + elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + echo "$iDIR/volume-low.png" + elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + echo "$iDIR/volume-mid.png" + elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + echo "$iDIR/volume-high.png" + fi +} + +# Notify +notify_user() { + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume : $(get_volume) %" +} + +# Increase Volume +inc_volume() { + pamixer -i 5 && notify_user +} + +# Decrease Volume +dec_volume() { + pamixer -d 5 && notify_user +} + +# Toggle Mute +toggle_mute() { + if [ "$(pamixer --get-mute)" == "false" ]; then + pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" + elif [ "$(pamixer --get-mute)" == "true" ]; then + pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON" + fi +} + +# Toggle Mic +toggle_mic() { + if [ "$(pamixer --default-source --get-mute)" == "false" ]; then + pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" + elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then + pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON" + fi +} +# Get icons +get_mic_icon() { + current=$(pamixer --default-source --get-volume) + if [[ "$current" -eq "0" ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + echo "$iDIR/microphone.png" + elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + echo "$iDIR/microphone.png" + fi +} +# Notify +notify_mic_user() { + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_mic_icon)" "Mic-Level : $(pamixer --default-source --get-volume) %" +} + +# Increase MIC Volume +inc_mic_volume() { + pamixer --default-source -i 5 && notify_mic_user +} + +# Decrease MIC Volume +dec_mic_volume() { + pamixer --default-source -d 5 && notify_mic_user +} + +# Execute accordingly +if [[ "$1" == "--get" ]]; then + get_volume +elif [[ "$1" == "--inc" ]]; then + inc_volume +elif [[ "$1" == "--dec" ]]; then + dec_volume +elif [[ "$1" == "--toggle" ]]; then + toggle_mute +elif [[ "$1" == "--toggle-mic" ]]; then + toggle_mic +elif [[ "$1" == "--get-icon" ]]; then + get_icon +elif [[ "$1" == "--get-mic-icon" ]]; then + get_mic_icon +elif [[ "$1" == "--mic-inc" ]]; then + inc_mic_volume +elif [[ "$1" == "--mic-dec" ]]; then + dec_mic_volume +else + get_volume +fi diff --git a/dwm/dwm/config.h b/dwm/dwm/config.h index 2175bf4..6367e12 100644 --- a/dwm/dwm/config.h +++ b/dwm/dwm/config.h @@ -19,17 +19,6 @@ static char *colors[][3] = { [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, }; -// static const char col_gray1[] = "#222222"; -// static const char col_gray2[] = "#444444"; -// static const char col_gray3[] = "#bbbbbb"; -// static const char col_gray4[] = "#eeeeee"; -// static const char col_cyan[] = "#00ffff"; -// static const char color_black[] = "#000000"; -// static const char *colors[][3] = { -// /* fg bg border */ -// [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -// [SchemeSel] = { col_gray4, color_black, col_cyan }, -// }; /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; @@ -89,9 +78,9 @@ static const char *lockercmd[] = { "i3lock", "-c", "000000", NULL }; //------------------------------------------------------------------------------------------------- //---------------------------- pamixer ------------------------------ -static const char *pamixericmd[] = { "pamixer", "-i", "10", NULL }; -static const char *pamixerdcmd[] = { "pamixer", "-d", "10", NULL }; -static const char *pamixermutecmd[] = { "pamixer", "-t", NULL }; +static const char *pamixericmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--inc", NULL }; +static const char *pamixerdcmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--dec", NULL }; +static const char *pamixermutecmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--toggle", NULL }; //------------------------------------------------------------------- //----------------------------- brightness -------------------------- diff --git a/dwm/dwm/drw.o b/dwm/dwm/drw.o index 53aefe5..18d23e9 100644 Binary files a/dwm/dwm/drw.o and b/dwm/dwm/drw.o differ diff --git a/dwm/dwm/dwm b/dwm/dwm/dwm index 6f196fb..e5992c1 100755 Binary files a/dwm/dwm/dwm and b/dwm/dwm/dwm differ diff --git a/dwm/dwm/dwm.o b/dwm/dwm/dwm.o index 01c1550..7ef06b1 100644 Binary files a/dwm/dwm/dwm.o and b/dwm/dwm/dwm.o differ diff --git a/dwm/dwm/util.o b/dwm/dwm/util.o index 9044214..804cda6 100644 Binary files a/dwm/dwm/util.o and b/dwm/dwm/util.o differ diff --git a/dwm/startdwm.sh b/dwm/startdwm.sh index ef6c811..2364509 100755 --- a/dwm/startdwm.sh +++ b/dwm/startdwm.sh @@ -3,11 +3,12 @@ export GTK_THEME=Adwaita:dark setxkbmap "us,ru" -option 'grp:win_space_toggle' ~/dotfiles/dwm/background.sh & -#dwmbar & +# dwmbar & +# ~/dotfiles/dwm/bin/picom +~/dotfiles/dwm/bin/wttrd & slstatus & dunst & ~/dotfiles/bin/dpmsdisablexorg -~/dotfiles/dwm/bin/wttrd & xrdb -merge ~/dotfiles/dwm/Xresources