From 0111989bbe10b02a4d9247251bd6a53d1068d666 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 21 Feb 2021 22:03:46 +0530 Subject: redesigned the bars and now one is at the top whereas one at the bottom --- XMonad/baraction | 30 ++++++++++++++---------------- XMonad/xmonad.hs | 41 ++++++++++++++--------------------------- 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/XMonad/baraction b/XMonad/baraction index 72422d83..9cdbbbb2 100755 --- a/XMonad/baraction +++ b/XMonad/baraction @@ -1,8 +1,14 @@ #!/bin/zsh +COLOR1="#130F23" +COLOR2="#8D5BD0" +A1="%{B"$COLOR2"}%{F"$COLOR1"}%{B"$COLOR1"}%{F-}" +A2="%{B"$COLOR1"}%{F"$COLOR2"}%{B"$COLOR2"}%{F-}" + clock() { datetime=$(date +"%d %b(%A) %H:%M") - echo "%{B#6c71c4}%{F#f0f0f0} $datetime %{B-}%{F-}" + # echo "%{B#6c71c4}%{F#f0f0f0} $datetime %{B-}%{F-}" + echo $datetime } cpu_load() { @@ -12,40 +18,32 @@ 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 "%{B#ff0077}%{F#FCFCFC} CPU: $cpu% %{B-}%{F-}" + echo CPU:$cpu% } cpu_temp() { CEL=$'\xc2\xb0C' temp=$( cat /sys/devices/virtual/thermal/thermal_zone0/temp ) temp=`expr $temp / 1000` - echo "%{B#135ef0}%{F#FCFCFC} TEMP: "$temp$CEL" %{B-}%{F-}" + echo TEMP:$temp$CEL } mem_usage() { mem=$(free -m | grep Mem: | awk '{print$3 / $2 * 100}') - echo "%{B#14eea0}%{F#232627}" - printf " MEM: %.0f%% " $mem - echo "%{B-}%{F-}" -} - -weather() { - echo "wttr.in" - # echo $( X () --- myTreeMenu a = TS.treeselectAction a --- [ Node (TS.TSNode "Hello" "displays hello" (spawn "xmessage hello!")) [] --- , Node (TS.TSNode "Shutdown" "Poweroff the system" (spawn "shutdown")) [] --- , Node (TS.TSNode "Brightness" "Sets screen brightness using xbacklight" (return ())) --- [ Node (TS.TSNode "Bright" "FULL POWER!!" (spawn "xbacklight -set 100")) [] --- , Node (TS.TSNode "Normal" "Normal Brightness (50%)" (spawn "xbacklight -set 50")) [] --- , Node (TS.TSNode "Dim" "Quite dark" (spawn "xbacklight -set 10")) [] --- ] --- ] - myPowerMenu :: TS.TSConfig (X ()) -> X () myPowerMenu a = TS.treeselectAction a [Node (TS.TSNode "SHUTDOWN" "It's not like I'm gonna miss you, b- baka!" (spawn "shutdown now")) [] @@ -363,24 +353,20 @@ myTabTheme = def { fontName = "roboto" -- layouts -myGap = spacingRaw False (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True - +myGap = spacingRaw True (Border sGap sGap sGap sGap) True (Border wGap wGap wGap wGap) True -myLayouts = avoidStruts ( - 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 = avoidStruts ( + renamed [R.Replace "BSP"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ emptyBSP) + ||| renamed [R.Replace "ThreeCol Mid (1)"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 1 (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol Mid (2)"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ ThreeColMid 2 (3/100) (1/2)) + ||| renamed [R.Replace "Grid"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ Grid) + ||| renamed [R.Replace "TwoPane"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ TwoPane (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol (1)"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 1 (3/100) (1/2)) + ||| renamed [R.Replace "ThreeCol (2)"] (maximize $ smartBorders $ fullscreenFocus $ windowNavigation $ myGap $ ThreeCol 2 (3/100) (1/2)) ||| tabbedRight shrinkText def ) -myLayoutHook = myLayouts - - myLemonbarPP = def {ppCurrent = wrap "%{B#d33682}" "%{B-}" , ppWsSep = "" , ppHidden = wrap "%{B#268bd2}" "%{B-}" @@ -394,7 +380,8 @@ myLemonbarPP = def {ppCurrent = wrap "%{B#d33682}" "%{B-}" } main = do - 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" + notXMobar <- spawnPipe "lemonbar -b -g 1366x21+0+0 -B '#130F23' -F '#ffffff' -f 'Source Han Sans JP:size=10' -o -3 -f 'RobotoMono Nerd Font:style=Regular:size=15' -f -n 'notXMobar' -o 0" + statusBar <- spawnPipe "/home/zt/.xmonad/baraction | lemonbar -g 1366x21+0+0 -B '#130F23' -F '#ffffff' -o -3 -f 'Source Han Sans JP:size=10' -o 0 -f 'RobotoMono Nerd Font:style=Regular:size=15'" xmonad $ docks def { terminal = myTerminal, -- cgit v1.2.3