Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
1. Installer now supports Pop!_OS and child distros of the Supported …
Browse files Browse the repository at this point in the history
…Distros.

2. Start/Stop summarized in one point.
3.Autostart enable and disable combined into one point.
  • Loading branch information
Truemmerer committed Jul 22, 2022
1 parent 47e5c24 commit 97d1896
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 111 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## Automatic installation
**This will install the dependencies directly with and move the files to the correct places.**
**Fedora, Arch Linux, Manjaro and Ubuntu supported**
**Also, children distros are supported.**

1. chmod +x install.sh
2. bash ./install.sh
Expand Down
81 changes: 48 additions & 33 deletions awp/awp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ cd $Download
###############

INPUT=$(zenity --list --title "Animated Wallpaper Helper" --window-icon=/usr/local/share/awp/awp_wallpaper_icon.png --text "What do you want?"\
--column "Selection" --column "Typ" --radiolist FALSE "Existing" FALSE "New" TRUE "Start Animated Wallpapers" FALSE "Stop Animated Wallpapers" FALSE "Remove Wallpaper" FALSE "Enable Autostart" FALSE "Disable Autostart" FALSE "Uninstall" FALSE About\
--column "Selection" --column "Typ" --radiolist FALSE "Existing" FALSE "New" TRUE "Start/Stop Animated Wallpapers" FALSE "Remove Wallpaper" FALSE "Enable/Disable Autostart" FALSE "Uninstall" FALSE About\
--width=600 --height=350)


Expand Down Expand Up @@ -114,37 +114,43 @@ then
fi

# Start Animated Wallpaper with the last image
if [ "$INPUT" == "Start Animated Wallpapers" ]
if [ "$INPUT" == "Start/Stop Animated Wallpapers" ]
then

# Check if there was a previous wallpaper and if yes load this

killall animated-wallpaper

if [ 'pidof animated-wallpaper' > 0 ]; then

read wallpaper < "$Cachedir/lastvideo.txt"

# Stop Animated Wallpaper
killall animated-wallpaper && exit 0

if [ -f "$Cachedir/lastvideo.txt" ]; then
gsettings set org.gnome.desktop.background picture-uri "file://$Bilddir/$wallpaper.png"\
&& gsettings set org.gnome.desktop.background picture-uri-dark "file://$Bilddir/$wallpaper.png"\
&& cd $Download && pwd\
&& animated-wallpaper "$wallpaper".* & exit 0

else

zenity --error \
--text="No wallpaper has been used yet that can be called up."
# Start Animated Wallpaper
killall animated-wallpaper

sh "/usr/local/share/awp/awp.sh"
fi
fi
read wallpaper < "$Cachedir/lastvideo.txt"

# Stop Animated Wallpaper
if [ "$INPUT" == "Stop Animated Wallpapers" ]
then

killall animated-wallpaper && exit 0
if [ -f "$Cachedir/lastvideo.txt" ]; then

echo "1" > "$StartStopStatus"

gsettings set org.gnome.desktop.background picture-uri "file://$Bilddir/$wallpaper.png"\
&& gsettings set org.gnome.desktop.background picture-uri-dark "file://$Bilddir/$wallpaper.png"\
&& cd $Download && pwd\
&& animated-wallpaper "$wallpaper".* & exit 0

else

zenity --error \
--text="No wallpaper has been used yet that can be called up."

sh "/usr/local/share/awp/awp.sh"
fi

fi


fi

Expand Down Expand Up @@ -241,27 +247,36 @@ then

fi

# Enable Autostart
# Enable/Disable Autostart

if [ "$INPUT" == "Enable Autostart" ]
if [ "$INPUT" == "Enable/Disable Autostart" ]
then

mkdir -p "$HOME/.config/autostart/"
cp "$Appdir/awp-autostart.desktop" "$HOME/.config/autostart/"
sh "$Appdir/awp.sh"

fi
if [ -f "$HOME/.config/autostart/awp-autostart.desktop" ]; then

# Disable Autostart
rm -f "$HOME/.config/autostart/awp-autostart.desktop"
zenity --info \
--text="Autostart disable"\
--width=600\
-- height=100

if [ "$INPUT" == "Disable Autostart" ]
then
sh "$Appdir/awp.sh"

else
mkdir -p "$HOME/.config/autostart/"
cp "$Appdir/awp-autostart.desktop" "$HOME/.config/autostart/"

zenity --info \
--text="Autostart enabled"\
--width=600\
-- height=100

rm -f "$HOME/.config/autostart/awp-autostart.desktop"
sh "$Appdir/awp.sh"
sh "$Appdir/awp.sh"

fi
fi


# Uninstall

if [ "$INPUT" == "Uninstall" ]
Expand Down
Loading

0 comments on commit 97d1896

Please sign in to comment.