Always on top linux

How to set a shortcut for «Always on Top» for window?

In 12.04 (Unity), I would like to assign a shortcut to the «always on top option» for a window. Probably something like Ctrl + Shift + Home to turn on and Ctrl + Shift + End to turn off, or whatever. Is there an option to do this somewhere in the Compiz Settings Manager? This (old) post claimed that

For compiz, Enable Extra WM Actions. Check the properties, and insert ALT + A to Key field for Toggle Always-On-Top action.

7 Answers 7

It should work on every Ubuntu OS since version 9.04 without installing anything, modifying of creating any shortcuts.

  • Alt + Space as the first shortcut brings up the right-click mouse menu
  • T selects the «Always On Top» function.

Confirmed working on Unity 14.04. The fact that alt+space activates a pull-down menu helps especially for infrequently-used features.

This was posted 2 years after the question, but now represents the best answer, so I am changing the accepted answer.

Since no one has mentioned this yet, I’ll just leave a solution that worked for me on Ubuntu 12.04.

You could setup a regular keyboard shortcut and use wmctrl to toggle the «Always on Top» option.

Go to System Settings > Keyboard > Shortcuts > Custom Shortcuts. Hit the + and give your shortcut a name. Then enter the following command.

wmctrl -r :ACTIVE: -b toggle,above 

If you don’t have it already, you can install wmctrl from the repos using

sudo apt-get install wmctrl 

You should have something that looks similar to this.

Screenshot showing a custom keyboard shortcut setup screen

Hit apply and you should be good to go!

Unity instead of GNOME (Ubuntu before 17.04)

If not install CCSM and extra compiz plugins via:

sudo apt-get install compizconfig-settings-manager compiz-plugins-extra 

Be aware please. CCSM can kill Unity3D on some systems.

If you have not had compiz-plugins-extra already installed, you need to restart Compiz to load them (even though they display in CCSM just fine before the restart) with Alt + F2 and

You can see Extra WM Actions under Windows Management section on CCSM as explained in the post you found. You can set the desired action there easily.

Actually, restarting compiz is only needed so that it is aware of the new plugins. Afterwards, you can change the shortcuts on the fly (i.e. you do not need to restart Compiz after every change of a shortcut)

Thank you for the info @sup. I just explained it using the given post. Actually I did not tried it myself.

Читайте также:  How to close linux terminal

I tried to use the wmctrl command toggle, but it didn’t work on my Ubuntu set up. The toggle would toggle on, but not toggle off. (I think it might be because I’m using the gnome desktop environment, on which wmctrl is slightly broken AFAIK).

Anyway, after a lot of research and working out how to write proper code in bash, I created a single command that uses the wmctrl commands within a layer of logic to toggle the ‘always on top’ state effectively on the current GNOME desktop. I posted this answer on Ask Unix/Linux, but thought I’d post it here too in case anyone had the same issue.

bash -c 'wmctrl -r :ACTIVE: -b $([[ $(xprop -id $(xprop -root -f _NET_ACTIVE_WINDOW 0x " \$0\\n" _NET_ACTIVE_WINDOW | awk "") _NET_WM_STATE) =~ "ABOVE" ]] && echo "remove" || echo "add"),above' 

It checks the active window state property «_NET_WM_STATE» using xprops , and if it contains the text «ABOVE» that means the ‘always on top’ option is active. Then it just runs the wmctrl command with the parameter add or remove as appropriate.

Command breakdown (each command is inserted into the next, replacing the ■ placeholder):

 xprop -root -f _NET_ACTIVE_WINDOW 0x " \$0\\n" _NET_ACTIVE_WINDOW | awk "" 

This last step in particular took me a very long time to figure out. Until I realised that the keyboard shortcuts weren’t running in bash by default, I had no idea why the commands were working in the console as I was testing them but silently failing when run directly as a keyboard shortcut. It drove me up the wall for ages!

Note: because you need quotes around the command you’re sending to bash, I had to be careful when writing the command that I never went more than one more level deep (using double quotes). Any further nesting of strings in quotes would have required lots of confusing backslashes to escape the quotes.

Further detailed notes: how to create the keyboard shortcut (thanks @rajesh_chaurasiya)

  1. Install wmctrl using sudo apt-get install wmctrl if you haven’t already
  2. Go to system settings > keyboard shortcuts. Click the + button to add a custom shortcut.
  3. Choose a name such as ‘Toggle always on top’ ( it can be anything you like ).
  4. In the command field add the full command from the top of this answer.
  5. Record a keybinding to complete the shortcut.

Источник

Always on Top: An Often Ignored But Handy Feature in Linux Desktop

“Always on Top” is one of those features that people are either not aware of or they simply ignore it.

And this surprises me. Because for me, it is one of the features that I simply love to use on Linux desktop.

If you are not aware of it already, (almost) all applications have this “Always on Top” option. Usually, when you open a new application, it gets the focus and occupies the screen above all other running applications.

With the “Always on Top” option selected, the application window will always be visible, no matter what other application you open.

Set Always On Top Linux

Keep in mind that the position of the application is not fixed. You can move the application to any corner of the screen. It will remain visible on the top of all opened applications.

To disable the “Always on Top” mode, you have to select it one more time.

Disable Always On Top

Do note that you won’t see the “Always on Top” option if your application is in full-window mode.

Читайте также:  Creating image file in linux

I know switching between applications is a matter of Alt+Tab keys but when you have several applications running, switching apps will require more than two keystrokes.

This feature should be available in most desktop environments. If you don’t see it, please check which desktop environment you are using and let me know. I’ll update the article with the information.

Do you like the “Always on Top” feature

This is like the “Picture in Picture” feature that modern web browsers like Firefox are providing these days. Linux had it way before.

I know this is a tiny thing and perhaps did not warrant an entire article. But I also have a feeling that in the world full of Poirots, there will be some Hastings and for them, this will be a revelation.

So, are you Hercule Poirot (already using this feature) or Captain Hastings (didn’t know about it)? Or perhaps you are Chief Inspector Japp (knew about this feature but never bothered to use it).

I couldn’t help using Agatha Christie jargon. If you are not a fan, just ignore it 🙂

Источник

linux window always on top

In Linux you can easily set a particular window to be always on top of other windows by right-clicking on the title bar and selecting the “Always On Top” option. This is useful when you need to constantly refer to the information in a window.

How do I keep a window always on top Linux?

Using “Always on Top” feature in Linux

All you have to do is to right-click on the top bar of the application. In here, select the Always on Top option. That’s it.

How do you keep a window on top all the time?

Just press CTRL + SPACE on whatever window you want to stay on top.

How do I keep a window on top in Ubuntu?

Right-click on the title bar of the window and select “Always On Top”.

How do I close all windows in Linux?

If you have an application running, you can close the application window using the Ctrl+Q key combination. You can also use Ctrl+W for this purpose. Alt+F4 is more ‘universal’ shortcut for closing an application window. It not work on a few applications such as the default terminal in Ubuntu.

How do I stop Windows from minimizing?

Navigate to User Configuration > Administrative Templates > Desktop. On the right-side tab, right-click on “Turn off Aero Shake window minimizing mouse gesture,” then click Edit. Set it to Disabled, then press OK.

How do I lock a window on my screen?

  1. Press Ctrl, Alt and Del at the same time.
  2. Then, select Lock from the options that appear on the screen.

Top 20 Best Webscraping Tools

Crawler

Top 20 Best Webscraping ToolsContent grabber:Fminer:Webharvy:Apify:Common Crawl:Grabby io:Scrapinghub:ProWebScraper:What is the best scraping tool?Wha.

Bash builtin examples

Shell

What is a builtin bash?Is Echo a bash builtin?What commands are built into the bash shell?Is LS a shell builtin?What are bash commands?How do you do i.

The 6 Best Linux File Recovery Software

Recovery

Which Linux is best for data recovery?Which recovery software is best?How recover data from hard drive in Linux?How do I install Ubuntu recovery softw.

Latest news, practical advice, detailed reviews and guides. We have everything about the Linux operating system

Источник

How To Use A Keyboard Shortcut To Toggle Always On Top On GNOME, KDE, MATE, Xfce and Cinnamon Desktops

Always on Top option

This article shows how to use a keyboard shortcut to set a window to be always on top, on GNOME, MATE, Xfce, Cinnamon and KDE Plasma desktops, as well as a generic shortcut that works with any EWMH/NetWM compatible X Window Manager (so this generic solution doesn’t work on Wayland).

Читайте также:  Alt linux active directory

Set an Always on Top keyboard shortcut on GNOME desktop

GNOME doesn’t have a default keyboard shortcut for Always on Top any more (it used to have Alt + Space , then t ), but there is an option to set your own keyboard shortcut for this window feature. The option is not exposed in Settings — > Keyboard Shortcuts though.

To access the option that allows setting a keyboard shortcut for Always on Top, open Dconf Editor and go to /org/gnome/desktop/wm/keybindings . There, set a keyboard shortcut for always-on-top in this form (example): [‘1’] , [‘2’] , [‘a’] and so on, but obviously, set it to what you want to use for this. Disable the «Use default value» toggle to be able to enter a shortcut.

Set an Always on Top (Keep Above Others) keyboard shortcut on KDE Plasma

KDE Plasma has an option that you can use set a window Always on Top, called Keep Window Above.

To set a keyboard shortcut to toggle this Keep Window Above option on/off, go to System Settings -> Shortcuts -> Global Shortcuts , search for Keep Window Above , and then you’ll see an option to assign a keyboard shortcut to this option, like in the screenshot above.

Using the built-in keyboard shortcut to toggle Always on Top on MATE, Xfce and Cinnamon desktops

MATE, Xfce and Cinnamon desktops have a built-in keyboard shortcut to toggle the Always on Top window option.

On MATE and Cinnamon, focus a window, then press Alt + Space , then t to set a window to be always on top. Toggle it off using the same key combination. Cinnamon also offers the ability to set a custom shortcut for this: System Settings -> Keyboard -> Shortcuts -> Windows -> Toggle always on top .

For Xfce, toggle Always on Top using Alt + F12 . Or use the same Alt + Space , then t to enable Always on Top; however, to toggle it off, use Alt + Space , then o . Xfce offers the ability to change the key to toggle the window above option: Settings -> Window Manager -> Keyboard -> Toggle above .

Using a generic way of setting a window Always on Top (X only)

If the desktop environment you’re using doesn’t have a way of setting a keyboard shortcut for the Always on Top window option, or you want to use a custom shortcut and the desktop environment you’re using doesn’t support this, you can use wmctrl to set a window always on top.

Here’s the wmctrl official description: wmctrl is a command that can be used to interact with an X Window manager that is compatible with the EWMH/NetWM specification. wmctrl can query the window manager for information, and it can request that certain window management actions be taken.

  • Debian / Ubuntu and Linux distributions based on these 2, like Pop!_OS, Zorin OS, Elementary OS, etc.:
sudo zypper install wmctrl

To use wmctrl to set Always on Top, open your desktop environment’s custom keyboard shortcuts dialog, add a new shortcut and use this as the command:

wmctrl -r :ACTIVE: -b toggle,above

This uses wmctrl to toggle the «above» window property, so it sets a window Always on Top if it’s not already, and it turns Always on Top off if it’s active.

Источник

Оцените статью
Adblock
detector