From 6156f88867f5e4d13227de65f2aa930e81b76fea Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 18 Dec 2024 13:28:28 +0100 Subject: checkpoint --- bin/extra/202020 | 21 +++++++++++++++------ bin/extra/cycleKB | 25 ++++++++++++++++++++----- 2 files changed, 35 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/extra/202020 b/bin/extra/202020 index 1386058..35ce1c9 100755 --- a/bin/extra/202020 +++ b/bin/extra/202020 @@ -1,14 +1,23 @@ #!/bin/sh -mpvwopts="mpv --no-resume-playback --volume=100" +mpvCommand="mpv --no-resume-playback --volume=100" sounds="$HOME/sync/share/sounds" -while true -do +if [ "$1" ]; then + $mpvCommand "$sounds"/avert1.ogg & + herbe '202020' 'avert!' & + sleep 20s + $mpvCommand "$sounds"/avert2.ogg & + herbe '202020' 'stop averting' & + + exit +fi + +while true; do sleep 20m - $mpvwopts "$sounds"/avert1.ogg & - herbe '202020' 'avert!' + $mpvCommand "$sounds"/avert1.ogg & + herbe '202020' 'avert!' & sleep 20s - $mpvwopts "$sounds"/avert2.ogg & + $mpvCommand "$sounds"/avert2.ogg & herbe '202020' 'stop averting' & done diff --git a/bin/extra/cycleKB b/bin/extra/cycleKB index 154f5a1..25f018d 100755 --- a/bin/extra/cycleKB +++ b/bin/extra/cycleKB @@ -1,6 +1,21 @@ #!/usr/bin/sh -keyboards="$HOME/bin/keyboards.txt" -kb="$(head -n 1 "$keyboards")" -setxkbmap $kb & -sed -i '1h;1d;$G' "$keyboards" -notify-send -t 1000 "cycleKB" "${kb%% *}" + +list_layouts() +{ +cat < Date: Sun, 29 Dec 2024 07:09:24 +0100 Subject: checkpoint --- .gitattributes | 1 + .gitconfig | 2 ++ bin/menuscripts/keyadd | 4 ++-- bin/menuscripts/mpass | 2 +- bin/menuscripts/mpower | 9 +++++++-- config/essentials/zsh/.zprofile | 7 ------- config/essentials/zsh/.zshrc | 7 +++++++ config/home/.xprofile | 9 +++++++-- config/home/.zshenv | 10 +++++----- hooks/post-commit | 3 --- hooks/post-merge | 3 --- setup.sh | 5 +++++ utils/gpgidentity | 2 ++ utils/post-commit | 3 +++ utils/post-merge | 3 +++ 15 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitconfig delete mode 100755 config/essentials/zsh/.zprofile delete mode 100755 hooks/post-commit delete mode 100755 hooks/post-merge create mode 100755 setup.sh create mode 100755 utils/gpgidentity create mode 100755 utils/post-commit create mode 100755 utils/post-merge (limited to 'bin') diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..00f0b60 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +config/essentials/zsh/.zshrc filter=gpgid \ No newline at end of file diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..673478c --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[filter "gpgid"] + clean = /home/void/proj/dotfiles/utils/gpgidentity diff --git a/bin/menuscripts/keyadd b/bin/menuscripts/keyadd index 4e7949f..5a38bfb 100755 --- a/bin/menuscripts/keyadd +++ b/bin/menuscripts/keyadd @@ -2,7 +2,7 @@ log() { - notify-send -t 1000 "keyadd" "$1" & + herbe "keyadd" "$1" & >&2 printf '%s\n' "$1" } @@ -55,7 +55,7 @@ then exit 1 fi -HOST=$(hostnamectl hostname) +HOST="$(hostname)" export PASSWORD="keys/$HOST/ssh/$key_pretty" export SSH_ASKPASS="sshpass" ssh-add -q - < "$key" && diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 5dc2289..fb11091 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -22,7 +22,7 @@ done [ "$file" ] || exit 1 pass show -c "$file" || exit 1 -notify-send -t 1000 "mpass" "$file" +herbe "*mpass" "$file" [ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running cliphist list | head -n 1 | cliphist delete diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 51b8e1d..b4b8640 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -9,5 +9,10 @@ hibernate EOF )" -[ "$choice" = "firmware" ] && systemctl reboot --firmware-setup -[ "$choice" ] && systemctl "$choice" +case "$choice" in + "suspend") doas /usr/sbin/zzz ;; + "poweroff") doas /usr/sbin/poweroff ;; + "reboot"|"firmware") doas /usr/sbin/reboot ;; + "") exit 1 ;; + *) ;; +esac diff --git a/config/essentials/zsh/.zprofile b/config/essentials/zsh/.zprofile deleted file mode 100755 index 9072f28..0000000 --- a/config/essentials/zsh/.zprofile +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if { [ "$TTY" = "/dev/tty1" ] || [ "$TTY" = "/dev/tty8" ]; } && [ "$(id -u)" -ne 0 ]; then - eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" - exec startx > /dev/null 2>&1 - exit -fi diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 68aae3f..3a75873 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -1,5 +1,12 @@ #!/bin/zsh +if { [ "$TTY" = "/dev/tty1" ] || [ "$TTY" = "/dev/tty8" ]; } && [ "$(id -u)" -ne 0 ]; then + eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents ssh,gpg)" + keychain --dir "$XDG_CONFIG_HOME/keychain" --quiet --agents gpg IDENTITY #FILTERED + exec startx > /dev/null 2>&1 + exit +fi + # zmodload zsh/zprof autoload -U select-word-style diff --git a/config/home/.xprofile b/config/home/.xprofile index f51fcad..718a319 100755 --- a/config/home/.xprofile +++ b/config/home/.xprofile @@ -1,3 +1,9 @@ +#!/bin/sh + +feh --no-fehbg --bg-scale "$HOME"/pics/wallpaper & + +setxkbmap us -variant colemak -option ctrl:swapcaps,menu:altwin & + # TODO: check if this is home if [ "$(hostname)" = "winter" ]; then ( @@ -7,8 +13,6 @@ if [ "$(hostname)" = "winter" ]; then fi picom -b & -feh --no-fehbg --bg-scale "$HOME"/pics/wallpaper & -setxkbmap colemak -option ctrl:swapcaps,altwin:menu_win & # xautolock -locker slock & @@ -20,6 +24,7 @@ slstatus & unclutter --timeout 3 --jitter 50 -b & 202020 & +echo 4 if [ "$(hostname)" = "winter" ]; then signal-desktop & discord & diff --git a/config/home/.zshenv b/config/home/.zshenv index 4932584..4bb166c 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -1,9 +1,9 @@ #!/bin/zsh -export EDITOR="nvim" -export VISUAL="nvim" +export EDITOR="vis" +export VISUAL="vis" -export BROWSER="zen-browser" +export BROWSER="firefox" export VIEWER="zathura" export PLAYER="mpv" export MENUCMD="dmenu" @@ -47,7 +47,7 @@ alias irssi='irssi --config="$XDG_CONFIG_HOME"/irssi/config --home="$XDG_DATA_HO alias mbsync='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc' export XINITRC="$XDG_CONFIG_HOME"/x11/xinitrc -export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority +export XAUTHORITY=$HOME/.Xauthority export ZDOTDIR="$XDG_CONFIG_HOME"/zsh export HISTFILE="$ZDOTDIR"/histfile @@ -64,7 +64,7 @@ export DOTNET_CLI_TELEMETRY_OPTOUT=1 # export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java # export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' -export PASSWORD_STORE_DIR="$HOME"/src/password-store +export PASSWORD_STORE_DIR="$HOME"/.password-store export PASSWORD_STORE_CLIP_TIME=5 # old diff --git a/hooks/post-commit b/hooks/post-commit deleted file mode 100755 index a6b419d..0000000 --- a/hooks/post-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd -stowdots d \ No newline at end of file diff --git a/hooks/post-merge b/hooks/post-merge deleted file mode 100755 index a6b419d..0000000 --- a/hooks/post-merge +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd -stowdots d \ No newline at end of file diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..f7855a7 --- /dev/null +++ b/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +git config --local include.path ../.gitconfig diff --git a/utils/gpgidentity b/utils/gpgidentity new file mode 100755 index 0000000..5a958b2 --- /dev/null +++ b/utils/gpgidentity @@ -0,0 +1,2 @@ +#!/bin/sh +sed '/#FILTERED$/s/[^ ]\+ #FILTERED$/IDENTITY #FILTERED/g' diff --git a/utils/post-commit b/utils/post-commit new file mode 100755 index 0000000..a6b419d --- /dev/null +++ b/utils/post-commit @@ -0,0 +1,3 @@ +#!/bin/sh +rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd +stowdots d \ No newline at end of file diff --git a/utils/post-merge b/utils/post-merge new file mode 100755 index 0000000..a6b419d --- /dev/null +++ b/utils/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh +rm ~/bin/keyboards.txt ~/.config/user-dirs.dirs ~/bin/wd +stowdots d \ No newline at end of file -- cgit v1.2.3 From 70ac73bc332facb6b55044a8a6145ea805592d18 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 29 Dec 2024 17:43:00 +0100 Subject: checkpoint --- bin/common/ytclipo | 4 ++-- bin/extra/cycleKB | 2 +- bin/extra/mtr | 2 +- bin/extra/p.sh | 2 +- bin/guiscripts/dmtofi | 4 ++-- bin/guiscripts/lh | 2 +- bin/guiscripts/wintitle | 3 --- bin/menuscripts/memoji | 2 +- bin/menuscripts/mpotp | 2 +- bin/menuscripts/shdul.sh | 2 +- 10 files changed, 11 insertions(+), 14 deletions(-) delete mode 100755 bin/guiscripts/wintitle (limited to 'bin') diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 4d9d846..f8d30b4 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -4,7 +4,7 @@ inp="$1" [ -z "$inp" ] && inp="$(ytlink)" [ "$inp" ] || exit 1 >&2 printf "inp: %s\n" "$inp" -notify-send "ytclipo" "$inp" || : +herbe "_ytclipo" "*$inp" || : yt-dlp "$inp" \ --restrict-filenames \ @@ -12,4 +12,4 @@ yt-dlp "$inp" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ -o "%(channel)s/%(title)s.%(ext)s" -notify-send "ytclipo" "finished downloading." || : +herbe "_ytclipo" "finished downloading." || : diff --git a/bin/extra/cycleKB b/bin/extra/cycleKB index 25f018d..597f26f 100755 --- a/bin/extra/cycleKB +++ b/bin/extra/cycleKB @@ -18,4 +18,4 @@ IndexLayout="$(list_layouts | awk "/^$(current_keymap)/ {print NR}")" [ "$IndexLayout" -eq "$NumLayouts" ] && IndexLayout=1 || IndexLayout=$((IndexLayout + 1)) Layout="$(list_layouts | sed -n "${IndexLayout}p" )" setxkbmap $Layout & -notify-send -t 1000 "cycleKB" "${Layout%% *}" +herbe "_cycleKB" "*${Layout%% *}" diff --git a/bin/extra/mtr b/bin/extra/mtr index 486a9b8..68aac60 100755 --- a/bin/extra/mtr +++ b/bin/extra/mtr @@ -20,4 +20,4 @@ category="$(list_categories | commander -cl)" transmission-remote debuc.com -a "$(clipo)" -w "/downloads/$category" -notify-send "mtr" "added to $category" +herbe "_mtr" "*added to $category" diff --git a/bin/extra/p.sh b/bin/extra/p.sh index 98f8ede..ff36e71 100755 --- a/bin/extra/p.sh +++ b/bin/extra/p.sh @@ -668,7 +668,7 @@ case "$1" in curl -Ls "$url" > "$html" level1="$(pup -p 'span.infocard:nth-child(2) > small:nth-child(2) text{}' < "$html")" level2="$(pup -p 'span.infocard:nth-child(4) > small:nth-child(2) text{}' < "$html")" - notify-send "p.sh" "$level1\n$level2" + herbe "_p.sh" "$level1\n$level2" ;; # moves diff --git a/bin/guiscripts/dmtofi b/bin/guiscripts/dmtofi index 5cdc3cf..ed9f673 100755 --- a/bin/guiscripts/dmtofi +++ b/bin/guiscripts/dmtofi @@ -2,7 +2,7 @@ if ! mv ~/bin/.dmenu ~/bin/dmenu 2>/dev/null then mv ~/bin/dmenu ~/bin/.dmenu - notify-send "dmtofi" "dmenu enabled!" + herbe "_dmtofi" "*enabled!" else - notify-send "dmtofi" "dmenu disabled!" + herbe "_dmtofi" "*disabled!" fi diff --git a/bin/guiscripts/lh b/bin/guiscripts/lh index ba39ec0..fd7f573 100755 --- a/bin/guiscripts/lh +++ b/bin/guiscripts/lh @@ -7,7 +7,7 @@ # otherwise it opens link in browser. [ "${url:=$1}" ] || url="$(clipo)" -notify-send "linkhandler" "$url" +herbe "_linkhandler" "$url" case "$url" in file://*) diff --git a/bin/guiscripts/wintitle b/bin/guiscripts/wintitle deleted file mode 100755 index 64938a5..0000000 --- a/bin/guiscripts/wintitle +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -notify-send "wintitle" "$(hyprctl activewindow -j | jq -r '.title')" diff --git a/bin/menuscripts/memoji b/bin/menuscripts/memoji index 5766238..0b3965d 100755 --- a/bin/menuscripts/memoji +++ b/bin/menuscripts/memoji @@ -13,7 +13,7 @@ case "$1" in input=$(tee | cut -f 1 -d ' ') if [ "$input" ] then - notify-send "dmemoji" "$input copied!" + herbe "_dmemoji" "*$input copied!" printf "%s" "$input" | clipp fi ;; diff --git a/bin/menuscripts/mpotp b/bin/menuscripts/mpotp index 2be6186..8ffb468 100755 --- a/bin/menuscripts/mpotp +++ b/bin/menuscripts/mpotp @@ -4,4 +4,4 @@ pass="$(find "$PASSWORD_STORE_DIR"/keys/otp -iname "*.gpg" | dmenu -c)" [ "$pass" ] || exit 1 pass otp -c keys/otp/"$pass" -notify-send -t 1000 "mpass" "copied $pass" +herbe "_mpotp" "copied $pass" diff --git a/bin/menuscripts/shdul.sh b/bin/menuscripts/shdul.sh index 4e1d744..8c059b9 100755 --- a/bin/menuscripts/shdul.sh +++ b/bin/menuscripts/shdul.sh @@ -113,7 +113,7 @@ view_schedule() then print_schedule "$1" "$2" prev_now="$now" - notify-send -u critical -t 5000 "shdul" "$(awk "NR==$((now-1)) {print \$2}" "$1")" + herbe "_shdul" "$(awk "NR==$((now-1)) {print \$2}" "$1")" # Align with clock sleep "$((60-$(date +%-S)))s" -- cgit v1.2.3 From 112449dd19eaae6769ef95a70b3e52234256400c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 29 Dec 2024 20:02:59 +0100 Subject: checkpoint --- bin/extra/notify-send | 81 ++++++++++++++++++++++++++++++++++++++++++++ bin/menuscripts/mpass | 2 +- config/essentials/git/config | 2 +- 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100755 bin/extra/notify-send (limited to 'bin') diff --git a/bin/extra/notify-send b/bin/extra/notify-send new file mode 100755 index 0000000..3a3872b --- /dev/null +++ b/bin/extra/notify-send @@ -0,0 +1,81 @@ +#!/bin/sh +# Shell script to redirect notify-send calls to herbe. The purpose is to ignore +# options passed to notify-send. +# +# Option parser generated by getoptions +# URL: https://github.com/ko1nksm/getoptions +# LICENSE: Creative Commons Zero v1.0 Universal + +usage() { + printf '%s\n' "${0##*/}: notify-send replacement for herbe" "accepts but ignores all notify-send options." +} + +REST='' +parse() { + OPTIND=$(($#+1)) + while [ $# -gt 0 ] && OPTARG=; do + case $1 in + --?*=*) OPTARG=$1; shift + eval 'set -- "${OPTARG%%\=*}" "${OPTARG#*\=}"' ${1+'"$@"'} + ;; + -[utich]?*) OPTARG=$1; shift + eval 'set -- "${OPTARG%"${OPTARG#??}"}" "${OPTARG#??}"' ${1+'"$@"'} + ;; + -[!-]?*) OPTARG=$1; shift + eval 'set -- "${OPTARG%"${OPTARG#??}"}" "-${OPTARG#??}"' ${1+'"$@"'} + OPTARG= ;; + esac + case $1 in + -u | --urgency) + [ $# -le 1 ] && set -- "$1" required && break + OPTARG=$2 + _=$OPTARG + shift ;; + -t | --expire-time) + [ $# -le 1 ] && set -- "$1" required && break + OPTARG=$2 + _=$OPTARG + shift ;; + -i | --icon) + [ $# -le 1 ] && set -- "$1" required && break + OPTARG=$2 + _=$OPTARG + shift ;; + -c | --category) + [ $# -le 1 ] && set -- "$1" required && break + OPTARG=$2 + _=$OPTARG + shift ;; + -h | --hint) + [ $# -le 1 ] && set -- "$1" required && break + OPTARG=$2 + _=$OPTARG + shift ;; + -? | --help) + usage + exit 0 ;; + --) shift + while [ $# -gt 0 ]; do + REST="${REST} \"\${$(($OPTIND-$#))}\"" + shift + done + break ;; + [-]?*) set -- "$1" unknown && break ;; + *) REST="${REST} \"\${$(($OPTIND-$#))}\"" + esac + shift + done + [ $# -eq 0 ] && return 0 + case $2 in + unknown) echo "unrecognized option '$1'" ;; + noarg) echo "option '$1' doesn't allow an argument" ;; + required) echo "option '$1' requires an argument" ;; + pattern) echo "option '$1' does not match the pattern ($3)" ;; + *) echo "option '$1' validation error: $2" + esac >&2 + exit 1 +} + +parse "$@" +eval set -- "$REST" +herbe "$@" & diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index fb11091..5a09623 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -22,7 +22,7 @@ done [ "$file" ] || exit 1 pass show -c "$file" || exit 1 -herbe "*mpass" "$file" +herbe "_mpass" "*$file" [ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running cliphist list | head -n 1 | cliphist delete diff --git a/config/essentials/git/config b/config/essentials/git/config index 130b8a5..605d4b2 100644 --- a/config/essentials/git/config +++ b/config/essentials/git/config @@ -1,7 +1,7 @@ [init] defaultBranch = main [user] - email = raymaekers.luca@gmail.com + email = luca@spacehb.net name = Raymaekers Luca signingkey = 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D [push] -- cgit v1.2.3