summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorteknsl2022-01-09 13:17:06 +0100
committerteknsl2022-01-09 13:17:06 +0100
commit06f341949cc39d269f778338fc3994e5d4343ade (patch)
tree531e37cdd3f3ce8d53bd63ea69a02a4097479fd6
parentc846ac36bd60f173aa7228b63c332bb81bde4660 (diff)
downloadaur-alacritty-xwayland.tar.gz
add revert patch function
-rwxr-xr-xalacritty-xwayland-patch7
-rw-r--r--alacritty-xwayland.install4
2 files changed, 10 insertions, 1 deletions
diff --git a/alacritty-xwayland-patch b/alacritty-xwayland-patch
index 11d9e9d3bc0d..a2a29148258d 100755
--- a/alacritty-xwayland-patch
+++ b/alacritty-xwayland-patch
@@ -1,5 +1,10 @@
#!/bin/sh
path="/usr/share/applications/Alacritty.desktop"
-sed -i "s|^Exec=|Exec=env WAYLAND_DISPLAY= |" $path
+
+if [[ "$1" = "remove" ]]; then
+ sed -i "s|^Exec=env WAYLAND_DISPLAY= |Exec=|" $path
+else
+ sed -i "s|^Exec=|Exec=env WAYLAND_DISPLAY= |" $path
+fi
diff --git a/alacritty-xwayland.install b/alacritty-xwayland.install
index cfbb11d37c06..3e58cf1f2a27 100644
--- a/alacritty-xwayland.install
+++ b/alacritty-xwayland.install
@@ -2,3 +2,7 @@ post_install() {
/usr/share/libalpm/scripts/alacritty-xwayland-patch
}
+pre_remove() {
+ /usr/share/libalpm/scripts/alacritty-xwayland-patch remove
+}
+