├── .gitattributes
├── .gitignore
├── DOCUMENTATION.md
├── LICENSE
├── Makefile
├── README.md
├── calendar.conf
├── config.conf
├── events.css
├── preview.jpg
├── proto
└── wlr-foreign-toplevel-management-unstable-v1.xml
├── src
├── config.hpp
├── config_parser.cpp
├── config_parser.hpp
├── main.cpp
├── main.hpp
├── module.cpp
├── module.hpp
├── modules
│ ├── backlight.cpp
│ ├── backlight.hpp
│ ├── battery.cpp
│ ├── battery.hpp
│ ├── bluetooth.cpp
│ ├── bluetooth.hpp
│ ├── cellular.cpp
│ ├── cellular.hpp
│ ├── clock.cpp
│ ├── clock.hpp
│ ├── controls.cpp
│ ├── controls.hpp
│ ├── hyprland.cpp
│ ├── hyprland.hpp
│ ├── menu.cpp
│ ├── menu.hpp
│ ├── mpris.cpp
│ ├── mpris.hpp
│ ├── network.cpp
│ ├── network.hpp
│ ├── notifications.cpp
│ ├── notifications.hpp
│ ├── performance.cpp
│ ├── performance.hpp
│ ├── taskbar.cpp
│ ├── taskbar.hpp
│ ├── tray.cpp
│ ├── tray.hpp
│ ├── volume.cpp
│ ├── volume.hpp
│ ├── weather.cpp
│ └── weather.hpp
├── overlay.cpp
├── window.cpp
├── window.hpp
├── wireless_network.cpp
├── wireless_network.hpp
├── wireplumber.cpp
└── wireplumber.hpp
└── style.css
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | build/
3 | src/git_info.hpp
4 | src/wlr-foreign-toplevel-management-unstable-v1.c
5 | src/wlr-foreign-toplevel-management-unstable-v1.h
--------------------------------------------------------------------------------
/DOCUMENTATION.md:
--------------------------------------------------------------------------------
1 | # Features
2 | Sysbar offers modules which could be displayed on the bar to provide real time information about various things.
3 | It also offers sidepanels which contain widgets that show additional information from the loaded modules.
4 |
5 | Sidebars can be accessed by either clicking or tapping and dragging on either end of the bar.
6 | (Touch gestures are supported)
7 |
8 |
9 | List of supported features
10 |
11 | * clock
12 | * Module: Show time and date
13 | * Widget: Clendar (Planned: Show events and holidays)
14 |
15 | * weather
16 | * Module: Show weather
17 | * Widget: (Planned: Show more detailed weather info)
18 |
19 | * tray
20 | * Module: Show running tray items
21 |
22 | * hyprland
23 | * Module: Show window title (Planned: Workspace indicator)
24 |
25 | * volume
26 | * Module: Show audio output volume level
27 | * Widget: Same as the module (Planned: Set volume level)
28 |
29 | * network
30 | * Module: Show network type and status (Ethernet, Wireless, Cellular)
31 | * Control: (Planned: Show nearby wireless networks)
32 |
33 | * battery
34 | * Module: Show battery level and status (Charging, Discharging)
35 | * Control: (Planned: Show additional power stuff, Set power plan)
36 |
37 | * notification
38 | * Widget: Show notifications
39 |
40 | * taskbar
41 | * Module: Show running toplevels
42 |
43 | * backlight
44 | * Module: Show backlight level
45 | * Widget: Show and set backlight brightness levels
46 |
47 | * menu
48 | * Module: Shows a simple button to open or close an app launcher
49 |
50 | * mpris
51 | * Module: Show currently playing song
52 | * Widget: Same as the above but with controls and album art
53 |
54 | * bluetooth
55 | * Module: Show bluetooth status (Connected, Disconnected)
56 | * Control: (Planned: Show nearby bluetooth devices)
57 |
58 | * cellular
59 | * Module: Show cellular signal strength
60 | * Control: (Planned: Ability to connect/disconnect to/from cellular networks)
61 |
62 |
63 | # Configuration
64 | Sysbar offers compile time and runtime configuration options.
65 | Undesired features can be disabled by ommiting them from `src/config.hpp`
66 | The config system is INI based and can be configured by editing `~/.config/sys64/bar/config.conf`
67 |
68 |
69 | Runtime file based config
70 |
71 | | section | default | description |
72 | |----------------------|-----------------------------|----------------------------------------------------|
73 | | [main] | | Primary configuration |
74 | | position | 0 | 0 = top 1 = right 2 = bottom 3 = left |
75 | | size | 40 | Height or width depending on position |
76 | | layer | 2 | Background = 0, Bottom = 1, Top = 2, Overlay = 3 |
77 | | exclusive | true | Exclude part of the screen for the bar |
78 | | verbose | false | Verbose output (For debugging) |
79 | | main-monitor | HDMI-A-1 | Monitor output name (DP-1, HDMI-A-1, ect..) |
80 | | modules-start | clock,weather,tray | Modules shown at the start of the bar (Left/Top) |
81 | | modules-center | hyprland | Modules shown in the middle of the bar |
82 | | modules-end | volume,network,notification | Modules shown at the end of the bar (Right/Bottom) |
83 | | sidepanel-start-size | 350 | Start (Left/Top) sidepanel (Width/Height) |
84 | | sidepanel-end-size | 350 | End (Right/Bottom) sidepanel (Width/Height) |
85 | | | | |
86 | | [clock] | | Clock module configuration |
87 | | interval | 1000 | How long (in ms) to refresh the time |
88 | | label-format | %H:%M | [Label format](https://www.man7.org/linux/man-pages/man1/date.1.html) |
89 | | tooltip-format | %Y/%m/%d | Same as the above but for the tooltip |
90 | | widget-layout | 0044 | [XYWH (Single digit values to position the widget)](https://gnome.pages.gitlab.gnome.org/gtkmm/classGtk_1_1Grid.html#a2f3d5ceb9a1c2f491b541aa56ebdc1e8) |
91 | | | | |
92 | | [weather] | | Weather module configuration |
93 | | url | https://wttr.in/?format=j1 | [wttr.in](https://github.com/chubin/wttr.in) Cool project, Consider supporting the dev out |
94 | | unit | f | Temperature unit **C**elsius or **F**ahrenheit |
95 | | | | |
96 | | [hyprland] | | Hyprland module configuration |
97 | | character-limit | 128 | Label character limit so the text won't get funky |
98 | | | | |
99 | | [volume] | | Volume module configuration |
100 | | show-label | false | Show the volume level as text |
101 | | widget-layout | 0441 | [XYWH (Single digit values to position the widget)](https://gnome.pages.gitlab.gnome.org/gtkmm/classGtk_1_1Grid.html#a2f3d5ceb9a1c2f491b541aa56ebdc1e8) |
102 | | | | |
103 | | [network] | | Network module configuration |
104 | | show-label | false | Show signal strength as text |
105 | | | | |
106 | | [battery] | | Battery module configuration |
107 | | show-label | false | Show charge level as text |
108 | | | | |
109 | | [notification] | | Notification widget configuration |
110 | | command | ffplay /usr/share/.. | Command to run whenever you recieve a notification |
111 | | | | |
112 | | [backlight] | | Backlight module configuration |
113 | | path | | Path to backlight (/sys/class/backlight/panel) |
114 | | show-icon | true | Show brightness level as an icon |
115 | | show-label | true | Show brightness level as text |
116 | | widget-layout | 0341 | [XYWH (Single digit values to position the widget)](https://gnome.pages.gitlab.gnome.org/gtkmm/classGtk_1_1Grid.html#a2f3d5ceb9a1c2f491b541aa56ebdc1e8) |
117 | | | | |
118 | | [menu] | | Menu module configuration |
119 | | show-icon | true | Show the icon |
120 | | show-label | false | Show the label |
121 | | icon-name | start-here | Icon name from your GTK icon theme |
122 | | label-text | Applications | Text to show on the menu button |
123 | | | | |
124 | | [taskbar] | | Taskbar module configuration |
125 | | text-length | 14 | Window title length |
126 | | icon-size | 32 | Size of the icons |
127 | | | | |
128 | | [mpris] | | Mpris module configuration |
129 | | show-icon | true | Show player status as an icon |
130 | | show-label | true | Show album name as text |
131 | | widget-layout | 0142 | [XYWH (Single digit values to position the widget)](https://gnome.pages.gitlab.gnome.org/gtkmm/classGtk_1_1Grid.html#a2f3d5ceb9a1c2f491b541aa56ebdc1e8) |
132 | | | | |
133 | | [cellular] | | Cellular module configuration |
134 | | show-icon | true | Show signal strength as an icon |
135 | | show-label | false | Show signal strength as text |
136 |
137 |
138 |
139 | Runtime launch arguments
140 |
141 | ```
142 | -p Set position
143 | -s Set start modules (modules on the left side)
144 | -c Set center modules (modules in the middle)
145 | -e Set end modules (modules on the right side)
146 | -S Set bar size (Height or Width depending on position)
147 | -V Be more verbose
148 | -v Prints version info
149 | ```
150 |
151 |
152 | # Styling
153 | By default sysbar will follow your GTK4 theme.
154 | However it can also load Custom Style Sheets from `~/.config/sys64/bar/style.css`
155 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2004 Sam Hocevar
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | BINS = sysbar
2 | LIBS = libsysbar.so
3 | PKGS = gtkmm-4.0 gtk4-layer-shell-0
4 | SRCS = $(wildcard src/*.cpp)
5 |
6 | PREFIX ?= /usr/local
7 | BINDIR ?= $(PREFIX)/bin
8 | LIBDIR ?= $(PREFIX)/lib
9 | DATADIR ?= $(PREFIX)/share
10 | BUILDDIR = build
11 |
12 | # Include enabled modules from config.hpp
13 | ifneq (, $(shell grep -E '^#define MODULE_CLOCK' src/config.hpp))
14 | SRCS += src/modules/clock.cpp
15 | endif
16 | ifneq (, $(shell grep -E '^#define MODULE_WEATHER' src/config.hpp))
17 | SRCS += src/modules/weather.cpp
18 | PKGS += libcurl jsoncpp
19 | endif
20 | ifneq (, $(shell grep -E '^#define MODULE_TRAY' src/config.hpp))
21 | SRCS += src/modules/tray.cpp
22 | PKGS += dbus-1
23 | endif
24 | ifneq (, $(shell grep -E '^#define MODULE_HYPRLAND' src/config.hpp))
25 | SRCS += src/modules/hyprland.cpp
26 | endif
27 | ifneq (, $(shell grep -E '^#define MODULE_VOLUME' src/config.hpp))
28 | SRCS += src/modules/volume.cpp
29 | PKGS += wireplumber-0.5
30 | else
31 | SRCS := $(filter-out src/wireplumber.cpp, $(SRCS))
32 | endif
33 | ifneq (, $(shell grep -E '^#define MODULE_NETWORK' src/config.hpp))
34 | SRCS += src/modules/network.cpp
35 | CXXFLAGS += -I /usr/include/libnl3/ -lnl-3 -lnl-genl-3
36 | endif
37 | ifneq (, $(shell grep -E '^#define MODULE_BATTERY' src/config.hpp))
38 | SRCS += src/modules/battery.cpp
39 | endif
40 | ifneq (, $(shell grep -E '^#define MODULE_NOTIFICATION' src/config.hpp))
41 | SRCS += src/modules/notifications.cpp
42 | endif
43 | ifneq (, $(shell grep -E '^#define MODULE_PERFORMANCE' src/config.hpp))
44 | SRCS += src/modules/performance.cpp
45 | endif
46 | ifneq (, $(shell grep -E '^#define MODULE_TASKBAR' src/config.hpp))
47 | SRCS += src/modules/taskbar.cpp
48 | endif
49 | ifneq (, $(shell grep -E '^#define MODULE_BACKLIGHT' src/config.hpp))
50 | SRCS += src/modules/backlight.cpp
51 | endif
52 | ifneq (, $(shell grep -E '^#define MODULE_MPRIS' src/config.hpp))
53 | SRCS += src/modules/mpris.cpp
54 | PKGS += playerctl libcurl
55 | endif
56 | ifneq (, $(shell grep -E '^#define MODULE_BLUETOOTH' src/config.hpp))
57 | SRCS += src/modules/bluetooth.cpp
58 | endif
59 | ifneq (, $(shell grep -E '^#define MODULE_CONTROLS' src/config.hpp))
60 | SRCS += src/modules/controls.cpp
61 | endif
62 | ifneq (, $(shell grep -E '^#define MODULE_CELLULAR' src/config.hpp))
63 | SRCS += src/modules/cellular.cpp
64 | endif
65 | ifneq (, $(shell grep -E '^#define MODULE_MENU' src/config.hpp))
66 | SRCS += src/modules/menu.cpp
67 | endif
68 | ifeq (, $(shell grep -E '^#define FEATURE_WIRELESS' src/config.hpp))
69 | SRCS := $(filter-out src/wireless_network.cpp, $(SRCS))
70 | endif
71 |
72 | VPATH = src src/modules
73 | OBJS = $(patsubst src/%, $(BUILDDIR)/%, $(patsubst src/modules/%, $(BUILDDIR)/%, $(SRCS:.cpp=.o)))
74 |
75 | CXXFLAGS += $(CFLAGS)
76 | LDFLAGS += -Wl,--as-needed,-z,now,-z,pack-relative-relocs
77 |
78 | CXXFLAGS += $(shell pkg-config --cflags $(PKGS))
79 | LDFLAGS += $(shell pkg-config --libs $(PKGS))
80 |
81 | PROTOS = $(wildcard proto/*.xml)
82 | PROTO_HDRS = $(patsubst proto/%.xml, src/%.h, $(PROTOS))
83 | PROTO_SRCS = $(patsubst proto/%.xml, src/%.c, $(PROTOS))
84 | PROTO_OBJS = $(patsubst src/%,$(BUILDDIR)/%,$(PROTO_SRCS:.c=.o))
85 |
86 | $(shell mkdir -p $(BUILDDIR))
87 | JOB_COUNT := $(BINS) $(LIBS) $(PROTO_HDRS) $(PROTO_SRCS) $(PROTO_OBJS) $(OBJS) src/git_info.hpp
88 | JOBS_DONE := $(shell ls -l $(JOB_COUNT) 2> /dev/null | wc -l)
89 |
90 | define progress
91 | $(eval JOBS_DONE := $(shell echo $$(($(JOBS_DONE) + 1))))
92 | @printf "[$(JOBS_DONE)/$(shell echo $(JOB_COUNT) | wc -w)] %s %s\n" $(1) $(2)
93 | endef
94 |
95 | all: release
96 |
97 | release: CFLAGS += -Oz -s -flto -fPIC -fomit-frame-pointer -Wl,--gc-sections -ffunction-sections -fdata-sections -ffast-math
98 | release: $(BINS) $(LIBS)
99 |
100 | debug: CFLAGS += -O0 -g -Wall -fPIC -DDEBUG
101 | debug: $(BINS) $(LIBS)
102 |
103 | install: $(BINS)
104 | @echo "Installing..."
105 | @install -D -t $(DESTDIR)$(BINDIR) $(BUILDDIR)/$(BINS)
106 | @install -D -t $(DESTDIR)$(LIBDIR) $(BUILDDIR)/$(LIBS)
107 | @install -D -t $(DESTDIR)$(DATADIR)/sys64/bar config.conf style.css events.css calendar.conf
108 |
109 | clean:
110 | @echo "Cleaning up"
111 | @rm -r $(BUILDDIR) src/git_info.hpp $(PROTO_HDRS) $(PROTO_SRCS)
112 |
113 | uninstall:
114 | @echo "Uninstalling..."
115 | @rm -f $(DESTDIR)$(BINDIR)/$(BINS)
116 | @rm -f $(DESTDIR)$(LIBDIR)/$(LIBS)
117 | @rm -f $(DESTDIR)$(DATADIR)/sys64/bar/config.conf
118 | @rm -f $(DESTDIR)$(DATADIR)/sys64/bar/style.css
119 | @rm -f $(DESTDIR)$(DATADIR)/sys64/bar/events.css
120 | @rm -f $(DESTDIR)$(DATADIR)/sys64/bar/calendar.conf
121 |
122 | $(BINS): src/git_info.hpp $(BUILDDIR)/main.o $(BUILDDIR)/config_parser.o
123 | $(call progress, Linking $@)
124 | @$(CXX) -o \
125 | $(BUILDDIR)/$(BINS) \
126 | $(BUILDDIR)/main.o \
127 | $(BUILDDIR)/config_parser.o \
128 | $(CXXFLAGS) \
129 | -lgtkmm-4.0 -lglibmm-2.68 -lgiomm-2.68 -lgtk4-layer-shell
130 |
131 | $(LIBS): $(PROTO_HDRS) $(PROTO_SRCS) $(PROTO_OBJS) $(OBJS)
132 | $(call progress, Linking $@)
133 | @$(CXX) -o \
134 | $(BUILDDIR)/$(LIBS) \
135 | $(filter-out $(BUILDDIR)/main.o, $(OBJS)) \
136 | $(PROTO_OBJS) \
137 | $(CXXFLAGS) \
138 | $(LDFLAGS) \
139 | -shared
140 |
141 | $(BUILDDIR)/%.o: %.cpp
142 | $(call progress, Compiling $@)
143 | @$(CXX) -c $< -o $@ $(CXXFLAGS)
144 |
145 | $(BUILDDIR)/%.o: %.c
146 | $(call progress, Compiling $@)
147 | @$(CC) -c $< -o $@ $(CFLAGS)
148 |
149 | $(PROTO_HDRS): src/%.h : proto/%.xml
150 | $(call progress, Creating $@)
151 | @wayland-scanner client-header $< $@
152 |
153 | $(PROTO_SRCS): src/%.c : proto/%.xml
154 | $(call progress, Creating $@)
155 | @wayland-scanner public-code $< $@
156 |
157 | src/git_info.hpp:
158 | $(call progress, Creating $@)
159 | @commit_hash=$$(git rev-parse HEAD); \
160 | commit_date=$$(git show -s --format=%cd --date=short $$commit_hash); \
161 | commit_message=$$(git show -s --format="%s" $$commit_hash | sed 's/"/\\\"/g'); \
162 | echo "#define GIT_COMMIT_MESSAGE \"$$commit_message\"" > src/git_info.hpp; \
163 | echo "#define GIT_COMMIT_DATE \"$$commit_date\"" >> src/git_info.hpp
164 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Sysbar
2 | Sysbar is a modular status bar for wayland written in gtkmm4
3 | 
4 |
5 | [](https://repology.org/project/sysbar/versions)
6 |
7 | # Documentation
8 | Read [this](https://github.com/System64fumo/sysbar/blob/main/DOCUMENTATION.md "documentation") to get started.
9 |
10 | # Credits
11 | [wttr.in](https://github.com/chubin/wttr.in) for their weather service
12 | [waybar](https://github.com/Alexays/Waybar) for showing how to write wireplumber stuff
13 | [wf-shell](https://github.com/WayfireWM/wf-shell) for showing how to do system tray stuff
14 |
--------------------------------------------------------------------------------
/calendar.conf:
--------------------------------------------------------------------------------
1 | [events]
2 | *-1-1="New Year's Day!"
3 | *-2-14="Valentine's Day"
4 | *-4-1="April Fool's Day"
5 | *-7-4="Independence Day"
6 | *-10-31="Halloween"
7 | *-12-25="Christmas"
8 |
--------------------------------------------------------------------------------
/config.conf:
--------------------------------------------------------------------------------
1 | [main]
2 | position=0
3 | size=40
4 | layer=2
5 | exclusive=true
6 | verbose=false
7 | main-monitor=HDMI-A-1
8 | modules-start=clock,weather,tray
9 | modules-center=hyprland
10 | modules-end=volume,network,notification
11 | sidepanel-start-size=350
12 | sidepanel-end-size=350
13 |
14 | [clock]
15 | interval=1000
16 | label-format=%H:%M
17 | tooltip-format=%Y/%m/%d
18 | widget-layout=0044
19 |
20 | [weather]
21 | url=https://wttr.in/?format=j1
22 | unit=f
23 |
24 | [hyprland]
25 | character-limit=128
26 |
27 | [volume]
28 | show-label=false
29 | widget-layout=0441
30 |
31 | [network]
32 | show-label=false
33 |
34 | [battery]
35 | show-label=false
36 |
37 | [notification]
38 | command=ffplay -nodisp -autoexit /usr/share/sounds/freedesktop/stereo/message.oga &>/dev/null
39 |
40 | [backlight]
41 | path=
42 | show-icon=true
43 | show-label=true
44 | widget-layout=0341
45 |
46 | [menu]
47 | show-icon=true
48 | show-label=false
49 | icon-name=start-here
50 | label-text=Applications
51 |
52 | [taskbar]
53 | text-length=14
54 | icon-size=32
55 |
56 | [mpris]
57 | show-icon=true
58 | show-label=true
59 | album-rounding=10
60 | widget-layout=0142
61 |
62 | [cellular]
63 | show-icon=true
64 | show-label=false
65 |
--------------------------------------------------------------------------------
/events.css:
--------------------------------------------------------------------------------
1 | #sysbar_overlay .event_christmas calendar > grid {
2 | box-shadow: 0px 10px 10px -10px inset black;
3 | background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px) 0px 0px;
4 | background-color: rgba(20, 20, 23, 1);
5 | background-repeat: repeat;
6 | background-size: 32px 32px;
7 | animation: snow 10s linear infinite;
8 | border-bottom: 1px solid @borders;
9 | }
10 |
11 | #sysbar_overlay .event_christmas calendar .day-number {
12 | color: rgba(255, 255, 255, 0.85);
13 | }
14 | #sysbar_overlay .event_christmas calendar .other-month {
15 | color: rgba(255, 255, 255, 0.3);
16 | }
17 |
18 | @keyframes snow {
19 | 0% {
20 | background-position: 5px 5px;
21 | }
22 |
23 | 100% {
24 | background-position: 50px 100px;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/preview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/System64fumo/sysbar/7040925b06617aabd9f8837fd4f9370bd45ae4c8/preview.jpg
--------------------------------------------------------------------------------
/proto/wlr-foreign-toplevel-management-unstable-v1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Copyright © 2018 Ilia Bozhinov
5 |
6 | Permission to use, copy, modify, distribute, and sell this
7 | software and its documentation for any purpose is hereby granted
8 | without fee, provided that the above copyright notice appear in
9 | all copies and that both that copyright notice and this permission
10 | notice appear in supporting documentation, and that the name of
11 | the copyright holders not be used in advertising or publicity
12 | pertaining to distribution of the software without specific,
13 | written prior permission. The copyright holders make no
14 | representations about the suitability of this software for any
15 | purpose. It is provided "as is" without express or implied
16 | warranty.
17 |
18 | THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
19 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
23 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25 | THIS SOFTWARE.
26 |
27 |
28 |
29 |
30 | The purpose of this protocol is to enable the creation of taskbars
31 | and docks by providing them with a list of opened applications and
32 | letting them request certain actions on them, like maximizing, etc.
33 |
34 | After a client binds the zwlr_foreign_toplevel_manager_v1, each opened
35 | toplevel window will be sent via the toplevel event
36 |
37 |
38 |
39 |
40 | This event is emitted whenever a new toplevel window is created. It
41 | is emitted for all toplevels, regardless of the app that has created
42 | them.
43 |
44 | All initial details of the toplevel(title, app_id, states, etc.) will
45 | be sent immediately after this event via the corresponding events in
46 | zwlr_foreign_toplevel_handle_v1.
47 |
48 |
49 |
50 |
51 |
52 |
53 | Indicates the client no longer wishes to receive events for new toplevels.
54 | However the compositor may emit further toplevel_created events, until
55 | the finished event is emitted.
56 |
57 | The client must not send any more requests after this one.
58 |
59 |
60 |
61 |
62 |
63 | This event indicates that the compositor is done sending events to the
64 | zwlr_foreign_toplevel_manager_v1. The server will destroy the object
65 | immediately after sending this request, so it will become invalid and
66 | the client should free any resources associated with it.
67 |
68 |
69 |
70 |
71 |
72 |
73 | A zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel
74 | window. Each app may have multiple opened toplevels.
75 |
76 | Each toplevel has a list of outputs it is visible on, conveyed to the
77 | client with the output_enter and output_leave events.
78 |
79 |
80 |
81 |
82 | This event is emitted whenever the title of the toplevel changes.
83 |
84 |
85 |
86 |
87 |
88 |
89 | This event is emitted whenever the app-id of the toplevel changes.
90 |
91 |
92 |
93 |
94 |
95 |
96 | This event is emitted whenever the toplevel becomes visible on
97 | the given output. A toplevel may be visible on multiple outputs.
98 |
99 |
100 |
101 |
102 |
103 |
104 | This event is emitted whenever the toplevel stops being visible on
105 | the given output. It is guaranteed that an entered-output event
106 | with the same output has been emitted before this event.
107 |
108 |
109 |
110 |
111 |
112 |
113 | Requests that the toplevel be maximized. If the maximized state actually
114 | changes, this will be indicated by the state event.
115 |
116 |
117 |
118 |
119 |
120 | Requests that the toplevel be unmaximized. If the maximized state actually
121 | changes, this will be indicated by the state event.
122 |
123 |
124 |
125 |
126 |
127 | Requests that the toplevel be minimized. If the minimized state actually
128 | changes, this will be indicated by the state event.
129 |
130 |
131 |
132 |
133 |
134 | Requests that the toplevel be unminimized. If the minimized state actually
135 | changes, this will be indicated by the state event.
136 |
137 |
138 |
139 |
140 |
141 | Request that this toplevel be activated on the given seat.
142 | There is no guarantee the toplevel will be actually activated.
143 |
144 |
145 |
146 |
147 |
148 |
149 | The different states that a toplevel can have. These have the same meaning
150 | as the states with the same names defined in xdg-toplevel
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | This event is emitted immediately after the zlw_foreign_toplevel_handle_v1
162 | is created and each time the toplevel state changes, either because of a
163 | compositor action or because of a request in this protocol.
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | This event is sent after all changes in the toplevel state have been
172 | sent.
173 |
174 | This allows changes to the zwlr_foreign_toplevel_handle_v1 properties
175 | to be seen as atomic, even if they happen via multiple events.
176 |
177 |
178 |
179 |
180 |
181 | Send a request to the toplevel to close itself. The compositor would
182 | typically use a shell-specific method to carry out this request, for
183 | example by sending the xdg_toplevel.close event. However, this gives
184 | no guarantees the toplevel will actually be destroyed. If and when
185 | this happens, the zwlr_foreign_toplevel_handle_v1.closed event will
186 | be emitted.
187 |
188 |
189 |
190 |
191 |
192 | The rectangle of the surface specified in this request corresponds to
193 | the place where the app using this protocol represents the given toplevel.
194 | It can be used by the compositor as a hint for some operations, e.g
195 | minimizing. The client is however not required to set this, in which
196 | case the compositor is free to decide some default value.
197 |
198 | If the client specifies more than one rectangle, only the last one is
199 | considered.
200 |
201 | The dimensions are given in surface-local coordinates.
202 | Setting width=height=0 removes the already-set rectangle.
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
215 |
216 |
217 |
218 |
219 | This event means the toplevel has been destroyed. It is guaranteed there
220 | won't be any more events for this zwlr_foreign_toplevel_handle_v1. The
221 | toplevel itself becomes inert so any requests will be ignored except the
222 | destroy request.
223 |
224 |
225 |
226 |
227 |
228 | Destroys the zwlr_foreign_toplevel_handle_v1 object.
229 |
230 | This request should be called either when the client does not want to
231 | use the toplevel anymore or after the closed event to finalize the
232 | destruction of the object.
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 | Requests that the toplevel be fullscreened on the given output. If the
241 | fullscreen state and/or the outputs the toplevel is visible on actually
242 | change, this will be indicated by the state and output_enter/leave
243 | events.
244 |
245 | The output parameter is only a hint to the compositor. Also, if output
246 | is NULL, the compositor should decide which output the toplevel will be
247 | fullscreened on, if at all.
248 |
249 |
250 |
251 |
252 |
253 |
254 | Requests that the toplevel be unfullscreened. If the fullscreen state
255 | actually changes, this will be indicated by the state event.
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 | This event is emitted whenever the parent of the toplevel changes.
264 |
265 | No event is emitted when the parent handle is destroyed by the client.
266 |
267 |
268 |
269 |
270 |
271 |
--------------------------------------------------------------------------------
/src/config.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Build time configuration Description
4 | #define CONFIG_RUNTIME // Allow the use of runtime arguments
5 | #define CONFIG_FILE // Allow the use of a config file
6 | #define MODULE_CLOCK // Include the clock module
7 | #define MODULE_WEATHER // Include the weather module
8 | #define MODULE_TRAY // Include the tray module
9 | #define MODULE_HYPRLAND // Include the tray module
10 | #define MODULE_VOLUME // Include the volume module
11 | #define MODULE_NETWORK // Include the network module
12 | #define MODULE_BATTERY // Include the battery module
13 | #define MODULE_NOTIFICATION // Include the notifications module
14 | #define MODULE_PERFORMANCE // Include the performance module
15 | #define MODULE_TASKBAR // Include the taskbar module
16 | #define MODULE_BACKLIGHT // Include the backlight module
17 | #define MODULE_MPRIS // Include the mpris module
18 | #define MODULE_BLUETOOTH // Include the bluetooth module
19 | #define MODULE_CONTROLS // Include the controls module (technically widget only)
20 | #define MODULE_CELLULAR // Include the cellular module
21 | #define MODULE_MENU // Include the menu module
22 | #define FEATURE_WIRELESS // Support for wireless networks
23 |
24 | // TODO: Re-Add a fallback/user defined config
25 | // Either that or add a check that requires one of the config options
26 |
--------------------------------------------------------------------------------
/src/config_parser.cpp:
--------------------------------------------------------------------------------
1 | #include "config_parser.hpp"
2 | #include
3 | #include
4 |
5 | config_parser::config_parser(const std::string& filename) {
6 | std::ifstream file(filename);
7 | std::string line;
8 | std::string current_section;
9 |
10 | available = file.is_open();
11 |
12 | if (available) {
13 | while (std::getline(file, line)) {
14 | line = trim(line);
15 |
16 | if (line.empty() || line[0] == ';' || line[0] == '#') {
17 | continue;
18 | }
19 | else if (line[0] == '[' && line[line.size() - 1] == ']') {
20 | current_section = line.substr(1, line.size() - 2);
21 | }
22 | else {
23 | size_t delimiter_pos = line.find('=');
24 | if (delimiter_pos != std::string::npos) {
25 | std::string key = trim(line.substr(0, delimiter_pos));
26 | std::string value = trim(line.substr(delimiter_pos + 1));
27 | data[current_section][key] = value;
28 | }
29 | }
30 | }
31 | file.close();
32 | }
33 | else {
34 | std::fprintf(stderr, "Unable to open file: %s\n", filename.c_str());
35 | }
36 | }
37 |
38 | std::string config_parser::trim(const std::string& str) {
39 | const size_t first = str.find_first_not_of(' ');
40 | if (std::string::npos == first) {
41 | return str;
42 | }
43 | const size_t last = str.find_last_not_of(' ');
44 | return str.substr(first, (last - first + 1));
45 | }
46 |
--------------------------------------------------------------------------------
/src/config_parser.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include