diff --git a/.config/hypr/includes/autostart.conf b/.config/hypr/includes/autostart.conf index 31badb6..59b6563 100644 --- a/.config/hypr/includes/autostart.conf +++ b/.config/hypr/includes/autostart.conf @@ -1,8 +1,5 @@ # Autostart applications exec-once = waybar & -exec-once = mako & -exec-once = wlogout & -exec-once = rofi-wayland & # exec-once = hyprpaper & exec-once = hypridle & diff --git a/.config/rofi/remmina_profiles.py b/.config/rofi/remmina_profiles.py deleted file mode 120000 index f67995f..0000000 --- a/.config/rofi/remmina_profiles.py +++ /dev/null @@ -1 +0,0 @@ -/home/lousy/git/dotfiles/local.config/rofi/remmina_profiles.py \ No newline at end of file diff --git a/.config/rofi/remmina_profiles.py b/.config/rofi/remmina_profiles.py new file mode 100755 index 0000000..8e74b01 --- /dev/null +++ b/.config/rofi/remmina_profiles.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +### Parameters +remmina_cfg = "~/.config/remmina/remmina.pref" +remmina_bin = "/usr/bin/remmina" + + + +### Modules +import os +import re +import sys +import subprocess + + + +### Main routine +def main(): + + # Get the Remmina data directory path + with open(os.path.abspath(os.path.expanduser(remmina_cfg)), "r") as f: + for l in f.readlines(): + m = re.match(r"\s*datadir_path\s*=\s*(.*)$", l.rstrip()) + if m: + datadir_path = os.path.abspath(os.path.expanduser(m[1])) + + # Parse the Remmina profiles in the directory path, extract their names + profiles = {} + for fpath in os.listdir(datadir_path): + fpath = os.path.join(datadir_path, fpath) + if os.path.isfile(fpath) and fpath.endswith(".remmina"): + try: + with open(fpath, "r") as f: + for l in f.readlines(): + m = re.match(r"\s*name\s*=\s*(.*)$", l.rstrip()) + if m: + profiles[m[1]] = fpath + except: + pass + + # If rofi passed a profile name as argument, start the corresponding profile + if len(sys.argv) > 1 and sys.argv[1] in profiles: + subprocess.Popen([remmina_bin, profiles[sys.argv[1]]], + stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + + # Otherwise send the list of profile names to rofi + else: + for p in sorted(profiles): + print(p) + + return 0 + + + +### Main program +if __name__ == "__main__": + exit(main())