feat: add bash configs
This commit is contained in:
parent
fd258a4df3
commit
6ee9a85ca1
7 changed files with 275 additions and 0 deletions
27
bash/systemd.bash
Normal file
27
bash/systemd.bash
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
set-scope() {
|
||||
local scope="${1:-default-scope}"
|
||||
|
||||
systemd-run \
|
||||
--user \
|
||||
--scope \
|
||||
--unit="$scope" \
|
||||
bash
|
||||
}
|
||||
|
||||
check-scope() {
|
||||
local scope="${1:-default-scope}"
|
||||
|
||||
systemctl --user status "$scope.scope"
|
||||
}
|
||||
|
||||
shtop() {
|
||||
local scope="${1:-default-scope.scope}"
|
||||
local cg
|
||||
|
||||
cg=$(systemctl --user show \
|
||||
"$scope" \
|
||||
-p ControlGroup \
|
||||
--value) || return
|
||||
|
||||
htop -p "$(paste -sd, "/sys/fs/cgroup${cg}/cgroup.procs")"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue