Difference between revisions of "OS-Linux-Desktop-Scripts"

From KRayWiki
Jump to navigation Jump to search
(Scripts referenced by the linking page.)
 
(No difference)

Latest revision as of 20:34, 1 January 2019

See Also 
OS-Linux-Desktop
OS-Linux

XDG

This version of the scripts are heavily customized to the computer they run on. A future improvement could place customizations in a data file so the code itself need not change from system to system. In any event, the scripts are published to help illustrate one way of implementing menu changes in a desktop-independent manner.

generate_xdg-desktop-menu-commands.sh

#!/bin/bash # function desktop() { echo xdg-desktop-menu ${1} --novendor `echo "${2}"` ${3} \ >>${0#*_} } >${0#*_} for ACTION in uninstall install do for DESKTOP in \ `find . -maxdepth 1 -regextype posix-extended \ -regex ".\/[^-]*[.]desktop"` do desktop "${ACTION}" "Local.directory" "${DESKTOP}" done for LOCAL in DOSBox GOG Graphics PlayOnLinux Steam Wine do for DESKTOP in \ `find . -maxdepth 1 -regextype posix-extended \ -regex ".\/${LOCAL}-[^-]*[.]desktop"` do desktop "${ACTION}" "Local.directory ${LOCAL}.directory" "${DESKTOP}" done for LVL2 in \ `find . -maxdepth 1 -regextype posix-extended \ -regex ".\/${LOCAL}-[^-]*[.]desktop"` do case "${LOCAL}" in Wine) for LVL2 in Warcraft3 do for DESKTOP in \ `find . -maxdepth 1 -regextype posix-extended \ -regex ".\/${LOCAL}-${LVL2}-[^-]*[.]desktop"` do desktop "${ACTION}" \ "Local.directory ${LOCAL}.directory ${LOCAL}-${LVL2}.directory" \ "${DESKTOP}" done done ;; esac done done

xdg-desktop-menu-commands.sh

Example of the generated script:

xdg-desktop-menu uninstall --novendor Local.directory ./Minecraft.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Raptor.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Loom.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-RiseOfTheTriad.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI3.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Settlers2.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-TerminalVelocity.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI2.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Hexen.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukem3D.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI1.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Falcon3.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-KeyMapper.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-RealmsOfChaos.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Omega.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Napalm.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-WhackyWheels.desktop xdg-desktop-menu uninstall --novendor Local.directory DOSBox.directory ./DOSBox-Civilization.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-NeverWinterNights.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-Eschalon_Book_I_Manual.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-LandsOfLoreI.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-LandsOfLoreIManual.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-BaldursGate.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-Eschalon_Book_I.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-Dragonsphere.desktop xdg-desktop-menu uninstall --novendor Local.directory GOG.directory ./GOG-Fallout.desktop xdg-desktop-menu uninstall --novendor Local.directory Graphics.directory ./Graphics-ImageMagick.desktop xdg-desktop-menu uninstall --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-BaldursGate.desktop xdg-desktop-menu uninstall --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-Darkstone.desktop xdg-desktop-menu uninstall --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-LOTRO.desktop xdg-desktop-menu uninstall --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-DesignSpark.desktop xdg-desktop-menu uninstall --novendor Local.directory Steam.directory ./Steam-Terraria.desktop xdg-desktop-menu uninstall --novendor Local.directory Steam.directory ./Steam-WorldofGoo.desktop xdg-desktop-menu uninstall --novendor Local.directory Steam.directory ./Steam-MelodysEscape.desktop xdg-desktop-menu uninstall --novendor Local.directory Steam.directory ./Steam-Bulrerria.desktop xdg-desktop-menu uninstall --novendor Local.directory Steam.directory ./Steam-Monochroma.desktop xdg-desktop-menu uninstall --novendor Local.directory Wine.directory ./Wine-Kill.desktop xdg-desktop-menu uninstall --novendor Local.directory Wine.directory Wine-Warcraft3.directory ./Wine-Warcraft3-FrozenThrone.desktop xdg-desktop-menu uninstall --novendor Local.directory Wine.directory Wine-Warcraft3.directory ./Wine-Warcraft3-Warcraft3.desktop xdg-desktop-menu install --novendor Local.directory ./Minecraft.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Raptor.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Loom.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-RiseOfTheTriad.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI3.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Settlers2.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-TerminalVelocity.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI2.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Hexen.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukem3D.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-DukeNukemI1.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Falcon3.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-KeyMapper.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-RealmsOfChaos.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Omega.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Napalm.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-WhackyWheels.desktop xdg-desktop-menu install --novendor Local.directory DOSBox.directory ./DOSBox-Civilization.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-NeverWinterNights.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-Eschalon_Book_I_Manual.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-LandsOfLoreI.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-LandsOfLoreIManual.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-BaldursGate.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-Eschalon_Book_I.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-Dragonsphere.desktop xdg-desktop-menu install --novendor Local.directory GOG.directory ./GOG-Fallout.desktop xdg-desktop-menu install --novendor Local.directory Graphics.directory ./Graphics-ImageMagick.desktop xdg-desktop-menu install --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-BaldursGate.desktop xdg-desktop-menu install --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-Darkstone.desktop xdg-desktop-menu install --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-LOTRO.desktop xdg-desktop-menu install --novendor Local.directory PlayOnLinux.directory ./PlayOnLinux-DesignSpark.desktop xdg-desktop-menu install --novendor Local.directory Steam.directory ./Steam-Terraria.desktop xdg-desktop-menu install --novendor Local.directory Steam.directory ./Steam-WorldofGoo.desktop xdg-desktop-menu install --novendor Local.directory Steam.directory ./Steam-MelodysEscape.desktop xdg-desktop-menu install --novendor Local.directory Steam.directory ./Steam-Bulrerria.desktop xdg-desktop-menu install --novendor Local.directory Steam.directory ./Steam-Monochroma.desktop xdg-desktop-menu install --novendor Local.directory Wine.directory ./Wine-Kill.desktop xdg-desktop-menu install --novendor Local.directory Wine.directory Wine-Warcraft3.directory ./Wine-Warcraft3-FrozenThrone.desktop xdg-desktop-menu install --novendor Local.directory Wine.directory Wine-Warcraft3.directory ./Wine-Warcraft3-Warcraft3.desktop

xdg-icon-resource-commands.sh

#!/bin/bash # for size in 128 48 32 22 16 do for action in uninstall install do echo "${action}ing ${size}x${size}..." pushd ${size}x${size} >/dev/null for file in *.png do echo " ${file}" xdg-icon-resource install --novendor --context apps --size $size ${file} done popd >/dev/null done done