22 lines
506 B
Nim
22 lines
506 B
Nim
import base
|
|
import std/[strutils,osproc]
|
|
|
|
# Basically just a wrapper to style passmenu nicely
|
|
proc main() =
|
|
var info = newInfo(capitalizeAscii(run_command))
|
|
let cmd = genDmenuCmd(info)
|
|
discard execCmd(cmd)
|
|
return
|
|
|
|
if isMainModule:
|
|
base.command_wrapper = true
|
|
for idx, arg in args:
|
|
case arg:
|
|
of "-r", "--run":
|
|
run_command = args[idx + 1]
|
|
break
|
|
else:
|
|
echo "No command given, please run again with `[-r|--run] __cmd__`"
|
|
|
|
if run_command != "":
|
|
main()
|