diff --git a/dotfiles/config/i3/config b/dotfiles/config/i3/config index e71506d..165a56e 100644 --- a/dotfiles/config/i3/config +++ b/dotfiles/config/i3/config @@ -117,7 +117,7 @@ bindsym $mod+r mode "resize" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { - status_command i3status + status_command bash -c "i3status -c <(~/.config/i3status/build_config.sh)" } # Cycle through workspaces like cinnamon @@ -170,6 +170,13 @@ exec --no-startup-id xset r rate 200 20 exec --no-startup-id ~/bin/autostart.py # customize windows +for_window [window_role="pop-up"] floating enable +for_window [window_role="bubble"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="Preferences"] floating enable +for_window [window_type="dialog"] floating enable +for_window [window_type="menu"] floating enable + for_window [class="^google-chrome$"] border pixel for_window [class="^Google-chrome-beta$"] border pixel for_window [class="^burp-StartBurp$" title="^(?!Burp Suite)"] floating enable diff --git a/dotfiles/config/i3status/build_config.sh b/dotfiles/config/i3status/build_config.sh new file mode 100755 index 0000000..f0e1e02 --- /dev/null +++ b/dotfiles/config/i3status/build_config.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +function general { + cat <<-EOF + general { + colors = true + interval = 5 + } + EOF +} + +function disks { + local DISKS=(/ /home) + local d + local used + for d in ${DISKS[@]} ; do + local dev=`df $d | tail -1 | awk '{print $1}'` + if [[ *$dev* == $used ]] ; then + continue + fi + local size=`df $d | tail -1 | awk '{print $2}'` + if [ $size -eq 0 ] ; then + continue + fi + used="${used} ${dev}" + cat <<-EOF + disk "${d}" { + format = "${d} %avail" + } + order += "disk ${d}" + EOF + done +} + +function wireless { + which iwconfig >/dev/null || return + iwconfig 2>&1 | grep . | grep -vq 'no wireless extensions' || return + cat <<-EOF + wireless _first_ { + format_up = "W: (%quality %essid) %ip" + format_down = "W: down" + } + order += "wireless _first_" + EOF +} + +function wired { + cat <<-EOF + ethernet _first_ { + format_up = "E: %ip" + format_down = "E: down" + } + order += "ethernet _first_" + EOF +} + +function ipv6 { + echo "order += \"ipv6\"" +} + +function load { + cat <<-EOF + load { + format = "%1min %5min" + } + order += "load" + EOF +} + +function now { + cat <<-EOF + tztime local { + format = "%Y-%m-%d %H:%M" + } + order += "tztime local" + EOF +} + +function battery { + local bat + shopt -s nullglob + for bat in /sys/class/power_supply/BAT* ; do + local bid=${bat##*BAT} + cat <<-EOF + battery ${bid} { + low_threshold = 15 + threshold_type = time + status_chr = "↑ CHR" + status_bat = "↓ BAT" + status_unk = "? UNK" + status_full = "FULL" + format = "%status %remaining (%emptytime %consumption)" + path = "/sys/class/power_supply/BAT%{bid}/uevent" + } + order += "battery ${bid}" + EOF + done +} + +general +disks +wireless +wired +ipv6 +load +battery +now + +# vim:set noexpandtab