diff options
author | Claudia Pellegrino | 2023-03-04 00:12:39 +0100 |
---|---|---|
committer | Claudia Pellegrino | 2023-03-04 01:16:35 +0100 |
commit | 2fa2b17e955de3d8a1ad0cddfd17d9b0caf50cee (patch) | |
tree | 48a3f28943fa62426910d337a95d921232a0cb75 | |
download | aur-2fa2b17e955de3d8a1ad0cddfd17d9b0caf50cee.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | .editorconfig | 23 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | 1password-blur-me-not.install | 14 | ||||
-rw-r--r-- | PKGBUILD | 112 | ||||
-rw-r--r-- | electron-blur-me-not-patch.sh | 14 | ||||
-rw-r--r-- | electron-blur-me-not-unpatch.sh | 15 | ||||
-rw-r--r-- | electron-blur-me-not.hook | 10 | ||||
-rw-r--r-- | electron-flags.conf | 2 | ||||
-rw-r--r-- | electron-launcher.sh | 21 | ||||
-rw-r--r-- | rambox-pro-bin-blur-me-not.install | 14 | ||||
-rw-r--r-- | signal-desktop-blur-me-not.install | 14 | ||||
-rw-r--r-- | spotify-blur-me-not.install | 14 |
13 files changed, 290 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..76987a7e0c9e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = electron-blur-me-not + pkgdesc = Auto-enable Wayland (ozone) for apps that come with a vendored Electron + pkgver = 0.1.2 + pkgrel = 1 + url = https://aur.archlinux.org/packages/electron-blur-me-not + arch = any + license = Apache + options = !strip + source = electron-blur-me-not.hook + source = electron-blur-me-not-patch.sh + source = electron-blur-me-not-unpatch.sh + source = electron-flags.conf + source = electron-launcher.sh + sha512sums = 5057477e2155a61a110a106e66376137f19472df215383435885529f6d8fbdc533ad912cb6a964cc2c8112d93f2443540729c3877b2259268729040c860f4506 + sha512sums = 331d86cdb0d10a82dfae45331a34a22b2938895fe874b10433674f33f9aed851289ab8cbbba35fce38bae376bcd83c82537592ee17cdfd930c1bf1db3cef8748 + sha512sums = bbe9bcbd7b6f2cd50061ba56d3e123fb76c734f2a878a2d40f7cceb5e300ab5de2127628c450bb979a64fd14abd38b867e87b70e6269710f9f459431d5d46d59 + sha512sums = 5f623fe7d7d750b19072ba6bd3a0ab44a46f938040c4cdfa0d8ba5ec78e6345f0b3793a8fb8950a65c39d661d7a2ac4f1cffd5c981b96385729c4c05a6fd5f3a + sha512sums = fe94d357a5da3333beaa88d1dc9a02b75c6d07ab83d32029f8ac216e783cfc8a90f4bdad2b6e01a10d796228acface0896240528811def3cfee70c13d40807d1 + +pkgname = 1password-blur-me-not + pkgdesc = Auto-enable Wayland (ozone) for 1passwordAuto-enable Wayland (ozone) for 1Password + +pkgname = rambox-pro-bin-blur-me-not + pkgdesc = Auto-enable Wayland (ozone) for rambox-pro-binAuto-enable Wayland (ozone) for Rambox Pro + +pkgname = signal-desktop-blur-me-not + pkgdesc = Auto-enable Wayland (ozone) for signal-desktopAuto-enable Wayland (ozone) for Signal Desktop + +pkgname = spotify-blur-me-not + pkgdesc = Auto-enable Wayland (ozone) for spotifyAuto-enable Wayland (ozone) for Spotify diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..8708e47d3a84 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{diff,patch}] +end_of_line = lf +trim_trailing_whitespace = false + +[PKGBUILD] +indent_size = 2 + +[*.json] +indent_size = 2 + +[*.sh] +indent_size = 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..37dd117487ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/.vscode/ +/src +/pkg +*.log +*.pkg.* +*.tar.* +*.zip diff --git a/1password-blur-me-not.install b/1password-blur-me-not.install new file mode 100644 index 000000000000..d531e7a36b3d --- /dev/null +++ b/1password-blur-me-not.install @@ -0,0 +1,14 @@ +post_install() { + echo >&2 'Enabling Wayland (ozone) for 1password...' + /usr/share/libalpm/scripts/1password-blur-me-not-patch +} + +post_upgrade() { + echo >&2 'Enabling Wayland (ozone) for 1password...' + /usr/share/libalpm/scripts/1password-blur-me-not-patch +} + +pre_remove() { + echo >&2 'Undoing modifications to 1password...' + /usr/share/libalpm/scripts/1password-blur-me-not-unpatch +} diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d2329f71897d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,112 @@ +# Maintainer: Claudia Pellegrino <aur ät cpellegrino.de> + +pkgbase=electron-blur-me-not + +# Some pkgnames are commented out; this means that no `blur-me-not` +# package is required for those. Instead, create a flags file in +# `~/.config` (or in `XDG_CONFIG_HOME`), and add the necessary flags +# to that file. The name of the flags file varies per package. +# Using a flags file is much simpler than a `blur-me-not` package. +pkgname=( + '1password-blur-me-not' + # 'code' -- create a `code-flags.conf` file instead + 'rambox-pro-bin-blur-me-not' + 'signal-desktop-blur-me-not' + 'spotify-blur-me-not' +) + +pkgver=0.1.2 +pkgrel=1 +pkgdesc='Auto-enable Wayland (ozone) for apps that come with a vendored Electron' +arch=('any') +url='https://aur.archlinux.org/packages/electron-blur-me-not' +license=('Apache') +options=('!strip') + +source=( + "${pkgbase}.hook" + "${pkgbase}-patch.sh" + "${pkgbase}-unpatch.sh" + 'electron-flags.conf' + 'electron-launcher.sh' +) + +sha512sums=( + '5057477e2155a61a110a106e66376137f19472df215383435885529f6d8fbdc533ad912cb6a964cc2c8112d93f2443540729c3877b2259268729040c860f4506' + '331d86cdb0d10a82dfae45331a34a22b2938895fe874b10433674f33f9aed851289ab8cbbba35fce38bae376bcd83c82537592ee17cdfd930c1bf1db3cef8748' + 'bbe9bcbd7b6f2cd50061ba56d3e123fb76c734f2a878a2d40f7cceb5e300ab5de2127628c450bb979a64fd14abd38b867e87b70e6269710f9f459431d5d46d59' + '5f623fe7d7d750b19072ba6bd3a0ab44a46f938040c4cdfa0d8ba5ec78e6345f0b3793a8fb8950a65c39d661d7a2ac4f1cffd5c981b96385729c4c05a6fd5f3a' + 'fe94d357a5da3333beaa88d1dc9a02b75c6d07ab83d32029f8ac216e783cfc8a90f4bdad2b6e01a10d796228acface0896240528811def3cfee70c13d40807d1' +) + +_pkgdesc() { + printf 'Auto-enable Wayland (ozone) for %s' \ + "${pkgname%-blur-me-not}" "${1?}" +} + +# shellcheck disable=SC2128 # during execution, pkgname is a string +_package() { + local _executable + _executable="${1?}" + depends=("${pkgname%-blur-me-not}") + install="${pkgname}.install" + + mkdir -p \ + "${pkgdir}/usr/share/${pkgname}" \ + "${pkgdir}/usr/share/libalpm/hooks" \ + "${pkgdir}/usr/share/libalpm/scripts" + + install -D -m 644 -T \ + "${srcdir}/electron-flags.conf" \ + "${pkgdir}/etc/${pkgname%-blur-me-not}-flags.conf" + + sed \ + -e "s/{{basename}}/${pkgname%-blur-me-not}/g" \ + -e "s#{{executable}}#${_executable}#g" \ + "${srcdir}/electron-launcher.sh" \ + > "${pkgdir}/usr/share/${pkgname}/${_executable##*/}-launcher.sh" + sed \ + -e "s#{{launcher}}#/usr/share/${pkgname}/${_executable##*/}-launcher.sh#g" \ + -e "s#{{target}}#/usr/bin/${_executable##*/}#g" \ + "${srcdir}/${pkgbase}-patch.sh" \ + > "${pkgdir}/usr/share/libalpm/scripts/${pkgname}-patch" + sed \ + -e "s#{{executable}}#${_executable}#g" \ + -e "s#{{target}}#/usr/bin/${_executable##*/}#g" \ + "${srcdir}/${pkgbase}-unpatch.sh" \ + > "${pkgdir}/usr/share/libalpm/scripts/${pkgname}-unpatch" + sed \ + -e "s#{{executable}}#${_executable}#g" \ + -e "s#{{target}}#/usr/bin/${_executable##*/}#g" \ + "${srcdir}/${pkgbase}-unpatch.sh" \ + > "${pkgdir}/usr/share/libalpm/scripts/${pkgname}-unpatch" + + chmod 755 "${pkgdir}/usr/share/libalpm/scripts/${pkgname}-patch" + chmod 755 "${pkgdir}/usr/share/libalpm/scripts/${pkgname}-unpatch" + chmod 755 "${pkgdir}/usr/share/${pkgname}/${_executable##*/}-launcher.sh" + + sed \ + -e "s/{{basename}}/${pkgname%-blur-me-not}/g" \ + "${srcdir}/${pkgbase}.hook" \ + > "${pkgdir}/usr/share/libalpm/hooks/${pkgname}.hook" +} + +package_1password-blur-me-not() { + pkgdesc="$(_pkgdesc '1Password')" + _package '/opt/1Password/1password' +} + +package_rambox-pro-bin-blur-me-not() { + pkgdesc="$(_pkgdesc 'Rambox Pro')" + _package '/opt/rambox/rambox' +} + +package_signal-desktop-blur-me-not() { + pkgdesc="$(_pkgdesc 'Signal Desktop')" + _package '/usr/lib/signal-desktop/signal-desktop' +} + +package_spotify-blur-me-not() { + pkgdesc="$(_pkgdesc 'Spotify')" + _package '/opt/spotify/spotify' +} diff --git a/electron-blur-me-not-patch.sh b/electron-blur-me-not-patch.sh new file mode 100644 index 000000000000..43428546a2b6 --- /dev/null +++ b/electron-blur-me-not-patch.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ ! -e '{{launcher}}' ]]; then + echo >&2 'Not modifying {{target}} because {{launcher}} is not installed.' + exit 0 +fi + +if [[ ! -L '{{target}}' ]]; then + echo >&2 'Not modifying {{target}} because it is not a symlink.' + exit 0 +fi + +# Modify symlink so it points to the launcher script +exec ln -fnsv '{{launcher}}' '{{target}}' diff --git a/electron-blur-me-not-unpatch.sh b/electron-blur-me-not-unpatch.sh new file mode 100644 index 000000000000..2e5e6198e42f --- /dev/null +++ b/electron-blur-me-not-unpatch.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ ! -e '{{executable}}' ]]; then + echo >&2 'Not modifying {{target}} because {{executable}} is not installed.' + exit 0 +fi + +if [[ ! -L '{{target}}' ]]; then + echo >&2 'Not modifying {{target}} because it is not a symlink.' + exit 0 +fi + +# Modify symlink so it points to the original executable +echo >&2 'Restoring original {{target}}' +exec ln -fnsv '{{executable}}' '{{target}}' diff --git a/electron-blur-me-not.hook b/electron-blur-me-not.hook new file mode 100644 index 000000000000..e16f2dada066 --- /dev/null +++ b/electron-blur-me-not.hook @@ -0,0 +1,10 @@ +[Trigger] +Type = Package +Operation = Install +Operation = Upgrade +Target = {{basename}} + +[Action] +Description = Enabling Wayland (ozone) for {{basename}}... +Exec = /usr/share/libalpm/scripts/{{basename}}-blur-me-not-patch +When = PostTransaction diff --git a/electron-flags.conf b/electron-flags.conf new file mode 100644 index 000000000000..51bdd86fd3be --- /dev/null +++ b/electron-flags.conf @@ -0,0 +1,2 @@ +--enable-features=UseOzonePlatform +--ozone-platform=wayland diff --git a/electron-launcher.sh b/electron-launcher.sh new file mode 100644 index 000000000000..82df9a5331f8 --- /dev/null +++ b/electron-launcher.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -eu -o pipefail + +basename='{{basename}}' +flags_file="${XDG_CONFIG_HOME:-${HOME}/.config}/${basename}-flags.conf" +flags=() + +if [[ ! -e "${flags_file}" ]]; then + flags_file="/etc/${basename}-flags.conf" +fi + +if [[ -e "${flags_file}" ]]; then + while read -r flag; do + if [[ "${flag}" != *(' ')'#'* ]]; then + flags+=("${flag}") + fi + done < "${flags_file}" +fi + +exec '{{executable}}' "${flags[@]}" "$@" diff --git a/rambox-pro-bin-blur-me-not.install b/rambox-pro-bin-blur-me-not.install new file mode 100644 index 000000000000..c7794d9bca0b --- /dev/null +++ b/rambox-pro-bin-blur-me-not.install @@ -0,0 +1,14 @@ +post_install() { + echo >&2 'Enabling Wayland (ozone) for rambox-pro-bin...' + /usr/share/libalpm/scripts/rambox-pro-bin-blur-me-not-patch +} + +post_upgrade() { + echo >&2 'Enabling Wayland (ozone) for rambox-pro-bin...' + /usr/share/libalpm/scripts/rambox-pro-bin-blur-me-not-patch +} + +pre_remove() { + echo >&2 'Undoing modifications to rambox-pro-bin...' + /usr/share/libalpm/scripts/rambox-pro-bin-blur-me-not-unpatch +} diff --git a/signal-desktop-blur-me-not.install b/signal-desktop-blur-me-not.install new file mode 100644 index 000000000000..292eecf7345c --- /dev/null +++ b/signal-desktop-blur-me-not.install @@ -0,0 +1,14 @@ +post_install() { + echo >&2 'Enabling Wayland (ozone) for signal-desktop...' + /usr/share/libalpm/scripts/signal-desktop-blur-me-not-patch +} + +post_upgrade() { + echo >&2 'Enabling Wayland (ozone) for signal-desktop...' + /usr/share/libalpm/scripts/signal-desktop-blur-me-not-patch +} + +pre_remove() { + echo >&2 'Undoing modifications to signal-desktop...' + /usr/share/libalpm/scripts/signal-desktop-blur-me-not-unpatch +} diff --git a/spotify-blur-me-not.install b/spotify-blur-me-not.install new file mode 100644 index 000000000000..aa413d8adb76 --- /dev/null +++ b/spotify-blur-me-not.install @@ -0,0 +1,14 @@ +post_install() { + echo >&2 'Enabling Wayland (ozone) for spotify...' + /usr/share/libalpm/scripts/spotify-blur-me-not-patch +} + +post_upgrade() { + echo >&2 'Enabling Wayland (ozone) for spotify...' + /usr/share/libalpm/scripts/spotify-blur-me-not-patch +} + +pre_remove() { + echo >&2 'Undoing modifications to spotify...' + /usr/share/libalpm/scripts/spotify-blur-me-not-unpatch +} |