Update to current state

This commit is contained in:
2024-03-09 13:38:38 +01:00
parent dedfe7285e
commit b8b5a9f45e
26 changed files with 265 additions and 394 deletions

View File

@ -6,10 +6,7 @@
#automatically scale HD screens to better work with hidpi
scale_factor_HD=${1:-1.6666}
scale_outputs="HDMI-3
DP-2
HDMI-1-3
DP1-2"
scale_outputs="HDMI-1 DP-7"
#fixes issue that script gets called twice for some reason
@ -45,7 +42,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
secondary=$(echo "$screens" | grep -v "$primary")
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
if $(echo "$scale_outputs" | grep -q "$primary"); then
if echo "$scale_outputs" | grep -q "$primary"; then
xrandr --output "$primary" --auto --scale $scale_factor_HD --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
elif $(echo "$scale_outputs" | grep -q "$seconday"); then
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale $scale_factor_HD

View File

@ -1,7 +1,6 @@
#!/bin/sh
DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/dbus_session_bus_address)
export DBUS_SESSION_BUS_ADDRESS
export DISPLAY=:0.0
export DBUS_SESSION_BUS_ADDRESS=$(cat /tmp/dbus_session_bus_address)
#export DISPLAY=:0.0
newsboat -x reload & pid=$!
sleep 120
kill -15 $pid

View File

@ -5,8 +5,8 @@
VIRTUAL_PRINTER_DIR="/var/spool/cups-pdf/$USER"
# Printer to print magazine layout on
PRINTER="Canon-MF220"
PRINTER=Virtual_PDF_Printer
file="$@"
#PRINTER=Virtual_PDF_Printer
file="$1"
lpr -P Virtual_PDF_Printer -o number-up=2 -o orientation-requested=4 -o fit-to-page -o media=a4 "$file"
str="."
until lpc status | grep -A 4 'Virtual_PDF_Printer:' | tail -n1 | grep 'no entries'; do

View File

@ -23,9 +23,10 @@ do
echo "Error. Capacity:$capacity" > /dev/stderr &&
continue
# do not display full batteries (nice to unclutter status bars for laptops mostly used stationiary)
[ "$capacity" -eq 100 ] &&
printf '\n' &&
if [ "$capacity" -eq 100 ] || grep -q "Full" "$battery"/status; then
printf '\n'
continue
fi
unset status
status=$(sed "s/Not charging/🛑/" "$battery"/status)

View File

@ -8,21 +8,21 @@ echo "syncclouds.sh: moodle-dl"
# remove lock file if moodle-dl is not running
pgrep -x moodle-dl || [ -f ~/eth/.moodle/running.lock ] && rm ~/eth/.moodle/running.lock
cd ~/eth/.moodle && moodle-dl
} > /dev/null 2>&1 &
}
moodle_pid=$!
# sync nextcloud drive
echo "syncclouds.sh: nextcloudcmd"
{
nextcloudcmd -u "alexander" --password "$(pass show Misc/nextcloud_token | head -n1)" ~/dox/nextcloud https://cloud.bocken.org
} > /dev/null 2>&1 &
}
nextcloud_pid=$!
# sync contacts to nextcloud
echo "syncclouds.sh: vdirsyncer"
{
vdirsyncer sync
} > /dev/null 2>&1 &
}
vdirsyncer_pid=$!
# sync calendar to nextcloud
@ -31,7 +31,7 @@ echo "syncclouds.sh: calcurse-caldav"
# remove lock file if calcurse-caldav is not running
pgrep -x calcurse-caldav || [ -f ~/.local/share/calcurse/caldav/lock ] && rm ~/.local/share/calcurse/caldav/lock
CALCURSE_CALDAV_PASSWORD=$(pass Misc/calcurse_token) calcurse-caldav
} > /dev/null 2>&1 &
}
calcurse_pid=$!
# Wait for all processes to complete and print a message for each one

View File

@ -11,7 +11,7 @@ makepathabsolute(){
echo "$dl_location"
}
choices="$(printf 'mpv\ncopy url\nqueue download\nrifle file\nqueue youtube-dl\nbrowser\nrip media\ncast')"
choices="$(printf 'mpv\ncopy url\nqueue download\nrifle file\nqueue youtube-dl\nbrowser\nrip media\ncast\nadd torrent\n')"
if echo "$1" | grep -q "4chan"; then
choices="$(printf '%s\nwatch thread' "$choices")"
fi
@ -38,7 +38,13 @@ case "$choice" in
mkdir -p "$(makepathabsolute "$dest")"
threadwatcher add "$1" "$dest" &
notify-send "dmenuhandler" "Thread watcher started. Download initialized.";;
"rip media") dest="$(dmenuinput 'name of folder:')"
lynx --dump --nonumbers --listonly "$1" | grep -E "\.(webm|mp4|gif|jpg|jpeg|png|pdf|epub|mobi|djvu)" | sort -u | xargs wget -P "$(makepathabsolute "$dest")"
notify-send "dmenuhandler" "all media ripped into $dest";;
"rip media") dest="$(dmenuinput 'name of folder:')"
lynx --dump --nonumbers --listonly "$1" | grep -E "\.(webm|mp4|gif|jpg|jpeg|png|pdf|epub|mobi|djvu)" | sort -u | xargs wget -P "$(makepathabsolute "$dest")"
notify-send "dmenuhandler" "all media ripped into $dest";;
"add torrent") echo "$1" | grep -q '^magnet:' && transadd "$1"
if echo "$1" | grep -q "\.torrent$"; then
curl -L "$1" -o "/tmp/torrentfile"
transadd "/tmp/torrentfile"
rm "/tmp/torrentfile"
fi
esac

View File

@ -4,7 +4,7 @@
#pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+12 dwmblocks)
host=https://bocken.org/transmission
host=https://bocken.org/transmission/rpc
user=alex
password=$(pass show server/seenas/transmission)
transmission-remote $host -n $user:$password -a "$@" && notify-send "🔽 Torrent added."

View File

@ -1,5 +1,5 @@
#!/bin/sh
while true; do
mpc idle player > /dev/null
pkill -RTMIN+11 dwmblocks
pkill -RTMIN+8 dwmblocks
done