diff options
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/autostart | 5 | ||||
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/notify.sh | 21 | ||||
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/panel.sh | 98 | ||||
| -rw-r--r-- | herbstluftwm/.config/herbstluftwm/panel_indicators.sh | 127 | ||||
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/popup.sh | 26 | ||||
| -rw-r--r-- | herbstluftwm/.config/herbstluftwm/theme.sh (renamed from herbstluftwm/.config/herbstluftwm/theme) | 2 | ||||
| -rwxr-xr-x | liquidprompt/.lp_ps1 | 2 |
7 files changed, 149 insertions, 132 deletions
diff --git a/herbstluftwm/.config/herbstluftwm/autostart b/herbstluftwm/.config/herbstluftwm/autostart index 9ec12f8..c93ff15 100755 --- a/herbstluftwm/.config/herbstluftwm/autostart +++ b/herbstluftwm/.config/herbstluftwm/autostart | |||
| @@ -6,8 +6,9 @@ hc() { | |||
| 6 | herbstclient "$@" | 6 | herbstclient "$@" |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | #Include the theming script | ||
| 9 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | 10 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 10 | source "$dir/theme" | 11 | source "$dir/theme.sh" |
| 11 | 12 | ||
| 12 | #Detect monitors | 13 | #Detect monitors |
| 13 | hc set auto_detect_monitors 1 | 14 | hc set auto_detect_monitors 1 |
| @@ -186,4 +187,4 @@ $dir/start.sh "xrdb -load $HOME/.Xresources" | |||
| 186 | $dir/start.sh "xset +fp /usr/share/fonts/local" | 187 | $dir/start.sh "xset +fp /usr/share/fonts/local" |
| 187 | $dir/start.sh "xset fp rehash" | 188 | $dir/start.sh "xset fp rehash" |
| 188 | $dir/start.sh "dropboxd" | 189 | $dir/start.sh "dropboxd" |
| 189 | #$dir/start.sh "$dir/notify.sh $monitor_w $window_p $panel_h $dir/popup.sh" | 190 | #$dir/start.sh "$dir/notify.sh $dir/popup.sh" |
diff --git a/herbstluftwm/.config/herbstluftwm/notify.sh b/herbstluftwm/.config/herbstluftwm/notify.sh index 190d496..40c5330 100755 --- a/herbstluftwm/.config/herbstluftwm/notify.sh +++ b/herbstluftwm/.config/herbstluftwm/notify.sh | |||
| @@ -1,29 +1,18 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | monitor_w=$1 | ||
| 4 | window_p=$2 | ||
| 5 | panel_h=$3 | ||
| 6 | |||
| 7 | popup_w=$(echo "$monitor_w - (2 * $window_p)" | bc) | ||
| 8 | popup_h=$panel_h | ||
| 9 | popup_x=$window_p | ||
| 10 | popup_y=$window_p | ||
| 11 | |||
| 12 | popup_opts="-w $popup_w -h $popup_h -x $popup_x -y $popup_y" | ||
| 13 | |||
| 14 | while true; do | 3 | while true; do |
| 15 | 4 | ||
| 16 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) | 5 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) |
| 17 | bat_stat=$(cat /sys/class/power_supply/BAT1/status) | 6 | bat_stat=$(cat /sys/class/power_supply/BAT1/status) |
| 18 | 7 | ||
| 19 | if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then | 8 | if [[ $bat_lvl -le 5 && $bat_stat == "Discharging" ]]; then |
| 20 | $4 -m "Battery level critical: $bat_lvl%%" -u "high" $popup_opts | 9 | $1 -m "Battery level critical: $bat_lvl%%" -u "high" |
| 21 | elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then | 10 | elif [[ $bat_lvl -eq 10 && $bat_stat == "Discharging" ]]; then |
| 22 | $4 -m "Battery level low: $bat_lvl%%" $popup_opts | 11 | $1 -m "Battery level low: $bat_lvl%%" |
| 23 | elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then | 12 | elif [[ $bat_lvl -eq 50 && $bat_stat == "Discharging" ]]; then |
| 24 | $4 -m "Battery level at $bat_lvl%%" $popup_opts | 13 | $1 -m "Battery level at $bat_lvl%%" |
| 25 | elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then | 14 | elif [[ $bat_lvl -eq 100 && $bat_stat == "Charging" ]]; then |
| 26 | $4 -m "Battery fully charged" | 15 | $1 -m "Battery fully charged" |
| 27 | fi | 16 | fi |
| 28 | 17 | ||
| 29 | sleep 60; | 18 | sleep 60; |
diff --git a/herbstluftwm/.config/herbstluftwm/panel.sh b/herbstluftwm/.config/herbstluftwm/panel.sh index 9b8fb48..763c668 100755 --- a/herbstluftwm/.config/herbstluftwm/panel.sh +++ b/herbstluftwm/.config/herbstluftwm/panel.sh | |||
| @@ -5,7 +5,8 @@ hc() { | |||
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | 7 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 8 | source "$dir/theme" | 8 | source "$dir/theme.sh" |
| 9 | source "$dir/panel_indicators.sh" | ||
| 9 | 10 | ||
| 10 | monitor=${1:-0} | 11 | monitor=${1:-0} |
| 11 | 12 | ||
| @@ -41,97 +42,12 @@ fi | |||
| 41 | # <eventname>\t<data> [...] | 42 | # <eventname>\t<data> [...] |
| 42 | # e.g. | 43 | # e.g. |
| 43 | # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 | 44 | # date ^fg(#efefef)18:33^fg(#909090), 2013-10-^fg(#efefef)29 |
| 44 | |||
| 45 | while true ; do | 45 | while true ; do |
| 46 | # Music | 46 | music |
| 47 | player_status=$(playerctl status) | 47 | volume |
| 48 | if [ $player_status = "Playing" ]; then | 48 | network |
| 49 | player_artist=$(playerctl metadata artist) | 49 | battery |
| 50 | player_title=$(playerctl metadata title) | 50 | clock |
| 51 | playing="$player_title - $player_artist" | ||
| 52 | |||
| 53 | if [ "$current" != "$playing" ] ; then | ||
| 54 | current=$playing | ||
| 55 | scrolling=$current | ||
| 56 | elif [ ${#scrolling} -gt "24" ] ; then | ||
| 57 | scrolling=${scrolling:1} | ||
| 58 | else | ||
| 59 | scrolling=$current | ||
| 60 | fi | ||
| 61 | |||
| 62 | echo -e "music\t\ue05c ${scrolling:0:24}" | ||
| 63 | else | ||
| 64 | echo -e "music\toff" | ||
| 65 | fi | ||
| 66 | |||
| 67 | # Volume | ||
| 68 | if pgrep pulseaudio >> /dev/null ; then | ||
| 69 | volumes=$(\ | ||
| 70 | amixer get Master | \ | ||
| 71 | grep "Front Right: Playback"\ | ||
| 72 | ) | ||
| 73 | vol=$(\ | ||
| 74 | echo $volumes | \ | ||
| 75 | sed "s/.*\[\([0-9]*\)%\].*/\1/"\ | ||
| 76 | ) | ||
| 77 | if [ -z $vol ] ; then | ||
| 78 | echo -e "volume\toff" | ||
| 79 | else | ||
| 80 | echo -e "volume\t%{F$acolor_fg}\ue05d $vol%%%{F-}" | ||
| 81 | fi | ||
| 82 | else | ||
| 83 | echo -e "volume\toff" | ||
| 84 | fi | ||
| 85 | |||
| 86 | # Network | ||
| 87 | read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'` | ||
| 88 | if iwconfig $int1 >/dev/null 2>&1; then | ||
| 89 | wifi=$int1 | ||
| 90 | eth=$int2 | ||
| 91 | else | ||
| 92 | wifi=$int2 | ||
| 93 | eth=$int1 | ||
| 94 | fi | ||
| 95 | |||
| 96 | ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi | ||
| 97 | |||
| 98 | if [ $int == "wlp3s0" ] ; then | ||
| 99 | iwconfig=$(iwconfig $int) | ||
| 100 | ssid=$(\ | ||
| 101 | echo $iwconfig | \ | ||
| 102 | sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ | ||
| 103 | sed "s/.*\(off\/any\).*/\"\1\"/" | \ | ||
| 104 | sed "s/.*\"\(.*\)\".*/\1/"\ | ||
| 105 | ) | ||
| 106 | |||
| 107 | if [ $ssid != "off/any" ] ; then | ||
| 108 | echo -e "net\t\ue0f3 $ssid" | ||
| 109 | else | ||
| 110 | echo -e "net\toff" | ||
| 111 | fi | ||
| 112 | |||
| 113 | elif [ $int == "enp2s0" ] ; then | ||
| 114 | echo -e "net\t\ue0af ethernet" | ||
| 115 | else | ||
| 116 | echo -e "net\toff" | ||
| 117 | fi | ||
| 118 | |||
| 119 | # Battery | ||
| 120 | if $(test -e /sys/class/power_supply/BAT1) ; then | ||
| 121 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) | ||
| 122 | if [ $bat_lvl -lt 15 ] ; then | ||
| 123 | bat_color=$acolor_accent | ||
| 124 | else | ||
| 125 | bat_color=$acolor_fg | ||
| 126 | fi | ||
| 127 | state=$(cat /sys/class/power_supply/BAT1/status) | ||
| 128 | echo -e "battery\t%{F$acolor_fg}\ue03b %{F$bat_color}$bat_lvl%{F$acolor_fg}%%%{F-}" | ||
| 129 | else | ||
| 130 | echo -e "battery\toff" | ||
| 131 | fi | ||
| 132 | |||
| 133 | # Time | ||
| 134 | echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}") | ||
| 135 | sleep 1 || break | 51 | sleep 1 || break |
| 136 | done > >(uniq_linebuffered) & | 52 | done > >(uniq_linebuffered) & |
| 137 | childpid=$! | 53 | childpid=$! |
diff --git a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh new file mode 100644 index 0000000..e450337 --- /dev/null +++ b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | battery_icon=("\ue113" "\ue114" "\ue115" "\ue116" "\ue042") | ||
| 3 | network_icon=("\ue0f1" "\ue0f2" "\ue0f3" "\ue0af") | ||
| 4 | music_icon="\ue05c" | ||
| 5 | |||
| 6 | music() | ||
| 7 | { | ||
| 8 | # Music | ||
| 9 | player_status=$(playerctl status) | ||
| 10 | if [ $player_status = "Playing" ]; then | ||
| 11 | player_artist=$(playerctl metadata artist) | ||
| 12 | player_title=$(playerctl metadata title) | ||
| 13 | playing="$player_title - $player_artist" | ||
| 14 | |||
| 15 | if [ "$current" != "$playing" ] ; then | ||
| 16 | current=$playing | ||
| 17 | scrolling=$current | ||
| 18 | elif [ ${#scrolling} -gt "24" ] ; then | ||
| 19 | scrolling=${scrolling:1} | ||
| 20 | else | ||
| 21 | scrolling=$current | ||
| 22 | fi | ||
| 23 | |||
| 24 | echo -e "music\t$music_icon ${scrolling:0:24}" | ||
| 25 | else | ||
| 26 | echo -e "music\toff" | ||
| 27 | fi | ||
| 28 | } | ||
| 29 | |||
| 30 | volume() | ||
| 31 | { | ||
| 32 | # Volume | ||
| 33 | if pgrep pulseaudio >> /dev/null ; then | ||
| 34 | volumes=$(\ | ||
| 35 | amixer get Master | \ | ||
| 36 | grep "Front Right: Playback"\ | ||
| 37 | ) | ||
| 38 | vol=$(\ | ||
| 39 | echo $volumes | \ | ||
| 40 | sed "s/.*\[\([0-9]*\)%\].*/\1/"\ | ||
| 41 | ) | ||
| 42 | if [ -z $vol ] ; then | ||
| 43 | echo -e "volume\toff" | ||
| 44 | else | ||
| 45 | echo -e "volume\t%{F$acolor_fg}\ue05d $vol%%%{F-}" | ||
| 46 | fi | ||
| 47 | else | ||
| 48 | echo -e "volume\toff" | ||
| 49 | fi | ||
| 50 | } | ||
| 51 | |||
| 52 | network() | ||
| 53 | { | ||
| 54 | # Network | ||
| 55 | read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'` | ||
| 56 | if iwconfig $int1 >/dev/null 2>&1; then | ||
| 57 | wifi=$int1 | ||
| 58 | eth=$int2 | ||
| 59 | else | ||
| 60 | wifi=$int2 | ||
| 61 | eth=$int1 | ||
| 62 | fi | ||
| 63 | |||
| 64 | ip link show $eth | grep 'state UP' >/dev/null && int=$eth || int=$wifi | ||
| 65 | |||
| 66 | if [ $int == $wifi ] ; then | ||
| 67 | iwconfig=$(iwconfig $int) | ||
| 68 | ssid=$( | ||
| 69 | echo $iwconfig | \ | ||
| 70 | sed "s/.*ESSID:\(\".*\"\).*/\1/" | \ | ||
| 71 | sed "s/.*\(off\/any\).*/\"\1\"/" | \ | ||
| 72 | sed "s/.*\"\(.*\)\".*/\1/" | ||
| 73 | ) | ||
| 74 | |||
| 75 | quality=$( \ | ||
| 76 | echo $iwconfig | \ | ||
| 77 | sed "s/^.*Link Quality=\([0-9]*\)\/\([0-9]*\) .*$/(\1*100)\/\2/" | \ | ||
| 78 | bc | ||
| 79 | ) | ||
| 80 | |||
| 81 | if [ $ssid == "off/any" ] ; then | ||
| 82 | echo -e "net\toff" | ||
| 83 | elif [ $quality -lt 33 ] ; then | ||
| 84 | echo -e "net\t${network_icon[0]} $ssid" | ||
| 85 | elif [ $quality -lt 66 ] ; then | ||
| 86 | echo -e "net\t${network_icon[1]} $ssid" | ||
| 87 | else | ||
| 88 | echo -e "net\t${network_icon[2]} $ssid" | ||
| 89 | fi | ||
| 90 | |||
| 91 | elif [ $int == $eth ] ; then | ||
| 92 | echo -e "net\t${network_icon[3]} ethernet" | ||
| 93 | else | ||
| 94 | echo -e "net\toff" | ||
| 95 | fi | ||
| 96 | } | ||
| 97 | |||
| 98 | battery() | ||
| 99 | { | ||
| 100 | # Battery | ||
| 101 | if $(test -e /sys/class/power_supply/BAT1) ; then | ||
| 102 | |||
| 103 | bat_lvl=$(cat /sys/class/power_supply/BAT1/capacity) | ||
| 104 | bat_state=$(cat /sys/class/power_supply/BAT1/status) | ||
| 105 | |||
| 106 | if [ $bat_state == "Charging" ] ; then | ||
| 107 | bat_status="${battery_icon[4]}" | ||
| 108 | elif [ $bat_lvl -lt 10 ] ; then | ||
| 109 | bat_status="${F$acolor_accent}${battery_icon[0]}${F-}" | ||
| 110 | elif [ $bat_ -lt 33 ] ; then | ||
| 111 | bat_status="${battery_icon[1]}" | ||
| 112 | elif [ $bat_lvl -lt 66 ] ; then | ||
| 113 | bat_status="${battery_icon[2]}" | ||
| 114 | else | ||
| 115 | bat_status="${battery_icon[3]}" | ||
| 116 | fi | ||
| 117 | |||
| 118 | echo -e "battery\t$bat_status $bat_lvl%%%{F-}" | ||
| 119 | else | ||
| 120 | echo -e "battery\toff" | ||
| 121 | fi | ||
| 122 | } | ||
| 123 | |||
| 124 | clock() | ||
| 125 | { | ||
| 126 | echo -e $(date +$"date\t%{F$acolor_fg}%H:%M:%S %{F$acolor_fg}(%d-%m-%Y)%{F-}") | ||
| 127 | } | ||
diff --git a/herbstluftwm/.config/herbstluftwm/popup.sh b/herbstluftwm/.config/herbstluftwm/popup.sh index 41c5e9c..eda37f5 100755 --- a/herbstluftwm/.config/herbstluftwm/popup.sh +++ b/herbstluftwm/.config/herbstluftwm/popup.sh | |||
| @@ -7,29 +7,20 @@ help () { | |||
| 7 | echo -e "Options:" | 7 | echo -e "Options:" |
| 8 | echo -e " -m MESSAGE\t\tSpecifies message to be displayed" | 8 | echo -e " -m MESSAGE\t\tSpecifies message to be displayed" |
| 9 | echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" | 9 | echo -e " -t TIMEOUT\t\tAmount of time in seconds the popup is displayed" |
| 10 | echo -e " -u LEVEL\t\tUrgency level (info or high)" | ||
| 10 | } | 11 | } |
| 11 | 12 | ||
| 12 | add_alpha_channel(){ | 13 | dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 13 | echo "$1" | \ | 14 | source "$dir/theme.sh" |
| 14 | sed "s/.*#\([0-9a-fA-F]*\).*/#ff\1/" | ||
| 15 | } | ||
| 16 | 15 | ||
| 17 | timeout=10 | 16 | timeout=10 |
| 18 | message="" | 17 | message="" |
| 19 | x=0 | ||
| 20 | y=0 | ||
| 21 | width=120 | ||
| 22 | height=90 | ||
| 23 | urgency="info" | 18 | urgency="info" |
| 24 | 19 | ||
| 25 | while getopts ":m:t:x:y:w:h:u:" opt; do | 20 | while getopts ":m:t:x:y:w:h:u:" opt; do |
| 26 | case $opt in | 21 | case $opt in |
| 27 | m) message=$OPTARG ;; | 22 | m) message=$OPTARG ;; |
| 28 | t) timeout=$OPTARG ;; | 23 | t) timeout=$OPTARG ;; |
| 29 | x) x=$OPTARG ;; | ||
| 30 | y) y=$OPTARG ;; | ||
| 31 | w) width=$OPTARG ;; | ||
| 32 | h) height=$OPTARG ;; | ||
| 33 | u) urgency=$OPTARG ;; | 24 | u) urgency=$OPTARG ;; |
| 34 | esac | 25 | esac |
| 35 | done | 26 | done |
| @@ -37,13 +28,8 @@ done | |||
| 37 | if test ! $message; then | 28 | if test ! $message; then |
| 38 | help | 29 | help |
| 39 | else | 30 | else |
| 40 | light=$(add_alpha_channel $WM_LIGHT) | 31 | |
| 41 | llight=$(add_alpha_channel $WM_LLIGHT) | 32 | bar_opts="-f $font,$font_sec -B $acolor_bg -F $acolor_fg -g ${popup_width}x${height}+${popup_x}+${popup_y} -u 2" |
| 42 | accent=$(add_alpha_channel $WM_ACCENT) | ||
| 43 | ldark=$(add_alpha_channel $WM_LDARK) | ||
| 44 | dark=$(add_alpha_channel $WM_DARK) | ||
| 45 | font="-*-fixed-medium-*-*-*-$(echo "$height - 10" | bc)-*-*-*-*-*-*-*" | ||
| 46 | bar_opts="-f ${font} -B $dark -F $light -g ${width}x${height}+${x}+${y} -u 2" | ||
| 47 | 33 | ||
| 48 | t=$(date +%T) | 34 | t=$(date +%T) |
| 49 | 35 | ||
| @@ -54,7 +40,7 @@ else | |||
| 54 | fi | 40 | fi |
| 55 | 41 | ||
| 56 | { | 42 | { |
| 57 | echo "%{F$accent} $prefix %{F$light}$message %{F$llight}($t)%{F-}" | 43 | echo "%{F$acolor_accent} $prefix %{F$acolor_fg}$message %{F$acolor_fg}($t)%{F-}" |
| 58 | sleep $timeout | 44 | sleep $timeout |
| 59 | } | bar $bar_opts | 45 | } | bar $bar_opts |
| 60 | fi | 46 | fi |
diff --git a/herbstluftwm/.config/herbstluftwm/theme b/herbstluftwm/.config/herbstluftwm/theme.sh index 810c5d2..bcbc6f7 100644 --- a/herbstluftwm/.config/herbstluftwm/theme +++ b/herbstluftwm/.config/herbstluftwm/theme.sh | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Get color from ~/.Xresources | 1 | # Get color from ~/.Xresources |
| 4 | get_x_color() { | 2 | get_x_color() { |
| 5 | xresources=$(cat ~/.Xresources) | 3 | xresources=$(cat ~/.Xresources) |
diff --git a/liquidprompt/.lp_ps1 b/liquidprompt/.lp_ps1 index 821dcf7..93987bb 100755 --- a/liquidprompt/.lp_ps1 +++ b/liquidprompt/.lp_ps1 | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | # Remember that most features come with their corresponding colors, | 22 | # Remember that most features come with their corresponding colors, |
| 23 | # see the README. | 23 | # see the README. |
| 24 | 24 | ||
| 25 | LP_PS1="[\d][\t]\u on \h\n\w${LP_VCS}${LP_MARK}" | 25 | LP_PS1="[\d][\t]\u on \h\n\w${LP_VCS} ${LP_MARK}" |
| 26 | 26 | ||
| 27 | LP_TITLE=$(_lp_title $PS1) | 27 | LP_TITLE=$(_lp_title $PS1) |
| 28 | PS1="${LP_TITLE}${PS1}" | 28 | PS1="${LP_TITLE}${PS1}" |
