Skip to main content
Topic: xeyes auto-started after desktop? (Read 934 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

xeyes auto-started after desktop?


I want to run a script that starts 2 instances of xeyes (placed on top of two deskbar panels) after (Plasma) desktop start. Putting the commands into /.profile doesn't do it (using OpenRC)

Code: [Select]
xeyes -geometry 60x60+15+400
xeyes -geometry 60x60+1840+340

It's the finishing touch I need for my first Artix Desktop

NB. if there's a plasma xeyes widget I'd be happy to try it but I do like xeyes' flexibility

TIA

Who, has loved us more?

Re: xeyes auto-started after desktop?

Reply #1
Doesn't KDE have a built-in autostart application that allows you to launch whatever you want when it is launched?

Re: xeyes auto-started after desktop?

Reply #2
Doesn't KDE have a built-in autostart application that allows you to launch whatever you want when it is launched?

If the deskbars are set to 'windows can cover' then doing it manually puts eyes on the panels. I don't know how to include both commands in one script but with two scrips I also manage to place eyes on each panel one at a time. If I include them in kde-autostart then they go under the panels.

Edit: With the panels set to be 'coverable by windows' the eyes go on top but only UNTIL I click on or into a panel, when they go under. So I included a 1m delay in both scripts which gave me enough time to launch xfce4-screenshooter before the scripts parked the eyes.  It's called cheating  (I had not read strajder's reply yet) :-)

 https://imgur.com/typQarw.png
Who, has loved us more?

Re: xeyes auto-started after desktop?

Reply #3
Since this is one of the original X apps, hardly anyone even remembers it anymore, so most of the things from KDE store about it are at least a decade old:

https://store.kde.org/p/999048/
https://store.kde.org/p/1103556/
https://store.kde.org/p/1298128/

I remember using an xeyes-inspired applet in KDE some 20 years ago. Not sure if it has maybe evolved into one of those.

It is unknown to me if there is a way to launch programs when Plasma has finished loading, but you could create a script which would activate it after a set number of seconds (not reliable with regards to if plasma has finished loading, but the best possible solution I know of).
Code: [Select]
#!/bin/sh
sleep 10             # in seconds; adjust as needed
wmctrl -a xeyes      # pacman -S wmctrl
This will, however, activate only the first instance.

Edit: You could instead use the following script, which will raise all windows having the string "xeyes" in their title:
Code: [Select]
#!/bin/sh
sleep 10
for id in $(wmctrl -l | grep xeyes | cut -d' ' -f1); do
    wmctrl -i -a "${id}"
done

Edit 2: If you are starting xeyes (or any X app) from a script, you need to send it to background using &:
Code: [Select]
xeyes -geometry 60x60+15+400 &
xeyes -geometry 60x60+1840+340 &
otherwise each call of xeyes will block the script until that instance is terminated.

Re: xeyes auto-started after desktop?

Reply #4
Since this is one of the original X apps, hardly anyone even remembers it anymore, so most of the things from KDE store about it are at least a decade old:
.....
Edit 2: If you are starting xeyes (or any X app) from a script, you need to send it to background using &:
Code: [Select]
xeyes -geometry 60x60+15+400 &
xeyes -geometry 60x60+1840+340 &
otherwise each call of xeyes will block the script until that instance is terminated.


Some of the best KDE features have gone into oblivion
- mouse-trails
- the ancestors of Quick-Access (ranted over that on the Devuan forum)
- xeyes
- much wider panel control

I tried some of your ideas with more or less success, putting everything into one script it now looks like this:

Code: [Select]
#!/bin/bash
sleep 10s
xeyes -geometry 65x65+20+374 &
xeyes -geometry 65x65+1830+388 &
sleep 30s
for id in $(wmctrl -l | grep xeyes | cut -d' ' -f1); do
    wmctrl -i -a "${id}"
done

with the last loop not seeming to do anything. 

So I set out to use more short panels with a blacked-out gap in between for the eyes but couldn't for the life of me find the length handles (yet another KDE feature gone?).

A light theme allowed some translucency, not very proud of the looks but here it is:

https://imgur.com/Ja40733.png

Who, has loved us more?

 

Re: xeyes auto-started after desktop?

Reply #5
with the last loop not seeming to do anything. 
What it should do is raise the windows with the text "xeyes" in their window title. This doesn't make them "on top", just raises them, as when they are activated/focused. If you click on some other window which would cover them, it will do so.

To have xeyes "on top", you can instead do:
Code: [Select]
#!/bin/sh
sleep 10
xeyes -geometry 65x65+20+374 &
xeyes -geometry 65x65+1830+388 &
sleep 30
for id in $(wmctrl -l | grep xeyes | cut -d' ' -f1); do
    wmctrl -r -i "${id}" -b add,above
done

Re: xeyes auto-started after desktop?

Reply #6
What it should do is raise the windows with the text "xeyes" in their window title. This doesn't make them "on top", just raises them, as when they are activated/focused. If you click on some other window which would cover them, it will do so.

To have xeyes "on top", you can instead do:
Code: [Select]
#!/bin/sh
sleep 10
xeyes -geometry 65x65+20+374 &
xeyes -geometry 65x65+1830+388 &
sleep 30
for id in $(wmctrl -l | grep xeyes | cut -d' ' -f1); do
    wmctrl -r -i "${id}" -b add,above
done

No change, today was Artix-day, back at it in a week or less. The trap is that one HAS to click the panels regularly  :-)

....for now I (FINALLY!) found them freakin' plasma panel handles and have explored the broken-panels idea w. slightly extruding eyes

https://imgur.com/ElyH9Yf.png





 
Who, has loved us more?

Re: xeyes auto-started after desktop?

Reply #7
No change, today was Artix-day, back at it in a week or less.
It works, but you need to have the package wmctrl installed (as I've written in the comment). You can also get rid of executing sleep altogether now, since the windows will be made "on top".