Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #########################################
- # small script to update desktop files #
- # for linux Puppy Buster and Fossa64 #
- # so far the only 2 OS i have test it #
- #########################################
- ###################################
- # list of desktop files to change #
- ###################################
- DIRECTORY="/usr/share/applications"
- file_desktop=(
- 'palemoon'
- 'chromium'
- 'firefox-esr'
- 'pcmanfm'
- 'sublime_text'
- 'gimp'
- 'telegramdesktop'
- 'lxterminal'
- )
- ###################################
- # list of categories to change #
- ###################################
- list_categories=(
- 'WebBrowser'
- 'WebBrowser'
- 'WebBrowser'
- 'FileManager'
- 'TextEditor'
- 'VectorGraphics'
- 'IRCClient'
- 'TerminalEmulator'
- )
- ###################################
- # list of command lines to change #
- ###################################
- Exec_List=(
- 'palemoon'
- 'chromium'
- 'firefox-esr'
- 'pcmanfm'
- 'subl'
- 'gimp-2.10'
- 'telegram-desktop'
- 'lxterminal'
- )
- # this one im not doing nuthing yet since i just add it yesterday to have an idea
- icon_List=(
- 'palemoon'
- 'chromium'
- 'firefox-esr'
- 'pcmanfm'
- 'subl'
- 'gimp-2.10'
- 'telegram-desktop'
- 'lxterminal'
- )
- count_apps=${#file_desktop[@]}
- for (( i = 0 ; i < ${count_apps} ; i++ )) ; do
- # check first if path exist
- if [[ -d "$DIRECTORY" ]] ; then
- # check if file exist then do the nasty job
- if [[ -f "${DIRECTORY}/${file_desktop[i]}.desktop" ]] ; then
- sed -i -e "s/^Categories=*.*/Categories=${list_categories[i]}/g" ${DIRECTORY}/${file_desktop[i]}.desktop
- sed -i -e "s/^Exec=*.*/Exec=${Exec_List[i]}/g" ${DIRECTORY}/${file_desktop[i]}.desktop
- fi
- fi
- done
- fixmenus # fix menus
- jwm -restart # restart jwm
Add Comment
Please, Sign In to add comment