Compare commits
2 commits
946f970f31
...
b32187db91
Author | SHA1 | Date | |
---|---|---|---|
b32187db91 | |||
8a5f9961ee |
1 changed files with 9 additions and 4 deletions
13
base.nim
13
base.nim
|
@ -65,10 +65,10 @@ proc debugLog*(str: string) =
|
||||||
defer: f.close()
|
defer: f.close()
|
||||||
f.writeLine(str)
|
f.writeLine(str)
|
||||||
|
|
||||||
proc switchTwmMode*() =
|
proc switchTwmMode*(mode: string = "default") =
|
||||||
# I intend to add support for more twm as time goes on (I switch around a lot)
|
# I intend to add support for more twm as time goes on (I switch around a lot)
|
||||||
# Switch out of an i3 bindsym mode if set
|
# Switch out of an i3 bindsym mode if set
|
||||||
discard execCmd("i3-msg mode \"default\"")
|
discard execCmd("i3-msg mode \"" & mode & "\"")
|
||||||
|
|
||||||
proc parseInput*(): i3BarInput =
|
proc parseInput*(): i3BarInput =
|
||||||
let input = readLineFromStdin("")
|
let input = readLineFromStdin("")
|
||||||
|
@ -88,8 +88,6 @@ proc getArguments*(): seq[string] =
|
||||||
return args
|
return args
|
||||||
|
|
||||||
proc runDMenu*(data: Info, opts: varargs[string], rofi: bool = false): string =
|
proc runDMenu*(data: Info, opts: varargs[string], rofi: bool = false): string =
|
||||||
switch_twm_mode()
|
|
||||||
|
|
||||||
# Build dmenu/rofi command
|
# Build dmenu/rofi command
|
||||||
var cmd = "echo -e \""
|
var cmd = "echo -e \""
|
||||||
# if the text is empty, we don't want to create a menu item of it
|
# if the text is empty, we don't want to create a menu item of it
|
||||||
|
@ -131,6 +129,13 @@ proc outputData*(data: Info, args: varargs[string]): string {.discardable.} =
|
||||||
output = runDmenu(data,args)
|
output = runDmenu(data,args)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# At Start up:
|
||||||
|
|
||||||
|
# Switch bindsym mode back to default as it could be being used.
|
||||||
|
switchTwmMode()
|
||||||
|
|
||||||
for arg in getArguments():
|
for arg in getArguments():
|
||||||
case arg:
|
case arg:
|
||||||
of "noloop":
|
of "noloop":
|
||||||
|
|
Loading…
Reference in a new issue