This commit is contained in:
2014-11-07 17:37:04 +01:00
parent b323c66209
commit f04a4da714
19 changed files with 268 additions and 338 deletions

3
i3/i3/.gitignore vendored
View File

@@ -1 +1,2 @@
session.config
session.*.config
testing/

View File

@@ -19,7 +19,8 @@
set $mod Mod4
# The default terminal
set $terminal urxvtc #-e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"
set $terminal ~/bin/start-urxvtc.sh
#-e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"
# Path to the exit script
set $path_i3exit ~/.i3/scripts/i3exit.bash
@@ -39,16 +40,16 @@
set $signal_reboot reboot
set $signal_shutdown shutdown
set $workspace1 1
set $workspace1 1:web
set $workspace2 2
set $workspace3 3
set $workspace4 4
set $workspace5 5
set $workspace6 6
set $workspace7 7
set $workspace8 8
set $workspace9 9
set $workspace10 10
set $workspace6 6:irc
set $workspace7 7:music
set $workspace8 8:notes
set $workspace9 9:mail
set $workspace10 10:im
set $key_workspace1 1
set $key_workspace2 2
@@ -181,7 +182,7 @@
### START APPLICATIONS #####################################################
bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -i -p '>' -nb '#000000' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
bindsym $mod+Return exec $terminal
bindsym $mod+F1 exec firefox
@@ -291,10 +292,10 @@ client.urgent #2f343a #900000 #ffffff #900000
for_window [class="^URxvt$"] border 1pixel
for_window [class="^Cairo-dock$"] floating enable , border none
for_window [class="^Pavucontrol$"] floating enable , border normal
for_window [title="^Skype.*for Linux$" ] floating enable , border none
for_window [class="^Chromium$" ] border none
for_window [class="^yad-status$" ] floating enable , border none
for_window [class="^Docky$" ] floating enable , border none
for_window [title="^Skype.*for Linux$" ] floating enable , border none
for_window [class="^Skype$" ] border none
for_window [class="^Steam$" ] border none
for_window [class="^Eclipse$" ] border none
@@ -304,9 +305,21 @@ client.urgent #2f343a #900000 #ffffff #900000
for_window [class="^Evince$" ] border none
for_window [class="^Designer$" ] border none
for_window [class="^main\.py$" ] floating enable
for_window [class="^Xfce4-panel$"] floating enable
for_window [class="^Thunderbird"] border none
#for_window [class="^Xfce4-panel$"] floating enable
for_window [class="^Thunderbird$"] border none
for_window [instance="^shutdown-menu$"] border normal
for_window [class="^VirtualBox$" ] border normal
assign [class="^Thunderbird"] $workspace9
#assign [class="^Thunderbird"] $workspace9
assign [class="^Firefox$" ] $workspace1
assign [title=".*[Ss]team.*" ] $workspace5
assign [class=".*[Ss]team.*" ] $workspace5
assign [class="^Quassel$" ] $workspace6
assign [instance="^ncmpcpp$" ] $workspace7
assign [class="^Zim$" ] $workspace8
assign [class="^Thunderbird$" ] $workspace9
assign [class="^Skype$"] $workspace10

View File

@@ -1,10 +1,23 @@
exec --no-startup-id dropboxd &
# bind some keys
bindsym XF86Sleep exec --no-startup-id $path_i3exit suspend
bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master %5+
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master %5-
bindsym XF86AudioRaiseVolume exec --no-startup-id bash $HOME/.i3/scripts/pa-volume.bash set-vol +5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86AudioLowerVolume exec --no-startup-id bash $HOME/.i3/scripts/pa-volume.bash set-vol -5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
# keys seemingly switched
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
bindsym XF86AudioPrev exec --no-startup-id mpc prev
bindsym XF86AudioNext exec --no-startup-id mpc next
# font for window titles. ISO 10646 = Unicode
font pango:DejaVu Sans Mono 11
bindsym $mod+o exec --no-startup-id "bash -c '~/development/projects/xautorandr/xautorandr ; kill -SIGUSR2 $(cat $HOME/.var/run/wallchanger.pid)'"
bindsym $mod+p exec --no-startup-id "bash -c 'kill -SIGUSR1 $(cat $HOME/.var/run/wallchanger.pid)'"
# start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
@@ -13,7 +26,6 @@ bar {
mode dock
position top
# show a tray area
tray_output primary
# show workspace buttons
@@ -21,20 +33,19 @@ bar {
id bar-0
font pango:DejaVu Sans Mono 8
font pango:DejaVu Sans, Icons 9
colors {
background #000000
statusline #ffffff
separator #666666
separator #e16b40
focused_workspace #4c7899 #285577 #ffffff
active_workspace #333333 #5f676a #ffffff
inactive_workspace #333333 #222222 #888888
urgent_workspace #2f343a #900000 #ffffff
focused_workspace #e16b40 #000000 #ffffff
active_workspace #000000 #5f676a #ffffff
inactive_workspace #000000 #000000 #dddddd
urgent_workspace #D00000 #D00000 #000000
}
i3bar_command i3bar
#status_command i3status -c ~/.i3/i3status.d/netbook.conf
status_command bash ~/.i3/i3bar_wrapper.bash ~/.i3/conky/netbook.conkyrc
}

View File

@@ -18,7 +18,6 @@ font pango:DejaVu Sans Mono 11
bindsym $mod+o exec --no-startup-id "bash -c '~/development/projects/xautorandr/xautorandr ; kill -SIGUSR2 $(cat $HOME/.var/run/wallchanger.pid)'"
bindsym $mod+p exec --no-startup-id "bash -c 'kill -SIGUSR1 $(cat $HOME/.var/run/wallchanger.pid)'"
# start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
@@ -36,14 +35,14 @@ bar {
font pango:DejaVu Sans, Icons 11
colors {
background #222222
background #000000
statusline #ffffff
separator #e16b40
focused_workspace #e16b40 #222222 #ffffff
active_workspace #222222 #5f676a #ffffff
inactive_workspace #222222 #222222 #bbbbbb
urgent_workspace #000000 #de1e15 #000000
focused_workspace #e16b40 #000000 #ffffff
active_workspace #000000 #5f676a #ffffff
inactive_workspace #000000 #000000 #dddddd
urgent_workspace #D00000 #D00000 #000000
}
i3bar_command i3bar

View File

@@ -1,5 +1,4 @@
# vim:set filetype=conkyrc:
# TODO: coloring of LOAD should depend on number of cpus, as it scales accordingly
out_to_console yes
out_to_ncurses no
out_to_stderr no
@@ -12,127 +11,59 @@ double_buffer yes
update_interval 1.0
update_interval_on_battery 1.0
mpd_host 10.11.11.190
mpd_port 6600
# pad_percents is useless without use_spacer, but the latter leads to some ugly gaps
#pad_percents 2
#use_spacer left
#${mpd_artist} - ${mpd_title} ${mpd_elapsed}/${mpd_length}\
TEXT
[
${if_existing /sys/class/net/wlp2s0}\
{ "full_text" : " \
W: \
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${wireless_essid wlp2s0} (${wireless_link_qual_perc wlp2s0}%)\
[\
{ "full_text" : "\
${if_mpd_playing}\
${if_match "${mpd_status}" == "Paused"}\
\
${else}\
No Address\
\
${endif}\
${mpd_title} ${mpd_elapsed}/${mpd_length}\
${else}\
down\
 stopped\
${endif}\
" , "color" : "\
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${if_match ${wireless_link_qual_perc wlp2s0} <= 25}\
\#FF0000\
${else}${if_match ${wireless_link_qual_perc wlp2s0} <= 50}\
\#FFFF00\
${else}\
\#00FF00\
${endif}\
${endif}\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
" , "name" : "mpd_toggle" },\
\
\
\
${if_existing /sys/class/net/enp0s3}
{ "full_text" : " \
E: \
${if_up enp0s3}\
${addr enp0s3}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp0s3}\
${if_match "${addr enp0s3}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
{ "full_text" : "  \
${texeci 5 bash $HOME/.i3/scripts/pa-volume.bash status} " , "color" : "\#FFFFFF" , "name" : "volume" },\
\
\
\
${if_existing /sys/class/net/enp1s0}
{ "full_text" : " \
E: \
${if_up enp1s0}\
${addr enp1s0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp1s0}\
${if_match "${addr enp1s0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/eth0}
{ "full_text" : " \
E: \
${if_up eth0}\
${addr eth0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up eth0}\
${if_match "${addr eth0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${if_existing /sys/class/power_supply/BAT1}\
${texeci 10 bash $HOME/.i3/scripts/status.d/battery.bash conky}\
${endif}\
\
\
\
${if_existing /sys/class/power_supply/BAT0}\
{ "full_text" : " BAT: ${battery_short BAT0} "\
, "color" : "\
${if_match ${battery_percent BAT0} < 10}\#FF0000\
${else}${if_match ${battery_percent BAT0} < 30}\#FFFF00\
${else}\#00FF00\
${endif}\
${endif}\
" },
${endif}\
{ "full_text" : "  ${kernel} " , "color" : "\#FFFFFF" , "name" : "sysinfo" },\
\
\
\
{ "full_text" : " VOL: \
${if_match ${mixer} == 0}\
mute\
${else}\
${mixer}%\
${endif}\
" , "color" : "\#FFFFFF" },
{ "full_text" : "  ${texeci 60 bash ~/.i3/scripts/status.d/conky_pacman.bash} " , "color" : "\#FFFFFF" , "name" : "pacman" },\
\
\
\
{ "full_text" : " ${time %a %F %T} " , "short_text" : " ${time %a %T} " , "color" : "\#FFFFFF" , "name" : "time" }
{ "full_text" : "  $uptime_short " , "color" : "\#FFFFFF" , "name" : "sysinfo" },\
\
\
\
{ "full_text" : "  ${time %a %F %T} " , "color" : "\#FFFFFF" , "name" : "time" },\
\
\
\
{ "full_text" : "" }\
],

View File

@@ -11,122 +11,32 @@ double_buffer yes
update_interval 1.0
update_interval_on_battery 1.0
mpd_host 10.11.11.190
mpd_port 6600
# pad_percents is useless without use_spacer, but the latter leads to some ugly gaps
#pad_percents 2
#use_spacer left
#${mpd_artist} - ${mpd_title} ${mpd_elapsed}/${mpd_length}\
TEXT
[\
{ "full_text" : "\
${if_running mpd}\
${if_mpd_playing}\
${if_match "${mpd_status}" == "Paused"}\
 \
${else}\
 \
${endif}\
${mpd_artist} - ${mpd_title} ${mpd_elapsed}/${mpd_length}\
${mpd_title} ${mpd_elapsed}/${mpd_length}\
${else}\
 stopped\
${endif}\
${else}\
 down\
${endif}\
" , "name" : "mpd_toggle" },\
\
\
\
${if_existing /sys/class/net/wlp2s0}\
{ "full_text" : "  \
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${wireless_essid wlp2s0} (${wireless_link_qual_perc wlp2s0}%)\
${else}\
No Address\
${endif}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${if_match ${wireless_link_qual_perc wlp2s0} <= 25}\
\#FF0000\
${else}${if_match ${wireless_link_qual_perc wlp2s0} <= 50}\
\#FFFF00\
${else}\
\#FFFFFF\
${endif}\
${endif}\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" , "name" : "wireless" },\
${endif}\
\
\
\
${if_existing /sys/class/net/enp0s3}\
{ "full_text" : " \
enp0s3: \
${if_up enp0s3}\
${addr enp0s3}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp0s3}\
${if_match "${addr enp0s3}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },\
${endif}\
\
\
\
${if_existing /sys/class/net/enp1s0}\
{ "full_text" : " \
enp1s0: \
${if_up enp1s0}\
${addr enp1s0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp1s0}\
${if_match "${addr enp1s0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },\
${endif}\
\
\
\
${if_existing /sys/class/net/eth0}\
{ "full_text" : " \
eth0: \
${if_up eth0}\
${addr eth0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up eth0}\
${if_match "${addr eth0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },\
${endif}\
\
\
\
{ "full_text" : "  \
${texeci 5 bash $HOME/.i3/scripts/pa-volume.bash status} " , "color" : "\#FFFFFF" , "name" : "volume" },\
\
@@ -142,7 +52,7 @@ ${endif}\
\
\
\
{ "full_text" : " ${texeci 60 bash ~/.i3/scripts/status.d/conky_pacman.bash} " , "color" : "\#FFFFFF" , "name" : "pacman" },\
{ "full_text" : " ${texeci 60 bash ~/.i3/scripts/status.d/conky_pacman.bash} " , "color" : "\#FFFFFF" , "name" : "pacman" },\
\
\
\

View File

@@ -1,9 +1,11 @@
#!/bin/bash
host="$(hostname --short)"
# main configuration file that is always used
MAIN_CONF="$HOME/.i3/config"
# temporary configuration file used for this session
SESSION_CONF="$HOME/.i3/session.config"
SESSION_CONF="$HOME/.i3/session.${host}.config"
# directory that contains host specific configuration
CONF_DIR="$HOME/.i3/config.d"
# file that should be used when no host specific configuration present
@@ -11,21 +13,19 @@ DEFAULT_CONF="$CONF_DIR/default"
LOGFILE="$LOGDIR/i3/genconfig.log"
host_specific_conf="$CONF_DIR/$host.config"
log() {
echo "[$(date +%FT%T)] $*" >> "$LOGFILE"
}
host="$(hostname)"
host_specific_conf="$CONF_DIR/$host.config"
# if it's a symlink to $MAIN_CONF, cat will fail
[[ -f "$SESSION_CONF" ]] && rm "$SESSION_CONF"
if [[ ! -f "$host_specific_conf" ]] && [[ ! -f "$DEFAULT_CONF" ]]; then
# if there is no host-specific configuration and no default one, just use
# the main config
log "neither config for host $host nor default config at $DEFAULT_CONF found, using main only"
log "neither config for host $host at $host_specific_conf nor default config at $DEFAULT_CONF found, using main only"
ln -sf "$MAIN_CONF" "$SESSION_CONF"
else
# either use the host specific config if present, or the default if not

View File

@@ -28,6 +28,10 @@ setvol() {
echo "capping at 100 percent"
newvol=100
fi
if [[ $newvol -lt 0 ]]; then
echo "capping at 0 percent"
newvol=0
fi
echo "newvol $newvol"
else
newvol="$1"

View File

@@ -2,7 +2,7 @@
updates=$(pacman -Quq | wc -l)
if [[ $updates -eq 0 ]] ; then
echo "no updates"
echo "up to date"
elif [[ $updates -eq 1 ]] ; then
echo "1 update"
else

21
i3/i3/scripts/weather.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007
METRIC=1 #Should be 0 or 1; 0 for F, 1 for C
if [ -z $1 ]; then
echo
echo "USAGE: weather.sh <locationcode>"
echo
exit 0;
fi
curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | grep "Currently" | head -1 | grep -o 'Currently:[^<]*' | cut -d ' ' -f 2- | tr ':' ','
# | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }' |sed s/\:// |tr [A-Z] [a-z]