treewide: use Bash internal 'test' command (#311)

Related: https://stackoverflow.com/questions/3427872
This commit is contained in:
NAHO 2024-03-30 12:23:23 +01:00 committed by GitHub
parent bad1af63ff
commit fdf8fd261e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -39,7 +39,7 @@ with lib;
let theme = import ./theme.nix args;
in "${theme}/share/gnome-shell/gnome-shell.css";
onChange = ''
if [ -x "$(command -v gnome-extensions)" ]; then
if [[ -x "$(command -v gnome-extensions)" ]]; then
gnome-extensions disable user-theme@gnome-shell-extensions.gcampax.github.com
gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com
fi

View file

@ -235,7 +235,7 @@ in {
home.activation.stylixLookAndFeel = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
globalPath() {
for dir in /run/current-system/sw/bin /usr/bin /bin; do
if [ -f "$dir/$1" ]; then
if [[ -f "$dir/$1" ]]; then
echo "$dir/$1"
break
fi
@ -243,12 +243,12 @@ in {
}
wallpaperImage="$(globalPath plasma-apply-wallpaperimage)"
if [ -n "$wallpaperImage" ]; then
if [[ -n "$wallpaperImage" ]]; then
"$wallpaperImage" ${themePackage}/share/wallpapers/stylix
fi
lookAndFeel="$(globalPath plasma-apply-lookandfeel)"
if [ -n "$lookAndFeel" ]; then
if [[ -n "$lookAndFeel" ]]; then
"$lookAndFeel" --apply stylix
fi
'';