added reminurr
This commit is contained in:
parent
ae102073b8
commit
079c5d9526
7 changed files with 21 additions and 34 deletions
|
@ -7,6 +7,7 @@ import util/volurrme
|
|||
import util/netwurrk
|
||||
import util/emurrji
|
||||
import util/calendurr
|
||||
import util/remminurr
|
||||
|
||||
proc dispatch*(cfg: Config) =
|
||||
case cfg.run
|
||||
|
@ -24,5 +25,7 @@ proc dispatch*(cfg: Config) =
|
|||
emurrji.go()
|
||||
of Calendurr:
|
||||
calendurr.go()
|
||||
of Remminurr:
|
||||
remminurr.go()
|
||||
else:
|
||||
echo "No valid run command given"
|
||||
|
|
|
@ -8,4 +8,5 @@ type
|
|||
Volurrme,
|
||||
Netwurrk,
|
||||
Emurrji,
|
||||
Calendurr
|
||||
Calendurr,
|
||||
Remminurr
|
||||
|
|
|
@ -7,7 +7,7 @@ proc stripQuotes(str: string): string =
|
|||
var text = replace(str,"\"",""")
|
||||
return text
|
||||
|
||||
proc quote(str: string): string =
|
||||
proc quote*(str: string): string =
|
||||
var text = str
|
||||
# May need to put some further work to escape some special chars here
|
||||
text = stripQuotes(text)
|
||||
|
|
|
@ -27,6 +27,8 @@ proc parseArgs*() =
|
|||
myConfig.run = Emurrji
|
||||
of "calendurr", "calender", "cal":
|
||||
myConfig.run = Calendurr
|
||||
of "remminurr", "remmina", "rdp", "rem":
|
||||
myConfig.run = Remminurr
|
||||
else:
|
||||
echo p.help
|
||||
quit(1)
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "Paul Wilde"
|
||||
description = "A Remmina client tool and opener"
|
||||
license = "GPL-3.0-or-later"
|
||||
srcDir = "src"
|
||||
bin = @["remmina_choosurr"]
|
||||
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 1.6.6"
|
||||
requires "configparser >= 0.1.0"
|
|
@ -1,20 +1,18 @@
|
|||
import ../../globurrl
|
||||
import std/[os,osproc,tables,algorithm]
|
||||
import os
|
||||
import osproc
|
||||
import tables
|
||||
import algorithm
|
||||
|
||||
import configparser
|
||||
|
||||
import ../common
|
||||
import ../output
|
||||
|
||||
const REMMINA_DIR = getHomeDir() & ".local/share/remmina"
|
||||
const SWITCH_WS = false
|
||||
const REMMINA_WS = "4"
|
||||
|
||||
var sessions = initTable[string,string]()
|
||||
var names: seq[string] = @[]
|
||||
|
||||
proc main()
|
||||
|
||||
proc switchWorkspace() =
|
||||
if SWITCH_WS and REMMINA_WS != "":
|
||||
discard execCmd("i3-msg workspace number " & REMMINA_WS)
|
||||
|
||||
proc getRemminaFiles(): seq[string] =
|
||||
if len(names) < 1:
|
||||
for file in walkFiles(REMMINA_DIR & "/*.remmina"):
|
||||
|
@ -38,6 +36,8 @@ proc startRemmina(conn: string) =
|
|||
let session = sessions[conn]
|
||||
discard execCmd("remmina -c " & quote(session))
|
||||
|
||||
proc go*() # adding as need to refer back to it in selectRemmina
|
||||
|
||||
proc selectRemmina(conn: string) =
|
||||
var info = newInfo("Remmina Choosurr : " & conn)
|
||||
let args = @["connect", "edit", "back"]
|
||||
|
@ -51,11 +51,9 @@ proc selectRemmina(conn: string) =
|
|||
editRemmina(conn)
|
||||
#switchWorkspace()
|
||||
of "back":
|
||||
main()
|
||||
go()
|
||||
|
||||
|
||||
|
||||
proc main() =
|
||||
proc go*() =
|
||||
var info = newInfo("Remmina Choosurr")
|
||||
var args: seq[string] = getRemminaFiles()
|
||||
args.add("new")
|
||||
|
@ -68,7 +66,3 @@ proc main() =
|
|||
elif output in names:
|
||||
selectRemmina(output)
|
||||
return
|
||||
return
|
||||
|
||||
if isMainModule:
|
||||
main()
|
|
@ -13,3 +13,4 @@ bin = @["wmtools"]
|
|||
requires "nim >= 2.0.0"
|
||||
requires "parsetoml >= 0.7.1"
|
||||
requires "argparse"
|
||||
requires "configparser"
|
||||
|
|
Loading…
Reference in a new issue