Opening graphic application on usb plug











up vote
0
down vote

favorite












I'm using Kubuntu 18.04 and Yubikey for VPN authorization.
I want to open Konsole application on key plug-in running nmcli connection up my_connection to show me password prompt. I set up udev to run my shell script, but it only blinks the window. It disappears less than in a second.



My /lib/udev/yubikey file is:



#!/bin/bash
export DISPLAY=:0
sudo -u user konsole -e "nmcli connection up my_connection"
sudo -u user nmcli connection up my_connection


If I run "nmcli connection up my_connection" from opened terminal it works! It works event if I run it using sudo. But not from udev.



Upd.
Added --hold key to konsole call. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this:



PERMISSION                                            VALUE
org.freedesktop.NetworkManager.enable-disable-network no









share|improve this question
























  • Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
    – Elder Geek
    Nov 13 at 18:45










  • Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
    – Валерий Старынин
    Nov 13 at 19:47












  • Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
    – Elder Geek
    Nov 13 at 23:59















up vote
0
down vote

favorite












I'm using Kubuntu 18.04 and Yubikey for VPN authorization.
I want to open Konsole application on key plug-in running nmcli connection up my_connection to show me password prompt. I set up udev to run my shell script, but it only blinks the window. It disappears less than in a second.



My /lib/udev/yubikey file is:



#!/bin/bash
export DISPLAY=:0
sudo -u user konsole -e "nmcli connection up my_connection"
sudo -u user nmcli connection up my_connection


If I run "nmcli connection up my_connection" from opened terminal it works! It works event if I run it using sudo. But not from udev.



Upd.
Added --hold key to konsole call. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this:



PERMISSION                                            VALUE
org.freedesktop.NetworkManager.enable-disable-network no









share|improve this question
























  • Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
    – Elder Geek
    Nov 13 at 18:45










  • Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
    – Валерий Старынин
    Nov 13 at 19:47












  • Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
    – Elder Geek
    Nov 13 at 23:59













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm using Kubuntu 18.04 and Yubikey for VPN authorization.
I want to open Konsole application on key plug-in running nmcli connection up my_connection to show me password prompt. I set up udev to run my shell script, but it only blinks the window. It disappears less than in a second.



My /lib/udev/yubikey file is:



#!/bin/bash
export DISPLAY=:0
sudo -u user konsole -e "nmcli connection up my_connection"
sudo -u user nmcli connection up my_connection


If I run "nmcli connection up my_connection" from opened terminal it works! It works event if I run it using sudo. But not from udev.



Upd.
Added --hold key to konsole call. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this:



PERMISSION                                            VALUE
org.freedesktop.NetworkManager.enable-disable-network no









share|improve this question















I'm using Kubuntu 18.04 and Yubikey for VPN authorization.
I want to open Konsole application on key plug-in running nmcli connection up my_connection to show me password prompt. I set up udev to run my shell script, but it only blinks the window. It disappears less than in a second.



My /lib/udev/yubikey file is:



#!/bin/bash
export DISPLAY=:0
sudo -u user konsole -e "nmcli connection up my_connection"
sudo -u user nmcli connection up my_connection


If I run "nmcli connection up my_connection" from opened terminal it works! It works event if I run it using sudo. But not from udev.



Upd.
Added --hold key to konsole call. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this:



PERMISSION                                            VALUE
org.freedesktop.NetworkManager.enable-disable-network no






networking kubuntu udev






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 13:48

























asked Nov 13 at 18:08









Валерий Старынин

11




11












  • Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
    – Elder Geek
    Nov 13 at 18:45










  • Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
    – Валерий Старынин
    Nov 13 at 19:47












  • Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
    – Elder Geek
    Nov 13 at 23:59


















  • Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
    – Elder Geek
    Nov 13 at 18:45










  • Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
    – Валерий Старынин
    Nov 13 at 19:47












  • Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
    – Elder Geek
    Nov 13 at 23:59
















Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
– Elder Geek
Nov 13 at 18:45




Welcome to AskUbuntu! what happens if you use the --hold or --noclose option rather than the -e as discussed here?
– Elder Geek
Nov 13 at 18:45












Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
– Валерий Старынин
Nov 13 at 19:47






Added. Now window stays and I can see: Error: Connection activation failed: Not authorized to control networking. Tried adding sudo -u user nmcli general permissions > /perm.txt to script. Got this: PERMISSION VALUE org.freedesktop.NetworkManager.enable-disable-network no
– Валерий Старынин
Nov 13 at 19:47














Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
– Elder Geek
Nov 13 at 23:59




Please edit the information into your post as comments can get deleted here for numerous reasons. Thank you for helping us help you!
– Elder Geek
Nov 13 at 23:59















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092629%2fopening-graphic-application-on-usb-plug%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092629%2fopening-graphic-application-on-usb-plug%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?