Rewrite xmobar config

This commit is contained in:
ItsDrike 2021-07-16 05:10:11 +02:00
parent d80d5abfab
commit 41c35f8101
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
4 changed files with 302 additions and 137 deletions

View file

@ -12,7 +12,7 @@ WORK_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xmobar"
make_position_line(){ make_position_line(){
xpos=$(($1 * $WIDTH)) xpos=$(($1 * $WIDTH))
line=", position = Static { xpos = $xpos, ypos = 0, width = $WIDTH, height = 24 }" line="position = Static { xpos = $xpos, ypos = 0, width = $WIDTH, height = 24 },"
echo "$line" echo "$line"
} }

View file

@ -1,47 +1,102 @@
-- xmobar main configuration file
--
-- This file serves as a shared template for the specific xmonad
-- configuration files that are generated from this file to accomodate
-- for multiple monitors.
--
-- For more details, run 'man xmobar', or visit the project website
-- http://projects.haskell.org/xmobar/ -- http://projects.haskell.org/xmobar/
Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true" Config {
, additionalFonts = [ "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true" -- Set font for default dg/bg colors. xmobar height will
, "xft:Font Awesome 5 Free Solid:pixelsize=12" -- be controlled by this font (it'll adjust itself to accomodate it)
, "xft:Font Awesome 5 Brands:pixelsize=12" -- Additional fonts can be defined for emoji support
] font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true",
, bgColor = "#282c34" additionalFonts = [
, fgColor = "#ff6c6b" "xft:Font Awesome 5 Free Solid:pixelsize=12",
, position = Static { xpos = 0, ypos = 0, width = 1920, height = 24 } "xft:Font Awesome 5 Brands:pixelsize=12",
, lowerOnStart = True "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true"
, hideOnStart = False ],
, allDesktops = True bgColor = "#282c34",
, persistent = True fgColor = "#ff6c6b",
-- apparently there's no way to use env var or relpaths here
, iconRoot = "/home/itsdrike/.config/xmobar/xpm" -- Define static position that will be adjusted by the deploy script
, commands = [ -- which will tweak the starting positions for multiple monitors, this
-- Time and date -- configuration will work fine for single monitor systems out of the box.
Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50 position = Static { xpos = 0, ypos = 0, width = 1920, height = 24 },
-- Network up and down -- Define the place where all used XPM images will be stored in
, Run Network "wlp2s0" ["-t", "<fn=2>\xf0ab</fn> <rx>kb <fn=2>\xf0aa</fn> <tx>kb"] 20 -- Apparently there's is no way to use env var or relpaths here.
-- Cpu usage in percent iconRoot = "/home/itsdrike/.config/xmobar/xpm",
, Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: (<total>%)","-H","50","--high","red"] 20 -- list of commands which gather information about the system
-- which can then be referrenced in the final template string
commands = [
-- Gather and format CPU usage information
-- if it's above 50%, we consider it high and make it red
Run Cpu [
"-t", "<fn=1>\xf108</fn> cpu: <total>%",
"-H","50",
"--high","red"
] 20,
-- Ram used number and percent -- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M (<usedratio>%)"] 20 Run Memory ["-t", "<fn=1>\xf233</fn> mem: <used>M (<usedratio>%)"] 20,
-- Disk space free
, Run DiskU [("/", "<fn=2>\xf0c7</fn> hdd: <free> free")] [] 60 -- Battery information. This is likely to require some customization
-- Runs a standard shell command 'uname -r' to get kernel version -- based upon your specific hardware. Or, for a desktop you may want
, Run Com "uname" ["-r"] "" 3600 -- to just remove this section entirely.
Run Battery [
"-t", "<fn=1>\xf240</fn> <acstatus> <left>% - <timeleft>",
"--",
"-i", "<fc=#75c44c>AC</fc>",
"-O", "<fc=#75c44c>AC</fc>",
"-o", "<fc=#ff0000>AUX</fc>",
"-L", "12",
"-h", "green",
"-l", "red"
] 10,
-- Time and date
Run Date "<fn=1>\xf017</fn> %H:%M %b %d %Y" "date" 50,
-- Network up and down
Run Network "wlp2s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
--Run Network "enp3s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
-- Show free disk space on /
Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free>")] [] 60,
-- Get kernel version from uname -r
Run Com "uname" ["-r"] "" 3600,
-- Add dynamic invisible XPM icon that resizes to accomodate trayer -- Add dynamic invisible XPM icon that resizes to accomodate trayer
-- this needs to be an absolute string path, env vars or relpaths aren't accepted -- this needs to be an absolute string path, env vars or relpaths aren't accepted
-- this should only be on 1 monitor (single file), so ignore this comment on others -- this should only be on 1 monitor (single file), so ignore this comment on others
, Run Com "/home/itsdrike/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 10 Run Com "/home/itsdrike/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 10,
-- Allow mouse clicking by using unsafe stdin reader
, Run UnsafeStdinReader -- This line tells xmobar to read input from stdin.
] -- That's how it gets information that xmonad is sending
, sepChar = "%" -- (such as workspaces) for displaying.
, alignSep = "}{" -- By using UnsafeStdinReader, it also allows mouse clicking events
, template = " <icon=haskell_20.xpm/> <fc=#666666>|</fc> %UnsafeStdinReader% }{ \ Run UnsafeStdinReader
\<fc=#666666>|</fc> <fc=#b3afc2><fn=3></fn> <action=`alacritty -e htop`>%uname%</action> </fc> \ ],
\<fc=#666666>|</fc> <fc=#ecbe7b> <action=`alacritty -e htop`>%cpu%</action> </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> <action=`alacritty -e htop`>%memory%</action> </fc> \ -- Separator character used to wrap variables in the xmobar template string
\<fc=#666666>|</fc> <fc=#51afef> <action=`alacritty -e htop`>%disku%</action> </fc> \ sepChar = "%",
\<fc=#666666>|</fc> <fc=#98be65> <action=`alacritty -e sudo iftop`>%wlp2s0%</action> </fc> \ -- Alignment eparator character used in the xmobar template string.
-- Everything before this will be aligned left, everything after right.
alignSep = "}{",
-- Template string defining the xmobar contents and overall layout.
template = "\
\<icon=haskell_20.xpm/> \
\<fc=#666666>|</fc> %UnsafeStdinReader% }{ \
\<fc=#666666>|</fc> <fc=#b3afc2><fn=2></fn> %uname% </fc> \
\<fc=#666666>|</fc> <fc=#9ce996> %battery% </fc> \
\<fc=#666666>|</fc> <fc=#ecbe7b> %cpu% </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> %memory% </fc> \
\<fc=#666666>|</fc> <fc=#51afef> %disku% </fc> \
\<fc=#666666>|</fc> <fc=#98be65> %wlp2s0% </fc> \
--\<fc=#666666>|</fc> <fc=#98be65> %eth3s0% </fc> \
\<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \ \<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \
\<fc=#666666>|</fc> %trayerpad%\ \<fc=#666666>|</fc> %trayerpad%\
\ " \ "

View file

@ -1,47 +1,102 @@
-- xmobar main configuration file
--
-- This file serves as a shared template for the specific xmonad
-- configuration files that are generated from this file to accomodate
-- for multiple monitors.
--
-- For more details, run 'man xmobar', or visit the project website
-- http://projects.haskell.org/xmobar/ -- http://projects.haskell.org/xmobar/
Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true" Config {
, additionalFonts = [ "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true" -- Set font for default dg/bg colors. xmobar height will
, "xft:Font Awesome 5 Free Solid:pixelsize=12" -- be controlled by this font (it'll adjust itself to accomodate it)
, "xft:Font Awesome 5 Brands:pixelsize=12" -- Additional fonts can be defined for emoji support
] font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true",
, bgColor = "#282c34" additionalFonts = [
, fgColor = "#ff6c6b" "xft:Font Awesome 5 Free Solid:pixelsize=12",
, position = Static { xpos = 0, ypos = 0, width = 1920, height = 24 } "xft:Font Awesome 5 Brands:pixelsize=12",
, lowerOnStart = True "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true"
, hideOnStart = False ],
, allDesktops = True bgColor = "#282c34",
, persistent = True fgColor = "#ff6c6b",
-- apparently there's no way to use env var or relpaths here
, iconRoot = "/home/itsdrike/.config/xmobar/xpm" -- Define static position that will be adjusted by the deploy script
, commands = [ -- which will tweak the starting positions for multiple monitors, this
-- Time and date -- configuration will work fine for single monitor systems out of the box.
Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50 position = Static { xpos = 0, ypos = 0, width = 1920, height = 24 },
-- Network up and down -- Define the place where all used XPM images will be stored in
, Run Network "wlp2s0" ["-t", "<fn=2>\xf0ab</fn> <rx>kb <fn=2>\xf0aa</fn> <tx>kb"] 20 -- Apparently there's is no way to use env var or relpaths here.
-- Cpu usage in percent iconRoot = "/home/itsdrike/.config/xmobar/xpm",
, Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: (<total>%)","-H","50","--high","red"] 20 -- list of commands which gather information about the system
-- which can then be referrenced in the final template string
commands = [
-- Gather and format CPU usage information
-- if it's above 50%, we consider it high and make it red
Run Cpu [
"-t", "<fn=1>\xf108</fn> cpu: <total>%",
"-H","50",
"--high","red"
] 20,
-- Ram used number and percent -- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M (<usedratio>%)"] 20 Run Memory ["-t", "<fn=1>\xf233</fn> mem: <used>M (<usedratio>%)"] 20,
-- Disk space free
, Run DiskU [("/", "<fn=2>\xf0c7</fn> hdd: <free> free")] [] 60 -- Battery information. This is likely to require some customization
-- Runs a standard shell command 'uname -r' to get kernel version -- based upon your specific hardware. Or, for a desktop you may want
, Run Com "uname" ["-r"] "" 3600 -- to just remove this section entirely.
Run Battery [
"-t", "<fn=1>\xf240</fn> <acstatus> <left>% - <timeleft>",
"--",
"-i", "<fc=#75c44c>AC</fc>",
"-O", "<fc=#75c44c>AC</fc>",
"-o", "<fc=#ff0000>AUX</fc>",
"-L", "12",
"-h", "green",
"-l", "red"
] 10,
-- Time and date
Run Date "<fn=1>\xf017</fn> %H:%M %b %d %Y" "date" 50,
-- Network up and down
Run Network "wlp2s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
--Run Network "enp3s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
-- Show free disk space on /
Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free>")] [] 60,
-- Get kernel version from uname -r
Run Com "uname" ["-r"] "" 3600,
-- Add dynamic invisible XPM icon that resizes to accomodate trayer -- Add dynamic invisible XPM icon that resizes to accomodate trayer
-- this needs to be an absolute string path, env vars or relpaths aren't accepted -- this needs to be an absolute string path, env vars or relpaths aren't accepted
-- this should only be on 1 monitor (single file), so ignore this comment on others -- this should only be on 1 monitor (single file), so ignore this comment on others
, Run Com "/home/itsdrike/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 10 Run Com "/home/itsdrike/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 10,
-- Allow mouse clicking by using unsafe stdin reader
, Run UnsafeStdinReader -- This line tells xmobar to read input from stdin.
] -- That's how it gets information that xmonad is sending
, sepChar = "%" -- (such as workspaces) for displaying.
, alignSep = "}{" -- By using UnsafeStdinReader, it also allows mouse clicking events
, template = " <icon=haskell_20.xpm/> <fc=#666666>|</fc> %UnsafeStdinReader% }{ \ Run UnsafeStdinReader
\<fc=#666666>|</fc> <fc=#b3afc2><fn=3></fn> <action=`alacritty -e htop`>%uname%</action> </fc> \ ],
\<fc=#666666>|</fc> <fc=#ecbe7b> <action=`alacritty -e htop`>%cpu%</action> </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> <action=`alacritty -e htop`>%memory%</action> </fc> \ -- Separator character used to wrap variables in the xmobar template string
\<fc=#666666>|</fc> <fc=#51afef> <action=`alacritty -e htop`>%disku%</action> </fc> \ sepChar = "%",
\<fc=#666666>|</fc> <fc=#98be65> <action=`alacritty -e sudo iftop`>%wlp2s0%</action> </fc> \ -- Alignment eparator character used in the xmobar template string.
-- Everything before this will be aligned left, everything after right.
alignSep = "}{",
-- Template string defining the xmobar contents and overall layout.
template = "\
\<icon=haskell_20.xpm/> \
\<fc=#666666>|</fc> %UnsafeStdinReader% }{ \
\<fc=#666666>|</fc> <fc=#b3afc2><fn=2></fn> %uname% </fc> \
\<fc=#666666>|</fc> <fc=#9ce996> %battery% </fc> \
\<fc=#666666>|</fc> <fc=#ecbe7b> %cpu% </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> %memory% </fc> \
\<fc=#666666>|</fc> <fc=#51afef> %disku% </fc> \
\<fc=#666666>|</fc> <fc=#98be65> %wlp2s0% </fc> \
--\<fc=#666666>|</fc> <fc=#98be65> %eth3s0% </fc> \
\<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \ \<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \
\<fc=#666666>|</fc> %trayerpad%\ \<fc=#666666>|</fc> %trayerpad%\
\ " \ "

View file

@ -1,46 +1,101 @@
-- xmobar main configuration file
--
-- This file serves as a shared template for the specific xmonad
-- configuration files that are generated from this file to accomodate
-- for multiple monitors.
--
-- For more details, run 'man xmobar', or visit the project website
-- http://projects.haskell.org/xmobar/ -- http://projects.haskell.org/xmobar/
Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true" Config {
, additionalFonts = [ "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true" -- Set font for default dg/bg colors. xmobar height will
, "xft:Font Awesome 5 Free Solid:pixelsize=12" -- be controlled by this font (it'll adjust itself to accomodate it)
, "xft:Font Awesome 5 Brands:pixelsize=12" -- Additional fonts can be defined for emoji support
] font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true",
, bgColor = "#282c34" additionalFonts = [
, fgColor = "#ff6c6b" "xft:Font Awesome 5 Free Solid:pixelsize=12",
, position = Static { xpos = 1920, ypos = 0, width = 1920, height = 24 } "xft:Font Awesome 5 Brands:pixelsize=12",
, lowerOnStart = True "xft:Mononoki Nerd Font:pixelsize=11:antialias=true:hinting=true"
, hideOnStart = False ],
, allDesktops = True bgColor = "#282c34",
, persistent = True fgColor = "#ff6c6b",
-- apparently there's no way to use env var or relpaths here
, iconRoot = "/home/itsdrike/.config/xmobar/xpm" -- Define static position that will be adjusted by the deploy script
, commands = [ -- which will tweak the starting positions for multiple monitors, this
-- Time and date -- configuration will work fine for single monitor systems out of the box.
Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50 position = Static { xpos = 1920, ypos = 0, width = 1920, height = 24 },
-- Network up and down -- Define the place where all used XPM images will be stored in
, Run Network "wlp2s0" ["-t", "<fn=2>\xf0ab</fn> <rx>kb <fn=2>\xf0aa</fn> <tx>kb"] 20 -- Apparently there's is no way to use env var or relpaths here.
-- Cpu usage in percent iconRoot = "/home/itsdrike/.config/xmobar/xpm",
, Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: (<total>%)","-H","50","--high","red"] 20 -- list of commands which gather information about the system
-- which can then be referrenced in the final template string
commands = [
-- Gather and format CPU usage information
-- if it's above 50%, we consider it high and make it red
Run Cpu [
"-t", "<fn=1>\xf108</fn> cpu: <total>%",
"-H","50",
"--high","red"
] 20,
-- Ram used number and percent -- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M (<usedratio>%)"] 20 Run Memory ["-t", "<fn=1>\xf233</fn> mem: <used>M (<usedratio>%)"] 20,
-- Disk space free
, Run DiskU [("/", "<fn=2>\xf0c7</fn> hdd: <free> free")] [] 60 -- Battery information. This is likely to require some customization
-- Runs a standard shell command 'uname -r' to get kernel version -- based upon your specific hardware. Or, for a desktop you may want
, Run Com "uname" ["-r"] "" 3600 -- to just remove this section entirely.
Run Battery [
"-t", "<fn=1>\xf240</fn> <acstatus> <left>% - <timeleft>",
"--",
"-i", "<fc=#75c44c>AC</fc>",
"-O", "<fc=#75c44c>AC</fc>",
"-o", "<fc=#ff0000>AUX</fc>",
"-L", "12",
"-h", "green",
"-l", "red"
] 10,
-- Time and date
Run Date "<fn=1>\xf017</fn> %H:%M %b %d %Y" "date" 50,
-- Network up and down
Run Network "wlp2s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
--Run Network "enp3s0" ["-t", "<fn=1>\xf0ab</fn> <rx>kb <fn=1>\xf0aa</fn> <tx>kb"] 20,
-- Show free disk space on /
Run DiskU [("/", "<fn=1>\xf0c7</fn> hdd: <free>")] [] 60,
-- Get kernel version from uname -r
Run Com "uname" ["-r"] "" 3600,
-- Add dynamic invisible XPM icon that resizes to accomodate trayer -- Add dynamic invisible XPM icon that resizes to accomodate trayer
-- this needs to be an absolute string path, env vars or relpaths aren't accepted -- this needs to be an absolute string path, env vars or relpaths aren't accepted
-- this should only be on 1 monitor (single file), so ignore this comment on others -- this should only be on 1 monitor (single file), so ignore this comment on others
-- Allow mouse clicking by using unsafe stdin reader
, Run UnsafeStdinReader -- This line tells xmobar to read input from stdin.
] -- That's how it gets information that xmonad is sending
, sepChar = "%" -- (such as workspaces) for displaying.
, alignSep = "}{" -- By using UnsafeStdinReader, it also allows mouse clicking events
, template = " <icon=haskell_20.xpm/> <fc=#666666>|</fc> %UnsafeStdinReader% }{ \ Run UnsafeStdinReader
\<fc=#666666>|</fc> <fc=#b3afc2><fn=3></fn> <action=`alacritty -e htop`>%uname%</action> </fc> \ ],
\<fc=#666666>|</fc> <fc=#ecbe7b> <action=`alacritty -e htop`>%cpu%</action> </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> <action=`alacritty -e htop`>%memory%</action> </fc> \ -- Separator character used to wrap variables in the xmobar template string
\<fc=#666666>|</fc> <fc=#51afef> <action=`alacritty -e htop`>%disku%</action> </fc> \ sepChar = "%",
\<fc=#666666>|</fc> <fc=#98be65> <action=`alacritty -e sudo iftop`>%wlp2s0%</action> </fc> \ -- Alignment eparator character used in the xmobar template string.
-- Everything before this will be aligned left, everything after right.
alignSep = "}{",
-- Template string defining the xmobar contents and overall layout.
template = "\
\<icon=haskell_20.xpm/> \
\<fc=#666666>|</fc> %UnsafeStdinReader% }{ \
\<fc=#666666>|</fc> <fc=#b3afc2><fn=2></fn> %uname% </fc> \
\<fc=#666666>|</fc> <fc=#9ce996> %battery% </fc> \
\<fc=#666666>|</fc> <fc=#ecbe7b> %cpu% </fc> \
\<fc=#666666>|</fc> <fc=#ff6c6b> %memory% </fc> \
\<fc=#666666>|</fc> <fc=#51afef> %disku% </fc> \
\<fc=#666666>|</fc> <fc=#98be65> %wlp2s0% </fc> \
--\<fc=#666666>|</fc> <fc=#98be65> %eth3s0% </fc> \
\<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \ \<fc=#666666>|</fc> <fc=#46d9ff> %date% </fc> \
\ " \ "
} }