From 7edc71556dc6d60116a8e255590c0e70a75e39a9 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 26 Nov 2018 14:17:18 -0500 Subject: [PATCH] prep for icon repo --- .profile | 6 ++++++ .scripts/cron/checkup | 22 ++++++++++++++++++++++ .scripts/cron/crontog | 2 +- .scripts/cron/newsup | 4 ++++ .scripts/pix/lock.png | Bin 7897 -> 0 bytes .scripts/tools/note | 11 ++++++----- .scripts/tools/transadd | 4 ++-- 7 files changed, 41 insertions(+), 8 deletions(-) create mode 100755 .scripts/cron/checkup delete mode 100644 .scripts/pix/lock.png diff --git a/.profile b/.profile index 25cb6bc..065be98 100644 --- a/.profile +++ b/.profile @@ -2,14 +2,20 @@ # Profile file. Runs on login. +# variables and default programs: +# Adds `~/.scripts` and all subdirectories to $PATH export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" export EDITOR="vim" export TERMINAL="st" +# Link handler is set as the $BROWSER for use with urlscan. +# Set your real browser in $TRUEBROWSER. export BROWSER="linkhandler" export TRUEBROWSER="firefox" export READER="zathura" export BIB="$HOME/Documents/LaTeX/uni.bib" export REFER="$HOME/.referbib" +# PIX is here I have LARBS keep icons. Subject to change, hence a variable. +export PIX="$HOME/.scripts/pix" [ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1 diff --git a/.scripts/cron/checkup b/.scripts/cron/checkup new file mode 100755 index 0000000..c823b32 --- /dev/null +++ b/.scripts/cron/checkup @@ -0,0 +1,22 @@ +#!/bin/sh +# Syncs repositories and downloads updates, meant to be run as a cronjob. +# For notifications, must export DBUS_SESSION_BUS_ADDRESS. +# See my cronjob below and mimic it: +# +# 9 12 * * * eval "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"; /home/luke/.scripts/cron/checkup + +ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit + +note "Checking for pacakge updates..." "$PIX/larbs.gif" + +sudo pacman -Syyuw --noconfirm || note "Error downloading updates. + +Check your internet connection, if pacman is already running, or run update manually to see errors." +pkill -RTMIN+8 i3blocks + +if pacman -Qul +then + note "Package updates available. Click statusbar icon for update." "$PIX/larbs.gif" +else + note "Repository sync complete. No new packages for update." "$PIX/larbs.gif" +fi diff --git a/.scripts/cron/crontog b/.scripts/cron/crontog index d5c61be..e6ffd6a 100755 --- a/.scripts/cron/crontog +++ b/.scripts/cron/crontog @@ -2,4 +2,4 @@ # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. -([ -f ~/.cronsaved ] && crontab - < ~/.cronsaved && rm ~/.cronsaved && notify-send "Cronjobs have been re-enabled." && echo cronjobs re-enabled.) || ( crontab -l > ~/.cronsaved && crontab -r && echo cronjobs saved and disabled.;notify-send "Cronjobs have been saved and disabled.") +([ -f ~/.cronsaved ] && crontab - < ~/.cronsaved && rm ~/.cronsaved && note "Cronjobs re-enabled." "$PIX/clock.gif" ) || ( crontab -l > ~/.cronsaved && crontab -r && note "Cronjobs saved and disabled." "$PIX/clock.gif") diff --git a/.scripts/cron/newsup b/.scripts/cron/newsup index d5a1dc4..81c9b01 100755 --- a/.scripts/cron/newsup +++ b/.scripts/cron/newsup @@ -6,9 +6,13 @@ ping -q -t 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit +note "Updating RSS feeds..." "$PIX/rss.gif" + echo 🔃 > ~/.config/newsboat/.update pkill -RTMIN+6 i3blocks /usr/bin/newsboat -x reload rm -f ~/.config/newsboat/.update pkill -RTMIN+6 i3blocks + +note "RSS feed update complete." "$PIX/rss.gif" diff --git a/.scripts/pix/lock.png b/.scripts/pix/lock.png deleted file mode 100644 index b09875d6758c7baa06db8d1d413c0ed67eb5cec9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7897 zcmaKx^;a7{--e3~cXu}2ZBT5;24lEOaT`8diVcPh2E$#8yALT8cZZ=v3w*I+WiWKW z%bq{rJvm9v$w~4<@=5O8SE4o574dOsZ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yn0x=rdofwM%UOvUv$*C#0bbv%iPc+h=$4n*7 z(6#C3{bW@&pKQoU9V;Q1fH$EDd-P5uV@~X%vJX>bUT@QP5i`6SW((60=(WRO;*tGv zFVMj9&CURQkr$$qENf?W?>MFJhwD{sn^la_Zi2>79k}ODeg+rq2wIH=4$xgFu_4h( z!{^brGMf8HHQ(5Jn)=vf4e`>T*;=OVF)Of0I2VP6Jur5$Kllc3CnG!R$B7A&^61C z!qV!7A?zM-QfCrE#LNjB?Vd-HtUVokqOxqcJew45SQ^qn)d!V0NBm zYC0!`UCawQityY6PmSJMNcmQIEWP?To;riTQurAo<2!VT2Zca!2>=8L}^_a8}Rm zfdU*7-1_P@E_y}V@g^JUn$w;KgeU~mJJh(Pe?bn@Mfq{ZwJeK3mte15B#@TG`oj{O z-qf?p4E9;tvAIS?5PhiXZlLMkT|cn-#p?-RQPB=oY5y+Y0vT6)z6F^0xg+sS^m(bh q)ZtCpI3Lwj!5{~9G@$bnV@>6|qlC9cz0aS}03`)=`P#P@q5lUeHiJ|E diff --git a/.scripts/tools/note b/.scripts/tools/note index a90bff1..09186ea 100755 --- a/.scripts/tools/note +++ b/.scripts/tools/note @@ -1,7 +1,8 @@ #!/bin/sh +# This is a general notification command for my own ease. +# $1 should be a message +# $2 is an optional image for notify-send +# Echos content on terminal and if dunst is running, shows notification. -# A super basic command. Give it some arguments to use as anotification. It -# will echo them on the terminal, and if you have `dunst` running, will send a -# `notify-send` message to it. - -echo "$@" && pgrep -x dunst >/dev/null && notify-send "$@" +[ -z "$2" ] || img="-i $2" +echo "$1" && pgrep -x dunst >/dev/null && notify-send $img "$1" diff --git a/.scripts/tools/transadd b/.scripts/tools/transadd index 782f67a..8cc7e80 100755 --- a/.scripts/tools/transadd +++ b/.scripts/tools/transadd @@ -7,6 +7,6 @@ # transmission-daemon sometimes fails to take remote requests in its first # moments. -pgrep -x transmission-da || (transmission-daemon && note "Starting daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks) +pgrep -x transmission-da || (transmission-daemon && note "Starting daemon..." "$PIX/dl.png" && sleep 3 && pkill -RTMIN+7 i3blocks) -transmission-remote -a "$@" && note "Torrent added." +transmission-remote -a "$@" && note "Torrent added." "$PIX/dl.png"