From 78f7be4e4b6501b15b5fefc9f7824bbadf0daf2a Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Fri, 13 Jun 2014 21:12:21 +0800 Subject: Added various dotfiles. * Xresources * profile, xprofile, xinitrc * bash (aliases, logout, profile, rc, completion) * gitconfig * gtkrc and gtk-bookmarks * i3 configs (with py3status configs) * i3status.conf * lftp/rc * tmux.conf * xbindkeysrc * mpdconf * ncmpcpp (config and keys) * sbclrc * vifm (vifmrc, colors) * urxvt (perl extensions) * conkyrc (and conky/cronograph configs) --- .Xresources | 315 +++ .bash_aliases | 9 + .bash_completion.d/gentoo | 1 + .bash_logout | 6 + .bash_profile | 5 + .bashrc | 56 + .conky/cronograph/accuweather/accuweather.sh | 172 ++ .conky/cronograph/accuweather/curr_cond | 5 + .conky/cronograph/accuweather/curr_cond_raw | 1646 ++++++++++++++ .conky/cronograph/accuweather/last_days | 25 + .conky/cronograph/accuweather/last_days_raw | 82 + .conky/cronograph/accuweather/tod_ton | 25 + .conky/cronograph/accuweather/tod_ton_raw | 81 + .conky/cronograph/conky_start.sh | 10 + .conky/cronograph/conkyrc | 89 + .conky/cronograph/images/Blank.png | Bin 0 -> 11356 bytes .conky/cronograph/images/Blue.png | Bin 0 -> 11605 bytes .conky/cronograph/images/Dark_Green.png | Bin 0 -> 12198 bytes .conky/cronograph/images/Dark_Purple.png | Bin 0 -> 11429 bytes .conky/cronograph/images/Green.png | Bin 0 -> 11963 bytes .conky/cronograph/images/Orange.png | Bin 0 -> 11767 bytes .conky/cronograph/images/Pink.png | Bin 0 -> 11514 bytes .conky/cronograph/images/Purple.png | Bin 0 -> 11335 bytes .conky/cronograph/images/Red.png | Bin 0 -> 11470 bytes .conky/cronograph/images/Yellow.png | Bin 0 -> 11889 bytes .conky/cronograph/scripts/blinkingLED | 3 + .conky/cronograph/scripts/clock_rings.lua | 358 +++ .conky/cronograph/scripts/multi_rings.lua | 375 ++++ .conkyrc | 89 + .gitconfig | 5 + .gtk-bookmarks | 5 + .gtkrc-2.0 | 8 + .gtkrc.mine | 25 + .i3/config | 362 +++ .i3/images/wallpaper.png | Bin 0 -> 87684 bytes .i3/py3status.conf | 78 + .i3/py3status/10-mpd.py | 117 + .i3/py3status/20-volume.py | 112 + .i3/py3status/25-microphone.py | 105 + .i3/py3status/30-touchpad.py | 86 + .i3/py3status/40-power.py | 73 + .i3/py3status/50-battery.py | 106 + .i3/py3status/80-datetime.py | 76 + .i3/py3status/backup/dpms.py | 44 + .i3/py3status/backup/empty_class.py | 41 + .i3/py3status/backup/glpi.py | 52 + .i3/py3status/backup/i3bar_click_events.py | 127 ++ .i3/py3status/backup/netdata.py | 132 ++ .i3/py3status/backup/ns_checker.py | 57 + .i3/py3status/backup/pingdom.py | 59 + .i3/py3status/backup/pomodoro.py | 123 + .i3/py3status/backup/sysdata.py | 137 ++ .i3/py3status/backup/weather_yahoo.py | 106 + .i3/py3status/backup/whoami.py | 26 + .i3/scripts/i3exit.sh | 43 + .i3status.conf | 76 + .lftp/rc | 21 + .mpdconf | 493 ++++ .ncmpcpp/config | 510 +++++ .ncmpcpp/keys | 188 ++ .profile | 34 + .sbclrc | 23 + .tmux.conf | 91 + .urxvt/ext/LICENSE | 339 +++ .urxvt/ext/README.md | 107 + .urxvt/ext/clipboard | 109 + .urxvt/ext/keyboard-select | 567 +++++ .urxvt/ext/url-select | 375 ++++ .vifm/colors/Default | 52 + .vifm/colors/alycolors | 60 + .vifm/colors/dmilith-root | 21 + .vifm/colors/dmilith-user | 21 + .vifm/colors/istib-solarized-dark | 25 + .vifm/colors/juef-zenburn | 21 + .vifm/colors/reicheltd-light | 26 + .vifm/vifm-help.txt | 3099 ++++++++++++++++++++++++++ .vifm/vifmrc | 314 +++ .xbindkeysrc | 104 + .xinitrc | 15 + .xprofile | 7 + 80 files changed, 12155 insertions(+) create mode 100644 .Xresources create mode 100644 .bash_aliases create mode 120000 .bash_completion.d/gentoo create mode 100644 .bash_logout create mode 100644 .bash_profile create mode 100644 .bashrc create mode 100755 .conky/cronograph/accuweather/accuweather.sh create mode 100644 .conky/cronograph/accuweather/curr_cond create mode 100644 .conky/cronograph/accuweather/curr_cond_raw create mode 100644 .conky/cronograph/accuweather/last_days create mode 100644 .conky/cronograph/accuweather/last_days_raw create mode 100644 .conky/cronograph/accuweather/tod_ton create mode 100644 .conky/cronograph/accuweather/tod_ton_raw create mode 100755 .conky/cronograph/conky_start.sh create mode 100644 .conky/cronograph/conkyrc create mode 100644 .conky/cronograph/images/Blank.png create mode 100644 .conky/cronograph/images/Blue.png create mode 100644 .conky/cronograph/images/Dark_Green.png create mode 100644 .conky/cronograph/images/Dark_Purple.png create mode 100644 .conky/cronograph/images/Green.png create mode 100644 .conky/cronograph/images/Orange.png create mode 100644 .conky/cronograph/images/Pink.png create mode 100644 .conky/cronograph/images/Purple.png create mode 100644 .conky/cronograph/images/Red.png create mode 100644 .conky/cronograph/images/Yellow.png create mode 100755 .conky/cronograph/scripts/blinkingLED create mode 100755 .conky/cronograph/scripts/clock_rings.lua create mode 100755 .conky/cronograph/scripts/multi_rings.lua create mode 100644 .conkyrc create mode 100644 .gitconfig create mode 100644 .gtk-bookmarks create mode 100644 .gtkrc-2.0 create mode 100644 .gtkrc.mine create mode 100644 .i3/config create mode 100644 .i3/images/wallpaper.png create mode 100644 .i3/py3status.conf create mode 100644 .i3/py3status/10-mpd.py create mode 100644 .i3/py3status/20-volume.py create mode 100644 .i3/py3status/25-microphone.py create mode 100644 .i3/py3status/30-touchpad.py create mode 100644 .i3/py3status/40-power.py create mode 100644 .i3/py3status/50-battery.py create mode 100644 .i3/py3status/80-datetime.py create mode 100644 .i3/py3status/backup/dpms.py create mode 100644 .i3/py3status/backup/empty_class.py create mode 100644 .i3/py3status/backup/glpi.py create mode 100644 .i3/py3status/backup/i3bar_click_events.py create mode 100644 .i3/py3status/backup/netdata.py create mode 100644 .i3/py3status/backup/ns_checker.py create mode 100644 .i3/py3status/backup/pingdom.py create mode 100644 .i3/py3status/backup/pomodoro.py create mode 100644 .i3/py3status/backup/sysdata.py create mode 100644 .i3/py3status/backup/weather_yahoo.py create mode 100644 .i3/py3status/backup/whoami.py create mode 100755 .i3/scripts/i3exit.sh create mode 100644 .i3status.conf create mode 100644 .lftp/rc create mode 100644 .mpdconf create mode 100644 .ncmpcpp/config create mode 100644 .ncmpcpp/keys create mode 100644 .profile create mode 100644 .sbclrc create mode 100644 .tmux.conf create mode 100644 .urxvt/ext/LICENSE create mode 100644 .urxvt/ext/README.md create mode 100644 .urxvt/ext/clipboard create mode 100644 .urxvt/ext/keyboard-select create mode 100644 .urxvt/ext/url-select create mode 100644 .vifm/colors/Default create mode 100644 .vifm/colors/alycolors create mode 100644 .vifm/colors/dmilith-root create mode 100644 .vifm/colors/dmilith-user create mode 100644 .vifm/colors/istib-solarized-dark create mode 100644 .vifm/colors/juef-zenburn create mode 100644 .vifm/colors/reicheltd-light create mode 100644 .vifm/vifm-help.txt create mode 100644 .vifm/vifmrc create mode 100644 .xbindkeysrc create mode 100644 .xinitrc create mode 100644 .xprofile diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..cb05930 --- /dev/null +++ b/.Xresources @@ -0,0 +1,315 @@ +! --------------------------------------------------------- +! $HOME/.Xresources +! +! Weitian LI +! 2014/05/10 +! +! Syntax: +! name.Class.resource: value +! +! Ref: https://wiki.archlinux.org/index.php/X_resources +! --------------------------------------------------------- + +!!! xft settings {{{ +Xft.dpi: 96 +Xft.antialias: true +Xft.rgba: rgb +Xft.hinting: true +Xft.hintstyle: hintmedium +!!! xft settings }}} + +!!! color scheme {{{ +!! foreground & background +! XXX: NOT set background and foreground globally +! to avoid conflicts with Tcl/Tk applications. (e.g. ds9) +!*background: #1b1b1b +!*foreground: #e0e0e0 +!! other colors +*cursorColor: #eeeeee +*colorBD: #cfcfcf +*colorUL: #969696 +*colorIT: #969696 +! +!! zenburn: http://xcolors.net/dl/zenburn {{{ +! Black +*color0: #1e2320 +*color8: #709080 +! Red +*color1: #705050 +*color9: #dca3a3 +! Green +*color2: #60b48a +*color10: #c3bf9f +! Yellow +*color3: #dfaf8f +*color11: #f0dfaf +! Blue +*color4: #506070 +*color12: #94bff3 +! Magenta +*color5: #dc8cc3 +*color13: #ec93d3 +! Cyan +*color6: #8cd0d3 +*color14: #93e0e3 +! White +*color7: #dcdccc +*color15: #ffffff +! zenburn }}} +! +!! clound: http://xcolors.net/dl/cloud {{{ +!!black +!*color0: #222827 +!*color8: #5D6F74 +!!red +!*color1: #D5A8E3 +!*color9: #CD749C +!!green +!*color2: #9C75DD +!*color10: #63B0B0 +!!yellow +!*color3: #9898AE +!*color11: #C0C0DD +!!blue +!*color4: #654A96 +!*color12: #5786BC +!!magenta +!*color5: #625566 +!*color13: #3F3442 +!!cyan +!*color6: #A9D1DF +!*color14: #849DA2 +!!white +!*color7: #E6EBE5 +!*color15: #D9D6CF +!! clound }}} +! +!! kori colorscheme: http://dotshare.it/dots/659/ {{{ +!!Black +!*color0: #3D3D3D +!*color8: #4D4D4D +!!Red +!*color1: #6673BF +!*color9: #899AFF +!!Green +!*color2: #3EA290 +!*color10: #52AD91 +!!Yellow +!*color3: #B0EAD9 +!*color11: #98C9BB +!!Blue +!*color4: #31658C +!*color12: #477AB3 +!!Magenta +!*color5: #596196 +!*color13: #7882BF +!!Cyan +!*color6: #8292B2 +!*color14: #95A7CC +!!White +!*color7: #C8CACC +!*color15: #EDEFF2 +!! }}} +! +!! unknown {{{ +!*color0: #353535 +!*color8: #666666 +!!red +!*color1: #D81860 +!*color9: #F00060 +!!green +!*color2: #B7CE42 +!*color10: #BDE077 +!!brown/yellow +!*color3: #FEA63C +!*color11: #FFE863 +!!blue +!*color4: #6F99B4 +!*color12: #7C96B0 +!!magenta +!*color5: #8B7B8B +!*color13: #D8BFD8 +!!cyan +!*color6: #A7A15E +!*color14: #F0E68C +!!white +!*color7: #DDDDDD +!*color15: #FFFFFF +!! }}} +! +!!! color scheme }}} + +!!! rxvt-unicode settings {{{ +!! urxvt background true transparent +! set to 32-bit for real transparency (compositing required [see xcompmgr]) +! xdpyinfo | grep Composite +URxvt.depth: 32 +! transparent=0000, opaque=ffff +URxvt.background: rgba:1111/1111/1111/dddd +! foreground +URxvt.foreground: #e0e0e0 +! +!! urxvt font settings +!URxvt.font: xft:DejaVu Sans Mono:pixelsize=16,xft:WenQuanYi Micro Hei Mono:pixelsize=16 +URxvt.font: xft:Terminus:size=12,xft:WenQuanYi Bitmap Song:size=10 +URxvt.xftAntialias: true +! +!! urxvt settings +!URxvt.termName: rxvt-256color +!URxvt.title: aly rxvt +URxvt.geometry: 92x26 +URxvt.cursorBlink: true +URxvt.underlineColor: green +URxvt.buffered: true +URxvt.jumpScroll: false +URxvt.secondaryScroll: true +URxvt.saveLines: 4000 +URxvt.scrollBar: true +URxvt.scrollBar_right: true +URxvt.scrollstyle: plain +URxvt.scrollTtyKeypress: true +URxvt.scrollTtyOutput: false +! scroll with scrollback buffer +URxvt.scrollWithBuffer: true +!URxvt.scrollColor: AntiqueWhite +! +!! urxvt keysym +! M: Meta S; Shift C: Control +! Mod4: Win +! \002: Control-B +! \015: Enter +! +!! urxvt perl extension settings +URxvt.perl-lib: ~/.urxvt/ext/ +URxvt.perl-ext-common: default,tabbed,clipboard,keyboard-select,url-select +!! tabbed color +URxvt.tabbed.tabbar-fg: 5 +URxvt.tabbed.tabbar-bg: 0 +URxvt.tabbed.tab-fg: 14 +URxvt.tabbed.tab-bg: 0 +!! copy/paste +URxvt.keysym.Mod4-c: perl:clipboard:copy +URxvt.keysym.Mod4-v: perl:clipboard:paste +URxvt.keysym.Mod4-S-v: perl:clipboard:paste_escaped +URxvt.clipboard.copycmd: xclip -i -selection clipboard +URxvt.clipboard.pastecmd: xclip -o -selection clipboard +!! keyboard-select +URxvt.keysym.Mod4-Escape: perl:keyboard-select:activate +URxvt.keysym.Mod4-s: perl:keyboard-select:search +!! url-select +URxvt.keysym.Mod4-u: perl:url-select:select_next +URxvt.url-select.underline: true +URxvt.url-select.button: 1 +URxvt.url-select.launcher: firefox -new-tab +! +!! urxvt misc settings +!URxvt.loginShell: true +URxvt.mapAlert: true +URxvt.pointerBlank: true +URxvt.urgentOnBell: true +URxvt.utmpInhibit: true +! preeditType: OverTheSpot, OffTheSpot, Root +URxvt.preeditType: root +! reduce the distance between characters +!URxvt.letterSpace: -1 +URxvt.inputMethod: fcitx +!!! rxvt-unicdoe settings }}} + +!!! xterm settings {{{ +XTerm.background: #1b1b1b +XTerm.foreground: #e0e0e0 +!XTerm.geometry: 80x25 +!XTerm.faceName: xft:Dejavu Sans Mono:pixelsize=16:antialias=true +XTerm.faceName: xft:Terminus:pixelsize=18 +XTerm.dynamicColors: true +XTerm.utf8: 2 +XTerm.eightBitInput: true +XTerm.saveLines: 4000 +XTerm.scrollTtyOutput: false +XTerm.scrollKey: true +XTerm.scrollBar: true +XTerm.rightScrollBar: true +!XTerm.loginShell: true +XTerm.jumpScroll: false +XTerm.multiScroll: true +XTerm.toolBar: true +!!! xterm settings }}} + +!!! Xcursor {{{ +! Vanilla-DMZ: white +! Vanilla-DMZ-AA: black +!Xcursor.theme: Vanilla-DMZ-AA +Xcursor.theme: Vanilla-DMZ +Xcursor.size: 32 +!!! Xcursor }}} + +!!! xfontsel {{{ +XFontSel.background: #1b1b1b +XFontSel.foreground: #e0e0e0 +!!! xfontsel }}} + +!!! x11-ssh-askpass {{{ +x11-ssh-askpass*font: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* +x11-ssh-askpass*background: #000000 +x11-ssh-askpass*foreground: #ffffff +x11-ssh-askpass.Button*background: #000000 +x11-ssh-askpass.Indicator*foreground: #ff9900 +x11-ssh-askpass.Indicator*background: #090909 +x11-ssh-askpass*topShadowColor: #000000 +x11-ssh-askpass*bottomShadowColor: #000000 +x11-ssh-askpass.*borderWidth: 1 +!!! x11-ssh-askpass }}} + +!!! xscreensaver settings {{{ +!! font settings +xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* +xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* +!! general dialog box (affects main hostname, username, password text) +xscreensaver.Dialog.foreground: #ffffff +xscreensaver.Dialog.background: #111111 +xscreensaver.Dialog.topShadowColor: #111111 +xscreensaver.Dialog.bottomShadowColor: #111111 +xscreensaver.Dialog.Button.foreground: #666666 +xscreensaver.Dialog.Button.background: #ffffff +!! username/password input box and date text colour +xscreensaver.Dialog.text.foreground: #666666 +xscreensaver.Dialog.text.background: #ffffff +xscreensaver.Dialog.internalBorderWidth: 24 +xscreensaver.Dialog.borderWidth: 20 +xscreensaver.Dialog.shadowThickness: 2 +!! timeout bar (background is actually determined by Dialog.text.background) +xscreensaver.passwd.thermometer.foreground: #ff0000 +xscreensaver.passwd.thermometer.background: #000000 +xscreensaver.passwd.thermometer.width: 8 +!! datestamp format - see strftime(3) manual page for details +xscreensaver.dateFormat: %I:%M%P %a %b %d, %Y +!! preferences +xscreensaver.mode: blank +xscreensaver.timeout: 0:10:00 +xscreensaver.cycle: 0:10:00 +xscreensaver.lock: True +xscreensaver.lockTimeout: 0:01:00 +xscreensaver.passwdTimeout: 0:00:30 +xscreensaver.dpmsEnabled: True +xscreensaver.dpmsQuickoff: True +xscreensaver.dpmsStandby: 0:10:00 +xscreensaver.dpmsSuspend: 0:10:00 +xscreensaver.dpmsOff: 0:15:00 +xscreensaver.fade: True +xscreensaver.unfade: False +xscreensaver.fadeSeconds: 0:00:03 +xscreensaver.fadeTicks: 20 +!! user switching from lock screen +! Lightdm: dm-tool switch-to-greeter +! LXDM: lxdm -c USER_SWITCH +! GDM: gdmflexiserver -ls +! KDM: kdmctl reverse +xscreensaver.newLoginCommand: dm-tool switch-to-greeter +!!! xscreensaver }}} + +! vim: set ts=8 sw=4 tw=78 ft=xdefaults: ! diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..7d25ed6 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,9 @@ +# ~/.bash_aliases +# + +### sbcl ### +#export CL_BREAK_CHARS="\"#'(),;\`\\|!?[]{}" +#alias sbcl="rlwrap -b \${CL_BREAK_CHARS} sbcl" +alias sbcl='sbcl --no-inform' + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.bash_completion.d/gentoo b/.bash_completion.d/gentoo new file mode 120000 index 0000000..98ef469 --- /dev/null +++ b/.bash_completion.d/gentoo @@ -0,0 +1 @@ +../../../usr/share/bash-completion/gentoo \ No newline at end of file diff --git a/.bash_logout b/.bash_logout new file mode 100644 index 0000000..44b6f79 --- /dev/null +++ b/.bash_logout @@ -0,0 +1,6 @@ +# /etc/skel/.bash_logout + +# This file is sourced when a login shell terminates. + +# Clear the screen for security's sake. +clear diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..94a6622 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,5 @@ +# /etc/skel/.bash_profile + +# This file is sourced by bash for login shells. The following line +# runs your .bashrc and is recommended by the bash info pages. +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..19842ea --- /dev/null +++ b/.bashrc @@ -0,0 +1,56 @@ +# ~/.bashrc +# /etc/skel/.bashrc +# +# This file is sourced by all *interactive* bash shells on startup, +# including some apparently interactive shells such as scp and rcp +# that can't tolerate any output. So make sure this doesn't display +# anything or bad things will happen ! + +# Test for an interactive shell. There is no need to set anything +# past this point for scp and rcp, and it's important to refrain from +# outputting anything in those cases. +if [[ $- != *i* ]] ; then + # Shell is non-interactive. Be done now! + return +fi + + +### bash settings {{{ +# no double entries in the shell history +export HISTCONTROL="$HISTCONTROL erasedups:ignoreboth" + +# prompt +export PS1="\[\033[01;33m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] " +### bash settings }}} + + +### bash completion {{{ +# bash-completion +if [ -f /etc/profile.d/bash-completion.sh ]; then + . /etc/profile.d/bash-completion.sh +fi +### bash completion }}} + + +### environment variables {{{ +export EDITOR=vim + +### }}} + + +### aliases {{{ +alias ll='ls -l' +alias lf='ls -F' +alias la='ls -A' + +# ~/.bash_aliases +[ -f ~/.bash_aliases ] && . ~/.bash_aliases +### aliases }}} + + +### run applications {{{ +# music player daemon (mpd) +[ ! -s ~/.mpd/pid ] && mpd >/dev/null 2>&1 +### run applications }}} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: # diff --git a/.conky/cronograph/accuweather/accuweather.sh b/.conky/cronograph/accuweather/accuweather.sh new file mode 100755 index 0000000..fe6a407 --- /dev/null +++ b/.conky/cronograph/accuweather/accuweather.sh @@ -0,0 +1,172 @@ +#!/bin/sh + +## get the directory of this script +SCRIPT_PATH=`readlink -f $0` +SCRIPT_DIR=`dirname ${SCRIPT_PATH}` + +## address (Accuweather url) +address="http://www.accuweather.com/en/cn/shanghai/106577/weather-forecast/106577" # Shanghai + + +## function: test_image() +test_image() { + case $1 in + 1) + echo a + ;; + 2|3) + echo b + ;; + 4|5) + echo c + ;; + 6) + echo d + ;; + 7) + echo e + ;; + 8) + echo f + ;; + 11) + echo 0 + ;; + 12) + echo h + ;; + 13|14) + echo g + ;; + 15) + echo m + ;; + 16|17) + echo k + ;; + 18) + echo i + ;; + 19) + echo q + ;; + 20|21|23) + echo o + ;; + 22) + echo r + ;; + 24|31) + echo E + ;; + 25) + echo v + ;; + 26) + echo x + ;; + 29) + echo y + ;; + 30) + echo 5 + ;; + 32) + echo 6 + ;; + 33) + echo A + ;; + 34|35) + echo B + ;; + 36|37) + echo C + ;; + 38) + echo D + ;; + 39|40) + echo G + ;; + 41|42) + echo K + ;; + 43|44) + echo O + ;; + *) + echo - + ;; + esac +} + + +#kill -STOP $(pidof conky) +#killall wget + +## urls and wget weather data +loc_id=$(echo ${address} | sed 's/\/weather-forecast.*$//' | sed 's/^.*\///') +last_number=$(echo ${address} | sed 's/^.*\///') + +curr_addr="$(echo ${address} | sed 's/weather-forecast.*$//')current-weather/${last_number}" +wget -O ${SCRIPT_DIR}/curr_cond_raw "${curr_addr}" + +addr1="$(echo ${address} | sed 's/weather-forecast.*$//')daily-weather-forecast/${last_number}" +wget -O ${SCRIPT_DIR}/tod_ton_raw "${addr1}" + +addr2="${addr1}?day=6" +wget -O ${SCRIPT_DIR}/last_days_raw "${addr2}" + +## current conditions +if [ -s ${SCRIPT_DIR}/curr_cond_raw ]; then + sed -i '/detail-now/,/#details/!d' ${SCRIPT_DIR}/curr_cond_raw + egrep -i '"cond"|icon i-|detail-tab-panel' ${SCRIPT_DIR}/curr_cond_raw > ${SCRIPT_DIR}/curr_cond + sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' ${SCRIPT_DIR}/curr_cond + sed -i -e 's/^.*"cond">//g' -e 's/°/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' ${SCRIPT_DIR}/curr_cond + sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' -e 's/-[a-z].*$//g' ${SCRIPT_DIR}/curr_cond + image=$(sed -n 2p ${SCRIPT_DIR}/curr_cond) + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/curr_cond +fi + +## First 5 days +if [ -s ${SCRIPT_DIR}/tod_ton_raw ]; then + sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/tod_ton_raw + egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/tod_ton_raw > ${SCRIPT_DIR}/tod_ton + sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/tod_ton + sed -i -e 's/Early AM/EARLY AM/' -e 's/Today/TODAY/' -e 's/Tonight/TONIGHT/' -e 's/Overnight/OVERNIGHT/' -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/tod_ton + time=$(sed -n 1p ${SCRIPT_DIR}/tod_ton) + image=$(sed -n 2p ${SCRIPT_DIR}/tod_ton) + # + if [ "${time}" = "TODAY" ]; then + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + elif [ "${time}" = "TONIGHT" -o "${time}" = "OVERNIGHT" -o "${time}" = "EARLY AM" ]; then + sed -i 2s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + sed -i 3a- ${SCRIPT_DIR}/tod_ton + fi + # + for i in $(seq 7 5 22); do + image=$(sed -n "${i}"p ${SCRIPT_DIR}/tod_ton) + sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/tod_ton + done +fi + +## Next 5 days +if [ -s ${SCRIPT_DIR}/last_days_raw ]; then + sed -i '/feed-tabs/,/\.feed-tabs/!d' ${SCRIPT_DIR}/last_days_raw + egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' ${SCRIPT_DIR}/last_days_raw > ${SCRIPT_DIR}/last_days + sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' ${SCRIPT_DIR}/last_days + sed -i -e 's/Mon/MON/' -e 's/Tue/TUE/' -e 's/Wed/WED/' -e 's/Thu/THU/' -e 's/Fri/FRI/' -e 's/Sat/SAT/' -e 's/Sun/SUN/' -e 's/-[a-z]*$//g' ${SCRIPT_DIR}/last_days + # + for i in $(seq 7 5 22); do + image=$(sed -n "${i}"p ${SCRIPT_DIR}/last_days) + sed -i ${i}s/${image}/$(test_image ${image})/ ${SCRIPT_DIR}/last_days + done +fi + +#kill -CONT $(pidof conky) + diff --git a/.conky/cronograph/accuweather/curr_cond b/.conky/cronograph/accuweather/curr_cond new file mode 100644 index 0000000..f5d92e6 --- /dev/null +++ b/.conky/cronograph/accuweather/curr_cond @@ -0,0 +1,5 @@ +night +A +Clear +18 + diff --git a/.conky/cronograph/accuweather/curr_cond_raw b/.conky/cronograph/accuweather/curr_cond_raw new file mode 100644 index 0000000..9f2b26c --- /dev/null +++ b/.conky/cronograph/accuweather/curr_cond_raw @@ -0,0 +1,1646 @@ + + + + Shanghai Current Weather - AccuWeather Forecast for Shanghai China + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + +
+ +
+
+ + + + + + +
+ +
+
+
+ + + + + +
+ +
+ + + +
+
+ + + + + + + + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+ 1 - 5 of 45 days | All 45 days + +
+ + +
+ Next 5 Days + +
    +
  • +
    +
    +

    Today

    +

    May 10

    +
    +
    + Rain and drizzle this morning + 22°Lo 19° +
    + +
    + +
  • +
  • +
    +
    +

    Sun

    +

    May 11

    +
    +
    + Humid with heavy rain + 23°Lo 17° +
    + + more +
    + +
  • +
  • +
    +
    +

    Mon

    +

    May 12

    +
    +
    + Nice and warm with sunshine + 26°Lo 16° +
    + + more +
    + +
  • +
  • +
    +
    +

    Tue

    +

    May 13

    +
    +
    + Rather cloudy and warm + 26°Lo 18° +
    + + more +
    + +
  • +
  • +
    +
    +

    Wed

    +

    May 14

    +
    +
    + Showers around in the morning + 25°Lo 18° +
    + + more +
    + +
  • +
+
+ + + + +
+ + +
+
+
+
+
Light fog 19° RealFeel® 20°
+ +
+ +
+ +
+
+

N

+

E

+

S

+

W

+ +
+ + +
    +
  • Humidity: 88%
  • +
  • Pressure: 1014.00 mb
  • +
  • UV Index: 4
  • +
  • Cloud Cover: 20%
  • +
  • Ceiling: 549 m
  • +
  • Dew Point: 17° C
  • +
  • Visibility: 3 km
  • +
+ +
+ + +
17 km/h
+ +
+ +
+ +
+ + + + +
+
+

Sunrise/Sunset

+
+ + + Sunrise / Sunset Illustration + +

+ Rises at + 5:03 AM + with + + 13:36 + + of sunlight, then sets at + 6:39 PM +

+ +
+ + +
+
+

Moonrise/Moonset

+ Astronomy > +
+ + + Moonrise / Moonset Illustration + +

+ Rises at + 2:18 PM + with + 12:14 + of moolight, then sets at + 2:32 AM +

+ +
+ + + +
+
+

Temperature Summary - 10:58 AM

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Temp (°C)
Now19°
Yesterday21°
RealFeel®20°
RealFeel® Shade18°
Wind Chill19°
Dew Point17°
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Hi / Lo
Previous 6 Hours20°
 18°
Previous 12 Hours20°
 17°
Previous 24 Hours22°
 17°
+
+
+
+
+ +
+
+

Temperature History - May 10

+ more Historical Weather Data > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 TodayNormalRecord5/10/2013
High22°23°N/A24°
Low19°16°N/A18°
+
+ + +
+
+

Precipitation Summary - 10:58 AM

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Amount (mm)
Previous 1 Hour0
Previous 3 Hours0
Previous 6 Hours1
Previous 9 Hours1
Previous 12 Hours1
Previous 18 Hours1
Previous 24 Hours1
+
+
+ +
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+ Top Story +

Shanghai Weather Report

+
+ + + +
+

Rainfall Tops 400 mm Near Hong Kong, More to Come

+
May 9, 2014; 10:05 PM ET
+

Hong Kong has already endured flooding rain, and more is on the way for this weekend. more >

+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + + + +
+ + + +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + diff --git a/.conky/cronograph/accuweather/last_days b/.conky/cronograph/accuweather/last_days new file mode 100644 index 0000000..75a56d9 --- /dev/null +++ b/.conky/cronograph/accuweather/last_days @@ -0,0 +1,25 @@ +WED +12 +Showers around in the morning +25 +17 +THU +d +Mostly cloudy +26 +18 +FRI +b +Partly sunny +23 +15 +SAT +i +Cooler with rain +17 +16 +SUN +i +Periods of rain +21 +17 diff --git a/.conky/cronograph/accuweather/last_days_raw b/.conky/cronograph/accuweather/last_days_raw new file mode 100644 index 0000000..6ac7def --- /dev/null +++ b/.conky/cronograph/accuweather/last_days_raw @@ -0,0 +1,82 @@ +
+ Previous 5 Days + Next 5 Days + +
    +
  • +
    +
    +

    Wed

    +

    May 14

    +
    +
    + Showers around in the morning + 25°Lo 17° +
    + +
    + +
  • +
  • +
    +
    +

    Thu

    +

    May 15

    +
    +
    + Mostly cloudy + 26°Lo 18° +
    + + more +
    + +
  • +
  • +
    +
    +

    Fri

    +

    May 16

    +
    +
    + Partly sunny + 23°Lo 15° +
    + + more +
    + +
  • +
  • +
    +
    +

    Sat

    +

    May 17

    +
    +
    + Cooler with rain + 17°Lo 16° +
    + + more +
    + +
  • +
  • +
    +
    +

    Sun

    +

    May 18

    +
    +
    + Periods of rain + 21°Lo 17° +
    + + more +
    + +
  • +
+
+ diff --git a/.conky/cronograph/accuweather/tod_ton b/.conky/cronograph/accuweather/tod_ton new file mode 100644 index 0000000..a839d7e --- /dev/null +++ b/.conky/cronograph/accuweather/tod_ton @@ -0,0 +1,25 @@ +TONIGHT +h +Rain and drizzle late +- +17 +SAT +e +Cloudy and breezy +21 +18 +SUN +i +Humid with heavy rain +23 +16 +MON +a +Nice and warm with sunshine +26 +16 +TUE +d +Rather cloudy and warm +26 +17 diff --git a/.conky/cronograph/accuweather/tod_ton_raw b/.conky/cronograph/accuweather/tod_ton_raw new file mode 100644 index 0000000..2976b86 --- /dev/null +++ b/.conky/cronograph/accuweather/tod_ton_raw @@ -0,0 +1,81 @@ +
+ Next 5 Days + +
    +
  • +
    +
    +

    Tonight

    +

    May 9

    +
    +
    + Rain and drizzle late + Lo 17° +
    + +
    + +
  • +
  • +
    +
    +

    Sat

    +

    May 10

    +
    +
    + Cloudy and breezy + 21°Lo 18° +
    + + more +
    + +
  • +
  • +
    +
    +

    Sun

    +

    May 11

    +
    +
    + Humid with heavy rain + 23°Lo 16° +
    + + more +
    + +
  • +
  • +
    +
    +

    Mon

    +

    May 12

    +
    +
    + Nice and warm with sunshine + 26°Lo 16° +
    + + more +
    + +
  • +
  • +
    +
    +

    Tue

    +

    May 13

    +
    +
    + Rather cloudy and warm + 26°Lo 17° +
    + + more +
    + +
  • +
+
+ diff --git a/.conky/cronograph/conky_start.sh b/.conky/cronograph/conky_start.sh new file mode 100755 index 0000000..98dbb27 --- /dev/null +++ b/.conky/cronograph/conky_start.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +CONKYRC="$HOME/.conky/cronograph/conkyrc" + +sleep 5 + +conky -d -c ${CONKYRC} "$@" + +exit 0 + diff --git a/.conky/cronograph/conkyrc b/.conky/cronograph/conkyrc new file mode 100644 index 0000000..3a54030 --- /dev/null +++ b/.conky/cronograph/conkyrc @@ -0,0 +1,89 @@ +# — Conky settings — # + +background yes + +update_interval 1 +total_run_times 0 +net_avg_samples 2 + +override_utf8_locale yes + +double_buffer yes +no_buffers yes + +text_buffer_size 2048 +imlib_cache_size 0 + +temperature_unit celsius + +# — Window specifications — # + +own_window_class Conky +own_window yes +own_window_type desktop +own_window_transparent yes +own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager + +border_inner_margin 0 +border_outer_margin 0 + +minimum_size 300 330 +maximum_width 300 + +alignment top_right + +gap_x 30 +gap_y 75 + + +# — Graphics settings — # +draw_shades no +draw_outline no +draw_borders no +draw_graph_borders no + +# — Text settings — # +use_xft yes +xftfont hooge 05_53:size=6 +xftalpha 0.5 + +default_color FFFFFF + +uppercase no +use_spacer right + +color0 white +color1 orange +color2 green + +# — Lua Load — # + +lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua +lua_draw_hook_pre clock_rings +lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua +lua_draw_hook_post main + +TEXT +${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} +#${voffset 29}${offset 120}BAT: +${voffset 29}${goto 109}GENTOO${goto 157}Linux +${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: +${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} +${voffset 2}${goto 65}${time %Y} +${voffset -6}${goto 145}HD +${voffset 12}${alignc}${fs_free}/${fs_size} +${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% +${voffset 10}${goto 76}CPU${goto 205}MEM +${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} +${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} +${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} +## mpd ## +${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} +${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} +${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} +${endif} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/.conky/cronograph/images/Blank.png b/.conky/cronograph/images/Blank.png new file mode 100644 index 0000000..a8adf65 Binary files /dev/null and b/.conky/cronograph/images/Blank.png differ diff --git a/.conky/cronograph/images/Blue.png b/.conky/cronograph/images/Blue.png new file mode 100644 index 0000000..2407cbe Binary files /dev/null and b/.conky/cronograph/images/Blue.png differ diff --git a/.conky/cronograph/images/Dark_Green.png b/.conky/cronograph/images/Dark_Green.png new file mode 100644 index 0000000..d40bcc4 Binary files /dev/null and b/.conky/cronograph/images/Dark_Green.png differ diff --git a/.conky/cronograph/images/Dark_Purple.png b/.conky/cronograph/images/Dark_Purple.png new file mode 100644 index 0000000..bb5da19 Binary files /dev/null and b/.conky/cronograph/images/Dark_Purple.png differ diff --git a/.conky/cronograph/images/Green.png b/.conky/cronograph/images/Green.png new file mode 100644 index 0000000..602ad43 Binary files /dev/null and b/.conky/cronograph/images/Green.png differ diff --git a/.conky/cronograph/images/Orange.png b/.conky/cronograph/images/Orange.png new file mode 100644 index 0000000..7574f9c Binary files /dev/null and b/.conky/cronograph/images/Orange.png differ diff --git a/.conky/cronograph/images/Pink.png b/.conky/cronograph/images/Pink.png new file mode 100644 index 0000000..6d2d973 Binary files /dev/null and b/.conky/cronograph/images/Pink.png differ diff --git a/.conky/cronograph/images/Purple.png b/.conky/cronograph/images/Purple.png new file mode 100644 index 0000000..e8c58e7 Binary files /dev/null and b/.conky/cronograph/images/Purple.png differ diff --git a/.conky/cronograph/images/Red.png b/.conky/cronograph/images/Red.png new file mode 100644 index 0000000..d2673e6 Binary files /dev/null and b/.conky/cronograph/images/Red.png differ diff --git a/.conky/cronograph/images/Yellow.png b/.conky/cronograph/images/Yellow.png new file mode 100644 index 0000000..8e2f62c Binary files /dev/null and b/.conky/cronograph/images/Yellow.png differ diff --git a/.conky/cronograph/scripts/blinkingLED b/.conky/cronograph/scripts/blinkingLED new file mode 100755 index 0000000..3f4c814 --- /dev/null +++ b/.conky/cronograph/scripts/blinkingLED @@ -0,0 +1,3 @@ +${image $HOME/.conky/cronograph/images/Blank.png -p 129, 241 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 129, 241 -s 40x40}${endif} +${image $HOME/.conky/cronograph/images/Blank.png -p 19, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 19, 129 -s 40x40}${endif} +${image $HOME/.conky/cronograph/images/Blank.png -p 240, 129 -s 40x40}${if_match ${execi 1 num=$(date +%-S);rem=$(( num % 2 ));if [ $rem -eq 0 ] ; then echo 0 ; else echo 1 ; fi}==0}${image $HOME/.conky/cronograph/images/Blue.png -p 240, 129 -s 40x40}${endif} diff --git a/.conky/cronograph/scripts/clock_rings.lua b/.conky/cronograph/scripts/clock_rings.lua new file mode 100755 index 0000000..fb6a838 --- /dev/null +++ b/.conky/cronograph/scripts/clock_rings.lua @@ -0,0 +1,358 @@ +--[[ +Clock Rings by londonali1010 (2009) + +This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script. + +IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. + +To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): + lua_load ~/scripts/clock_rings-v1.1.1.lua + lua_draw_hook_pre clock_rings + +Changelog: ++ v1.1.1 -- Fixed minor bug that caused the script to crash if conky_parse() returns a nil value (20.10.2009) ++ v1.1 -- Added colour option for clock hands (07.10.2009) ++ v1.0 -- Original release (30.09.2009) +]] + +settings_table = { + { + -- Edit this table to customise your rings. + -- You can create more rings simply by adding more elements to settings_table. + -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'. + name='time', + -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''. + arg='%I.%M', + -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100. + max=12, + -- "bg_colour" is the colour of the base ring. + bg_colour=0xFFFFFF, + -- "bg_alpha" is the alpha value of the base ring. + bg_alpha=0.1, + -- "fg_colour" is the colour of the indicator part of the ring. + fg_colour=0xFFFFFF, + -- "fg_alpha" is the alpha value of the indicator part of the ring. + fg_alpha=0.5, + -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window. + x=150, y=150, + -- "radius" is the radius of the ring. + radius=135, + -- "thickness" is the thickness of the ring, centred around the radius. + thickness=4, + -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative. + start_angle=0, + -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle. + end_angle=360 + }, + { + name='time', + arg='%M.%S', + max=60, + bg_colour=0xFFFFFF, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.5, + x=150, y=150, + radius=140, + thickness=4, + start_angle=0, + end_angle=360 + }, + { + name='time', + arg='%S', + max=60, + bg_colour=0xFFFFFF, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.5, + x=150, y=150, + radius=145, + thickness=4, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.1, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=150, + radius=66, + thickness=130, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=150, + radius=1, + thickness=10, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=30, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=15, + thickness=27, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=85, y=150, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=30, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=15, + thickness=27, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=215, y=150, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=25, + thickness=1, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0x000000, + bg_alpha=0.3, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=13, + thickness=22, + start_angle=0, + end_angle=360 + }, + { + name='', + arg='', + max=100, + bg_colour=0xFFFFFF, + bg_alpha=1.0, + fg_colour=0xFFFFFF, + fg_alpha=0.0, + x=150, y=75, + radius=1, + thickness=2, + start_angle=0, + end_angle=360 + }, + } + +-- Use these settings to define the origin and extent of your clock. + +clock_r=127 + +-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window. + +clock_x=150 +clock_y=150 + +-- Colour & alpha of the clock hands + +clock_colour=0xFFFFFF +clock_alpha=1 + +-- Do you want to show the seconds hand? + +show_seconds=true + +require 'cairo' + +function rgb_to_r_g_b(colour,alpha) + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + +function draw_ring(cr,t,pt) + local w,h=conky_window.width,conky_window.height + + local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] + local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] + + local angle_0=sa*(2*math.pi/360)-math.pi/2 + local angle_f=ea*(2*math.pi/360)-math.pi/2 + local t_arc=t*(angle_f-angle_0) + + -- Draw background ring + + cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) + cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) + cairo_set_line_width(cr,ring_w) + cairo_stroke(cr) + + -- Draw indicator ring + + cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) + cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) + cairo_stroke(cr) +end + +function draw_clock_hands(cr,xc,yc) + local secs,mins,hours,secs_arc,mins_arc,hours_arc + local xh,yh,xm,ym,xs,ys + + secs=os.date("%S") + mins=os.date("%M") + hours=os.date("%I") + + secs_arc=(2*math.pi/60)*secs + mins_arc=(2*math.pi/60)*mins+secs_arc/60 + hours_arc=(2*math.pi/12)*hours+mins_arc/12 + + -- Draw hour hand + + xh=xc+0.7*clock_r*math.sin(hours_arc) + yh=yc-0.7*clock_r*math.cos(hours_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xh,yh) + + cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND) + cairo_set_line_width(cr,5) + cairo_set_source_rgba(cr,rgb_to_r_g_b(clock_colour,clock_alpha)) + cairo_stroke(cr) + + -- Draw minute hand + + xm=xc+clock_r*math.sin(mins_arc) + ym=yc-clock_r*math.cos(mins_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xm,ym) + + cairo_set_line_width(cr,3) + cairo_stroke(cr) + + -- Draw seconds hand + + if show_seconds then + xs=xc+clock_r*math.sin(secs_arc) + ys=yc-clock_r*math.cos(secs_arc) + cairo_move_to(cr,xc,yc) + cairo_line_to(cr,xs,ys) + + cairo_set_line_width(cr,1) + cairo_stroke(cr) + end +end + +function conky_clock_rings() + local function setup_rings(cr,pt) + local str='' + local value=0 + + str=string.format('${%s %s}',pt['name'],pt['arg']) + str=conky_parse(str) + + value=tonumber(str) + if value == nil then value = 0 end + pct=value/pt['max'] + + draw_ring(cr,pct,pt) + end + + -- Check that Conky has been running for at least 5s + + if conky_window==nil then return end + local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) + + local cr=cairo_create(cs) + + local updates=conky_parse('${updates}') + update_num=tonumber(updates) + + if update_num>5 then + for i in pairs(settings_table) do + setup_rings(cr,settings_table[i]) + end + end + + draw_clock_hands(cr,clock_x,clock_y) +end diff --git a/.conky/cronograph/scripts/multi_rings.lua b/.conky/cronograph/scripts/multi_rings.lua new file mode 100755 index 0000000..b9735b2 --- /dev/null +++ b/.conky/cronograph/scripts/multi_rings.lua @@ -0,0 +1,375 @@ +--============================================================================== +-- multi_rings.lua +-- +-- author : SLK +-- version : v2011011601 +-- license : Distributed under the terms of GNU GPL version 2 or later +-- +--============================================================================== + +require 'cairo' + +-------------------------------------------------------------------------------- +-- clock DATA +-- HOURS +clock_h = { + { + name='time', arg='%H', max_value=12, + x=150, y=150, + graph_radius=140, + graph_thickness=3, + graph_unit_angle=30, graph_unit_thickness=5, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=1, txt_size=10.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=125, + graduation_thickness=10, graduation_mark_thickness=2, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + }, +} +-- MINUTES +clock_m = { + { + name='time', arg='%M', max_value=60, + x=150, y=150, + graph_radius=100, + graph_thickness=3, + graph_unit_angle=6, graph_unit_thickness=3, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=0, txt_size=9.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=57, + graduation_thickness=0, graduation_mark_thickness=2, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, + }, +} +-- SECONDS +clock_s = { + { + name='time', arg='%S', max_value=60, + x=150, y=150, + graph_radius=50, + graph_thickness=3, + graph_unit_angle=6, graph_unit_thickness=3, + graph_bg_colour=0xffffff, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + txt_radius=100, + txt_weight=0, txt_size=12.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=0, + graduation_thickness=0, graduation_mark_thickness=0, + graduation_unit_angle=0, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0, + }, +} + +-------------------------------------------------------------------------------- +-- gauge DATA +gauge = { +{ + name='cpu', arg='cpu0', max_value=100, + x=85, y=150, + graph_radius=14, + graph_thickness=27, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=27, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +{ + name='memperc', arg='', max_value=100, + x=215, y=150, + graph_radius=14, + graph_thickness=27, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=27, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +{ + name='fs_used_perc', arg='/', max_value=100, + x=150, y=75, + graph_radius=10, + graph_thickness=23, + graph_start_angle=0, + graph_unit_angle=3.5, graph_unit_thickness=3.0, + graph_bg_colour=0xFFFFFF, graph_bg_alpha=0.0, + graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.0, + hand_fg_colour=0xFFFFFF, hand_fg_alpha=1.0, + txt_radius=1, + txt_weight=0, txt_size=8.0, + txt_fg_colour=0xFFFFFF, txt_fg_alpha=0.0, + graduation_radius=22, + graduation_thickness=4, graduation_mark_thickness=4, + graduation_unit_angle=30, + graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=1.0, + caption='', + caption_weight=1, caption_size=8.0, + caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.0, +}, +} + +------------------------------------------------------------------------------- +-- rgb_to_r_g_b +-- converts color in hexa to decimal +-- +function rgb_to_r_g_b(colour, alpha) + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + +------------------------------------------------------------------------------- +-- angle_to_position +-- convert degree to rad and rotate (0 degree is top/north) +-- +function angle_to_position(start_angle, current_angle) + local pos = current_angle + start_angle + return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) ) +end + +------------------------------------------------------------------------------- +-- draw_clock_ring +-- displays clock +-- +function draw_clock_ring(display, data, value) + local max_value = data['max_value'] + local x, y = data['x'], data['y'] + local graph_radius = data['graph_radius'] + local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] + local graph_unit_angle = data['graph_unit_angle'] + local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] + local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] + + -- background ring + cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- arc of value + local val = (value % max_value) + local i = 1 + while i <= val do + cairo_arc(display, x, y, graph_radius,( ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360) )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = (graph_unit_angle * i) - graph_unit_thickness + + -- graduations marks + local graduation_radius = data['graduation_radius'] + local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] + local graduation_unit_angle = data['graduation_unit_angle'] + local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = 360 / graduation_unit_angle + local i = 1 + while i <= nb_graduation do + cairo_set_line_width(display, graduation_thickness) + cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- text + local txt_radius = data['txt_radius'] + local txt_weight, txt_size = data['txt_weight'], data['txt_size'] + local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] + local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2))) + local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2))) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight); + cairo_set_font_size (display, txt_size); + cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)); + cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3); + cairo_show_text (display, value); + cairo_stroke (display); +end + +------------------------------------------------------------------------------- +-- draw_gauge_ring +-- displays gauges +-- +function draw_gauge_ring(display, data, value) + local max_value = data['max_value'] + local x, y = data['x'], data['y'] + local graph_radius = data['graph_radius'] + local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness'] + local graph_start_angle = data['graph_start_angle'] + local graph_unit_angle = data['graph_unit_angle'] + local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha'] + local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha'] + local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha'] + local graph_end_angle = (max_value * graph_unit_angle) % 360 + + -- background ring + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle)) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- arc of value + local val = value % (max_value + 1) + local start_arc = 0 + local stop_arc = 0 + local i = 1 + while i <= val do + start_arc = (graph_unit_angle * i) - graph_unit_thickness + stop_arc = (graph_unit_angle * i) + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = start_arc + + -- hand + start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2) + stop_arc = (graph_unit_angle * val) + cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha)) + cairo_stroke(display) + + -- graduations marks + local graduation_radius = data['graduation_radius'] + local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness'] + local graduation_unit_angle = data['graduation_unit_angle'] + local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha'] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = graph_end_angle / graduation_unit_angle + local i = 0 + while i < nb_graduation do + cairo_set_line_width(display, graduation_thickness) + start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2) + stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2) + cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc)) + cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- text + local txt_radius = data['txt_radius'] + local txt_weight, txt_size = data['txt_weight'], data['txt_size'] + local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha'] + local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle)) + local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle)) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight) + cairo_set_font_size (display, txt_size) + cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)) + cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3) + cairo_show_text (display, value) + cairo_stroke (display) + + -- caption + local caption = data['caption'] + local caption_weight, caption_size = data['caption_weight'], data['caption_size'] + local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha'] + local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) + local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2))) + cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight); + cairo_set_font_size (display, caption_size) + cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha)) + cairo_move_to (display, x + tox + 5, y + toy + 1) + -- bad hack but not enough time ! + if graph_start_angle < 105 then + cairo_move_to (display, x + tox - 30, y + toy + 1) + end + cairo_show_text (display, caption) + cairo_stroke (display) +end + +------------------------------------------------------------------------------- +-- go_clock_rings +-- loads data and displays clock +-- +function go_clock_rings(display) + local function load_clock_rings(display, data) + local str, value = '', 0 + str = string.format('${%s %s}',data['name'], data['arg']) + str = conky_parse(str) + value = tonumber(str) + draw_clock_ring(display, data, value) + end + + for i in pairs(clock_h) do + load_clock_rings(display, clock_h[i]) + end + for i in pairs(clock_m) do + load_clock_rings(display, clock_m[i]) + end + for i in pairs(clock_s) do + load_clock_rings(display, clock_s[i]) + end +end + +------------------------------------------------------------------------------- +-- go_gauge_rings +-- loads data and displays gauges +-- +function go_gauge_rings(display) + local function load_gauge_rings(display, data) + local str, value = '', 0 + str = string.format('${%s %s}',data['name'], data['arg']) + str = conky_parse(str) + value = tonumber(str) + draw_gauge_ring(display, data, value) + end + + for i in pairs(gauge) do + load_gauge_rings(display, gauge[i]) + end +end + +------------------------------------------------------------------------------- +-- MAIN +function conky_main() + if conky_window == nil then + return + end + + local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) + local display = cairo_create(cs) + + local updates = conky_parse('${updates}') + update_num = tonumber(updates) + + if update_num > 5 then + go_clock_rings(display) + go_gauge_rings(display) + end + +end + diff --git a/.conkyrc b/.conkyrc new file mode 100644 index 0000000..3a54030 --- /dev/null +++ b/.conkyrc @@ -0,0 +1,89 @@ +# — Conky settings — # + +background yes + +update_interval 1 +total_run_times 0 +net_avg_samples 2 + +override_utf8_locale yes + +double_buffer yes +no_buffers yes + +text_buffer_size 2048 +imlib_cache_size 0 + +temperature_unit celsius + +# — Window specifications — # + +own_window_class Conky +own_window yes +own_window_type desktop +own_window_transparent yes +own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager + +border_inner_margin 0 +border_outer_margin 0 + +minimum_size 300 330 +maximum_width 300 + +alignment top_right + +gap_x 30 +gap_y 75 + + +# — Graphics settings — # +draw_shades no +draw_outline no +draw_borders no +draw_graph_borders no + +# — Text settings — # +use_xft yes +xftfont hooge 05_53:size=6 +xftalpha 0.5 + +default_color FFFFFF + +uppercase no +use_spacer right + +color0 white +color1 orange +color2 green + +# — Lua Load — # + +lua_load $HOME/.conky/cronograph/scripts/clock_rings.lua +lua_draw_hook_pre clock_rings +lua_load $HOME/.conky/cronograph/scripts/multi_rings.lua +lua_draw_hook_post main + +TEXT +${execi 600 sh $HOME/.conky/cronograph/accuweather/accuweather.sh} +#${voffset 29}${offset 120}BAT: +${voffset 29}${goto 109}GENTOO${goto 157}Linux +${voffset 17}${goto 65}${font hooge 05_53:size=12}${time %H:%M}${font}${goto 185}UPTIME: +${voffset 2}${goto 65}${time %a %d %b}${goto 185}${uptime} +${voffset 2}${goto 65}${time %Y} +${voffset -6}${goto 145}HD +${voffset 12}${alignc}${fs_free}/${fs_size} +${voffset 36}${goto 91}${cpu cpu0}%${goto 221}${memperc}% +${voffset 10}${goto 76}CPU${goto 205}MEM +${voffset 16}${goto 82}${font hooge 05_53:size=12}${execpi 600 sed -n '4p' $HOME/.conky/cronograph/accuweather/curr_cond}°C${font}${voffset -30}${goto 125}${font ConkyWeather:size=40}${execpi 600 sed -n '2p' $HOME/.conky/cronograph/accuweather/curr_cond}${font}${voffset -16}${goto 185}${execpi 600 sed -n '3p' $HOME/.conky/cronograph/accuweather/curr_cond}${voffset 12}${goto 185}${font ConkyWeather:size=20}${voffset 1}${goto 80}${execpi 600 sed -n '7p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 135}${execpi 600 sed -n '12p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 185}${execpi 600 sed -n '17p' $HOME/.conky/cronograph/accuweather/tod_ton}${font}${voffset 6}${goto 84}${execpi 600 sed -n '9p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '10p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 140}${execpi 600 sed -n '14p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '15p' $HOME/.conky/cronograph/accuweather/tod_ton}°${goto 190}${execpi 600 sed -n '19p' $HOME/.conky/cronograph/accuweather/tod_ton}°/${execpi 600 sed -n '20p' $HOME/.conky/cronograph/accuweather/tod_ton}°${voffset 7}${goto 85}${execpi 600 sed -n '6p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/.conky/cronograph/accuweather/tod_ton}${goto 190}${execpi 600 sed -n '16p' $HOME/.conky/cronograph/accuweather/tod_ton} +${if_match ${battery_percent BAT0}>0}${if_match ${battery_percent BAT0}<=15}${image $HOME/.conky/cronograph/images/Red.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>15}${if_match ${battery_percent BAT0}<=20}${image $HOME/.conky/cronograph/images/Orange.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>20}${if_match ${battery_percent BAT0}<=35}${image $HOME/.conky/cronograph/images/Yellow.png -p 129,18 -s 40x40}${endif}${endif} +${if_match ${battery_percent BAT0}>35}${if_match ${battery_percent BAT0}<=100}${image $HOME/.conky/cronograph/images/Dark_Green.png -p 129,18 -s 40x40}${endif}${endif} +${execpi 30 cat $HOME/.conky/cronograph/scripts/blinkingLED} +## mpd ## +${if_mpd_playing}${voffset 6}${goto 10}${font Sans:size=8:bold}${mpd_artist}${font}${voffset -5}${font Sans:size=8} - ${mpd_title}${font} +${voffset 4}${goto 10}${mpd_bar 5,220}${alignr 10}${mpd_elapsed}/${mpd_length} +${else}${voffset 6}${goto 10}${font hooge 05_53:size=8}MPD: stopped${font} +${endif} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conkyrc: # diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..2ca776e --- /dev/null +++ b/.gitconfig @@ -0,0 +1,5 @@ +[user] + name = Weitian LI + email = liweitianux@gmail.com +[push] + default = simple diff --git a/.gtk-bookmarks b/.gtk-bookmarks new file mode 100644 index 0000000..8af8f6f --- /dev/null +++ b/.gtk-bookmarks @@ -0,0 +1,5 @@ +file:///home/aly/Documents +file:///home/aly/Music +file:///home/aly/Pictures +file:///home/aly/Videos +file:///home/aly/Downloads diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 new file mode 100644 index 0000000..dc786c3 --- /dev/null +++ b/.gtkrc-2.0 @@ -0,0 +1,8 @@ +## +## ~/.gtkrc-2.0 +## + +## NOTE: cannot use `~' and `$HOME' here + +include "/home/aly/.gtkrc.mine" + diff --git a/.gtkrc.mine b/.gtkrc.mine new file mode 100644 index 0000000..7652fa4 --- /dev/null +++ b/.gtkrc.mine @@ -0,0 +1,25 @@ +## +## ~/.gtkrc.mine +## + +## font +gtk-font-name = "Sans 10" + +## theme +#gtk-theme-name = "Clearlooks" +#gtk-theme-name = "FlatStudioLight" +#gtk-theme-name = "FlatStudioGray" +gtk-theme-name = "FlatStudioDark" + +## icon +#gtk-icon-theme-name = "AwOken" +gtk-icon-theme-name = "AwOkenWhite" +#gtk-icon-theme-name = "AwOkenDark" + +## toolbar +# GTK_TOOLBAR_ICONS: only icons +# GTK_TOOLBAR_TEXT: only text +# GTK_TOOLBAR_BOTH: both icon and text +# GTK_TOOLBAR_BOTH_HORIZ: icon and text next to the icon +gtk-toolbar-style = GTK_TOOLBAR_ICONS + diff --git a/.i3/config b/.i3/config new file mode 100644 index 0000000..3388538 --- /dev/null +++ b/.i3/config @@ -0,0 +1,362 @@ +########################################################### +## ~/.i3/config +## +## i3 config file (v4) +## Ref: http://i3wm.org/docs/userguide.html +## +## Weitian LI +## 2014/05/10 +########################################################### + +###### NOTES ###### {{{ +# To get a config file with the same key positions, but for your current +# layout, use the `i3-config-wizard' +###### NOTES ###### }}} + +###### variables ###### {{{ +## modifier +# Mod1: Alt +# Mod4: Win +set $mod Mod1 +set $sup Mod4 + +# variables used in this config +set $i3_scripts ~/.i3/scripts +set $i3_images ~/.i3/images + +# screenshots directory +set $shots_dir ~/pictures/screenshots +###### variables ###### }}} + +###### settings ###### {{{ +# Font for window titles. (also for bar if not specified) +# ISO 10646: Unicode +# Use pango to choose FreeType fonts +#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +#font pango:DejaVu Sans Mono 10 +font pango:Terminus, WenQuanYi Bitmap Song, Icons, FontAwesome, 10 + +# use `Mouse+$mod' to drag floating windows +floating_modifier $mod + +# focus follows mouse (default yes) +#focus_follows_mouse no + +# timeout of urgency hint on workspace change (default 500ms) +force_display_urgency_hint 1000 ms + +# ipc (`i3-msg' to run i3 commands) +ipc-socket ~/.i3/i3-ipc.sock +###### settings ###### }}} + +###### appearance ###### {{{ +# border style +#new_window 1pixel +bindsym $mod+t border normal +bindsym $mod+y border 1pixel +bindsym $mod+u border none + +# orientation for new workspaces +default_orientation auto + +# hide vertical borders adjacent to the screen edge +#hide_edge_borders vertical + +### colors +## solarized colorscheme (customized) {{{ +client.background #1e2320 +# colorclass border background text indicator +client.focused #859900 #859900 #fdf6e3 #2e9ef4 +client.focused_inactive #268bd2 #268bd2 #fdf6e3 #484e50 +client.unfocused #93a1a1 #93a1a1 #fdf6e3 #292d2e +client.urgent #cb4b16 #cb4b16 #fdf6e3 #2e9ef4 +## colorscheme }}} +# +###### appearance ###### }}} + +###### workspace ###### {{{ +# name workspace +set $ws1 1gentoo +set $ws2 2term +set $ws3 3vim +set $ws4 4web +set $ws5 5work +set $ws6 6media +set $ws7 7game +set $ws8 8sys +set $ws9 9misc +set $ws0 0float + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws0 +# auto back-and-forth when switched to the current workspace +workspace_auto_back_and_forth yes + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws0 +# move to provided workspace +bindsym $mod+Shift+m exec i3-input -F 'move container to workspace "%s"' -P 'move to workspace: ' + +# assign workspace for applications +assign [class="Gvim"] $ws3 +assign [class="Firefox" instance="Navigator"] $ws4 +assign [class="Vlc"] $ws6 + +# switch workspace +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+Ctrl+Left workspace prev +bindsym $mod+Ctrl+Right workspace next +# also bind ThinkPad 'XF86Back' and 'XF86Forward' keys +#bindsym XF86Back workspace prev +#bindsym XF86Forward workspace next +###### workspace ###### }}} + +###### key bindings ###### {{{ +# start a terminal +bindsym $mod+Return exec urxvtc || i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill +bindsym $mod+F4 kill + +# change focus (h/j/k/l) +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window (h/j/k/l) +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+Shift+v split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +bindsym $mod+c focus child + +## scratchpad +# move the currently focused window to the scratchpad +bindsym $mod+Shift+minus move scratchpad +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +bindsym $mod+minus scratchpad show + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +###### key bindings ###### }}} + +###### i3 modes ###### {{{ +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + # Pressing left will shrink the window's width. + # Pressing right will grow the window's width. + # Pressing up will shrink the window's height. + # Pressing down will grow the window's height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# mode_system: prompt for lock, logout, suspend, shutdown, etc. +set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown +mode "$mode_system" { + bindsym l exec --no-startup-id $i3_scripts/i3exit.sh lock, mode "default" + bindsym e exec --no-startup-id $i3_scripts/i3exit.sh logout, mode "default" + bindsym s exec --no-startup-id $i3_scripts/i3exit.sh suspend, mode "default" + bindsym h exec --no-startup-id $i3_scripts/i3exit.sh hibernate, mode "default" + bindsym r exec --no-startup-id $i3_scripts/i3exit.sh reboot, mode "default" + bindsym Shift+s exec --no-startup-id $i3_scripts/i3exit.sh shutdown, mode "default" + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+Ctrl+Delete mode "$mode_system" +###### i3 modes ###### }}} + +###### applications bindings ###### {{{ +## NOTE: (Mod4: Win) +## Some Mod4-keys binded for urxvt (~/.Xresources) +## Mod4-c, Mod4-v, Mod4-Shift-v +## Mod4-Escape, Mode4-s, Mod4-u + +# dmenu & i3-dmenu-desktop +bindsym $mod+d exec --no-startup-id dmenu_run +bindsym $mod+F2 exec --no-startup-id dmenu_run +# `i3-dmenu-desktop' only displays applications with a .desktop file +bindsym $mod+p exec --no-startup-id i3-dmenu-desktop + +# lock screen (i3lock) +bindsym $mod+Ctrl+l exec --no-startup-id $i3_scripts/i3exit.sh lock +# turn off display +bindsym $mod+Ctrl+b exec --no-startup-id sleep 1 && xset dpms force off + +# screenshots +bindsym Print exec --no-startup-id scrot -e 'mv $f $shots_dir/$f' +bindsym $mod+Print exec --no-startup-id scrot -s -e 'mv $f $shots_dir/$f' + +# terminal +bindsym $sup+t exec urxvtc || urxvt || i3-sensible-terminal +# file manager +bindsym $sup+f exec thunar +# web browser +bindsym $sup+w exec ~/bin/firefox || firefox + +## dropdown terminal +# auto start urxvt if closed +exec --no-startup-id "while true; do urxvt -name 'dropdown_term'; done" +#for_window [instance="dropdown_term"] floating enable, border 1pixel +#for_window [instance="dropdown_term"] move scratchpad; [instance="dropdown_term"] scratchpad show; resize shrink height 100px; resize grow width 626px; move position 1px 20px; move scratchpad +for_window [instance="dropdown_term"] floating enable, border 1pixel, resize shrink height 100px, resize grow width 626px, move position 1px 20px +for_window [instance="dropdown_term"] move scratchpad +bindsym $mod+backslash [instance="dropdown_term"] scratchpad show +###### applications bindings ###### }}} + +###### window control ###### {{{ +## floating +for_window [window_role="pop-up"] floating enable +for_window [class="Feh"] floating enable +for_window [class="XFontSel"] floating enable +for_window [class="Arandr"] floating enable +for_window [class="Xfce4-notifyd"] floating enable +for_window [class="Xscreensaver-demo"] floating enable +for_window [class="Pinentry-gtk-2"] floating enable +for_window [class="Ds9"] floating enable +for_window [class="Toplevel"] floating enable +for_window [class="Firefox" instance="Places"] floating enable +for_window [class="Firefox" instance="Browser"] floating enable +for_window [class="Firefox" instance="Update"] floating enable +## floating by title +# xbindkeys +for_window [title="^XBindKey:.*Hit.*"] floating enable +# xev +for_window [title="^Event Tester$"] floating enable +# thunar copy files +for_window [title="^File Operation Progress$"] floating enable + +## adjust window border +for_window [class="URxvt"] border 1pixel +for_window [class="Firefox"] border 1pixel +for_window [class="Xfce4-notifyd"] border none +###### window control ###### }}} + +###### i3bar ###### {{{ +# i3bar (plus the system information i3status finds out, if available) +bar { + #status_command py3status -c ~/.i3/py3status.conf + status_command py3status -s -c ~/.i3/py3status.conf + position top + # whether show the current binding mode indicator (default yes) + #binding_mode_indicator no + + ## color theme + colors { + ## zenburn colorscheme (customized) {{{ + background #1e2320 + statusline #dcdccc + separator #94bff3 + # colorclass border background text + focused_workspace #506070 #506070 #ffffff + active_workspace #dcdccc #506070 #ffffff + inactive_workspace #dcdccc #1e2320 #dcdccc + urgent_workspace #dcdccc #cb4b16 #dcdccc + ## colorscheme }}} + # + ## solarized colorscheme {{{ + #background #073642 + #statusline #eee8d5 + #focused_workspace #cb4b16 #cb4b16 #eee8d5 + #active_workspace #cb4b16 #cb4b16 #eee8d5 + #inactive_workspace #b58900 #b58900 #eee8d5 + ## solarized }}} + } +} +###### i3bar ###### }}} + +###### autostart ###### {{{ +## run applications on startup +## if need to run command when restarting i3, use `exec_always' +# disable bell +exec --no-startup-id xset b off +exec --no-startup-id xrdb -load ~/.Xresources +exec --no-startup-id sh ~/.fehbg +exec --no-startup-id xcompmgr +exec --no-startup-id xbindkeys +exec --no-startup-id urxvtd -q -o -f +exec --no-startup-id parcellite +exec --no-startup-id fcitx +exec --no-startup-id nm-applet +exec --no-startup-id xbacklight -set 80 +exec --no-startup-id xscreensaver -no-splash +exec --no-startup-id xfce4-power-manager +exec --no-startup-id mpd +###### autostart ###### }}} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/.i3/images/wallpaper.png b/.i3/images/wallpaper.png new file mode 100644 index 0000000..468b1a9 Binary files /dev/null and b/.i3/images/wallpaper.png differ diff --git a/.i3/py3status.conf b/.i3/py3status.conf new file mode 100644 index 0000000..d19b4b8 --- /dev/null +++ b/.i3/py3status.conf @@ -0,0 +1,78 @@ +## ~/.i3/py3status.conf +## +## py3status configuration file +## same syntax as 'i3status.conf' (man i3status) +## + +# 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 + color_good = '#dcdccc' + color_degraded = '#8cd0d3' + color_bad = '#dc8cc3' + interval = 3 + # output format (i3bar|dzen2|xmobar|none) + output_format = 'i3bar' +} + +#order += "volume master" +#order += "ipv6" +#order += "disk /" +#order += "run_watch DHCP" +#order += "run_watch VPN" +#order += "wireless wlp3s0" +#order += "ethernet enp0s25" +order += "battery 0" +order += "load" +#order += "tztime local" + +volume master { + format = "%volume" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + +wireless wlp3s0 { + #format_up = "W: (%quality at %essid) %ip" + format_up = "%essid(%ip)" + format_down = "down" +} + +ethernet enp0s25 { + # if you use %speed, i3status requires root privileges + format_up = "E: %ip" + format_down = "E: down" +} + +battery 0 { + format = "%status %percentage %remaining" +} + +run_watch DHCP { + #pidfile = "/var/run/dhclient*.pid" + pidfile = "/var/run/dhcpd*.pid" +} + +run_watch VPN { + pidfile = "/var/run/vpnc/pid" +} + +tztime local { + #format = "%Y-%m-%d %H:%M:%S" + format = "%m-%d|%H:%M" +} + +load { + format = "%1min" +} + +disk "/" { + format = "%free" +} + +# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=conf: # diff --git a/.i3/py3status/10-mpd.py b/.i3/py3status/10-mpd.py new file mode 100644 index 0000000..95b7b4f --- /dev/null +++ b/.i3/py3status/10-mpd.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/14 + +""" +mpd module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import os +import re +import subprocess +import time + + +POSITION = 0 +# regex to match the status string of 'mpc status' output +mpd_status_p = re.compile(r'.*\n^\[([a-z]+)\]', re.M) # multiline + +class Py3status: + """ + MPD module to show mpd status and play info. + + This module also handle click events: + left button: mpc toggle + middle button: mpc stop + right button: mpc next + """ + + def mpd(self, i3status_output_json, i3status_config): + """ + Display MPD status and song info. + """ + response = { + 'full_text': '', + 'name': 'mpd', + 'instance': 'first', + } + # update response fields + self._update_response(i3status_config) + if self.color: + response['color'] = self.color + response['full_text'] = self.full_text + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + + def on_click(self, i3status_output_json, i3status_config, event): + """ + Handle click events. + """ + if event['button'] == 1: + # left button click + cmd = 'mpc toggle' + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 2: + # middle button click + cmd = 'mpc stop' + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 3: + # right button click + cmd = 'mpc next' + cmd_output = subprocess.getoutput(cmd) + # + self._update_response(i3status_config) + os.system('killall -USR1 py3status') + + def _update_response(self, i3status_config=None): + ## get mpd status + cmd = 'mpc status' + cmd_out = subprocess.getstatusoutput(cmd) + if cmd_out[0] == 0: + # mpd is running + mpd_status_m = mpd_status_p.match(cmd_out[1]) + if mpd_status_m: + self.status = mpd_status_m.group(1) + else: + self.status = 'stopped' + else: + # mpd not running (N/A) + self.status = 'na' + ## set full_text and color + prompt = '' # Icons: uF198 (music) + if self.status == 'playing': + status_text = ' ' # Icons: uF04B (play) + cmd = 'mpc status -f "%artist%-%title%" | head -n 1' + song_text = subprocess.getoutput(cmd) + if i3status_config: + self.color = i3status_config['color_good'] + elif self.status == 'paused': + status_text = ' ' # Icons: uF04C (pause) + cmd = 'mpc status -f "%title%" | head -n 1' + song_text = subprocess.getoutput(cmd) + if i3status_config: + self.color = i3status_config['color_degraded'] + elif self.status == 'stopped': + status_text = '' # Icons: uF04D (stop) + song_text = '' + if i3status_config: + self.color = i3status_config['color_bad'] + else: + # mpd not running (N/A) + status_text = '' # Icons: uF00D (X) + song_text = '' + if i3status_config: + self.color = i3status_config['color_bad'] + # full_text + self.full_text = '{0} {1}{2}'.format(prompt, status_text, song_text) + diff --git a/.i3/py3status/20-volume.py b/.i3/py3status/20-volume.py new file mode 100644 index 0000000..467764c --- /dev/null +++ b/.i3/py3status/20-volume.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/15 + +""" +volume module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import os +import re +import subprocess +import time + + +POSITION = 0 +DEVICE = 'default' +MIXER = 'Master' +# regex compile to match amixer output volume info +amixer_rep = re.compile(r'.*\[(\d+)%\]\s*\[(on|off)\]') + + +class Py3status: + """ + Volume module to show volume info. + + This module also handle click events: + left button: decrease volume + middle button: mute/unmute toggle + right button: increase volume + """ + + def myvolume(self, i3status_output_json, i3status_config): + """ + Display volume info. + + XXX: cannot use name 'volume' ?? + """ + response = { + 'full_text': '', + 'name': 'myvolume', + 'instance': 'first', + } + # update response fields + self._update_response(i3status_config) + if self.color: + response['color'] = self.color + response['full_text'] = self.full_text + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + + def on_click(self, i3status_output_json, i3status_config, event): + """ + Handle click events. + """ + if event['button'] == 1: + # left button click + cmd = 'amixer -D "{0}" sset "{1}" "5%-" unmute'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 2: + # middle button click + cmd = 'amixer -D "{0}" sset "{1}" toggle'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 3: + # right button click + cmd = 'amixer -D "{0}" sset "{1}" "5%+" unmute'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + # + self._update_response(i3status_config) + os.system('killall -USR1 py3status') + + def _update_response(self, i3status_config=None): + """ + update self.full_text + """ + # get volume info + cmd = 'amixer -D "{0}" sget "{1}" | tail -n 1'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + m = amixer_rep.match(cmd_output) + self.volume, self.status = m.group(1, 2) + if int(self.volume) > 60: + self.level = 'high' + prompt = '' # Icons: uF357 (volume-high) + if i3status_config: + self.color = i3status_config['color_degraded'] + elif int(self.volume) > 30: + self.level = 'medium' + prompt = '' # Icons: uF359 (volume-medium) + if i3status_config: + self.color = i3status_config['color_good'] + else: + self.level = 'low' + prompt = '' # Icons: uF358 (volume-low) + if i3status_config: + self.color = i3status_config['color_good'] + # determine icon + if self.status == 'off': + prompt = '' # Icons: uF35A (volume-off) + if i3status_config: + self.color = i3status_config['color_bad'] + # determine display info + self.full_text = '{0} {1}%'.format(prompt, self.volume) + diff --git a/.i3/py3status/25-microphone.py b/.i3/py3status/25-microphone.py new file mode 100644 index 0000000..379a44c --- /dev/null +++ b/.i3/py3status/25-microphone.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/15 + +""" +microphone module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import os +import re +import subprocess + + +POSITION = 0 +DEVICE = 'default' +MIXER = 'Capture' # Microphone +# regex compile to match amixer output volume info +amixer_rep = re.compile(r'.*\[(\d+)%\]\s*\[(on|off)\]') + + +class Py3status: + """ + Microphone module to show microphone info. + + This module also handle click events: + left button: decrease volume + middle button: mute/unmute toggle + right button: increase volume + """ + + def microphone(self, i3status_output_json, i3status_config): + """ + Display microphone info. + """ + response = { + 'full_text': '', + 'name': 'microphone', + 'instance': 'first', + } + # update response fields + self._update_response(i3status_config) + response['full_text'] = self.full_text + if self.color: + response['color'] = self.color + return (POSITION, response) + + def on_click(self, i3status_output_json, i3status_config, event): + """ + Handle click events. + """ + if event['button'] == 1: + # left button click + cmd = 'amixer -D "{0}" sset "{1}" "5%-" unmute'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 2: + # middle button click + cmd = 'amixer -D "{0}" sset "{1}" toggle'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + elif event['button'] == 3: + # right button click + cmd = 'amixer -D "{0}" sset "{1}" "5%+" unmute'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + # + self._update_response(i3status_config) + os.system('killall -USR1 py3status') + + def _update_response(self, i3status_config=None): + """ + update self.full_text + """ + # get volume info + cmd = 'amixer -D "{0}" sget "{1}" | tail -n 1'.format(DEVICE, MIXER) + cmd_output = subprocess.getoutput(cmd) + m = amixer_rep.match(cmd_output) + self.volume, self.status = m.group(1, 2) + prompt = '' # Icons: uF130 (mic-on) + if int(self.volume) > 60: + self.level = 'high' + if i3status_config: + self.color = i3status_config['color_degraded'] + elif int(self.volume) > 30: + self.level = 'medium' + if i3status_config: + self.color = i3status_config['color_good'] + else: + self.level = 'low' + if i3status_config: + self.color = i3status_config['color_good'] + # determine icon + if self.status == 'off': + prompt = '' # Icons: uF131 (mic-off) + if i3status_config: + self.color = i3status_config['color_bad'] + # determine display info + self.full_text = '{0} {1}%'.format(prompt, self.volume) + diff --git a/.i3/py3status/30-touchpad.py b/.i3/py3status/30-touchpad.py new file mode 100644 index 0000000..195d6b1 --- /dev/null +++ b/.i3/py3status/30-touchpad.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/15 + +""" +touchpad module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import os +import re +import subprocess + + +POSITION = 0 + + +class Py3status: + """ + Touchpad module to show the status of touchpad. + + Click events: + left button: enable touchpad + middle button: toggle touchpad + """ + + def __init__(self): + """ + get touchpad status + """ + cmd = 'synclient -l | grep -c "TouchpadOff.*=.*0"' + touchpad_status = subprocess.getoutput(cmd) + if int(touchpad_status) == 1: + self.status = 'on' + else: + self.status = 'off' + + def touchpad(self, i3status_output_json, i3status_config): + """ + Display touchpad status. + """ + #prompt = '' # Icons: uF10A (ipad) + prompt = '' # Icons: uF3E3 (palm) + response = { + 'full_text': '', + 'name': 'touchpad', + 'instance': 'first', + } + if self.status == 'on': + response['color'] = i3status_config['color_good'] + status_text = '' # Icons: uF00C (check) + else: + response['color'] = i3status_config['color_bad'] + status_text = '' # Icons: uF00D (cross) + response['full_text'] = '{0} {1}'.format(prompt, status_text) + return (POSITION, response) + + def on_click(self, i3status_output_json, i3status_config, event): + """ + Handle click events. + """ + if event['button'] == 1: + # left button click + cmd = 'synclient TouchpadOff=0' + cmd_output = subprocess.getoutput(cmd) + self.status = 'on' + elif event['button'] == 2: + # middle button click + if self.status == 'on': + cmd = 'synclient TouchpadOff=1' + self.status = 'off' + else: + cmd = 'synclient TouchpadOff=0' + self.status = 'on' + cmd_output = subprocess.getoutput(cmd) + # + os.system('killall -USR1 py3status') + diff --git a/.i3/py3status/40-power.py b/.i3/py3status/40-power.py new file mode 100644 index 0000000..96b8ce5 --- /dev/null +++ b/.i3/py3status/40-power.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/15 + +""" +power module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import re +import subprocess +import time + + +POSITION = 0 + +BAT_PRESENT = '/sys/class/power_supply/BAT0/present' +# regex to match the '1' at the beginning +one_p = re.compile(r'(^1).*') + + +class Py3status: + """ + Power module to show whether AC/battery is online. + + ac_status: online, offline + bat_status: present, na + """ + + def power(self, i3status_output_json, i3status_config): + """ + Display power status. + """ + response = { + 'full_text': '', + 'name': 'power', + 'instance': 'first', + } + # AC online + ac_cmd = 'on_ac_power' + ac_cmd_out = subprocess.getstatusoutput(ac_cmd) + if ac_cmd_out[0] == 0: + ac_text = '' # Icons: uF237 (ac-online) + self.ac_status = 'online' + response['color'] = i3status_config['color_good'] + else: + ac_text = '' # Icons: uF236 (ac-offline) + self.ac_status = 'offline' + response['color'] = i3status_config['color_bad'] + # Battery present + with open(BAT_PRESENT, 'r') as bat_present_f: + bat_present_c = bat_present_f.read() + bat_m = one_p.match(bat_present_c) + if bat_m.group(1): + bat_text = ' ' # Icons: uF3CF (battery-vertical) + self.bat_status = 'present' + else: + bat_text = '' + self.bat_status = 'na' + # + response['full_text'] = '{0} {1}'.format(ac_text, bat_text) + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + diff --git a/.i3/py3status/50-battery.py b/.i3/py3status/50-battery.py new file mode 100644 index 0000000..5e88125 --- /dev/null +++ b/.i3/py3status/50-battery.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/17 + +""" +battery module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import re +import subprocess +import time + + +POSITION = 0 + +BAT_ID = 0 +## uevent: +## ENERGY_NOW: energy that battery has now +## POWER_NOW: battery current discharging/charing rate +BAT_UEVENT = '/sys/class/power_supply/BAT{0}/uevent'.format(BAT_ID) + +# regex to match pattern in 'uevent' contents' +status_p = re.compile(r'.*STATUS=(\w+)', re.S) +present_p = re.compile(r'.*PRESENT=(\d)', re.S) +capacity_p = re.compile(r'.*CAPACITY=(\d+)', re.S) +energynow_p = re.compile(r'.*ENERGY_NOW=(\d+)', re.S) +powernow_p = re.compile(r'.*POWER_NOW=(\d+)', re.S) + + +class Py3status: + """ + Battery module to show battery information. + + battery status: Full, Discharging, Charging, Unknown + """ + + def mybattery(self, i3status_output_json, i3status_config): + """ + Display battery information. + """ + response = { + 'full_text': '', + 'name': 'mybattery', + 'instance': 'first', + } + # open battery uevent file + with open(BAT_UEVENT, 'r') as bat_f: + bat_info = bat_f.read() + status_m = status_p.match(bat_info) + capacity_m = capacity_p.match(bat_info) + energynow_m = energynow_p.match(bat_info) + powernow_m = powernow_p.match(bat_info) + self.status = status_m.group(1) + self.capacity = int(capacity_m.group(1)) + energynow = int(energynow_m.group(1)) + powernow = int(powernow_m.group(1)) + # + bat_text = '{0}%'.format(self.capacity) + if self.status == 'Full': + prompt = '' # Icons: uF213 (battery-full) + color = i3status_config['color_good'] + elif self.status == 'Charging': + prompt = '' # Icons: uF211 (battery-charing) + color = i3status_config['color_degraded'] + elif self.status == 'Discharging': + if self.capacity > 80: + prompt = '' # Icons: uF213 (battery-full) + color = i3status_config['color_good'] + elif self.capacity > 60: + prompt = '' # Icons: uF214 (battery-high) + color = i3status_config['color_degraded'] + elif self.capacity > 30: + prompt = '' # Icons: uF215 (battery-low) + color = i3status_config['color_degraded'] + else: + prompt = '' # Icons: uF212 (battery-empty) + color = i3status_config['color_bad'] + # calc remaining time + remaining_h = energynow // powernow + remaining_m = int((energynow % powernow) / powernow * 60) + if remaining_h: + remaining = '{0}h{1:02d}m'.format(remaining_h, remaining_m) + else: + remaining = '{0:02d}m'.format(remaining_m) + bat_text = '{0} {1}'.format(bat_text, remaining) + else: + # unknown battery status + prompt = '' # Icons: uF215 (battery-low) + prompt = prompt + ' ' # Icons: uF243 (question-sign) + color = i3status_config['color_bad'] + # + response['full_text'] = '{0} {1}'.format(prompt, bat_text) + response['color'] = color + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + diff --git a/.i3/py3status/80-datetime.py b/.i3/py3status/80-datetime.py new file mode 100644 index 0000000..5d578a0 --- /dev/null +++ b/.i3/py3status/80-datetime.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Weitian LI +# 2014/05/15 + +""" +datetime module for py3status +""" + +## Get output of shell command: +## python 3.x: +## >>> subprocess.getoutput(cmd) +## >>> subprocess.getstatusoutput(cmd) +## python 2.7.x: +## >>> subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) + +import re +import subprocess +import time + + +# regext to match date and time from output of 'date' +datetime_p = re.compile(r'(^\d+/\d+)\s*(\d+:\d+)') + + +class Py3status: + """ + Datetime module to show current date and time. + """ + + def mydate(self, i3status_output_json, i3status_config): + """ + Display current date. + """ + POSITION = 0 + response = { + 'full_text': '', + 'name': 'mydate', + 'instance': 'first', + } + prompt = '' # Icons: uF073 (calendar) + # update datetime + self._get_datetime() + response['full_text'] = '{0} {1}'.format(prompt, self.date) + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + + def mytime(self, i3status_output_json, i3status_config): + """ + Display current time. + """ + POSITION = 1 + response = { + 'full_text': '', + 'name': 'mytime', + 'instance': 'first', + } + prompt = '' # Icons: uF017 (clock) + # update datetime + self._get_datetime() + response['full_text'] = '{0} {1}'.format(prompt, self.time) + # cache status for 5 seconds + response['cached_until'] = time.time() + 5 + return (POSITION, response) + + def _get_datetime(self): + """ + Get current date and time + """ + cmd = 'date "+%m/%d %H:%M"' + datetime = subprocess.getoutput(cmd) + dt_m = datetime_p.match(datetime) + self.date, self.time = dt_m.group(1, 2) + diff --git a/.i3/py3status/backup/dpms.py b/.i3/py3status/backup/dpms.py new file mode 100644 index 0000000..783c53c --- /dev/null +++ b/.i3/py3status/backup/dpms.py @@ -0,0 +1,44 @@ +from os import system + + +class Py3status: + """ + This module allows activation and deactivation + of DPMS (Display Power Management Signaling) + by clicking on 'DPMS' in the status bar. + + Written and contributed by @tasse: + Andre Doser + """ + def __init__(self): + """ + Detect current state on start. + """ + self.run = system('xset -q | grep -iq "DPMS is enabled"') == 0 + + def dpms(self, i3status_output_json, i3status_config): + """ + Display a colorful state of DPMS. + """ + result = { + 'full_text': 'DPMS', + 'name': 'dpms' + } + if self.run: + result['color'] = i3status_config['color_good'] + else: + result['color'] = i3status_config['color_bad'] + return (0, result) + + def on_click(self, json, i3status_config, event): + """ + Enable/Disable DPMS on left click. + """ + if event['button'] == 1: + if self.run: + self.run = False + system("xset -dpms") + else: + self.run = True + system("xset +dpms") + system("killall -USR1 py3status") diff --git a/.i3/py3status/backup/empty_class.py b/.i3/py3status/backup/empty_class.py new file mode 100644 index 0000000..077269c --- /dev/null +++ b/.i3/py3status/backup/empty_class.py @@ -0,0 +1,41 @@ +class Py3status: + """ + Empty and basic py3status class. + + NOTE: py3status will NOT execute: + - methods starting with '_' + - methods decorated by @property and @staticmethod + + NOTE: reserved method names: + - 'kill' method for py3status exit notification + - 'on_click' method for click events from i3bar + """ + def kill(self, i3status_output_json, i3status_config): + """ + This method will be called upon py3status exit. + """ + pass + + def on_click(self, i3status_output_json, i3status_config, event): + """ + This method will be called when a click event occurs on this module's + output on the i3bar. + + Example 'event' json object: + {'y': 13, 'x': 1737, 'button': 1, 'name': 'empty', 'instance': 'first'} + """ + pass + + def empty(self, i3status_output_json, i3status_config): + """ + This method will return an empty text message + so it will NOT be displayed on your i3bar. + + If you want something displayed you should write something + in the 'full_text' key of your response. + + See the i3bar protocol spec for more information: + http://i3wm.org/docs/i3bar-protocol.html + """ + response = {'full_text': '', 'name': 'empty', 'instance': 'first'} + return (0, response) diff --git a/.i3/py3status/backup/glpi.py b/.i3/py3status/backup/glpi.py new file mode 100644 index 0000000..929749d --- /dev/null +++ b/.i3/py3status/backup/glpi.py @@ -0,0 +1,52 @@ +# You need MySQL-python from http://pypi.python.org/pypi/MySQL-python +import MySQLdb + + +class Py3status: + """ + This example class demonstrates how to display the current total number of + open tickets from GLPI in your i3bar. + + It features thresholds to colorize the output and forces a low timeout to + limit the impact of a server connectivity problem on your i3bar freshness. + + Note that we don't have to implement a cache layer as it is handled by + py3status automagically. + """ + def count_glpi_open_tickets(self, json, i3status_config): + response = {'full_text': '', 'name': 'glpi_tickets'} + + # user-defined variables + CRIT_THRESHOLD = 20 + WARN_THRESHOLD = 15 + MYSQL_DB = '' + MYSQL_HOST = '' + MYSQL_PASSWD = '' + MYSQL_USER = '' + POSITION = 0 + + mydb = MySQLdb.connect( + host=MYSQL_HOST, + user=MYSQL_USER, + passwd=MYSQL_PASSWD, + db=MYSQL_DB, + connect_timeout=5, + ) + mycr = mydb.cursor() + mycr.execute('''select count(*) + from glpi_tickets + where closedate is NULL and solvedate is NULL;''') + row = mycr.fetchone() + if row: + open_tickets = int(row[0]) + if i3status_config['colors']: + if open_tickets > CRIT_THRESHOLD: + response.update({'color': i3status_config['color_bad']}) + elif open_tickets > WARN_THRESHOLD: + response.update( + {'color': i3status_config['color_degraded']} + ) + response['full_text'] = '%s tickets' % open_tickets + mydb.close() + + return (POSITION, response) diff --git a/.i3/py3status/backup/i3bar_click_events.py b/.i3/py3status/backup/i3bar_click_events.py new file mode 100644 index 0000000..792965c --- /dev/null +++ b/.i3/py3status/backup/i3bar_click_events.py @@ -0,0 +1,127 @@ +from subprocess import Popen +from time import time + + +class Py3status: + """ + This module allows you to take actions based on click events made on + the i3status modules. For example, thanks to this module you could + launch the wicd GUI when clicking on the ethernet or wireless module + of your i3status output ! + + IMPORTANT: + This module file name is reserved and should NOT be changed if you + want py3status to handle your i3status modules click events ! + + The behavior described above will only work if this file is named + 'i3bar_click_events.py' ! + """ + def __init__(self): + """ + This is where you setup your actions based on your i3status config. + + Configuration: + -------------- + self.actions = { + "": { +