Add "superpin" or "sticky" to hyprland as super + grave (floating and tiled windows move with workspaces) This Lua script adds a "superpin" feature to the Hyprland window manager, allowing users to toggle a window as "sticky" by pressing Super + Grave. When enabled, superpinned windows automatically move to follow the active workspace, and their original floating position and size are restored when the window updates its rules. superpin.lua 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 Show hidden characters local superpin windows = {} ---add or remove window from superpin list ---@param target win HL.Window local function toggle superpin target win if superpin windows target win.address then superpin windows target win.address = nil hl.notification.create { text = "superpin off: " .. target win.title, timeout = 2000 } else superpin windows target win.address = { win = target win, at = target win.at, size = target win.size, } hl.notification.create { text = "superpin on: " .. target win.title, timeout = 2000 } end end -- watch for workspace changes to ensure superpin windows follow hl.on "workspace.active", function ws for , stored in pairs superpin windows do hl.dispatch hl.dsp.window.move { workspace = ws.id, window = stored.win } end end -- clean up hl.on "window.close", function win superpin windows win.address = nil end -- toggle superpin hl.bind "SUPER + grave", function local win = hl.get active window -- @as HL.Window toggle superpin win end -- helps restore original position and size hl.on "window.update rules", function win if win.floating then local stored = superpin windows win.address if stored and stored.at and stored.size then hl.dispatch hl.dsp.window.move { x = stored.at.x, y = stored.at.y, window = win } hl.dispatch hl.dsp.window.resize { x = stored.size.x, y = stored.size.y, window = win } end end end