-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(script): renamed install-remote to install
Signed-off-by: Manish Kumar <[email protected]>
- Loading branch information
1 parent
00b0931
commit 10082bd
Showing
2 changed files
with
43 additions
and
56 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
#! /bin/bash | ||
|
||
# Adding some splash of colours | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[0;33m' | ||
OFF='\033[0m' | ||
|
||
# Check up and clean old verisons | ||
echo "Checking and cleaning up old $1 files" | ||
|
||
rm -f $1.zip | ||
|
||
# If old directory exists, delete it | ||
if [ -d "./$1" ]; then | ||
printf '%s\n' "Removing Old Files for ($1)" | ||
rm -rf "./$1" | ||
fi | ||
|
||
echo "Adding $1 to wallpapers ..." | ||
cd $1 | ||
|
||
# Create wallpapers directory if doesn't exist | ||
sudo mkdir -p /usr/share/backgrounds/gnome | ||
|
||
# Download files from the zip repo | ||
echo -e "${YELLOW}Downloading Files...${OFF}" | ||
status=$(curl -LJ https://github.com/manishprivet/dgw-zips/blob/main/$1.zip?raw=true -o ./$1.zip --write-out %{http_code} --silent) | ||
|
||
# If file doesn't exist, exit with an error | ||
if [[ "$status" -ne 200 ]] ; then | ||
echo -e "${RED}$1 theme doesn't exist. Make sure you spelled it correctly.${OFF}" | ||
rm -f $1.zip | ||
exit 0 | ||
fi | ||
|
||
# Unzip the file | ||
unzip $1.zip -d ./$1 | ||
|
||
|
||
cd $1 | ||
|
||
# Create required directories | ||
sudo mkdir /usr/share/backgrounds/gnome/$1-timed | ||
sudo cp $1*.jp* /usr/share/backgrounds/gnome/$1-timed | ||
sudo cp $1-timed.xml /usr/share/backgrounds/gnome | ||
sudo cp $1.xml /usr/share/gnome-background-properties | ||
echo "Added $1 dynamic wallpaper!" | ||
echo "" | ||
echo -e "${GREEN}Added $1 dynamic wallpaper!" | ||
|
||
# Cleanup zip file and extracted folder | ||
echo "Cleaning up ..." | ||
cd .. | ||
rm -rf $1 | ||
rm $1.zip |