diff options
Diffstat (limited to 'herbstluftwm')
-rwxr-xr-x | herbstluftwm/autostart | 37 | ||||
-rwxr-xr-x | herbstluftwm/bar/functions/sysinfo | 48 | ||||
-rwxr-xr-x | herbstluftwm/bar/functions/volume_info | 3 | ||||
-rwxr-xr-x | herbstluftwm/bar/functions/weather | 21 | ||||
-rwxr-xr-x | herbstluftwm/bar/launch | 11 | ||||
-rwxr-xr-x | herbstluftwm/bar/sysinfo_bar | 25 | ||||
-rwxr-xr-x | herbstluftwm/bar/ws_bar | 25 |
7 files changed, 12 insertions, 158 deletions
diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 9874f60e..b0b063a0 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -4,32 +4,26 @@ hc() { } hc emit_hook reload -# remove all existing keybindings +# remove all existing keybindings hc keyunbind --all + # focus follows mouse hc set focus_follows_mouse 1 Mod=Mod4 # Use the super key as the main modifier -myTerminal=st # keybindings (rest are handled by sxhkd) hc keybind $Mod-Shift-q quit hc keybind $Mod-Shift-r reload hc keybind Mod1-w close -hc keybind $Mod-Return spawn "${TERMINAL:-konsole}" - -# splitting frames -# create an empty frame at the specified direction -hc keybind $Mod-a split bottom 0.5 -hc keybind $Mod-s split right 0.5 -# let the current frame explode into subframes -# hc keybind $Mod-f split explode +hc keybind $Mod-Return spawn st # for resizing frames and floating clients -resizestep=0.02 +resizestep=0.01 # tags -tag_names=( {1..9} 0 ) +# if I don't add the period to the last tag, it messes up lemonbar +tag_names=( 一, 二, 三, 四, 五, 六, 七, 八, 九, 十, 十一, 十二, 十三. ) tag_keys=( {1..9} 0 ) hc rename default "${tag_names[0]}" || true @@ -42,12 +36,10 @@ for i in "${!tag_names[@]}" ; do fi done -# layouting -hc keybind $Mod-d remove -# The following cycles through the available layouts within a frame, but skips -# layouts, if the layout change wouldn't affect the actual window positions. -# I.e. if there are two windows within a frame, the grid layout is skipped. -hc keybind Mod1-space \ +# cycle through layouts while +# ignoring the layouts which won't +# make a difference +hc keybind Mod4-space \ or , and . compare tags.focus.curframe_wcount = 2 \ . cycle_layout +1 vertical horizontal max vertical grid \ , cycle_layout +1 @@ -121,10 +113,5 @@ hc unlock # or simply: # hc detect_monitors -# find the panel -panel=~/.config/scripts/launch-lemonbar -[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh -for monitor in $(hc list_monitors | cut -d: -f1) ; do - # start it on each monitor - "$panel" "$monitor" & -done +# launch the panel +./bar/launch diff --git a/herbstluftwm/bar/functions/sysinfo b/herbstluftwm/bar/functions/sysinfo deleted file mode 100755 index a377c600..00000000 --- a/herbstluftwm/bar/functions/sysinfo +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/zsh - -date_time() { - datetime=$(date +"%d %b(%A) %H:%M") - echo $datetime -} - -cpu_load() { - read cpu a b c previdle rest < /proc/stat - prevtotal=$((a+b+c+previdle)) - sleep 0.5 - read cpu a b c idle rest < /proc/stat - total=$((a+b+c+idle)) - cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) - echo -e "CPU: $cpu%" -} - -cpu_temp() { - CEL=$'\xc2\xb0C' - temp=$( cat /sys/devices/virtual/thermal/thermal_zone0/temp ) - temp=`expr $temp / 1000` - echo "TEMP: " $temp$CEL -} - -root_usage() { - root=$(df -h / | awk 'NR==2 {print $4 "/" $2}') - echo "ROOT: "$root -} - -home_usage() { - home=$(df -h /home | awk 'NR==2 {print $4 "/" $2}') - echo "HOME: "$home -} - -mem_usage() { - mem=$(free -m | grep Mem: | awk '{print$3 / $2 * 100}') - printf "MEM: %.0f %%" $mem -} - -while :; do - echo $(date_time) > /home/zt/.cache/lemon/clock - echo $(cpu_load) > /home/zt/.cache/lemon/cpu_load - echo $(cpu_temp) > /home/zt/.cache/lemon/cpu_temp - echo $(root_usage) > /home/zt/.cache/lemon/disk_root - echo $(home_usage) > /home/zt/.cache/lemon/disk_home - echo $(mem_usage) > /home/zt/.cache/lemon/mem - sleep 3 -done diff --git a/herbstluftwm/bar/functions/volume_info b/herbstluftwm/bar/functions/volume_info deleted file mode 100755 index e5d06f8d..00000000 --- a/herbstluftwm/bar/functions/volume_info +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -echo $(pamixer --get-volume-human) > /home/zt/.cache/lemon/volume diff --git a/herbstluftwm/bar/functions/weather b/herbstluftwm/bar/functions/weather deleted file mode 100755 index df6cf24b..00000000 --- a/herbstluftwm/bar/functions/weather +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/zsh - -get_current_temp() { - if [ $stat = "Smoke" ] || [ $stat = "Sunny" ]; then - temp=$(curl wttr.in | grep °C | awk 'NR==1 {print $4 "°C"}' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g") - else - temp=$(curl wttr.in | grep °C | awk 'NR==1 {print $9 "°C"}' | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g") - fi - - echo $temp -} - -get_current_weather() { - stat=$(curl wttr.in | awk 'NR==3 {print $1}') - echo $(get_current_temp)"("$stat")" -} - -while :; do - echo $(get_current_weather) > /home/zt/.cache/lemon/weather - sleep 3600 -done diff --git a/herbstluftwm/bar/launch b/herbstluftwm/bar/launch deleted file mode 100755 index 1b8f46bd..00000000 --- a/herbstluftwm/bar/launch +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/zsh - -# kill running scripts, just in case they are -killall sysinfo weather ws_bar sysinfo_bar lemonbar - -./functions/sysinfo & -./functions/weather & - -./ws_bar | lemonbar -g 600x21+0+0 -B '#00000000' -p -F '#ffffff' -f "Source Han Sans JP:size=10" -o -3 -f "RobotoMono Nerd Font:style=Regular:size=15" -f -n "workspaceinfo-bar" -o 0 & - -./sysinfo_bar | lemonbar -g 1020x21+346+0 -B '#171520' -p -F '#ffffff' -f "Source Han Sans JP:size=10" -o -3 -f "RobotoMono Nerd Font:style=Regular:size=15" -f -n "sysinfo-bar" -o 0 diff --git a/herbstluftwm/bar/sysinfo_bar b/herbstluftwm/bar/sysinfo_bar deleted file mode 100755 index 83158c50..00000000 --- a/herbstluftwm/bar/sysinfo_bar +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/zsh -BAR_COLOR="#171520" -COLOR1="#0d0c13" -COLOR2="#70638F" - -A0="%{B"$COLOR1"}%{F"$COLOR2"}%{B"$COLOR2"}%{F"$COLOR1"}" -A1="%{B"$COLOR2"}%{F"$COLOR1"}%{B"$COLOR1"}%{F"$COLOR2"}" -A2="%{B"$COLOR1"}%{F"$COLOR2"}%{B"$COLOR2"}%{F"$COLOR1"}" - -right_modules() { - clock=$(</home/zt/.cache/lemon/clock) - volume=$(</home/zt/.cache/lemon/volume) - root=$(</home/zt/.cache/lemon/disk_root) - home=$(</home/zt/.cache/lemon/disk_home) - mem=$(</home/zt/.cache/lemon/mem) - cpu_load=$(</home/zt/.cache/lemon/cpu_load) - cpu_temp=$(</home/zt/.cache/lemon/cpu_temp) - weather=$(</home/zt/.cache/lemon/weather) - echo $A0$A1$weather$A2$cpu_temp$A1$cpu_load$A2$mem$A1$root$A2$home$A1$volume$A2$clock$A1 -} - -while :; do - echo "%{r}"$(right_modules) - sleep 0.1 -done diff --git a/herbstluftwm/bar/ws_bar b/herbstluftwm/bar/ws_bar deleted file mode 100755 index f45b316c..00000000 --- a/herbstluftwm/bar/ws_bar +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/python - -import datetime -import time -import os - -def getTags(): - tags = os.popen("herbstclient tag_status").read().split() # get tags in a list - - for i in range(len(tags)): - tag = tags[i] - - if tag[0] == ':': - tags[i] = ' ' + tag[1:-1] + ' ' # format occupied tags - elif tag[0] == '#': - tags[i] = '%{F#6c71c4}%{B#d33682}%{F-} ' + tag[1:-1] + '%{F#d33682} %{B#268bd2}%{F-}' # format active tag - else: - tags[i] = '%{F#443837} ' + tag[1:-1] + '%{F-} ' # format other tags - - return '%{B#6c71c4} ' + ' '.join((str(x) for x in tags)) + '%{B-}' + '%{F#268bd2}%{F-}' # return formatted list in a cleaner form - -while True: - time.sleep(0.3) # be nice to the CPU - output = getTags() - os.system("echo '" + output + "'") # for some reason print() messes up everythingt |