Last active
June 17, 2026 18:00
-
-
Save dotaxis/99158f5318a6028972446465695997c0 to your computer and use it in GitHub Desktop.
Hyprland Lua: RuneLite Picture in Picture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- place this in ~/.config/hypr/custom/ | |
| -- source with require("custom.hyprpip-runelite") | |
| -- Force this on workspace 1 and pin+float it, so it appears on that monitor | |
| -- adjust workspace if you want it on a different monitor, or remove workspace to allow it on any monitor | |
| hl.window_rule({ | |
| name = "runelite-pip", | |
| match = { | |
| initial_title = "Picture in Picture", | |
| initial_class = "net-runelite-client-RuneLite", | |
| }, | |
| workspace = "1 silent", | |
| no_initial_focus = true, | |
| suppress_event = "activate", | |
| suppress_event = "activatefocus", | |
| render_unfocused = true, | |
| float = true, | |
| pin = true, | |
| }) | |
| -- left click on PiP window focuses the main client | |
| -- change "Click Action" in plugin settings to "Do Nothing" | |
| -- change bind if you want to use a different mouse button or key | |
| local runelite_class = "net-runelite-client-RuneLite" | |
| local runelite_pip_title = "Picture in Picture" | |
| local bind = "mouse:272" -- left click | |
| hl.on("window.active", function(w, active) | |
| if active ~= 1 or w.class ~= runelite_class or not w.title:match(runelite_pip_title) then | |
| hl.unbind(bind) | |
| return | |
| end | |
| hl.bind(bind, focus_main) | |
| end) | |
| function focus_main() | |
| local active = hl.get_active_window() | |
| if active == nil then | |
| return | |
| end | |
| local pid = active.pid | |
| local all_windows = hl.get_windows() | |
| for _, win in pairs(all_windows) do | |
| if win.pid == pid and win.address ~= active.address then | |
| hl.dispatch(hl.dsp.focus({ window = "address:" .. win.address })) | |
| return | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment