about summary refs log tree commit diff stats
path: root/pkgs/by-name/ne/neorg/functions/dmenu.sh
blob: 5a1389827451935caa689fce513ae22002e531e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env dash

dmenu0open_context_in_browser() {
    project="$(echo "%ALL_PROJECTS_PIPE" | rofi -sep "|" -dmenu)"

    if [ "$project" ]; then
        [ -d "%NEORG_REVIEW_PATH" ] || mkdir --parents "%NEORG_REVIEW_PATH"
        [ -f "%NEORG_REVIEW_PATH/$project.lock" ] || touch "%NEORG_REVIEW_PATH/$project.lock"
        project0open_project_in_browser "$project"
    else
        notify-send "(neorg/dmenu) No project selected"
        exit 1
    fi
}