Skip to content

Commit

Permalink
Fixed hotcorners to run on multiple accounts independently.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Vlijm committed Jan 27, 2018
1 parent 261b1a4 commit 2c192d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions budgie-hotcorners/bhcorners
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def watch():
n = 0
res = None
corner1 = None
user = bhc.user

while True:
time.sleep(t)
Expand All @@ -34,6 +35,8 @@ def watch():
if all([res2, res != res2]):
res = res2
elif n == 3:
if user not in subprocess.check_output("who").decode("utf-8"):
break
try:
check = subprocess.check_output([
"dconf", "dump", dcpath + key + "/"
Expand Down
2 changes: 2 additions & 0 deletions budgie-hotcorners/bhctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
dr = os.path.join(os.environ["HOME"], ".config", "budgie-extras", "hotcorners")
# settings file
settings = os.path.join(dr, "hotc_settings")
# user, to make sure all procs run per user
user = os.environ["USER"]


def get(cmd):
Expand Down
4 changes: 2 additions & 2 deletions budgie-hotcorners/budgie_hcorners.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import gi.repository
gi.require_version('Budgie', '1.0')
from gi.repository import Budgie, GObject, Gtk
from bhctools import get, dr, settings
from bhctools import get, dr, settings, user


"""
Expand Down Expand Up @@ -241,7 +241,7 @@ def switch_entry(self, button, n):

def close_running(self):
try:
pid = get(["pgrep", "-f", app]).splitlines()
pid = get(["pgrep", "-f", "-u", user, app]).splitlines()
except AttributeError:
pass
else:
Expand Down

0 comments on commit 2c192d6

Please sign in to comment.