bin

git clone git://git.codymlewis.com/bin.git
Log | Files | Refs

commit d5ee803c014f8eb2fd77648d11123a3c39817611
parent 3494606c6e2e0969efcacc33ad926870bb88bcfe
Author: Cody Lewis <cody@codymlewis.com>
Date:   Fri, 26 Jun 2020 10:32:43 +1000

Changed to dmenu and added some statubar scripts

Diffstat:
Admenumpc | 11+++++++++++
Dfzfmpc | 11-----------
Mget-pass | 4++--
Mpowermenu | 3+--
Mstatusbar/battery | 2+-
Astatusbar/brightness | 5+++++
Astatusbar/cpu | 8++++++++
Astatusbar/mem | 11+++++++++++
Astatusbar/music | 11+++++++++++
Astatusbar/network | 7+++++++
Mstatusbar/volume | 6++++--
Mxrs | 4++--
12 files changed, 63 insertions(+), 20 deletions(-)

diff --git a/dmenumpc b/dmenumpc @@ -0,0 +1,11 @@ +#!/bin/bash + +artist="$(mpc list Artist | dmenu -p 'Choose an Artist')" + +[[ $artist = "" ]] && exit + +title="$(mpc list Title Artist "$artist" | dmenu -p 'Choose a Song')" + +[[ $title = "" ]] && exit + +mpc searchplay Artist "$artist" Title "$title" diff --git a/fzfmpc b/fzfmpc @@ -1,11 +0,0 @@ -#!/bin/bash - -artist="$(mpc list Artist | fzf)" - -[[ $artist = "" ]] && exit - -title="$(mpc list Title Artist "$artist" | fzf)" - -[[ $title = "" ]] && exit - -mpc searchplay Artist "$artist" Title "$title" diff --git a/get-pass b/get-pass @@ -1,8 +1,8 @@ #!/bin/sh -a=$(ls "$HOME/.password-store" | rofi -dmenu -p "What website do you want a password for") +a=$(ls "$HOME/.password-store" | dmenu -p "What website do you want a password for") [ $(ls "$HOME/.password-store/$a" | wc -l) = 1 ] && b=$(ls "$HOME/.password-store/$a" | sed 's/\.gpg//') || - b=$(ls "$HOME/.password-store/$a" | sed 's/\.gpg//' | rofi -dmenu "Which account do you want a password for") + b=$(ls "$HOME/.password-store/$a" | sed 's/\.gpg//' | dmenu "Which account do you want a password for") (tpm show "$a/$b" | xsel -p) && (echo "$a" | xsel -b) && notify-send "Password for $a/$b copied to clipboard" diff --git a/powermenu b/powermenu @@ -1,7 +1,6 @@ #!/bin/bash -# A power handling script using rofi -PWR_OPT=$(echo -e "Cancel\nExit WM\nShutdown\nReboot" | rofi -dmenu -i -p "What would you like to do?" -l 4) +PWR_OPT=$(echo -e "Cancel\nExit WM\nShutdown\nReboot" | dmenu -i -p "What would you like to do?" -l 4) case $PWR_OPT in "Exit WM") diff --git a/statusbar/battery b/statusbar/battery @@ -16,4 +16,4 @@ if grep 'Discharging' /sys/class/power_supply/BAT0/status > /dev/null; then else baticon="" fi -printf "%s %s " "$baticon" "$cap" +printf "%s %s%% " "$baticon" "$cap" diff --git a/statusbar/brightness b/statusbar/brightness @@ -0,0 +1,5 @@ +#!/bin/sh + +brightness=$(xbacklight | sed 's/\\..*//') + +printf "%4.1f%%" "$brightness" diff --git a/statusbar/cpu b/statusbar/cpu @@ -0,0 +1,8 @@ +#!/bin/sh + +case $BUTTON in + 1) setsid "$TERMINAL" -e htop & ;; +esac + +usage=$(top -b -n 1 | grep Cpu | awk '{print $2}') +printf "%4.1f%% " "$usage" diff --git a/statusbar/mem b/statusbar/mem @@ -0,0 +1,11 @@ +#!/bin/sh + +case $BUTTON in + 1) setsid "$TERMINAL" -e htop & ;; +esac + + +mem="$(free -h | grep Mem)" +free="$(echo "$mem" | awk '{print $3}')" +total="$(echo "$mem" | awk '{print $2}')" +printf "%s/%s " "$free" "$total" diff --git a/statusbar/music b/statusbar/music @@ -0,0 +1,11 @@ +#!/bin/sh + + +case $BUTTON in + 1) setsid "$TERMINAL" -e ncmpcpp & ;; +esac + +mpc_status=$(mpc status) + +printf "%s" "$mpc_status" | grep 'playing' > /dev/null && \ + printf " %s" "$mpc_status" | head -n1 diff --git a/statusbar/network b/statusbar/network @@ -0,0 +1,7 @@ +#!/bin/sh + +case $BUTTON in + 1) setsid "$TERMINAL" -e nmtui & ;; +esac + +nmcli | head -n 1 diff --git a/statusbar/volume b/statusbar/volume @@ -1,9 +1,11 @@ #!/bin/sh -case $BLOCK_BUTTON in +case $BUTTON in 1) setsid "$TERMINAL" -e pulsemixer & ;; esac +# notify-send "test: $BLOCK_BUTTON" + vol=$(amixer get Master | awk -F'[][]' 'END{ print $2 }' | sed 's/%//g') is_muted=$(amixer get Master | grep 'off') if [ "$is_muted" ]; then @@ -16,5 +18,5 @@ else else vol=" $vol" fi - printf "%s " "$vol" + printf "%s%% " "$vol" fi diff --git a/xrs b/xrs @@ -4,9 +4,9 @@ primary="eDP1" other_mons="$(xrandr | awk '/\sconnected\s[^p]/{ print $1 }')" -mon="$(printf "%s" "$other_mons" | rofi -dmenu -p 'Which monitor')" +mon="$(printf "%s" "$other_mons" | dmenu -p 'Which monitor')" -dir=$(printf "Right\nLeft\nMirror\nAbove\nBelow\nOff" | rofi -dmenu -p 'Which direction') +dir=$(printf "Right\nLeft\nMirror\nAbove\nBelow\nOff" | dmenu -p 'Which direction') case "$dir" in "Right")