Misterio77 / flavours

🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
MIT License
506 stars 28 forks source link

qutebrowser hook issue #12

Closed loiccoyle closed 3 years ago

loiccoyle commented 3 years ago

I was trying out flavours but I have run into a problem.

I want to reload qutebrowser here is the relevant part of the config:

[[item]]
file='$XDG_CONFIG_HOME/qutebrowser/colours.py'
template='qutebrowser'
subtemplate='minimal'
rewrite=true
hook='pgrep -x qutebrowser && qutebrowser :config-source'

But unfortunately qutebrowser does not reload. If I run the hook command in a terminal it works fine. if I remove the pgrep part and use:

hook='qutebrowser :config-source'

it also works but causes issues (not related to flavours) when qutebrowser is not running.

Note that flavours does not print out an error message.

Misterio77 commented 3 years ago

Hey!

I did the hook functionality a few months ago, but as far as i tried, i couldn't make it work like an actual shell command. It pretty much runs the first word as the command and the rest as an argument.

The only way i can think of to make this run in a shell but still be cross platform will be adding a config file in the future that will allow the user to specify the shell path.

So, long story short, the hook can be just one command and its arguments, not an bash/sh/other shell expression.

Try running it inside bash, like this:

hook='bash -c "pgrep -x qutebrowser && qutebrowser :config-source"'
loiccoyle commented 3 years ago

Thanks that did the trick. Maybe it's worth mentioning this somewhere. Have a great day!

Misterio77 commented 3 years ago

Thanks for the input! Will add a heads up to the README.

Really excited to see other people using this. I plan on doing some sort of user gallery, so feel free to send me a pic of your desktop if you're willing to share it <3