Compare commits

..

No commits in common. "453ff302fca58a1c2af53e687b94b1e9c12c380a" and "8860da11c23325414fc3a25901515d22c50789c3" have entirely different histories.

View File

@ -2,24 +2,21 @@
# Simple CLI to make wallpaper changes with xwallpaper more comfortable # Simple CLI to make wallpaper changes with xwallpaper more comfortable
CONF_DIR=${XDG_CONFIG_HOME:-~/.config}/paperchanger mkdir -p $HOME/.paperchanger
CONF_CURRENT_WP=${CONF_DIR}/current_wallpaper.txt
CONF_PATH=${CONF_DIR}/paperchanger.conf.sh
mkdir -p ${CONF_DIR}
if [[ ! -f ${CONF_DIR} ]]; then if [[ ! -f "$HOME/.paperchanger/current_wallpaper.txt" ]]; then
touch ${CONF_DIR} touch $HOME/.paperchanger/current_wallpaper.txt
fi fi
if [[ ! -f ${CONF_PATH} ]]; then if [[ ! -f "$HOME/.paperchanger/paperchanger.conf.sh" ]]; then
echo '# This is the configuration file used by the paperchanger program echo '# This is the configuration file used by the paperchanger program
default_directory=' > ${CONF_DIR}/paperchanger.conf.sh default_directory=' > $HOME/.paperchanger/paperchanger.conf.sh
fi fi
read -r current_file_path < ${CONF_CURRENT_WP} read -r current_file_path < $HOME/.paperchanger/current_wallpaper.txt
source ${CONF_CURRENT_WP} source $HOME/.paperchanger/paperchanger.conf.sh
function _help() { function _help() {
echo "" echo ""
@ -44,11 +41,11 @@ function _display() {
function _set() { function _set() {
current_file_path="$1" current_file_path="$1"
echo "$current_file_path" > ${CONF_CURRENT_WP} echo "$current_file_path" > $HOME/.paperchanger/current_wallpaper.txt
} }
function _change_config_path() { function _change_config_path() {
sed -i "s/^default_directory=.*\$/default_directory=${1//\//\\/}/" ${CONF_PATH} sed -i "s/^default_directory=.*\$/default_directory=${1//\//\\/}/" $HOME/.paperchanger/paperchanger.conf.sh
} }
case "$#" in case "$#" in