mirror of
https://github.com/hyprwm/hyprland-wiki.git
synced 2024-11-22 12:45:59 +01:00
Fix overwriting newly installed portals with disabled portals
This commit is contained in:
parent
e8194a9bd8
commit
d3f1a597c8
1 changed files with 11 additions and 1 deletions
|
@ -122,11 +122,21 @@ disable_portal() {
|
|||
mv "$ENABLED_PORTAL_DIR/$1.portal" "$DISABLED_PORTAL_DIR/$1.portal"
|
||||
}
|
||||
|
||||
remove_disabled_portal() {
|
||||
rm "$DISABLED_PORTAL_DIR/$1.portal"
|
||||
}
|
||||
|
||||
PORTAL=$1
|
||||
ENABLE=${2:-$(is_portal_enabled "$PORTAL" && echo "disable" || echo "enable")}
|
||||
|
||||
if [ "$ENABLE" = "enable" ]; then
|
||||
is_portal_disabled "$PORTAL" && enable_portal "$PORTAL"
|
||||
if is_portal_enabled "$PORTAL"; then
|
||||
# remove disabled portal if enabled portal exists as well,
|
||||
# as the enabled portal is most likely a newly installed version
|
||||
is_portal_disabled "$PORTAL" && remove_disabled_portal "$PORTAL"
|
||||
else
|
||||
is_portal_disabled "$PORTAL" && enable_portal "$PORTAL"
|
||||
fi
|
||||
else
|
||||
is_portal_enabled "$PORTAL" && disable_portal "$PORTAL"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue