mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-07-15 14:41:02 +03:00
Compare commits
2 Commits
687a9d6986
...
646fd1bb01
Author | SHA1 | Date | |
---|---|---|---|
646fd1bb01 | |||
e163724976 |
19
README.md
19
README.md
@ -16,6 +16,25 @@ This plugin's purpose is to automatically copy to your clipboard the next waypoi
|
|||||||
- Open the folder you created and put all the files and folders you extracted inside
|
- Open the folder you created and put all the files and folders you extracted inside
|
||||||
- Restart EDMC
|
- Restart EDMC
|
||||||
|
|
||||||
|
### Wayland Support
|
||||||
|
|
||||||
|
If you're using a Wayland desktop environment, you can't use xclip and have to configure the plugin using the `EDMC_SPANSH_ROUTER_XCLIP` environment variable to use Wayland specific `wl-copy` tool before launching EDMC. For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export EDMC_SPANSH_ROUTER_XCLIP="/usr/bin/wl-copy"
|
||||||
|
python EDMarketConnector.py
|
||||||
|
```
|
||||||
|
|
||||||
|
For Flatpak users, you may need to:
|
||||||
|
1. Add permissions when launching EDMC: `--socket=wayland --filesystem=host-os`
|
||||||
|
2. Use another path for wl-copy: `export EDMC_SPANSH_ROUTER_XCLIP="/run/host/usr/bin/wl-copy"`
|
||||||
|
|
||||||
|
|
||||||
|
This allows the plugin to use `wl-copy` instead of `xclip` for clipboard operations.
|
||||||
|
|
||||||
|
|
||||||
|
For more details see [this issue](https://github.com/norohind/EDMC_SpanshRouter/issues/6)
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
You can either plot your route directly from EDMC by clicking the "Plot Route" button, or you can import a CSV file from [Spansh](https://www.spansh.co.uk/plotter)
|
You can either plot your route directly from EDMC by clicking the "Plot Route" button, or you can import a CSV file from [Spansh](https://www.spansh.co.uk/plotter)
|
||||||
|
@ -342,8 +342,10 @@ class SpanshRouter():
|
|||||||
|
|
||||||
def copy_waypoint(self):
|
def copy_waypoint(self):
|
||||||
if sys.platform == "linux" or sys.platform == "linux2":
|
if sys.platform == "linux" or sys.platform == "linux2":
|
||||||
|
clipboard_cli = os.getenv("EDMC_SPANSH_ROUTER_XCLIP") or "xclip -selection c"
|
||||||
|
clipboard_cli = clipboard_cli.split()
|
||||||
command = subprocess.Popen(["echo", "-n", self.next_stop], stdout=subprocess.PIPE)
|
command = subprocess.Popen(["echo", "-n", self.next_stop], stdout=subprocess.PIPE)
|
||||||
subprocess.Popen(["xclip", "-selection", "c"], stdin=command.stdout)
|
subprocess.Popen(clipboard_cli, stdin=command.stdout)
|
||||||
else:
|
else:
|
||||||
self.parent.clipboard_clear()
|
self.parent.clipboard_clear()
|
||||||
self.parent.clipboard_append(self.next_stop)
|
self.parent.clipboard_append(self.next_stop)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user