mirror of
https://github.com/aclist/dztui.git
synced 2024-12-29 13:52:03 +01:00
Force recreation of freedesktop files
This commit is contained in:
parent
04d58987de
commit
bf5ecc7462
1 changed files with 30 additions and 28 deletions
18
dzgui.sh
18
dzgui.sh
|
@ -162,19 +162,20 @@ Icon=$HOME/.local/share/dzgui/dzgui
|
||||||
Categories=Game
|
Categories=Game
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
guess_path(){
|
freedesktop_dirs(){
|
||||||
if [[ $is_steam_deck -eq 1 ]]; then
|
|
||||||
mkdir -p $HOME/.local/share/dzgui
|
mkdir -p $HOME/.local/share/dzgui
|
||||||
mkdir -p "$freedesktop_path"
|
mkdir -p "$freedesktop_path"
|
||||||
#TODO: update url
|
#TODO: update url
|
||||||
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/$i"
|
curl -s "$img_url/$i" > "$HOME/local/.share/dzgui/$i"
|
||||||
done
|
done
|
||||||
write_desktop_file > "$freedesktop_path/dzgui.desktop"
|
write_desktop_file > "$freedesktop_path/dzgui.desktop"
|
||||||
|
if [[ $is_steam_deck -eq 1 ]]; then
|
||||||
write_desktop_file > "$HOME/Desktop/dzgui.desktop"
|
write_desktop_file > "$HOME/Desktop/dzgui.desktop"
|
||||||
steam_path="$HOME/.local/share/Steam"
|
fi
|
||||||
else
|
}
|
||||||
|
guess_path(){
|
||||||
echo "# Checking for default DayZ path"
|
echo "# Checking for default DayZ path"
|
||||||
path=$(find $HOME -path "*.local/share/Steam/steamapps/common/DayZ" | wc -c)
|
path=$(find $HOME -path "*.local/share/Steam/steamapps/common/DayZ" | wc -c)
|
||||||
if [[ ! $path -eq 0 ]]; then
|
if [[ ! $path -eq 0 ]]; then
|
||||||
|
@ -193,7 +194,6 @@ guess_path(){
|
||||||
steam_path=""
|
steam_path=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
echo "[DZGUI] Set Steam path to $steam_path"
|
echo "[DZGUI] Set Steam path to $steam_path"
|
||||||
}
|
}
|
||||||
create_config(){
|
create_config(){
|
||||||
|
@ -262,8 +262,9 @@ run_varcheck(){
|
||||||
}
|
}
|
||||||
config(){
|
config(){
|
||||||
if [[ ! -f $config_file ]]; then
|
if [[ ! -f $config_file ]]; then
|
||||||
zenity --question --cancel-label="Exit" --text="Config file not found. Should DZGUI create one for you?" 2>/dev/null
|
zenity --info --text="Config file not found. DZGUI will create one for you now." 2>/dev/null
|
||||||
code=$?
|
code=$?
|
||||||
|
#prevent progress if user hits ESC
|
||||||
if [[ $code -eq 1 ]]; then
|
if [[ $code -eq 1 ]]; then
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
|
@ -762,6 +763,7 @@ merge_config(){
|
||||||
|
|
||||||
}
|
}
|
||||||
download_new_version(){
|
download_new_version(){
|
||||||
|
freedesktop_dirs
|
||||||
source_script=$(realpath "$0")
|
source_script=$(realpath "$0")
|
||||||
source_dir=$(dirname "$source_script")
|
source_dir=$(dirname "$source_script")
|
||||||
mv $source_script $source_script.old
|
mv $source_script $source_script.old
|
||||||
|
@ -881,7 +883,7 @@ setup(){
|
||||||
check_map_count(){
|
check_map_count(){
|
||||||
count=1048576
|
count=1048576
|
||||||
if [[ $(sysctl -q vm.max_map_count | awk -F"= " '{print $2}') -ne $count ]]; then
|
if [[ $(sysctl -q vm.max_map_count | awk -F"= " '{print $2}') -ne $count ]]; then
|
||||||
map_warning=$(zenity --question --title="DZGUI" --text "System map count must be $count or higher to run DayZ with Wine. Increase map count and make this change permanent? (will prompt for sudo password)" 2>/dev/null)
|
map_warning=$(zenity --question --width 500 --title="DZGUI" --text "System map count must be $count or higher to run DayZ with Wine. Increase map count and make this change permanent? (will prompt for sudo password)" 2>/dev/null)
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
pass=$(zenity --password)
|
pass=$(zenity --password)
|
||||||
sudo -S <<< "$pass" sh -c "echo 'vm.max_map_count=1048576' > /etc/sysctl.d/dayz.conf"
|
sudo -S <<< "$pass" sh -c "echo 'vm.max_map_count=1048576' > /etc/sysctl.d/dayz.conf"
|
||||||
|
|
Loading…
Reference in a new issue