You are not logged in.

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

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
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

Offline

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

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

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,160

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: 29,442
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

Offline

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

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

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

#106 2022-01-27 15:58:37

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

Re: Tabby: a tabbed-tiling wayland compositor

Tabby has just received several updates to work with the significant API changes of wlroots 0.15 coincident with a rewrite / refactoring I was doing to prepare for adding layer shell support (which is not implemented but now seems very doable).  Big recent additions are the ability to set a wallpaper as well as fullscreen support (e.g., for fullscreened videos from a browser).

I'm going to spend a little while on testing and fixing bugs in these updates before tagging a 1.5 release at which point I'll put my focus on implementing layer-shell support.

@bgc1954 Sorry I missed that edit from a couple months ago - if you're still using tabby and struggling with the status info, let me know.

Last edited by Trilby (2022-01-27 15:59:57)


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

Offline

#107 2022-01-27 17:05:21

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

Re: Tabby: a tabbed-tiling wayland compositor

Yup, as the edit said, I’m not getting all displayed on one line. It’s just doing as said in edit, flashing one item after displaying the whole thing once. Also, anything special needed to have a wallpaper or is that still in the works?


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

Offline

#108 2022-01-27 17:24:25

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

Re: Tabby: a tabbed-tiling wayland compositor

Ah, I see the problem with the status scripts.  Tabby reads the input unbuffered (otherwise it would hang for a long time until the pipe buffer flushed).  But because of this each bit of input is read regardless of newlines.  I'll look into whether I can get the event handler to read line buffered input, but until then a script can do it's own line buffering.  Just add something like the following at the end of the loop:

#...

done | while read line; do printf "$line"; done

For wallpapers, it's fully implemented in the most recent commits.  There is some information on using it in the example config file in the package (under /usr/share).  But this is tabby's own wallpaper setting.  The use of third party background setters (like sway-bg) will require the not-yet-implemented layer-shell protocol.

EDIT some shells may have some setting (e.g., a 'shopt' option or the like) to do output line buffering, but I'm not familiar with these.

Last edited by Trilby (2022-01-27 17:55:22)


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

Offline

#109 2022-01-28 15:29:08

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

Re: Tabby: a tabbed-tiling wayland compositor

Well, that's much better but I'm still not seeing quite all of what I was looking for.  It first prints the full date and uptime is at the end with no temp reading.  Then after the sleep it redraws with uptime at the start and temp with no degree sign, the time with no date, and the uptime at the end again in a different color font.  The uptime at the end doesn't redraw as it stays at the same time.  I also thought I read somewhere earlier about a truncated right status but not sure if that's part of the problem.  The script now looks like this:

#!/bin/sh

while :; do

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

printf '%s ' "Up:$(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 | while read line; do printf "$line"; done

sleep 10

done

Also not seeing any wallpaper after updating tabby config file using a wallpaper .png file I have been using for years in openbox. Changed the opacity setting in ~/.config/alacritty/alacritty.yml as old setting is deprecated with new alacritty update but there is nothing showing behind even if I run tabby and kill the terminal  so don't know if that works yet. And thanks for fullscreen in browser works great.

Edit: explanation wasn't quite correct.

Last edited by bgc1954 (2022-01-29 17:54:30)


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

Offline

#110 2022-01-29 17:19:36

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

Re: Tabby: a tabbed-tiling wayland compositor

Sorry, I guess wallpaper does work after all.  I double checked my image and was certain it was a .png but it was still a .jpg but not working with transparency on alacritty..  I think they've been having problems with that but I'll read further.  Now my wallpaper has black bars on top and bottom and the .png file is scaled exactly to my 4:3 monitor so tabby is scaling it to something else.

Also the top bar was going wonky and clicking on it was giving me a bunch of >> with no titles so I reverted back to the date only right status thinking my script was causing some issue, but something strange is still happening.  I'll keep an eye on it and see if it keeps going nuts.

Edit: top bar seems to be fine even with right status script so not sure what happened there.

Last edited by bgc1954 (2022-01-29 17:49:36)


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

Offline

#111 2022-01-29 19:19:32

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

Re: Tabby: a tabbed-tiling wayland compositor

The wallpaper scaling does definitely need testing and likely some patching.  I threw that together *very* quickly just to get something functional while I focused on the actual setting / rendering of the wallpaper (which is rather involved).  For scaling / positioning this is exactly what is done:

double sx = geom->width / png_w;
double sy = geom->height / png_h;
double scale = sx < sy ? sx : sy;
cairo_scale(wall_ctx, scale, scale);
cairo_set_source_surface(wall_ctx, png, (geom->width / scale - png_w)/2.0, (geom->height / scale - png_h)/2.0);

Here "geom" is a pointer to a struct of the monitor's size/position and png_w/png_h are width and height of the image as reported by cairo.  The intent is for 'scale' to be the scale factor which will maintain the aspect ratio but scale the image so the larger of it's dimensions fits the screen (scale to fit), then the position of the other dimension is calculated off of this.  If the aspect ratio of the image really is identical to that of the screen, then sx should equal sy resulting in the position calculation to offset to 0, 0.

Can you check the screen size reported by the output from tabby/wlroots and report those dimensions along with the image size.  For example, run tabby with stdout/stderr redirected to a log file, e.g.:

tabby >| /tmp/tabby.log 2>&1

Then once running, check the output size being used for the monitor.  The following should be simplest:

grep '(preferred)' /tmp/tabby.log

Then use imagemagic or a related tool to get the image information:

identify /path/to/wallpaper.png

Last edited by Trilby (2022-01-29 19:23:27)


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

Offline

#112 2022-01-29 22:09:50

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

Re: Tabby: a tabbed-tiling wayland compositor

Sorry,, it was all me! PEBKAC.  Using your info I found that the image actually was only 1280x800 so of course it didn't display properly on my 1280x1024 (preferred) display.  My problem is I have too many computers with different size monitors so not quite sure where this one originally came from but feh scales it properly in openbox so didn't think it was the image.  I should check these things before I waste your time.

Any ideas on the right status script problem on my post before the last one?


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

Offline

#113 2022-01-29 22:38:00

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

Re: Tabby: a tabbed-tiling wayland compositor

Oh, sorry, I missed that post.  The addition was in the wrong place in your script.  That line buffering needs to be on the outter loop - in your script it'd be after the second "done".  As an aside, I think that inner loop could be replaced by a single sed:

sed -n 's/...$/°/;H;${x;s/^\n//;s/\n/ /g;p}' /sys/class/hwmon/hwmon*/temp1_input

EDIT: scratch that, sed will not work there as it doesn't do the addition of 40.  But what is the purpose of that?  That's certainly not a conversion to fahrenheit.  If you are intending to have degrees F, awk could do that:

awk '{printf "%d° ", $1 * .0018 + 32}' /sys/class/hwmon/hwmon*/temp1_input

Last edited by Trilby (2022-01-29 22:45:50)


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

Offline

#114 2022-01-30 01:44:31

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

Re: Tabby: a tabbed-tiling wayland compositor

Thanks, the awk line works and even shows the degree symbol.  That's great, but it displays properly only the first time until after the sleep and then it redraws all messed up with the temp, then just the tail end of uptime, then tail end of date and then in another font color the uptime display and temp which don't change.

I just found something strange which maybe has nothing to do with it.  I was messing around with the status script and thought I'd try taking out the sleep and it's like there is a right status area and then it's trying to write in front of it as it was flashing continuously with no sleep defined.  For some reason I clicked on the right status area and I'm getting a new window with alacritty and it's like there are two instances of the status bar area.  I don't know if that makes any sense but that's what I'm getting.


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

Offline

#115 2022-01-30 02:21:01

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

Re: Tabby: a tabbed-tiling wayland compositor

Well don't take the sleep out of the script.  Without it you'll just eat CPU cycles and the status display will be continuously redrawing which I'd not expect to be good.  As for launching alacritty, if you just used the default config, that's the expected behavior for clicking in the right-side status region.  For the script with the sleep, can you post what you are actually using now?

Last edited by Trilby (2022-01-30 02:21:35)


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

Offline

#116 2022-01-30 14:51:37

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

Re: Tabby: a tabbed-tiling wayland compositor

This is what is currently running:

!/bin/sh

while :; do

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

printf '%s ' "Up:$(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))
awk '{printf "%d° ", $1 * .0018 + 32}' /sys/class/hwmon/hwmon*/temp1_input

sleep 10

done

while read line; do printf "$line"; done

And they say a picture is worth a thousand words: screenshot.png

And I did notice after I posted the mouse behavior in tabby config but it says right click and it's actually the left, I believe.

Edit: trying to figure out postimage site

Last edited by bgc1954 (2022-01-30 15:01:28)


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

Offline

#117 2022-01-30 15:11:15

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

Re: Tabby: a tabbed-tiling wayland compositor

That second while loop in your script never runs - you need to pipe the first into the second to get it to buffer the output edit: removed faulty example

And the config doesn't say "right" click, that indicates the status region on the right with button number 1.

Last edited by Trilby (2022-01-31 01:13:00)


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

Offline

#118 2022-01-30 15:16:13

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

Re: Tabby: a tabbed-tiling wayland compositor

Ok, what do I know about your config file.  Thanks for your patience.  I said my bash was horrible.  And about the temp formula, that was something I stuck together by reading the temp in my motherboard readout and making a formula that spit out the same number.  Crude but it worked for years.

edit: that doesn't work as I just get a blank region on the right now.  And then this happened: screenshot2.png

Last edited by bgc1954 (2022-01-30 15:32:46)


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

Offline

#119 2022-01-31 01:15:01

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

Re: Tabby: a tabbed-tiling wayland compositor

Sorry, it turns out my attempt at line buffering the script output doesn't really do what I hoped.  In any case, tabby will display what it is sent as it is sent.  I'm not sure my approaches to your script have been that useful, but perhaps this will work, just using a single print command so all content comes out at the same time:

#!/bin/sh

while :; do

printf '  %s Up:%s %s' \
	"$(date "+{fg=7}%b %d %l:%M%P {fg=4}")" \
	"$(uptime | sed -n 's/.*up \([^,]*\).*/\1/p')" \
	"$(awk '{printf "%d° ", $1 * .0018 + 32}' /sys/class/hwmon/hwmon*/temp1_input)"

sleep 10

done

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

Offline

#120 2022-01-31 16:39:33

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

Re: Tabby: a tabbed-tiling wayland compositor

Thanks, that works perfectly.

Edit:  Just wondering if Tabby has anything that is preventing alacritty terminal from being transparent.  Seems from some of the reading I've done, it works in sway on Arch but doesn't always work for others mostly in X running a compositor.  This wayland is a tricky beast.

Last edited by bgc1954 (2022-01-31 17:15:57)


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

Offline

#121 2022-01-31 17:32:54

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

Re: Tabby: a tabbed-tiling wayland compositor

Nope.  I use alacritty with transparency with no issues.  Alacritty recently changed how it's opacity is set from a global "background_opacity" setting to having "opacity" under the "window" category.  But if you are still using the old setting method, it would give a big warning about it each time a terminal opens.  Can you post / link-to your alacritty config?


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

Offline

#122 2022-01-31 18:01:11

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

Re: Tabby: a tabbed-tiling wayland compositor

I’ll save you the trouble of looking through the whole thing as all I did was uncomment the opacity setting and set it to 0.5. Is there another setting I need to uncomment in ~/.config/alacritty/alacritty.yml?  And I did update to the new alacritty.yml.


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

Offline

#123 2022-01-31 21:38:22

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

Re: Tabby: a tabbed-tiling wayland compositor

Ah ... the context is important.  If you really only uncommented the one line specifying opacity, that would explains why it would fail as the "window" block is commented out in the default config.


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

Offline

#124 2022-02-01 01:23:23

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

Re: Tabby: a tabbed-tiling wayland compositor

Wow, what a difference one line makes.. All works now and I see the logic in what I missed.  Maybe you can teach an old dog new tricks. smile

edit:  Funny how all the articles I read online never mentioned anything about having to uncomment that line.  Must assume everyone just knows these kinds of things.

Last edited by bgc1954 (2022-02-01 16:40:51)


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

Offline

#125 2022-02-12 15:10:46

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

Re: Tabby: a tabbed-tiling wayland compositor

Wondering if you'd consider adding an option for the status bar to be on the bottom of the screen?  I believe I asked for this in Alopex as it is just a personal preference.

Also, just a trivial mention as I downloaded the tarball for tabby-fossil the other day as I saw it was a 1.4.etc version and my status bar said Tabby 1.3 so I thought you had updated the package.  But no, when I built it, it said reinstalling 1.4.etc so I looked in the config file and the title line was still Tabby 1.3 so I changed it and all is well, in my mind at least.

Trying out wayland compatible browsers and on my system, at least, epiphany is much zippier than firefox.  Wonder why (retorical question) smile


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

Offline

Board footer

Powered by FluxBB