Compare commits

..

No commits in common. "master" and "f30d9568c9dd051a72e955d1b119fbef33bfeaba" have entirely different histories.

4 changed files with 11 additions and 86 deletions

24
LICENSE
View File

@ -1,24 +0,0 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

View File

@ -1,14 +1,12 @@
# Nitrogen Random
Simply changes your [nitrogen](https://wiki.archlinux.org/title/Nitrogen) desktop wallpaper to a random image from a folder.
Simply changes your nitrogen desktop wallpaper to a random image from provided folder.
### How to run ###
Edit the script and make all variables valid:
* Carefully read the installation script and then launch it:
```bash
bash install.sh
```
* Follow the instructions.
* Optionally edit your .nitrogen-random config file.
* Try it by running nitrogen-random.
* Optionally add it to your [crontab](https://wiki.archlinux.org/title/Cron)!
BGSAVED is the path to bg-saved.cfg of nitrogen, must be in your .config/nitrogen folder.
WALLPAPERS is the path to a folder where all your wallpapers are located.
You may also put it to crontab.

View File

@ -1,50 +0,0 @@
#!/bin/bash
if [[ "$EUID" = 0 ]]
then
echo "Please run without sudo."
exit 0
fi
if [ ! -d ~/.config/nitrogen/ ]
then
echo "You don't have nitrogen installed! Please install it."
exit 0
fi
echo "Now exporting default config file to ~/.config/nitrogen/.nitrogen-random"
echo "#Path to bg-saved.cfg of nitrogen, must be in your ~/.config/nitrogen folder." > ~/.config/nitrogen/.nitrogen-random
echo "nBGSAVED=/home/${USER}/.config/nitrogen/bg-saved.cfg" >> ~/.config/nitrogen/.nitrogen-random
echo " " >> ~/.config/nitrogen/.nitrogen-random
echo "#Path to a folder where all your wallpapers are located." >> ~/.config/nitrogen/.nitrogen-random
echo "nWALLPAPERS=/home/${USER}/Pictures/" >> ~/.config/nitrogen/.nitrogen-random
echo " " >> ~/.config/nitrogen/.nitrogen-random
echo "#Nitrogen policy for resizing and scaling." >> ~/.config/nitrogen/.nitrogen-random
echo "nMODE=4" >> ~/.config/nitrogen/.nitrogen-random
echo "nitrogen-random will read config from ~/.config/ folder of ${USER}."
decided=false
while [ "$decided" == false ]
do
echo "Choose an option:"
echo "1) It's okay, the config will be in /home/${USER}/.config/nitrogen/"
echo "2) No, I want to set the path on my own."
read input
if [ "$input" == "1" ]
then
decided=true
sed -i "s/{username}/${USER}/" nitrogen-random
elif [ "$input" == "2" ]
then
decided=true
echo "Please write path to the config file in /usr/local/bin/nitrogen-random manually!"
fi
done
chmod u+x ./nitrogen-random
echo "Ready to install ./nitrogen-random to /usr/local/bin/"
sudo cp -f ./nitrogen-random /usr/local/bin/
sudo chown ${USER} /usr/local/bin/nitrogen-random
echo " "
echo " All done! (> < ) "

7
nitrogen-random → nitrogen-random.sh Executable file → Normal file
View File

@ -1,7 +1,8 @@
#!/bin/bash
#You can move the config .nitrogen-random anywhere, just replace the path here
. /home/{username}/.config/nitrogen/.nitrogen-random
nBGSAVED=/home/naiji/.config/nitrogen/bg-saved.cfg
nWALLPAPERS=/home/naiji/Pictures/wallpapers/lewd/
nMODE=4
export DISPLAY=:0
@ -12,4 +13,4 @@ echo "file=${nWALLPAPERS}/${nPATH}" >> ${nBGSAVED}
echo "mode=${nMODE}" >> ${nBGSAVED}
echo 'bgcolor=#000000' >> ${nBGSAVED}
nitrogen --restore
nitrogen --restore