diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common/wt | 2 | ||||
-rwxr-xr-x | bin/common/ytclipo | 2 | ||||
-rwxr-xr-x | bin/extra/confirm | 4 | ||||
-rwxr-xr-x | bin/extra/gml | 33 | ||||
-rwxr-xr-x | bin/extra/pomo | 31 | ||||
-rwxr-xr-x | bin/extra/setip | 16 | ||||
-rwxr-xr-x | bin/guiscripts/dmfm | 28 | ||||
-rwxr-xr-x | bin/guiscripts/locker | 7 | ||||
-rwxr-xr-x | bin/guiscripts/startdwl | 44 | ||||
-rwxr-xr-x | bin/guiscripts/startw | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mhelp | 6 | ||||
-rwxr-xr-x | bin/menuscripts/mplay | 6 | ||||
-rwxr-xr-x | bin/menuscripts/mpwgen (renamed from bin/menuscripts/mpassgen) | 0 |
13 files changed, 105 insertions, 76 deletions
diff --git a/bin/common/wt b/bin/common/wt index d19539b..3cd739a 100755 --- a/bin/common/wt +++ b/bin/common/wt @@ -2,6 +2,6 @@ while true do clear - $@ + eval "$*" sleep 1 done 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 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]" diff --git a/bin/extra/gml b/bin/extra/gml index 0f2f143..f8d6b7e 100755 --- a/bin/extra/gml +++ b/bin/extra/gml @@ -32,14 +32,14 @@ minecraft() -mindepth 1 -maxdepth 1 \ -type d \ -printf "%f\n" - ) | commander -d -c -s)" + ) | commander -d -c -s)" - [ -z "$world" ] && exit 1 + [ -z "$world" ] && exit 1 - if [ "$world" = 'none' ] - then setsid multimc -l "$instance" > /dev/null 2>&1 - else setsid multimc -l "$instance" -w "$world" > /dev/null 2>&1 - fi + if [ "$world" = 'none' ] + then setsid multimc -l "$instance" > /dev/null 2>&1 + else setsid multimc -l "$instance" -w "$world" > /dev/null 2>&1 + fi fi } @@ -47,24 +47,27 @@ minecraft() steam() { choice="$( - cat <<-EOF | column -t -l 2 | commander -d -x -c | awk '{printf $1}' - 274190 broforce - 291550 brawlhalla - 1712840 tiny tina - 105600 terraria - kill -EOF - )" + cat <<-EOF | + 274190 broforce + 291550 brawlhalla + 1712840 tiny tina + 105600 terraria + kill + EOF + column -t -l 2 | commander -d -x -c | awk '{printf $1}')" + case "$choice" in kill) pkill steam ;; + "") ;; *) setsid steam steam://rungameid/"$choice" ;; esac exit } eval "$( - cat <<-EOF | commander -c -w 9 -y 2 + cat <<-EOF | commander -c -w 9 -y 3 minecraft steam + lutris EOF )" 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 "<b>START</b>" - 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 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" diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm index 969c111..d1dd8b8 100755 --- a/bin/guiscripts/dmfm +++ b/bin/guiscripts/dmfm @@ -1,17 +1,19 @@ #!/bin/sh -file=1 -while [ "$file" ]; do - file=$(ls -1 --group-directories-first | dmenu -i -l 8 -g 1 -p "$(basename $(pwd)):") - if [ -e "$file" ]; then - owd=$(pwd) - if [ -d "$file" ]; then - cd "$file" - else [ -f "$file" ] - if which xdg-open &> /dev/null; then - exec xdg-open "$owd/$file" & - unset file - fi - fi +while true +do + 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>") + + [ "$file" ] || break + [ ! -e "$file" ] && continue + + if [ -d "$file" ] + then + cd "$file" || continue + else + setsid xdg-open "$PWD/$file" & fi + done diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index 7c42cda..a0a9eac 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -1,9 +1,8 @@ #!/bin/sh -which swaylock grim pixelate > /dev/null || - exit 1 +which swaylock grim pixelate > /dev/null || exit 1 umask 077 -monitors="$(hyprctl monitors -j | jq -r '.[].name' | xargs)" +monitors="$(xrandr --listactivemonitors | awk '/^ [0-9]/ {print $4}')" for monitor in $monitors do @@ -15,5 +14,5 @@ do files="$files $file" done -swaylock -f -u $img_opt +swaylock --indicator-radius 0 $img_opt shred -uz -- $files diff --git a/bin/guiscripts/startdwl b/bin/guiscripts/startdwl new file mode 100755 index 0000000..bb5fec0 --- /dev/null +++ b/bin/guiscripts/startdwl @@ -0,0 +1,44 @@ +#!/bin/sh + +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" + +export XCURSOR_THEME="Bibata-Modern-Classic" +export XCURSOR_SIZE="24" + +export GTK_THEME="Arc-Dark" + +export GTK_IM_MODULE="fcitx" +export XMODIFIERS="@im=fcitx" +export GLFW_IM_MODULE="ibus" + +export MOZ_ENABLE_WAYLAND="1" + +export QT_IM_MODULE="fcitx" +export QT_AUTO_SCREEN_SCALE_FACTOR="1" +export QT_QPA_PLATFORM="wayland;xcb" +export QT_QPA_PLATFORMTHEME="qt5ct" +export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + +export XDG_CURRENT_DESKTOP="dwl" +export XDG_SESSION_TYPE="wayland" +export XDG_SESSION_DESKTOP="dwl" + +export SDL_IM_MODULE="fcitx" +export SDL_VIDEODRIVER="wayland" +export CLUTTER_BACKEND="wayland" + +export TERMINAL="foot" +export MENUCMD="tofi" +export IMAGE="imv" + +# # nvidia +# env = LIBVA_DRIVER_NAME,nvidia +# env = XDG_SESSION_TYPE,wayland +# env = GBM_BACKEND,nvidia-drm +# env = __GLX_VENDOR_LIBRARY_NAME,nvidia +# env = WLR_NO_HARDWARE_CURSORS,1 + +while true; +do dwl -s "$HOME"/.config/dwl/startup.sh +done diff --git a/bin/guiscripts/startw b/bin/guiscripts/startw index 9b35556..0383f48 100755 --- a/bin/guiscripts/startw +++ b/bin/guiscripts/startw @@ -3,4 +3,6 @@ eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" +(cd ~/.config/waybar/ && ln -sf hyprland.jsonc config.jsonc) + Hyprland diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index 339d6bf..cb7977b 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,16 +1,16 @@ #!/usr/bin/env sh -program="$(commander -r -c -d)" +program="$(commander -rcd)" [ "$program" ] || exit 1 option="$("$program" --help | # Parse options - grep "^ *-[-a-zA-Z0-9]* " | + grep -- "^ *-[-a-zA-Z0-9]* " | tr -s ' ' | sort | uniq | column -l 2 -t | - commander -l -x -c -d | + commander -lxcd | awk '{print $1}')" [ "$option" ] || exit 1 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 diff --git a/bin/menuscripts/mpassgen b/bin/menuscripts/mpwgen index 51b9bc4..51b9bc4 100755 --- a/bin/menuscripts/mpassgen +++ b/bin/menuscripts/mpwgen |