You are not logged in.
Pages: 1
Hello EDX-0, I like your shell approach and the idea of being agnostic of window system. init-system or whatever is there. (I'm using a similar thing for my own stuff on Raspberry Pi.) I have a small suggestion just in case there are distro maintainers with aversion of too much shell commands:
get_shed_cgroup_2() {
awk '
BEGIN {
pid = ARGV[1];
cmd = "ps ax -o pid,cgroup,cmd=CMD ";
while (cmd | getline > 0) {
if ($0 ~ /grep/ || $0 !~ /shed/)
continue;
else if ($1 != pid)
continue;
sub(/^.*::\//, "", $2);
print $2;
}
}' "$shed_pid"
}
shed_pid=$$
get_shed_cgroup
get_shed_cgroup_2Pages: 1