Made user specific files created at runtime

Removed corresponding files from PKGBUILD
This commit is contained in:
Maximilian P. Käfer 2021-05-17 20:17:56 +02:00
parent 7b24c74f62
commit cd3bba334b
Signed by: mpk
GPG Key ID: 035869C949377C5C
2 changed files with 19 additions and 7 deletions

View File

@ -28,10 +28,10 @@ pkgver() {
package() { package() {
cd ${pkgname} cd ${pkgname}
rm -rf "${pkgdir}${HOME}/.${pkgname}" # rm -rf "${pkgdir}${HOME}/.${pkgname}"
mkdir -p "${pkgdir}${HOME}/.${pkgname}" # mkdir -p "${pkgdir}${HOME}/.${pkgname}"
install -Dm755 paperchanger.conf.sh "${pkgdir}/etc/paperchanger.conf.sh" # install -Dm755 paperchanger.conf.sh "${pkgdir}/etc/paperchanger.conf.sh"
install -Dm755 current_wallpaper.txt "${pkgdir}${HOME}/.${pkgname}/current_wallpaper.txt" # install -Dm755 current_wallpaper.txt "${pkgdir}${HOME}/.${pkgname}/current_wallpaper.txt"
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -Dm755 paperchanger.sh "${pkgdir}/usr/bin/paperchanger" install -Dm755 paperchanger.sh "${pkgdir}/usr/bin/paperchanger"
} }

View File

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