#!/usr/bin/env bash set -euo pipefail REPO_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" mkdir -p "$HOME/.local/bin" "$HOME/.config/systemd/user" "$HOME/.config/panel-colorizer/presets" install -m 755 "$REPO_DIR/scripts/recalc-plasma-bottom-docks.sh" "$HOME/.local/bin/recalc-plasma-bottom-docks.sh" install -m 644 "$REPO_DIR/systemd/plasma-dock-autofit.service" "$HOME/.config/systemd/user/plasma-dock-autofit.service" install -m 644 "$REPO_DIR/systemd/plasma-dock-autofit.path" "$HOME/.config/systemd/user/plasma-dock-autofit.path" rm -rf "$HOME/.config/panel-colorizer/presets/LogicDock" cp -a "$REPO_DIR/presets/LogicDock" "$HOME/.config/panel-colorizer/presets/LogicDock" if kpackagetool6 --type KWin/Script --show manjaro_dock_force_hide >/dev/null 2>&1; then kpackagetool6 --type KWin/Script --upgrade "$REPO_DIR/kwin/manjaro_dock_force_hide" else kpackagetool6 --type KWin/Script --install "$REPO_DIR/kwin/manjaro_dock_force_hide" fi kwriteconfig6 --file "$HOME/.config/kwinrc" --group Plugins --key manjaro_dock_force_hideEnabled true if [[ -z "$(kreadconfig6 --file "$HOME/.config/kwinrc" --group Script-manjaro_dock_force_hide --key delaySeconds)" ]]; then kwriteconfig6 --file "$HOME/.config/kwinrc" --group Script-manjaro_dock_force_hide --key delaySeconds 6 fi if [[ -z "$(kreadconfig6 --file "$HOME/.config/kwinrc" --group Script-manjaro_dock_force_hide --key debug)" ]]; then kwriteconfig6 --file "$HOME/.config/kwinrc" --group Script-manjaro_dock_force_hide --key debug false fi systemctl --user daemon-reload systemctl --user enable --now plasma-dock-autofit.service plasma-dock-autofit.path "$HOME/.local/bin/recalc-plasma-bottom-docks.sh" qdbus6 org.kde.KWin /KWin reconfigure >/dev/null 2>&1 || true qdbus6 org.kde.KWin /Scripting org.kde.kwin.Scripting.start >/dev/null 2>&1 || true echo 'Installed. If Panel Colorizer or KWin scripts were just updated, log out and back in once.'