aboutsummaryrefslogtreecommitdiffstats
path: root/xmobar
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-07-07 14:33:20 +0300
committerla-ninpre <leobrekalini@gmail.com>2021-07-07 14:33:20 +0300
commit904a7edf2aedb48b0ce9825fd5c8a46e57847073 (patch)
tree0171a9f0f5eeb786b94900ffd56007a2dda347e2 /xmobar
downloadxmonad-config-904a7edf2aedb48b0ce9825fd5c8a46e57847073.tar.gz
xmonad-config-904a7edf2aedb48b0ce9825fd5c8a46e57847073.zip
initial commit
Diffstat (limited to 'xmobar')
-rwxr-xr-xxmobar/separator.sh3
-rwxr-xr-xxmobar/trayer-padding-icon.sh48
-rwxr-xr-xxmobar/xmobarrc107
-rw-r--r--xmobar/xmobarrc.bak30
4 files changed, 188 insertions, 0 deletions
diff --git a/xmobar/separator.sh b/xmobar/separator.sh
new file mode 100755
index 0000000..e305e52
--- /dev/null
+++ b/xmobar/separator.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "<fc=#66666a>|</fc>"
diff --git a/xmobar/trayer-padding-icon.sh b/xmobar/trayer-padding-icon.sh
new file mode 100755
index 0000000..efb8ef6
--- /dev/null
+++ b/xmobar/trayer-padding-icon.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Copied from https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
+# Detects the width of running trayer-srg window (xprop name 'panel')
+# and creates an XPM icon of that width, 1px height, and transparent.
+# Outputs an <icon>-tag for use in xmobar to display the generated
+# XPM icon.
+#
+# Run script from xmobar:
+# `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10`
+# and use `%trayerpad%` in your template.
+
+
+# Function to create a transparent Wx1 px XPM icon
+create_xpm_icon () {
+ timestamp=$(date)
+ pixels=$(for i in `seq $1`; do echo -n "."; done)
+
+ cat << EOF > "$2"
+/* XPM *
+static char * trayer_pad_xpm[] = {
+/* This XPM icon is used for padding in xmobar to */
+/* leave room for trayer-srg. It is dynamically */
+/* updated by by trayer-padding-icon.sh which is run */
+/* by xmobar. */
+/* Created: ${timestamp} */
+/* <w/cols> <h/rows> <colors> <chars per pixel> */
+"$1 1 1 1",
+/* Colors (none: transparent) */
+". c none",
+/* Pixels */
+"$pixels"
+};
+EOF
+}
+
+# Width of the trayer window
+width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5)
+
+# Icon file name
+iconfile="$HOME/.xmonad/xpm/tmp/trayer-padding-${width}px.xpm"
+
+# If the desired icon does not exist create it
+if [ ! -f $iconfile ]; then
+ create_xpm_icon $width $iconfile
+fi
+
+# Output the icon tag for xmobar
+echo "<icon=${iconfile}/>"
diff --git a/xmobar/xmobarrc b/xmobar/xmobarrc
new file mode 100755
index 0000000..8d2f309
--- /dev/null
+++ b/xmobar/xmobarrc
@@ -0,0 +1,107 @@
+-- https://projects.haskell.org/xmobar/
+-- uses font awesome
+-- vim:se syntax=haskell:
+
+Config { font = "xft:Lato:weight=bold:pixelsize=12:antialias=true:hinting=true"
+ , additionalFonts = [ "xft:Font Awesome 5 Free Solid:pixelsize=12"
+ , "xft:Font Awesome 5 Brands:pixelsize=14"
+ -- sitelen pona pona by jackhumbert
+ --, "xft:sitelen\-pona:pixelsize=20:antialias=true:hinting=true"
+ -- linja pona
+ , "xft:linja pona:pixelsize=22:antialias=true:hinting=true"
+ ]
+ , bgColor = "#19191a"
+ , fgColor = "#cadcde"
+ , position = TopSize C 100 24
+ , lowerOnStart = True
+ , hideOnStart = False
+ , persistent = True
+ , iconRoot = ".xmonad/xpm/"
+ , commands = [ Run UnsafeStdinReader
+ , Run Com "uname" ["-r"] "" 0
+ , Run Uptime
+ ["-t"
+ -- normie
+ --, "<fc=#7f9848><fn=1>\xf017</fn> uptime: <days>d</fc>"
+ -- sitelen pona pona by jackhumbert
+ --, "<fc=#7f9848><fn=3>\xee6b\xee64\xee3d</fn><days></fc>"
+ -- linja pona
+ , "<fc=#7f9848><fn=3>\xe66b\xe664\xe63d</fn><days></fc>"
+ -- tenpo suno nanpa
+ ] 60
+ , Run Cpu
+ ["-t"
+ -- normie
+ --, "<fc=#c74444><fn=1>\xf108</fn>cpu: <total>%</fc>"
+ -- sitelen pona pona by jackhumbert
+ --, "<fc=#c74444><fn=3>\xee24\xee4d\xee0e\xee3d</fn>: <total>%</fc>"
+ -- linja pona
+ , "<fc=#c74444><fn=3>\xe624\xe730\xe60e\xe63d</fn>: <total>%</fc>"
+ -- lawa pi ilo sona
+ , "-H", "50", "--high", "red"
+ ] 20
+ , Run Memory
+ ["-t"
+ -- normie
+ --, "<fc=#d7a06d><fn=1>\xf538</fn> ram: <used>M (<usedratio>%)</fc>"
+ -- sitelen pona pona by jackhumbert
+ --, "<fc=#d7a06d><fn=3>\xee53\xee49</fn>: <used>M (<usedratio>%)</fc>"
+ -- linja pona
+ , "<fc=#d7a06d><fn=3>\xe653\xf174</fn>: <used>M (<usedratio>%)</fc>"
+ -- poki pali
+ ] 20
+ , Run DiskU
+ [("/home"
+ -- normie
+ --, "<fc=#4e96d5><fn=1>\xf0a0</fn> hdd: <free> free</fc>")
+ -- sitelen pona pona by jackhumbert
+ --, "<fc=#4e96d5><fn=3>\xee53\xee08</fn>: <free></fc>")
+ -- linja pona
+ , "<fc=#4e96d5><fn=3>\xe653\xf109</fn>: <free></fc>")
+ -- poki awen
+ ] [] 60
+ , Run Kbd
+ -- normie
+ --[ ("us", "<fc=#55b795><fn=1>\xf11c</fn> EN</fc>")
+ --, ("ru", "<fc=#55b795><fn=1>\xf11c</fn> RU</fc>")
+ --]
+ -- sitelen pona pona by jackhumbert
+ --[ ("us", "<fc=#55b795><fn=3>\xee6c\xee4d\xee0e\xee60 inli</fn></fc>")
+ --, ("ru", "<fc=#55b795><fn=3>\xee6c\xee4d\xee0e\xee60 losi</fn></fc>")
+ --]
+ -- toki pi ilo sitelen
+ -- linja pona
+ [ ("us", "<fc=#55b795><fn=3>\xe66c\xe730\xe619\xe660 [_I_N_LI]</fn></fc>")
+ , ("ru", "<fc=#55b795><fn=3>\xe66c\xe730\xe619\xe660 [_L_O_SI]</fn></fc>")
+ ]
+ -- toki pi ilo sitelen
+ , Run Date
+ -- normie
+ --"<fc=#ceced2><fn=1>\xf017</fn> %d %b %Y %R</fc>"
+ -- sitelen pona pona by jackhumbert
+ --"<fc=#ceced2><fn=3>\xee6b</fn> %d-%m-%Y %R</fc>"
+ -- linja pona
+ "<fc=#ceced2><fn=3>\xe66b</fn> %d-%m-%Y %R</fc>"
+ -- tenpo
+ "date" 50
+ , Run Network "wg0"
+ ["-t"
+ -- normie
+ --, "<fc=#ceced2><fn=1>\xf6d5</fn></fc>"
+ -- sitelen pona pona by jackhumbert
+ --, "<fc=#ceced2><fn=3>\xee01</fn></fc>"
+ -- linja pona
+ , "<fc=#ceced2><fn=3>\xe601</fn></fc>"
+ -- akesi
+ ] 20
+ , Run Com ".xmonad/xmobar/trayer-padding-icon.sh"
+ ["panel"] "trayerpad" 10
+ , Run Com ".xmonad/xmobar/separator.sh" [] "s" 0
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ -- ... }{ <fc=#ceced2><fn=2></fn> ... -- normie
+ -- ... }{ <fc=#ceced2><fn=3> linu</fn> ... -- sitelen pona pona by jackhumbert
+ -- ... }{ <fc=#ceced2><fn=3> [_L_IN_U]</fn> ... -- linja pona
+ , template = " <action=`dm-logout`><icon=la_ninpre.xpm/></action> %s% %UnsafeStdinReader% }{ <fc=#ceced2><fn=3> [_L_IN_U]</fn> <action=`alacritty --class Alacritty,splash --hold -e neofetch`>%uname%</action></fc> %s% %uptime% %s% <action=`alacritty -e htop`>%cpu%</action> %s% <action=`alacritty -e htop`>%memory%</action> %s% <action=`alacritty --class Alacritty,splash --hold -e df -h / /timeshift /home`>%disku%</action> %s% %kbd% %s% <action=`alacritty -e calcurse`>%date%</action> %s% %wg0% %trayerpad%"
+}
diff --git a/xmobar/xmobarrc.bak b/xmobar/xmobarrc.bak
new file mode 100644
index 0000000..79daa12
--- /dev/null
+++ b/xmobar/xmobarrc.bak
@@ -0,0 +1,30 @@
+Config { font = "xft:Jet Brains Mono:pixelsize=12:antialias=true;hinting=true"
+ , additionalFonts = []
+ , bgColor = "#2e3440"
+ , fgColor = "#d8dee9"
+ , position = Top
+ , lowerOnStart = True
+ , hideOnStart = False
+ , allDesktops = True
+ , persistent = True
+ , iconRoot = "/home/aaoth/.xmonad/xpm/" -- default: "."
+ , commands = [
+ -- Time and date
+ Run Date "%b %d %Y %H:%M" "date" 50
+ -- Network up and down
+ , Run Network "eno1" ["-t", "<rx>kb <tx>kb"] 20
+ , Run Network "wg0" ["-t", "<rx>kb <tx>kb"] 20
+ -- Cpu usage in percent
+ , Run Cpu ["-t", "<total>%","-H","50","--high","red"] 20
+ -- Ram used number and percent
+ , Run Memory ["-t", "<used>M (<usedratio>%)"] 20
+ -- Disk space free
+ , Run DiskU [("/", "<free> free")] [] 60
+ -- Runs a standard shell command 'uname -r' to get kernel version
+ , Run Com "uname" ["-r"] "" 3600
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ , template = "<icon=haskell_20.xpm/>}{%uname% <fc=#666666>|</fc> <icon=cpu_20.xpm/> %cpu% <fc=#666666>|</fc> <icon=memory-icon_20.xpm/> %memory% <fc=#666666>|</fc> <icon=harddisk-icon_20.xpm/> %disku% <fc=#666666>|</fc> %eno1% wg: %wg0% <fc=#666666>|</fc> %date% "
+ }
+