local/bin/homeinit: Fix laptop predicate and persistent folder creation.

master
Pierre Neidhardt 2020-06-11 14:49:03 +02:00
parent 8e1b522210
commit a3019e6ba5
1 changed files with 5 additions and 5 deletions

View File

@ -134,7 +134,7 @@ has_gpg_keys() {
}
is_laptop() {
[ -n "$(ls -1 /sys/class/power_supply/)" ]
[ -n "$(ls -1 /sys/class/power_supply/ 2>/dev/null)" ]
}
if ! has_gpg_keys; then
@ -195,12 +195,12 @@ else
fi
section "Persistent folders"
for i in "$MAIL_CACHE" .config .config/guix .config/guix-gaming-channels .config/transmission-daemon .emacs.d "$XDG_DATA_HOME" .mpv projects; do
mkdir -pv "$HOME/$i"
for i in "$MAIL_CACHE" ~/.config ~/.config/guix ~/.config/guix-gaming-channels ~/.config/transmission-daemon ~/.emacs.d "$XDG_DATA_HOME" ~/.mpv ~/projects; do
mkdir -pv "$i"
done
section "Gaming"
lnn "$SOURCEDIR/games/games.scm.gpg" .config/guix-gaming-channels/
lnn "$SOURCEDIR/games/games.scm.gpg" ~/.config/guix-gaming-channels/
section "dotfiles"
if [ -e ~/dotfiles ]; then
@ -249,7 +249,7 @@ if inpath guix; then
for i in default main emacs next texlive; do
guix_install_profile "$i"
done
if $is_laptop; then
if is_laptop; then
guix_install_profile laptop laptop-gaming
else
guix_install_profile gaming