1

I have created a Pomodoro Timer which runs in a seperate terminal window. I want this timer to always remain on top of other windows.

While searching for an answer, I found this: How can I keep Terminal always on top of other windows?.

But, this would mean that whenever I run my script, I'll have to manually right click the title bar and select "Always on top".

I was wondering if there is a temporary terminal command for that (which I can add to my code), so that it can keep the particular terminal window on top. (and the setting resets on closing the terminal, i.e. it is not permanent.)

11
  • wmctrl -i -r <window id> -b add,above or wmctrl -r "window name" -b add,above
    – kenn
    May 31, 2020 at 13:19
  • How to get the Window ID, I have seen xwininfo -display :0 but it requires the user to manually select the window. @kenn May 31, 2020 at 13:23
  • You can use window name in quotes as well.
    – kenn
    May 31, 2020 at 13:27
  • 1
    @aakash Ah, I see, I misunderstood the question.
    – pomsky
    May 31, 2020 at 13:44
  • 2
    This may help to give the terminal a unique name then raise it based on title: askubuntu.com/questions/516223/…
    – vanadium
    May 31, 2020 at 14:49

1 Answer 1

1

The answer is :

  1. Install wmctrl
  2. Open a terminal and type wmctrl -l. You will see a list of windows and processes.
  3. Type : wmctrl -i -r $windowId -b add,above (please replace $windowId by the window id of step 2)

Thanks to this question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.