From a3019e6ba56ab07d12d4690abfbbec10391ad925 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 11 Jun 2020 14:49:03 +0200 Subject: [PATCH] local/bin/homeinit: Fix laptop predicate and persistent folder creation. --- .local/bin/homeinit | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/homeinit b/.local/bin/homeinit index 873d8e0c..09f708c9 100755 --- a/.local/bin/homeinit +++ b/.local/bin/homeinit @@ -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