diff options
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/.bashrc | 4 | ||||
| -rw-r--r-- | misc/.config/i3/config | 1 | ||||
| -rw-r--r-- | misc/.config/mimeapps.list | 4 | ||||
| -rw-r--r-- | misc/.config/mpv/input.conf | 1 | ||||
| -rw-r--r-- | misc/.config/mpv/mpv.conf | 3 | ||||
| -rw-r--r-- | misc/.config/rofi/config.rasi | 2 | ||||
| -rw-r--r-- | misc/.gdbinit | 7 | ||||
| -rw-r--r-- | misc/.local/share/applications/emacsclient-web.desktop | 20 | ||||
| -rwxr-xr-x | misc/bin/merge-tracks.sh | 25 | ||||
| -rwxr-xr-x | misc/bin/mpvmix.sh | 22 | ||||
| -rwxr-xr-x | misc/bin/mv-single-pages.sh | 3 | ||||
| -rwxr-xr-x | misc/bin/ttrss-fetch.el | 10 | ||||
| -rwxr-xr-x | misc/bin/unzipall.sh | 8 | ||||
| -rwxr-xr-x | misc/bin/zipall.sh | 9 | 
14 files changed, 114 insertions, 5 deletions
diff --git a/misc/.bashrc b/misc/.bashrc index b425d61..2d44565 100644 --- a/misc/.bashrc +++ b/misc/.bashrc @@ -275,12 +275,12 @@ fi  # gs-extract 4 11 page-4-thru-11.pdf original.pdf  gs-extract() {    gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=$1 -dLastPage=$2 \ -     -sOutputFile=$3 $4 +     -sOutputFile="$3" "$4"  }  # ghostscript, merge files: gs-merge merged.pdf 1.pdf 2.pdf  gs-merge() { -  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$* +  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="$@"  }  # dptrp1 diff --git a/misc/.config/i3/config b/misc/.config/i3/config index 31b74ad..803dcd1 100644 --- a/misc/.config/i3/config +++ b/misc/.config/i3/config @@ -211,3 +211,4 @@ bindsym $mod+minus exec dunstctl close  exec ibus-daemon  exec redshift-gtk  exec --no-startup-id i3-msg 'workspace $ws1; exec urxvt' +exec xscreensaver -no-splash & diff --git a/misc/.config/mimeapps.list b/misc/.config/mimeapps.list index e0b551f..413a9f5 100644 --- a/misc/.config/mimeapps.list +++ b/misc/.config/mimeapps.list @@ -36,8 +36,8 @@ video/quicktime=vlc.desktop  video/x-msvideo=mpv.desktop  x-scheme-handler/chrome=firefox.desktop  x-scheme-handler/ftp=filezilla.desktop -x-scheme-handler/http=firefox.desktop -x-scheme-handler/https=firefox.desktop +x-scheme-handler/http=emacsclient-web.desktop +x-scheme-handler/https=emacsclient-web.desktop  x-scheme-handler/mailto=emacsclient-mail.desktop  x-scheme-handler/sgnl=signal-desktop.desktop  x-scheme-handler/org-protocol=emacsclient-org-protocol.desktop diff --git a/misc/.config/mpv/input.conf b/misc/.config/mpv/input.conf index 890da80..0238138 100644 --- a/misc/.config/mpv/input.conf +++ b/misc/.config/mpv/input.conf @@ -1,2 +1,3 @@  PREV seek -15  NEXT stop +a vf toggle hflip diff --git a/misc/.config/mpv/mpv.conf b/misc/.config/mpv/mpv.conf index a3f5d24..b6b1beb 100644 --- a/misc/.config/mpv/mpv.conf +++ b/misc/.config/mpv/mpv.conf @@ -6,6 +6,9 @@ save-position-on-quit  script-opts=ytdl_hook-ytdl_path=/usr/bin/yt-dlp  ytdl-format="bestvideo[height<=?720]+bestaudio/best"  osc=no +stop-screensaver = "yes" +# play audio with ui +# profile=pseudo-gui  [emacsconf-talks]  # Positioning diff --git a/misc/.config/rofi/config.rasi b/misc/.config/rofi/config.rasi index aab83de..041b095 100644 --- a/misc/.config/rofi/config.rasi +++ b/misc/.config/rofi/config.rasi @@ -33,7 +33,7 @@ configuration {  /*	parse-hosts: false;*/  /*	parse-known-hosts: true;*/  	combi-modes: "run,drun"; -	matching: "glob"; +	matching: "prefix";  /*	tokenize: true;*/  /*	m: "-5";*/  /*	filter: ;*/ diff --git a/misc/.gdbinit b/misc/.gdbinit index b84dbef..00be34f 100644 --- a/misc/.gdbinit +++ b/misc/.gdbinit @@ -1,3 +1,5 @@ +set debuginfod enabled on +set max-completions 20  set print static-members off  set print frame-arguments all  # unlimited print string length @@ -35,7 +37,12 @@ alias pvtable = print /a (*(void ***))  set unwindonsignal on  set print vtbl on  set print pretty on +set index-cache enabled on  # rr  alias rf = reverse-finish +define wlrc +  watch -l $arg0 +  rc +end  source ~/.gdbinit_local diff --git a/misc/.local/share/applications/emacsclient-web.desktop b/misc/.local/share/applications/emacsclient-web.desktop new file mode 100644 index 0000000..5beb0f3 --- /dev/null +++ b/misc/.local/share/applications/emacsclient-web.desktop @@ -0,0 +1,20 @@ +[Desktop Entry] +Categories=Network;Web; +Comment=GNU Emacs is an extensible, customizable text editor - and more +Exec=/usr/bin/emacsclient -n %u +Icon=emacs +Name=Emacs (Web Browser, Client) +MimeType=x-scheme-handler/http;x-scheme-handler/https; +NoDisplay=true +Terminal=false +Type=Application +Keywords=emacsclient; +Actions=new-window;new-instance; + +[Desktop Action new-window] +Name=New Window +Exec=/usr/bin/emacsclient --create-frame -n %u + +[Desktop Action new-instance] +Name=New Instance +Exec=emacs -f browse-url %u diff --git a/misc/bin/merge-tracks.sh b/misc/bin/merge-tracks.sh new file mode 100755 index 0000000..ddfc36d --- /dev/null +++ b/misc/bin/merge-tracks.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Consolidate albums of < 3 tracks to a "medley" album + +find . -wholename './.git' -prune -o -type d -links 2 \ +     -exec /bin/bash -c 'a=( "{}"/* ); [[ ${#a[*]} -lt 3 ]]' ';' -print | +  while IFS=$'\n' read -r dir; do +    for f in "$dir"/*; do +      # echo "$f" +      p1=$(echo "$f" | cut -d/ -f 2) +      p2=$(basename "$f") +      if [[ "$p1" == "Various Artists" ]]; then +        newf="./Various Artists/Medley/$p2" +      else +        newf="./Various Artists/Medley/$p1-$p2" +      fi +      git mv "$f" "$newf" +    done +  done + +# May need to do multiple times to remove all empty dirs +find . -wholename './.git' -prune -o -type d -empty -print | +  while IFS=$'\n' read -r dir; do +    echo rmdir "$dir" +  done diff --git a/misc/bin/mpvmix.sh b/misc/bin/mpvmix.sh new file mode 100755 index 0000000..8bc0ac8 --- /dev/null +++ b/misc/bin/mpvmix.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Randomly play media segments from a list of files with start and end +# time line format: +# 1:00//1:05//~/file.mp4 + +f="$1" +n=$(cat "$f" | wc -l) +while true; do +  while read -r line; do +    echo "$line" +    regex='([0-9:]+)//([0-9:]+)//(.+)' +    [[ "$line" =~ $regex ]] || continue +    start=${BASH_REMATCH[1]} +    end=${BASH_REMATCH[2]} +    media=${BASH_REMATCH[3]} +    media="${media/#~/${HOME}}" +    # echo "start: $start; end: $end; file: $media" +    mpv --start=$start --end=$end "$media" +  done <<<$(shuf -n $n "$f") +  sleep 1 +done diff --git a/misc/bin/mv-single-pages.sh b/misc/bin/mv-single-pages.sh new file mode 100755 index 0000000..76c234f --- /dev/null +++ b/misc/bin/mv-single-pages.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +grep -l "^ Page saved with SingleFile $" -Z ~/Downloads/*.html | xargs -0 -I {} mv {} "$MY_WEBPAGE_INCOMING_DIR/" diff --git a/misc/bin/ttrss-fetch.el b/misc/bin/ttrss-fetch.el new file mode 100755 index 0000000..770ff46 --- /dev/null +++ b/misc/bin/ttrss-fetch.el @@ -0,0 +1,10 @@ +#!/bin/emacs --script + +(add-to-list 'load-path (locate-user-emacs-file "lisp/ttrss.el")) +(add-to-list 'load-path (locate-user-emacs-file "lisp/my")) +(require 'my-ttrss) +(require 'my-package) +(my-read-local-config) +(my-setq-from-local ttrss-address ttrss-user ttrss-password) +(my-setq-from-local my-ttrss-dir) +(my-ttrss-fetch) diff --git a/misc/bin/unzipall.sh b/misc/bin/unzipall.sh new file mode 100755 index 0000000..2d654f0 --- /dev/null +++ b/misc/bin/unzipall.sh @@ -0,0 +1,8 @@ +#/bin/bash + +# unzip all zip/7z files with 7z in pwd +for f in ./*; do +  ext=${f##*.} +  if test "$ext" = zip; then 7z e "$f"; fi; +  if test "$ext" = 7z; then 7z e "$f"; fi; +done diff --git a/misc/bin/zipall.sh b/misc/bin/zipall.sh new file mode 100755 index 0000000..0a244c2 --- /dev/null +++ b/misc/bin/zipall.sh @@ -0,0 +1,9 @@ +#/bin/bash + +# zip all non-7z and non-zip files with 7z in pwd and delete the original +for f in ./*; do +  ext=${f##*.} +  if test "$ext" = zip; then continue; fi; +  if test "$ext" = 7z; then continue; fi; +  7z a -sdel "$f.7z" "$f" +done  | 
