From: Maximilian Friedersdorff Date: Thu, 4 May 2023 08:51:06 +0000 (+0100) Subject: Qutebrowser bitwarden wrapper scripts X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=7ee6957a2472ae8b47fe4b0ab73ca110475ce407;p=max%2Fsaltfiles.git Qutebrowser bitwarden wrapper scripts --- diff --git a/states/qutebrowser/files/config.py b/states/qutebrowser/files/config.py index 3ad62c7..78ebb76 100644 --- a/states/qutebrowser/files/config.py +++ b/states/qutebrowser/files/config.py @@ -26,15 +26,15 @@ c.content.headers.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/2 c.content.headers.custom = {'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'} {% endif %} -config.bind(',zl', "spawn --userscript qute-pass --dmenu-invocation 'rofi -dmenu'") -config.bind(',zul', "spawn --userscript qute-pass --dmenu-invocation 'rofi -dmenu' --username-only") -config.bind(',zpl', "spawn --userscript qute-pass --dmenu-invocation 'rofi -dmenu' --password-only") -config.bind(',zol', "spawn --userscript qute-pass --dmenu-invocation 'rofi -dmenu' --otp-only") - -config.bind(',bl', 'spawn --userscript qute-bitwarden --auto-lock 14400 --dmenu-invocation "rofi -dmenu"') -config.bind(',bul', 'spawn --userscript qute-bitwarden --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --username-only') -config.bind(',bpl', 'spawn --userscript qute-bitwarden --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --password-only') -config.bind(',bol', 'spawn --userscript qute-bitwarden --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --totp-only') +config.bind(',zl', "spawn --userscript qute-bitwarden-personal --auto-lock 14400 --dmenu-invocation 'rofi -dmenu'") +config.bind(',zul', "spawn --userscript qute-bitwarden-personal --auto-lock 14400--dmenu-invocation 'rofi -dmenu' --username-only") +config.bind(',zpl', "spawn --userscript qute-bitwarden-personal --auto-lock 14400--dmenu-invocation 'rofi -dmenu' --password-only") +config.bind(',zol', "spawn --userscript qute-bitwarden-personal --auto-lock 14400--dmenu-invocation 'rofi -dmenu' --totp-only") + +config.bind(',bl', 'spawn --userscript qute-bitwarden-work --auto-lock 14400 --dmenu-invocation "rofi -dmenu"') +config.bind(',bul', 'spawn --userscript qute-bitwarden-work --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --username-only') +config.bind(',bpl', 'spawn --userscript qute-bitwarden-work --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --password-only') +config.bind(',bol', 'spawn --userscript qute-bitwarden-work --auto-lock 14400 --dmenu-invocation "rofi -dmenu" --totp-only') config.bind(',s', 'set tabs.show always') config.bind(',h', 'set tabs.show switching') diff --git a/states/qutebrowser/files/qute-bitwarden-personal b/states/qutebrowser/files/qute-bitwarden-personal new file mode 100755 index 0000000..1391183 --- /dev/null +++ b/states/qutebrowser/files/qute-bitwarden-personal @@ -0,0 +1,3 @@ +#!/bin/sh + +BITWARDEN_APPDATA_DIR=~/.config/bitwarden_personal /usr/share/qutebrowser/userscripts/qute-bitwarden "$@" diff --git a/states/qutebrowser/files/qute-bitwarden-work b/states/qutebrowser/files/qute-bitwarden-work new file mode 100755 index 0000000..4c15547 --- /dev/null +++ b/states/qutebrowser/files/qute-bitwarden-work @@ -0,0 +1,3 @@ +#!/bin/sh + +BITWARDEN_APPDATA_DIR=~/.config/bitwarden_work /usr/share/qutebrowser/userscripts/qute-bitwarden "$@" diff --git a/states/qutebrowser/init.sls b/states/qutebrowser/init.sls index c8a40ae..001461e 100644 --- a/states/qutebrowser/init.sls +++ b/states/qutebrowser/init.sls @@ -20,16 +20,6 @@ userscripts dir: - require: - pkg: install qutebrowser -symlink qute-pass: - file.symlink: - - name: {{ grains['homedir'] }}/.local/share/qutebrowser/userscripts/qute-pass - - target: /usr/share/qutebrowser/userscripts/qute-pass - - user: {{ grains['user'] }} - - group: {{ grains['user'] }} - - mode: 750 - - require: - - file: userscripts dir - noscript_enable file: file.managed: - name: {{ grains['homedir'] }}/.local/share/qutebrowser/userscripts/noscript_enable @@ -50,6 +40,26 @@ noscript_disable file: - require: - file: userscripts dir +qute-bitwarden-personal file: + file.managed: + - name: {{ grains['homedir'] }}/.local/share/qutebrowser/userscripts/qute-bitwarden-personal + - source: salt://qutebrowser/files/qute-bitwarden-personal + - user: {{ grains['user'] }} + - groups: {{ grains['user'] }} + - mode: 750 + - require: + - file: userscripts dir + +qute-bitwarden-work file: + file.managed: + - name: {{ grains['homedir'] }}/.local/share/qutebrowser/userscripts/qute-bitwarden-work + - source: salt://qutebrowser/files/qute-bitwarden-work + - user: {{ grains['user'] }} + - groups: {{ grains['user'] }} + - mode: 750 + - require: + - file: userscripts dir + qutebrowser wrapper: file.managed: - name: {{ grains['homedir'] }}/.local/bin/qutebrowser