Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- from pynput import keyboard
- import sys
- import time
- def on_key_press(key):
- if (str(key) == 'Key.esc' or str(key) == 'Key.enter'):
- subprocess.call(["kill", str(process_feh.pid)])
- sys.exit()
- picture = "/path/to/your/picture"
- process_rofi = subprocess.Popen(["rofi", '-show', 'run', '-config', '/path/to/your/rofi-config'])
- time.sleep(0.03) # Edit this to sync feh and rofi better
- process_feh = subprocess.Popen(["feh", '-x', picture, '--title', '\"rofi-feh\"', '--geometry', '960x360']) # Edit the 960x360 to fit your rofi
- with keyboard.Listener(on_press = on_key_press) as listener:
- listener.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement