* Made a iio-hyprland plugin for noctalia kill iio-hyprland and restart it depending on the locked setting. The plugin has: -control center toggle -Bar wigdet for toggle of state --If rigth clicked this wigdet will open the panel -Panel for calling by msg --Panel also added possibally to specify lock direction -Bar wiget for open panel --Useful for touch - Tested with hyprland 0.55.4 and noctalia v5.0.0 - Should work with sway using iio-sway (not tested) * add en.json to translation unify settings keys for consistent naming update names add iio-service so tools work independently refactor code for readability and remove unused logic update readme add thumbnail * Updated plugin.toml names Reworked panel code * bump version * Make arrow buttons apply relative orientation instead of fixed original directions * fixed wrong labels * Delete iio_lock/iio_lock.luau * Delete iio_lock/iio_panel.luau * Delete iio_lock/shortcut.luau * make noctalia.getConfig the sole config accessor --------- Co-authored-by: Lemmy <studio@quadbyte.net>
39 lines
705 B
Luau
39 lines
705 B
Luau
--!nonstrict
|
|
-- Config
|
|
local glyph_unlocked = noctalia.getConfig("unlocked")
|
|
local glyph_locked = noctalia.getConfig("locked")
|
|
|
|
-- State
|
|
local locked = false
|
|
local glyph = glyph_unlocked
|
|
|
|
local function render()
|
|
barWidget.setGlyph(glyph)
|
|
end
|
|
|
|
local function apply_lock_state()
|
|
if locked then
|
|
glyph = glyph_locked
|
|
else
|
|
glyph = glyph_unlocked
|
|
end
|
|
end
|
|
|
|
function onClick()
|
|
locked = not locked
|
|
noctalia.state.set("iio-state",locked)
|
|
render()
|
|
end
|
|
|
|
noctalia.state.watch("iio-state", function (value)
|
|
locked = value
|
|
apply_lock_state()
|
|
render()
|
|
end)
|
|
|
|
function onRightClick()
|
|
noctalia.togglePanel("nikolaj-zwergius/iio_lock:panel")
|
|
end
|
|
|
|
render()
|