From c032a9d071ee4b7eb2bfe79ec03d2a7dc4020f15 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 15 Oct 2023 00:32:34 +0200 Subject: added termux detection --- bin/common/ytclipo | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 7e7b9cc..6da7059 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -2,19 +2,20 @@ # argument ($1) -> clipboard -> stdin if [ "$WAYLAND_DISPLAY" ] -then - paste="$(wl-paste)" -else - paste="$(xclip -o -sel c)" +then paste() { wl-paste; } +elif [ "$TERMUX_VERSION" ] +then paste() { termux-clipboard-get; } +else paste() { xclip -o -sel c; } fi -test -z "${inp:=${1:-$paste}}" && - inp="$(cat /dev/stdin)" + +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/')" -echo "inp: ${inp}" 1>&2 -notify-send "ytclipo" "downloading $inp" +>&2 printf "inp: %s\n" "$inp" +notify-send "ytclipo" "downloading $inp" || : yt-dlp "$inp" \ --restrict-filenames \ @@ -22,5 +23,4 @@ yt-dlp "$inp" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ -o "%(channel)s - %(title)s.%(ext)s" -notify-send "ytclipo" "ytclipo
finished downloading." -echo "$inp" >> /tmp/ytclipo_history +notify-send "ytclipo" "ytclipo
finished downloading." || : -- cgit v1.2.3 From 4d4a846253b492fae3da17a43c4f5f559a0776e3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 15 Oct 2023 15:27:47 +0200 Subject: disabled age threshold --- config/X/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 4975d0a..3d0eaed 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -171,7 +171,7 @@ # Show age of message if message is older than show_age_threshold # seconds. # Set to -1 to disable. - show_age_threshold = 60 + show_age_threshold = -1 # Specify where to make an ellipsis in long lines. # Possible values are "start", "middle" and "end". -- cgit v1.2.3 From 0f7b4712384ae7edfe2234d56fd085791327b832 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:04:29 +0200 Subject: removed mplay --- bin/menuscripts/mplay | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 bin/menuscripts/mplay diff --git a/bin/menuscripts/mplay b/bin/menuscripts/mplay deleted file mode 100755 index e4fca54..0000000 --- a/bin/menuscripts/mplay +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -choice="$(mpc listall | commander -c -l -d -x)" -[ "$choice" ] || exit 1 -mpc insert "$choice" || exit 1 -mpc next 2> /dev/null -mpc play 2> /dev/null -- cgit v1.2.3 From cb97cb065ebd7fa5e447a314a2421109ef9c3339 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:07:21 +0200 Subject: added setip --- bin/extra/setip | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/extra/setip diff --git a/bin/extra/setip b/bin/extra/setip new file mode 100755 index 0000000..b10e7cc --- /dev/null +++ b/bin/extra/setip @@ -0,0 +1,16 @@ +#!/bin/sh + +ips="192.168.178.79 192.168.178.52 10.7.0.1 none" + +for ip in $ips +do ping -i .2 -c 1 "$ip" > /dev/null 2>&1 && break +done + +if [ "$ip" = "none" ] +then + >&2 printf 'No ip.\n' + exit 1 +fi + +sed -i "/Host db/,/^$/s/.*HostName.*/\tHostname $ip/" "$HOME"/.ssh/config +>&2 printf 'Done: %s \n' "$ip" -- cgit v1.2.3 From ab321c0ce1a90fd0d690db6ef94bc170167795a9 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:07:26 +0200 Subject: added pf snippet --- config/essentials/nvim/after/plugin/luasnip.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index 3f607ab..70d7570 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -143,6 +143,7 @@ ls.add_snippets("java", { ls.add_snippets("sh", { s("TD", t "THISDIR=\"$(dirname \"$(readlink -f \"$0\")\")\""), + parse("pf", ">&2 printf '$1\\n'$0", {}), parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), -- Functions parse("rchar", -- cgit v1.2.3 From 791fe7d02cd117f12c5f1473f408ea67c5f2338e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:07:51 +0200 Subject: removed pomo --- bin/extra/pomo | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100755 bin/extra/pomo diff --git a/bin/extra/pomo b/bin/extra/pomo deleted file mode 100755 index a2c371d..0000000 --- a/bin/extra/pomo +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -notif() { notify-send -t 1000 -w "pomo" "$1"; } - -for msg in "three" "two" "one" -do notif "$msg" -done - -# $1: time in minutes -# $2: msg for notification -ring_ring() -{ - date '+%R B' - notify-send -w "$(($1*1000*60))" -u critical "pomo" "$2" -} - -i="${1-0}" -while true - -do - notif "START" - date '+%R S' - sleep 20m - if [ "$i" -eq 3 ] - then - i=0 - ring_ring 20 "GIGA BREAK TIME" - else - ring_ring 5 "BREAK TIME" - i=$((i+1)) - fi -done -- cgit v1.2.3 From 389f23521d2d43fd7a9117a47f5ba4ed92c4c389 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:08:15 +0200 Subject: fixed typo --- bin/common/ytclipo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 567e357..712b068 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -8,7 +8,7 @@ then paste() { termux-clipboard-get; } else paste() { xclip -o -sel c; } fi -inp=”$1” +inp="$1" [ "${inp:=$(paste)}" ] || inp="$(cat /dev/stdin)" # take last link from clipboard -- cgit v1.2.3 From cf9854013e689fa238a2deb14276e29c1a4a35f4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:08:25 +0200 Subject: cleanup --- bin/extra/confirm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/extra/confirm b/bin/extra/confirm index 116b468..630d701 100755 --- a/bin/extra/confirm +++ b/bin/extra/confirm @@ -5,8 +5,8 @@ read_char () old_stty_cfg=$(stty -g 2> /dev/null) stty raw -echo 2> /dev/null dd ibs=1 count=1 2> /dev/null - stty $old_stty_cfg 2> /dev/null + stty "$old_stty_cfg" 2> /dev/null } ->&2 printf "$1 " +>&2 printf "%s " "$1" read_char | grep -q "[yY]" -- cgit v1.2.3 From 6c78112e19f44ef79eebf1076041feff83c303e6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:08:31 +0200 Subject: fix typo --- config/X/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 3d0eaed..a83f45f 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -30,7 +30,7 @@ height = 80 # Position the notification in the top right corner - origin = right + origin = top-right # Offset from the origin offset = 10x10 -- cgit v1.2.3