GTK3-based panel for sway window manager

Overview

nwg-panel

I have been using sway since 2019 and find it the most comfortable working environment, but... Have you ever missed all the graphical bells and whistles in your panel, we used to have in tint2? It happens to me. That's why I decided to try to code a GTK-based panel, including best features from my two favourites: Waybar and tint2. Many thanks to Developers and Contributors of the both projects!

Development status is alpha. Errors are expected (please report!). Breaking changes may, and probably will occur.

There are 7 modules available at the moment, and I don't plan on many more. Basis system controls are available in the Controls module, and whatever else you may need, there's an executor for that.

gh.png

Modules - as for today

Controls

Panel widget with a popup window, including sliders, some system info, user-defined rows and customizable menu (top right in the picture);

SwayTaskbar

Shows tasks from a selected or all outputs, with the program icon and name; allows switching between them, toggle the container layout (tabbed stacking splitv splith) with the mouse scroller, move to workspaces, toggle floating and kill with the right-click menu (bottom left);

CustomButton

Simple Gtk.Button with an icon, and a command assigned to it (top left corner);

SwayWorkspaces

Not really necessary set of textual buttons to switch between workspaces (not in the picture);

Clock

Just a label to show the date command output in the format of your choice (top center);

Playerctl

Set of buttons, and a label to control mpris media player with the Playerctl utility (top left);

Executor

Last but not least: the Executor module displays an icon, and a label on the basis of a script output, in user-defined intervals (bottom right, and the weather executor next to the clock).

See Wiki for more information.

Comments
  • add system tray module

    add system tray module

    This is an attempt to create an SNI based system tray module for nwg-panel.

    Progress:

    • [X] dbus watcher
    • [X] dbus host
    • [X] item
    • [X] tray module (showing real app icons)
    • [X] wire in DbusmenuGtk3
    • [x] cleanup and action any feedback

    I think the menu's can be implemented by leveraging the libdbusmenu library. There is example python code in the following two tests:

    • https://github.com/AyatanaIndicators/libdbusmenu/blob/master/tests/test-glib-simple-items.py
    • https://github.com/AyatanaIndicators/libdbusmenu/blob/master/tests/test-gtk-shortcut-client.py

    I'm a front-end developer by day so I apologise in advance for butchering the python language :wink: All feedback welcome!

    This addresses #41

    opened by christian-schulze 31
  • alsa-related issues

    alsa-related issues

    hello there whenever i try to launch the panel i get this error i use pipewire if that helps as it looks like its related to audio image anything else ill be willing to provide

    opened by mackdroid 31
  • Support system tray

    Support system tray

    I'd like to be able to fully replace waybar with nwg-panel. One thing preventing me from doing so is a lack of support for displaying system tray icons.

    If you added tray support, that would make nwg-panel a great replacement for other sway panels.

    feature request 
    opened by emmaliddell 16
  • Controlling brightness for external monitors using ddcutil

    Controlling brightness for external monitors using ddcutil

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    As a desktop PC user, I use ddcutil instead of light or brightnessctl to control my display brightness.

    Describe the solution you'd like A clear and concise description of what you want to happen.

    To be able to use the current brightness slider in the controls module to control brightness for external displays.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Other than that, I also propose to allow users to choose between light, brightnessctl and ddcutil in the settings, since the current logic automatically chooses by the order of met dependency (light, then brightnessctl, etc.). This would be useful for users who have more than one of the dependencies installed, for example laptop users who also use additional external monitors.

    Additional context Add any other context or screenshots about the feature request here.

    opened by az01101001 11
  • [BUG] duplicate panels after edit with `nwg-panel-config`

    [BUG] duplicate panels after edit with `nwg-panel-config`

    Describe the bug more than one panel

    To Reproduce Steps to reproduce the behavior:

    1. open nwg-panel-config
    2. Change a setting (eg remove modules on the right)
    3. click Save & restart
    4. now there should be 2 panels

    Expected behavior The current one gets terminated and the new one starts

    Screenshots image

    Desktop (please complete the following information):

    • Linux distribution: Arch
    • Sway version sway -v: 1.7
    • Panel version nwg-panel -v: 0.6.1

    Additional context Can provide if needed

    opened by matthis-k 11
  • add systemd service

    add systemd service

    Not all sway users rely on the "flaky" exec_always in the sway config.

    For example if the app crashes (like it currently does on my machine after a suspend / resume), then nwg-panel is terminated and never comes back.

    For users using sway-service this would be a nice addition.

    Also this is the required change in the PKGBUILD

    diff --git a/PKGBUILD b/PKGBUILD
    index 26c5832..f698201 100644
    --- a/PKGBUILD
    +++ b/PKGBUILD
    @@ -20,4 +20,5 @@ package() {
       install -D -t "$pkgdir"/usr/share/pixmaps nwg-panel.svg
       install -D -t "$pkgdir"/usr/share/pixmaps nwg-shell.svg
       install -D -t "$pkgdir"/usr/share/applications nwg-panel-config.desktop
    +  install -D -t "$pkgdir"/usr/lib/systemd/user/ nwg-panel.service
     }
    
    opened by jtheoof 9
  • Force refresh of executor

    Force refresh of executor

    Is your feature request related to a problem? Please describe.

    I wrote an quick and dirty alertmanager executor, which works fine. However, if I want to refresh it's status, I don't know any other way than waiting for the end of the current interval.

    Describe the solution you'd like

    I'd like to have an option to force a refresh (a.k.a. force-end the current interval), configurable i.e. via right-click.

    enhancement 
    opened by varac 8
  • Name root/parent module GTK objects.

    Name root/parent module GTK objects.

    This allows the modules root object (the module object directly inheriting a GTK object) to be referenced in CSS (as 'root-' and whatever CSS name was configured for that module).

    opened by simplejack-src 7
  • Bug in 0.1.6?

    Bug in 0.1.6?

    nwg-panel
    Running on sway Display: HDMI-A-1, position: top, layer: bottom, width: 2048, height: 30

    ** (nwg-panel:156765): WARNING **: 01:46:28.599: gtk-layer-shell v0.5.2 may not work on GTK v3.24.26. If you experience crashes, check https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md Traceback (most recent call last): File "/usr/bin/nwg-panel", line 33, in sys.exit(load_entry_point('nwg-panel==0.1.6', 'gui_scripts', 'nwg-panel')()) File "/usr/lib/python3.9/site-packages/nwg_panel/main.py", line 281, in main check_key(panel["controls-settings"], "window-width", 0) KeyError: 'controls-settings'

    opened by IntinteDAO 7
  • Let user choose which backlight device is controlled by brightness slider

    Let user choose which backlight device is controlled by brightness slider

    Is your feature request related to a problem? Please describe. My computer (an Apple MacBookPro16,1) has two backlight devices:

    $ ls /sys/class/backlight/
    acpi_video0  amdgpu_bl0
    

    "acpi_video0" is the one that actually controls my display backlight, while "amdgpu_bl0" does nothing. When nwg-panel calls light, it selects the amd backlight by default, so the brightness slider in my panel's controls menu doesn't do anything.

    Describe the solution you'd like

    I would like some way to set the backlight device that is used so that I can set it to control the "acpi_video0" backlight. This could probably be done by adding a dropdown menu that lets you select from the outputs of

    $ ls /sys/class/backlight`
    acpi_video0 
    amdgpu_bl0
    

    If a specific backlight is selected, -s sysfs/backlight/<SELECTED_BACKLIGHT> could be added to light's arguments, or -d <SELECTED_BACKLIGHT> to brightnessctl

    This dropdown to select device could be located above "output switcher" and to the right of "Brightness" in this screenshot: image

    Describe alternatives you've considered Alternatively, the slider in the panel's controls thing could be set up to change the brightness of all display backlights in the system.

    Additional context

    light is called to set brightness here in the code https://github.com/nwg-piotr/nwg-panel/blob/97e2cc0ee8e5f050d92a74434978d6bd71496cd2/nwg_panel/tools.py#L432

    opened by Redecorating 6
  • SwayTaskbar doesn't show icons for some applications

    SwayTaskbar doesn't show icons for some applications

    For example Element and Manuskript. Maybe instead of looking at the icon names which are element and manuskript, the uppercase versions are being used to find icons?

    Also if a desktop entry is opened and the icon specified there doesn't exist, taskbar crashes.

    opened by CIAvash 6
  • nwg-panel hangs when resuming from standby/hibernation (0.7.15)

    nwg-panel hangs when resuming from standby/hibernation (0.7.15)

    Dependencies check: {'light': True, 'brightnessctl': True, 'ddcutil': False, 'pamixer': True, 'pactl': True, 'playerctl': True, 'netifaces': True, 'btmgmt': True, 'wlr-randr': False, 'upower': True, 'swaync': True, 'python-requests': True}
    Running on sway
    Error loading json: [Errno 2] No such file or directory: '/home/user/.local/share/nwg-panel/calendar.json'
    executor name: executor-updates
    Panel 'top': output: eDP-1, position: top, layer: bottom, width: 1920, height: 30
    executor name: executor-cpuav
    executor name: executor-cpubar
    executor name: executor-temp
    executor name: executor-memory
    executor name: executor-drives
    Panel 'bottom': output: eDP-1, position: bottom, layer: bottom, width: 1920, height: 30
    
    (nwg-panel:34704): Gdk-CRITICAL **: 04:04:29.540: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed
    
    (nwg-panel:34704): Gdk-CRITICAL **: 04:04:29.541: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed
    
    (nwg-panel:34704): Gdk-CRITICAL **: 04:04:29.541: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed
    
    (nwg-panel:34704): Gdk-CRITICAL **: 04:04:29.541: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed
    
    ...
    ``
    shift+mod+c reloads as expected, but is required after every resume
    opened by envolution 4
  • [BUG] Playerctl not displaying info for spotify

    [BUG] Playerctl not displaying info for spotify

    The last few weeks I have had quite a bit of trouble getting playerctl to display spotify information. I am able to see my spotify session with "playerctl -p spotify metadata" but the only time the executor displays anything is while watching a youtube video or using lollypop. Previously if this was an issue skipping a song or pausing it on spotify would refresh playerctl but this is no longer sufficient.

    Is there some way to edit how the playerctl commands behave? Because if possible I would like to ignore youtube but not the others. Apologies if this is a spotify issue and not an nwg issue, I am just having trouble understanding where the error lies. I know there is a way to ignore certain players, but I don't see anywhere I can change the playerctl commands even reading the config files.

    Still loving the shell regardless, thanks!

    opened by xi-pinmping 0
  • mimic i3status

    mimic i3status

    Hi there,

    Firstly thank you for your efforts to date. The project looks great and your additions are really cool.

    I would like to request (apologies for asking in an Issues page!) a drop in theme to mimic the default i3status of i3wm.

    I am struggling to, for example, show the i3 status style of "desktops in use" "active desktop". And to have the simplistic default line of text to the right to indicate ipv6, wireless, ethernet, battery, disk usage, ram, and date.

    I like your project because, unlike i3status, your application indicators work with the desired results.

    I know this might seem an odd request - but if this can mimic 100% the design of a default i3status, then many might simply set and forget.

    Hope you don't see this as any criticism and just more constructive input towards your great project. Thanks for doing it!

    feature request 
    opened by mattdrepo 1
  • [BUG] Nextcloud client freezes the panel for a long time at startup

    [BUG] Nextcloud client freezes the panel for a long time at startup

    Describe the bug

    When I start nextcloud client it freezes the panel immediatly and it takes a very long time until the icon shows up in the panel, then it is responsive again

    To Reproduce

    Steps to reproduce the behavior:

    1. Install nextcloud client (3.6.2-1) on Arch Linux.
    2. Remove existing .config/Nextcloud folder
    3. Start with nextcloud --logfile /tmp/nextcloud.log --logdebug
    4. Panel freezes
    5. Wait apporx. 3 minutes
    6. Icon shows up in panel, and the initial NC window appears

    Expected behavior

    The icon should show up in the panel shortly after start, and the initial window should appear quickly. The panel should not freeze at any moment.

    Desktop (please complete the following information):

    • Linux distribution: Arch Linux
    • Sway version 1.7
    • Panel version 0.7.13

    Additional context

    The log shows messages like System tray is not available, waiting... : nextcloud.log

    opened by varac 3
  • [FEATURE REQUEST] More css-name to have more control over css customization

    [FEATURE REQUEST] More css-name to have more control over css customization

    Is your feature request related to a problem? Please describe. Hello, I would like to have more control over css customization to be able to customization panel box left/middle/right and sway workspaces button container for exemple

    Describe the solution you'd like All gtx box created should have a property name to able to be access by css selector and to be edited in style.css

    Additional context Maybe I have missing some things about how Gtk works and something like that is already done by Gtk

    Exemaple of level of customization i would like: https://i.redd.it/6cni5jbtlyw91.jpg https://i.redd.it/207tgukid1t91.png https://i.redd.it/ux7tmqcx2ix91.png https://i.redd.it/fuujqm9q7ox91.png https://i.redd.it/uh5cz1h7wsu91.png

    opened by Blist 0
Releases(v0.7.15)
  • v0.7.15(Dec 10, 2022)

    • added try/except clause -> signal subscription loop, in order to fix #162;
    • added a possibility to refresh executors on an RT signal; closes #164.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.14(Oct 29, 2022)

    • Scratchpad module: added the /tmp/nwg-scratchpad file. It stores info on the containers moved to scratchpad, for it to survive sway reloads.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.13(Oct 28, 2022)

    This feature adds the move scratchpad ("minimize") entry to the SwayTaskbar context menu. It moves the window to the sway scratchpad. If you place the Scratchpad module next to the SwayTaskbar module, you'll see minimized windows' icons in it.

    image

    The SwayTaskbar module saves the window parent workspace and floating state. When you click the window icon in the Scratchpad module, these two properties will be restored. Obviously it won't happen if you move a window to the scratchpad in any other way.

    Users of multi-headed setups with a SwayTaskbar + Scratch module combo on each of them, may want to see the tasks that belong to the certain display on every Scratchpad module instance. That's why the "Single output" check box has been added.

    image

    Again, for it to work, you need to "minimize" the window from the SwayTaskbar module. Also, the panel needs to be assigned to an output.

    image

    Please find this feature beta, and report bugs, if any.

    Source code(tar.gz)
    Source code(zip)
  • v0.7.12(Oct 22, 2022)

    • Playerctl module: full (unshortened) label text -> tooltip text;
    • Controls module: added optional, semi-transparent background window to click and close the popup, in addition to the previous behaviour;
    • some typos fixed by @kianmeng;
    • added fallback icon name, same as the app_id, when all other icon name detection methods fail.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.11(Oct 12, 2022)

  • v0.7.10(Oct 7, 2022)

  • v0.7.9(Oct 5, 2022)

    • added (back) check box to disable the panel homogeneity. See #95: if we use Center modules in a panel, the panel's box "columns" need to be homogeneous, if we want the center columns content (e.g. clock) to be centered in the screen. If some columns width exceeds 1/3 of the screen width, it results in cutting off the panel edges. If one really needs 3 columns and wide content, the only solution is to turn the columns' homogeneity off, and give up on centering.
    • Playerctl module: added possibility to scroll track metadata longer than the label length limit (instead of shortening).

    image

    Source code(tar.gz)
    Source code(zip)
  • v0.7.7(Aug 31, 2022)

    • fixed improper Tray icon size on outputs scaled up;
    • fixed output dimensions detection on compositors other than sway: closes #134, reported from Wayfire.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.6(Aug 28, 2022)

  • v0.7.5(Aug 21, 2022)

  • v0.7.4(Aug 15, 2022)

    • nwg-panel-config & Clock module: icon names fixed to work with Adwaita icon theme - closes #139;
    • fix to prevent SwayWorkspaces from crashing on empty floating node.name - closes #137 (hopefully, as I couldn't reproduce the crash on my side).
    Source code(tar.gz)
    Source code(zip)
  • v0.7.3(Jul 30, 2022)

    Clock module: added Calendar window, with the ability to save a simple note for each day.

    image

    Hint: by default, calendar data is stored in the /home/$USER/.local/share/nwg-panel/calendar.json file. Use a folder that you sync over the web to access the same calendar on various machines. E.g. you may install Dropbox and use the /home/$USER/Dropbox/calendar.json path.

    image

    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Jul 18, 2022)

    Openweather module:

    • added precipitation volume
    • added Romanian translation by drLobes
    • added Watherbit.io weather alerts (requires a separate API key)

    Controls module:

    • brightness slider now supports ddcutil to control external displays @az01101001

    BrightnessSlider module

    • allows to have a separate brightness slider, especially on ddcutil-controlled outputs, without multiple instances of the Controls module. @az01101001
    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Jun 16, 2022)

    • Added OpenWeather module (NEW DEPENDENCY: python-requests);
    • added separate horizontal and vertical margin for the Controls module popup window #121 by @az01101001;
    • added custom labels for workspaces in the SwayWorkspaces module #123 by @az01101001.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jun 6, 2022)

  • v0.6.5(May 22, 2022)

  • v0.6.4(May 13, 2022)

  • v0.6.3(Apr 13, 2022)

    • fixed improper error message on python-dasbus module missing; The module should be moved to hard dependencies; Closes #99
    • added check if Gdk.Monitor detected: if not, the panel instance won't be created
    • [SwayTaskbar] added switch to turn the (a)utotiling marker on/off; Closes #100
    • [SwayTaskbar] added switchable X|wayland marker
    Source code(tar.gz)
    Source code(zip)
  • v0.6.2(Mar 17, 2022)

    • fixed crash happening on a Monitor turned off and back on
    • added fallback method of killing the running instance if SIGTERM fails: fixes the panel duplication occurring sometimes on panel restart #93
    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Feb 1, 2022)

  • v0.6.0(Jan 29, 2022)

  • v0.5.8(Jan 26, 2022)

    • fixed bug that would permanently hide executors (2 lines, icon + text) if no content found
    • added optional field to specify a backlight device path or name (for light / brightnessctl) used by the Controls module. Closes #83
    Source code(tar.gz)
    Source code(zip)
  • v0.5.7(Jan 15, 2022)

  • v0.5.6(Jan 9, 2022)

  • v0.5.5(Jan 7, 2022)

  • v0.5.4(Dec 30, 2021)

  • v0.5.3(Dec 30, 2021)

  • v0.5.2(Dec 14, 2021)

    The python-pybluez module crashes on python 3.10 (#72). Since the bug seems to have been first reported in February, and still remains unfixed, I decided to drop this dependency, and use the btmgmt info command from the bluez-utils package instead. Additional benefit is that we now have the BT name instead od MAC address.

    TL/DR: dependency changed - bluez-utils instead of python-pybluez.

    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Dec 13, 2021)

    • support for brightnessctl as the light package alternative
    • upower as fallback battery check (where psutil doesn't work)
    • changed assignment battery level -> icon
    Source code(tar.gz)
    Source code(zip)
Owner
Piotr Miller
After hours developer, Linux fan, Arch Linux user
Piotr Miller
Мои личные наработки по новому API Тинькофф. Не официально.

TinkoffNewAPI Мои личные наработки по новому API Тинькофф. Не официально. Официально по ссылке: https://github.com/Tinkoff/investAPI/ Выложено по прос

1 Jan 20, 2022
An API which returns random AOT quote everytime it's invoked

An API which returns random AOT quote everytime it's invoked

Nishant Sapkota 1 Feb 07, 2022
Telegram Url Upload Bot With Same more Features ✨

Telegram Url Upload Bot With Same more Features ✨

Group Dc Bots 4 Feb 12, 2022
🥀 Find the start of the token !

Discord Token Finder Find half of your target's token with just their ID. Install 🔧 pip install -r requeriments.txt Gui Usage 💻 Go to Discord Setti

zeytroxxx 2 Dec 22, 2021
A python bot that scrapes free udemy coupons and sends them to Telegram.

About: A python telegram bot that scrapes information about fresh free Udemy coupons content from couponscorpion.com and sends it to teleram channel h

Irina Gayday 1 Dec 19, 2021
A Python Script to automate searching of available vaccination centers in the city and hence booking

Cowin Vaccine Availability Notifier Cowin Vaccine Availability Notifier takes your City or PIN code as an input and automatically notifies you via ema

Jayesh Padhiar 7 Sep 05, 2021
Make your Pass (sanitaire) Fun Again

Make Your Pass (Sanitaire) Fun Again Customize your Pass Sanitaire (French name for EU digital Covide19 Certificate) with colors and images, thus make

101 Dec 01, 2022
AK-LEECH-BOT - AK LEECH BOT For python

Benefits :- ✓ Google Drive link cloning using gclone.(wip) ✓ Telegram File mirro

5 Mar 24, 2022
PRNT.sc Image Grabber

PRNTSender PRNT.sc Image Grabber PRNTSender is a script that takes images posted on PRNT.sc and sends them to a Discord webhook, if you want to know h

neox 2 Dec 10, 2021
Scanner and Checker for Binance Scam Contracts

Money Printer by Warranty Voider well this isnt exactly a printer, but it helps you find and check new token startups. In the end its a nice scam cont

12 Nov 24, 2022
Grape - A webbrowser with its own Search Engine

Grape 🔎 A Web Browser made entirely in python. Search Engine 🔎 Installation: F

Grape 2 Sep 06, 2022
Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available

TikTok-AutoClaimer Working TikTok Username Auto-Claimer/Sniper/Swapper which will autoclaim username if it´s available Usage Python 3.6 or above is re

Kevin 18 Dec 08, 2022
Implementation of Chatterbot using Discord API

discord-chat-bot Implementation of Chatterbot using Discord API. Usage Due to the necessity of storing files to train the AI, the bot is not hosted pu

kiwijuice56 0 Sep 29, 2022
SelfBot, a lots of features: Mass DM , Nuke, Raid... and more!

SelfBot, a lots of features: Mass DM , Nuke, Raid... and more!

eryycr 2 Nov 10, 2021
A Python API to retrieve and read MLB GameDay data

mlbgame mlbgame is a Python API to retrieve and read MLB GameDay data. mlbgame works with real time data, getting information as games are being playe

Zach Panzarino 493 Dec 13, 2022
Telegram Bot to store Posts and Documents and it can Access by Special Links.

File-sharing-Bot Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 .

Code X Botz 1.2k Jan 08, 2023
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

JOBIN 0 Dec 01, 2021
`python-jamf` is a library for connecting to a Jamf Server that maps directly to the Jamf Pro Classic API.

`python-jamf` is a library for connecting to a Jamf Server that maps directly to the Jamf Pro Classic API. It is the basis for the `jctl` tool to automate patch management & packages and many other i

University of Utah, Marriott Library, Apple Support 38 Dec 13, 2022
“ Hey there 👋 I'm Daisy „ AI based Advanced Group Management Bot Suit For All Your Needs ❤️.. Source Code of @Daisyxbot

Project still under heavy development Everything will be changed in the release “ Hey there 👋 I'm Daisy „ AI based Advanced telegram Group Management

TeamDaisyX 43 Nov 12, 2022
Share your files on local network just by one click.

Share Your Folder This script helps you to share any folder anywhere on your local network. it's possible to use the script on both: Windows (Click he

Mehran Seifalinia 15 Oct 23, 2022