1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

Abstract install path

This commit is contained in:
aclist 2022-08-06 07:42:35 +09:00
parent c3895b1cc7
commit 5595983b04

View file

@ -18,6 +18,7 @@ help_url="https://aclist.github.io/dzgui/dzgui"
check_config_msg="Check config values and restart." check_config_msg="Check config values and restart."
news_url="https://raw.githubusercontent.com/aclist/dztui/dzgui/news" news_url="https://raw.githubusercontent.com/aclist/dztui/dzgui/news"
freedesktop_path="$HOME/.local/share/applications" freedesktop_path="$HOME/.local/share/applications"
sd_install_path="$HOME/.local/share/dzgui"
update_last_seen(){ update_last_seen(){
mv $config_file ${config_path}dztuirc.old mv $config_file ${config_path}dztuirc.old
@ -155,22 +156,22 @@ cat <<-END
Version=1.0 Version=1.0
Type=Application Type=Application
Terminal=false Terminal=false
Exec=$HOME/dzgui/dzgui.sh Exec=$sd_install_path/dzgui.sh
Name=DZGUI Name=DZGUI
Comment=dzgui Comment=dzgui
Icon=$HOME/dzgui/dzgui Icon=$sd_install_path/dzgui
Categories=Game Categories=Game
END END
} }
freedesktop_dirs(){ freedesktop_dirs(){
mkdir -p $HOME/dzgui mkdir -p "$sd_install_path"
mkdir -p "$freedesktop_path" mkdir -p "$freedesktop_path"
#TODO: update url #TODO: update url
curl -s "$version_url" > $HOME/dzgui/dzgui.sh curl -s "$version_url" > "$sd_install_path/dzgui.sh"
chmod +x "$HOME/dzgui/dzgui.sh" chmod +x "$sd_install_path/dzgui.sh"
img_url="https://raw.githubusercontent.com/aclist/dztui/testing/images" img_url="https://raw.githubusercontent.com/aclist/dztui/testing/images"
for i in dzgui grid.png hero.png logo.png; do for i in dzgui grid.png hero.png logo.png; do
curl -s "$img_url/$i" > "$HOME/dzgui/$i" curl -s "$img_url/$i" > "$sd_install_path/$i"
done done
write_desktop_file > "$freedesktop_path/dzgui.desktop" write_desktop_file > "$freedesktop_path/dzgui.desktop"
write_desktop_file > "$HOME/Desktop/dzgui.desktop" write_desktop_file > "$HOME/Desktop/dzgui.desktop"