sfwbar
sfwbar copied to clipboard
Firefox moves on the taskbar when I switch between (some) tabs
Firefox moves on the taskbar when I switch between (some) tabs. I haven't figured out what exactly causes this behavior. Not all tabs behave this way. Waybar works fine.
Video demonstration:
https://user-images.githubusercontent.com/21033483/187670705-180ac404-06cb-4ad6-9ed3-60590afe7b7f.mp4
sfwbar on top, then waybar.
Program version:
- sfwbar 1.0_beta8 [apk link]
- sfwbar [commit 423e4aad6aeeb3f44ba56616ebef42689664d856]
System information:
OS: Alpine Linux v3.16 x86_64
Kernel: 5.15.63-0-lts
libc: musl
Shell: ash
WM: sway
P.S. Don't pay attention to the inconsistent design, I'm just experimenting with different programs around Wayland for now.
This is because the taskbar items are sorted by window title. Firefox changes the title when you switch tabs, so the taskbar gets reordered to reflect the new title. It would be fairly easy to add a config option to sort taskbar items by app_id or by sequence in which windows were open. Let me know if this would be useful and I'll code it up.
Somewhat unrelated, the firefox icon seems to be missing, which is why you're getting that ugly icon in your taskbar. You can check the icon it's trying to load by running "sfwbar -d -g image" (this will dump a list of all the images the program is attempting to load).
Thank you for the clarification.
It would be fairly easy to add a config option to sort taskbar items by app_id or by sequence in which windows were open. Let me know if this would be useful and I'll code it up.
It would be a useful addition. There is no rush, however. I don't use Wayland regularly, just randomly testing some programs from the list.
Somewhat unrelated, the firefox icon seems to be missing, which is why you're getting that ugly icon in your taskbar.
Yeah. Firefox (icon) works correctly when I add it via button. But the taskbar always shows a placeholder icon for me.
Button example
button {
value = "firefox"
action = "firefox"
action[3] = "firefox --private-window"
css = "* { min-height: 24px; min-width: 24px; }"
}
The same result for the standard theme (I've moved user config ~/.config/sfwbar to make sure it's not my fault).
sfwbar -d -g image
18:34:26.92 image: firefox @ 0
18:34:26.93 image: Alacritty @ 0
18:34:26.93 image: icons/misc/unlock.svg @ 0
18:34:26.94 image: icons/misc/rewind.svg @ 0
18:34:26.94 image: icons/misc/play.svg @ 0
18:34:26.94 image: icons/misc/stop.svg @ 0
18:34:26.94 image: icons/misc/fforward.svg @ 0
18:34:26.94 image: icons/misc/cpu.svg @ 0
18:34:26.95 image: icons/misc/lan.svg @ 0
18:34:26.95 image: icons/misc/comp.svg @ 0
18:34:26.95 image: icons/misc/fan.svg @ 0
18:34:26.95 image: icons/weather/.svg @ 0
18:34:26.96 image: icons/weather/.svg @ 0
18:34:26.96 image: icons/misc/fan.svg @ 0
18:34:26.97 image: icons/misc/comp.svg @ 0
18:34:26.97 image: icons/misc/lan.svg @ 0
18:34:26.97 image: icons/misc/cpu.svg @ 0
18:34:26.97 image: icons/misc/unlock.svg @ 0
18:34:26.97 image: Alacritty @ 0
18:34:26.97 image: firefox @ 0
18:34:26.97 image: icons/misc/lock.svg @ 0
18:34:26.98 image: firefox @ 0
18:34:26.98 image: Alacritty @ 0
18:34:26.98 image: icons/misc/lock.svg @ 0
18:34:26.98 image: icons/misc/fan.svg @ 0
18:34:26.98 image: icons/misc/comp.svg @ 0
18:34:26.98 image: icons/misc/lan.svg @ 0
18:34:26.99 image: icons/misc/cpu.svg @ 0
18:34:26.99 image: icons/weather/.svg @ 0
18:34:27.00 image: firefox @ 0
18:34:27.00 image: Alacritty @ 0
18:34:27.00 image: icons/misc/lock.svg @ 0
18:34:27.00 image: icons/misc/lock.svg @ 0
18:34:27.00 image: icons/misc/cpu.svg @ 0
18:34:27.00 image: icons/misc/lan.svg @ 0
18:34:27.00 image: icons/misc/comp.svg @ 0
18:34:27.00 image: icons/misc/fan.svg @ 0
18:34:27.00 image: icons/misc/cpu.svg @ 0
18:34:27.00 image: icons/misc/cpu.svg @ 19
18:34:27.00 image: icons/misc/lan.svg @ 0
18:34:27.00 image: icons/misc/lan.svg @ 19
18:34:27.00 image: icons/misc/comp.svg @ 0
18:34:27.00 image: icons/misc/comp.svg @ 19
18:34:27.00 image: icons/misc/fan.svg @ 0
18:34:27.00 image: icons/misc/fan.svg @ 19
18:34:27.01 image: icons/weather/.svg @ 0
18:34:27.01 image: icons/weather/.svg @ 0
18:34:27.01 image: icons/weather/.svg @ 49
18:34:27.01 image: icons/misc/fan.svg @ 19
18:34:27.02 image: icons/misc/comp.svg @ 19
18:34:27.02 image: icons/misc/lan.svg @ 19
18:34:27.02 image: icons/misc/cpu.svg @ 19
18:34:27.02 image: icons/misc/lock.svg @ 16
18:34:27.02 image: Alacritty @ 48
18:34:27.02 image: firefox @ 48
18:34:27.07 image: firefox-default @ 0
18:34:27.07 image: foot @ 0
18:34:27.07 image: lite-xl @ 0
18:34:27.07 image: firefox-default @ 16
18:34:27.07 image: foot @ 16
18:34:27.08 image: lite-xl @ 16
18:34:27.08 image: lite-xl @ 16
18:34:27.08 image: foot @ 16
18:34:27.08 image: firefox-default @ 16
This is because the taskbar items are sorted by window title
Just my personal opinion, I would expect a panel to not sort the items at all and just add new ones to the right. Having the possibility to reorder the items by drag and drop would be a bonus.
This was a quick change, so I added a sorting option in the latest git version. You can now add
sort = seq
to keep the windows in the bar in order they appeared in (you can use Title or AppId as other sort options).
@Consolatis - Seq will get you the basic behavior you'd like. I'll need to look into implementing drag and drop.
Thank you. After a brief test with https://github.com/LBCrion/sfwbar/commit/c486b06d5dade0aa7f135f51577ad1fea072b300 build, everything works as expected. I'm closing the issue.
Good to hear it works.
For the firefox icon issue, it looks like your build of firefox sets app_id to firefox-default. The easiest way to get an icon would be to symlink firefox.svg icon to ~/.config/sfwbar/firefox-default.svg
Reordering of windows via drag and drop in sort = seq mode should now work as well.
Reordering of windows via drag and drop in sort = seq mode should now work as well.
Great stuff, seems to work fine :)
Small remark about the DnD feature:
It seems the item is always moved to the left of the drop target, I think it would be nice if it could be moved to the right of the drop target if released on x > dnd_target_width / 2. This also makes it possible to move an item to the end of the list (right now its impossible unless working around it by moving the last item to the left instead).
I've been thinking of the best approach to something like this. Using left vs right half of the destination widget would work well visually for a single row horizontal taskbar, but would be odd for a vertical taskbar. And a visually consistent approach for multi row or multi column taskbars is even harder.
Perhaps as a first try, I can use the left/right side for single and multi row bars and top/bottom split for single and multi column bars.
On Sat, 3 Sept 2022, 01:44 Consolatis, @.***> wrote:
Small remark about the DnD feature:
It seems the item is always moved to the left of the drop target, I think it would be nice if it could be moved to the right of the drop target if released on x > dnd_target_width / 2. This also makes it possible to move an item to the end of the list (right now its impossible unless working around it by moving the last item to the left instead).
— Reply to this email directly, view it on GitHub https://github.com/LBCrion/sfwbar/issues/38#issuecomment-1236005562, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHPFFFW2GUNGUKZUTMQGJDV4KNPDANCNFSM6AAAAAAQBJR2M4 . You are receiving this because you commented.Message ID: @.***>
I implemented the behaviour described above, try it and see if it works as you would expect.
On Sat, 3 Sept 2022, 07:09 Lev Babiev, @.***> wrote:
I've been thinking of the best approach to something like this. Using left vs right half of the destination widget would work well visually for a single row horizontal taskbar, but would be odd for a vertical taskbar. And a visually consistent approach for multi row or multi column taskbars is even harder.
Perhaps as a first try, I can use the left/right side for single and multi row bars and top/bottom split for single and multi column bars.
On Sat, 3 Sept 2022, 01:44 Consolatis, @.***> wrote:
Small remark about the DnD feature:
It seems the item is always moved to the left of the drop target, I think it would be nice if it could be moved to the right of the drop target if released on x > dnd_target_width / 2. This also makes it possible to move an item to the end of the list (right now its impossible unless working around it by moving the last item to the left instead).
— Reply to this email directly, view it on GitHub https://github.com/LBCrion/sfwbar/issues/38#issuecomment-1236005562, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHPFFFW2GUNGUKZUTMQGJDV4KNPDANCNFSM6AAAAAAQBJR2M4 . You are receiving this because you commented.Message ID: @.***>
After some thinking, I changed the sort option to a boolean. The config line will now be 'sort = false' instead of 'sort = seq'. Apologies for breaking everyone's configs, but I want to expand this functionality to other grids (at least a tray) and boolean option will be more consistent across different grids.
Tested with a single row horizontal taskbar and it feels very intuitive to me.
I want to expand this functionality to other grids (at least a tray)
Was about to mention that. The question that arises for the tray is if you want to somehow persist the new sorting which could potentially open up a whole new can of worms.
Edit: launchers would also be a potential target.
Good to hear it works.
For the firefox icon issue, it looks like your build of firefox sets app_id to firefox-default. The easiest way to get an icon would be to symlink firefox.svg icon to ~/.config/sfwbar/firefox-default.svg
Ha, I just upgraded my base to slackware-current and I get this 'feature' too.
Edit: (@Consolatis ) launchers would also be a potential target.
Indeed.
Persistent tray ordering is a hard one. The main issue I see is maintaining the order of tray items while the list is incomplete. I.e. user manually sorts 4 items, then, while one of the item isn't present, the user changes the order of the remaining 3. Where should the missing item go when it comes back? We can try to maintain a list of precedents (i.e. item1 goes after item2 and item3. item4 goes after item1 and item2), but even with this approach and items missing from time to time, we can end up with contradictions.
Sorting launchers would require implementing a concept of a launcher and a launcher tray first. Currently any widget can be a launcher and they can be located anywhere within the layout. Implementing drag and drop for all widgets would lead to full visual layout configuration (something I rather hope to avoid).
Implementing a launcher tray which can contain some launchers, which user can re-order via drag and drop is possible. It's even possible to then save the order of these into a state file and restore this state upon restart. This will, however, result in a bit of a piecemeal configuration approach (mostly via config file, with some parts supporting visual configuration).