Since dragon and ripdrag can't drag files to the Xwayland window under the latest hyprland, I decided to write one by myself.
base pyqt5,generate file-list gui from cli which can open in target app. it should be work both in linux,windows and macos. but i haven't test in macos.
2024-03-02.19-40-36.mp4
- yazi-config: keymap.toml
{ on = [ "u","f" ], run = '''shell ' QT_QPA_PLATFORM=xcb ~/deskenv/master/qxdrag/qxdrag.py -x -e -b -p "$1"' --confirm''',desc="dragon x11" },
{ on = [ "u","w" ], run = '''shell ' QT_QPA_PLATFORM=wayland ~/deskenv/master/qxdrag/qxdrag.py -x -e -b -p "$1"' --confirm''',desc="dragon wayland" },
2024-03-03.13-51-16.mp4
- yazi-config: keymap.toml
{ on = [ "u","f" ], run = '''shell 'python D:/tool/qxdrag/qxdrag.py -x -e -b -p "%1"' --confirm''',desc="qxdrag" },
pyqt(>= pyqt5.15.10 and < pyqt6)
sudo pacman -S python3
sudo pacman -S python-pyqt5
pip install pycairo
pip install PyGObject
'-x', '--and-exit', action='store_true', help='exit after first successful drag to open'
'-b', '--basename', action='store_true', help='only show basename of each file'
'-w', '--width', type=int, help='window width', default=400
'-t', '--height', type=int, help='window height',default=300
'-p', '--path', type=str, help='dir full path'
'-e', '--expand', action='store_true', help='generate all file to item in folder'
'-s', '--size', type=int, help='icon size', default=64
QT_QPA_PLATFORM=xcb ~/tool/qxdrag.py -x -e -b -p ~/Images/hello.jpg
QT_QPA_PLATFORM=wayland ~/tool/qxdrag.py -x -e -b -p ~/Images/hello.jpg
x11 class: qxdrag.py