1
0
Fork 0
Helper utility to generate a bookmark lookup table for rofi / fzf
Find a file
2021-08-18 09:25:05 +02:00
test First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
.build.yml Add more README and a better example 2021-08-17 23:45:25 +02:00
.gitignore First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
bookmarks.go First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
bookmarks_test.go First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
go.mod First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
go.sum First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
LICENSE Add License 2021-08-17 23:36:24 +02:00
lookmarks-with-fzf.gif Add a quick screencapture to show a usage example w/ fzf 2021-08-18 00:01:49 +02:00
main.go First iteration, renaming rofi-marks to "lookmarks" 2021-08-17 23:34:41 +02:00
README.md Fixup typo in README and make example hierarchical 2021-08-18 09:25:05 +02:00

Lookmarks

builds.sr.ht status

Quick helper utility initially prototyped with Lucas to generate a lookup list of commonly used URLs from a standard Yaml file.

Think of it as a kind-of "bookmark builder" which enables you to generate bookmark list from a hierarchically defined Yaml structure:

bookmarks:
  - url: https://example.com
    key: example
    sub:
      - url: foo
      - url: bar
      - sub:
        - url: baz
          key: alias

Will generate the following lookup table:

key value
example https://example.com
example-foo https://example.com/foo
example-bar https://example.com/bar
example-bar-alias https://example.com/bar/baz

While this might not look that impressive on first sight, think about the possibilities for e.g. modelling GitLab's URL structure for a few different repositories by simply defining a few Yaml anchors and letting lookmarks take care of the rest:

---
gitlab_layout: &gitlab_urls
  - url: "issues"
    key: "issues"
    sub:
    - url: "%{s}"
      key: jump
    - url: "?scope=all&state=opened&assignee_username=bascht"
      key: mine
    - url: "new"
      key: create
  - url: pipelines
    key: pipelines
  - url: merge_requests

bookmarks:
  - key: gitlab
    url: https://gitlab.com/gitlab-org
    sub:
      - url: gitlab-org
        sub: *gitlab_urls
      - url: www-gitlab-com
        sub: *gitlab_urls

will generate URLs for:

  • gitlab
  • gitlab-gitlab-org
  • gitlab-gitlab-org-issues
  • gitlab-gitlab-org-issues-create
  • gitlab-gitlab-org-issues-jump
  • gitlab-gitlab-org-issues-mine
  • gitlab-gitlab-org-merge_requests
  • gitlab-gitlab-org-pipelines
  • gitlab-gitlab-org-tags
  • gitlab-gitlab-org-wikis
  • gitlab-gl-infra
  • gitlab-gl-infra-issues
  • gitlab-gl-infra-issues-create
  • gitlab-gl-infra-issues-jump
  • gitlab-gl-infra-issues-mine
  • gitlab-gl-infra-merge_requests
  • […] you probably see where this is going…

which you can then use to feed them into the tool of your choice, say fzf for example:

screencap