diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-13 23:19:23 +0200 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-13 23:19:23 +0200 | 
| commit | 485c2d2ebaf238eb37a5650d364cb0031854774a (patch) | |
| tree | 8b9c11c322c426e086b4172368c704920bb0d227 | |
| parent | 02da333eb51cc5f7cfc28e194681db0e5f59d485 (diff) | |
checkpoint
| -rwxr-xr-x | bin/extra/curszip | 12 | ||||
| -rwxr-xr-x | bin/guiscripts/clipo | 4 | ||||
| -rwxr-xr-x | bin/guiscripts/clipp | 4 | ||||
| -rwxr-xr-x | bin/guiscripts/swclip (renamed from bin/guiscripts/cps) | 0 | ||||
| -rwxr-xr-x | bin/menuscripts/mmedia | 2 | ||||
| -rwxr-xr-x | bin/menuscripts/tsh | 29 | ||||
| -rwxr-xr-x | config/common/tmux/tmux.conf | 15 | ||||
| -rw-r--r-- | config/essentials/shell/aliases.sh | 4 | 
8 files changed, 42 insertions, 28 deletions
diff --git a/bin/extra/curszip b/bin/extra/curszip index 64abdb6..0de772f 100755 --- a/bin/extra/curszip +++ b/bin/extra/curszip @@ -1,13 +1,17 @@  #!/bin/sh -list1() { find "$1" -mindepth 1 -maxdepth 1 -type "${2:-d}" -printf '%f\n'; } +# $1: dir  +# $2: type +list1() { find "$1" -mindepth 1 -maxdepth 1 -type "$2" -printf '%f\n'; } -curs="$(list1 ~/docs/school/Vakken | commander -c)" +curs="$(list1 ~/docs/school/Vakken d | dmenu -c)"  [ "$curs" ] || exit 1 -zip="$(list1 ~/dl f | fzf -f "$curs" | grep '\.zip$')"  >&2 printf "curs: %s\n" "$curs" -[ "$zip" ] || exit 1 +dldir="$(which xdg-user-dir > /dev/null 2>&1 && xdg-user-dir 'DOWNLOAD' || echo '~/dl')" + +zip="$(list1 "$dldir" f | fzf -f "$curs" | grep '\.zip$')" +[ "$zip" ] || exit 1  >&2 printf "zip: %s\n" "$zip"  cd -- ~/docs/school/Vakken/"$curs" || exit 1 diff --git a/bin/guiscripts/clipo b/bin/guiscripts/clipo index ebc9a25..e554c24 100755 --- a/bin/guiscripts/clipo +++ b/bin/guiscripts/clipo @@ -1,6 +1,6 @@  #!/bin/sh -[ "$1" = "-p" ] && i='primary' j="-b" +[ "$1" = "-p" ] && i='primary' j="-p"  if [ "$WAYLAND_DISPLAY" ]  then wl-paste -n "$1" -else xsel -o $j +else xsel -o ${j:--b}  fi diff --git a/bin/guiscripts/clipp b/bin/guiscripts/clipp index d545087..c3ee8f2 100755 --- a/bin/guiscripts/clipp +++ b/bin/guiscripts/clipp @@ -1,6 +1,6 @@  #!/bin/sh -[ "$1" = "-p" ] && i='primary' j='-b' +[ "$1" = "-p" ] && i='primary' j='-p'  if [ "$WAYLAND_DISPLAY" ]  then wl-copy -n $i -else xsel $j +else xsel ${j:--b}  fi diff --git a/bin/guiscripts/cps b/bin/guiscripts/swclip index 1cae135..1cae135 100755 --- a/bin/guiscripts/cps +++ b/bin/guiscripts/swclip diff --git a/bin/menuscripts/mmedia b/bin/menuscripts/mmedia index 43a8aca..3141c3b 100755 --- a/bin/menuscripts/mmedia +++ b/bin/menuscripts/mmedia @@ -51,7 +51,7 @@ choice="$(  	grep "$regex" |  	sort | tee "$tmp" |  	concat_path | -	dmenu -px -c -i -l 10 -g 1 -F)" +	dmenu -px -c -i -l 10 -g 1 -x)"  file="$(sed -n "${choice}p" "$tmp")"  [ -r "$file" ] || exit 1 diff --git a/bin/menuscripts/tsh b/bin/menuscripts/tsh index eac0c3e..aac27ee 100755 --- a/bin/menuscripts/tsh +++ b/bin/menuscripts/tsh @@ -19,7 +19,7 @@ done  export results="$tmp/results"  export links="$tmp/links" -types="music anime movies shows other software games isos books" +categories="music anime movies shows other software games isos books"  if [ "$WAYLAND_DISPLAY" ]  then @@ -42,6 +42,9 @@ help ()  	                 Available options: seeds, size, name  	    -m MODULE    Select a module, if MODULE is 'list',  	                 lists out available modules +            -c CATEGORY  Select category +            -f           Do not list files +            -d		 Download without confirming  	EOF  } @@ -121,7 +124,7 @@ show_files()  # Select a type after having displayed them with 'show_types'  select_type()  { -	for type in $types +	for type in $categories  	do printf "%s\n" "$type"  	done | fzf  } @@ -131,10 +134,17 @@ trap "cleanup" EXIT  ## OPTIONS  skip=0 -while getopts ":hm:rs:" opt +while getopts ":hm:rs:c:fd" opt  do  	case $opt in  		h) help && exit ;; +		c) +			[ "$OPTARG" = "list" ] && >&2 printf '%s\n' "$categories" && exit +			category="$(printf '%s\n' "$categories" | tr ' ' '\n' | grep -m 1 "^$OPTARG")" +			[ -z "$category" ] && die "No valid category for '$OPTARG'" +			logn "category: $category" ;; +		f) noaskfiles="1" ;; +		d) noaskdownload="1" ;;  		m)  			[ "$OPTARG" = "list" ] && list_modules && exit  			module="$(list_modules | grep -m 1 "^$OPTARG")" @@ -185,17 +195,18 @@ getfunctions=1 . "$LIBPFX/$module"  # select result from "$results"  for choice in $(select_result | xargs)  do -    printf 'choice: %s\n' "$choice" +    printf 'choice: %s\n' "$(sed -n "${choice}p" "$results" | cut -f 3-)"      magnet="$(get_magnet "$choice")"      [ "$magnet" ] || exit 1 -    confirm 'files?' && show_files "$magnet" +    if [ -z "$noaskfiles" ] && confirm 'files?'; then +	    show_files "$magnet" +    fi -    if confirm 'download?' +    if [ "$noaskdownload" ] || confirm 'download?'      then -	    type="$(select_type)" -	    [ "$type" ] || exit 1 -	    transmission-remote debuc.com -a "$magnet" -w "/downloads/$type" +    	    [ "${category:-$(select_type)}" ] || exit 1 +	    transmission-remote debuc.com -a "$magnet" -w "/downloads/$category"      elif confirm "copy?"      then  	    echo "$magnet" | clipp diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index d8a4969..9300c97 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -43,11 +43,11 @@ bind  X     confirm -p "Kill Window?"   kill-window  bind  M-x   confirm -p "Kill Session?"  kill-session  bind  M-X   confirm -p "Kill Server?"   kill-server  # Restart pane -bind k run -C "respawn-pane -k; send-keys !! 'C-j'" -bind K respawn-pane -k +bind C-r run -C "respawn-pane -k; send-keys !! 'C-j'" +bind C-R respawn-pane -k  # Splitting  bind v split-window -h -c "#{pane_current_path}" -bind h split-window -v -c "#{pane_current_path}" +bind s split-window -v -c "#{pane_current_path}"  # Swapping left and right a la vim  bind -n M-H swap-pane -U  bind -n M-L swap-pane -D @@ -64,8 +64,10 @@ bind b break-pane -t :  # Reset length and shit  bind z select-layout main-vertical - - +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R  # Pane navigating with h|j|k|l a la vim  # Smart pane switching with awareness of Vim splits. @@ -88,9 +90,6 @@ bind-key -T copy-mode-vi 'M-k' select-pane -U  bind-key -T copy-mode-vi 'M-l' select-pane -R  bind-key -T copy-mode-vi 'M-\' select-pane -l - - -  bind -n M-u previous-window  bind -n M-i next-window  # Session navigeting with S-M-u|i diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index 876c5d0..a8b9036 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -2,7 +2,7 @@  # s/alias \([^-]\)/alias -g \1  # The most important one -alias vi='nvim' +alias vi='vis'  alias cd='z'  # Zsh specific aliases @@ -81,7 +81,7 @@ alias lst2='ls --tree -L2'  alias lst3='ls --tree -L3'  alias ls.='ls -dl .*'  which eza >/dev/null 2>&1 && -	alias ls='eza --sort extension --group-directories-first --no-time --git' || +	alias ls='eza --sort extension --group-directories-first --git' ||  	alias ls='ls --color --group-directories-first --sort=extension'  # pacman aliases  | 
