1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 21:32:36 +01:00

Freedesktop deployment fixes

This commit is contained in:
aclist 2022-08-06 03:35:17 +09:00
parent c04adc15fd
commit 293b99402a

View file

@ -17,6 +17,7 @@ testing_url="https://raw.githubusercontent.com/aclist/dztui/testing/dzgui.sh"
help_url="https://aclist.github.io/dzgui/dzgui" 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"
update_last_seen(){ update_last_seen(){
mv $config_file ${config_path}dztuirc.old mv $config_file ${config_path}dztuirc.old
@ -154,7 +155,7 @@ cat <<-END
Version=1.0 Version=1.0
Type=Application Type=Application
Terminal=false Terminal=false
Exec=$HOME/.local/share/applications/dzgui.sh Exec=$freedesktop_path
Name=DZGUI Name=DZGUI
Comment=dzgui Comment=dzgui
Icon=$HOME/.local/share/dzgui/dzgui Icon=$HOME/.local/share/dzgui/dzgui
@ -164,14 +165,14 @@ Categories=Game
guess_path(){ guess_path(){
if [[ $is_steam_deck -eq 1 ]]; then if [[ $is_steam_deck -eq 1 ]]; then
mkdir -p $HOME/.local/share/dzgui mkdir -p $HOME/.local/share/dzgui
mkdir -p $HOME/.local/share/applications mkdir -p "$freedesktop_path"
curl -Ls "$stable_url" > $HOME/.local/share/applications/dzgui.sh curl -Ls "$stable_url" > "$freedesktop_path/dzgui.sh"
#TODO: update url #TODO: update url
img_url="https://raw.githubusercontent.com/aclist/dztui/testing" img_url="https://raw.githubusercontent.com/aclist/dztui/testing"
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/.local/share/dzgui/$i" curl -s "$img_url/$i" > "$HOME/.local/share/dzgui/$i"
done done
write_desktop_file > "$HOME/.local/share/applications/dzgui.desktop" write_desktop_file > "$freedesktop_path/dzgui.desktop"
write_desktop_file > "$HOME/Desktop/dzgui.desktop" write_desktop_file > "$HOME/Desktop/dzgui.desktop"
steam_path="$HOME/.local/share/Steam" steam_path="$HOME/.local/share/Steam"
else else
@ -766,7 +767,8 @@ download_new_version(){
source_dir=$(dirname "$source_script") source_dir=$(dirname "$source_script")
mv $source_script $source_script.old mv $source_script $source_script.old
curl -Ls "$version_url" > $source_script curl -Ls "$version_url" > $source_script
curl -Ls "$version_url" > $HOME/.local/share/applications/dzgui.sh curl -Ls "$version_url" > $freedesktop_path/dzgui.sh
chmod +x $freedesktop_path/dzgui.sh
rc=$? rc=$?
if [[ $rc -eq 0 ]]; then if [[ $rc -eq 0 ]]; then
echo "[DZGUI] Wrote $upstream to $source_script" echo "[DZGUI] Wrote $upstream to $source_script"
@ -811,7 +813,7 @@ check_version(){
if [[ ! -f $config_file ]]; then : ; else source $config_file; fi if [[ ! -f $config_file ]]; then : ; else source $config_file; fi
if [[ -z $branch ]]; then if [[ -z $branch ]]; then
branch="stable" branch="stable"
write_config write_config > $config_file
fi fi
check_branch check_branch
if [[ $version == $upstream ]]; then if [[ $version == $upstream ]]; then