Skip to content

Commit

Permalink
add hooks to monitoring install nvidia hibrid
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbarnabedikartola committed Sep 20, 2023
1 parent 016f75b commit 05b7b41
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkgbuild/pkgbuild.install
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ post_remove() {
fi
#add users to $folderType
for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
folderType+=(/home/"${user}"/.local/share/applications)
if [ -e /home/"${user}"/.local/share/applications ];then
folderType+=(/home/"${user}"/.local/share/applications)
fi
done

RenderType=(
Expand Down
13 changes: 13 additions & 0 deletions usr/share/libalpm/hooks/render-menu-options-add.hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade

Target = usr/bin/optimus-manager
Target = usr/bin/prime-run
Target = usr/bin/switcherooctl

[Action]
Description = Add Render Menu
When = PostTransaction
Exec = /usr/share/libalpm/scripts/render-menu-options-add.sh
5 changes: 5 additions & 0 deletions usr/share/libalpm/scripts/render-menu-options-add.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

sudo systemctl start render-menu-options.service
sudo systemctl start render-menu-options-flatpak.service
systemctl --user start render-menu-options-user.service
4 changes: 3 additions & 1 deletion usr/share/libalpm/scripts/render-menu-options-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ if [ -d /var/lib/flatpak/exports/share/applications ];then
fi
#add users to $folderType
for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do
folderType+=(/home/"${user}"/.local/share/applications)
if [ -e /home/"${user}"/.local/share/applications ];then
folderType+=(/home/"${user}"/.local/share/applications)
fi
done

RenderType=(
Expand Down

0 comments on commit 05b7b41

Please sign in to comment.