Adding leftwm with xmobar.

This commit is contained in:
Derek Taylor
2022-10-19 17:44:02 -05:00
parent cfb5e86f9f
commit ffab9f795a
19 changed files with 341 additions and 212 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
leftwm-command "SendWorkspaceToTag $1 $2"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
#set background
if [ -x "$(command -v feh)" ]; then
feh --bg-scale $SCRIPTPATH/reset.jpg
fi
leftwm-command "UnloadTheme"
ps -alh | grep xmobar_control_script | awk '{print $3}' | xargs kill
pkill compton
pkill picom
pkill xmobar
pkill xmobar

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

View File

@@ -0,0 +1,3 @@
{% for w in workspaces %}
Static { xpos = {{w.x}} , ypos = {{w.y}}, width = {{w.w}}, height = 24 }
{% endfor %}

View File

@@ -0,0 +1,12 @@
{% for tag in workspace.tags %}
{% if tag.mine %}
<action=`$SCRIPTPATH/change_to_tag {{workspace.index}} {{tag.index}}`><fc=#FF0000> {{tag.name}} </fc></action>
{% elsif tag.visible %}
<action=`$SCRIPTPATH/change_to_tag {{workspace.index}} {{tag.index}}`><fc=#FF9999> {{tag.name}} </fc></action>
{% elsif tag.busy %}
<action=`$SCRIPTPATH/change_to_tag {{workspace.index}} {{tag.index}}`> {{tag.name}}* </action>
{% else %}
<action=`$SCRIPTPATH/change_to_tag {{workspace.index}} {{tag.index}}`><fc=#FFFFFF> {{tag.name}} </fc></action>
{% endif %}
{% endfor %}
<fc=#555555> {{ window_title }}</fc>

View File

@@ -0,0 +1,6 @@
(border_width: 2,
margin: 12,
default_border_color: "#222222",
floating_border_color: "#555555",
focused_border_color: "#FF3333",
)

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
export SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
#down the last running theme
if [ -f "/tmp/leftwm-theme-down" ]; then
/tmp/leftwm-theme-down
rm /tmp/leftwm-theme-down
fi
ln -s $SCRIPTPATH/down /tmp/leftwm-theme-down
#boot compton or picom if it exists
killall conky
killall trayer
lxsession &
picom &
nm-applet &
volumeicon &
/usr/bin/emacs --daemon &
sleep 2 && conky -c $HOME/.config/conky/xmonad/doom-one-01.conkyrc
sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x282c34 --height 22
#set the theme.ron config
leftwm-command "LoadTheme $SCRIPTPATH/theme.ron"
# SET WALLPAPER
# Uncomment only ONE of the following FOUR lines, depending on which wallpaper setter you use.
xargs xwallpaper --stretch < ~/.cache/wall
# ~/.fehbg &" -- set last saved feh wallpaper
# feh --randomize --bg-fill /usr/share/backgrounds/dtos-backgrounds/*" -- feh set random wallpaper
# nitrogen --restore &" -- if you prefer nitrogen to feh
index=0
leftwm-state -q -n -t $SCRIPTPATH/sizes.liquid | sed -r '/^\s*$/d' | while read size
do
leftwm-state -w $index -t $SCRIPTPATH/template.liquid | xmobar -p "$size" $SCRIPTPATH/xmobar-config.hs --alpha=230 &
let index=index+1
done

View File

@@ -0,0 +1,23 @@
Config { font = "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = Top
, lowerOnStart = True
, allDesktops = True
, pickBroadest = False
, overrideRedirect = False
, commands = [ Run Weather "KSHV" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000
, Run Network "eno1" ["-L","0","-H","32","--normal","green","--high","red"] 10
, Run MultiCpu ["-L","15","-H","50","--normal","green","--high","red"] 10
, Run Memory [] 10
, Run Swap [] 10
, Run TopProc [] 10
, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
, Run UnsafeStdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%UnsafeStdinReader% }{ %top% | %multicpu% | %memory% * %swap% | %eno1% | %date% | %KSHV%"
}

View File

@@ -0,0 +1,52 @@
Config { font = "xft:Ubuntu:weight=bold:pixelsize=11:antialias=true:hinting=true"
, additionalFonts = [ "xft:Mononoki:pixelsize=11: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 L 100 24
, lowerOnStart = True
, hideOnStart = False
, allDesktops = True
, overrideRedirect = False
, persistent = True
, commands = [
-- Echos a "penguin" icon in front of the kernel output.
Run Com "echo" ["<fn=3>\xf17c</fn>"] "penguin" 3600
-- Get kernel version (script found in .local/bin)
, Run Com ".local/bin/kernel" [] "kernel" 36000
-- 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> hdd: <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 "bell" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf0f3</fn>"] "bell" 3600
-- Check for pacman updates (script found in .local/bin)
, Run Com ".local/bin/pacupdate" [] "pacupdate" 36000
-- Echos a "battery" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf242</fn>"] "baticon" 3600
-- Battery
, Run BatteryP ["BAT0"] ["-t", "<acstatus><watts> (<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 ".config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20
-- Prints out the left side items such as workspaces, layout, etc.
, Run UnsafeStdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = " %UnsafeStdinReader% }{ <box type=Bottom width=2 mb=2 color=#51afef><fc=#51afef>%penguin% %kernel%</fc></box> <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>%disku%</fc></box> <box type=Bottom width=2 mb=2 color=#98be65><fc=#98be65>%uparrow% %uptime%</fc></box> <box type=Bottom width=2 mb=2 color=#c678dd><fc=#c678dd>%bell% <action=`alacritty -e sudo pacman -Syu`>%pacupdate%</action></fc></box> <box type=Bottom width=2 mb=2 color=#da8548><fc=#da8548>%baticon% %battery%</fc></box> <box type=Bottom width=2 mb=2 color=#46d9ff><fc=#46d9ff><action=`emacsclient -c -a 'emacs' --eval '(doom/window-maximize-buffer(dt/year-calendar))'`>%date%</action></fc></box> %trayerpad%"
}