Rewrite layout switcher in Nim #3

Merged
tio merged 8 commits from nim-rewrite into master 2023-12-26 00:08:43 +00:00
Showing only changes of commit b7578dd97f - Show all commits

10
sharedModule.nim Normal file
View File

@ -0,0 +1,10 @@
from std/osproc import startProcess, ProcessOption, waitForExit, close
proc runCommand*(command: string, args: openArray[string]): int =
## This will run a command with the given args and return its exit code upon completion
let process = startProcess(command, args=args, options={poParentStreams})
result = process.waitForExit()
process.close()
proc isGlobalMenuEnabled*(): bool =
return runCommand("/usr/bin/pacman", ["-Qq", "vala-panel-appmenu-registrar"]) == 0