updating EVERYTHING for arch again

This commit is contained in:
Chris Cochrun 2022-06-23 12:17:54 -05:00
parent 270b92d0c2
commit d0ef589a39
20 changed files with 120 additions and 74 deletions

17
scripts/cpu-plasma-diy.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
ID=$1
while true
do
COMMAND="systemmonitor"
# font='VictorMono Nerd Font' color=#ff9f43 size=11
cpu="$(mpstat 1 1 | rg Average | awk '{print $3+$4+$5}' | sed 's/\(.*\)/\1%/g')"
DATA="| A |  $cpu | | $COMMAND |"
qdbus org.kde.plasma.doityourselfbar /id_$ID \
org.kde.plasma.doityourselfbar.pass "$DATA"
sleep 3s
done

View file

@ -4,5 +4,5 @@
# echo 100 - $(mpstat | rg all | cut -d \ -f43) | bc
cpu="$(mpstat 1 1 | rg Average | awk '{print $3+$4+$5}' | sed 's/\(.*\)/\1%/g')"
echo "$cpu | color=#ff9f43 font='VictorMono Nerd Font' size=11"
echo "$cpu | font='VictorMono Nerd Font' color=#ff9f43 size=11"
# echo " $cpu | color=#D75F00 font='VictorMono Nerd Font' size=11"

View file

@ -9,15 +9,15 @@ if [ $(pgrep -c emacsclient) -gt 0 ]; then
# echo $emacsrg
if [ -z $emacsrg ]; then
emacsclient -c &
exec emacsclient -c &
exit
else
wmctrl -ia $emacsrg
exec wmctrl -ia $emacsrg
exit
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
/home/chris/bin/ww -fa Emacs -c emacsclient
exec /home/chris/bin/ww -fa Emacs -c emacsclient
exit
else
# WAYLAND
@ -26,11 +26,11 @@ if [ $(pgrep -c emacsclient) -gt 0 ]; then
emacswin=$(echo $emacsrg | sed 's/.*\: //')
# echo $emacswin
wlrctl toplevel focus title:"$emacswin"
exec wlrctl toplevel focus title:"$emacswin"
exit
fi
fi
else
emacsclient -c &
exec emacsclient -c &
fi

View file

@ -12,16 +12,16 @@ if [ $(pgrep -c firefox) -gt 0 ]; then
# echo $emacsrg
if [ -z $ffrg ]; then
firefox
exec firefox
exit
else
wmctrl -ia $ffrg
exec wmctrl -ia $ffrg
exit
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
echo "KDE"
/home/chris/bin/ww -f firefox -c firefox
exec /home/chris/bin/ww -f firefox -c firefox
exit
else
# WAYLAND
@ -30,10 +30,10 @@ if [ $(pgrep -c firefox) -gt 0 ]; then
ffwin=$(echo $ffrg | sed 's/.*\: //')
# echo $ffwin
wlrctl toplevel focus title:"$ffwin"
exec wlrctl toplevel focus title:"$ffwin"
exit
fi
fi
else
firefox
exec firefox
fi

21
scripts/mem-plasma-diy.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
ID=$1
while true
do
COMMAND="systemmonitor"
# font='VictorMono Nerd Font' color=#ff9f43 size=11
read used total <<< $(free -m | awk '/Mem/{printf $2" "$3}')
percent=$(bc -l <<< "100 * $total / $used")
mem=$(awk -v u=$used -v t=$total -v p=$percent 'BEGIN {printf "%sMi/%sMi %.1f% ", t, u, p}'| awk '{printf $2}')
DATA="| A |  $mem | |$COMMAND |"
qdbus org.kde.plasma.doityourselfbar /id_$ID \
org.kde.plasma.doityourselfbar.pass "$DATA"
sleep 2s
done

View file

@ -1,4 +1,4 @@
#!/run/current-system/sw/bin/bash
#!/bin/bash
# Get the percentage of used memory and print it
read used total <<< $(free -m | awk '/Mem/{printf $2" "$3}')

16
scripts/muunread-plasma-diy.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
ID=$1
while true
do
COMMAND="emacsclient -c -e (mu4e)"
muunread="$(mu find flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" | wc -l)"
DATA="| A |  $muunread | |$COMMAND |"
qdbus org.kde.plasma.doityourselfbar /id_$ID \
org.kde.plasma.doityourselfbar.pass "$DATA"
sleep 60s
done

View file

@ -12,15 +12,15 @@ if [ $(pgrep -c qutebrowser) -gt 0 ]; then
# echo $emacsrg
if [ -z $qbrg ]; then
qutebrowser
exec qutebrowser
exit
else
wmctrl -ia $qbrg
exec wmctrl -ia $qbrg
exit
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
/home/chris/bin/ww -f org.qutebrowser.qutebrowser -c qutebrowser
exec /home/chris/bin/ww -f org.qutebrowser.qutebrowser -c qutebrowser
exit
else
echo "other wayland"
@ -30,10 +30,10 @@ if [ $(pgrep -c qutebrowser) -gt 0 ]; then
qbwin=$(echo $qbrg | sed 's/\(.*r\)\:.*/\1/')
# echo $ffwin
wlrctl toplevel focus "$qbwin"
exec wlrctl toplevel focus "$qbwin"
exit
fi
fi
else
qutebrowser
exec qutebrowser
fi

View file

@ -21,7 +21,7 @@ declare -a options=(
"cancel"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -theme /home/chris/dotfiles/rofi/launchers-git/$style.rasi -dmenu -p 'Clip or Save')
choice=$(printf '%s\n' "${options[@]}" | rofi -theme /home/chris/.config/rofi/launchers-git/$style.rasi -dmenu -p 'Clip or Save')
if [[ "$choice" == "cancel" ]]; then
rm /tmp/$timestamp.png

10
scripts/startup.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
nextcloud --background &
rbw-agent &
killall jellyfin-mpv-shim && jellyfin-mpv-shim &
/usr/lib/kdeconnectd &
emacs --daemon &
nm-applet &
greenclip daemon &
waybar &

View file

@ -1,4 +1,4 @@
#!/run/current-system/sw/bin/bash
#!/bin/bash
# Usage: ww -f "window class filter" -c "run if not found"
# Usage: ww -fa "window title filter" -c "run if not found"
@ -116,5 +116,5 @@ if [ -n "$IS_RUNNING" ] || [ -n "$FILTERALT" ]; then
# uninstall it
dbus-send --session --dest=org.kde.KWin --print-reply=literal /Scripting org.kde.kwin.Scripting.unloadScript "string:$SCRIPT_NAME" >/dev/null 2>&1
elif [ -n "$COMMAND" ]; then
$COMMAND &
exec $COMMAND &
fi