Skip to content

Commit

Permalink
Merge pull request #11 from quintenroets/support-multiple-users
Browse files Browse the repository at this point in the history
support multiple users
  • Loading branch information
academo authored Jan 17, 2025
2 parents 9714078 + 995d421 commit 90abf65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ww
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ if [ -z "$FILTERBY" ] && [ -z "$FILTERALT" ]; then
exit 1
fi

IS_RUNNING=$(pgrep -o -a -f "$COMMAND" | grep -v "$CURRENT_SCRIPT_NAME")
session_id=$(loginctl show-seat seat0 -p ActiveSession --value)
user_id=$(loginctl show-session "$session_id" -p User --value)
IS_RUNNING=$(pgrep -u "$user_id" -o -a -f "$COMMAND" | grep -v "$CURRENT_SCRIPT_NAME")

if [ -n "$IS_RUNNING" ] || [ -n "$FILTERALT" ]; then

Expand Down

0 comments on commit 90abf65

Please sign in to comment.