diff --git a/i3/i3blocks.conf b/i3/i3blocks.conf index 528fdbd..63bb24c 100644 --- a/i3/i3blocks.conf +++ b/i3/i3blocks.conf @@ -24,141 +24,27 @@ # # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate. -command=/usr/lib/i3blocks/$BLOCK_NAME +#command=/usr/lib/i3blocks/$BLOCK_NAME +command=~/bin/i3blocks/$BLOCK_NAME separator_block_width=15 markup=pango -# Volume indicator -# -# The first parameter sets the step (and units to display) -# The second parameter overrides the mixer selection -# See the script for details. -[volume] -#label=VOL -label=♪ -instance=Master -#instance=PCM -interval=once -signal=10 - -# Disk usage -# -# The directory defaults to $HOME if the instance is not specified. -# The script may be called with a optional argument to set the alert -# (defaults to 10 for 10%). -#[disk] -#label=HOME -#instance=/mnt/data -#interval=30 - - -# Memory usage -# -# The type defaults to "mem" if the instance is not specified. -[memory] -label= -separator=false -interval=30 - -#[memory] -#label=SWAP -#instance=swap -#separator=false -#interval=30 - -# CPU usage -# -# The script may be called with -w and -c switches to specify thresholds, -# see the script for details. -[cpu_usage] -label= -interval=10 -#min_width= 100.00% -separator=false - -[load_average] -label= +[disk] interval=60 -separator=false +command=disk / -# Temperature -# -# Support multiple chips, though lm-sensors. -# The script may be called with -w and -c switches to specify thresholds, -# see the script for details. -[temperature] -label= +[disk] +interval=60 +command=disk /home 🏠 + +[memory] interval=30 +label=🧠 -# Network interface monitoring -# -# If the instance is not specified, use the interface used for default route. -# The address can be forced to IPv4 or IPv6 with -4 or -6 switches. -#[iface] -#instance=wlan0 -#color=#00FF00 -#interval=10 -#separator=false +[cpu] +interval=15 +label=💻 -#[wifi] -#instance=wlp3s0 -#interval=50 -#separator=false - -[bandwidth] -label= -instance=enp3s0 -interval=5 - - -# Battery indicator -# -# The battery instance defaults to 0. -#[battery] -#label=BAT -#label=⚡ -#label=🔋 -#instance=1 -#interval=30 - -# Date Time -# -[time] -#label= -#command=date '+%d/%m/%Y %H:%M' -#command=date '+%Y-%m-%d %H:%M:%S' -#interval=59 -label= -command=date '+%a, %d %b %H:%M' -interval=5 - -# Generic media player support -# -# This displays "ARTIST - SONG" if a music is playing. -# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others. -[mediaplayer] -instance=spotify -interval=33 -signal=10 - -# OpenVPN support -# -# Support multiple VPN, with colors. -#[openvpn] -#interval=20 - -# Key indicators -# -# Add the following bindings to i3 config file: -# -# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks -# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks -#[keyindicator] -#instance=CAPS -#interval=once -#signal=11 - -#[keyindicator] -#instance=NUM -#interval=once -#signal=11 +[clock] +label=📅 +interval=30 diff --git a/i3/i3blocks/clock b/i3/i3blocks/clock new file mode 100755 index 0000000..587e3c9 --- /dev/null +++ b/i3/i3blocks/clock @@ -0,0 +1,11 @@ +#!/bin/sh + +date '+%Y %b %d (%a) %I:%M%p' + +case $BLOCK_BUTTON in + 1) pgrep -x dunst >/dev/null && notify-send "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "$(calcurse -d3)" ;; + 2) "$TERMINAL" -e calcurse ;; + 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module: +- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` +- Middle click opens calcurse if installed" ;; +esac diff --git a/i3/i3blocks/cpu b/i3/i3blocks/cpu new file mode 100755 index 0000000..fc9d617 --- /dev/null +++ b/i3/i3blocks/cpu @@ -0,0 +1,12 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) notify-send "🖥 CPU hogs: +$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; + 3) notify-send "🖥 CPU module: +- Shows CPU temperature. +- Click to show intensive processes. +- % is of single core." ;; +esac + +sensors | awk '/Core 0/ {print $3}' diff --git a/i3/i3blocks/disk b/i3/i3blocks/disk new file mode 100755 index 0000000..f5e56fa --- /dev/null +++ b/i3/i3blocks/disk @@ -0,0 +1,22 @@ + +executable file 21 lines (15 sloc) 559 Bytes +#!/bin/sh + +# Status bar module for disk space +# $1 should be drive mountpoint +# $2 is optional icon, otherwise mountpoint will displayed + +[ -z "$1" ] && exit + +icon="$2" +[ -z "$2" ] && icon="$1" + +case $BLOCK_BUTTON in + 1) pgrep -x dunst >/dev/null && notify-send "💽 Disk space: +$(df -h --output=target,used,size)" ;; + 3) pgrep -x dunst >/dev/null && notify-send "💽 Hard drive space remaining: +- Shows used hard drive space. +- Click to show all disk info." ;; +esac + +printf "%s: %s" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/i3/i3blocks/memory b/i3/i3blocks/memory new file mode 100755 index 0000000..40705c4 --- /dev/null +++ b/i3/i3blocks/memory @@ -0,0 +1,11 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) notify-send "🧠 Memory hogs: +$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; + 3) notify-send "🧠 Memory module: +- Shows Memory Used/Total. +- Click to show memory hogs." ;; +esac + +free -h | awk '/^Mem:/ {print $3 "/" $2}' diff --git a/install.sh b/install.sh index e975456..97d5318 100755 --- a/install.sh +++ b/install.sh @@ -82,6 +82,7 @@ symlink $basedir/home/tmux.conf $HOME/.tmux.conf symlink $basedir/home/vimrc $HOME/.vimrc symlink $basedir/home/gitconfig $HOME/.gitconfig symlink $basedir/home/Xresources $HOME/.Xresources +symlink $basedir/i3/i3blocks $HOME/bin/i3blocks echo "Installing VIM Pathogen..." mkdir -p $HOME/.vim/autoload $HOME/.vim/bundle