Create config generator for i3status

This commit is contained in:
2013-12-26 21:44:24 +03:00
parent 5a67da9dd1
commit bd156d251a
4 changed files with 90 additions and 71 deletions

View File

@@ -1,68 +0,0 @@
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
}
order += "ipv6"
order += "disk /"
order += "disk /home"
order += "run_watch DHCP"
order += "run_watch VPN"
order += "wireless wlp2s0"
order += "ethernet enp14s0"
order += "battery 0"
order += "cpu_temperature 0"
order += "load"
order += "tztime local"
cpu_temperature 0 {
format = "%degrees °C"
path = "/sys/devices/platform/coretemp.0/temp1_input"
}
wireless wlp2s0 {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}
ethernet enp14s0 {
# if you use %speed, i3status requires root privileges
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
battery 0 {
format = "%status %percentage %remaining"
}
run_watch DHCP {
pidfile = "/var/run/dhc*.pid"
}
run_watch VPN {
pidfile = "/var/run/vpnc/pid"
}
tztime local {
format = "%Y-%m-%d %H:%M:%S"
}
load {
format = "%1min"
}
disk "/" {
format = "/ %free"
}
disk "/home" {
format = "/home %free"
}

83
.config/i3status/config.gen Executable file
View File

@@ -0,0 +1,83 @@
#!/usr/bin/env bash
cat <<CONFIG
general {
colors = true
interval = 5
}
order += "ipv6"
order += "disk /"
order += "disk /home"
order += "run_watch DHCP"
order += "run_watch VPN"
CONFIG
wireless_interface_config=''
for wireless_interface in $(ip link | grep -Eo 'wl[a-z0-9]+'); do
echo "order += \"wireless $wireless_interface\""
wireless_interface_config="$wireless_interface_config
wireless $wireless_interface {
format_up = \"W: (%quality at %essid) %ip\"
format_down = \"W: down\"
}
"
done
ethernet_interface_config=''
for ethernet_interface in $(ip link | grep -Eo 'en[a-z0-9]+'); do
echo "order += \"ethernet $ethernet_interface\""
ethernet_interface_config="$ethernet_interface_config
ethernet $ethernet_interface {
format_up = \"E: %ip (%speed)\"
format_down = \"E: down\"
}
"
done
echo 'order += "battery 0"'
cpu_temperature_config=''
cpu_temperature_index=0
for cpu_temperature_file in /sys/devices/platform/coretemp.0/temp*_input; do
echo "order += \"cpu_temperature $cpu_temperature_index\""
cpu_temperature_config="$cpu_temperature_config
cpu_temperature $cpu_temperature_index {
format = \"%degrees °C\"
path = \"$cpu_temperature_file\"
}
"
let cpu_temperature_index+=1
done
cat <<CONFIG
order += "load"
order += "tztime local"
$cpu_temperature_config
$wireless_interface_config
$ethernet_interface_config
run_watch DHCP {
pidfile = "/var/run/dhc*.pid"
}
run_watch VPN {
pidfile = "/var/run/vpnc/pid"
}
tztime local {
format = "%Y-%m-%d %H:%M:%S"
}
load {
format = "%1min"
}
disk "/" {
format = "/ %free"
}
disk "/home" {
format = "/home %free"
}
CONFIG

View File

@@ -27,14 +27,15 @@ floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
bindsym $mod+F4 kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
bindsym $mod+r exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
bindsym $mod+F12 exec slock
# change focus
bindsym $mod+j focus left
@@ -147,7 +148,7 @@ mode "resize" {
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+m mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)

View File

@@ -10,6 +10,9 @@ setxkbmap -layout "us,ru" -option "grp:caps_toggle,grp_led:caps,compose:ralt"
xset dpms 610 610 610
xset r rate 290 30
local i3status=~/.config/i3status/config
${i3status}.gen >$i3status
#xset +fp /usr/share/fonts/local
#xset fp rehash
# if this doesn't work, run mkfontdir there