Update terminal colors, additions to the vimrc
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
count=0
|
||||
disconnected="/"
|
||||
disconnected2="\\"
|
||||
wireless_connected=""
|
||||
@ -9,14 +8,9 @@ ethernet_connected=""
|
||||
ID="$(ip link | awk '/state UP/ {print $2}')"
|
||||
|
||||
while true; do
|
||||
if (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
|
||||
if [[ $ID == e* ]]; then
|
||||
echo "$ethernet_connected" ; sleep 25
|
||||
else
|
||||
echo "$wireless_connected" ; sleep 25
|
||||
fi
|
||||
if (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) >/dev/null 2>&1; then
|
||||
[[ $ID == e* ]] && { echo "$ethernet_connected"; sleep 25; } || { echo "$wireless_connected"; sleep 25; }
|
||||
else
|
||||
echo "$disconnected" ; sleep 0.6
|
||||
echo "$disconnected2" ; sleep 0.6
|
||||
echo "$disconnected"; sleep 0.6; echo "$disconnected2"; sleep 0.6
|
||||
fi
|
||||
done
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
TRASH_DIRECTORY="$BLOCK_INSTANCE"
|
||||
|
||||
if [[ $TRASH_DIRECTORY = "" ]]; then
|
||||
|
@ -6,7 +6,7 @@ VER="0.4"
|
||||
usage() {
|
||||
cat <<- EOF
|
||||
|
||||
USAGE: $NAME [OPTIONS]
|
||||
USAGE: $NAME [OPTIONS]
|
||||
|
||||
OPTIONS:
|
||||
|
||||
@ -26,7 +26,8 @@ usage() {
|
||||
|
||||
-l,--logout Session logout dialog
|
||||
|
||||
Without any options -r,--run will be opened.
|
||||
|
||||
Without any options the run dialog will be opened.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
@ -6,32 +6,26 @@ NOTIFY_ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png
|
||||
get_total_updates() { UPDATES=$(checkupdates 2>/dev/null | wc -l); }
|
||||
|
||||
while true; do
|
||||
# print the icon first to avoid gibberish in polybar
|
||||
echo $BAR_ICON
|
||||
|
||||
get_total_updates
|
||||
|
||||
# notify user of updates
|
||||
if hash notify-send &>/dev/null; then
|
||||
if hash notify-send >/dev/null 2>&1; then
|
||||
if (( UPDATES > 50 )); then
|
||||
notify-send -u critical -i $NOTIFY_ICON \
|
||||
"You really need to update!!" "$UPDATES New packages"
|
||||
notify-send -u critical -i $NOTIFY_ICON "Updates Available" "$UPDATES packages"
|
||||
elif (( UPDATES > 25 )); then
|
||||
notify-send -u normal -i $NOTIFY_ICON \
|
||||
"You should update soon" "$UPDATES New packages"
|
||||
notify-send -u normal -i $NOTIFY_ICON "Updates Available" "$UPDATES packages"
|
||||
elif (( UPDATES > 2 )); then
|
||||
notify-send -u low -i $NOTIFY_ICON \
|
||||
"$UPDATES New packages"
|
||||
notify-send -u low -i $NOTIFY_ICON "Updates Available" "$UPDATES packages"
|
||||
fi
|
||||
fi
|
||||
|
||||
# when there are updates available
|
||||
# every 10 seconds another check for updates is done
|
||||
while (( UPDATES > 0 )); do
|
||||
if (( UPDATES == 1 )); then
|
||||
echo "$UPDATES Update"
|
||||
elif (( UPDATES > 1 )); then
|
||||
echo "$UPDATES Updates"
|
||||
else
|
||||
echo $BAR_ICON
|
||||
fi
|
||||
(( UPDATES == 1 )) && echo "$UPDATES Update" || { (( UPDATES > 1 )) && echo "$UPDATES Updates"; }
|
||||
sleep 10
|
||||
get_total_updates
|
||||
done
|
||||
@ -39,7 +33,6 @@ while true; do
|
||||
# when no updates are available, use a longer loop, this saves on CPU
|
||||
# and network uptime, only checking once every 30 min for new updates
|
||||
while (( UPDATES == 0 )); do
|
||||
echo $BAR_ICON
|
||||
sleep 1800
|
||||
get_total_updates
|
||||
done
|
||||
|
Reference in New Issue
Block a user