First commit
This commit is contained in:
commit
08c122f3fd
23 changed files with 1960 additions and 0 deletions
52
.config/xmobar/trayer-padding-icon.sh
Executable file
52
.config/xmobar/trayer-padding-icon.sh
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/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
|
||||
|
||||
if [ "$width" -gt "5" ]; then
|
||||
# Output the icon tag for xmobar
|
||||
echo "<fc=#eba0ac>•</fc><icon=${iconfile}/>"
|
||||
else
|
||||
echo "<icon=${iconfile}/>"
|
||||
fi
|
20
.config/xmobar/xmobarrc
Normal file
20
.config/xmobar/xmobarrc
Normal file
|
@ -0,0 +1,20 @@
|
|||
Config { lowerOnStart = True
|
||||
, overrideRedirect = True
|
||||
, font = "xft:IBMPlex Mono:size=10:antialias=true,IpaGothic:size=11:antialias,Symbols Nerd Font:size=10"
|
||||
, bgColor = "#303446"
|
||||
, fgColor = "#c6d0f5"
|
||||
, position = TopSize L 100 27
|
||||
, commands = [ Run Cpu
|
||||
[ "--template", " <total>%"] 90
|
||||
, Run Com "sb-cpu-temp" [] "cpu-temp" 100
|
||||
, Run Com "sb-battery" [] "battery" 300
|
||||
, Run Com "sb-ram" [] "memory" 150
|
||||
, Run Com "sb-disk-space" [] "disk" 360000
|
||||
, Run Com "sb-datetime" [] "date" 200
|
||||
, Run Com "sb-wifi" [] "wifi" 50
|
||||
, Run Com "/home/crony/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 100
|
||||
, Run XMonadLog
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " %XMonadLog% }{ %cpu-temp% <fc=#eba0ac>•</fc> %cpu% <fc=#eba0ac>•</fc> %memory% <fc=#eba0ac>•</fc> %disk% <fc=#eba0ac>•</fc> %wifi% <fc=#eba0ac>•</fc> %battery% <fc=#eba0ac>•</fc> %date% %trayerpad%" }
|
Loading…
Add table
Add a link
Reference in a new issue