diff options
Diffstat (limited to 'dotfiles/.local/bin')
| -rwxr-xr-x | dotfiles/.local/bin/barweather | 2 | ||||
| -rwxr-xr-x | dotfiles/.local/bin/mailsync | 10 | ||||
| -rwxr-xr-x | dotfiles/.local/bin/menumako | 2 | ||||
| -rwxr-xr-x | dotfiles/.local/bin/sshwiz | 18 |
4 files changed, 24 insertions, 8 deletions
diff --git a/dotfiles/.local/bin/barweather b/dotfiles/.local/bin/barweather index 3fc7f42..a608b80 100755 --- a/dotfiles/.local/bin/barweather +++ b/dotfiles/.local/bin/barweather @@ -12,7 +12,7 @@ update_forecast() { forecast=$(curl -s wttr.in/"$location"?format=1) if [ ${#forecast} -lt 30 ]; then - printf "%s\n" "$forecast" > "$cachefile" + printf "%s\n" "$forecast" | sed -e 's/ / /g' > "$cachefile" fi } diff --git a/dotfiles/.local/bin/mailsync b/dotfiles/.local/bin/mailsync index d67db06..42b8079 100755 --- a/dotfiles/.local/bin/mailsync +++ b/dotfiles/.local/bin/mailsync @@ -9,14 +9,14 @@ notmuchrc="$HOME/.config/notmuchrc" mbsyncrc="$HOME/.config/mbsyncrc" # Run only if user logged in (prevent cron errors) -w | grep "^$USER\W" >/dev/null || exit +# w | grep "^$USER\W" >/dev/null || exit # Don't run if screen is locked (gpg key is locked too) -pidof swaylock && exit +# pidof swaylock && exit # Check several times before giving up, useful when just waking up from sleep # since internet is usually not available right away -wget -q --tries=3 --timeout=20 --spider 1.1.1.1 > /dev/null || exit +wget -q --tries=3 --timeout=20 --spider http://1.1.1.1 > /dev/null || exit thereis=0 @@ -39,12 +39,10 @@ do done if [ $thereis = 1 ]; then - mpv --really-quiet "$HOME/.local/share/soundalerts/mail.ogg" - killall -43 waybar + mpv --keep-open=no --really-quiet "$HOME/.local/share/soundalerts/mail.ogg" fi notmuch -c "$notmuchrc" new 2>/dev/null # Create a touch file that indicates the time of the last run of mailsync touch "$HOME/.cache/lastmailsync" - diff --git a/dotfiles/.local/bin/menumako b/dotfiles/.local/bin/menumako index 628a93a..96c564b 100755 --- a/dotfiles/.local/bin/menumako +++ b/dotfiles/.local/bin/menumako @@ -1,3 +1,3 @@ #!/bin/sh -makoctl menu rofi -dmenu -p "What to do?" +makoctl menu -- rofi -dmenu -p "What to do?" diff --git a/dotfiles/.local/bin/sshwiz b/dotfiles/.local/bin/sshwiz new file mode 100755 index 0000000..ba71b08 --- /dev/null +++ b/dotfiles/.local/bin/sshwiz @@ -0,0 +1,18 @@ +#!/bin/bash + +# SSH "wizard" script. Copies the public key and installs terminfo for first +# time use of a host. + +if [ -z "$1" ]; then + echo "usage: sshwiz <destination>" + exit 1 +fi + +target=$1 + +ssh-copy-id $target +echo "installing terminfo..." +infocmp $TERM > /tmp/$TERM.terminfo +rsync /tmp/$TERM.terminfo ${target}: +ssh $target "tic -x $TERM.terminfo" +echo "done" |
