Skip to content

Add align commands (left, center, right)#61

Open
osv wants to merge 1 commit intorobm:masterfrom
osv:align-commands-backport
Open

Add align commands (left, center, right)#61
osv wants to merge 1 commit intorobm:masterfrom
osv:align-commands-backport

Conversation

@osv
Copy link

@osv osv commented Oct 11, 2024

Added ^left(), ^center(), and ^right() commands.
With these commands, there's no longer a need to run multiple instances of dzen2 or use the -expand parameter.

Each new command will copy pixmap to window and call parse_line with rest of not processed text.

Demo:

window

#!/usr/bin/env bash

# nano dark theme
FOREGROUND="#ECEFF4"  # white
BACKGROUND="#2E3440"  # black
HIGHLIGHT="#3B4252"   # brightblack
SUBTLE="#434C5E"      # brightblack
FADED="#677691"       # cyan
SALIENT="#81A1C1"     # brightblue
STRONG="#FFFFFF"      # brightwhite
POPOUT="#D08770"      # brightred
CRITICAL="#EBCB8B"    # yellow


fg="^fg($FOREGROUND)"
bg="^fg($BACKGROUND)"
sep="^fg($FADED)|"
active="^bg($POPOUT)^fg($BACKGROUND)"

key="^fg($SALIENT)"
val="^fg($STRONG)"

left="^left()${bg}$fg 1 $sep $fg 2 $sep $active 3 "
center="^center()${fg}12:34"
right="^right()$key CPU:$val 10% $sep $key MEM:$val 3.3GB"

echo " ${left}${center}${right} " | ./dzen2 -p -fn "Iosevka Comfy-12" -w 800 -bg $BACKGROUND -fg $FOREGROUND

My fork includes graphical unit tests, and no regressions have been detected.

@osv osv changed the title Add align commands (left, center, right_ Add align commands (left, center, right) Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant