diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-01-10 09:53:47 +0100 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-01-10 09:53:47 +0100 |
commit | 0467fa38e57589f2bcd5cfeca5643f360800460e (patch) | |
tree | 30fe3d379312073177b9425b76b782947b11a9dc | |
parent | c8283a1ef06b15ab0b5871655f4bfaefe9518673 (diff) |
checkpoint
-rwxr-xr-x | bin/common/gt | 18 | ||||
-rwxr-xr-x | bin/extra/cycleKB | 33 | ||||
-rwxr-xr-x | bin/extra/notify-send | 1 | ||||
-rw-r--r-- | config/extra/mutt/configs/billy@spacehb.net.muttrc | 6 | ||||
-rw-r--r-- | config/extra/mutt/configs/luca@spacehb.net.muttrc | 6 | ||||
-rw-r--r-- | config/extra/mutt/configs/tlast@spacehb.net.muttrc | 6 | ||||
-rw-r--r-- | config/home/.mbsyncrc | 18 |
7 files changed, 59 insertions, 29 deletions
diff --git a/bin/common/gt b/bin/common/gt index 5adfe71..e048912 100755 --- a/bin/common/gt +++ b/bin/common/gt @@ -34,6 +34,13 @@ EOF } list_repos() { cut -f 1 -d ' ' "$REPOS"; } +quit_when_no_repos() { + if [ "$(wc -l <"$REPOS")" -eq 0 ]; + then + >&2 printf 'No repositories added.\n' + exit 1 + fi +} # fetch repository prettily, outputs nothing if failed fetch() { @@ -49,7 +56,6 @@ if [ -z "$1" ]; then exit 1 fi -[ "$(wc -l <"$REPOS")" -gt 0 ] || exit 0 while getopts ":a:c:f:lsheu" opt; do case "$opt" in @@ -73,6 +79,7 @@ while getopts ":a:c:f:lsheu" opt; do printf >&2 'added.\n' ;; c) + quit_when_no_repos list_repos | if [ "$parallel" ]; then parallel gt-cmd "{}" "$OPTARG" @@ -80,11 +87,16 @@ while getopts ":a:c:f:lsheu" opt; do xargs -I{} gt-cmd "{}" "$OPTARG" fi ;; - s) list_repos | xargs -I{} gt-st {} ;; - l) list_repos ;; + s) + quit_when_no_repos + list_repos | xargs -I{} gt-st {} ;; + l) + quit_when_no_repos + list_repos ;; e) $EDITOR "$REPOS" ;; f) REPOS="$OPTARG" ;; u) + quit_when_no_repos >&2 printf 'pull:\n' if [ "$parallel" ]; then list_repos | parallel gt-cmd {} pull diff --git a/bin/extra/cycleKB b/bin/extra/cycleKB index 597f26f..8f0de60 100755 --- a/bin/extra/cycleKB +++ b/bin/extra/cycleKB @@ -4,18 +4,35 @@ list_layouts() { cat <<EOF us -colemak -option ctrl:swapcaps,altwin:menu_win +us -variant colemak -option ctrl:swapcaps,altwin:menu_win EOF } -current_keymap() -{ - setxkbmap -print | awk -F '+' '/xkb_symbols/ {print $2}' -} +ProgramPath="$(readlink -f "$0")" +CurrentKeymap="$(tail -n 1 "$ProgramPath")" +>&2 printf 'Current: %s\n' "$CurrentKeymap" NumLayouts="$(list_layouts | wc -l)" -IndexLayout="$(list_layouts | awk "/^$(current_keymap)/ {print NR}")" -[ "$IndexLayout" -eq "$NumLayouts" ] && IndexLayout=1 || IndexLayout=$((IndexLayout + 1)) +[ "$NumLayouts" ] || exit 1 +IndexLayout="$(list_layouts | awk "/^${CurrentKeymap}$/ {print NR}")" +[ "$IndexLayout" ] || exit 2 + +# Cycle +if [ "$IndexLayout" -eq "$NumLayouts" ]; then + IndexLayout=1 +else + IndexLayout=$((IndexLayout + 1)) +fi + Layout="$(list_layouts | sed -n "${IndexLayout}p" )" +[ "$Layout" ] || exit 3 + +>&2 printf 'Layout: %s\n' "$Layout" setxkbmap $Layout & -herbe "_cycleKB" "*${Layout%% *}" +sed -i "\$s/.*/$Layout/" "$ProgramPath" +notify-send "_cycleKB" "*${Layout%% -option*}" & + +exit + +# THIS LINE IS ADDED AUTOMATICALLY +us -variant colemak -option ctrl:swapcaps,altwin:menu_win diff --git a/bin/extra/notify-send b/bin/extra/notify-send index b0cf04a..e058d79 100755 --- a/bin/extra/notify-send +++ b/bin/extra/notify-send @@ -83,4 +83,5 @@ parse() { parse "$@" eval set -- "$REST" +pkill herbe herbe "$@" & diff --git a/config/extra/mutt/configs/billy@spacehb.net.muttrc b/config/extra/mutt/configs/billy@spacehb.net.muttrc index 0bf375c..118c063 100644 --- a/config/extra/mutt/configs/billy@spacehb.net.muttrc +++ b/config/extra/mutt/configs/billy@spacehb.net.muttrc @@ -4,9 +4,9 @@ set realname = "billy" set from = "billy@spacehb.net" set sendmail = "msmtp -a billy@spacehb.net" alias me billy <billy@spacehb.net> -set folder = "/home/aluc/.local/share/mail/billy@spacehb.net" -set header_cache = "/home/aluc/.cache/mutt-wizard/billy_spacehb.net/headers" -set message_cachedir = "/home/aluc/.cache/mutt-wizard/billy_spacehb.net/bodies" +set folder = "$HOME/.local/share/mail/billy@spacehb.net" +set header_cache = "$HOME/.cache/mutt-wizard/billy_spacehb.net/headers" +set message_cachedir = "$HOME/.cache/mutt-wizard/billy_spacehb.net/bodies" set mbox_type = Maildir set hostname = "spacehb.net" set spoolfile = "+INBOX" diff --git a/config/extra/mutt/configs/luca@spacehb.net.muttrc b/config/extra/mutt/configs/luca@spacehb.net.muttrc index 85b65d3..3cf7b68 100644 --- a/config/extra/mutt/configs/luca@spacehb.net.muttrc +++ b/config/extra/mutt/configs/luca@spacehb.net.muttrc @@ -4,9 +4,9 @@ set realname = "Luca" set from = "luca@spacehb.net" set sendmail = "msmtp -a luca@spacehb.net" alias me luca <luca@spacehb.net> -set folder = "/home/aluc/.local/share/mail/luca@spacehb.net" -set header_cache = "/home/aluc/.cache/mutt-wizard/luca_spacehb.net/headers" -set message_cachedir = "/home/aluc/.cache/mutt-wizard/luca_spacehb.net/bodies" +set folder = "$HOME/.local/share/mail/luca@spacehb.net" +set header_cache = "$HOME/.cache/mutt-wizard/luca_spacehb.net/headers" +set message_cachedir = "$HOME/.cache/mutt-wizard/luca_spacehb.net/bodies" set mbox_type = Maildir set hostname = "spacehb.net" set spoolfile = "+INBOX" diff --git a/config/extra/mutt/configs/tlast@spacehb.net.muttrc b/config/extra/mutt/configs/tlast@spacehb.net.muttrc index a0248ec..33910e4 100644 --- a/config/extra/mutt/configs/tlast@spacehb.net.muttrc +++ b/config/extra/mutt/configs/tlast@spacehb.net.muttrc @@ -4,9 +4,9 @@ set realname = "TlasT" set from = "tlast@spacehb.net" set sendmail = "msmtp -a tlast@spacehb.net" alias me tlast <tlast@spacehb.net> -set folder = "/home/aluc/.local/share/mail/tlast@spacehb.net" -set header_cache = "/home/aluc/.cache/mutt-wizard/tlast_spacehb.net/headers" -set message_cachedir = "/home/aluc/.cache/mutt-wizard/tlast_spacehb.net/bodies" +set folder = "$HOME/.local/share/mail/tlast@spacehb.net" +set header_cache = "$HOME/.cache/mutt-wizard/tlast_spacehb.net/headers" +set message_cachedir = "$HOME/.cache/mutt-wizard/tlast_spacehb.net/bodies" set mbox_type = Maildir set hostname = "spacehb.net" set spoolfile = "+INBOX" diff --git a/config/home/.mbsyncrc b/config/home/.mbsyncrc index d2e61d2..8a18828 100644 --- a/config/home/.mbsyncrc +++ b/config/home/.mbsyncrc @@ -5,13 +5,13 @@ Port 993 User luca@spacehb.net PassCmd "pass hosts/spacehb/luca" AuthMechs LOGIN -SSLType IMAPS +TLSType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore luca@spacehb.net-local Subfolders Verbatim -Path /home/aluc/.local/share/mail/luca@spacehb.net/ -Inbox /home/aluc/.local/share/mail/luca@spacehb.net/INBOX +Path ~/.local/share/mail/luca@spacehb.net/ +Inbox ~/.local/share/mail/luca@spacehb.net/INBOX Channel luca@spacehb.net Expunge Both @@ -31,13 +31,13 @@ Port 993 User billy@spacehb.net PassCmd "pass hosts/spacehb/billy" AuthMechs LOGIN -SSLType IMAPS +TLSType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore billy@spacehb.net-local Subfolders Verbatim -Path /home/aluc/.local/share/mail/billy@spacehb.net/ -Inbox /home/aluc/.local/share/mail/billy@spacehb.net/INBOX +Path ~/.local/share/mail/billy@spacehb.net/ +Inbox ~/.local/share/mail/billy@spacehb.net/INBOX Channel billy@spacehb.net Expunge Both @@ -57,13 +57,13 @@ Port 993 User tlast@spacehb.net PassCmd "pass hosts/spacehb/tlast" AuthMechs LOGIN -SSLType IMAPS +TLSType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore tlast@spacehb.net-local Subfolders Verbatim -Path /home/aluc/.local/share/mail/tlast@spacehb.net/ -Inbox /home/aluc/.local/share/mail/tlast@spacehb.net/INBOX +Path ~/.local/share/mail/tlast@spacehb.net/ +Inbox ~/.local/share/mail/tlast@spacehb.net/INBOX Channel tlast@spacehb.net Expunge Both |