Gnome 3 Disable "Unlock private key" modal GUI - gnome

I am using Gnome 3.34.3.
When I need to unlock a private key (ssh, git, etc.), a modal window appear and ask me to write the key's passphrase.
The GUI is modal and it is not convenient for me.
I would like to unlock my private keys from either the terminal or a not modal GUI.
Is it possible ?
Thank you !

echo "pinentry-program /usr/bin/pinentry-gtk" >> ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye
Almost solved.

In short; no. [sorry]
The dialog is kept modal to mark its importance. For example, such password, urgent info windows must be kept modal to get the user's attention as soon as possible. Modal also prevents you from accessing the other part of application, which otherwise would spoil the application entirely.
For example:
if the dialog wasn't modal while getting authentication, there is no meaning at all. The dialog could be just kept down by the window manager without you even knowing it. There are possibilities.
I agree, modal windows are irksome as many crazy developers use it for everything (You can read more about this on GNOME's HIG guidelines), but a dialog should be modal when it has to be.
It depends on the developer to choose what should be modal and what should not be. That is it depends on the application, and there is no system wide settings available to change that behavior. You can, so, ask the respective developer to replace the modal windows with convenient ones.
To your question of accessing it from terminal, it also depends on the application.

Related

How to disable PrtScr

I'm working on a program that operates like a TOTP protocol. The program is giving the user passwords to other applications every 30 seconds. For security reasons, I want to be able to block the PrintScreen key and similar screen capture methods. Does anyone have any idea how I can prevent this? I am working with Windows programs.
Your question is incredibly vague and provides no context or research, but here goes:
You cannot completely prevent screen capture programs (like snipping tool or OBS) from capturing your software on a screen. However, here's a couple of ways you can prevent the printscreen tool in windows.
Method 1: Disable unwanted keystrokes
You can read the Windows API to disable unwanted keystrokes. This CodeProject documentation should show you how to do it in C#.
Method 2: Hide your application
You can use something similar to this to hide your application on screen so if the PrintScreen button is pressed, it will hide your application (and thus hide the password(s) on screen) from the screenshot.
private void Display_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Snapshot)
{
this.Hide();
}
}
Please note that this piece of code is not guaranteed to fix the problem. Use it as an idea or template to build your own methods of hiding the window.
If you are still absolutely desperate, you can change the software to show a button that says "Copy Password to Clipboard". Instead of displaying the password in a textbox, the user can see a label like "Amazon Account" and then click on the button that says to copy their password to the clipboard. This means the actual password is never revealed on screen yet the user can still copy and paste it into their Amazon account etc.
You should not be developing a TOTP client on a system that is also used as the main system to authenticate. If it is a different system, then you should not care about prntscrn at all.

Any reason that zenity wouldn't bring a dialog into focus?

I am using Zenity 3.10.2 and any time I use Zenity, regardless of dialog type, the dialog it brings up has focus. i.e. I can straight away press "Enter" straight away and proceed. (I need this ability for automation)
However, there is one exception and it is very difficult to test. It occurs during the KIWI installation of a custom Linux distro and involved a question dialog being created with no focus. Neither enter nor tab have any effect.
There is a bash script which creates this dialog. When I run this in all other contexts, It has focus, but in this install it does not, the cursor appears in random places all around the place. However, from what I can see, the whole point of Zenity is on-top, already focused dialogs.
The actual call to create the dialog is the result of sourcing a file that has the bash script in it i.e. ". ~/.bashrc". Even this approach, always works when I test it manually.
Any ideas as to what could cause a Zenity dialog to be created without focus? Or any way using just Zenity to reclaim / change the focus?
I am aware you can use a window manager such as wmctrl to bring the Dialog to the focus. However this currently not a used package and shouldn't have to do anything else as this is just a simple dialog.
WINDOWMANAGER=/usr/bin/gnome-session
Any guidance would be much appreciated!

Simulating user activities on a GMail page

I create a program that simulates me browsing to gmail, entering the user name and password and clicking the submit button.
All this with C#.
I would appreciate two kinds of answers:
One that tells how to do this programaticaly. Since I may be interested in automating more
sophisticated user activities.
On that tells me about a program that already does that.
Thanks!!
I want to access my mail account with a double click (without browsing, entering username and password and pressing submit).
Why not check the 'stay signed in' box, and add a bookmark toolbar item for Gmail?
alt text http://img192.imageshack.us/img192/6240/picture5zw.png
Do it once, and all future logins are a one-click process. Am I missing something? Why overcomplicate this with a C# program?
Well, depending on the browser you're using, it might be much simpler to use a greasemonkey userscript (on FireFox) that does auto-login for you.
If you want to simulate user activity take a look at AutoHotKey.
Also if the issue is specific to logging into websites take a look at LastPass. They have plug-ins for every major browser and mobile device. I haven't type out a user name or password on a website in months.
If your ok with clicking 'go' (or wharever) on your application and then clickingin the username field. Look into Sendkeys:
Put this in the onClick event of a button and replace text with your user details:
SendKeys.Send("USER#DOMAIN.COM{TAB}PASS{TAB}{TAB}{ENTER}");
You might also want to put a timer or make your program wait a few seconds before actually sending the keys to give you time to click in the username box.
Use WatIn. and this is a placeholder to get to 30 Chars answer

Call my application through keyword

My problem is very simple, but implementation can be hard!
I want that my application (Windows Application:: Visual C# .net) is launched whenever the user uses some keys combinations (on his keyboard).
For example it types Ctrl+W+W and my application is launched, that's all, I want the simplest implementation, less code, memory...
Thanks :D
You would need to write a keylogger type application in conjunction with your app which monitors for keyboard events. Once your specific shortcut is triggered you could then load your application.
See here for information on how to capture keystrokes.
Create a shortcut to the application, and assign a hot-key combination to the shortcut. Depending on the O/S, not every keystroke combination can be assigned to a shortcut, e.g. you may be able to assign Ctrl+Alt+W but not Ctrl+W+W.
On Windows, you can create a shortcut (on the desktop) to your application.
When you open the properties of the shortcut, on the second tab (labeled "Shortcut"), you can assign a shortcut key. But you can use only Ctrl+Alt+key shortcuts.
I don't think this is possible in the way that you framed this question. What is possible, however, is to have your application run automatically on startup without showing any forms, have it hook into Windows to monitor all keystrokes (I'm not sure how to do that part, exactly) and then show a form when the user presses a particular sequence of keys.
So in other words, your application would have to be running from the time Windows starts, but only show itself (make a form visible) when the user clicks a particular key sequence.
Update: here is a link to an article that discusses how to do global keystroke capture using C#: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx.

Browser Context Menu customization?

Is there a way to override the "undo" and "select all" in right click context menu of the browser over textarea?
Thank you.
You cannot edit the browser's built-in context menu, but you can disable it and replace it with your own using the oncontextmenu event on the window object. I would caution that this is often a bad idea. Users expect to find the built-in context menu and are often frustrated when it isn't there.
I know you can prevent the whole context menu from opening by registering to the click() event, doing some cross-browser mumbo-jumbo to get wich button was clicked, and then return false if the right one was clicked.
However, I don't think it's possible to modify the context menu itself, at least not using javascript.
I should add that you may want to rethink why you're doing this. This will never be a protection against anything (some try to prevent copying images from their website), as it may simply be disabled by turning javascript off.
UPDATE: Ok, so you don't want to prevent users to do things, bug have them doing things your way. Then, I guess the best thing to do is :
Provide users with a toolbar that allow them to do these things (and thus making them use your actions instead of the default one
Map the usual keyboard shortcuts to your actions (Ctrl+A, Ctrl+Z, etc...)
Replace the right click menu with your own.
You mentionned in another comment that you cannot reproduce copy/paste, which is correct, but you can implement you own clipboard (that will only work for your webapp) if you really have to.

Resources