summarylogtreecommitdiffstats
path: root/burning-windows.install
blob: 92900ec1bb940ea8b5145606d67108830a385b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
post_install() {
  echo ""
  echo "Burning Windows has been installed."
  echo ""
  echo "IMPORTANT: KDE's built-in 'Fall Apart' effect conflicts with Burning Windows."
  echo "This package tries to enable Burning Windows and disable conflicting effects for the installing user."
  echo "If it does not apply automatically, set these in ~/.config/kwinrc under [Plugins]:"
  echo "  remisa_burnEnabled=true"
  echo "  burning_windowsEnabled=true"
  echo "  fallapartEnabled=false"
  echo "  glideEnabled=false"
  echo ""

  target_user="${SUDO_USER:-}"
  if [ -z "$target_user" ] || [ "$target_user" = "root" ]; then
    target_user="$(logname 2>/dev/null || true)"
  fi

  if [ -n "$target_user" ] && command -v runuser >/dev/null 2>&1; then
    runuser -u "$target_user" -- kwriteconfig6 --file kwinrc --group Plugins --key remisa_burnEnabled true 2>/dev/null || true
    runuser -u "$target_user" -- kwriteconfig6 --file kwinrc --group Plugins --key burning_windowsEnabled true 2>/dev/null || true
    runuser -u "$target_user" -- kwriteconfig6 --file kwinrc --group Plugins --key fallapartEnabled false 2>/dev/null || true
    runuser -u "$target_user" -- kwriteconfig6 --file kwinrc --group Plugins --key glideEnabled false 2>/dev/null || true
  fi

  echo "Please REBOOT your system now. Do not only logout/login."
  echo ""
}

post_upgrade() {
  post_install
}

post_remove() {
  echo "Burning Windows has been removed. Reboot KDE Plasma to fully unload the effect."
}