sagb / alttab Goto Github PK
View Code? Open in Web Editor NEWThe task switcher for minimalistic window managers or standalone X11 session
License: GNU General Public License v3.0
The task switcher for minimalistic window managers or standalone X11 session
License: GNU General Public License v3.0
This tool would be much more useful if it allowed access to windows on other workspaces, not just the one you're already on.
alttab.c
In Metacity (recognized as EWMH-compatible) alttab's UI is hidden behind all windows,
shown only on unobstructed desktop.
Surprisingly, alttab works from inside xpra (proxy for attaching to X windows remotely, like GNU screen):
DISPLAY=:20 alttab
(assuming xpra owns display :20).
Xpra appears to set its own properties on windows and is detected as EWMH, even if neither local nor remote WM are EWMH.
The issues are:
Use full windows as icons? https://www.talisman.org/~erlkonig/misc/x11-composite-tutorial/
Understand hints->icon_window. For xterm, it seems not usable.
win.c
Alttab seems to only change the MRU sort order when a new window is focused by Alttab.
$ alttab -d 1
Ideally, Alttab would listen for all window focusing events in the window manager, and change its sort order every time a window is focused by any means.
Centering and no-title hints don't work in awesome.
Enhances: x-window-manager or ratpoison|...
in next release
When switching to/from rdesktop window started with -K option, alttab "eats" or "adds" modifiers.
Particularly, Ctrl-Shift and Alt-Shift shortcuts stop working in RDP session, or sometimes it behaves like 'Alt' key has been stuck.
Current goal of master (release) branch: full desktops support.
Current strategies:
-1 desktop: switch to any desktop, including -1 (as for i3), except in cwm.
The following madness must be taken into account:
lwm (#40):
number of desktops: 1
current desktop: 0
window's desktop: _NET_WM_DESKTOP or _WIN_WORKSPACE aren't set.
cwm (#35):
number of desktops=10
active desktop=1
window's desktop=-1 (_NET_WM_DESKTOP(CARDINAL) = 4294967295)
group membership switched by ctrl-alt-g (man openbsd-cwm),
-1 means "isn't member of any group"
i3 (#45):
number of desktops: 1
current desktop: 0
normal window's desktop: 0
window on hidden desktop aka "scratchpad": -1 (_NET_WM_DESKTOP(CARDINAL) = 4294967295)
Unlike cwm, -1 does indeed mean something.
Also, scratchpad window has:
WM_STATE(WM_STATE):
window state: Withdrawn
A comment in wmctrl:
/* special desktop ID -1 means "all desktops", so we
have to convert the desktop value to signed long */
also see "sticky window" in man
-d 2 for "sticky windows always shown" or "-1 desktop always shown"?
When using jwm, the window is immediately moved from the center to the first unoccupied space in the upper left, picture attached. Additionally, there is no way to define custom behavior for alttab in the jwm configuration, because it selects based on values in WM_CLASS, which doesn't seem to exist here, as reported by xprop.
Otherwise, this is a very nice program, and a big improvement on jwm's stacking behavior!
WM should have:
Definite candidates for "enhances" tag are marked bold.
i3: tiling by default, no alt-tab included. include because of positive user experience (#45, #46, #51, #52).
xmonad: tiling by default, dwm-style alt-tab
openbox: stacking, good ("openbox-style") alt-tab
stumpwm: tiling
dwm: tiling, "dwm-style" alt-tab
jwm: stacking, dwm-style alt-tab
twm (#29)
evilwm: fullscreen, dwm-style alt-tab
ratpoison: fullscreen by default, no alt-tab (dwm-style easily added), also include because of -w 2
fluxbox: stacking, dwm-style alt-tab, startup nuance (#93)
icewm: stacking, openbox-style alt-tab
matchbox: fullscreen, no built-in alt-tab, ignores centering (#34)
xfwm4, metacity etc: stacking, our-style built-in alt-tab (#24, #26, #27, #28)
enlightenment: stacking, openbox-style alt-tab
blackbox: stacking, no built-in alt-tab
window maker: stacking, our-style alt-tab
flwm: stacking, openbox-style alt-tab, ignores centering (#34).
cwm: stacking, dwm-like alt-tab, bug (#35)
wm2: stacking, no alt-tab
aewm: stacking, no alt-tab
fvwm: stacking, openbox-style alt-tab, ignores no-title hints
ctwm: stacking, no alt-tab, bug (#39)
lwm: stacking, no alt-tab, bug (#40)
sawfish: stacking, dwm-style alt-tab
awesome: stacking, no alt-tab, bug (#41), openbox-style alt-tab with plugin, our-style with this
I have two monitors connected to my desktop. When I invoke Alttab, the switcher window appears right in the middle of the two, half on one and half on the other.
Also, two "windows manager" items included in the list
Especially when I have ~40 windows going, it would be a nice feature to be able to raise the switcher by hitting Alt-tab with my left hand, and then click on the correct option with the mouse in my right hand.
alttab shows nothing in ctwm (EWMH detected).
Some ewmh_ functions use ICCCM fallback, but detection code (EWMH/non-EWMH) prevents them from running.
I'm trying to build this on OpenBSD 6.2-current, but I can't figure out where wordexp.h should come from. What package should I install?
job@victoria:~/source/alttab$ make
make all-recursive
Making all in src
depbase=`echo alttab.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/X11R6/include -I/usr/local/include/libpng16 -Wall -g -O2 -MT alttab.o -MD -MP -MF $depbase.Tpo -c -o alttab.o alttab.c && mv -f $depbase.Tpo $depbase.Po
In file included from alttab.h:62,
from alttab.c:29:
icon.h:36:21: error: wordexp.h: No such file or directory
*** Error 1 in src (Makefile:362 'alttab.o')
*** Error 1 in . (Makefile:386 'all-recursive')
*** Error 1 in /home/job/source/alttab (Makefile:302 'all')
job@victoria:~/source/alttab$
In xfce, focus isn't switched when switched from gtk apps to xterm
Can't switch from transmission-remote-gtk or zenity window sometimes, because of lost Alt release event.
matchbox has empty _NET_CURRENT_DESKTOP (?)
wmctrl -b skip_pager,skip_taskbar
Also, spits xlib's "BadWindow" etc instead of useful messages/actions
alttab.c
Watch for Alpine Linux package submitted to aports/testing.
When/if it will be moved to aports/main or aports/community, mention this in documentation.
https://forum.alpinelinux.org/forum/general-discussion/alpine-linux-desktop-environment#comment-1130
(xcalc)
gui.c
After focusing a window belonging to the group (desktop) other than current group, pressing alt-tab causes segfault.
WM: ratpoison
Command that changes focus to window on another desktop, without switching to that desktop: firefox-esr -new-tab ...
Program received signal SIGSEGV, Segmentation fault.
0xb7e651f9 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
(gdb) bt
#0 0xb7e651f9 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
#1 0xb7e618c5 in XftTextExtentsUtf8 () from /usr/lib/i386-linux-gnu/libXft.so.2
#2 0x0804cc8f in drawMultiLine (dpy=0x10, dpy@entry=0x8054008, d=119, d@entry=12582929,
font=0xbfffd4fc, font@entry=0x10, xftcolor=0x8053ab0 <g+4208>,
str=0x8070cd0 "ws rel", x1=0, y1=5, width=109, height=4294967291) at util.c:313
#3 0x0804d6b5 in drawMultiLine (dpy=0x8054008, d=12582929, font=0x10,
xftcolor=0x8053ab0 <g+4208>, str=0x8070cd0 "ws rel", x1=0, y1=5, width=109,
height=4294967291) at util.c:307
#4 0x0804b0fb in uiShow (dpy=0x8054008, root=627, direction=false) at gui.c:315
#5 0x08049a27 in main (argc=1, argv=0xbfffefc4) at alttab.c:299
Incorrect EWMH support:
number of desktops: 1
current desktop: 0
window's desktop: _NET_WM_DESKTOP or _WIN_WORKSPACE aren't set.
If there is a single window or no windows at all, frame is drawn around wrong tile.
yesterday regression?
AfterStep reports EWMH properties but fails to maintain correct window list.
The best option is setting -w 3
manually, but too bad anyway.
alttab should look for specific EWMH hints for auxiliary windows in heavy WMs like metacity.
Probably a regression from 9736a3a
Most Recently Used (MRU) ordering criticized: http://www.azarask.in/blog/post/solving-the-alt-tab-problem/
But some professionals seem to object to that critic: https://news.ycombinator.com/item?id=1315942
"At the same time as the switcher program is trying to learn the user's common patterns, the user is also trying to learn how the switcher works."
Someone "suggest having new alternative to Alt-Tab that has static positions (reorderable for the power user.)"
Request for static order: https://ubuntuforums.org/showthread.php?t=1204947
Request for grouping: https://unix.stackexchange.com/questions/330656/application-window-switcher-on-xubuntu-xfce-group-windows-by-application
Request for switching without raising (should be easy): https://unix.stackexchange.com/questions/237087/keyboard-shortcut-to-switch-focus-without-raising-window
Request for partially hidden list: https://unix.stackexchange.com/questions/213854/how-to-hide-a-window-from-alttab-in-cinnamon/226422
Should alttab
implement some crafty ordering of windows as an option?
cwm reports via ewmh:
number of desktops=10
active desktop=1
window's desktop=-1 (_NET_WM_DESKTOP(CARDINAL) = 4294967295)
Together with or instead of X resources?
Behaviour is not actually "microsoft", as readme says. The order of windows is always the same, regardless of last choice. Instead, it should pull selected window to the top, isn't it?
no WM hints ()
can't find WM_CLASS for ""
in evilwm, xterm mini-window has empty icon (just a frame). not very annoying, but why?
evilwm grabs alt-tab
i3 doesn't grab
twm
doesn't grab
WM_TWM
dwm
grabs
unknowm_ewmh_compatible
When a window is on a scratchpad in i3, it appears in the Alttab list, but selecting it gives the error "Unexpected X Error: BadMatch (invalid parameter attributes)".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.