Compare commits

..

No commits in common. "9713f40fac11eacad9b858a875bad8608439a48f" and "310b8d9c1e4c333618cd898bccdf8cff70ca5d21" have entirely different histories.

6 changed files with 1578 additions and 3648 deletions

View file

@ -17,7 +17,6 @@ which are selectable options in dmenu.
- `notes` a simple one liner note taking tool, displaying notes in `dmenu`/`rofi`
- `calculate` a calculator, utilising `qalculate` - inspired by [@fedops](https://codeberg.org/fedops/scripts)
- `emoji` an emoji picker
- `remmina` reads the files in your remmina config directory and allows you to connect to and edit them
The next two do not work with `rofi` unless you have `alias dmenu=rofi` set, but they're pretty nice tools

View file

@ -63,10 +63,7 @@ var passmenu* = false
var command_wrapper* = false
var run_command* = ""
proc newInfo*(str: string = "Info"): Info =
var title = str
if rofi:
title = title & " : "
proc newInfo*(title: string = "Info"): Info =
return Info(
title: title,
selected_fg: black,

View file

@ -1,19 +1,18 @@
import base
import lib/emojilist
import lib/codemap
import std/[re,osproc,algorithm]
proc main() =
var info = newInfo("Emoji Picker")
var args = getEmoji()
var args = emojiCodemap
args.add("exit")
let output = outputData(info,args)
if output == "exit" or output == "":
return
else:
let e = re.findAll(output,re(".+ :"))
if len(e) > 0:
let emoji = re.replace(e[0], re(" :"),"")
copyToClipboard(emoji)
let emoji = re.replace(e[0], re(" :"),"")
copyToClipboard(emoji)
return
if isMainModule:

1573
lib/codemap.nim Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,66 +0,0 @@
import base
import lib/emojilist
import std/[re,os,osproc,tables,algorithm]
import configparser
const REMMINA_DIR = getHomeDir() & ".local/share/remmina"
var sessions = initTable[string,string]()
var names: seq[string] = @[]
proc main()
proc getRemminaFiles(): seq[string] =
if len(names) < 1:
for file in walkFiles(REMMINA_DIR & "/*.remmina"):
let content = readFile(file)
let ini = parseIni(content)
let group = ini.getProperty("remmina","group")
let name = ini.getProperty("remmina","name")
let server = ini.getProperty("remmina","server")
if name != "" and server != "":
let slug = group & " : " & name & " : (" & server & ")"
sessions[slug] = file
names.add(slug)
names.sort()
return names
proc editRemmina(conn: string) =
let session = sessions[conn]
discard execCmd("remmina -e " & quote(session))
proc startRemmina(conn: string) =
let session = sessions[conn]
discard execCmd("remmina -c " & quote(session))
proc selectRemmina(conn: string) =
var info = newInfo("Remmina : " & conn)
let args = @["connect", "edit", "back"]
let output = outputData(info,args)
if output in args:
case output:
of "connect":
startRemmina(conn)
of "edit":
editRemmina(conn)
of "back":
main()
proc main() =
var info = newInfo("Remmina")
var args: seq[string] = getRemminaFiles()
args.add("new")
args.add("exit")
let output = outputData(info,args)
if output == "exit" or output == "":
return
elif output == "new":
discard execCmd("remmina --new")
elif output in names:
selectRemmina(output)
return
return
if isMainModule:
main()