updates and a lot of em

This commit is contained in:
Chris Cochrun 2022-04-26 12:40:23 -05:00
parent 30cd55aca8
commit bd0cf6ff9b
37 changed files with 618 additions and 96 deletions

4
scripts/batget Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
notify-send "$(batinfo)" --icon=battery

View file

@ -1,10 +1,13 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
capacity=$(cat /sys/class/power_supply/BAT1/capacity)
status=$(cat /sys/class/power_supply/BAT1/status)
if [ $status = 'Charging' ]; then
icon=''
else
icon=''
fi
echo $icon $capacity
echo $icon $capacity

3
scripts/dlaudio Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
alacritty -e yt-dlp -x -o '/home/chris/Music/%(title)s.%(ext)s ' $1

3
scripts/dlvideo Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
alacritty -e yt-dlp -o '/home/chris/Videos/%(title)s.%(ext)s ' $1

View file

@ -15,7 +15,6 @@ if [ $(pgrep -c emacsclient) -gt 0 ]; then
wmctrl -ia $emacsrg
exit
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
ww -f emacs -c emacsclient

View file

@ -11,10 +11,13 @@ else
#echo "this is not hidpi"
fi
lolcate | rofi -dmenu -p "File Search:" -i -matching regex -theme ~/.config/rofi/launchers-git/$style.rasi | xargs -r0 xdg-open $@ &
c=0
while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
sleep .1
c=$((c+1))
[[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
done
lolcate | rofi -dmenu -p " " -i -matching regex -theme ~/.config/rofi/launchers-git/$style.rasi | xargs -r0 xdg-open
# $@ &
# c=0
# while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
# sleep .1
# c=$((c+1))
# [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
# done

View file

@ -27,18 +27,19 @@ list_passwords() {
passwords=$(rbw list)
prompt='search for passwords...'
prompt='BW'
if [ $XDG_SESSION_TYPE = "x11" ]; then
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi $@ &
c=0
while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
sleep .1
c=$((c+1))
[[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
done
SECRET=$(list_passwords | rofi -i -p "${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi
# $@ &
# c=0
# while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
# sleep .1
# c=$((c+1))
# [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
# done
)
else
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi)
SECRET=$(list_passwords | rofi -i -p "${prompt}" -dmenu -theme ~/.config/rofi/launchers-git/$style.rasi)
fi
# Ask whether pass, user or both are required
@ -49,16 +50,17 @@ options=("Password" \
"OTP")
if [ $XDG_SESSION_TYPE = "x11" ]; then
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -p="..." -theme ~/.config/rofi/launchers-git/$style.rasi $@ &
c=0
while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
sleep .1
c=$((c+1))
[[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
done
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -p "" -theme ~/.config/rofi/launchers-git/$style.rasi
# $@ &
# c=0
# while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
# sleep .1
# c=$((c+1))
# [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
# done
)
else
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -p="..." -theme ~/.config/rofi/launchers-git/$style.rasi)
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -p "" -theme ~/.config/rofi/launchers-git/$style.rasi)
fi
# echo $option

View file

@ -1,3 +1,5 @@
#!/bin/sh
notify-send " $(light -G) ﯧ "
awesome-client "naughty.destroy_all_notifications()"
notify-send "$(light -G)" --icon=display-brightness

View file

@ -1,9 +1,42 @@
#!/bin/sh
window=$(wmctrl -l | awk '{print $4}' | rg org-agenda)
active=$(xdotool getwindowfocus getwindowname)
# Check to see if an emacsclient is running
if [ $(pgrep -c emacsclient) -gt 0 ]; then
if [ $XDG_SESSION_TYPE = "x11" ]; then
#X11
window=$(wmctrl -lx | rg org-agenda | awk '{print $1}')
# echo $emacsrg
if [ -z $window ]; then
emacsclient -e '(chris/org-agenda)' &
exit
else
if [ $window = $active ]; then
wmctrl -ir $window -b toggle,hidden
else
wmctrl -ia $window
exit
fi
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
ww -f emacs -c emacsclient
exit
else
# WAYLAND
emacsrg=$(wlrctl window list | rg 'emacs:\sorg-agenda' | rg 'emacs:')
emacswin=$(echo $emacsrg | sed 's/.*\: //')
# echo $emacswin
wlrctl toplevel focus title:"$emacswin"
exit
fi
fi
if [ -z $window ]; then
wmctrl -a $window
else
emacsclient -e '(chris/org-agenda)'
emacsclient -e '(chris/org-agenda)' &
fi

View file

@ -1,5 +1,16 @@
#!/bin/bash
if [ $(hostname) = "syl" ]; then
if [ $XDG_SESSION_TYPE = "x11" ]; then
style="laptop-search"
else
style="laptop-search-wayland"
fi
else
style="desktop-search"
#echo "this is not hidpi"
fi
timestamp=$(date +%F-%T)
picture=$(maim --hidecursor --select /tmp/$timestamp.png)
@ -10,7 +21,7 @@ declare -a options=(
"cancel"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -p 'Clip or Save')
choice=$(printf '%s\n' "${options[@]}" | rofi -theme /home/chris/dotfiles/rofi/launchers-git/$style.rasi -dmenu -p 'Clip or Save')
if [[ "$choice" == "cancel" ]]; then
rm /tmp/$timestamp.png

5
scripts/timeget Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
notify-send "$(date +"%h %d, %H:%M:%S %p")" --icon=time

7
scripts/voldown Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
pactl set-sink-volume @DEFAULT_SINK@ -5%
paplay /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga
volume=$(pulsemixer --get-volume | awk '{print $1}')
notify-send $volume

7
scripts/volup Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
pactl set-sink-volume @DEFAULT_SINK@ +5%
paplay /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga
volume=$(pulsemixer --get-volume | awk '{print $1}')
notify-send $volume