{"id":15168594,"url":"https://github.com/ciavash/gtklayershell","last_synced_at":"2025-10-01T00:32:22.242Z","repository":{"id":147482030,"uuid":"421797547","full_name":"CIAvash/GtkLayerShell","owner":"CIAvash","description":"GtkLayerShell - A Raku module for interfacing with Gtk Layer Shell","archived":true,"fork":false,"pushed_at":"2022-02-03T09:37:51.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-30T17:37:00.012Z","etag":null,"topics":["gtk","gtk-layer-shell","gui","module","native","nativecall","raku","raku-module","rakulang","wayland"],"latest_commit_sha":null,"homepage":"https://codeberg.org/CIAvash/GtkLayerShell","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CIAvash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-27T11:53:10.000Z","updated_at":"2024-03-30T12:37:08.000Z","dependencies_parsed_at":"2023-06-05T05:45:26.888Z","dependency_job_id":null,"html_url":"https://github.com/CIAvash/GtkLayerShell","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"6967bedf512e313359c29d53a391274fec2d1070"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FGtkLayerShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FGtkLayerShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FGtkLayerShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FGtkLayerShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CIAvash","download_url":"https://codeload.github.com/CIAvash/GtkLayerShell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234803487,"owners_count":18889263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gtk","gtk-layer-shell","gui","module","native","nativecall","raku","raku-module","rakulang","wayland"],"created_at":"2024-09-27T06:23:20.913Z","updated_at":"2025-10-01T00:32:21.915Z","avatar_url":"https://github.com/CIAvash.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n====\n\nGtkLayerShell - A [Raku](https://www.raku-lang.ir/en) module for interfacing with `Gtk Layer Shell`\n\nDESCRIPTION\n===========\n\nProvides a Raku interface for [Gtk Layer Shell](https://github.com/wmww/gtk-layer-shell), a library for creating panels and other desktop components for Wayland, using the Layer Shell protocol.\n\nSYNOPSIS\n========\n\n```raku\nuse GtkLayerShell:auth\u003czef:CIAvash\u003e:api\u003c0.7\u003e;\n\n# With Gnome::Gtk3 module\nuse Gnome::Gtk3::Main;\nuse Gnome::Gtk3::Window;\nuse Gnome::Gtk3::Box;\nuse Gnome::Gtk3::Label;\n\nmy Gnome::Gtk3::Main   $m          .= new;\nmy Gnome::Gtk3::Window $gtk_window .= new;\n\nmy $window = $gtk_window.get-native-object;\n\nmy GtkLayerShell $layer_surface .= new: :$window, :init,\n                                        :layer(LAYER_OVERLAY)\n                                        :anchors(:EDGE_LEFT, :EDGE_TOP),\n                                        :margins(:EDGE_TOP(5), :EDGE_LEFT(10)),\n                                        :exclusive_zone(50);\n\n# Or\nmy $layer_surface = GtkLayerShell.new: :$window;\n$layer_surface.init;\n$layer_surface.set: :layer(LAYER_OVERLAY),\n                    :anchors(:EDGE_LEFT, :EDGE_TOP),\n                    :margins(:EDGE_TOP(5), :EDGE_LEFT(10)),\n                    :name_space\u003cpanel\u003e,\n                    :auto_exclusive_zone\n\n# Or\nmy $layer_surface = GtkLayerShell.new: :$window, :init;\n$layer_surface.set_layer:  LAYER_OVERLAY;\n$layer_surface.set_anchor: EDGE_TOP,  True;\n$layer_surface.set_anchor: EDGE_LEFT, True;\n$layer_surface.set_margin: EDGE_TOP,  10;\n$layer_surface.set_margin: EDGE_LEFT, 10;\n\nmy $box = Gnome::Gtk3::Box.new;\n$box.add: Gnome::Gtk3::Label.new: :text('Gtk Layer Shell!');\n\n$gtk_window.add: $box;\n\n$gtk_window.show-all;\n\n$m.gtk-main;\n\n# With GTK::Simple\nuse GTK::Simple;\nuse GTK::Simple::App;\n\nmy GTK::Simple::App $app .= new;\n\nmy GtkLayerShell $layer_surface .= new: :window($app.WIDGET), :init, :anchors(:EDGE_RIGHT, :EDGE_BOTTOM);\n\n$app.set-content: GTK::Simple::HBox.new: GTK::Simple::Label.new: text =\u003e 'Gtk Layer Shell!';\n\n$app.run;\n```\n\nINSTALLATION\n============\n\nYou need to have [Gtk Layer Shell](https://github.com/wmww/gtk-layer-shell) and a Wayland compositor that works with it, [Raku](https://www.raku-lang.ir/en) and [zef](https://github.com/ugexe/zef), then run:\n\n```console\nzef install \"GtkLayerShell:auth\u003czef:CIAvash\u003e:api\u003c0.7\u003e\"\n```\n\nor if you have've cloned the repo:\n\n```console\nzef install .\n```\n\nTESTING\n=======\n\n```console\nprove -ve 'raku -I.' --ext rakutest\n```\n\nATTRIBUTES\n==========\n\n## has GtkLayerShell::DefinedWindow $.window\n\nA layer surface. `Pointer` to `Gtk.Window`.\n\n## has Bool:D $.init\n\nWhether to initialize layer for `window` on instantiation\n\nMETHODS\n=======\n\n## method major_version\n\n```raku\nmethod major_version() returns Int:D\n```\n\nReturns the major version number of the GTK Layer Shell library\n\n## method minor_version\n\n```raku\nmethod minor_version() returns Int:D\n```\n\nReturns the minor version number of the GTK Layer Shell library\n\n## method micro_version\n\n```raku\nmethod micro_version() returns Int:D\n```\n\nReturns the micro/patch version number of the GTK Layer Shell library\n\n## method is_supported\n\n```raku\nmethod is_supported() returns Bool\n```\n\nReturns `True` if the platform is Wayland and Wayland compositor supports the zwlr_layer_shell_v1 protocol. May block for a Wayland roundtrip the first time it's called.\n\n## method protocol_version\n\n```raku\nmethod protocol_version() returns Int:D\n```\n\nReturns version of the zwlr_layer_shell_v1 protocol supported by the compositor or 0 if the protocol is not supported. May block for a Wayland roundtrip the first time it's called.\n\n## method init\n\n```raku\nmethod init() returns Mu\n```\n\nSets the `window` up to be a layer surface once it is mapped. This must be called before the `window` is realized.\n\n## method set\n\n```raku\nmethod set(\n    LayerShellLayer :$layer,\n    Str :$name_space,\n    GtkLayerShell::Native::Monitor :$monitor,\n    :@anchors where .all ~~ Anchor,\n    :@margins where .all ~~ Margin,\n    Int :$exclusive_zone,\n    Bool :$auto_exclusive_zone,\n    LayerShellKeyboardMode :$keyboard_mode\n) returns Mu\n```\n\nSets multiple properties of the layer surface at once\n\n### PARAMETERS\n\n#### Enum LayerShellLayer :$layer\n\nThe `LayerShellLayer` on which this surface appears\n\n#### Str :$name_space\n\nThe namespace of this layer surface\n\n#### GtkLayerShell::Native::Monitor :$monitor\n\nThe output(`Pointer` to `Gdk.Monitor`) this layer surface will be placed on (`Any` to let the compositor decide)\n\n#### :@anchors where .all ~~ Anchor\n\nPairs of `LayerShellEdge`, `Int` to set margins of this layer suface's edges\n\n#### :@margins where .all ~~ Anchor\n\nPairs of `LayerShellEdge`, `Bool` this layer suface may be anchored to\n\n#### Int :$exclusive_zone\n\nThe size of the exclusive zone for this layer surface\n\n#### Bool :$auto_exclusive_zone\n\nAutomatically set the size of exclusive zone for this layer surface\n\n#### Enum LayerShellKeyboardMode :$keyboard_mode\n\nThe type of keyboard interactivity requested\n\n## method is_layer_window\n\n```raku\nmethod is_layer_window() returns Bool\n```\n\nReturns if `window` has been initialized as a layer surface.\n\n## method zwlr_layer_surface_v1\n\n```raku\nmethod zwlr_layer_surface_v1() returns GtkLayerShell::Native::ZwlrLayerSurfaceV1\n```\n\nReturns The underlying layer surface Wayland object\n\n## method set_namespace\n\n```raku\nmethod set_namespace(\n    Str:D $name_space\n) returns Mu\n```\n\nSets the `namespace` of the surface. No one is quite sure what this is for, but it probably should be something generic (\"panel\", \"osk\", etc). If the window is currently mapped, it will get remapped so the change can take effect.\n\n### PARAMETERS\n\n#### Str:D $name_space\n\nThe namespace of this layer surface\n\n## method get_namespace\n\n```raku\nmethod get_namespace() returns Str:D\n```\n\nReturns the namespace property. If namespace is unset, returns the default namespace (\"gtk-layer-shell\")\n\n## method set_layer\n\n```raku\nmethod set_layer(\n    LayerShellLayer:D $layer\n) returns Mu\n```\n\nSets the \"layer\" on which the surface appears (controls if it is over top of or below other surfaces). The layer may be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an older version, the `window` is remapped so the change can take effect.\n\nDefault is `LAYER_TOP`\n\n### PARAMETERS\n\n#### LayerShellLayer:D $layer\n\nThe layer on which this surface appears\n\n## method get_layer\n\n```raku\nmethod get_layer() returns LayerShellLayer:D\n```\n\nReturns the current layer\n\n## method set_monitor\n\n```raku\nmethod set_monitor(\n    GtkLayerShell::Native::Monitor $monitor\n) returns Mu\n```\n\nSets the output for the window to be placed on, or `Pointer` type object to let the compositor choose. If the window is currently mapped, it will get remapped so the change can take effect.\n\nDefault behavior is to let the compositor choose\n\n### PARAMETERS\n\n#### GtkLayerShell::Native::Monitor:D $monitor\n\nThe output(`Pointer` to `Gdk.Monitor`) this layer surface will be placed on\n\n## method get_monitor\n\n```raku\nmethod get_monitor() returns GtkLayerShell::Native::Monitor\n```\n\nReturns the monitor(`Pointer` to `Gdk.Monitor`) this surface will/has requested to be on, can be `Pointer` type object.\n\nNOTE: To get which monitor the surface is actually on, use `gdk_get_monitor_at_window` from a Gdk module.\n\n## method set_anchor\n\n```raku\nmethod set_anchor(\n    LayerShellEdge:D $edge,\n    Bool:D $anchor_to_edge\n) returns Mu\n```\n\nSets whether `window` should be anchored to `edge`.\n\n- If two perpendicular edges are anchored, the surface with be anchored to that corner\n- If two opposite edges are anchored, the window will be stretched across the screen in that direction Default is `False` for each `LayerShellEdge`\n\n### PARAMETERS\n\n#### Enum LayerShellEdge:D $edge\n\nA `LayerShellEdge` this layer suface may be anchored to\n\n#### Bool:D $anchor_to_edge\n\nWhether or not to anchor this layer surface to `edge`\n\n## method get_anchor\n\n```raku\nmethod get_anchor(\n    LayerShellEdge:D $edge\n) returns Bool\n```\n\nReturns if this surface is anchored to the given edge\n`LayerShellEdge`\n\n## method set_margin\n\n```raku\nmethod set_margin(\n    LayerShellEdge:D $edge,\n    Int:D $margin_size\n) returns Mu\n```\n\nSets the margin for a specific `edge` of a `window`. Effects both surface's distance from the edge and its exclusive zone size (if auto exclusive zone enabled). Default is 0 for each `LayerShellEdge`\n\n### PARAMETERS\n\n#### Enum LayerShellEdge:D $edge\n\nThe `LayerShellEdge` for which to set the margin\n\n#### Int:D $margin_size\n\nThe margin for `edge` to be set\n\n## method get_margin\n\n```raku\nmethod get_margin(\n    LayerShellEdge:D $edge\n) returns Int:D\n```\n\nReturns the size of the margin for the given edge\n`LayerShellEdge`\n\n## method set_exclusive_zone\n\n```raku\nmethod set_exclusive_zone(\n    Int $exclusive_zone\n) returns Mu\n```\n\nHas no effect unless the surface is anchored to an edge. Requests that the compositor does not place other surfaces within the given exclusive zone of the anchored edge.\n\nFor example, a panel can request to not be covered by maximized windows. See wlr-layer-shell-unstable-v1.xml for details. Default is 0\n\n### PARAMETERS\n\n#### Int $exclusive_zone\n\nThe size of the exclusive zone\n\n## method get_exclusive_zone\n\n```raku\nmethod get_exclusive_zone() returns Int:D\n```\n\nReturns the window's exclusive zone (which may have been set manually or automatically)\n\n## method enable_auto_exclusive_zone\n\n```raku\nmethod enable_auto_exclusive_zone() returns Mu\n```\n\nWhen auto exclusive zone is enabled, exclusive zone is automatically set to the size of the `window` + relevant margin. To disable auto exclusive zone, just set the exclusive zone to 0 or any other fixed value.\n\nNOTE: you can control the auto exclusive zone by changing the margin on the non-anchored edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol\n\n## method is_auto_exclusive_zone_enabled\n\n```raku\nmethod is_auto_exclusive_zone_enabled() returns Bool\n```\n\nReturns if the surface's exclusive zone is set to change based on the window's size\n\n## method set_keyboard_mode\n\n```raku\nmethod set_keyboard_mode(\n    LayerShellKeyboardMode:D $mode\n) returns Mu\n```\n\nSets if/when `window` should receive keyboard events from the compositor, see `LayerShellKeyboardMode` for details. Default is `KEYBOARD_MODE_NONE`\n\n### PARAMETERS\n\n#### Enum LayerShellKeyboardMode:D $mode\n\nThe type of keyboard interactivity requested\n\n## method get_keyboard_mode\n\n```raku\nmethod get_keyboard_mode() returns LayerShellKeyboardMode:D\n```\n\nReturns current keyboard interactivity mode for `window`\n\nREPOSITORY\n==========\n\n[https://github.com/CIAvash/GtkLayerShell/](https://github.com/CIAvash/GtkLayerShell/)\n\nBUG\n===\n\n[https://github.com/CIAvash/GtkLayerShell/issues](https://github.com/CIAvash/GtkLayerShell/issues)\n\nAUTHOR\n======\n\nSiavash Askari Nasr - [https://www.ciavash.name](https://www.ciavash.name)\n\nCOPYRIGHT\n=========\n\nCopyright © 2021 Siavash Askari Nasr\n\nLICENSE\n=======\n\nThis file is part of GtkLayerShell.\n\nGtkLayerShell is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nGtkLayerShell is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with GtkLayerShell. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fgtklayershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciavash%2Fgtklayershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fgtklayershell/lists"}