1
0
Fork 0
mirror of https://github.com/Horhik/dotfiles.git synced 2024-11-22 08:21:27 +00:00

update xmobar

This commit is contained in:
Horhik 2021-02-26 03:08:07 +03:00
parent 0eb0100d14
commit 8b8f087234
6 changed files with 144 additions and 19 deletions

View file

@ -0,0 +1,106 @@
#!/bin/bash
module GruvboxColors where
backgroundColor="#282828"
currentLineColor="#fabd2f"
selectionColor="#665c54"
foregroundColor="#ebdbb2"
foregroundSecondColor="#fbf1c1"
commentColor="#458588"
cyanColor="#83a598"
greenColor="#8ec07c"
greenDarkerColor="#689d6a"
orangeColor="#fe8019"
pinkColor="#d3869b"
purpleColor="#b16286"
redColor="#cc241d"
yellowColor="#fabd2f"
battery ()
{
val=$(acpi | grep -oh "[[:digit:]]*%" | grep -oh "[0-9]*")
case $val in
[1-9][0-9][0-9])
echo "<fc=$greenColor>-{ </fc>$val<fc=$greenColor>%}</fc>"
;;
[5-9][0-9])
echo "<fc=$greenColor>-{ </fc>$val<fc=$greenColor>%}</fc>"
;;
[1-4][0-9])
echo "<fc=$yellowColor>-{ </fc>$val<fc=$yellowColor>%}</fc>"
;;
[1-9])
echo "<fc=$orangeColor> </fc>$val%"
echo "<fc=$orangeColor>-{ </fc>$val<fc=$orangeColor>%}</fc>"
;;
0)
echo "<fc=$redColor> </fc>"
;;
*)
echo "<fc=$greenColor>-{ </fc>$val<fc=$greenColor>%}</fc>"
;;
esac
}
volume ()
{
#maybe change to Right, Left, Mono
val=$(amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }'| grep -oh "[0-9]*")
case $val in
100)
echo "<fc=$redColor>-{ $val</fc>%<fc=$redColor>}</fc>"
;;
[5-9][0-9])
echo "<fc=$orangeColor>-{ $val</fc>%<fc=$orangeColor>}</fc>"
;;
[1-4][0-9])
echo "<fc=$yellowColor>-{ $val</fc>%<fc=$yellowColor>}</fc>"
;;
[1-9])
echo "<fc=$greenDarkerColor>-{ $val</fc>%<fc=$greenDarkerColor>}</fc>"
;;
0)
echo "<fc=$currentLineColor>-{}</fc>"
;;
*)
echo "<fc=$redColor>-{ $val</fc>%<fc=$redColor>}</fc>"
esac
}
diskspace ()
{
#might be another /dev/sda...
echo "<fc=$pinkColor>-{ </fc>"$(df -h | grep sda2 | grep -oh "[0-9]*%") "<fc=$pinkColor>}</fc>"
}
wifi ()
{
name=$(connmanctl services | grep "*A" | grep -oh "^*A. [A-Za-z]*" | grep -oh "[[:space:]][A-Za-x]*" | head -n 1)
if [ $name != " " ];
then
echo "<fc=$cyanColor>-{ </fc>$name<fc=$cyanColor>}</fc>"
else
echo 睊 off
fi
}
layout ()
{
echo "<fc=$orangeColor>-{ </fc>"$(xkblayout-state print %s)"<fc=$orangeColor>}</fc>"
}
timeanddate ()
{
echo "<fc=$yellowColor>-{</fc>" "<fc=$yellowColor>$(date +'%T')}</fc>"
}
calendar ()
{
echo "<fc=$greenDarkerColor> </fc>"$(date +'%d/%m/%Y')
}
echo "$(wifi)$(battery)$(volume)$(layout)$(diskspace)$(timeanddate)<fc=$greenDarkerColor>-{</fc>$(calendar)<fc=$greenDarkerColor>}--</fc>"
#echo "                                          "

View file

@ -52,7 +52,7 @@ Config {
, "--High" , "5000" -- units: B/s , "--High" , "5000" -- units: B/s
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- cpu activity monitor -- cpu activity monitor
@ -61,7 +61,7 @@ Config {
, "--High" , "85" -- units: % , "--High" , "85" -- units: %
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- cpu core temperature monitor -- cpu core temperature monitor
@ -70,7 +70,7 @@ Config {
, "--High" , "80" -- units: °C , "--High" , "80" -- units: °C
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 50 ] 50
-- memory usage monitor -- memory usage monitor
@ -79,7 +79,7 @@ Config {
, "--High" , "90" -- units: % , "--High" , "90" -- units: %
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- battery monitor -- battery monitor
@ -105,7 +105,7 @@ Config {
-- keyboard layout indicator -- keyboard layout indicator
, Run Kbd [ ("us" , "<fc=#83a598>EN</fc>") , Run Kbd [ ("us" , "<fc=#83a598>EN</fc>")
, ("ru" , "<fc=#cc241d>RU</fc>") , ("ru" , "<fc=#fb4934>RU</fc>")
] ]
, Run StdinReader , Run StdinReader
, Run Brightness , Run Brightness

View file

@ -1,10 +1,10 @@
Config { Config {
-- appearance -- appearance
font = "xft:Mononoki-11:bold:antialias=true:hinting=true" font = "xft:Mononoki Nerd Font-14:bold:antialias=true:hinting=true"
, additionalFonts = [ , additionalFonts = [
"xft:Fira Code-10:bold:antialias=true:hinting=True" "xft:EmojiOne:bold:antialias=true:hinting=true"
, "xft:Mononoki-10:bold:antialias=true:hinting=True" ,"xft:FontAwesome:bold:antialias=true:hinting=true"
] ]
, bgColor = "#282828" , bgColor = "#282828"
, fgColor = "#ebdbb2" , fgColor = "#ebdbb2"
@ -16,7 +16,7 @@ Config {
-- layout -- layout
, sepChar = "%" -- delineator between plugin names and straight text , sepChar = "%" -- delineator between plugin names and straight text
, alignSep = "][" -- separator between left-right alignment , alignSep = "][" -- separator between left-right alignment
, template = "--{%StdinReader%}---------------------------------------------------------------------------------------------------------------------------------][{ %coretemp%}-{ %memory% }-{ %dynnetwork% }-{ %battery%}-{ %date% }-{ %kbd% }--" , template = "--{%StdinReader%}<fc=#83a598>---------------------------------------------------------------------------------------------------------------------------------</fc>][%xmobarstatus%"
-- general behavior -- general behavior
, lowerOnStart = False -- send to bottom of window stack on start , lowerOnStart = False -- send to bottom of window stack on start
@ -45,6 +45,7 @@ Config {
-- weather monitor -- weather monitor
[ Run Weather "RJTT" [ "--template", "<skyCondition> | <fc=#458588><tempC></fc>°C | <fc=#458588><rh></fc>% | <fc=#458588><pressure></fc>hPa" [ Run Weather "RJTT" [ "--template", "<skyCondition> | <fc=#458588><tempC></fc>°C | <fc=#458588><rh></fc>% | <fc=#458588><pressure></fc>hPa"
] 36000 ] 36000
, Run Com "xmobarstatus" [] "" 10
-- network activity monitor (dynamic interface resolution) -- network activity monitor (dynamic interface resolution)
, Run DynNetwork [ "--template" , "<dev>: <tx>kB/s|<rx>kB/s" , Run DynNetwork [ "--template" , "<dev>: <tx>kB/s|<rx>kB/s"
@ -52,7 +53,7 @@ Config {
, "--High" , "5000" -- units: B/s , "--High" , "5000" -- units: B/s
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- cpu activity monitor -- cpu activity monitor
@ -61,7 +62,7 @@ Config {
, "--High" , "85" -- units: % , "--High" , "85" -- units: %
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- cpu core temperature monitor -- cpu core temperature monitor
@ -70,7 +71,7 @@ Config {
, "--High" , "80" -- units: °C , "--High" , "80" -- units: °C
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 50 ] 50
-- memory usage monitor -- memory usage monitor
@ -79,7 +80,7 @@ Config {
, "--High" , "90" -- units: % , "--High" , "90" -- units: %
, "--low" , "#8ec07c" , "--low" , "#8ec07c"
, "--normal" , "#fabd2f" , "--normal" , "#fabd2f"
, "--high" , "#cc241d" , "--high" , "#fb4934"
] 10 ] 10
-- battery monitor -- battery monitor
@ -105,7 +106,7 @@ Config {
-- keyboard layout indicator -- keyboard layout indicator
, Run Kbd [ ("us" , "<fc=#83a598>EN</fc>") , Run Kbd [ ("us" , "<fc=#83a598>EN</fc>")
, ("ru" , "<fc=#cc241d>RU</fc>") , ("ru" , "<fc=#fb4934>RU</fc>")
] ]
, Run StdinReader , Run StdinReader
, Run Brightness , Run Brightness

View file

@ -141,6 +141,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- flameshot gui -- flameshot gui
, ((modm .|. shiftMask, xK_s ), spawn "flameshot gui") , ((modm .|. shiftMask, xK_s ), spawn "flameshot gui")
, ((modm .|. controlMask, xK_space ), spawn "$HOME/.local/scripts/deadd_notify")
-- change lang -- change lang
, ((controlMask , xK_space ), spawn "setxkbmap -layout fi,ru,us; xkb-switch -n") , ((controlMask , xK_space ), spawn "setxkbmap -layout fi,ru,us; xkb-switch -n")
-- toggle fullscreen -- toggle fullscreen
@ -151,12 +152,14 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
, ((modm .|. controlMask .|. shiftMask, xK_h), namedScratchpadAction myScratchpads "htop") , ((modm .|. controlMask .|. shiftMask, xK_h), namedScratchpadAction myScratchpads "htop")
, ((modm .|. shiftMask , xK_a), namedScratchpadAction myScratchpads "anki") , ((modm .|. shiftMask , xK_a), namedScratchpadAction myScratchpads "anki")
, ((modm .|. shiftMask , xK_m), namedScratchpadAction myScratchpads "pulse") , ((modm .|. shiftMask , xK_m), namedScratchpadAction myScratchpads "pulse")
, ((modm .|. shiftMask , xK_d), namedScratchpadAction myScratchpads "todoist")
, ((modm .|. shiftMask , xK_e), namedScratchpadAction myScratchpads "pomo")
-- | Programs -- | Programs
, ((modm .|. shiftMask, xK_z), spawn "zathura &") -- book reader (zathura) , ((modm .|. shiftMask, xK_z), spawn "zathura &") -- book reader (zathura)
, ((modm .|. shiftMask, xK_b), spawn "firefox" ) -- browser , ((modm .|. shiftMask, xK_b), spawn "firefox" ) -- browser
, ((modm .|. controlMask, xK_e), spawn "/usr/bin/emacs &" ) -- editor (emacs) , ((modm .|. controlMask, xK_e), spawn "/usr/bin/emacs &" ) -- editor (emacs)
, ((modm .|. shiftMask, xK_n), spawn "firefox --new-tab https://www.notion.so/horhi ") -- noteapp , ((modm .|. shiftMask, xK_n), spawn "firefox --new-tab https://www.notion.so/horhi ") -- noteapp
@ -182,7 +185,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
-- --
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_less, xK_greater, xK_r] [0..] | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
++ ++
@ -280,9 +283,11 @@ myManageHook = (composeAll
myScratchpads = [ myScratchpads = [
NS "terminal" spawnTerm findTerm manageTerm NS "terminal" spawnTerm findTerm manageTerm
, NS "htop" "xterm -e htop" (title =? "htop") defaultFloating , NS "htop" "alacritty -t htop -e htop " (title =? "htop") defaultFloating
, NS "pomo" "pomodone" (title =? "PomoDoneApp") defaultFloating
, NS "anki" spawnAnki findAnki manageAnki , NS "anki" spawnAnki findAnki manageAnki
, NS "pulse" spawnPulse findPulse managePulse , NS "pulse" spawnPulse findPulse managePulse
, NS "todoist" spawnTodoist findTodoist manageTodoist
] ]
where where
classTerm = "TerminalDropdown" classTerm = "TerminalDropdown"
@ -315,6 +320,18 @@ myScratchpads = [
t = (1 - h) / 2 -- bottom edge t = (1 - h) / 2 -- bottom edge
l = (1 - w) / 2 -- centered left/right l = (1 - w) / 2 -- centered left/right
classTodoist = "TodoistDropdown"
titleTodoist = "Todoist"
spawnTodoist = "todoist"
findTodoist = title =? titleTodoist
manageTodoist = customFloating $ W.RationalRect l t w h
where
h = 0.7 -- height, 50%
w = 0.4 -- width, 50%
t = (1 - h) / 2 -- bottom edge
l = (1 - w) / 2 -- centered left/right
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -369,6 +386,7 @@ myStartupHook = do
spawnOnce "nitrogen --restore &" spawnOnce "nitrogen --restore &"
-- spawnOnce "compton --config ~/.config/compton/compton.conf &" -- spawnOnce "compton --config ~/.config/compton/compton.conf &"
spawnOnce "picom &" spawnOnce "picom &"
spawnOnce "deadd-notification-center"
spawnOnce "setxkbmap us,ru, grp:alt_shift_toggle" spawnOnce "setxkbmap us,ru, grp:alt_shift_toggle"
spawnOnce "$HOME/Scripts/startup/touchpad.sh" spawnOnce "$HOME/Scripts/startup/touchpad.sh"
spawnOnce "sh ssh-agent bash ; ssh-add ~/.ssh/arch" spawnOnce "sh ssh-agent bash ; ssh-add ~/.ssh/arch"

Binary file not shown.