📜 ⬆️ ⬇️

Elementary OS. Impose cleanliness and order in Applications

Hello!

When I first went to Habr, I realized that I was at home. Home, Sweet Home.…
All did not dare to write. Here, decided! Writing. Good or bad, but I write.


')
I was always saddened by the mess in [... everywhere, I don't like mess ...] in the application menu of Mandriva, Suse, Ubuntu, Elementary OS (I decided to list them in the order of use. I write and nostalgic). Of course, the situation is the same for the majority of distributions, as the creators of these programs in * .desktop files prescribe information about how and where to display the program. And many of them do not seem to care about the mess that comes from such neglect of the logic of building navigation.

I decided to fix it. A long time ago, a long time ago. And after a while, long ago ... Taki corrected. And she decided to you and was going to show you just now.

Task: remove all unnecessary from Applications. At the same time, not only not to lose in the convenience of work, but also to win many times.

I figured out how to achieve what I need in a simplest way. And I need order in the menu and at the same time the performance of all programs. Different * .desktop files had different structure and order of lines. In a word - no order. Someone in the forest, some for firewood. To change them and bring to perfection is a thankless task. Yes, I did it once, I was still on Ubuntu. Quit) Although the developments are still and probably worth putting them as they are. Maybe I will get user support in my endeavors, and maybe they will criticize me so much that I will forget about this long-standing idealistic undertaking as a nightmare. What to do, we must try.

I experimentally understood that I need to add two lines to the very beginning of each * .desktop file:
[Desktop Entry] NoDisplay=true 


What are * .desktop files? - Something like shortcuts in Windows. Located in / usr / share / applications /

I wrote a simple bash file. Visually broke it into three parts:



So, for example:



The note:
I haven’t gotten Scratch native as an editor, but I haven’t found anything better than Scratch for organizing TODO lists and all sorts of notes. Once in love with Tomboy notes, console wyrd, then Wunderlist. I tried many things and stopped now at a bunch of responsive and simple test editor with fixing the folder tree (Scratch) and the cloud service (Dropbox). The folders in the picture in the left sidebar are fixed and do not go away when you open / close the editor. Conveniently. Such a functional discovered by chance and fell in love with it.

Code bash script to restore order in the application menu
 #!/bin/bash # Just not needed for others to know that i have this in my system. # I always can run them from cli.  sudo sed -i '1iNoDisplay=true' /usr/share/applications/synaptic.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/synaptic.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/teamviewer-teamviewer9.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/teamviewer-teamviewer9.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/bleachbit.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/bleachbit.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/bleachbit-root.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/bleachbit-root.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/virtualbox.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/virtualbox.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/wireshark.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/wireshark.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/umit.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/umit.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/bum.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/bum.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/gparted.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/gparted.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/guake.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/guake.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/luakit.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/luakit.desktop # Rubbish. ,    , #       , #   file associations sudo sed -i '1iNoDisplay=true' /usr/share/applications/dropbox.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/dropbox.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/AdobeAIR.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/AdobeAIR.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/file-roller.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/file-roller.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/caffeine-preferences.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/caffeine-preferences.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/evince.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/evince.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/gdebi.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/gdebi.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/gthumb.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/gthumb.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/update-manager.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/update-manager.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/vlc.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/vlc.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/pantheon-terminal.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/pantheon-terminal.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/noise.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/noise.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-base.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-base.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-calc.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-calc.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-math.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-math.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-draw.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-draw.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-impress.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-impress.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/libreoffice4.3-writer.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/libreoffice4.3-writer.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/ibus-setup.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/ibus-setup.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/empathy.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/empathy.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/totem.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/totem.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/gxneur.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/gxneur.desktop # ,        . #      .     . sudo sed -i '1iNoDisplay=true' /usr/share/applications/scratch-text-editor.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/scratch-text-editor.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/scribes.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/scribes.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/sublime_text.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/sublime_text.desktop sudo sed -i '1iNoDisplay=true' /usr/share/applications/atom.desktop sudo sed -i '1i[Desktop Entry]' /usr/share/applications/atom.desktop #      batch edit.      'd' #sudo sed -i '/\[Desktop Entry\] NoDisplay=true/d' /usr/share/applications/synaptic.desktop 



Of all the icons, the libreophis left only one - the central one.

Save and run.

 chmod u+x Beautify_menu sh Beautify_menu 

Only one inconvenience. The script must be restarted after software updates. Since they erase the old and write down a new * .desktop file. As a result, our edits are lost and the script needs to be repeated. And what about when one program is updated, while others do not. What then? Do not worry, the multiple lines below do not affect anything:

 [Desktop Entry] NoDisplay=true [Desktop Entry] NoDisplay=true [Desktop Entry] NoDisplay=true [Desktop Entry] NoDisplay=true 


Because the script can be run infinitely many times.

How optimally the script is written, I leave it to your judgment. I personally think that the code can be simplified at least twice. But how exactly, I do not know. Tortured to experiment and laid out as is.

Do not run this script blindly. Think whether you need what I wanted. Perhaps everything suits you.

If you agree with my point of view about the order in the menu, do not forget to correct the script for yourself. I wish you all good luck.

In a future article I would like to introduce you to my console and its aliases. A lot more then what lies in the daddy marked "In dev". My thoughts are inconsistent, I know.

Source: https://habr.com/ru/post/242751/


All Articles