readme changes, added passwurrd to readme

This commit is contained in:
Paul Wilde 2022-07-20 09:18:57 +01:00
parent 9adec53b26
commit 3756444021
2 changed files with 23 additions and 17 deletions

View file

@ -20,10 +20,8 @@ which are selectable options in dmenu.
- `remmina_choosurr` reads the files in your remmina config directory and allows you to connect to and edit them
- `translaturr` utilises libretranslate (you'll need and API key or your own instance) to translate test. Prefix the text with `en>de`, `de>en`, `en>fr`, etc. as you need. Must be compiled with `-d:ssl`
- `clipurr` clipboard manager
The next two do not work with `rofi` unless you have `alias dmenu=rofi` set, but they're pretty nice tools
- `cmd_wrappurr` inspired by passmenu_wrapper, a basic tool to run other `dmenu` related tools with uniform styling.
- `passwuurd` a passmenu clone, that works in rofi too
- `cmd_wrappurr` a basic tool to run other `dmenu` related tools with uniform styling.
- For example: `dmenu_run`, `clipmenu`, `passmenu` etc.
### Why do all the tools have "urr" in them?

View file

@ -2,7 +2,11 @@ import ../../globurrl
import std/[osproc,json,strutils]
const I3_WORKSPACES = "i3-msg -t get_workspaces"
const SWAY_WORKSPACES = "swaymsg -t get_workspaces"
let WORKSPACES = if wayland: SWAY_WORKSPACES else: I3_WORKSPACES
const I3_TREE = "i3-msg -t get_tree"
const SWAY_TREE = "swaymsg -t get_tree"
let TREE = if wayland: SWAY_TREE else: I3_TREE
const VISIBLE = "#"
const URGENT = "!"
const FOCUSED = "%"
@ -64,6 +68,10 @@ proc switchWorkspace(workspace: string) =
let ws = findWorkspace(workspace)
if ws.num == current_workspace:
return
if wayland:
let cmd = "swaymsg workspace " & $ws.num
discard execCmd(cmd)
else:
let cmd = "i3-msg workspace " & $ws.num
discard execCmd(cmd)
showWorkspaces()
@ -159,14 +167,14 @@ proc findWorkspacesTree(node: JsonNode, parent: Workspace = Workspace()) =
return
proc getTree() =
let cur_workspaces = execCmdEx(I3_TREE)
let cur_workspaces = execCmdEx(TREE)
if cur_workspaces.output != "":
let root = parseJson(cur_workspaces.output)
findWorkspacesTree(root)
return
proc getWorkspaces(): seq[Workspace] =
let cur_workspaces = execCmdEx(I3_WORKSPACES)
let cur_workspaces = execCmdEx(WORKSPACES)
if cur_workspaces.output != "":
let ws = parseJson(cur_workspaces.output)
for w in ws: