Skip to content

A bare-bones plugin to help creating wayland bars with gtk-layer-shell.

License

Notifications You must be signed in to change notification settings

khalid151/flutter-layer-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_layer_shell

A bare-bones plugin to help creating wayland bars. All it does is provide a function to configure the position and size of the bar.

Getting Started

To get started, edit linux/my_application.cc and add the following header

#include <flutter_layer_shell/flutter_layer_shell_plugin.h>

And call this function setup_layer_shell(window) right after creating the GTK window:

// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
  MyApplication* self = MY_APPLICATION(application);
  GtkWindow* window =
      GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));

  // Must run before creating the view
  setup_layer_shell(window);

Once done, bar can be set like this:

import 'package:flutter_layer_shell/flutter_layer_shell.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterLayerShell.configure(edge: LayerShellEdge.TOP, size: 65);
  runApp(const MyApp());
}

There are other to functions to update the size and position dynamically.

FlutterLayerShell.changeSize(size);
FlutterLayerShell.changePosition(layerShellEdge);

About

A bare-bones plugin to help creating wayland bars with gtk-layer-shell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published