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

Commit

Permalink
Merge pull request #3 from Truemmerer/truemmerer
Browse files Browse the repository at this point in the history
Truemmerer
  • Loading branch information
Truemmerer committed Jun 15, 2021
2 parents 22b4bd7 + aee4919 commit d4138ca
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 9 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
<img src="./awp/awp_wallpaper_icon.png" width="150" height="150">

# Requires
1. youtube-dl
2. animated-wallpaper
# Requires (shipped by awp_install_script.sh)
1. ffmpeg
2. youtube-dl
3. animated-wallpaper
<https://github.com/Ninlives/animated-wallpaper>

# Installation
## Automatic installation
**This will install the dependencies directly with and move the files to the correct places.**
**! Only for Fedora !**
1. chmod +x awp_install_script.sh
2. ./awp_install_script.sh

## Manual Installation
1. Move the folder "awp" to /usr/local/share/
2. Move the ".desktop" file to /usr/share/applications/
3. chmod +x /usr/local/share/awp/awp.sh
4. chmod +x /usr/local/share/awp/awp_autostart.sh
5. Reload GNOME - X11 press f2 and then r

# Notice:
The X11 version of GNOME is recommended for this, as this will only work on a Wayland workspace.

## Icon from:
https://icon-icons.com/icon/wallpaper/104166
Jeremiah
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions awp/awp-autostart.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=Animated Wallpaper Autostart
Name[de]=Animierte Hintergrundbilder Autostart
Comment[de]=Verwaltung von animierten Hintergrundbildern - Autostart
Comment=Control of animated Wallpaper - Autostart
Keywords[de]=Hintergrund;Animation;Wallpaper;
Keywords=Animation;Wallpaper;GTK;Background;
OnlyShowIn=GNOME;Unity;
Exec=/usr/local/share/awp/awp-autostart.sh
Icon=/usr/local/share/awp/awp_wallpaper_icon.png
StartupNotify=false
Terminal=false
Type=Application
Categories=GNOME;GTK;Core;Utility;Graphics;
File renamed without changes.
60 changes: 54 additions & 6 deletions awp/awp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Bilddir="$HOME/Animated_Wallpapers/Bild"
mkdir -p $Bilddir
cd $Download

INPUT=$(zenity --list --title "Animated Wallpaper Helper" --text "What do you want?"\
--column "Selection" --column "Typ" --radiolist TRUE "Existing" FALSE "New" FALSE "Start Animated Wallpapers" FALSE "Stop Animated Wallpapers"\
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 "Enable Autostart" FALSE "Disable Autostart"\
--width=600 --height=250)


Expand All @@ -17,12 +17,47 @@ then

Video=$(zenity --file-selection --title "Choose the live wallpaper" --filename='$Download' --width=600 --file-filter=""*.mkv" "*.webm"")

echo $Video > lastvideo.txt
cd Bild
Bild=$(zenity --file-selection --title "Select the corresponding still image" --filename='$Bilddir' --width=600 --file-filter=""*.png" "*.jpg" "*.jpeg"")
case $? in

0)
echo "select Video"
;;
1)
echo "Aborted"
exit 0
;;
-1)
zenity --info --width 500\
--text="Oops. This should not happen."
exit 0
;;

esac

cd $Bilddir
Bild=$(zenity --file-selection --title "Select the corresponding still image" --filename='$Bilddir' --width=600 --file-filter=""*.png" "*.jpg" "*.jpeg"")

case $? in

0)
echo "select Picture"
;;

1)
echo "Aborted"
exit 0
;;
-1)
zenity --info --width 500\
--text="Oops. This should not happen."
exit 0
;;

esac

cd ..
echo $Bild > lastpicture.txt

echo $Video > lastvideo.txt
killall animated-wallpaper

gsettings set org.gnome.desktop.background picture-uri file://$Bild\
Expand Down Expand Up @@ -65,7 +100,20 @@ killall animated-wallpaper
gsettings set org.gnome.desktop.background picture-uri file://$Bilddir/$NAME.png\
&& animated-wallpaper $NAME.* & exit 0

fi

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

cp /usr/local/share/awp/awp-autostart.desktop $HOME/.config/autostart/
sh /usr/local/share/awp/awp.sh

fi

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

rm -f $HOME/.config/autostart/awp-autostart.desktop
sh /usr/local/share/awp/awp.sh

fi
70 changes: 70 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

if [ $(whoami) != 'root' ]; then
echo "Please run as root"

else

# Detect OS
if [ -f /etc/os-release ]; then
# freedesktop.org and systemd
. /etc/os-release
OS=$NAME
elif type lsb_release >/dev/null 2>&1; then
OS=$(lsb_release -si)
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
OS=$DISTRIB_ID
else
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
OS=$(uname -s)
VER=$(uname -r)
fi

# Install Dependencies
if [ "$OS" == "Fedora" ]; then
# Fedora

zenity --question --width 500\
--text="Installation for Fedora initiated. It needs to intigrate the rpmfusion repository for ffmpeg. Do you agree with this?"

case $? in
0)
echo Install Fedora Dependencies
echo Add rpmfusion repository for ffmpeg
dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
echo Install dev tools and dependencies
dnf install -y cmake gcc-c++ vala pkgconfig gtk3-devel clutter-devel clutter-gtk-devel clutter-gst3-devel youtube-dl ffmpeg
;;
1)
zenity --info --width 500\
--text="Unfortunately, it is not possible for me to work like this."
exit 0
;;
-1)
zenity --info --width 500\
--text="Oops. This should not happen."
exit 0
;;
esac
fi


# Clone and Install animated-wallpaper
echo 'Clone animated-wallpaper from github. (https://github.com/Ninlives/animated-wallpaper)'

git clone https://github.com/Ninlives/animated-wallpaper
cd animated-wallpaper
cmake . && make && make install
cd ..
rm -rf animated-wallpaper

# Clone and Install animated_wallpaper_helper

cp -r awp /usr/local/share/
cp awp.desktop /usr/share/applications/
chmod +x /usr/local/share/awp/awp.sh
chmod +x /usr/local/share/awp/awp-autostart.sh

fi

0 comments on commit d4138ca

Please sign in to comment.