Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 14172  / 1 Year ago, sun, april 16, 2023, 4:39:55

I'm trying to make a custom launcher in 11.10 for the special force quit launcher we had in 11.04 (you could add it from the list of apps, but now it is nowhere to be found, even in alacarte). So I try using info from here
but I have no idea what the actual file or command is for force quit nor where it is in the file system.


This question is real specific to force quit itself and is not about asking how to create a launcher.


I will create a file called forcequit.desktop and put it in ~/.local/share/applications folder and will then drag it unto the toolbar like it is told elsewhere.


The content of the file will look like this:


#!/usr/bin/env xdg-open  
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=sh -c 'notify-send "Click on an application to force-close it, or press Esc to cancel."; xkill'
Name=Force Quit
Comment=Click on the app to quit with your pointer
Icon=gnome-panel-force-quit
Categories=System,Accessories;

I suppose it might be a special command that takes an argument, again if you have the info please do tell :)


I wrote comments in the file about the info I need.


Edit: ok now it works with showing a special X icon and does force quit properly.
Now I just need to find out how to get instructions to appear for an end user, just like it does when using from CLI. I'd suppose it displays the launcher's comment on screen somewhere? Any ideas or links ? Or maybe I need to add something to this launcher file ?


Last edit: well the solution from the above edit has been found, it is the usage of notify send that does the trick. Like it is now reflected in the code.
Enjoy the solution for your desktop (or for end users you support !)


Latest edit: all this talk makes me want to go look for notify-send options a little more... and well in a greater scale at all the other commands I can use.....notify-send is part of gnome, is it ? Or is it part of sh? (I doubt it's from sh)


Edit to the lastest edit :
never mind that. I found an answer to that as well. notify-send is part of the libnotify library package... and notify-send is in the tools folder (I had trouble finding it at first…) and no it isn't specifically part of gnome, but rather another library used by many apps :)


More From » 11.10

 Answers
4

The command, as WarriorIng64 already said, is xkill.



To show some instructions for the end user, maybe use



notify-send "Click on an application to force-close it, or right-click to cancel."


Now to combine two commands into one launcher, you'll have to wrap them in sh -c '...', so your .desktop file should say



Exec=sh -c 'notify-send "Click on an application to force-close it, or right-click to cancel."; xkill'

[#42573] Sunday, April 16, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
smelrop

Total Points: 263
Total Questions: 122
Total Answers: 108

Location: Saudi Arabia
Member since Thu, Jan 28, 2021
3 Years ago
smelrop questions
Mon, Mar 13, 23, 07:22, 1 Year ago
Sun, Feb 5, 23, 13:02, 1 Year ago
Tue, Aug 31, 21, 00:50, 3 Years ago
Sat, Dec 18, 21, 15:18, 2 Years ago
;