jschlatow / taskopen

Tool for taking notes and open urls with taskwarrior
GNU General Public License v2.0
363 stars 31 forks source link

taskopen - No actions applicable #164

Closed domalex closed 1 year ago

domalex commented 1 year ago
  1. TaskOpen cannot open URLs or other annotations.
  2. The default Note cannot be created with task add Notes. The required folder ~/.tasknotes has previously been created.
task 31

Name          Value
ID            31
Description   test
                2023-03-24 10:15:33 www.google.com
Status        Pending
Project       inbox
Entered       2023-03-24 08:44:42 (1h)
Last modified 2023-03-24 10:25:52 (5s)
Virtual tags  ANNOTATED LATEST PENDING PROJECT READY UNBLOCKED
UUID          f43dd2ba-85b4-42ae-bead-7faf63bc95fd
Urgency        1.8

    project          1 *    1 =      1
    annotations    0.8 *    1 =    0.8
                                ------
                                   1.8
taskopen 31
No actions applicable.
Attaching to task 31 'test'.
Type a file extension (or none):
jschlatow commented 1 year ago

@domalex Can you please try the updated PKGBUILD from AUR for version 2.0.1. It adds the proper default config for notes and urls and also fixes #159.

domalex commented 1 year ago

The new AUR package shows now the version no. properly:

taskopen diagnostics
Environment
  Platform:       Linux
  Taskopen:       2.0.1
  Taskwarrior:    2.6.2
  Configuration:  /home/niggi/.config/taskopen/taskopenrc
Current configuration
  Binaries and paths:
    taskbin            = task
    taskargs           =
    editor             = vim
    path_ext           = /usr/share/taskopen/scripts
  General:
    debug              = false
    no_annotation_hook = addnote $ID
    task_attributes    = priority,project,tags,description
  Action groups:
  Subcommands:
    default            = normal
  Actions:
    files
      .target          = annotations
      .regex           = ^[\.\/~]+.*\.(.*)
      .labelregex      = .*
      .command         = xdg-open $FILE
      .modes           = batch,any,normal
    notes
      .target          = annotations
      .regex           = ^Notes(\..*)?
      .labelregex      = .*
      .command         = editnote ~/Notes/tasknotes/$UUID$LAST_MATCH "$TASK_DES
                         CRIPTION" $UUID
      .modes           = batch,any,normal
    url
      .target          = annotations
      .regex           = ((?:www|http).*)
      .labelregex      = .*
      .command         = xdg-open $LAST_MATCH
      .modes           = batch,any,normal

TaskOpen # provides now the opening dialogue:

 taskopen 31
Please select one or multiple actions:
 1) notes: Notes
    ("test") -- 31
 2) url: https://tagesanzeiger.ch
    ("test") -- 31

Although I expect the URL only to open in Brave, it opens also in an instance of Firefox. Bash is showing error messages and doesn't return to the bash prompt:

Type number(s): 2
Wird in einer aktuellen Browsersitzung geöffnet.
/usr/bin/xdg-open: Zeile 756:  7847 Speicherzugriffsfehler  (Speicherabzug geschriebe
/usr/bin/xdg-open: Zeile 880: x-www-browser: Kommando nicht gefunden.
[GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
ATTENTION: default value of option mesa_glthread overridden by environment.

When stopping the process I get:

^CSIGINT: Interrupted by Ctrl-C.

niggi@archbox ~ $ Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

The Notes-file opens now in vim. However, when I try to safe changes I am told, that the file couldn't be opened for writing:

"Notes/tasknotes/61161038-52fa-4fa8-b841-21fd7807a5ca"
"Notes/tasknotes/61161038-52fa-4fa8-b841-21fd7807a5ca" E212: Datei kann nicht zum Schreiben geöffnet werden
Betätigen Sie die EINGABESTASTE oder geben Sie einen Befehl ein
domalex commented 1 year ago

I didnt want to close the issue. This is my first bug report and I am still trying to find my way.

I hope my contribution is of any help to you in finding a solution for the problem.

Regards Dominik

domalex commented 1 year ago

After uninstalling Firefox from my system an URL opens in Brave and returns to the prompt:

niggi@archbox ~ $ taskopen 31
Please select one or multiple actions:
 1) notes: Notes
    ("test") -- 31
 2) url: https://tagesanzeiger.ch
    ("test") -- 31
Type number(s): 2
Wird in einer aktuellen Browsersitzung geöffnet.
/usr/bin/xdg-open: Zeile 756: 62207 Speicherzugriffsfehler  (Speicherabzug geschrieben) env "$command" "$@"
/usr/bin/xdg-open: Zeile 880: x-www-browser: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: firefox: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: iceweasel: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: seamonkey: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: mozilla: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: epiphany: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: konqueror: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: chromium: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: chromium-browser: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: google-chrome: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: www-browser: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: links2: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: elinks: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: links: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: lynx: Kommando nicht gefunden.
/usr/bin/xdg-open: Zeile 880: w3m: Kommando nicht gefunden.
xdg-open: no method available for opening 'https://tagesanzeiger.ch'
Command "(cmd: "xdg-open $LAST_MATCH", env: {blue: \033[1;34m, TERM: st-256color, _:
/usr/bin/taskopen, MOTD_SHOWN: pam, WINDOWID: 33554437, ARGS: , XDG_SESSION_CLASS: user, TIMEWARRIORDB: /home/niggi/.config/timewarrior, PWD: /home/niggi/.config, WINDOWPATH: 1, SSH_AGENT_PID: 720, XDG_SESSION_ID: 1, TASK_DESCRIPTION: test, DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus, cyan: \033[1;36m, LOGNAME: niggi, green: \033[1;32m, ANNOTATION: https://tagesanzeiger.ch, yellow: \033[1;33m, HISTFILE: /home/niggi/.local/state/bash/history, TASK_PROJECT: inbox, LANG: de_CH.UTF-8, UUID: 61161038-52fa-4fa8-b841-21fd7807a5ca, INVOCATION_ID: deaffaa6e60c4008a64b690a662bf45d, NPM_CONFIG_USERCONFIG: /home/niggi/.config/npm/npmrc, CARGO_HOME: /home/niggi/.local/share/cargo, MAIL: /var/spool/mail/niggi, LAST_MATCH: https://tagesanzeiger.ch, LABEL: , PATH: /usr/share/taskopen/scripts:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/niggi/data/bin:/home/niggi/.local/bin:/home/niggi/data/bin:/home/niggi/.local/bin, USER: niggi, INPUTRC: /home/niggi/.config/readline/inputrc, XDG_RUNTIME_DIR: /run/user/1000, BUGWARRIORRC: /home/niggi/.config/bugwarrior/bugwarriorrc, W3M_DIR: /home/niggi/.local/share/w3m, XDG_VTNR: 1,
reset: \033[m, XDG_DATA_HOME: /home/niggi/.local/share, XDG_CONFIG_HOME: /home/niggi/.config, XDG_STATE_HOME: /home/niggi/.local/state, EDITOR: vim, FILE: https://tagesanzeiger.ch, XDG_CACHE_HOME: /home/niggi/.cache, purple: \033[1;35m, XDG_SESSION_TYPE:
tty, SSH_AUTH_SOCK: /tmp/ssh-XXXXXXR19JE9/agent.719, SHELL: /bin/bash, HOME: /home/niggi, OLDPWD: /home/niggi, DEBUGINFOD_URLS: https://debuginfod.archlinux.org , PS1: \033[1;36m\u@\h \033[0;37m\w \033[1;36m$ \033[m, SHLVL: 3, DISPLAY: :0, PYTHONSTARTUP:
/etc/python/pythonrc, ID: 31, XDG_SEAT: seat0, grey: \033[0;37m, red: \033[1;31m, XAUTHORITY: /run/user/1000/Xauthority, SYSTEMD_EXEC_PID: 439})" failed with exit code: 3
niggi@archbox ~ $
domalex commented 1 year ago

I tested today again. All bugs seem to have vanished. In the meantime I updated to a new version of Timewarrior. Not sure whether this is relevant.

Current System:

Thank you for fixing the bugs!