For example, to open the Inkscape Vector Graphics Editor, I enter inkscape in the terminal.
How can I find such names from other programs?
For example, to open the Inkscape Vector Graphics Editor, I enter inkscape in the terminal.
How can I find such names from other programs?
you can use this script:
#!/bin/bash [ $# -eq 0 ] && { echo "usage: $0 search string"; exit 1; } d=${XDG_DATA_DIRS:-/usr/local/share:/usr/share} h=${XDG_DATA_HOME:-${HOME}/.local/share} a=${d}:${h}: s=${a//://applications } f="$@" find ${s} -type f -name \*.desktop 2>/dev/null | \ xargs grep -li "${f}" | xargs grep '^Exec' an example of use with an example of the result (the case register is not important):
$ bash ΡΠ°ΠΉΠ»-Ρ-ΡΡΠΈΠΌ-ΡΠΊΡΠΈΠΏΡΠΎΠΌ inkscape vector Exec=inkscape %F Exec=inkscape what you see in the menu is made up of files with the .desktop suffix, which are searched for, according to the standard , in directories:
$XDG_DATA_DIRS/applications $XDG_DATA_HOME/applications if such environment variables are not defined, you should use:
XDG_DATA_DIRS=/usr/local/share/:/usr/share/ XDG_DATA_HOME=$HOME/.local/share/ as a colon, as is usual in unix , directories are separated when several are placed in one variable.
Ie, it is necessary to find the files (in order not to complicate, we proceed from the fact that the above variables are not defined):
$ find {/usr/share,/usr/local/share,~/.local/share}/applications/ -type f -name \*.desktop 2>/dev/null then select from the list those files that mention the search string (for example, Inkscape Vector ):
$ ... | xargs grep -l 'Inkscape Vector' and then output the lines beginning with Exec from the selected files (it is in these lines that it is written what should be launched when clicking on the menu item):
$ ... | xargs grep '^Exec' after connecting to one line, this is a long command:
$ find {/usr/share,/usr/local/share,~/.local/share}/applications/ -type f -name \*.desktop 2>/dev/null | xargs grep -l 'Inkscape Vector' | xargs grep '^Exec' on my system, she issued two lines:
Exec=inkscape %F Exec=inkscape of them, I hope, it is obvious that the inkscape program should be executed.
ps by localized names (for example: Π Π΅Π΄Π°ΠΊΡΠΎΡ Π²Π΅ΠΊΡΠΎΡΠ½ΠΎΠΉ Π³ΡΠ°ΡΠΈΠΊΠΈ ) is also great looking for:
$ find {/usr/share,/usr/local/share,~/.local/share}/applications/ -type f -name \*.desktop 2>/dev/null | xargs grep -l 'Π Π΅Π΄Π°ΠΊΡΠΎΡ Π²Π΅ΠΊΡΠΎΡΠ½ΠΎΠΉ Π³ΡΠ°ΡΠΈΠΊΠΈ' | xargs grep '^Exec' Exec=inkscape %F Exec=inkscape .desktop file itself, where you can see the command without any extra gestures ... - Fat-ZerHow to learn the name of the program under the menu item?
It depends on the Linux distribution. But, anyway, you have a certain analogue of the start button. Clicking on which you get the menu. And further, two options:
Either first or second, launch the menu editor, find the item you need, open its properties and see the name of the module being launched.
By the way, the option of studying shortcuts on the desktop (* .desktop files) is not very good, as there are a lot of items in the menu for launching programs that have no shortcuts.
Like about Windows , all programs have their own executable file. In the folder with the installed program Inkscape Vector Graphics Editor lies the file inkscape , which starts. You can start it by simply specifying the full path to it.
In order not to specify full paths, you can put links to executable files in the /bin and /sbin directories (as well as their options for users /usr/bin and /usr/sbin ). Then you can call the files just by writing inkscape and Linux itself will find the executable file.
You can prescribe paths in Bash yourself, just like it is done in Windows through the Path , only with a different mechanism.
In any case, when you put a package, you do not know where it places its contents and what executable files are called, so itβs best to look in the documentation.
Source: https://ru.stackoverflow.com/questions/908516/
All Articles