23 lines
499 B
Nim
23 lines
499 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]
|
||
|
else:
|
||
|
echo "No run tag given. Please run again with '--run _cmd_'"
|
||
|
break
|
||
|
|
||
|
if run_command != "":
|
||
|
main()
|