diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-01-21 23:05:03 +0100 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-01-21 23:05:03 +0100 |
commit | a5d21a49ccdc6141790085d4bd26b667b8d5618d (patch) | |
tree | c952cf834458da4938dfca837abe6323283d2bb8 | |
parent | efcd2b7cdb03a354bd4311bac75953738ec34e4f (diff) |
checkpoint
-rwxr-xr-x | bin/common/saf | 14 | ||||
-rwxr-xr-x | bin/extra/202020 | 4 | ||||
-rwxr-xr-x | bin/extra/gdbcore | 4 | ||||
-rwxr-xr-x | bin/extra/muz-sync | 25 | ||||
-rwxr-xr-x | bin/extra/rek | 16 | ||||
-rwxr-xr-x | bin/guiscripts/vrec | 38 | ||||
-rwxr-xr-x | bin/menuscripts/mpower | 9 | ||||
-rwxr-xr-x | bin/menuscripts/pomo | 12 | ||||
-rwxr-xr-x | config/X/x11/xinitrc | 1 | ||||
-rwxr-xr-x | config/common/tmux/tmux.conf | 2 | ||||
-rw-r--r-- | config/essentials/shell/aliases.sh | 1 | ||||
-rw-r--r-- | config/essentials/shell/functions.sh | 17 | ||||
-rw-r--r-- | config/essentials/starship.toml | 3 | ||||
-rw-r--r-- | config/extra/kdeglobals | 19 |
14 files changed, 118 insertions, 47 deletions
diff --git a/bin/common/saf b/bin/common/saf index 2936346..7323339 100755 --- a/bin/common/saf +++ b/bin/common/saf @@ -2,7 +2,7 @@ # Simple Ass Fetch by futxlii -red="$(printf '\033[31m')" +cyan="$(printf '\033[36m')" blue="$(printf '\033[34m')" reset="$(printf '\033[0m')" @@ -24,10 +24,14 @@ done KERNEL="$(uname -r)" UPTIME="$(uptime -p)"; UPTIME="${UPTIME##up }" SHELL="$(basename "$SHELL")" +MEMORY_USED="$(free --bytes | awk 'NR==2 {print $3}' | numfmt --to=iec-i --format '%.2f')" +MEMORY_TOTAL="$(free --bytes | awk 'NR==2 {print $2}' | numfmt --to=iec-i --format '%.2f')" cat <<EOF - ${red}- ${blue}${ID:-"unknown"} - ${red}- ${blue}$KERNEL - ${red}- ${blue}$UPTIME ($(load)) - ${red}- ${blue}$SHELL${reset} + ${blue}OS: ${cyan}${NAME:-"unknown"} + ${blue}Kernel: ${cyan}$KERNEL + ${blue}Desktop: ${cyan}$XDG_CURRENT_DESKTOP${reset} + ${blue}Shell: ${cyan}$SHELL${reset} + ${blue}Memory: ${cyan}$MEMORY_USED / $MEMORY_TOTAL + ${blue}Uptime: ${cyan}$UPTIME ($(load)) EOF diff --git a/bin/extra/202020 b/bin/extra/202020 index 35ce1c9..9833e48 100755 --- a/bin/extra/202020 +++ b/bin/extra/202020 @@ -5,10 +5,10 @@ sounds="$HOME/sync/share/sounds" if [ "$1" ]; then $mpvCommand "$sounds"/avert1.ogg & - herbe '202020' 'avert!' & + notify-send '_202020' '*avert!' & sleep 20s $mpvCommand "$sounds"/avert2.ogg & - herbe '202020' 'stop averting' & + notify-send '_202020' '*stop averting' & exit fi diff --git a/bin/extra/gdbcore b/bin/extra/gdbcore index 6daafa8..f44a020 100755 --- a/bin/extra/gdbcore +++ b/bin/extra/gdbcore @@ -11,8 +11,9 @@ cache="$HOME/.cache/gdbcore_prog" -if [ "$#" -lt 1 ]; then +if [ "$1" = "-h" ]; then >&2 printf 'usage: gdbcore [-r] <program>\n' + exit 1 fi if [ "$1" = "-r" ]; then @@ -64,6 +65,7 @@ else line="$(sed -n "${nr}p" "$tmp")" corefile="$coredir"/"${line%% *}" fi +>&2 printf 'corefile: %s\n' "$corefile" if [ ! -f "$corefile" ]; then rm -f "$tmp" diff --git a/bin/extra/muz-sync b/bin/extra/muz-sync index 3a5c5f1..0c2dba2 100755 --- a/bin/extra/muz-sync +++ b/bin/extra/muz-sync @@ -1,9 +1,28 @@ #!/bin/sh trap "exit 1" INT -music="$(xdg-user-dir MUSIC)" ->&2 printf "music: %s\n" "$music" +[ "$1" ] && path="$1" || path="/media/basilisk/music/sorted/" +[ "$2" ] && music="$2" || music="$(xdg-user-dir MUSIC)" +[ "$3" ] && host="$3" || host="autumn" -while ! rsync --recursive --verbose --partial --progress --ignore-existing --size-only db:/media/basilisk/music/sorted/ "$music" +>&2 printf '%s:%s -> %s\n' "$host" "$path" "$music" + +>&2 printf 'Confirm? [y/N] ' +answer="$(head -n 1)" +[ "$answer" ] || exit 1 + +if [ "$answer" != "y" ] && [ "$answer" != "Y" ]; then + exit 1 +fi + +# retry until failure +while ! rsync \ + --recursive \ + --verbose \ + --partial \ + --progress \ + --ignore-existing \ + --size-only \ + "$host":"$path" "$music" do : done diff --git a/bin/extra/rek b/bin/extra/rek deleted file mode 100755 index b5baac7..0000000 --- a/bin/extra/rek +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# Record desktop with ffmpeg, strip metadata and use mp4 for relative small file size -# copy the path of the output file to the system clipboard for sharing -out="out.mp4" - -# with audio -if [ "$1" = "-a" ] -then - ffmpeg -y -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i default -map 0:v -map 0:a? -map_metadata -1 -map_metadata:s:v -1 -map_metadata:s:a -1 -map_chapters -1 -disposition 0 "$out" -else - ffmpeg -y -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0+0,0 -map 0:v -map 0:a? -map_metadata -1 -map_metadata:s:v -1 -map_metadata:s:a -1 -map_chapters -1 -disposition 0 "$out" -fi - -# copy output path -readlink -f "$out" | clipp diff --git a/bin/guiscripts/vrec b/bin/guiscripts/vrec index 6af8d58..e16679d 100755 --- a/bin/guiscripts/vrec +++ b/bin/guiscripts/vrec @@ -45,15 +45,14 @@ record_cmd() w=$(($3 + $3 % 2)) h=$(($4 + $4 % 2)) ffmpeg $audio \ - -v 16 \ + -hide_banner \ -r 30 \ -f x11grab \ -s "${w}x${h}" \ -i ":0.0+$1,$2" \ - -preset slow \ - -c:v h264 \ + -preset ultrafast\ + -c:v libx264 \ -pix_fmt yuv420p \ - -crf 20 \ "$5/$6.mp4" rm -f "$lock" herbe "vrec" "stopped recording." & @@ -69,14 +68,21 @@ else dir="$(xdg-user-dir VIDEOS)" [ -d "$dir" ] && dir="$dir/records" || dir="$HOME" fi +mkdir -p "$dir" + # Set audio variable if [ "$1" = "-a" ] then - ## Mic - # audio="-f pulse -ac 2 -i default" - ## Desktop - audio="-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1" - shift + if [ "$2" = "-m" ] + then + ## Mic + audio="-f pulse -ac 2 -i default" + shift + else + ## Desktop + audio="-f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 1" + fi + shift fi output="$(date +%F_%H-%M-%S)" @@ -99,7 +105,7 @@ case "$option" in ;; stop) pid="$(pgrep ffmpeg | xargs ps | grep 'x11grab' | awk '{print $1}')" - [ "$pid" ] && kill "$pid" + [ "$pid" ] && kill -TERM $pid rm -f "$lock" herbe "vrec" "stopped recording." & ;; @@ -108,6 +114,16 @@ case "$option" in printf '%s' "$file" | clipp ;; full) record_cmd 0 0 1920 1080 "$dir" "$output" ;; - audio) $0 -a; exit ;; + audio) + choice="$(printf 'mic\ndesktop\n' | dmenu -c)" + [ "$choice" ] || exit 1 + if [ "$choice" = "desktop" ] + then + $0 -a + else + $0 -a -m + fi + exit + ;; help|*) >&2 printf 'record [dir] (active|part|stop|full|last|audio)\n' ;; esac diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index b4b8640..fb7249d 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -9,6 +9,15 @@ hibernate EOF )" +if [ "$(hostname)" = "winter" ]; then + if [ "$choice" = "firmware" ]; then + systemctl reboot --firmware-setup + exit + fi + systemctl "$choice" + exit +fi + case "$choice" in "suspend") doas /usr/sbin/zzz ;; "poweroff") doas /usr/sbin/poweroff ;; diff --git a/bin/menuscripts/pomo b/bin/menuscripts/pomo index 07db166..5b52ebd 100755 --- a/bin/menuscripts/pomo +++ b/bin/menuscripts/pomo @@ -1,7 +1,9 @@ #!/bin/sh -# time in minutes of one pomodoro +# time in minutes [ "$SLEEP_TIME" ] || SLEEP_TIME=25 +[ "$BREAK_TIME" ] || BREAK_TIME=5 +[ "$GIGA_BREAK_TIME" ] || GIGA_BREAK_TIME=20 ### FUNCTIONS notif() { @@ -25,7 +27,7 @@ player_command() { # $1: time in minutes # $2: msg for notification ring_ring() { - printf >&2 '%s B %s\n' "$(date '+%R')" "$round" + printf >&2 '%s %s [%s]\n' "$(date '+%R')" "Break" "$round" player_command herbe "pomo" "$2" & sleep "${1}m" @@ -62,13 +64,13 @@ done while true; do notif "*START" - printf >&2 '%s S %s\n' "$(date '+%R')" "$round" + printf >&2 '%s %s [%s]\n' "$(date '+%R')" "Start" "$round" sleep "${SLEEP_TIME}m" if [ "$round" -eq 3 ]; then - ring_ring 20 "*GIGA BREAK TIME" + ring_ring "$GIGA_BREAK_TIME" "*GIGA BREAK TIME" round=0 else - ring_ring 5 "*BREAK TIME" + ring_ring "$BREAK_TIME" "*BREAK TIME" round=$((round + 1)) fi done diff --git a/config/X/x11/xinitrc b/config/X/x11/xinitrc index 2ec027e..9de64f7 100755 --- a/config/X/x11/xinitrc +++ b/config/X/x11/xinitrc @@ -23,5 +23,6 @@ fi export MENUCMD="dmenu" export IMAGE="feh" +export XDG_CURRENT_DESKTOP="dwm" exec startdwm diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 4af91fa..ae6d5b8 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -66,7 +66,7 @@ bind J command-prompt -1p "Send to window:" "join-pane -t \:%% ; select-window - # Break pane without losing focus bind b break-pane -t : # Reset length and shit -bind z select-layout main-vertical +bind-key z resize-pane -Z bind-key h select-pane -L bind-key j select-pane -D diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index 10a72b1..70d65fc 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -112,7 +112,6 @@ alias pkb='pkgfile -b' alias trr='transmission-remote debuc.com' alias trls='transmission-remote debuc.com -t all -l' alias tradd='transmission-remote debuc.com -a' -alias trclipo='transmission-remote debuc.com -a "$(clipo)"' alias grub-update='doas grub-mkconfig -o /boot/grub/grub.cfg' diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index f249c14..39c5e19 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -76,7 +76,6 @@ to_webm() { ffmpeg -y -i "$1" -vcodec libvpx -cpu-used -12 -deadline realtime "$ ngenable() { ln -sf /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/; } remove_audio() { ffmpeg -i "$1" -cpu-used -$(nproc) -deadline realtime -c copy -an "${2:-out.mp4}"; } nasg() { smbclient //192.168.178.24/Public/ -D ENFANTS/Luca/tmp -N -c "get $1"; } -trll() { printf "%s\n" "$1" | trl 2>/dev/null; } vidlen() { date -u -d @"$(ffprobe -show_entries format=duration -v quiet -of csv="p=0" -i "$1")" +'%T'; } pcp() { readlink -f "$1" | tr -d '\n' | clipp; } @@ -387,3 +386,19 @@ ssl_req() { [ "$2" ] || return 2 openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out "$1" -keyout "$2" } + +trclipo() +{ + magnet="$(clipo)" + if ! printf '%s\n' "$magnet" | grep '^magnet:' > /dev/null 2>&1 + then + >&2 printf 'Not a magnet.\n' + return 1 + fi + + category="$(printf "music\nanime\nmovies\nshows\nother\nsoftware\ngames\nisos\nbooks\n" | fzf)" + [ "$category" ] || return 2 + + transmission-remote debuc.com -a -w "/downloads/$choice" "$magnet" + +} diff --git a/config/essentials/starship.toml b/config/essentials/starship.toml index abda192..ec9046b 100644 --- a/config/essentials/starship.toml +++ b/config/essentials/starship.toml @@ -46,7 +46,8 @@ disabled = true disabled = true [nodejs] disabled = true - +[dotnet] +disabled = true # [custom.upds] # command = 'cat ~/.cache/updates' # shows output of command diff --git a/config/extra/kdeglobals b/config/extra/kdeglobals index e1465b0..4e5a3c2 100644 --- a/config/extra/kdeglobals +++ b/config/extra/kdeglobals @@ -1,2 +1,21 @@ [$Version] update_info=filepicker.upd:filepicker-remove-old-previews-entry + +[KFileDialog Settings] +Allow Expansion=false +Automatically select filename extension=true +Breadcrumb Navigation=true +Decoration position=2 +LocationCombo Completionmode=5 +PathCombo Completionmode=5 +Show Bookmarks=false +Show Full Path=false +Show Inline Previews=true +Show Speedbar=true +Show hidden files=false +Sort by=Name +Sort directories first=true +Sort hidden files last=false +Sort reversed=false +Speedbar Width=148 +View Style=DetailTree |