Update configs

This commit is contained in:
Tobias Reisinger 2024-07-02 15:42:26 +02:00
parent cc39076825
commit b033291384
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
7 changed files with 54 additions and 30 deletions

View file

@ -5,4 +5,6 @@ export AUTOSTART_DISPLAY=""
export MONITOR_PRIMARY="primary" export MONITOR_PRIMARY="primary"
export MONITOR_SECONDARY="secondary" export MONITOR_SECONDARY="secondary"
export BROWSER_CHROMIUM="chromium"
export DUNST_MONITOR="0" export DUNST_MONITOR="0"

View file

@ -7,4 +7,6 @@ export KDE_CONNECT_DEVICE="Fairphone3"
export MONITOR_PRIMARY="DP-1" export MONITOR_PRIMARY="DP-1"
export MONITOR_SECONDARY="HDMI-A-1" export MONITOR_SECONDARY="HDMI-A-1"
export BROWSER_CHROMIUM="brave"
export DUNST_MONITOR="$MONITOR_SECONDARY" export DUNST_MONITOR="$MONITOR_SECONDARY"

View file

@ -1,6 +1,7 @@
# Layer rules # Layer rules
layerrule = noanim, menu layerrule = noanim, menu
layerrule = noanim, notifications
# Workspace rules # Workspace rules
@ -11,6 +12,7 @@ windowrulev2 = workspace $ws_web, class:(firefox)
windowrulev2 = workspace $ws_focus, class:^(jetbrains-) windowrulev2 = workspace $ws_focus, class:^(jetbrains-)
windowrulev2 = workspace $ws_media, class:([cC]hromium) windowrulev2 = workspace $ws_media, class:([cC]hromium)
windowrulev2 = workspace $ws_media, class:(Brave-browser)
windowrulev2 = workspace $ws_media, class:(FreeTube) windowrulev2 = workspace $ws_media, class:(FreeTube)
windowrulev2 = workspace $ws_media, class:(qutebrowser-kiosk) windowrulev2 = workspace $ws_media, class:(qutebrowser-kiosk)

View file

@ -77,7 +77,7 @@ dwindle {
master { master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true new_status = master
mfact = 0.5 mfact = 0.5
no_gaps_when_only = yes no_gaps_when_only = yes

View file

@ -1,2 +1,3 @@
@awesome.me:registry=https://npm.fontawesome.com/
@fortawesome:registry=https://npm.fontawesome.com/ @fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} //npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}

View file

@ -1,14 +1,21 @@
import os
def init(c): def init(c):
c.unbind('d') # I prefer ctrl+w to close tabs. I hit d by mistake too often.
c.bind(',v', 'spawn io.freetubeapp.FreeTube {url}') c.bind(',v', 'spawn io.freetubeapp.FreeTube {url}')
c.bind(',V', 'hint links spawn io.freetubeapp.FreeTube {hint-url}') c.bind(',V', 'hint links spawn io.freetubeapp.FreeTube {hint-url}')
# external # external
c.bind(',eb', 'spawn chromium {url}') browser_chromium = os.getenv('BROWSER_CHROMIUM', 'chromium')
c.bind(',eB', 'hint links spawn chromium {hint-url}') c.bind(',eb', f'spawn {browser_chromium} {{url}}')
c.bind(',eB', f'hint links spawn {browser_chromium} {{hint-url}}')
c.bind(',ef', 'spawn firefox {url}') c.bind(',ef', 'spawn firefox {url}')
c.bind(',eF', 'hint links spawn firefox {hint-url}') c.bind(',eF', 'hint links spawn firefox {hint-url}')
c.bind(',es', 'spawn xdg-open steam://openurl/{url}') c.bind(',es', 'spawn xdg-open steam://openurl/{url}')
c.bind(',ep', 'spawn kdeconnect-cli -n Fairphone3 --share {url}') c.bind(',ep', 'spawn kdeconnect-cli -n Fairphone3 --share {url}')
c.bind(',et', 'spawn ts-control message {url}')
c.bind(',eT', 'hint links spawn ts-control message {hint-url}')
c.bind(',g', 'open {url:scheme}://github1s.com{url:path}{url:query}') c.bind(',g', 'open {url:scheme}://github1s.com{url:path}{url:query}')
@ -16,12 +23,11 @@ def init(c):
c.bind(',rt', 'open {url:scheme}://teddit.net{url:path}{url:query}') c.bind(',rt', 'open {url:scheme}://teddit.net{url:path}{url:query}')
gpg_key = '723B78C0BF8D8C721D2C4EEF41E544A54E2533B2' gpg_key = '723B78C0BF8D8C721D2C4EEF41E544A54E2533B2'
c.bind(',p', f'spawn --userscript qutebrowser-keepassxc --key {gpg_key}', mode='normal')
c.bind(',p', 'spawn --userscript qutebrowser-keepassxc --key ' + gpg_key, mode='normal') c.bind(',Pu', f'spawn --userscript qutebrowser-keepassxc --only-username --key {gpg_key}', mode='normal')
c.bind(',Pu', 'spawn --userscript qutebrowser-keepassxc --only-username --key ' + gpg_key, mode='normal') c.bind(',Pi', f'spawn --userscript qutebrowser-keepassxc --only-password --key {gpg_key}', mode='normal')
c.bind(',Pi', 'spawn --userscript qutebrowser-keepassxc --only-password --key ' + gpg_key, mode='normal') c.bind(',Po', f'spawn --userscript qutebrowser-keepassxc --only-otp --key {gpg_key}', mode='normal')
c.bind(',Po', 'spawn --userscript qutebrowser-keepassxc --only-otp --key ' + gpg_key, mode='normal') c.bind(',Pp', f'spawn --userscript qutebrowser-keepassxc --autotype --key {gpg_key}', mode='normal')
c.bind(',Pp', 'spawn --userscript qutebrowser-keepassxc --autotype --key ' + gpg_key, mode='normal')
# output # output
c.bind(',oq', 'spawn --userscript qr {url}') c.bind(',oq', 'spawn --userscript qr {url}')

View file

@ -5,7 +5,7 @@ import urllib.request
linkwarden_url = os.environ.get('LINKWARDEN_URL') linkwarden_url = os.environ.get('LINKWARDEN_URL')
linkwarden_token = os.environ.get('LINKWARDEN_TOKEN') linkwarden_token = os.environ.get('LINKWARDEN_TOKEN')
def get_links(cursor): def get_links_part(cursor):
request = urllib.request.Request(linkwarden_url + "/api/v1/links?sort=0&cursor=" + str(cursor), headers={ request = urllib.request.Request(linkwarden_url + "/api/v1/links?sort=0&cursor=" + str(cursor), headers={
'Authorization': 'Bearer ' + linkwarden_token 'Authorization': 'Bearer ' + linkwarden_token
}) })
@ -15,22 +15,20 @@ def get_links(cursor):
data = ' '.join(data.split()) data = ' '.join(data.split())
return json.loads(data).get("response", []) return json.loads(data).get("response", [])
def init(): def get_links():
if linkwarden_url is None or linkwarden_token is None:
return
links = []
cursor = 0 cursor = 0
links = []
while True: while True:
new_links = get_links(cursor) new_links = get_links_part(cursor)
links += new_links links += new_links
if len(new_links): if len(new_links):
cursor = new_links[-1]["id"] cursor = new_links[-1]["id"]
else: else:
break return links
with open(os.path.expanduser("~/.config/qutebrowser/bookmarks/urls"), "w+") as f: def format_links(links):
formatted_links = []
for link in links: for link in links:
url = link.get("url") url = link.get("url")
if not url: if not url:
@ -40,8 +38,21 @@ def init():
if not title: if not title:
title = link.get("description") title = link.get("description")
if not title: if not title:
title = "" title = "<untitled>"
f.write(url + " " + title + "\n") collection = link.get("collection", {}).get("name")
if not collection:
collection = "<uncategorized>"
formatted_links.append(f"{url} {collection}/{title}")
return formatted_links
def init():
if linkwarden_url is None or linkwarden_token is None:
return
links = format_links(get_links())
with open(os.path.expanduser("~/.config/qutebrowser/bookmarks/urls"), "w+") as f:
f.write("\n".join(links))
f.close() f.close()