You are not logged in.

#101 2021-10-31 15:09:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,881
Website

Re: Tabby: a tabbed-tiling wayland compositor

Thanks bgc - I'm glad to see you still around here.

The background issue is not on you - Tabby is not yet equipped for that, but it is at the top of my todo list when I get back to it.  In wayland the compositor must really do everything: there is no "background" or mechanism to set it other than what the compositor provides.  And so far, Tabby doesn't provide anything (other than a customizable solid color).

There are two ways to allow for backgrounds: one is to implement the layer-shell protocol, and the other is to have a compositor-specific mechanism.  I've avoided the layer-shell protocol for a while, but I think I need to deal with it.  As may have been noticed, then tabby-menu system does not handle key repeats (if you press and hold a key).  Key repeat in wayland needs to be implemented by the client, and while implementing the menu within tabby was pretty simple, adding key-repeat mechanisms too is going to get complicated.  So this has increased the priority of implementing the layer-shell protocol (so that tabby can use third-party menus which will implement key-repeat in their own code).  Implementing layer-shell will make tools like sway-bg function as expected.

However, I will also include mechanism to set backgrounds in tabby itself.  While I prefer to avoid duplicating effort, I believe this job should be in the compositor.  When you run sway-bg in a layer-shell-compatible compositor, sway-bg doesn't just set the background, but it has to continue running as a daemon process to maintain the background and on every rendering the compositor has to ask the background program what to draw.  This can all be done in the compositor pretty easily once the image loading code is written.  At that point the image surface is just kept around and rendered as needed without having to interact with another program.

Last edited by Trilby (2021-10-31 15:10:59)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#102 2021-11-01 15:40:36

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,141

Re: Tabby: a tabbed-tiling wayland compositor

OK, I get it.  It seems much more complicated in wayland and as I found out not a lot of tools to accomplish it and they seem to be specific to the compositor so your explanation makes total sense.  Hope it doesn't add too much unnecessary bulk when you get around to it.  Mostly on a browser anyway so it would only be noticable when I'm in the terminal.  Just find it familiar to see something behind the terminal other than a solid colored screen.

Edit:  And just in case someone else encounters problem getting media keys to work with pulseaudio (required by firefox).  After some searching found this:

bind 0 XF86AudioRaiseVolume  exec       amixer -q -D pulse set Master 5%+ unmute
bind 0 XF86AudioLowerVolume  exec       amixer -q -D pulse set Master 5%- unmute
bind 0 XF86AudioMute         exec       amixer -q -D pulse set Master toggle

Why is it always so complicated learning new stuff.  Just getting old, I guess.

Last edited by bgc1954 (2021-11-02 14:57:53)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#103 2021-11-19 16:54:40

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,141

Re: Tabby: a tabbed-tiling wayland compositor

@Trilby
Just trying to add a couple of things to my right side bar and not quite succeeding.  My bash is very rusty and not polished in the slightest.  What I'm now getting after many tries is my results flashing on the right side of the bar one after another rather than all in one line.  At least I've gotten this far as all it was showing was the date and time for quite some time.  Until I added the sleeps I sometimes got the uptime then the date/time but no temp. Any suggestions?  I know you will have.

#!/bin/sh

while :; do

read t0 < /sys/class/hwmon/hwmon0/temp1_input
read t1 < /sys/class/hwmon/hwmon1/temp1_input
read t2 < /sys/class/hwmon/hwmon2/temp1_input

uptime=
echo "$(uptime | grep 'up' | cut -c14-18)"
sleep 5

temp=
if [ $t0 ]
then
        echo "$((($t0) / 1000 + 40))""°"
elif [ $t1 ]
then
        echo "$((($t1) / 1000 + 40))""°"
elif [ $t2 ]
then
        echo "$((($t2) / 1000 + 40))""°"
fi
sleep 5

date "+{fg=7}%b %d %l:%M%P {fg=4}${uptime}${temp}"

sleep 5

done

Messy right!


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#104 2021-11-19 18:34:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,881
Website

Re: Tabby: a tabbed-tiling wayland compositor

Do you want the display to cycle through the different bits of information?  As written, it will display the uptime for 5 seconds, then the temperatures for 5 seconds, then the date for 5 seconds and repeat all of this (and the uptime and temp variables are not used at all).  Or do you want it to display all of this concurrently?  Each line that the script outputs replaces any previous status information, so it all needs to be printed on a single line.  You could do this by putting everything in variables, but it'd be easier to just use printf (or echo w/ the "-n" flag).  Also, do you really want to show all the temperatures individually, or do you want to average them?  If you want this all on one line and all temperatures displayed, try the following:

#!/bin/sh

while :; do

printf '%s' "$(date "+{fg=7}%b %d %l:%M%P {fg=4}")"

printf '%s ' "$(uptime | sed -n 's/.*up \([^,]*\).*/\1/p')"

for input in /sys/class/hwmon/hwmon*/temp1_input; do
	read t < $input
	printf '%d° ' $((t / 1000 + 40))
done

printf '\n'

sleep 5

done

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#105 2021-11-20 16:32:32

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,141

Re: Tabby: a tabbed-tiling wayland compositor

Ok thanks. I’m just on my tablet right now so will try that out later. Actually, that whole temp thing is due to the temp1_input jumping around from hwmon1 to hwmon2 to hwmon3 and I’d get no temp readout sometimes. I borrowed this from my fbpanel display that I use in openbox but that output didn’t display the same in tabby’s right side. And to answer your question, I’m just trying to get it to display in one line. The flashing of the readouts the way it is now is distracting.  Thanks again, I’ll try out yours when I get around to my desktop.

Edit:  Nope, not quite.  Either with my script using echo -n or your script, the right status shows a nice one liner for a few seconds and then either displays just the temp with yours or the date with mine, although there is some flashing so it looks like it's trying to rewrite the status but doesn't display the whole thing.

Last edited by bgc1954 (2021-11-21 16:11:29)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

Board footer

Powered by FluxBB