diff options
-rwxr-xr-x | XMonad/baraction | 45 | ||||
-rw-r--r-- | XMonad/xmonad.hs | 29 |
2 files changed, 28 insertions, 46 deletions
diff --git a/XMonad/baraction b/XMonad/baraction index 9e39c9b5..0c9d12f1 100755 --- a/XMonad/baraction +++ b/XMonad/baraction @@ -1,15 +1,8 @@ #!/bin/zsh -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"}" - clock() { datetime=$(date +"%d %b(%A) %H:%M") - echo $datetime + echo "%{B#6c71c4}%{F#f0f0f0} $datetime %{B-}%{F-}" } cpu_load() { @@ -19,45 +12,35 @@ cpu_load() { 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%" + echo -e "%{B#ff0077}%{F#FCFCFC} CPU: $cpu% %{B-}%{F-}" } 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 + echo "%{B#135ef0}%{F#FCFCFC} TEMP: "$temp$CEL" %{B-}%{F-}" } mem_usage() { mem=$(free -m | grep Mem: | awk '{print$3 / $2 * 100}') - printf "MEM: %.0f %%" $mem -} - -volume() { - vol=$(pamixer --get-mute) - if [ $vol = "true" ] - then - echo "%{B#F15BB5}%{F#232627} ミュート" - fi + echo "%{B#14eea0}%{F#232627}" + printf " MEM: %.0f%% " $mem + echo "%{B-}%{F-}" } weather() { - echo "script broken" + echo "wttr.in" # echo $(</tmp/weather_stat) } +volume() { + echo "volume" +} + +s=" " # spacing between modules + while :; do - echo "%{r}"$A0$A1$(weather)$A2$(cpu_temp)$A1$(cpu_load)$A2$(mem_usage)$A1$(root_usage)$A2$(home_usage)$A1$(volume)$A2$(clock)$A1 + echo "%{r}"$(weather)$s$(volume)$s$(cpu_temp)$s$(cpu_load)$s$(mem_usage)$s$(clock) sleep 3 done diff --git a/XMonad/xmonad.hs b/XMonad/xmonad.hs index bd952eeb..439cdd77 100644 --- a/XMonad/xmonad.hs +++ b/XMonad/xmonad.hs @@ -16,7 +16,7 @@ import XMonad.Layout.Spacing import XMonad.Layout.LayoutModifier import XMonad.Layout.WindowNavigation as WN import XMonad.Layout.Fullscreen -import XMonad.Layout.Renamed (renamed, Rename(Replace)) +import XMonad.Layout.Renamed as R (renamed, Rename(Replace)) -- Layouts -- import XMonad.Layout.AvoidFloats @@ -46,8 +46,7 @@ import XMonad.Util.NamedScratchpad myStartupHook :: X () myStartupHook = do - spawnOnce "/home/zt/.xmonad/baraction | lemonbar -g 1366x20+0+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" --- spawnOnce "/home/zt/.config/scripts/weather" + spawnOnce "./baraction | lemonbar -b -g 466x21+800+0 -B '#171520' -F '#ffffff' -f 'Source Han Sans JP:size=10' -o -3 -f 'RobotoMono Nerd Font:style=Regular:size=15' -f -n 'notXMobar' -o 0" spawnOnce "nitrogen --restore" spawnOnce "picom" spawnOnce "deadd-notification-center" @@ -249,23 +248,23 @@ myGap = spacingRaw False (Border sGap sGap sGap sGap) True (Border wGap wGap wGa myLayouts = avoidStruts ( - renamed [Replace "BSP"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ emptyBSP) - ||| renamed [Replace "ThreeCol Mid (1)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 1 (3/100) (1/2)) - ||| renamed [Replace "ThreeCol Mid (2)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 2 (3/100) (1/2)) - ||| renamed [Replace "Grid"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ Grid) - ||| renamed [Replace "TwoPane"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ TwoPane (3/100) (1/2)) - ||| renamed [Replace "ThreeCol (1)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 1 (3/100) (1/2)) - ||| renamed [Replace "ThreeCol (2)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 2 (3/100) (1/2)) + renamed [R.Replace "BSP"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ emptyBSP) + ||| renamed [R.Replace "ThreeCol Mid (1)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 1 (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol Mid (2)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 2 (3/100) (1/2)) + ||| renamed [R.Replace "Grid"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ Grid) + ||| renamed [R.Replace "TwoPane"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ TwoPane (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol (1)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 1 (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol (2)"] (maximize $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 2 (3/100) (1/2)) ) myLayoutHook = myLayouts -myLemonbarPP = def {ppCurrent = wrap "%{F#6c71c4}%{B#d33682}%{F-}" "%{F#d33682}%{B-}%{F-}" - , ppWsSep = " " +myLemonbarPP = def {ppCurrent = wrap "%{B#d33682}" "%{B-}" + , ppWsSep = "" , ppHidden = wrap "%{B#268bd2}" "%{B-}" , ppHiddenNoWindows = wrap "%{F#02fc45}" "%{F-}" - , ppTitle = wrap " %{B#6c71c4}%{F#f0f0f0} " " %{B-}" . shorten 75 + , ppTitle = wrap " %{B#6c71c4}%{F#f0f0f0} " " %{B-}" . shorten 60 , ppUrgent = wrap "%{B#9cfc02} " " %{B-}%{F-}" , ppLayout = wrap "%{r}%{B#99B1D5}%{F#232627} " " %{B-} " , ppSep = " " @@ -274,7 +273,7 @@ myLemonbarPP = def {ppCurrent = wrap "%{F#6c71c4}%{B#d33682}%{F-}" "%{F#d33682}% } main = do - notXMobar <- spawnPipe "lemonbar -b -g 1366x21+0+0 -B '#171520' -F '#ffffff' -f 'Source Han Sans JP:size=10' -o -3 -f 'RobotoMono Nerd Font:style=Regular:size=15' -f -n 'notXMobar' -o 0" + notXMobar <- spawnPipe "lemonbar -b -g 800x21+0+0 -B '#171520' -F '#ffffff' -f 'Source Han Sans JP:size=10' -o -3 -f 'RobotoMono Nerd Font:style=Regular:size=15' -f -n 'notXMobar' -o 0" xmonad $ docks def { terminal = myTerminal, @@ -290,5 +289,5 @@ main = do handleEventHook = fullscreenEventHook, logHook = dynamicLogWithPP myLemonbarPP { ppOutput = \x -> hPutStrLn notXMobar x}, startupHook = myStartupHook -} `additionalKeys` myKeys +} `additionalKeys` myKeys |