From c341c9242a4ebcb3d5998af7e1078b6c5fe59b83 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Thu, 23 Nov 2023 09:41:16 +0000 Subject: [PATCH] added emurrji --- src/common.nim | 2 ++ src/dispatcher.nim | 3 +++ src/{util/emurrji/src => }/lib/emurrjilist.nim | 0 src/model/config.nim | 9 ++------- src/model/tool.nim | 10 ++++++++++ src/output.nim | 3 +++ src/parser.nim | 2 ++ src/util/{emurrji/src => }/emurrji.nim | 12 ++++++------ src/util/emurrji/emurrji.nimble | 13 ------------- 9 files changed, 28 insertions(+), 26 deletions(-) rename src/{util/emurrji/src => }/lib/emurrjilist.nim (100%) create mode 100644 src/model/tool.nim rename src/util/{emurrji/src => }/emurrji.nim (75%) delete mode 100644 src/util/emurrji/emurrji.nimble diff --git a/src/common.nim b/src/common.nim index 488e05c..58e7a4c 100644 --- a/src/common.nim +++ b/src/common.nim @@ -1,8 +1,10 @@ import model/config +import model/tool import model/info import model/extraargs export config +export tool export info export extraargs diff --git a/src/dispatcher.nim b/src/dispatcher.nim index 340348f..527fd1b 100644 --- a/src/dispatcher.nim +++ b/src/dispatcher.nim @@ -5,6 +5,7 @@ import util/pingclock import util/batturry import util/volurrme import util/netwurrk +import util/emurrji proc dispatch*(cfg: Config) = case cfg.run @@ -18,5 +19,7 @@ proc dispatch*(cfg: Config) = volurrme.go() of Netwurrk: netwurrk.go() + of Emurrji: + emurrji.go() else: echo "No valid run command given" diff --git a/src/util/emurrji/src/lib/emurrjilist.nim b/src/lib/emurrjilist.nim similarity index 100% rename from src/util/emurrji/src/lib/emurrjilist.nim rename to src/lib/emurrjilist.nim diff --git a/src/model/config.nim b/src/model/config.nim index 61f1a04..c74997c 100644 --- a/src/model/config.nim +++ b/src/model/config.nim @@ -1,6 +1,8 @@ import os import parsetoml + import extraargs +import tool type Config* = ref object @@ -9,13 +11,6 @@ type max_lines*: int prepend*: bool extra_args*: seq[ExtraArg] - Tool* = enum - None, - FurryTime, - PingClock, - Batturry, - Volurrme, - Netwurrk let config_dir* = getHomeDir() & ".config/wm_tools/" let config_file* = config_dir & "config.toml" diff --git a/src/model/tool.nim b/src/model/tool.nim new file mode 100644 index 0000000..60853f5 --- /dev/null +++ b/src/model/tool.nim @@ -0,0 +1,10 @@ + +type + Tool* = enum + None, + FurryTime, + PingClock, + Batturry, + Volurrme, + Netwurrk, + Emurrji diff --git a/src/output.nim b/src/output.nim index 6941d4f..ea3ce37 100644 --- a/src/output.nim +++ b/src/output.nim @@ -21,6 +21,9 @@ proc markup(str: string): string = var text = stripQuotes(str) return text +proc copyToClipboard*(str: string): bool {.discardable.} = + return false + proc genMenuCmd(data: Info, opts: varargs[string]): string = var cmd = "" var x_lines = len(opts) + 1 diff --git a/src/parser.nim b/src/parser.nim index 216d491..670c18b 100644 --- a/src/parser.nim +++ b/src/parser.nim @@ -23,6 +23,8 @@ proc parseArgs*() = myConfig.run = Volurrme of "netwurrk", "network", "net": myConfig.run = Netwurrk + of "emurrji", "emoji": + myConfig.run = Emurrji else: echo p.help quit(1) diff --git a/src/util/emurrji/src/emurrji.nim b/src/util/emurrji.nim similarity index 75% rename from src/util/emurrji/src/emurrji.nim rename to src/util/emurrji.nim index 6513f51..eec8bdd 100644 --- a/src/util/emurrji/src/emurrji.nim +++ b/src/util/emurrji.nim @@ -1,8 +1,10 @@ -import ../../globurrl -import lib/emurrjilist -import std/[re] +import ../lib/emurrjilist +import ../common +import ../output -proc main() = +import re + +proc go*() = var info = newInfo("Emurrji") var args = getEmoji() args.add("exit") @@ -16,5 +18,3 @@ proc main() = copyToClipboard(emoji) return -if isMainModule: - main() diff --git a/src/util/emurrji/emurrji.nimble b/src/util/emurrji/emurrji.nimble deleted file mode 100644 index a77390a..0000000 --- a/src/util/emurrji/emurrji.nimble +++ /dev/null @@ -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"