Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
Brendan Webb | 69e4fed9b1 | |
Brendan Webb | bf630f1d4b | |
Brendan Webb | 8164fff194 | |
Brendan Webb | fc0aca957f | |
Brendan Webb | 958017264b | |
Brendan Webb | 079f270c96 | |
Brendan Webb | ce71357803 | |
Brendan Webb | ae2407a9ff | |
Brendan Webb | 15be4b3ca9 | |
Brendan Webb | f2204c4196 | |
Brendan Webb | c15894c8bd | |
Brendan Webb | 3b079b97eb | |
Brendan Webb | 00aad7f03c |
|
@ -1,3 +1,4 @@
|
|||
brendotools-wallman*
|
||||
brendotools-wallman.zip
|
||||
to-do.md
|
||||
to-do.md
|
||||
releasenotes_not_for_push
|
10
README.md
10
README.md
|
@ -2,4 +2,12 @@
|
|||
|
||||
## brendo's stupidly over-engineered wallpaper manager.
|
||||
|
||||
### documentation coming... eventually.
|
||||
### documentation coming... eventually.
|
||||
|
||||
### at least i hopefully fixed the update mechanism...
|
||||
|
||||
### i'm a fucking moron
|
||||
|
||||
this is entirely so i can see if i fixed a broken hook
|
||||
|
||||
yeah the hook didn't work
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
function parse() {
|
||||
WPSET_REL=$(mktemp /tmp/wpset-releases-XXXXX.json)
|
||||
curl -s https://tildegit.org/api/v1/repos/BrendanTCC/brendotools-wallman/tags -o $WPSET_REL
|
||||
DOWNLOAD_VERSION=$(cat $WPSET_REL | jq .[0].name | sed s/\"//g)
|
||||
DOWNLOAD_NOTES=$(cat $WPSET_REL | jq .[0].message | sed s/\"//g | sed 's/\\n/\
|
||||
/g')
|
||||
rm $WPSET_REL
|
||||
}
|
||||
# everything below this comment is entirely for debugging parsing.
|
||||
# haha im lazy
|
||||
function debug() {
|
||||
parse
|
||||
echo "newest tag found: $DOWNLOAD_VERSION"
|
||||
echo "tag message:"
|
||||
echo "$DOWNLOAD_NOTES"
|
||||
}
|
||||
if [ "$1" == "debug" ]; then
|
||||
debug
|
||||
fi
|
100
wpset
100
wpset
|
@ -1,40 +1,61 @@
|
|||
#!/bin/bash
|
||||
# setting USER variable
|
||||
USER=$(logname)
|
||||
|
||||
# WPDL
|
||||
VERSION="0.1-rev83"
|
||||
VERSION=""
|
||||
CONF="/home/$USER/.config/wpdl.conf"
|
||||
source $CONF
|
||||
|
||||
source /etc/wpdl/parse
|
||||
# updater
|
||||
if [ "$1" = "-u" ]; then
|
||||
# contact tildegit to see if there's a new release
|
||||
WPSET_REL=$(mktemp /tmp/wpset-releases-XXXXX.json)
|
||||
curl -s https://tildegit.org/api/v1/repos/BrendanTCC/brendotools-wallman/releases -o $WPSET_REL
|
||||
DOWNLOAD_VERSION=$(cat $WPSET_REL | jq .[0].tag_name | sed s/\"//g)
|
||||
DOWNLOAD_URL=$(cat $WPSET_REL | jq .[0].assets[0].browser_download_url | sed s/\"//g)
|
||||
DOWNLOAD_FNAME=$(cat $WPSET_REL | jq .[0].assets[0].name | sed s/\"//g)
|
||||
rm $WPSET_REL
|
||||
# root check
|
||||
ROOT=$(whoami)
|
||||
if [ "$ROOT" != "root" ]; then
|
||||
echo "ERR_ROOT_PRIVS_REQUIRE"
|
||||
echo "(try re-running this script with sudo.)"
|
||||
exit
|
||||
fi
|
||||
# contact tildegit to check for a new release
|
||||
parse
|
||||
# compare versions
|
||||
WPSET_REMOTEVER=$(echo "$DOWNLOAD_VERSION")
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
|
||||
# compare versions
|
||||
WPSET_REMOTEVER=$(echo "$DOWNLOAD_VERSION")
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
if [ "$WPSET_REMOTEVER" == "$WPSET_LOCALVER" ]; then
|
||||
|
||||
if [ "$WPSET_REMOTEVER" == "$WPSET_LOCALVER" ]; then
|
||||
# tell user that there's nothing to do
|
||||
echo "you are already running the latest available version of wallman."
|
||||
exit
|
||||
|
||||
# tell user that there's nothing to do
|
||||
echo "you are already running the latest available version of wallman."
|
||||
exit
|
||||
else
|
||||
# download the update
|
||||
cd /home/$USER/
|
||||
FOLDER_CHECK=$(ls | grep brendotools-wallman)
|
||||
if [ "$FOLDER_CHECK" != "" ]; then
|
||||
rm -rf brendotools-wallman*
|
||||
fi
|
||||
git clone https://tildegit.org/BrendanTCC/brendotools-wallman/
|
||||
cd brendotools-wallman
|
||||
git checkout tags/$DOWNLOAD_VERSION
|
||||
|
||||
else
|
||||
# download the update
|
||||
cd /home/$USER/
|
||||
wget $DOWNLOAD_URL -o $DOWNLOAD_FNAME
|
||||
unzip $DOWNLOAD_FNAME
|
||||
cd brendotools-wallman
|
||||
mv wpset /bin/wpset
|
||||
chmod +x /bin/wpset
|
||||
cd /home/$USER/
|
||||
rm -rf brendotools-wallman/
|
||||
echo "done."
|
||||
# set the version because GOOD GOD I'M A LAZY CUNT
|
||||
echo wpset | sed "s/VERSION\=\"\"/VERSION\=\"$DOWNLOAD_VERSION\""
|
||||
# install the update
|
||||
mv wpset /bin/wpset
|
||||
chmod +x /bin/wpset
|
||||
mv parse /etc/wpdl/parse
|
||||
chmod +x /etc/wpdl/parse
|
||||
cd /home/$USER/
|
||||
rm -rf brendotools-wallman/
|
||||
echo "done."
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
if [ "$WPSET_LOCALVER" == "$WPSET_REMOTEVER" ]; then
|
||||
echo "success! wpset version updated to $WPSET_LOCALVER."
|
||||
else
|
||||
echo "something's gone wrong. wpset version is '$WPSET_LOCALVER' when it should be $WPSET_REMOTEVER.\
|
||||
try manually moving the file and running wpset -v."
|
||||
fi
|
||||
fi
|
||||
|
||||
# version
|
||||
|
@ -90,17 +111,18 @@ else
|
|||
|
||||
# wallpaper lookup
|
||||
WPLIST=$(wplist | grep $1)
|
||||
if [ "$WPLIST" = "$1" ]; then
|
||||
# download the actual script
|
||||
curl -s sftp://$SSH_HOST/home/$SSH_USER/bin/wpdl -u $SSH_USER: -o wpdl
|
||||
chmod +x wpdl
|
||||
clear
|
||||
$PWD/wpdl $*
|
||||
rm wpdl
|
||||
[ -e wp.list ] && rm $PWD/wp.list
|
||||
else
|
||||
clear
|
||||
echo "could not find the wallpaper you requested, here's a list of what's available:"
|
||||
wplist
|
||||
if [ "$WPLIST" = "$1" ]; then
|
||||
# download the actual script
|
||||
curl -s sftp://$SSH_HOST/home/$SSH_USER/bin/wpdl -u $SSH_USER: -o wpdl
|
||||
chmod +x wpdl
|
||||
clear
|
||||
$PWD/wpdl $*
|
||||
rm wpdl
|
||||
[ -e wp.list ] && rm $PWD/wp.list
|
||||
else
|
||||
clear
|
||||
echo "could not find the wallpaper you requested, here's a list of what's available:"
|
||||
wplist
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
16
wpset-setup
16
wpset-setup
|
@ -1,7 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# version
|
||||
VERSION="1.0"
|
||||
source parse
|
||||
git checkout tags/$DOWNLOAD_VERSION
|
||||
|
||||
# setting USER variable
|
||||
USER=$(logname)
|
||||
|
@ -9,17 +8,13 @@ USER=$(logname)
|
|||
# root check
|
||||
ROOT=$(whoami)
|
||||
if [ "$ROOT" != "root" ]; then
|
||||
echo "ERR_ROOT_PRIVS_REQUIRE"
|
||||
echo "an error occurred while checking for root permissions: DONT_HAVE_EM_CHIEF"
|
||||
echo "(try re-running this script with sudo.)"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" = "-u" ]; then
|
||||
mv wpset /bin/wpset
|
||||
chmod +x /bin/wpset
|
||||
cd /home/$USER/
|
||||
rm -rf brendotools-wallman*
|
||||
echo "done."
|
||||
exit
|
||||
fi
|
||||
|
||||
# location where config file will reside.
|
||||
|
@ -57,5 +52,8 @@ echo "LASTWP_LOC=\"\$WALL_LOC/.lastwp\"" >> $CONFIG
|
|||
echo "LAST=\$(cat /home/$USER/wallpaper/.lastwp)" >> $CONFIG
|
||||
chown $USER:$USER $CONFIG
|
||||
echo "done! now let's chuck wpset in /bin/..."
|
||||
echo wpset | sed "s/VERSION\=\"\"/VERSION\=\"$DOWNLOAD_VERSION\""
|
||||
mv wpset /bin/wpset
|
||||
mkdir -p /etc/wpdl
|
||||
mv parse /etc/wpdl/parse
|
||||
echo "done! goodbye."
|
||||
|
|
85
wpset-update
85
wpset-update
|
@ -1,41 +1,58 @@
|
|||
#!/bin/bash
|
||||
function process() {
|
||||
# install the update
|
||||
mv wpset /bin/wpset
|
||||
chmod +x /bin/wpset
|
||||
mv parse /etc/wpdl/parse
|
||||
chmod +x /etc/wpdl/parse
|
||||
cd /home/$USER/
|
||||
rm -rf brendotools-wallman/
|
||||
echo "done."
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
if [ "$WPSET_LOCALVER" == "$WPSET_REMOTEVER" ]; then
|
||||
echo "success! wpset version updated to $WPSET_LOCALVER."
|
||||
else
|
||||
echo "something's gone wrong. wpset version is '$WPSET_LOCALVER' when it should be $WPSET_REMOTEVER.\
|
||||
try manually moving the file and running wpset -v."
|
||||
fi
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
# root check
|
||||
ROOT=$(whoami)
|
||||
if [ "$ROOT" != "root" ]; then
|
||||
sudo bash wpset-update process
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "process" ]; then
|
||||
process
|
||||
fi
|
||||
|
||||
# contact tildegit to see if there's a new release
|
||||
WPSET_REL=$(mktemp /tmp/wpset-releases-XXXXX.json)
|
||||
curl -s https://tildegit.org/api/v1/repos/BrendanTCC/brendotools-wallman/releases -o $WPSET_REL
|
||||
DOWNLOAD_VERSION=$(cat $WPSET_REL | jq .[0].tag_name | sed s/\"//g)
|
||||
DOWNLOAD_URL=$(cat $WPSET_REL | jq .[0].assets[0].browser_download_url | sed s/\"//g)
|
||||
DOWNLOAD_FNAME=$(cat $WPSET_REL | jq .[0].assets[0].name | sed s/\"//g)
|
||||
rm $WPSET_REL
|
||||
|
||||
# other important shit
|
||||
CONF="/home/$USER/.config/wpdl.conf"
|
||||
source $CONF
|
||||
WPSET_REMOTEVER="0.1-rev83"
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
clear
|
||||
|
||||
if [ "$WPSET_REMOTEVER" == "$WPSET_LOCALVER" ]; then
|
||||
|
||||
echo "no updates to install, latest version already installed"
|
||||
exit
|
||||
cd /home/$USER/
|
||||
FOLDER_CHECK=$(ls | grep brendotools-wallman)
|
||||
if [ "$FOLDER_CHECK" != "" ]; then
|
||||
rm -rf brendotools-wallman*
|
||||
fi
|
||||
git clone https://tildegit.org/BrendanTCC/brendotools-wallman/
|
||||
cd brendotools-wallman
|
||||
source parse
|
||||
parse
|
||||
git checkout tags/$DOWNLOAD_VERSION
|
||||
# set the version because GOOD GOD I'M A LAZY CUNT
|
||||
echo wpset | sed "s/VERSION\=\"\"/VERSION\=\"$DOWNLOAD_VERSION\""
|
||||
# setting USER variable
|
||||
USER=$(logname)
|
||||
|
||||
# root check
|
||||
ROOT=$(whoami)
|
||||
if [ "$ROOT" != "root" ]; then
|
||||
sudo bash /home/$USER/brendotools-wallman/wpset-update process
|
||||
else
|
||||
PASSWD=$(pass system/sudo)
|
||||
|
||||
# The Parsed (and updater)
|
||||
curl -s $DOWNLOAD_URL -o $DOWNLOAD_FNAME
|
||||
unzip $DOWNLOAD_FNAME -d /home/$USER/$DOWNLOAD_FOLDER
|
||||
cd /home/$USER/$DOWNLOAD_FOLDER
|
||||
chmod +x /home/$USER/$DOWNLOAD_FOLDER/brendotools-wallman/wpset-setup
|
||||
echo "sudo privileges are required to continue. enter your password."
|
||||
sudo mv wpset /bin/wpset
|
||||
sudo chmod +x /bin/wpset
|
||||
|
||||
|
||||
sleep 1
|
||||
echo "wpset should have successfully updated."
|
||||
WPSET_LOCALVER=$(wpset -v)
|
||||
echo "wpset version is now $WPSET_LOCALVER."
|
||||
process
|
||||
fi
|
||||
rm $WPSET_REL
|
||||
|
||||
echo "wpset-update is now deprecated. it's now built directly into wpset."
|
Loading…
Reference in New Issue