chore: Added more config files

This commit is contained in:
Afonso Franco 2022-10-14 14:01:46 +01:00
parent 00e95f6df9
commit 3cafdb0c71
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
13 changed files with 1557 additions and 0 deletions

1
.config/xmobar/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
xmobar-git

View file

@ -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="/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}/>"

50
.config/xmobar/xmobarrc Normal file
View file

@ -0,0 +1,50 @@
-- Xmobar (http://projects.haskell.org/xmobar/)
-- This is the default xmobar configuration for DTOS.
-- This config is packaged in the DTOS repo as dtos-xmobar
-- Dependencies: otf-font-awesome ttf-mononoki ttf-ubuntu-font-family trayer
-- Also depends on scripts from dtos-local-bin from the dtos-core-repo.
Config { font = "xft:Ubuntu:weight=bold:pixelsize=14:antialias=true:hinting=true"
, additionalFonts = [ "xft:mononoki:pixelsize=14:antialias=true:hinting=true"
, "xft:Font Awesome 6 Free Solid:pixelsize=12"
, "xft:Font Awesome 6 Brands:pixelsize=12"
]
, bgColor = "#282c34"
, fgColor = "#ff6c6b"
-- Position TopSize and BottomSize take 3 arguments:
-- an alignment parameter (L/R/C) for Left, Right or Center.
-- an integer for the percentage width, so 100 would be 100%.
-- an integer for the minimum pixel height for xmobar, so 24 would force a height of at least 24 pixels.
-- NOTE: The height should be the same as the trayer (system tray) height.
, position = TopSize C 95 26
, lowerOnStart = True
, hideOnStart = False
, allDesktops = True
, persistent = True
, iconRoot = "/home/afonso/.config/xmobar/xpm/" -- default: "."
, commands = [
-- Cpu usage in percent
Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: (<total>%)","-H","50","--high","red"] 20
-- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M (<usedratio>%)"] 20
-- Disk space free
, Run DiskU [("/", "<fn=2>\xf0c7</fn> disk: <free> free")] [] 60
-- Echos an "up arrow" icon in front of the uptime output.
, Run Com "echo" ["<fn=2>\xf0aa</fn>"] "uparrow" 3600
-- Uptime
, Run Uptime ["-t", "uptime: <days>d <hours>h"] 360
-- Echos a "battery" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf242</fn>"] "baticon" 3600
-- Battery
, Run BatteryP ["BAT0"] ["-t", "<fn=2>\xf242</fn> AC:<acstatus> (<left>%)"] 360
-- Time and date
, Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50
-- Script that dynamically adjusts xmobar padding depending on number of trayer icons.
, Run Com "/home/afonso/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20
-- Prints out the left side items such as workspaces, layout, etc.
, Run UnsafeStdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = " <icon=logo.xpm/> <fc=#666666>|</fc> %UnsafeStdinReader% }{ <box type=Bottom width=2 mb=2 color=#ecbe7b><fc=#ecbe7b><action=`alacritty -e htop`>%cpu%</action></fc></box> | <box type=Bottom width=2 mb=2 color=#ff6c6b><fc=#ff6c6b><action=`alacritty -e htop`>%memory%</action></fc></box> | <box type=Bottom width=2 mb=2 color=#a9a1e1><fc=#a9a1e1><action=`alacritty -e htop`>%disku%</action></fc></box> | <box type=Bottom width=2 mb=2 color=#46d9ff><fc=#46d9ff>%date%</fc></box> | <box type=Bottom width=2 mb=2 color=#da8548><fc=#da8548> <action=`alacritty -e sudo pacman -Syu`>%battery%</action></fc></box> | %trayerpad% "
}

View file

@ -0,0 +1,75 @@
/* XPM */
static char *logo[] = {
/* columns rows colors chars-per-pixel */
"16 16 53 1 ",
" c None",
". c #3A7F2A",
"X c #F34E00",
"o c #F74F00",
"O c #FC5100",
"+ c #FD661D",
"@ c #FE671F",
"# c #E4672C",
"$ c #E8682B",
"% c #EB692B",
"& c #F46E2A",
"* c #FE6E2A",
"= c #E8712D",
"- c #E17230",
"; c #FE7A3B",
": c #FC7C3F",
"> c #3B802A",
", c #408B2E",
"< c #418A2F",
"1 c #408C2E",
"2 c #418C2E",
"3 c #418C2F",
"4 c #418D2F",
"5 c #428C2F",
"6 c #448E31",
"7 c #4E8C3F",
"8 c #449131",
"9 c #459232",
"0 c #569746",
"q c #559845",
"w c #569847",
"e c #569248",
"r c #5A994B",
"t c #599C49",
"y c #5A9C49",
"u c #5B9D4B",
"i c #5B994C",
"p c #5C9A4D",
"a c #5C9D4C",
"s c #5F9F50",
"d c #619853",
"f c #619F52",
"g c #649C56",
"h c #73985F",
"j c #67A159",
"k c #68A05B",
"l c #6BA45D",
"z c #70A763",
"x c #72A965",
"c c #FD8147",
"v c #E98657",
"b c #8AB580",
"n c #C7C6B0",
/* pixels */
" ",
" z0p ",
" 188f ",
" j 188u ",
" lq 188u q ",
" 6d188u < ",
" xe188sg1 ",
" b188r>a ",
" 188i7 ",
" 188k ",
" n.1<h ",
" c&-=@ ",
" #%%v ",
" OXo: ",
" ;@* ",
" "
};