added emurrji

This commit is contained in:
Paul Wilde 2023-11-23 09:41:16 +00:00
parent d0142a966b
commit c341c9242a
9 changed files with 28 additions and 26 deletions

View file

@ -1,8 +1,10 @@
import model/config import model/config
import model/tool
import model/info import model/info
import model/extraargs import model/extraargs
export config export config
export tool
export info export info
export extraargs export extraargs

View file

@ -5,6 +5,7 @@ import util/pingclock
import util/batturry import util/batturry
import util/volurrme import util/volurrme
import util/netwurrk import util/netwurrk
import util/emurrji
proc dispatch*(cfg: Config) = proc dispatch*(cfg: Config) =
case cfg.run case cfg.run
@ -18,5 +19,7 @@ proc dispatch*(cfg: Config) =
volurrme.go() volurrme.go()
of Netwurrk: of Netwurrk:
netwurrk.go() netwurrk.go()
of Emurrji:
emurrji.go()
else: else:
echo "No valid run command given" echo "No valid run command given"

View file

@ -1,6 +1,8 @@
import os import os
import parsetoml import parsetoml
import extraargs import extraargs
import tool
type type
Config* = ref object Config* = ref object
@ -9,13 +11,6 @@ type
max_lines*: int max_lines*: int
prepend*: bool prepend*: bool
extra_args*: seq[ExtraArg] extra_args*: seq[ExtraArg]
Tool* = enum
None,
FurryTime,
PingClock,
Batturry,
Volurrme,
Netwurrk
let config_dir* = getHomeDir() & ".config/wm_tools/" let config_dir* = getHomeDir() & ".config/wm_tools/"
let config_file* = config_dir & "config.toml" let config_file* = config_dir & "config.toml"

10
src/model/tool.nim Normal file
View file

@ -0,0 +1,10 @@
type
Tool* = enum
None,
FurryTime,
PingClock,
Batturry,
Volurrme,
Netwurrk,
Emurrji

View file

@ -21,6 +21,9 @@ proc markup(str: string): string =
var text = stripQuotes(str) var text = stripQuotes(str)
return text return text
proc copyToClipboard*(str: string): bool {.discardable.} =
return false
proc genMenuCmd(data: Info, opts: varargs[string]): string = proc genMenuCmd(data: Info, opts: varargs[string]): string =
var cmd = "" var cmd = ""
var x_lines = len(opts) + 1 var x_lines = len(opts) + 1

View file

@ -23,6 +23,8 @@ proc parseArgs*() =
myConfig.run = Volurrme myConfig.run = Volurrme
of "netwurrk", "network", "net": of "netwurrk", "network", "net":
myConfig.run = Netwurrk myConfig.run = Netwurrk
of "emurrji", "emoji":
myConfig.run = Emurrji
else: else:
echo p.help echo p.help
quit(1) quit(1)

View file

@ -1,8 +1,10 @@
import ../../globurrl import ../lib/emurrjilist
import lib/emurrjilist import ../common
import std/[re] import ../output
proc main() = import re
proc go*() =
var info = newInfo("Emurrji") var info = newInfo("Emurrji")
var args = getEmoji() var args = getEmoji()
args.add("exit") args.add("exit")
@ -16,5 +18,3 @@ proc main() =
copyToClipboard(emoji) copyToClipboard(emoji)
return return
if isMainModule:
main()

View file

@ -1,13 +0,0 @@
# Package
version = "0.1.0"
author = "Paul Wilde"
description = "An emoji picker for dmenu/rofi"
license = "MIT"
srcDir = "src"
bin = @["emurrji"]
# Dependencies
requires "nim >= 1.6.6"