dotfiles

config files and scripts
git clone git://git.hanetzok.net/dotfiles
Log | Files | Refs

commit d5b26532531140aa0f3c4c48dbe9f57bab110441
parent 01da119e7f12691f91c3e010074d87b289720afb
Author: Markus Hanetzok <markus@hanetzok.net>
Date:   Wed, 27 Nov 2024 20:59:48 +0100

add some scripts

Diffstat:
M.config/ncmpcpp/config | 4+---
A.local/bin/mount-nfs.sh | 7+++++++
A.local/bin/status.sh | 25+++++++++++++++++++++++++
A.local/bin/umount-nfs.sh | 4++++
A.local/bin/xev.sh | 4++++
5 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config @@ -2,7 +2,7 @@ ncmpcpp_directory = "~/.config/ncmpcpp" lyrics_directory = "~/.local/share/lyrics" -mpd_music_dir = "~/Music" +mpd_music_dir = "~/media/music" message_delay_time = "1" visualizer_type = "spectrum" song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} @@ -30,5 +30,3 @@ progressbar_color = black:b progressbar_elapsed_color = blue:b statusbar_color = red statusbar_time_color = cyan:b -execute_on_song_change="pkill -RTMIN+11 dwmblocks" -execute_on_player_state_change="pkill -RTMIN+11 dwmblocks" diff --git a/.local/bin/mount-nfs.sh b/.local/bin/mount-nfs.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if ping -c 1 "$NAS_ADDRESS" &> /dev/null +then + sudo -u markus mount /home/markus/media + sudo -u markus mount /home/markus/nas +fi diff --git a/.local/bin/status.sh b/.local/bin/status.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# simple statusbar script for dwm + +mpc_state() { + if mpc | grep -q 'paused'; then + echo "PAUSED" + fi + if mpc | grep -q 'playing'; then + echo "PLAYING" + fi +} + +while true; do + date="$(date +%y-%m-%d)" + time="$(date +%H:%M)" + bat="$(cat /sys/class/power_supply/BAT0/capacity)" + ram="$(LANG=C free -m | grep Mem | awk '{usage=($3/$2)*100} END {print usage "%"}')" + cpu="$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}')" + song="$(mpc current)" + mpc="$(mpc_state)" + + xsetroot -name "$time | $date | BAT: $bat%; [$mpc] $song ;RAM: $ram | CPU: $cpu" + sleep 1 +done diff --git a/.local/bin/umount-nfs.sh b/.local/bin/umount-nfs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo -u markus umount /home/markus/media +sudo -u markus umount /home/markus/nas diff --git a/.local/bin/xev.sh b/.local/bin/xev.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }' +