From 3f3fa5e5c9df7f43507a117b7cdbc2ddabb9d555 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 7 Nov 2023 01:24:40 +0100 Subject: concatenate dir name --- bin/guiscripts/dmfm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm index d1dd8b8..9485469 100755 --- a/bin/guiscripts/dmfm +++ b/bin/guiscripts/dmfm @@ -2,9 +2,10 @@ while true do + dir="$(printf '%s' "$PWD" | sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g")" file=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' | sort -k 1 -k 2 | cut -f 2- | - commander -xcd -p "$PWD>") + commander -xc -p "$dir") [ "$file" ] || break [ ! -e "$file" ] && continue -- cgit v1.2.3 From 09e3e0945dd31005f10d7cc18ccd5b38fdb58f97 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 10 Nov 2023 11:44:35 +0100 Subject: refactor --- bin/common/targit | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/common/targit b/bin/common/targit index ae046ac..ca560b3 100755 --- a/bin/common/targit +++ b/bin/common/targit @@ -1,6 +1,5 @@ #!/bin/sh -pwd=$(pwd) root="$(git rev-parse --show-toplevel)" cd "$root" || exit 1 -file="$(basename "$root" | sed 's/^\.//').tar.gz" -tar czf "$pwd/$file" $(git ls-files) +file="${root##*/}".tar.gz +tar czf "$file" $(git ls-files) -- cgit v1.2.3 From 2f3909181e31fb443c4ad2048a1e886e877e4a5c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 12:30:38 +0100 Subject: put channels in a subfolder --- bin/common/ytclipo | 2 +- config/essentials/zsh/aliases.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 5d86c3f..8997539 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -23,5 +23,5 @@ yt-dlp "$inp" \ -f "b" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ - -o "%(channel)s - %(title)s.%(ext)s" + -o "%(channel)s/%(title)s.%(ext)s" notify-send "ytclipo" "finished downloading." || : diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 5de4803..a166513 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -282,7 +282,7 @@ alias fzh="tac $HISTFILE | fzf | tee /dev/stderr | clipp" alias ffwin='hyprctl clients -j | jq '\''.[].pid'\'' | fzf --preview "hyprctl clients -j | jq '\''.[] | select(.pid == {}) | {class, title, workspace, xwayland}'\''"' alias pff='find ${PASSWORD_STORE_DIR:=~/src/password-store/} -name "*.gpg" | sed -e "s@$PASSWORD_STORE_DIR/@@" -e '\''s/\.gpg$//'\'' | fzf | xargs pass show -c' alias fzps='fzf --print0 | xargs -0I{}' -alias ytdl='yt-dlp --restrict-filenames --embed-chapters -f "b" -S "res:1080" -P "$HOME/vids/youtube/" -o "%(channel)s - %(title)s.%(ext)s"' +alias ytdl='yt-dlp --restrict-filenames --embed-chapters -f "b" -S "res:1080" -P "$HOME/vids/youtube/" -o "%(channel)s/%(title)s.%(ext)s"' # docker aliases alias dcb='docker build' -- cgit v1.2.3 From cbfda49e578cf18e7f5e605ca5e073fe0a1c0c17 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:19:14 +0100 Subject: added appned2mpv --- bin/extra/append2mpv | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 bin/extra/append2mpv (limited to 'bin') diff --git a/bin/extra/append2mpv b/bin/extra/append2mpv new file mode 100755 index 0000000..28c3916 --- /dev/null +++ b/bin/extra/append2mpv @@ -0,0 +1,30 @@ +#!/bin/sh +IPC="/tmp/mpvsocket" + +die () { >&2 printf '%s\n' "$@"; exit 1; } +append_to_mpv() +{ + file="$(readlink -f "$1")" + if [ ! -r "$file" ] + then + >&2 printf '%s\n' "'$file' not found" + return + fi + + echo '{ "command": ["loadfile", "'"$file"'", "append"] }' | + socat - "$IPC" +} + +[ -S "$IPC" ] || die "$IPC is not a socket or doesn't exist" +which socat > /dev/null || exit 1 + + +if [ -t 0 ] +then + append_to_mpv "$1" +else + while read -r file + do + append_to_mpv "$file" + done +fi -- cgit v1.2.3 From 2fd5995ff81e0b1792b5eab3a723d7321dec78cb Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:19:48 +0100 Subject: added sgimg --- bin/extra/sgimg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/extra/sgimg (limited to 'bin') diff --git a/bin/extra/sgimg b/bin/extra/sgimg new file mode 100755 index 0000000..7c1823c --- /dev/null +++ b/bin/extra/sgimg @@ -0,0 +1,6 @@ +#!/bin/sh + +imv "$(find ~/.local/share/gurk/ -type f -printf "%A@\t%p\n" | + sort -n | + tail -n 1 | + cut -f 2-)" -- cgit v1.2.3 From 1dcdf0cdb769296c33737d285ba9008cff0d60ba Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 16 Nov 2023 21:56:12 +0100 Subject: improved compatibility for different frontends Introduces the use of parameter expansion for converting the link, also convert to youtube.com, because this fixes the bug where you couldn't download playlists/channels. --- bin/common/ytclipo | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 8997539..959ee21 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -11,9 +11,13 @@ fi inp="$1" [ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)" -# take last link from clipboard -# works when link is from yt-local -inp="https://youtu.be/$(echo "$inp" | sed 's/.*\(.\{11\}\)$/\1/')" +# remove util scheme +inp="${inp#*//}" +# convert to youtube.com/path url +# works for: +# - 'youtu.be/watch?v=xxxxxx' +# - 'https://piped.video/watch?v=xxxxx' +inp="https://youtube.com/${inp#*/}" >&2 printf "inp: %s\n" "$inp" notify-send "ytclipo" "downloading $inp" || : -- cgit v1.2.3 From b11feb1758d79e762a8b86041123459aaa802cda Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 21 Nov 2023 23:21:36 +0100 Subject: added mmpv and mpass-otp --- bin/menuscripts/mmpv | 8 ++++++++ bin/menuscripts/mpass-otp | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100755 bin/menuscripts/mmpv create mode 100755 bin/menuscripts/mpass-otp (limited to 'bin') diff --git a/bin/menuscripts/mmpv b/bin/menuscripts/mmpv new file mode 100755 index 0000000..76c0d6a --- /dev/null +++ b/bin/menuscripts/mmpv @@ -0,0 +1,8 @@ +#!/bin/sh +# Have an mpv instance that works with a socket somewhat globally +socket="/tmp/mpvsocket" +# Start mpv in idle if socket is not getting listened to +nc -zvU "$socket" || setsid mpv --input-ipc-server=/tmp/mpvsocket --idle & +file="$(PLAYER='echo' mmedia video)" +[ "$file" ] || exit 1 +echo '{ "command": ["loadfile", "'"$file"'", "append-play"] }' | nc -U /tmp/mpvsocket diff --git a/bin/menuscripts/mpass-otp b/bin/menuscripts/mpass-otp new file mode 100755 index 0000000..b60f953 --- /dev/null +++ b/bin/menuscripts/mpass-otp @@ -0,0 +1,6 @@ +#!/bin/sh +pass="$(find "$PASSWORD_STORE_DIR"/keys/otp -name "*.gpg" -printf '%f\n' | + sed 's/\.gpg$//' | + commander -c)" +[ "$pass" ] || exit 1 +pass otp -c keys/otp/"$pass" -- cgit v1.2.3 From 1024bf9cb8f38ff9cdd6e58a7614d1de8a5bbb29 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 22 Nov 2023 01:22:59 +0100 Subject: make move command mroe uniform --- bin/guiscripts/torque | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/guiscripts/torque b/bin/guiscripts/torque index 51e2806..8f939e1 100755 --- a/bin/guiscripts/torque +++ b/bin/guiscripts/torque @@ -47,8 +47,8 @@ prompt() { r) read -rp "remove torrent: #"; send -t "$REPLY" -r; k=0 ;; o) read -rp "load magnet: "; send -a "$REPLY"; k=0 ;; m) - read -rp "move torrent: " torrent - read -rp "destination folder: " + read -rp "move torrent: #" torrent + read -rp "destination folder: /downloads/" send -t "$torrent" --move "/downloads/$REPLY" ;; j) ((j==${#t[@]}))||((k=k>=j?k:++k,j=j<${#t[@]}?++j:j)) ;; -- cgit v1.2.3 From f989900f49b186154db323797f8636d44f7d8c1f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 27 Nov 2023 23:46:10 +0100 Subject: added notification --- bin/menuscripts/mpass-otp | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/menuscripts/mpass-otp b/bin/menuscripts/mpass-otp index b60f953..e771f9f 100755 --- a/bin/menuscripts/mpass-otp +++ b/bin/menuscripts/mpass-otp @@ -4,3 +4,4 @@ pass="$(find "$PASSWORD_STORE_DIR"/keys/otp -name "*.gpg" -printf '%f\n' | commander -c)" [ "$pass" ] || exit 1 pass otp -c keys/otp/"$pass" +notify-send -t 1000 "mpass" "copied $pass" -- cgit v1.2.3 From bd9fcf134b2140bbeeeaeedcf12aace729072197 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 5 Dec 2023 02:36:42 +0100 Subject: added getdisplays --- bin/guiscripts/getdisplays | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/guiscripts/getdisplays (limited to 'bin') diff --git a/bin/guiscripts/getdisplays b/bin/guiscripts/getdisplays new file mode 100755 index 0000000..8712b30 --- /dev/null +++ b/bin/guiscripts/getdisplays @@ -0,0 +1,3 @@ +#!/bin/sh +grep -l '^connected$' /sys/class/drm/*/status | + sed 's@^/sys/class/drm/[^-]*-\(.*\)/status$@\1@' -- cgit v1.2.3 From 4fed98c4cb8fc44867bb663ad060ccf426ab4c07 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 7 Dec 2023 23:48:00 +0100 Subject: cleanup --- bin/guiscripts/startdwl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/guiscripts/startdwl b/bin/guiscripts/startdwl index bb5fec0..039f506 100755 --- a/bin/guiscripts/startdwl +++ b/bin/guiscripts/startdwl @@ -39,6 +39,7 @@ export IMAGE="imv" # env = __GLX_VENDOR_LIBRARY_NAME,nvidia # env = WLR_NO_HARDWARE_CURSORS,1 -while true; -do dwl -s "$HOME"/.config/dwl/startup.sh +while true +do + dwl -s "$HOME"/.config/dwl/startup.sh done -- cgit v1.2.3 From e2ee726c851eadeac489b3288f775af234ba4a7a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 10 Dec 2023 15:23:29 +0100 Subject: fixed: only find images --- bin/extra/sgimg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/extra/sgimg b/bin/extra/sgimg index 7c1823c..acb8126 100755 --- a/bin/extra/sgimg +++ b/bin/extra/sgimg @@ -1,6 +1,6 @@ #!/bin/sh -imv "$(find ~/.local/share/gurk/ -type f -printf "%A@\t%p\n" | +imv "$(find ~/.local/share/gurk/ -type f \( -iname '*.png' -o -iname '*.jpg' \) -printf "%A@\t%p\n" | sort -n | tail -n 1 | cut -f 2-)" -- cgit v1.2.3 From 94c9b362faa414e7068f60184e3d01a47b96b823 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:10:31 +0100 Subject: added handling file:// scheme --- bin/guiscripts/linkhandler | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin') diff --git a/bin/guiscripts/linkhandler b/bin/guiscripts/linkhandler index aeec202..fb5a3ea 100755 --- a/bin/guiscripts/linkhandler +++ b/bin/guiscripts/linkhandler @@ -11,6 +11,12 @@ test -z "${url:=$1}" && dunstify "linkhandler" "handling $url" case "$url" in + file://*) file="${url##file:/}" + case "$(file -bi "$file" | cut -f1 -d'/')" in + audio|video) mpv "$file" ;; + image) imv "$file" ;; + *) xdg-open "$file" ;; + esac ;; *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv --quiet --ytdl --ytdl-raw-options="format-sort=res:720" "$url" > /dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) -- cgit v1.2.3 From e04eb710bbd01c0f6f486c037815687081c21d4b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:12:10 +0100 Subject: added ytlink --- bin/common/ytclipo | 19 +------------------ bin/common/ytlink | 14 ++++++++++++++ config/essentials/zsh/aliases.sh | 1 + 3 files changed, 16 insertions(+), 18 deletions(-) create mode 100755 bin/common/ytlink (limited to 'bin') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 959ee21..1a82df2 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -1,23 +1,6 @@ #!/bin/sh -# argument ($1) -> clipboard -> stdin -if [ "$WAYLAND_DISPLAY" ] -then paste() { wl-paste; } -elif [ "$TERMUX_VERSION" ] -then paste() { termux-clipboard-get; } -else paste() { xclip -o -sel c; } -fi - -inp="$1" -[ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)" - -# remove util scheme -inp="${inp#*//}" -# convert to youtube.com/path url -# works for: -# - 'youtu.be/watch?v=xxxxxx' -# - 'https://piped.video/watch?v=xxxxx' -inp="https://youtube.com/${inp#*/}" +inp="$(ytlink)" >&2 printf "inp: %s\n" "$inp" notify-send "ytclipo" "downloading $inp" || : diff --git a/bin/common/ytlink b/bin/common/ytlink new file mode 100755 index 0000000..a5e9bf0 --- /dev/null +++ b/bin/common/ytlink @@ -0,0 +1,14 @@ +#!/bin/sh + +# convert to youtube.com/path url +# works for: +# - 'youtu.be/watch?v=xxxxxx' +# - 'https://piped.video/watch?v=xxxxx' + +inp="$1" +[ "${inp:=$(clipo)}" ] || inp="$(cat /dev/stdin)" + +# remove util scheme +inp="${inp#*//}" +inp="https://youtube.com/${inp#*/}" +printf "%s" "$inp" diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 9c8f7f6..ee7dfd8 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -284,6 +284,7 @@ alias ffwin='hyprctl clients -j | jq '\''.[].pid'\'' | fzf --preview "hyprctl cl alias pff='find ${PASSWORD_STORE_DIR:=~/src/password-store/} -name "*.gpg" | sed -e "s@$PASSWORD_STORE_DIR/@@" -e '\''s/\.gpg$//'\'' | fzf | xargs pass show -c' alias fzps='fzf --print0 | xargs -0I{}' alias ytdl='yt-dlp --restrict-filenames --embed-chapters -f "b" -S "res:1080" -P "$HOME/vids/youtube/" -o "%(channel)s/%(title)s.%(ext)s"' +alias ytplay='mpv "$(ytlink)"' # emacs aliases alias emacsd='emacs --daemon' -- cgit v1.2.3 From 797c829ac104ee480d4f46d091999d84d6f8c3bd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:14:40 +0100 Subject: added file scheme --- bin/guiscripts/sturl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index c738c8e..17f2beb 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,7 +1,7 @@ #!/bin/sh -regex='(((https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' url="$(tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" +regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' [ -z "$url" ] && exit 1 case $1 in -- cgit v1.2.3 From 347d3e683e2194b4b59eac3e0343f28089587c10 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:14:59 +0100 Subject: cleanup sort results in reverse order so bottom results in terminal are shown first don't use echo --- bin/guiscripts/sturl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index 17f2beb..5b8b1e7 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,11 +1,11 @@ #!/bin/sh -url="$(tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' +url="$(tr -d '\n' | grep -Eo "$regex" | tac | commander -cl)" [ -z "$url" ] && exit 1 case $1 in - 'c') echo -n "$url" | xclip -sel c -r ;; + 'c') printf '%s' "$url" | xclip -sel c -r ;; 'o') linkhandler "$url" ;; *) echo "no option" ;; esac -- cgit v1.2.3 From c4bc59d1dc75f39114aa023d8f2b9945989a456d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:15:35 +0100 Subject: use mpv instead of qndl --- bin/guiscripts/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/guiscripts/linkhandler b/bin/guiscripts/linkhandler index fb5a3ea..329e267 100755 --- a/bin/guiscripts/linkhandler +++ b/bin/guiscripts/linkhandler @@ -24,7 +24,7 @@ case "$url" in *pdf|*cbz|*cbr) curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && $VIEWER "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source*) - qndl "$url" 'curl -LO' >/dev/null 2>&1 ;; + mpv "$url" 'curl -LO' >/dev/null 2>&1 ;; *) if [ -f "$url" ] then setsid -f "$TERMINAL" -e "$EDITOR" "$url" >/dev/null 2>&1 -- cgit v1.2.3 From 82fe753f3dd60d358ee399ff7ac5740f849a1741 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 3 Jan 2024 16:07:17 +0100 Subject: update --- bin/common/ytclipo | 4 ++-- config/essentials/git/config | 7 ++++++- config/essentials/shell/aliases.sh | 2 +- config/essentials/shell/functions.sh | 2 +- config/essentials/zsh/.zshrc | 2 +- config/home/.bashrc | 4 +++- config/home/.zshenv | 4 ++-- config/theme/fontconfig/fonts.conf | 3 ++- 8 files changed, 18 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 1a82df2..6416a15 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -2,7 +2,7 @@ inp="$(ytlink)" >&2 printf "inp: %s\n" "$inp" -notify-send "ytclipo" "downloading $inp" || : +# notify-send "ytclipo" "downloading $inp" || : yt-dlp "$inp" \ --restrict-filenames \ @@ -11,4 +11,4 @@ yt-dlp "$inp" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ -o "%(channel)s/%(title)s.%(ext)s" -notify-send "ytclipo" "finished downloading." || : +# notify-send "ytclipo" "finished downloading." || : diff --git a/config/essentials/git/config b/config/essentials/git/config index 90bab4f..fcf80db 100644 --- a/config/essentials/git/config +++ b/config/essentials/git/config @@ -3,5 +3,10 @@ [user] email = raymaekers.luca@gmail.com name = Raymaekers Luca + signingkey = 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D [push] - autoSetupRemote = true + autosetupremote = true +[pull] + rebase = false +[commit] + gpgsign = true diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index eed3fa0..99c49d8 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -140,7 +140,7 @@ alias ss4='ss -tln4p' alias mdb='mariadb -u admin -ppass admindb' alias mdbw='mariadb -h 0.0.0.0 -u padmin -pbulbizarre padmindb' alias mdbwa='mariadb -h 10.3.50.5 -u padmin -pbulbizarre padmindb' -alias tmux='tmux a || tmux' +alias tmux='pgrep tmux && tmux attach || tmux new-session' # ssh alias sha='ssh-add' diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 37e471c..b699a86 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -110,7 +110,7 @@ __git_files() { } esc() { - $EDITOR "$(which $1)" + eval "$EDITOR '$(which $1)'" } delfile() { diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 2223c67..99c65d7 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -153,7 +153,7 @@ command_not_found_handler () { } # prompt -PS1=' %B%(#.%F{1}.%F{13})%n%b%f@%B%F{6}%m%b%f %3~ ' +PS1=' %K{16}%B%(#.%F{1}.%F{13})%n%b%f@%B%F{6}%m%b%f %3~%k ' RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)' setopt prompt_subst diff --git a/config/home/.bashrc b/config/home/.bashrc index de7659a..312500d 100644 --- a/config/home/.bashrc +++ b/config/home/.bashrc @@ -2,9 +2,11 @@ SHELL=/bin/bash PATH=$HOME/bin:$PATH color1="\[\033[35m\]" color2="\[\033[36m\]" +color3="\[\033[40m\]" +color4="\[\033[38m\]" bold="\[\033[1m\]" reset="\[\033[0m\]" -PS1="${color1}${bold} [\\u${reset}@${color2}${bold}\\h]${reset} \\w " +PS1="${color1}${bold} ${color3}\\u${reset}${color3}${color4}@${color2}${bold}\\h${reset}${color3} \\w${reset} " HISTFILE= . $HOME/.config/shell/aliases.sh . $HOME/.config/shell/functions.sh diff --git a/config/home/.zshenv b/config/home/.zshenv index d33fbd7..e8021ec 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -1,6 +1,6 @@ #!/bin/zsh -export EDITOR="emacsclient -t" -export VISUAL="emacsclient -t -c -a emacs" +export EDITOR="emacsclient -nw -q" +export VISUAL="emacsclient -nw -q" export BROWSER="librewolf" export VIEWER="zathura" diff --git a/config/theme/fontconfig/fonts.conf b/config/theme/fontconfig/fonts.conf index 8681e4e..625dd34 100644 --- a/config/theme/fontconfig/fonts.conf +++ b/config/theme/fontconfig/fonts.conf @@ -16,7 +16,8 @@ monospace - JetBrains Mono + JetBrains Mono + JetBrains Mono NerdFont Joy Pixels -- cgit v1.2.3 From 0d10205772b2745356969176de6f52510527e5a6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 4 Jan 2024 20:45:39 +0100 Subject: Add more scripts --- bin/extra/mariadb-adduser | 25 +++++++++++++++++++++++++ bin/extra/oclipp | 2 ++ 2 files changed, 27 insertions(+) create mode 100755 bin/extra/mariadb-adduser create mode 100755 bin/extra/oclipp (limited to 'bin') diff --git a/bin/extra/mariadb-adduser b/bin/extra/mariadb-adduser new file mode 100755 index 0000000..d4e1b45 --- /dev/null +++ b/bin/extra/mariadb-adduser @@ -0,0 +1,25 @@ +#!/bin/sh +if [ "$(id -u)" -ne 0 ] +then + >&2 printf "Not root.\n" + exit 1 +fi + +printf 'name? ' +name="$(head -n 1)" +printf 'password? ' +password="$(head -n 1)" +printf 'database? ' +database="$(head -n 1)" + +( + cat <