Welcome!
Important information
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.1 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Open app window 'always on top' (SOLVED)

Post Reply
arky217
Forum Novice
Forum  Novice
Posts: 81
Joined: Mon Jun 19, 2017 6:00 pm

Open app window 'always on top' (SOLVED)

#1

Post by arky217 » Tue Jan 08, 2019 11:41 pm

I use the app password-gorilla; it's a password manager program.
When I open it, I have to right click the title bar and select 'always on top'
or I have to bring it to the forefront again after copying the username in
order to then copy the password for whatever web site I need to login to.

What I would like to do is to start password-gorilla with it 'always on top' automatically.

For example, the Opera browser always starts with a window not full size, so I add the switch
'--start-maximized' to the command to start it in a full size window.

Similarly, I would like to add a switch to the password-gorilla app so that when
it starts, it will be 'always on top'. I know that this only saves a couple of clicks,
but after logging on to numerous sites, those clicks add up.

I don't know that the password-gorilla app has switches to add to it's start,
but was wondering is a way to start it or any app so that the window is 'always on top'.

Is this possible ?
Last edited by arky217 on Wed Jan 09, 2019 4:24 pm, edited 1 time in total.

User avatar
timkb4cq
Forum Veteran
Forum Veteran
Posts: 4732
Joined: Wed Jul 12, 2006 4:05 pm

Re: Open app window 'always on top'

#2

Post by timkb4cq » Wed Jan 09, 2019 12:04 pm

It is possible using the wmctrl command. It's not as straightforward in the case of password-gorilla as it normally is because wmctrl recognizes Windows by their titles and password-gorilla has a Window titled Open Password Database which it destroys before opening the Password Gorilla Window.
I wrote a small shell script to do this.
First Install wmctrl from the standard repos.
Then copy & paste this into a text file.

Code: Select all

#!/bin/bash
password-gorilla &		#open password-gorilla then switch control of this script away from it with the &
sleep .5
while wmctrl -l | grep "Open Password Database" > /dev/null		#Loop while the Open Password Database Window is on the screen
	do
	sleep .5
	done
wmctrl -r Gorilla -b add,above		#Add the Always on Top property to the Window with Gorilla in the title
Save this text file as start-pg and open a terminal in the folder that start-pg was saved. Run:

Code: Select all

chmod +x start-pg
to mark it as executable, and (with password-gorilla closed) test it with:

Code: Select all

./start-pg
The ./ is used so you don't have to type the whole path to that folder.

If it works correctly (it does here) then you can edit the Password Gorilla launcher to point at your new script.
MSI 970A-G43 MB, AMD FX-6300 (six core), 16GB RAM, GeForce 730, Samsung 850 EVO 250GB SSD, Seagate Barracuda XT 3TB

arky217
Forum Novice
Forum  Novice
Posts: 81
Joined: Mon Jun 19, 2017 6:00 pm

Re: Open app window 'always on top'

#3

Post by arky217 » Wed Jan 09, 2019 4:24 pm

@Timkb4cq,

Excellent; works perfectly, thank you very much !

Post Reply

Return to “Software / Configuration”