Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CHALLENGE: Find a Way to Activate a Window
#5
The "wmctrl" might work only for XFCE. Right now I'm on EndeavourOS with that D.E. and had to install "wmctrl", so not everybody will have it on their Linux system. The good news is that it works but the commands are very specific. Basically give the window a title that could be easily captured and told apart from any other window. Then a few things could be done like:

Code: (Select All)
Force-close:
wmctrl -F -c weakwack

Minimize:
wmctrl -F -c weakwack -b add,hidden

Restore:
wmctrl -F -c weakwack -b remove,hidden

In these examples, "weakwack" (without double-quotation marks) is the title of the window. The "-ia" or anything involving "-i" just didn't work for me, the stupid program doesn't read hexadecimal numbers properly.

https://en.wikipedia.org/wiki/Wmctrl

Sadly otherwise it seems that only window managers are supported. If it exists it would have to be found eg. for KDE Plasma. The "compiz" is in some installations with MATE, especially Fedora. "OpenBox" is a window manager which looks very much like XFCE but was clunky for me to work with. Some distros have it like Porteus and Slackel (both based on Slackware).

EDIT: It might matter if the user enables composition or not for XFCE or for "compiz". I have it disabled on my installtion of EndeavourOS but it worked nevertheless. I would have to switch to my other computer with Fedora 37 MATE to test the other one.

https://linux.die.net/man/1/wmctrl

The following also needs to be installed and there's no guarantee for which D.E. it could work on:

https://github.com/jordansissel/xdotool
Reply


Messages In This Thread
RE: CHALLENGE: Find a Way to Activate a Window - by mnrvovrfc - 12-09-2022, 11:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Feature Request: Limit Scope of a "Find" and "Change" hanness 5 725 06-21-2025, 11:21 PM
Last Post: SMcNeill
  personal coding challenge results James D Jarvis 4 627 06-20-2025, 03:20 PM
Last Post: James D Jarvis
  calculating ratios to find optimal grid layout madscijr 16 2,626 02-21-2025, 10:24 PM
Last Post: madscijr
  QB64PE programming challenge? auto-convert image to photoreal etch-a-sketch drawing madscijr 9 1,883 02-14-2025, 05:49 PM
Last Post: madscijr
  Steve's Programming Challenge: Weights and Measures SMcNeill 23 3,998 08-16-2024, 08:49 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 3 Guest(s)