diff --git a/scripts/dunstvol b/scripts/dunstvol new file mode 100644 index 0000000..b7eb387 --- /dev/null +++ b/scripts/dunstvol @@ -0,0 +1,17 @@ +#!/bin/sh +# changeVolume + +msgTag="volumechange" +iconPath="/usr/share/icons/Adwaita/32x32/legacy/" + +volume="$(pactl get-sink-volume 0 | awk '{print $5}' )" +mute="$(pactl get-sink-mute 0 | awk '{print $2}' )" + + +if [[ $volume == 0 || "$mute" == "yes" ]]; then + # Show the sound muted notification + notify-send -a "changeVolume" -h string:x-dunst-stack-tag:$msgTag -i $iconPath/audio-volume-muted.png "Volume muted" --expire-time=1000 +else + # Show the volume notification + notify-send -a "changeVolume" -h string:x-dunst-stack-tag:$msgTag -i $iconPath/audio-volume-high.png -h int:value:"$volume" "Volume: ${volume}" --expire-time=1000 +fi diff --git a/scripts/restartdwm b/scripts/restartdwm new file mode 100644 index 0000000..80f93e1 --- /dev/null +++ b/scripts/restartdwm @@ -0,0 +1,8 @@ +#!/bin/sh + +cd ~/dwm + +make -j4 +make install + +killall dwm diff --git a/scripts/startdwm b/scripts/startdwm new file mode 100644 index 0000000..56f6405 --- /dev/null +++ b/scripts/startdwm @@ -0,0 +1,19 @@ +#!/bin/sh + +#picom -b --vsync --experimental-backends +#feh --bg-scale ~/path/to/img.png +#setxkbmap us,ru -option 'grp:shift_alt_toggle' + +# Statusbar loop +while true; do + ubar + sleep 1s # Update time every second +done & + +# relaunch DWM +while true; do + # Log stderror to a file + ~/.local/bin/dwm 2> ~/.dwm.log + # No error logging + #dwm >/dev/null 2>&1 +done diff --git a/scripts/ubar b/scripts/ubar index d905d9d..c8f12dd 100644 --- a/scripts/ubar +++ b/scripts/ubar @@ -1 +1,12 @@ -e +#!/bin/sh + +SEP="┇" + +#RAM_USAGE=$( free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }' ) +#CPU_USAGE=$( mpstat 1 1 | awk '/Av/ {printf(" %s% \n", $(NF-9))}' ) +LANG=$( xset -q|grep LED| awk '{ if (substr ($10,5,1) == 1) print "[RU]"; else print "[EN]"; }' ) +DATE_TIME=$(date +" %d.%m $SEP  %H:%M") +BATT=$(cat /sys/class/power_supply/BAT0/capacity) + +xsetroot -rv -name " $SEP $LANG $SEP  $BATT% $SEP $DATE_TIME " +