From d68a0d42c326ce5b2a67738a5e31ecd55777dc26 Mon Sep 17 00:00:00 2001 From: Jacob Parnell Date: Thu, 11 May 2023 23:20:18 -0500 Subject: [PATCH] Add doas support --- .gitignore | 1 + PKGBUILD | 13 +++++++++---- doasuser.patch | 12 ++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 doasuser.patch diff --git a/.gitignore b/.gitignore index 67a2461..bab0484 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ !.SRCINFO !90-hardcode-tray.hook !hook.py +!doasuser.patch diff --git a/PKGBUILD b/PKGBUILD index 7b50ca7..ee6c8b8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ # Contributor: Yuanji # Contributor: Bilal Elmoussaoui pkgname=hardcode-tray-git -pkgver=4.3.r224.ga91b4b7 -pkgrel=2 +pkgver=4.3.r246.g1d52b2c +pkgrel=1 pkgdesc="Fixes hardcoded tray icons" arch=('x86_64') url="https://github.com/bil-elmoussaoui/Hardcode-Tray" @@ -17,10 +17,12 @@ provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") source=("${pkgname%-git}::git+https://github.com/bil-elmoussaoui/Hardcode-Tray.git" "90-${pkgname%-git}.hook" - "hook.py") + "hook.py" + "doasuser.patch") sha256sums=('SKIP' 'c16ba6a82d4fe523cb91bf472b44296db82ff301866e3bce18bb4149d0aae5ea' - '64a9907f74c5c04fb9f32b2b0684a3ce040d3bc2baacabb3ca1e914d70f24c81') + '64a9907f74c5c04fb9f32b2b0684a3ce040d3bc2baacabb3ca1e914d70f24c81' + '8f567656707f3e1bc534f2b30b0f87a1b9df9372be27788b61044a54fec90045') pkgver() { cd "$srcdir/${pkgname%-git}" @@ -33,6 +35,9 @@ prepare() { # Correct app.asar path for community bitwarden package sed -i 's|/usr/lib/bitwarden/resources/|/usr/lib/bitwarden/|g' \ data/database/bitwarden.electron.json + + # Add doas support + patch --forward --strip=1 --input="${srcdir}/doasuser.patch" } build() { diff --git a/doasuser.patch b/doasuser.patch new file mode 100644 index 0000000..513b9a2 --- /dev/null +++ b/doasuser.patch @@ -0,0 +1,12 @@ +diff --unified --recursive --text --color hardcode-tray.orig/const.py.in hardcode-tray.new/const.py.in +--- hardcode-tray.orig/const.py.in 2023-05-04 15:16:47.519709571 -0500 ++++ hardcode-tray.new/const.py.in 2023-05-04 15:19:08.596711509 -0500 +@@ -24,7 +24,7 @@ + from HardcodeTray.tools import detect_de, get_themes + + DB_FOLDER = path.join("@DATA_DIR@", "database", "") +-USERNAME = getenv("SUDO_USER") or getenv("USER") ++USERNAME = getenv("SUDO_USER") or getenv("DOAS_USER") or getenv("USER") + USERHOME = path.expanduser("~" + USERNAME) + BACKUP_FOLDER = path.join(USERHOME, ".config", "Hardcode-Tray", "") + CONFIG_FILE = path.join(USERHOME, ".config", "hardcode-tray.json")