Skip to content

Subtract from a percentage #850

Answered by w-lfchen
Eclextic asked this question in Q&A
Jul 19, 2023 · 3 comments · 10 replies
Discussion options

You must be logged in to vote

Window sizes have to be fixed as far as I'm concerned.
I have found something new that you might want to try though, it's way less clunky and I honestly don't know why I didn't think of this before:
Unset the window class background by any means.
Then give the box containing your bar stuff the following properties:

margin-right: 10px;
margin-left: 10px;

Here's an example:

(defpoll random :interval "1s" "fish -c \"random 0 1024\"")
(defwindow example
  :monitor 0
  :geometry (geometry
    :x "0%"
    :y "0%"
    :width "100%"
    :height "10px"
    :anchor "top center"
  )
  :exclusive true
  (box
    :style "margin-right: ${random}px; margin-left: ${random}px; background-color:red;"
    …

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Eclextic
Comment options

@Eclextic
Comment options

Comment options

You must be logged in to vote
8 replies
@Eclextic
Comment options

@Eclextic
Comment options

@Eclextic
Comment options

@w-lfchen
Comment options

Answer selected by Eclextic
@Eclextic
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants