-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(widgets, config): implement new screen_layouts widget based on n…
…ew `script_switcher` base and add it to the sidebar in the config
- Loading branch information
1 parent
ee1b65d
commit 76b7c03
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--[[ | ||
Licensed under GNU General Public License v2 | ||
* (c) 2024, Yauheni Kirylau | ||
--]] | ||
|
||
--local awful = require("awful") | ||
|
||
local script_switcher = require("actionless.widgets.script_switcher") | ||
--local get_icon = require("actionless.util.xdg").get_icon | ||
|
||
|
||
-- screen_layouts infos | ||
local screen_layouts = { | ||
} | ||
|
||
|
||
function screen_layouts.init(widget_args) | ||
local home = os.getenv("HOME") | ||
widget_args = widget_args or {} | ||
widget_args.name = widget_args.name or "screen_layouts" | ||
widget_args.scripts = widget_args.scripts or { | ||
{ | ||
cmd=home.."/.screenlayout/main_only.sh", | ||
cmd_off="true", | ||
title="Main Screen Only", | ||
}, | ||
{ | ||
cmd=home.."/.screenlayout/two_screens_bottom_right.sh", | ||
cmd_off="true", | ||
title="2 screens: Main -> TouchScreen", | ||
}, | ||
} | ||
widget_args.extra_funcs = widget_args.extra_funcs or { | ||
--{ | ||
-- "restuck", | ||
-- function() | ||
-- awful.spawn.with_shell( | ||
-- "pw-metadata -n settings 0 clock.force-quantum 256" | ||
-- .." ; pw-metadata -n settings 0 clock.force-quantum 1024" | ||
-- ) | ||
-- end, | ||
-- get_icon('actions', 'view-refresh') | ||
--}, | ||
} | ||
screen_layouts = script_switcher.init(widget_args) | ||
return setmetatable(screen_layouts, { __index = screen_layouts.widget }) | ||
end | ||
|
||
return setmetatable( | ||
screen_layouts, | ||
{ __call = function(_, ...) | ||
return screen_layouts.init(...) | ||
end | ||
} | ||
) |
This file contains 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