config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 1816757050d89815f71f2666de06ce2b9cb395b5
parent 1cefe565f26f8efd592e1cc2c6d8e41550beabcc
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Fri, 26 Mar 2021 22:55:21 -0700

Rewrite mark script

Simply concatenate files instead of listing with catagories. I'm
still not happy with how it works but I never use it and don't have
the patience to make it proper. Also I updated it to use XDG_DATA_HOME
for the bookmark directory.

Diffstat:
Mlocal/bin/.local/bin/mark | 19+++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/local/bin/.local/bin/mark b/local/bin/.local/bin/mark @@ -1,17 +1,12 @@ -#!/usr/local/bin/rc -e +#!/bin/ksh # Copyright 2021 Jacob R. Edwards # License: GPLv3 # -# mark -- select a line from multiple files via dmenu(1) +# mark -- copy bookmark to the clipboard -fn clip { xclip -selection clipboard $* } -fn list { - awk '{ - base = split(FILENAME, path, "/"); - printf "%s:%s\n", path[base], $0 - }' $* -} +set -o pipefail -ifs='' -list $* | dmenu -i | cut -d: -f2- | clip -in -exec herbe `{ clip -out } & +clip() xclip -selection clipboard "$@" + +find "${XDG_DATA_HOME:-$HOME/.local/share}/mark" -type f -print0 | + xargs -0 cat | dmenu -i | clip && herbe "$(clip -out)" &