Commit 03ab4991 authored by Franciszek Madej's avatar Franciszek Madej 🤞

anki sync

parent 34c08ba6
...@@ -156,6 +156,9 @@ bindsym $mod+space exec $menu ...@@ -156,6 +156,9 @@ bindsym $mod+space exec $menu
bindsym $mod+Shift+p exec $passmenu bindsym $mod+Shift+p exec $passmenu
bindsym $mod+Shift+q exec $screenshot bindsym $mod+Shift+q exec $screenshot
# for_window [title="bemenu"] exec --no-startup-id notify-send "title changed"
# for_window [title="bemenu"] resize set 640 480; move position center; move left 20px; exec --no-startup-id notify-send "title changed"
# autostart # autostart
exec dunst exec dunst
exec nextcloud exec nextcloud
......
#!/usr/bin/env python3
import os
import re
import subprocess
import sys
from rofi import Rofi
STORE = os.path.normpath(os.path.expanduser('~/.password-store'))
passwords = []
for dirpath, _, filenames in os.walk(STORE, followlinks=True):
for f in filenames:
if re.match(r'.*\.gpg$', f):
password_file = os.path.abspath(os.path.join(dirpath, f))
# lovely hack
# in short:
# 1. split path by `/`
# 2. remove `/home/${user}/.password-store/`
# 3. join string using `/` again
# 4. remove `.gpg`
password_file = '/'.join(password_file.split('/')[4:])[:-4]
passwords.append(password_file)
rofi = Rofi()
password = rofi.select('pass', passwords)
if password[1] == -1:
sys.exit(1)
password = passwords[password[0]]
subprocess.Popen(['pass', '-c', password],
stdin=subprocess.PIPE,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment