This commit is contained in:
Cynthia Foxwell 2022-11-08 09:36:46 -07:00
parent 24706d35f7
commit f7c2b96150
28 changed files with 450 additions and 1885 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

36
linux/.local/bin/autostart.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/sh
COLORSCHEME="tokyonight"
run() {
if ! pgrep "$1" ;
then
notify-send "autostart: starting $1"
"$@" &
else
notify-send "autostart: $1 already running"
fi
}
notify-send "begin autostart"
xrdb ~/.config/xrdb/main.xrdb
xrdb -merge "~/.config/xrdb/colors/$COLORSCHEME.xrdb"
xmodmap -e "keysym Menu = Multi_key"
run pipewire
run picom --config ~/.config/picom.conf
run xscreensaver -no-splash
run xmousepasteblock
run flameshot
# manual pgrep because env vars
if ! pgrep "nicotine" ; then
notify-send "autostart: starting nicotine"
env GTK_CSD=0 LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0 nicotine &
else
notify-send "autostart: nicotine already running"
fi

View file

@ -3,14 +3,14 @@
get_albumart() {
rm /tmp/albumart.jpg
local dir_name=$( dirname "$1" )
local names=(folder cover albumart front "$2")
for item in "${names[@]}" ; do
img_file=$( find "$dir_name" -maxdepth 1 -iregex ".*$item*\.\(jpg\|jpeg\|gif\|png\|\)$" -print -quit )
[ -n "$img_file" ] && cp "$img_file" /tmp/_albumart.jpg && break
done
[ -z "$img_file" ] && ffmpeg -i "$1" -an -v:c copy "/tmp/_albumart.jpg" -y && img_file="/tmp/_albumart.jpg"
[ -n "$img_file" ] && ffmpeg -i /tmp/_albumart.jpg -vf scale=72:-1 /tmp/albumart.jpg && rm /tmp/_albumart.jpg
local dir_name=$( dirname "$1" )
local names=(folder cover albumart front "$2")
for item in "${names[@]}" ; do
img_file=$( find "$dir_name" -maxdepth 1 -iregex ".*$item*\.\(jpg\|jpeg\|gif\|png\|\)$" -print -quit )
[ -n "$img_file" ] && cp "$img_file" /tmp/_albumart.jpg && break
done
[ -z "$img_file" ] && ffmpeg -i "$1" -an -vcodec copy "/tmp/_albumart.jpg" -y && img_file="/tmp/_albumart.jpg"
[ -n "$img_file" ] && ffmpeg -i /tmp/_albumart.jpg -vf scale=72:-1 /tmp/albumart.jpg && rm /tmp/_albumart.jpg
}
if [ $2 == "playing" ]; then
@ -32,5 +32,23 @@ if [ $2 == "playing" ]; then
duration_formatted+=$(printf '%02d:%02d' $(($_duration%3600/60)) $(($_duration%60)))
fi
notify-send -t 5000 -i /tmp/albumart.jpg "$_title" "$_artist\n$_album\n$duration_formatted"
details=""
if [ "$_artist" != "" ]; then
details+="$_artist"
fi
if [ "$_album" != "" ]; then
if [ "$details" != "" ]; then
details+="\n"
fi
details+="$_album"
fi
if [ "$duration_formatted" != "" ]; then
if [ "$details" != "" ]; then
details+="\n"
fi
details+="$duration_formatted"
fi
notify-send -t 5000 -i /tmp/albumart.jpg "$_title" "$details"
fi

View file

@ -92,12 +92,14 @@ function upload_file_and_notify() {
if [[ $macos == "true" ]]; then
osascript -e "display notification \"${response}\" with title \"Success!\""
else
aplay "$HOME/.local/bin/assets/done.wav" &
notify-send -t 5000 "Success!" "${response}" -i "${1}" --hint=int:transient:1
fi
else
if [[ $macos == "true" ]]; then
osascript -e "display notification \"Error uploading file\" with title \"Error!\""
else
aplay "$HOME/.local/bin/assets/error.wav" &
notify-send -t 5000 "Error!" --hint=int:transient:1
fi
fi

View file

@ -26,11 +26,12 @@ mkdir -p "$screenshot_folder"
date_str=$(date +'%Y-%m-%d-%H_%M_%S')
target="$screenshot_folder/screenie-$date_str.png"
maim -s "$target"
flameshot gui -r > "$target"
if [ ! -f "$target" ]; then
notify-send -t 5000 "screenshot not found, skipping sending"
if [ ! -s "$target" ]; then
notify-send "screenshot aborted, skipping sending"
else
aplay "$HOME/.local/bin/assets/capture.wav" &
notify-send -t 5000 "screenie: sending: $target"
source ~/.secrets
$elixiremanager "$target"