aboutsummaryrefslogtreecommitdiff
path: root/ayatanasettings/psutil.py
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2024-08-27 14:43:59 +0200
committerRobert Tari <robert@tari.in>2024-08-27 14:43:59 +0200
commit269aa4c7df03e1e581c01866c91bcfa5524d6334 (patch)
tree2fcd022cbfcb82537b15ae334b563cfaf16e5dde /ayatanasettings/psutil.py
parent4bfbd579171d9194956376c7153f378ff6eb9d4e (diff)
downloadayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.tar.gz
ayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.tar.bz2
ayatana-settings-269aa4c7df03e1e581c01866c91bcfa5524d6334.zip
Rewrite using C/CMake/Gtk4 and add some features/tweaks
Diffstat (limited to 'ayatanasettings/psutil.py')
-rw-r--r--ayatanasettings/psutil.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/ayatanasettings/psutil.py b/ayatanasettings/psutil.py
deleted file mode 100644
index acdbe67..0000000
--- a/ayatanasettings/psutil.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-import psutil
-import os
-from .appdata import APPNAME
-
-def isRunning():
-
- for pProc in psutil.process_iter():
-
- sName = pProc.name
-
- if not isinstance(sName, str):
-
- sName = pProc.name()
-
- if sName == 'python3' or sName == 'python':
-
- lCmdLine = pProc.cmdline
-
- if not isinstance(lCmdLine, list):
-
- lCmdLine = pProc.cmdline()
-
- for sCmd in lCmdLine:
-
- if sCmd.endswith(APPNAME) and pProc.pid != os.getpid():
-
- return True
-
- elif sName.endswith(APPNAME) and pProc.pid != os.getpid():
-
- return True
-
- return False
-
-def isSystemd():
-
- for pProc in psutil.process_iter():
-
- sName = pProc.name
-
- if not isinstance(sName, str):
-
- sName = pProc.name()
-
- if sName == 'systemd':
-
- lCmdLine = pProc.cmdline
-
- if not isinstance(lCmdLine, list):
-
- lCmdLine = pProc.cmdline()
-
- for sCmd in lCmdLine:
-
- if sCmd == '--user':
-
- return True
-
- return False