Compare commits
1 Commits
3304143997
...
9c2695133c
Author | SHA1 | Date |
---|---|---|
blankie | 9c2695133c |
24
.clang-tidy
24
.clang-tidy
|
@ -15,15 +15,15 @@ Checks: >
|
|||
-readability-redundant-member-init,
|
||||
-readability-redundant-string-init,
|
||||
-readability-identifier-length
|
||||
# CheckOptions:
|
||||
# - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
||||
# - { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||
# - { key: readability-identifier-naming.VariableCase, value: camelBack }
|
||||
# - { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
|
||||
# - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
||||
# - { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||
# - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||
# - { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||
CheckOptions:
|
||||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.VariableCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
|
||||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
||||
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
||||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||
|
|
|
@ -16,5 +16,4 @@ jobs:
|
|||
with:
|
||||
source: "."
|
||||
extensions: "hpp,h,cpp,c"
|
||||
style: "file:.clang-format"
|
||||
clangFormatVersion: 18
|
||||
clangFormatVersion: 16
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# run every night at midnight
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Alexays/Waybar'
|
||||
strategy:
|
||||
fail-fast: false # don't fail the other jobs if one of the images fails to build
|
||||
matrix:
|
||||
os: [ 'alpine', 'archlinux', 'debian', 'fedora', 'gentoo', 'opensuse' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfiles/${{ matrix.os }}
|
||||
push: true
|
||||
tags: alexays/waybar:${{ matrix.os }}
|
|
@ -14,22 +14,23 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Test in FreeBSD VM
|
||||
uses: cross-platform-actions/action@v0.25.0
|
||||
uses: cross-platform-actions/action@v0.23.0
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
CPPFLAGS: '-isystem/usr/local/include'
|
||||
LDFLAGS: '-L/usr/local/lib'
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: "14.1"
|
||||
version: "13.2"
|
||||
environment_variables: CPPFLAGS LDFLAGS
|
||||
sync_files: runner-to-vm
|
||||
run: |
|
||||
sudo sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
|
||||
sudo pkg install -y git # subprojects/date
|
||||
sudo pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
|
||||
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
|
||||
pkgconf pipewire pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||
pkgconf pulseaudio scdoc sndio spdlog wayland-protocols upower \
|
||||
libinotify
|
||||
meson setup build -Dman-pages=enabled
|
||||
meson build -Dman-pages=enabled
|
||||
ninja -C build
|
||||
meson test -C build --no-rebuild --print-errorlogs --suite waybar
|
||||
|
|
|
@ -9,7 +9,6 @@ concurrency:
|
|||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distro:
|
||||
- alpine
|
||||
|
@ -27,7 +26,7 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: configure
|
||||
run: meson setup -Dman-pages=enabled -Dcpp_std=${{matrix.cpp_std}} build
|
||||
run: meson -Dman-pages=enabled -Dcpp_std=${{matrix.cpp_std}} build
|
||||
- name: build
|
||||
run: ninja -C build
|
||||
- name: test
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
name: "Nix-Tests"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
nix-flake-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- run: nix flake show
|
||||
- run: nix flake check --print-build-logs
|
||||
- run: nix build --print-build-logs
|
|
@ -1,22 +0,0 @@
|
|||
name: update-flake-lock
|
||||
on:
|
||||
workflow_dispatch: # allows manual triggering
|
||||
schedule:
|
||||
- cron: '0 0 1 * *' # Run monthly
|
||||
push:
|
||||
paths:
|
||||
- 'flake.nix'
|
||||
jobs:
|
||||
lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Alexays/Waybar'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
extra_nix_config: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Update flake.lock
|
||||
uses: DeterminateSystems/update-flake-lock@v21
|
|
@ -48,5 +48,3 @@ packagecache
|
|||
# Nix
|
||||
result
|
||||
result-*
|
||||
|
||||
.ccls-cache
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
FROM archlinux:base-devel
|
||||
|
||||
RUN pacman -Syu --noconfirm && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols glib2-devel pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl iniparser fftw && \
|
||||
pacman -S --noconfirm git meson base-devel libinput wayland wayland-protocols pixman libxkbcommon mesa gtkmm3 jsoncpp pugixml scdoc libpulse libdbusmenu-gtk3 libmpdclient gobject-introspection libxkbcommon playerctl iniparser fftw && \
|
||||
sed -Ei 's/#(en_(US|GB)\.UTF)/\1/' /etc/locale.gen && locale-gen
|
||||
|
|
|
@ -34,7 +34,7 @@ RUN apt update && \
|
|||
libudev-dev \
|
||||
libupower-glib-dev \
|
||||
libwayland-dev \
|
||||
libwireplumber-0.5-dev \
|
||||
libwireplumber-0.4-dev \
|
||||
libxkbcommon-dev \
|
||||
libxkbregistry-dev \
|
||||
locales \
|
||||
|
|
|
@ -29,6 +29,6 @@ RUN dnf install -y @c-development \
|
|||
'pkgconfig(wayland-client)' \
|
||||
'pkgconfig(wayland-cursor)' \
|
||||
'pkgconfig(wayland-protocols)' \
|
||||
'pkgconfig(wireplumber-0.5)' \
|
||||
'pkgconfig(wireplumber-0.4)' \
|
||||
'pkgconfig(xkbregistry)' && \
|
||||
dnf clean all -y
|
||||
|
|
|
@ -6,4 +6,4 @@ RUN zypper -n up && \
|
|||
zypper addrepo https://download.opensuse.org/repositories/X11:Wayland/openSUSE_Tumbleweed/X11:Wayland.repo | echo 'a' && \
|
||||
zypper -n refresh && \
|
||||
zypper -n install -t pattern devel_C_C++ && \
|
||||
zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel libxkbregistry-devel scdoc playerctl-devel python3-packaging
|
||||
zypper -n install git meson clang libinput10 libinput-devel pugixml-devel libwayland-client0 libwayland-cursor0 wayland-protocols-devel wayland-devel Mesa-libEGL-devel Mesa-libGLESv2-devel libgbm-devel libxkbcommon-devel libudev-devel libpixman-1-0-devel gtkmm3-devel jsoncpp-devel libxkbregistry-devel scdoc playerctl-devel
|
||||
|
|
4
Makefile
4
Makefile
|
@ -3,11 +3,11 @@
|
|||
default: build
|
||||
|
||||
build:
|
||||
meson setup build
|
||||
meson build
|
||||
ninja -C build
|
||||
|
||||
build-debug:
|
||||
meson setup build --buildtype=debug
|
||||
meson build --buildtype=debug
|
||||
ninja -C build
|
||||
|
||||
install: build
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
- Sway (Workspaces, Binding mode, Focused window name)
|
||||
- River (Mapping mode, Tags, Focused window name)
|
||||
- Hyprland (Window Icons, Workspaces, Focused window name)
|
||||
- Niri (Workspaces, Focused window name, Language)
|
||||
- DWL (Tags, Focused window name) [requires dwl ipc patch](https://github.com/djpohly/dwl/wiki/ipc)
|
||||
- Tray [#21](https://github.com/Alexays/Waybar/issues/21)
|
||||
- Local time
|
||||
|
@ -49,7 +48,7 @@ An Ubuntu PPA with more recent versions is available
|
|||
```bash
|
||||
$ git clone https://github.com/Alexays/Waybar
|
||||
$ cd Waybar
|
||||
$ meson setup build
|
||||
$ meson build
|
||||
$ ninja -C build
|
||||
$ ./build/waybar
|
||||
# If you want to install it
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1726062873,
|
||||
"narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=",
|
||||
"lastModified": 1711163522,
|
||||
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f",
|
||||
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
38
flake.nix
38
flake.nix
|
@ -16,12 +16,7 @@
|
|||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
]
|
||||
(system: func (import nixpkgs {
|
||||
inherit system;
|
||||
overlays = with self.overlays; [
|
||||
waybar
|
||||
];
|
||||
}));
|
||||
(system: func (import nixpkgs { inherit system; }));
|
||||
|
||||
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||
(builtins.substring 0 4 longDate)
|
||||
|
@ -51,25 +46,22 @@
|
|||
};
|
||||
});
|
||||
|
||||
overlays = {
|
||||
default = self.overlays.waybar;
|
||||
waybar = final: prev: {
|
||||
waybar = final.callPackage ./nix/default.nix {
|
||||
waybar = prev.waybar;
|
||||
# take the first "version: '...'" from meson.build
|
||||
version =
|
||||
(builtins.head (builtins.split "'"
|
||||
(builtins.elemAt
|
||||
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
||||
2)))
|
||||
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
};
|
||||
overlays.default = final: prev: {
|
||||
waybar = final.callPackage ./nix/default.nix {
|
||||
# take the first "version: '...'" from meson.build
|
||||
version =
|
||||
(builtins.head (builtins.split "'"
|
||||
(builtins.elemAt
|
||||
(builtins.split " version: '" (builtins.readFile ./meson.build))
|
||||
2)))
|
||||
+ "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
};
|
||||
};
|
||||
|
||||
packages = genSystems (pkgs: {
|
||||
default = self.packages.${pkgs.stdenv.hostPlatform.system}.waybar;
|
||||
inherit (pkgs) waybar;
|
||||
});
|
||||
packages = genSystems (pkgs:
|
||||
let packages = self.overlays.default pkgs pkgs;
|
||||
in packages // {
|
||||
default = packages.waybar;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,10 +27,6 @@ class ALabel : public AModule {
|
|||
|
||||
bool handleToggle(GdkEventButton *const &e) override;
|
||||
virtual std::string getState(uint8_t value, bool lesser = false);
|
||||
|
||||
std::map<std::string, GtkMenuItem *> submenus_;
|
||||
std::map<std::string, std::string> menuActionsMap_;
|
||||
static void handleGtkMenuEvent(GtkMenuItem *menuitem, gpointer data);
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <glibmm/dispatcher.h>
|
||||
#include <glibmm/markup.h>
|
||||
#include <gtkmm.h>
|
||||
#include <gtkmm/eventbox.h>
|
||||
#include <json/json.h>
|
||||
|
||||
|
@ -14,9 +13,9 @@ class AModule : public IModule {
|
|||
public:
|
||||
static constexpr const char *MODULE_CLASS = "module";
|
||||
|
||||
~AModule() override;
|
||||
virtual ~AModule();
|
||||
auto update() -> void override;
|
||||
virtual auto refresh(int shouldRefresh) -> void {};
|
||||
virtual auto refresh(int) -> void{};
|
||||
operator Gtk::Widget &() override;
|
||||
auto doAction(const std::string &name) -> void override;
|
||||
|
||||
|
@ -32,25 +31,19 @@ class AModule : public IModule {
|
|||
enum SCROLL_DIR { NONE, UP, DOWN, LEFT, RIGHT };
|
||||
|
||||
SCROLL_DIR getScrollDir(GdkEventScroll *e);
|
||||
bool tooltipEnabled() const;
|
||||
bool tooltipEnabled();
|
||||
|
||||
const std::string name_;
|
||||
const Json::Value &config_;
|
||||
Gtk::EventBox event_box_;
|
||||
|
||||
virtual void setCursor(Gdk::CursorType const &c);
|
||||
|
||||
virtual bool handleToggle(GdkEventButton *const &ev);
|
||||
virtual bool handleMouseEnter(GdkEventCrossing *const &ev);
|
||||
virtual bool handleMouseLeave(GdkEventCrossing *const &ev);
|
||||
virtual bool handleScroll(GdkEventScroll *);
|
||||
virtual bool handleRelease(GdkEventButton *const &ev);
|
||||
GObject *menu_;
|
||||
|
||||
private:
|
||||
bool handleUserEvent(GdkEventButton *const &ev);
|
||||
const bool isTooltip;
|
||||
bool hasUserEvents_;
|
||||
std::vector<int> pid_;
|
||||
gdouble distance_scrolled_y_;
|
||||
gdouble distance_scrolled_x_;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <json/json.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
|
@ -54,7 +53,7 @@ class BarIpcClient;
|
|||
}
|
||||
#endif // HAVE_SWAY
|
||||
|
||||
class Bar : public sigc::trackable {
|
||||
class Bar {
|
||||
public:
|
||||
using bar_mode_map = std::map<std::string, struct bar_mode>;
|
||||
static const bar_mode_map PRESET_MODES;
|
||||
|
@ -66,7 +65,7 @@ class Bar : public sigc::trackable {
|
|||
~Bar();
|
||||
|
||||
void setMode(const std::string &mode);
|
||||
void setVisible(bool value);
|
||||
void setVisible(bool visible);
|
||||
void toggle();
|
||||
void handleSignal(int);
|
||||
|
||||
|
|
|
@ -20,9 +20,6 @@ class Config {
|
|||
static std::optional<std::string> findConfigPath(
|
||||
const std::vector<std::string> &names, const std::vector<std::string> &dirs = CONFIG_DIRS);
|
||||
|
||||
static std::optional<std::string> tryExpandPath(const std::string &base,
|
||||
const std::string &filename);
|
||||
|
||||
Config() = default;
|
||||
|
||||
void load(const std::string &config);
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace waybar {
|
|||
|
||||
class Group : public AModule {
|
||||
public:
|
||||
Group(const std::string &, const std::string &, const Json::Value &, bool);
|
||||
~Group() override = default;
|
||||
Group(const std::string&, const std::string&, const Json::Value&, bool);
|
||||
virtual ~Group() = default;
|
||||
auto update() -> void override;
|
||||
operator Gtk::Widget &() override;
|
||||
operator Gtk::Widget&() override;
|
||||
|
||||
virtual Gtk::Box &getBox();
|
||||
void addWidget(Gtk::Widget &widget);
|
||||
virtual Gtk::Box& getBox();
|
||||
void addWidget(Gtk::Widget& widget);
|
||||
|
||||
bool handleMouseHover(GdkEventCrossing* const& e);
|
||||
|
||||
protected:
|
||||
Gtk::Box box;
|
||||
|
@ -25,13 +27,9 @@ class Group : public AModule {
|
|||
Gtk::Revealer revealer;
|
||||
bool is_first_widget = true;
|
||||
bool is_drawer = false;
|
||||
bool click_to_reveal = false;
|
||||
std::string add_class_to_drawer_children;
|
||||
bool handleMouseEnter(GdkEventCrossing *const &ev) override;
|
||||
bool handleMouseLeave(GdkEventCrossing *const &ev) override;
|
||||
bool handleToggle(GdkEventButton *const &ev) override;
|
||||
void show_group();
|
||||
void hide_group();
|
||||
|
||||
void addHoverHandlerTo(Gtk::Widget& widget);
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
|
|
@ -32,7 +32,7 @@ class Battery : public ALabel {
|
|||
void refreshBatteries();
|
||||
void worker();
|
||||
const std::string getAdapterStatus(uint8_t capacity) const;
|
||||
std::tuple<uint8_t, float, std::string, float, uint16_t, float> getInfos();
|
||||
const std::tuple<uint8_t, float, std::string, float> getInfos();
|
||||
const std::string formatTimeRemaining(float hoursRemaining);
|
||||
void setBarClass(std::string&);
|
||||
|
||||
|
|
|
@ -49,9 +49,6 @@ class Bluetooth : public ALabel {
|
|||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
static auto onObjectAdded(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
|
||||
static auto onObjectRemoved(GDBusObjectManager*, GDBusObject*, gpointer) -> void;
|
||||
|
||||
static auto onInterfaceAddedOrRemoved(GDBusObjectManager*, GDBusObject*, GDBusInterface*,
|
||||
gpointer) -> void;
|
||||
static auto onInterfaceProxyPropertiesChanged(GDBusObjectManagerClient*, GDBusObjectProxy*,
|
||||
|
|
|
@ -39,7 +39,6 @@ class Cava final : public ALabel {
|
|||
std::chrono::seconds suspend_silence_delay_{0};
|
||||
bool silence_{false};
|
||||
bool hide_on_silence_{false};
|
||||
std::string format_silent_{""};
|
||||
int sleep_counter_{0};
|
||||
// Cava method
|
||||
void pause_resume();
|
||||
|
|
|
@ -21,12 +21,10 @@ class Clock final : public ALabel {
|
|||
auto doAction(const std::string&) -> void override;
|
||||
|
||||
private:
|
||||
const std::locale m_locale_;
|
||||
const std::locale locale_;
|
||||
// tooltip
|
||||
const std::string m_tlpFmt_;
|
||||
std::string m_tlpText_{""}; // tooltip text to print
|
||||
const Glib::RefPtr<Gtk::Label> m_tooltip_; // tooltip as a separate Gtk::Label
|
||||
bool query_tlp_cb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip>& tooltip);
|
||||
const std::string tlpFmt_;
|
||||
std::string tlpText_{""}; // tooltip text to print
|
||||
// Calendar
|
||||
const bool cldInTooltip_; // calendar in tooltip
|
||||
/*
|
||||
|
@ -51,11 +49,8 @@ class Clock final : public ALabel {
|
|||
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
|
||||
std::string cldText_{""}; // calendar text to print
|
||||
CldMode cldMode_{CldMode::MONTH};
|
||||
auto get_calendar(const year_month_day& today, const year_month_day& ymd,
|
||||
const time_zone* tz) -> const std::string;
|
||||
|
||||
// get local time zone
|
||||
auto local_zone() -> const time_zone*;
|
||||
auto get_calendar(const year_month_day& today, const year_month_day& ymd, const time_zone* tz)
|
||||
-> const std::string;
|
||||
|
||||
// time zoned time in tooltip
|
||||
const bool tzInTooltip_; // if need to print time zones text
|
||||
|
@ -75,7 +70,6 @@ class Clock final : public ALabel {
|
|||
void cldModeSwitch();
|
||||
void cldShift_up();
|
||||
void cldShift_down();
|
||||
void cldShift_reset();
|
||||
void tz_up();
|
||||
void tz_down();
|
||||
// Module Action Map
|
||||
|
@ -83,7 +77,6 @@ class Clock final : public ALabel {
|
|||
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
||||
{"shift_up", &waybar::modules::Clock::cldShift_up},
|
||||
{"shift_down", &waybar::modules::Clock::cldShift_down},
|
||||
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
|
||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||
};
|
||||
|
|
|
@ -35,7 +35,6 @@ class Custom : public ALabel {
|
|||
std::string id_;
|
||||
std::string alt_;
|
||||
std::string tooltip_;
|
||||
const bool tooltip_format_enabled_;
|
||||
std::vector<std::string> class_;
|
||||
int percentage_;
|
||||
FILE* fp_;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace waybar::modules::dwl {
|
|||
class Window : public AAppIconLabel, public sigc::trackable {
|
||||
public:
|
||||
Window(const std::string &, const waybar::Bar &, const Json::Value &);
|
||||
~Window();
|
||||
virtual ~Window() = default;
|
||||
|
||||
void handle_layout(const uint32_t layout);
|
||||
void handle_title(const char *title);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
@ -26,10 +25,6 @@ class IPC {
|
|||
|
||||
static std::string getSocket1Reply(const std::string& rq);
|
||||
Json::Value getSocket1JsonReply(const std::string& rq);
|
||||
static std::filesystem::path getSocketFolder(const char* instanceSig);
|
||||
|
||||
protected:
|
||||
static std::filesystem::path socketFolder_;
|
||||
|
||||
private:
|
||||
void startIPC();
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "util/enum.hpp"
|
||||
#include "util/regex_collection.hpp"
|
||||
|
||||
using WindowAddress = std::string;
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Workspaces;
|
||||
|
||||
class WindowCreationPayload {
|
||||
public:
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_repr);
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_class, std::string window_title);
|
||||
WindowCreationPayload(Json::Value const& client_data);
|
||||
|
||||
int incrementTimeSpentUncreated();
|
||||
bool isEmpty(Workspaces& workspace_manager);
|
||||
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
|
||||
std::string repr(Workspaces& workspace_manager);
|
||||
|
||||
std::string getWorkspaceName() const { return m_workspaceName; }
|
||||
WindowAddress getAddress() const { return m_windowAddress; }
|
||||
|
||||
void moveToWorksace(std::string& new_workspace_name);
|
||||
|
||||
private:
|
||||
void clearAddr();
|
||||
void clearWorkspaceName();
|
||||
|
||||
using Repr = std::string;
|
||||
using ClassAndTitle = std::pair<std::string, std::string>;
|
||||
std::variant<Repr, ClassAndTitle> m_window;
|
||||
|
||||
WindowAddress m_windowAddress;
|
||||
std::string m_workspaceName;
|
||||
|
||||
int m_timeSpentUncreated = 0;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
|
@ -1,88 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "modules/hyprland/windowcreationpayload.hpp"
|
||||
#include "util/enum.hpp"
|
||||
#include "util/regex_collection.hpp"
|
||||
|
||||
using WindowAddress = std::string;
|
||||
|
||||
namespace waybar::modules::hyprland {
|
||||
|
||||
class Workspaces;
|
||||
class Workspace {
|
||||
public:
|
||||
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
||||
const Json::Value& clients_data = Json::Value::nullRef);
|
||||
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
|
||||
Gtk::Button& button() { return m_button; };
|
||||
|
||||
int id() const { return m_id; };
|
||||
std::string name() const { return m_name; };
|
||||
std::string output() const { return m_output; };
|
||||
bool isActive() const { return m_isActive; };
|
||||
bool isSpecial() const { return m_isSpecial; };
|
||||
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
|
||||
bool isPersistentConfig() const { return m_isPersistentConfig; };
|
||||
bool isPersistentRule() const { return m_isPersistentRule; };
|
||||
bool isVisible() const { return m_isVisible; };
|
||||
bool isEmpty() const { return m_windows == 0; };
|
||||
bool isUrgent() const { return m_isUrgent; };
|
||||
|
||||
bool handleClicked(GdkEventButton* bt) const;
|
||||
void setActive(bool value = true) { m_isActive = value; };
|
||||
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
|
||||
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
|
||||
void setUrgent(bool value = true) { m_isUrgent = value; };
|
||||
void setVisible(bool value = true) { m_isVisible = value; };
|
||||
void setWindows(uint value) { m_windows = value; };
|
||||
void setName(std::string const& value) { m_name = value; };
|
||||
void setOutput(std::string const& value) { m_output = value; };
|
||||
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
|
||||
void insertWindow(WindowCreationPayload create_window_paylod);
|
||||
std::string removeWindow(WindowAddress const& addr);
|
||||
void initializeWindowMap(const Json::Value& clients_data);
|
||||
|
||||
bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
|
||||
std::optional<std::string> closeWindow(WindowAddress const& addr);
|
||||
|
||||
void update(const std::string& format, const std::string& icon);
|
||||
|
||||
private:
|
||||
Workspaces& m_workspaceManager;
|
||||
|
||||
int m_id;
|
||||
std::string m_name;
|
||||
std::string m_output;
|
||||
uint m_windows;
|
||||
bool m_isActive = false;
|
||||
bool m_isSpecial = false;
|
||||
bool m_isPersistentRule = false; // represents the persistent state in hyprland
|
||||
bool m_isPersistentConfig = false; // represents the persistent state in the Waybar config
|
||||
bool m_isUrgent = false;
|
||||
bool m_isVisible = false;
|
||||
|
||||
std::map<WindowAddress, std::string> m_windowMap;
|
||||
|
||||
Gtk::Button m_button;
|
||||
Gtk::Box m_content;
|
||||
Gtk::Label m_label;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
|
@ -4,18 +4,19 @@
|
|||
#include <gtkmm/label.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/hyprland/backend.hpp"
|
||||
#include "modules/hyprland/windowcreationpayload.hpp"
|
||||
#include "modules/hyprland/workspace.hpp"
|
||||
#include "util/enum.hpp"
|
||||
#include "util/regex_collection.hpp"
|
||||
|
||||
|
@ -25,6 +26,97 @@ namespace waybar::modules::hyprland {
|
|||
|
||||
class Workspaces;
|
||||
|
||||
class WindowCreationPayload {
|
||||
public:
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_repr);
|
||||
WindowCreationPayload(std::string workspace_name, WindowAddress window_address,
|
||||
std::string window_class, std::string window_title);
|
||||
WindowCreationPayload(Json::Value const& client_data);
|
||||
|
||||
int incrementTimeSpentUncreated();
|
||||
bool isEmpty(Workspaces& workspace_manager);
|
||||
bool reprIsReady() const { return std::holds_alternative<Repr>(m_window); }
|
||||
std::string repr(Workspaces& workspace_manager);
|
||||
|
||||
std::string getWorkspaceName() const { return m_workspaceName; }
|
||||
WindowAddress getAddress() const { return m_windowAddress; }
|
||||
|
||||
void moveToWorksace(std::string& new_workspace_name);
|
||||
|
||||
private:
|
||||
void clearAddr();
|
||||
void clearWorkspaceName();
|
||||
|
||||
using Repr = std::string;
|
||||
using ClassAndTitle = std::pair<std::string, std::string>;
|
||||
std::variant<Repr, ClassAndTitle> m_window;
|
||||
|
||||
WindowAddress m_windowAddress;
|
||||
std::string m_workspaceName;
|
||||
|
||||
int m_timeSpentUncreated = 0;
|
||||
};
|
||||
|
||||
class Workspace {
|
||||
public:
|
||||
explicit Workspace(const Json::Value& workspace_data, Workspaces& workspace_manager,
|
||||
const Json::Value& clients_data = Json::Value::nullRef);
|
||||
std::string& selectIcon(std::map<std::string, std::string>& icons_map);
|
||||
Gtk::Button& button() { return m_button; };
|
||||
|
||||
int id() const { return m_id; };
|
||||
std::string name() const { return m_name; };
|
||||
std::string output() const { return m_output; };
|
||||
bool isActive() const { return m_isActive; };
|
||||
bool isSpecial() const { return m_isSpecial; };
|
||||
bool isPersistent() const { return m_isPersistentRule || m_isPersistentConfig; };
|
||||
bool isPersistentConfig() const { return m_isPersistentConfig; };
|
||||
bool isPersistentRule() const { return m_isPersistentRule; };
|
||||
bool isVisible() const { return m_isVisible; };
|
||||
bool isEmpty() const { return m_windows == 0; };
|
||||
bool isUrgent() const { return m_isUrgent; };
|
||||
|
||||
bool handleClicked(GdkEventButton* bt) const;
|
||||
void setActive(bool value = true) { m_isActive = value; };
|
||||
void setPersistentRule(bool value = true) { m_isPersistentRule = value; };
|
||||
void setPersistentConfig(bool value = true) { m_isPersistentConfig = value; };
|
||||
void setUrgent(bool value = true) { m_isUrgent = value; };
|
||||
void setVisible(bool value = true) { m_isVisible = value; };
|
||||
void setWindows(uint value) { m_windows = value; };
|
||||
void setName(std::string const& value) { m_name = value; };
|
||||
void setOutput(std::string const& value) { m_output = value; };
|
||||
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
|
||||
void insertWindow(WindowCreationPayload create_window_paylod);
|
||||
std::string removeWindow(WindowAddress const& addr);
|
||||
void initializeWindowMap(const Json::Value& clients_data);
|
||||
|
||||
bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
|
||||
std::optional<std::string> closeWindow(WindowAddress const& addr);
|
||||
|
||||
void update(const std::string& format, const std::string& icon);
|
||||
|
||||
private:
|
||||
Workspaces& m_workspaceManager;
|
||||
|
||||
int m_id;
|
||||
std::string m_name;
|
||||
std::string m_output;
|
||||
uint m_windows;
|
||||
bool m_isActive = false;
|
||||
bool m_isSpecial = false;
|
||||
bool m_isPersistentRule = false; // represents the persistent state in hyprland
|
||||
bool m_isPersistentConfig = false; // represents the persistent state in the Waybar config
|
||||
bool m_isUrgent = false;
|
||||
bool m_isVisible = false;
|
||||
|
||||
std::map<WindowAddress, std::string> m_windowMap;
|
||||
|
||||
Gtk::Button m_button;
|
||||
Gtk::Box m_content;
|
||||
Gtk::Label m_label;
|
||||
};
|
||||
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
|
@ -35,7 +127,6 @@ class Workspaces : public AModule, public EventHandler {
|
|||
auto allOutputs() const -> bool { return m_allOutputs; }
|
||||
auto showSpecial() const -> bool { return m_showSpecial; }
|
||||
auto activeOnly() const -> bool { return m_activeOnly; }
|
||||
auto specialVisibleOnly() const -> bool { return m_specialVisibleOnly; }
|
||||
auto moveToMonitor() const -> bool { return m_moveToMonitor; }
|
||||
|
||||
auto getBarOutput() const -> std::string { return m_bar.output->name; }
|
||||
|
@ -50,24 +141,11 @@ class Workspaces : public AModule, public EventHandler {
|
|||
void onEvent(const std::string& e) override;
|
||||
void updateWindowCount();
|
||||
void sortWorkspaces();
|
||||
void createWorkspace(Json::Value const& workspace_data,
|
||||
Json::Value const& clients_data = Json::Value::nullRef);
|
||||
|
||||
static Json::Value createMonitorWorkspaceData(std::string const& name,
|
||||
std::string const& monitor);
|
||||
void createWorkspace(Json::Value const& workspaceData,
|
||||
Json::Value const& clientsData = Json::Value::nullRef);
|
||||
void removeWorkspace(std::string const& name);
|
||||
void setUrgentWorkspace(std::string const& windowaddress);
|
||||
|
||||
// Config
|
||||
void parseConfig(const Json::Value& config);
|
||||
auto populateIconsMap(const Json::Value& formatIcons) -> void;
|
||||
static auto populateBoolConfig(const Json::Value& config, const std::string& key,
|
||||
bool& member) -> void;
|
||||
auto populateSortByConfig(const Json::Value& config) -> void;
|
||||
auto populateIgnoreWorkspacesConfig(const Json::Value& config) -> void;
|
||||
auto populateFormatWindowSeparatorConfig(const Json::Value& config) -> void;
|
||||
auto populateWindowRewriteConfig(const Json::Value& config) -> void;
|
||||
|
||||
void registerIpc();
|
||||
|
||||
// workspace events
|
||||
|
@ -93,13 +171,7 @@ class Workspaces : public AModule, public EventHandler {
|
|||
|
||||
int windowRewritePriorityFunction(std::string const& window_rule);
|
||||
|
||||
// Update methods
|
||||
void doUpdate();
|
||||
void removeWorkspacesToRemove();
|
||||
void createWorkspacesToCreate();
|
||||
static std::vector<std::string> getVisibleWorkspaces();
|
||||
void updateWorkspaceStates();
|
||||
bool updateWindowsToCreate();
|
||||
|
||||
void extendOrphans(int workspaceId, Json::Value const& clientsJson);
|
||||
void registerOrphanWindow(WindowCreationPayload create_window_payload);
|
||||
|
@ -112,7 +184,6 @@ class Workspaces : public AModule, public EventHandler {
|
|||
bool m_allOutputs = false;
|
||||
bool m_showSpecial = false;
|
||||
bool m_activeOnly = false;
|
||||
bool m_specialVisibleOnly = false;
|
||||
bool m_moveToMonitor = false;
|
||||
Json::Value m_persistentWorkspaceConfig;
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ class Network : public ALabel {
|
|||
void parseEssid(struct nlattr**);
|
||||
void parseSignal(struct nlattr**);
|
||||
void parseFreq(struct nlattr**);
|
||||
void parseBssid(struct nlattr**);
|
||||
bool associatedOrJoined(struct nlattr**);
|
||||
bool checkInterface(std::string name);
|
||||
auto getInfo() -> void;
|
||||
|
@ -70,7 +69,6 @@ class Network : public ALabel {
|
|||
|
||||
std::string state_;
|
||||
std::string essid_;
|
||||
std::string bssid_;
|
||||
bool carrier_;
|
||||
std::string ifname_;
|
||||
std::string ipaddr_;
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "util/json.hpp"
|
||||
|
||||
namespace waybar::modules::niri {
|
||||
|
||||
class EventHandler {
|
||||
public:
|
||||
virtual void onEvent(const Json::Value& ev) = 0;
|
||||
virtual ~EventHandler() = default;
|
||||
};
|
||||
|
||||
class IPC {
|
||||
public:
|
||||
IPC() { startIPC(); }
|
||||
|
||||
void registerForIPC(const std::string& ev, EventHandler* ev_handler);
|
||||
void unregisterForIPC(EventHandler* handler);
|
||||
|
||||
static Json::Value send(const Json::Value& request);
|
||||
|
||||
// The data members are only safe to access while dataMutex_ is locked.
|
||||
std::lock_guard<std::mutex> lockData() { return std::lock_guard(dataMutex_); }
|
||||
const std::vector<Json::Value>& workspaces() const { return workspaces_; }
|
||||
const std::vector<Json::Value>& windows() const { return windows_; }
|
||||
const std::vector<std::string>& keyboardLayoutNames() const { return keyboardLayoutNames_; }
|
||||
unsigned keyboardLayoutCurrent() const { return keyboardLayoutCurrent_; }
|
||||
|
||||
private:
|
||||
void startIPC();
|
||||
static int connectToSocket();
|
||||
void parseIPC(const std::string&);
|
||||
|
||||
std::mutex dataMutex_;
|
||||
std::vector<Json::Value> workspaces_;
|
||||
std::vector<Json::Value> windows_;
|
||||
std::vector<std::string> keyboardLayoutNames_;
|
||||
unsigned keyboardLayoutCurrent_;
|
||||
|
||||
util::JsonParser parser_;
|
||||
std::mutex callbackMutex_;
|
||||
std::list<std::pair<std::string, EventHandler*>> callbacks_;
|
||||
};
|
||||
|
||||
inline std::unique_ptr<IPC> gIPC;
|
||||
|
||||
}; // namespace waybar::modules::niri
|
|
@ -1,38 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/niri/backend.hpp"
|
||||
|
||||
namespace waybar::modules::niri {
|
||||
|
||||
class Language : public ALabel, public EventHandler {
|
||||
public:
|
||||
Language(const std::string &, const Bar &, const Json::Value &);
|
||||
~Language() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void updateFromIPC();
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void doUpdate();
|
||||
|
||||
struct Layout {
|
||||
std::string full_name;
|
||||
std::string short_name;
|
||||
std::string variant;
|
||||
std::string short_description;
|
||||
};
|
||||
|
||||
static Layout getLayout(const std::string &fullName);
|
||||
|
||||
std::mutex mutex_;
|
||||
const Bar &bar_;
|
||||
|
||||
std::vector<Layout> layouts_;
|
||||
unsigned current_idx_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::niri
|
|
@ -1,28 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include "AAppIconLabel.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/niri/backend.hpp"
|
||||
|
||||
namespace waybar::modules::niri {
|
||||
|
||||
class Window : public AAppIconLabel, public EventHandler {
|
||||
public:
|
||||
Window(const std::string &, const Bar &, const Json::Value &);
|
||||
~Window() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void doUpdate();
|
||||
void setClass(const std::string &className, bool enable);
|
||||
|
||||
const Bar &bar_;
|
||||
|
||||
std::string oldAppId_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::niri
|
|
@ -1,30 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtkmm/button.h>
|
||||
#include <json/value.h>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/niri/backend.hpp"
|
||||
|
||||
namespace waybar::modules::niri {
|
||||
|
||||
class Workspaces : public AModule, public EventHandler {
|
||||
public:
|
||||
Workspaces(const std::string &, const Bar &, const Json::Value &);
|
||||
~Workspaces() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
void onEvent(const Json::Value &ev) override;
|
||||
void doUpdate();
|
||||
Gtk::Button &addButton(const Json::Value &ws);
|
||||
std::string getIcon(const std::string &value, const Json::Value &ws);
|
||||
|
||||
const Bar &bar_;
|
||||
Gtk::Box box_;
|
||||
// Map from niri workspace id to button.
|
||||
std::unordered_map<uint64_t, Gtk::Button> buttons_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::niri
|
|
@ -10,8 +10,6 @@ namespace waybar::modules {
|
|||
struct Profile {
|
||||
std::string name;
|
||||
std::string driver;
|
||||
|
||||
Profile(std::string n, std::string d) : name(std::move(n)), driver(std::move(d)) {}
|
||||
};
|
||||
|
||||
class PowerProfilesDaemon : public ALabel {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
#include "modules/privacy/privacy_item.hpp"
|
||||
#include "util/pipewire/pipewire_backend.hpp"
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
#include <json/value.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
|
|
|
@ -76,8 +76,6 @@ class Item : public sigc::trackable {
|
|||
void makeMenu();
|
||||
bool handleClick(GdkEventButton* const& /*ev*/);
|
||||
bool handleScroll(GdkEventScroll* const&);
|
||||
bool handleMouseEnter(GdkEventCrossing* const&);
|
||||
bool handleMouseLeave(GdkEventCrossing* const&);
|
||||
|
||||
// smooth scrolling threshold
|
||||
gdouble scroll_threshold_ = 0;
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace waybar::modules::sway {
|
|||
class Workspaces : public AModule, public sigc::trackable {
|
||||
public:
|
||||
Workspaces(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~Workspaces() override = default;
|
||||
virtual ~Workspaces() = default;
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
|
@ -38,10 +38,10 @@ class Workspaces : public AModule, public sigc::trackable {
|
|||
Gtk::Button& addButton(const Json::Value&);
|
||||
void onButtonReady(const Json::Value&, Gtk::Button&);
|
||||
std::string getIcon(const std::string&, const Json::Value&);
|
||||
std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
|
||||
const std::string getCycleWorkspace(std::vector<Json::Value>::iterator, bool prev) const;
|
||||
uint16_t getWorkspaceIndex(const std::string& name) const;
|
||||
static std::string trimWorkspaceName(std::string);
|
||||
bool handleScroll(GdkEventScroll* /*unused*/) override;
|
||||
std::string trimWorkspaceName(std::string);
|
||||
bool handleScroll(GdkEventScroll*) override;
|
||||
|
||||
const Bar& bar_;
|
||||
std::vector<Json::Value> workspaces_;
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <giomm/dbusconnection.h>
|
||||
#include <gtkmm/icontheme.h>
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AIconLabel.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class UPower final : public AIconLabel {
|
||||
public:
|
||||
UPower(const std::string &, const Json::Value &);
|
||||
virtual ~UPower();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
const std::string NO_BATTERY{"battery-missing-symbolic"};
|
||||
|
||||
// Config
|
||||
bool showIcon_{true};
|
||||
bool hideIfEmpty_{true};
|
||||
int iconSize_{20};
|
||||
int tooltip_spacing_{4};
|
||||
int tooltip_padding_{4};
|
||||
Gtk::Box contentBox_; // tooltip box
|
||||
std::string tooltipFormat_;
|
||||
|
||||
// UPower device info
|
||||
struct upDevice_output {
|
||||
UpDevice *upDevice{NULL};
|
||||
double percentage{0.0};
|
||||
double temperature{0.0};
|
||||
guint64 time_full{0u};
|
||||
guint64 time_empty{0u};
|
||||
gchar *icon_name{(char *)'\0'};
|
||||
bool upDeviceValid{false};
|
||||
UpDeviceState state;
|
||||
UpDeviceKind kind;
|
||||
char *nativePath{(char *)'\0'};
|
||||
char *model{(char *)'\0'};
|
||||
};
|
||||
|
||||
// Technical variables
|
||||
std::string nativePath_;
|
||||
std::string model_;
|
||||
std::string lastStatus_;
|
||||
Glib::ustring label_markup_;
|
||||
std::mutex mutex_;
|
||||
Glib::RefPtr<Gtk::IconTheme> gtkTheme_;
|
||||
bool sleeping_;
|
||||
|
||||
// Technical functions
|
||||
void addDevice(UpDevice *);
|
||||
void removeDevice(const gchar *);
|
||||
void removeDevices();
|
||||
void resetDevices();
|
||||
void setDisplayDevice();
|
||||
const Glib::ustring getText(const upDevice_output &upDevice_, const std::string &format);
|
||||
bool queryTooltipCb(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &);
|
||||
|
||||
// DBUS variables
|
||||
guint watcherID_;
|
||||
Glib::RefPtr<Gio::DBus::Connection> conn_;
|
||||
guint subscrID_{0u};
|
||||
|
||||
// UPower variables
|
||||
UpClient *upClient_;
|
||||
upDevice_output upDevice_; // Device to display
|
||||
typedef std::unordered_map<std::string, upDevice_output> Devices;
|
||||
Devices devices_;
|
||||
bool upRunning_{true};
|
||||
|
||||
// DBus callbacks
|
||||
void getConn_cb(Glib::RefPtr<Gio::AsyncResult> &result);
|
||||
void onAppear(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &,
|
||||
const Glib::ustring &);
|
||||
void onVanished(const Glib::RefPtr<Gio::DBus::Connection> &, const Glib::ustring &);
|
||||
void prepareForSleep_cb(const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
||||
const Glib::ustring &sender_name, const Glib::ustring &object_path,
|
||||
const Glib::ustring &interface_name, const Glib::ustring &signal_name,
|
||||
const Glib::VariantContainerBase ¶meters);
|
||||
|
||||
// UPower callbacks
|
||||
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
|
||||
static void deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data);
|
||||
static void deviceNotify_cb(UpDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||
// UPower secondary functions
|
||||
void getUpDeviceInfo(upDevice_output &upDevice_);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
|
@ -0,0 +1,82 @@
|
|||
#pragma once
|
||||
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "ALabel.hpp"
|
||||
#include "glibconfig.h"
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/image.h"
|
||||
#include "gtkmm/label.h"
|
||||
#include "modules/upower/upower_tooltip.hpp"
|
||||
|
||||
namespace waybar::modules::upower {
|
||||
|
||||
class UPower : public AModule {
|
||||
public:
|
||||
UPower(const std::string &, const Json::Value &);
|
||||
virtual ~UPower();
|
||||
auto update() -> void override;
|
||||
|
||||
private:
|
||||
typedef std::unordered_map<std::string, UpDevice *> Devices;
|
||||
|
||||
const std::string DEFAULT_FORMAT = "{percentage}";
|
||||
const std::string DEFAULT_FORMAT_ALT = "{percentage} {time}";
|
||||
|
||||
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
|
||||
static void deviceRemoved_cb(UpClient *client, const gchar *objectPath, gpointer data);
|
||||
static void deviceNotify_cb(UpDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||
static void prepareForSleep_cb(GDBusConnection *system_bus, const gchar *sender_name,
|
||||
const gchar *object_path, const gchar *interface_name,
|
||||
const gchar *signal_name, GVariant *parameters,
|
||||
gpointer user_data);
|
||||
static void upowerAppear(GDBusConnection *conn, const gchar *name, const gchar *name_owner,
|
||||
gpointer data);
|
||||
static void upowerDisappear(GDBusConnection *connection, const gchar *name, gpointer user_data);
|
||||
|
||||
void removeDevice(const gchar *objectPath);
|
||||
void addDevice(UpDevice *device);
|
||||
void setDisplayDevice();
|
||||
void resetDevices();
|
||||
void removeDevices();
|
||||
bool show_tooltip_callback(int, int, bool, const Glib::RefPtr<Gtk::Tooltip> &tooltip);
|
||||
bool handleToggle(GdkEventButton *const &) override;
|
||||
std::string timeToString(gint64 time);
|
||||
|
||||
const std::string getDeviceStatus(UpDeviceState &state);
|
||||
|
||||
Gtk::Box box_;
|
||||
Gtk::Image icon_;
|
||||
Gtk::Label label_;
|
||||
|
||||
// Config
|
||||
bool hideIfEmpty = true;
|
||||
bool tooltip_enabled = true;
|
||||
uint tooltip_spacing = 4;
|
||||
uint tooltip_padding = 4;
|
||||
uint iconSize = 20;
|
||||
std::string format = DEFAULT_FORMAT;
|
||||
std::string format_alt = DEFAULT_FORMAT_ALT;
|
||||
|
||||
Devices devices;
|
||||
std::mutex m_Mutex;
|
||||
UpClient *client;
|
||||
UpDevice *displayDevice = nullptr;
|
||||
guint login1_id;
|
||||
GDBusConnection *login1_connection;
|
||||
std::unique_ptr<UPowerTooltip> upower_tooltip;
|
||||
std::string lastStatus;
|
||||
const char *lastWarningLevel;
|
||||
bool showAltText;
|
||||
bool showIcon = true;
|
||||
bool upowerRunning;
|
||||
guint upowerWatcher_id;
|
||||
std::string nativePath_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::upower
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/label.h"
|
||||
#include "gtkmm/window.h"
|
||||
|
||||
namespace waybar::modules::upower {
|
||||
|
||||
class UPowerTooltip : public Gtk::Window {
|
||||
private:
|
||||
typedef std::unordered_map<std::string, UpDevice*> Devices;
|
||||
|
||||
const std::string getDeviceIcon(UpDeviceKind& kind);
|
||||
|
||||
std::unique_ptr<Gtk::Box> contentBox;
|
||||
|
||||
uint iconSize;
|
||||
uint tooltipSpacing;
|
||||
uint tooltipPadding;
|
||||
|
||||
public:
|
||||
UPowerTooltip(uint iconSize, uint tooltipSpacing, uint tooltipPadding);
|
||||
virtual ~UPowerTooltip();
|
||||
|
||||
uint updateTooltip(Devices& devices);
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::upower
|
|
@ -24,10 +24,6 @@
|
|||
|
||||
namespace waybar::modules::wlr {
|
||||
|
||||
struct widget_geometry {
|
||||
int x, y, w, h;
|
||||
};
|
||||
|
||||
class Taskbar;
|
||||
|
||||
class Task {
|
||||
|
@ -46,7 +42,6 @@ class Task {
|
|||
};
|
||||
// made public so TaskBar can reorder based on configuration.
|
||||
Gtk::Button button;
|
||||
struct widget_geometry minimize_hint;
|
||||
|
||||
private:
|
||||
static uint32_t global_id;
|
||||
|
@ -87,8 +82,6 @@ class Task {
|
|||
private:
|
||||
std::string repr() const;
|
||||
std::string state_string(bool = false) const;
|
||||
void set_minimize_hint();
|
||||
void on_button_size_allocated(Gtk::Allocation &alloc);
|
||||
void set_app_info_from_app_id_list(const std::string &app_id_list);
|
||||
bool image_load_icon(Gtk::Image &image, const Glib::RefPtr<Gtk::IconTheme> &icon_theme,
|
||||
Glib::RefPtr<Gio::DesktopAppInfo> app_info, int size);
|
||||
|
|
|
@ -56,10 +56,10 @@ class BacklightBackend {
|
|||
|
||||
void set_previous_best_device(const BacklightDevice *device);
|
||||
|
||||
void set_brightness(const std::string &preferred_device, ChangeType change_type, double step);
|
||||
void set_brightness(std::string preferred_device, ChangeType change_type, double step);
|
||||
|
||||
void set_scaled_brightness(const std::string &preferred_device, int brightness);
|
||||
int get_scaled_brightness(const std::string &preferred_device);
|
||||
void set_scaled_brightness(std::string preferred_device, int brightness);
|
||||
int get_scaled_brightness(std::string preferred_device);
|
||||
|
||||
bool is_login_proxy_initialized() const { return static_cast<bool>(login_proxy_); }
|
||||
|
||||
|
@ -70,7 +70,7 @@ class BacklightBackend {
|
|||
std::mutex udev_thread_mutex_;
|
||||
|
||||
private:
|
||||
void set_brightness_internal(const std::string &device_name, int brightness, int max_brightness);
|
||||
void set_brightness_internal(std::string device_name, int brightness, int max_brightness);
|
||||
|
||||
std::function<void()> on_updated_cb_;
|
||||
std::chrono::milliseconds polling_interval_;
|
||||
|
|
|
@ -622,8 +622,8 @@ inline auto convertInto(std::string const &source, bool &target) -> ParserResult
|
|||
}
|
||||
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
|
||||
template <typename T>
|
||||
inline auto convertInto(std::string const &source,
|
||||
CLARA_CONFIG_OPTIONAL_TYPE<T> &target) -> ParserResult {
|
||||
inline auto convertInto(std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T> &target)
|
||||
-> ParserResult {
|
||||
T temp;
|
||||
auto result = convertInto(source, temp);
|
||||
if (result) target = std::move(temp);
|
||||
|
@ -751,8 +751,8 @@ class ParserBase {
|
|||
public:
|
||||
virtual ~ParserBase() = default;
|
||||
virtual auto validate() const -> Result { return Result::ok(); }
|
||||
virtual auto parse(std::string const &exeName,
|
||||
TokenStream const &tokens) const -> InternalParseResult = 0;
|
||||
virtual auto parse(std::string const &exeName, TokenStream const &tokens) const
|
||||
-> InternalParseResult = 0;
|
||||
virtual auto cardinality() const -> size_t { return 1; }
|
||||
|
||||
auto parse(Args const &args) const -> InternalParseResult {
|
||||
|
@ -1098,8 +1098,8 @@ struct Parser : ParserBase {
|
|||
|
||||
using ParserBase::parse;
|
||||
|
||||
auto parse(std::string const &exeName,
|
||||
TokenStream const &tokens) const -> InternalParseResult override {
|
||||
auto parse(std::string const &exeName, TokenStream const &tokens) const
|
||||
-> InternalParseResult override {
|
||||
struct ParserInfo {
|
||||
ParserBase const *parser = nullptr;
|
||||
size_t count = 0;
|
||||
|
|
|
@ -64,7 +64,7 @@ struct fmt::formatter<date::zoned_time<Duration, TimeZonePtr>> {
|
|||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const date::zoned_time<Duration, TimeZonePtr>& ztime, FormatContext& ctx) const {
|
||||
auto format(const date::zoned_time<Duration, TimeZonePtr>& ztime, FormatContext& ctx) {
|
||||
if (ctx.locale()) {
|
||||
const auto loc = ctx.locale().template get<std::locale>();
|
||||
return fmt::format_to(ctx.out(), "{}", date::format(loc, fmt::to_string(specs), ztime));
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class pow_format {
|
||||
public:
|
||||
pow_format(long long val, std::string&& unit, bool binary = false)
|
||||
: val_(val), unit_(unit), binary_(binary) {};
|
||||
: val_(val), unit_(unit), binary_(binary){};
|
||||
|
||||
long long val_;
|
||||
std::string unit_;
|
||||
|
@ -45,7 +45,7 @@ struct formatter<pow_format> {
|
|||
}
|
||||
|
||||
template <class FormatContext>
|
||||
auto format(const pow_format& s, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||
auto format(const pow_format& s, FormatContext& ctx) -> decltype(ctx.out()) {
|
||||
const char* units[] = {"", "k", "M", "G", "T", "P", nullptr};
|
||||
|
||||
auto base = s.binary_ ? 1024ull : 1000ll;
|
||||
|
@ -92,7 +92,7 @@ struct formatter<pow_format> {
|
|||
template <>
|
||||
struct formatter<Glib::ustring> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) const {
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
||||
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "util/backend_common.hpp"
|
||||
#include "util/pipewire/privacy_node_info.hpp"
|
||||
|
||||
|
@ -15,8 +13,7 @@ class PipewireBackend {
|
|||
pw_context* context_;
|
||||
pw_core* core_;
|
||||
|
||||
pw_registry* registry_;
|
||||
spa_hook registryListener_;
|
||||
spa_hook registry_listener;
|
||||
|
||||
/* Hack to keep constructor inaccessible but still public.
|
||||
* This is required to be able to use std::make_shared.
|
||||
|
@ -24,22 +21,20 @@ class PipewireBackend {
|
|||
* pointer because the destructor will manually free memory, and this could be
|
||||
* a problem with C++20's copy and move semantics.
|
||||
*/
|
||||
struct PrivateConstructorTag {};
|
||||
struct private_constructor_tag {};
|
||||
|
||||
public:
|
||||
std::mutex mutex_;
|
||||
|
||||
pw_registry* registry;
|
||||
|
||||
sigc::signal<void> privacy_nodes_changed_signal_event;
|
||||
|
||||
std::unordered_map<uint32_t, PrivacyNodeInfo*> privacy_nodes;
|
||||
std::mutex mutex_;
|
||||
|
||||
static std::shared_ptr<PipewireBackend> getInstance();
|
||||
|
||||
// Handlers for PipeWire events
|
||||
void handleRegistryEventGlobal(uint32_t id, uint32_t permissions, const char* type,
|
||||
uint32_t version, const struct spa_dict* props);
|
||||
void handleRegistryEventGlobalRemove(uint32_t id);
|
||||
|
||||
PipewireBackend(PrivateConstructorTag tag);
|
||||
PipewireBackend(private_constructor_tag tag);
|
||||
~PipewireBackend();
|
||||
};
|
||||
} // namespace waybar::util::PipewireBackend
|
||||
|
|
|
@ -34,12 +34,29 @@ class PrivacyNodeInfo {
|
|||
|
||||
void *data;
|
||||
|
||||
std::string getName();
|
||||
std::string getIconName();
|
||||
std::string get_name() {
|
||||
const std::vector<std::string *> names{&application_name, &node_name};
|
||||
std::string name = "Unknown Application";
|
||||
for (auto &name_ : names) {
|
||||
if (name_ != nullptr && name_->length() > 0) {
|
||||
name = *name_;
|
||||
name[0] = toupper(name[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
// Handlers for PipeWire events
|
||||
void handleProxyEventDestroy();
|
||||
void handleNodeEventInfo(const struct pw_node_info *info);
|
||||
std::string get_icon_name() {
|
||||
const std::vector<std::string *> names{&application_icon_name, &pipewire_access_portal_app_id,
|
||||
&application_name, &node_name};
|
||||
const std::string name = "application-x-executable-symbolic";
|
||||
for (auto &name_ : names) {
|
||||
if (name_ != nullptr && name_->length() > 0 && DefaultGtkIconThemeWrapper::has_icon(*name_)) {
|
||||
return *name_;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace waybar::util::PipewireBackend
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <functional>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
|
@ -18,7 +17,7 @@ struct Rule {
|
|||
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
|
||||
// aggregates"
|
||||
Rule(std::regex rule, std::string repr, int priority)
|
||||
: rule(std::move(rule)), repr(std::move(repr)), priority(priority) {}
|
||||
: rule(rule), repr(repr), priority(priority) {}
|
||||
};
|
||||
|
||||
int default_priority_function(std::string& key);
|
||||
|
@ -37,17 +36,16 @@ class RegexCollection {
|
|||
std::map<std::string, std::string> regex_cache;
|
||||
std::string default_repr;
|
||||
|
||||
std::string find_match(std::string& value, bool& matched_any);
|
||||
std::string& find_match(std::string& value, bool& matched_any);
|
||||
|
||||
public:
|
||||
RegexCollection() = default;
|
||||
RegexCollection(
|
||||
const Json::Value& map, std::string default_repr = "",
|
||||
const std::function<int(std::string&)>& priority_function = default_priority_function);
|
||||
RegexCollection(const Json::Value& map, std::string default_repr = "",
|
||||
std::function<int(std::string&)> priority_function = default_priority_function);
|
||||
~RegexCollection() = default;
|
||||
|
||||
std::string& get(std::string& value, bool& matched_any);
|
||||
std::string& get(std::string& value);
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
} // namespace waybar::util
|
|
@ -38,7 +38,7 @@ The *backlight* module displays the current backlight level.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
@ -81,19 +81,6 @@ The *backlight* module displays the current backlight level.
|
|||
default: 1.0 ++
|
||||
The speed at which to change the brightness when scrolling.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# EXAMPLE:
|
||||
|
||||
```
|
||||
|
|
|
@ -69,7 +69,7 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*on-click*: ++
|
||||
typeof: string ++
|
||||
|
@ -109,19 +109,6 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
|||
default: false ++
|
||||
Option to enable battery compatibility if not detected.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{capacity}*: Capacity in percentage
|
||||
|
@ -132,10 +119,6 @@ The *battery* module displays the current capacity and state (eg. charging) of y
|
|||
|
||||
*{time}*: Estimate of time until full or empty. Note that this is based on the power draw at the last refresh time, not an average.
|
||||
|
||||
*{cycles}*: Amount of charge cycles the highest-capacity battery has seen. *(Linux only)*
|
||||
|
||||
*{health}*: The percentage of the highest-capacity battery's original maximum charge it can still hold.
|
||||
|
||||
# TIME FORMAT
|
||||
|
||||
The *battery* module allows you to define how time should be formatted via *format-time*.
|
||||
|
|
|
@ -54,7 +54,7 @@ Addressed by *bluetooth*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -129,19 +129,6 @@ Addressed by *bluetooth*
|
|||
typeof: string ++
|
||||
This format is used to define how each connected device should be displayed within the *device_enumerate* format replacement in the tooltip menu.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{status}*: Status of the bluetooth device.
|
||||
|
|
|
@ -64,10 +64,6 @@ libcava lives in:
|
|||
:[ bool
|
||||
:[ false
|
||||
:[ Hides the widget if no input (after sleep_timer elapsed)
|
||||
|[ *format_silent*
|
||||
:[ string
|
||||
:[
|
||||
:[ Widget's text after sleep_timer elapsed (hide_on_silence has to be false)
|
||||
|[ *method*
|
||||
:[ string
|
||||
:[ pulse
|
||||
|
@ -124,18 +120,6 @@ libcava lives in:
|
|||
:[ string
|
||||
:[ /dev/stdout
|
||||
:[ It's impossible to set it. Waybar sets it to = /dev/stdout for internal needs
|
||||
|[ *menu*
|
||||
:[ string
|
||||
:[
|
||||
:[ Action that popups the menu.
|
||||
|[ *menu-file*
|
||||
:[ string
|
||||
:[
|
||||
:[ Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||
|[ *menu-actions*
|
||||
:[ array
|
||||
:[
|
||||
:[ The actions corresponding to the buttons of the menu.
|
||||
|
||||
Configuration can be provided as:
|
||||
- The only cava configuration file which is provided through *cava_config*. The rest configuration can be skipped
|
||||
|
@ -200,8 +184,3 @@ In case when cava releases new version and you're wanna get it, it should be rai
|
|||
}
|
||||
},
|
||||
```
|
||||
# STYLE
|
||||
|
||||
- *#cava*
|
||||
- *#cava.silent* Applied after no sound has been detected for sleep_timer seconds
|
||||
- *#cava.updated* Applied when a new frame is shown
|
||||
|
|
|
@ -51,7 +51,7 @@ $XDG_CONFIG_HOME/waybar/config ++
|
|||
|[ *rotate*
|
||||
:[ integer
|
||||
:[
|
||||
:[ Positive value to rotate the text label (in 90 degree increments)
|
||||
:[ Positive value to rotate the text label
|
||||
|[ *on-click*
|
||||
:[ string
|
||||
:[
|
||||
|
@ -84,18 +84,6 @@ $XDG_CONFIG_HOME/waybar/config ++
|
|||
:[ string
|
||||
:[ same as format
|
||||
:[ Tooltip on hover
|
||||
|[ *menu*
|
||||
:[ string
|
||||
:[
|
||||
:[ Action that popups the menu.
|
||||
|[ *menu-file*
|
||||
:[ string
|
||||
:[
|
||||
:[ Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||
|[ *menu-actions*
|
||||
:[ array
|
||||
:[
|
||||
:[ The actions corresponding to the buttons of the menu.
|
||||
|
||||
View all valid format options in *strftime(3)* or have a look https://en.cppreference.com/w/cpp/chrono/duration/formatter
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ The *cpu* module displays the current CPU utilization.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
|
|
@ -21,10 +21,6 @@ Addressed by *custom/<name>*
|
|||
The path to a script, which determines if the script in *exec* should be executed. ++
|
||||
*exec* will be executed if the exit code of *exec-if* equals 0.
|
||||
|
||||
*hide-empty-text*: ++
|
||||
typeof: bool ++
|
||||
Disables the module when output is empty, but format might contain additional static content.
|
||||
|
||||
*exec-on-event*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
|
@ -55,8 +51,8 @@ Addressed by *custom/<name>*
|
|||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {text} ++
|
||||
The format, how information should be displayed. On {text} data gets inserted.
|
||||
default: {} ++
|
||||
The format, how information should be displayed. On {} data gets inserted.
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
|
@ -64,7 +60,7 @@ Addressed by *custom/<name>*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -125,19 +121,6 @@ Addressed by *custom/<name>*
|
|||
default: false ++
|
||||
Option to enable escaping of script output.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# RETURN-TYPE
|
||||
|
||||
When *return-type* is set to *json*, Waybar expects the *exec*-script to output its data in JSON format.
|
||||
|
@ -160,7 +143,7 @@ $text\\n$tooltip\\n$class*
|
|||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{text}*: Output of the script.
|
||||
*{}*: Output of the script.
|
||||
|
||||
*{percentage}* Percentage which can be set via a json return type.
|
||||
|
||||
|
@ -172,7 +155,7 @@ $text\\n$tooltip\\n$class*
|
|||
|
||||
```
|
||||
"custom/spotify": {
|
||||
"format": " {text}",
|
||||
"format": " {}",
|
||||
"max-length": 40,
|
||||
"interval": 30, // Remove this if your script is endless and write in loop
|
||||
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
|
||||
|
@ -185,7 +168,7 @@ $text\\n$tooltip\\n$class*
|
|||
|
||||
```
|
||||
"custom/mpd": {
|
||||
"format": "♪ {text}",
|
||||
"format": "♪ {}",
|
||||
//"max-length": 15,
|
||||
"interval": 10,
|
||||
"exec": "mpc current",
|
||||
|
@ -199,7 +182,7 @@ $text\\n$tooltip\\n$class*
|
|||
|
||||
```
|
||||
"custom/cmus": {
|
||||
"format": "♪ {text}",
|
||||
"format": "♪ {}",
|
||||
//"max-length": 15,
|
||||
"interval": 10,
|
||||
"exec": "cmus-remote -C \"format_print '%a - %t'\"", // artist - title
|
||||
|
@ -214,7 +197,7 @@ $text\\n$tooltip\\n$class*
|
|||
```
|
||||
|
||||
"custom/pacman": {
|
||||
"format": "{text} ",
|
||||
"format": "{} ",
|
||||
"interval": "once",
|
||||
"exec": "pacman_packages",
|
||||
"on-click": "update-system",
|
||||
|
@ -226,7 +209,7 @@ $text\\n$tooltip\\n$class*
|
|||
|
||||
```
|
||||
"custom/pacman": {
|
||||
"format": "{text} ",
|
||||
"format": "{} ",
|
||||
"interval": 3600, // every hour
|
||||
"exec": "checkupdates | wc -l", // # of updates
|
||||
"exec-if": "exit 0", // always run; consider advanced run conditions
|
||||
|
|
|
@ -29,7 +29,7 @@ Addressed by *disk*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
@ -93,19 +93,6 @@ Addressed by *disk*
|
|||
typeof: string ++
|
||||
Use with specific_free, specific_used, and specific_total to force calculation to always be in a certain unit. Accepts kB, kiB, MB, Mib, GB, GiB, TB, TiB.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{percentage_used}*: Percentage of disk in use.
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *dwl/window*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
|
|
@ -25,19 +25,6 @@ Addressed by *hyprland/language*
|
|||
typeof: string ++
|
||||
Specifies which keyboard to use from hyprctl devices output. Using the option that begins with "at-translated-set..." is recommended.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *hyprland/submap*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -80,19 +80,6 @@ Addressed by *hyprland/submap*
|
|||
default: Default ++
|
||||
Option to set the submap name to display when not in an active submap.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ Addressed by *hyprland/workspaces*
|
|||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
||||
Keys are the rules, while the values are the methods of representation. Values may use the placeholders {class} and {title} to use the window's original class and/or title respectively.
|
||||
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
|
||||
|
||||
*window-rewrite-default*:
|
||||
typeof: string ++
|
||||
|
@ -43,11 +42,6 @@ Addressed by *hyprland/workspaces*
|
|||
default: false ++
|
||||
If set to true, special workspaces will be shown.
|
||||
|
||||
*special-visible-only*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If this and show-special are to true, special workspaces will be shown only if visible.
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
|
@ -148,7 +142,6 @@ Additional to workspace name matching, the following *format-icons* can be set.
|
|||
"class<firefox> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github". Note that "class" always comes first.
|
||||
"foot": "", // Windows that contain "foot" in either class or title. For optimization reasons, it will only match against a title if at least one other window explicitly matches against a title.
|
||||
"code": "",
|
||||
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -21,7 +21,7 @@ screensaver, also known as "presentation mode".
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -89,19 +89,6 @@ screensaver, also known as "presentation mode".
|
|||
typeof: string ++
|
||||
This format is used when the inhibit is deactivated.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu. Cannot be "on-click".
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{status}*: status (*activated* or *deactivated*)
|
||||
|
|
|
@ -25,7 +25,7 @@ See *systemd-inhibit*(1) for more information.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -76,19 +76,6 @@ See *systemd-inhibit*(1) for more information.
|
|||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu. Cannot be "on-click".
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{status}*: status (*activated* or *deactivated*)
|
||||
|
|
|
@ -51,7 +51,7 @@ Addressed by *jack*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -85,19 +85,6 @@ Addressed by *jack*
|
|||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{load}*: The current CPU load estimated by JACK.
|
||||
|
|
|
@ -29,7 +29,7 @@ Addressed by *memory*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
@ -84,19 +84,6 @@ Addressed by *memory*
|
|||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{percentage}*: Percentage of memory in use.
|
||||
|
|
|
@ -1,153 +0,0 @@
|
|||
waybar-menu(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - menu property
|
||||
|
||||
# OVERVIEW
|
||||
|
||||
|
||||
Some modules support a 'menu', which allows to have a popup menu whan a defined
|
||||
click is done over the module.
|
||||
|
||||
# PROPERTIES
|
||||
|
||||
A module that implements a 'menu' needs 3 properties defined in its config :
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu. The possibles actions are :
|
||||
|
||||
[- *Option*
|
||||
:- *Description*
|
||||
|[ *on-click*
|
||||
:< When you left-click on the module
|
||||
|[ *on-click-release*
|
||||
:< When you release left button on the module
|
||||
|[ *on-double-click*
|
||||
:< When you double left click on the module
|
||||
|[ *on-triple-click*
|
||||
:< When you triple left click on the module
|
||||
|[ *on-click-middle*
|
||||
:< When you middle click on the module using mousewheel
|
||||
|[ *on-click-middle-release*
|
||||
:< When you release mousewheel button on the module
|
||||
|[ *on-double-click-middle*
|
||||
:< When you double middle click on the module
|
||||
|[ *on-triple-click-middle*
|
||||
:< When you triple middle click on the module
|
||||
|[ *on-click-right*
|
||||
:< When you right click on the module using
|
||||
|[ *on-click-right-release*
|
||||
:< When you release right button on the module
|
||||
|[ *on-double-click-right*
|
||||
:< When you double right click on the module
|
||||
|[ *on-triple-click-right*
|
||||
:< When you triple middle click on the module
|
||||
|[ *on-click-backward*
|
||||
:< When you click on the module using mouse backward button
|
||||
|[ *on-click-backward-release*
|
||||
:< When you release mouse backward button on the module
|
||||
|[ *on-double-click-backward*
|
||||
:< When you double click on the module using mouse backward button
|
||||
|[ *on-triple-click-backward*
|
||||
:< When you triple click on the module using mouse backawrd button
|
||||
|[ *on-click-forward*
|
||||
:< When you click on the module using mouse forward button
|
||||
|[ *on-click-forward-release*
|
||||
:< When you release mouse forward button on the module
|
||||
|[ *on-double-click-forward*
|
||||
:< When you double click on the module using mouse forward button
|
||||
|[ *on-triple-click-forward*
|
||||
:< When you triple click on the module using mouse forward button
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*.
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu. The identifiers of
|
||||
each actions needs to exists as an id in the 'menu-file' for it to be linked
|
||||
properly.
|
||||
|
||||
# MENU-FILE
|
||||
|
||||
The menu-file is an `.xml` file representing a GtkBuilder. Documentation for it
|
||||
can be found here : https://docs.gtk.org/gtk4/class.Builder.html
|
||||
|
||||
Here, it needs to have an element of type GtkMenu with id "menu". Eeach actions
|
||||
in *menu-actions* are linked to elements in the *menu-file* file by the id of
|
||||
the elements.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
Module config :
|
||||
```
|
||||
"custom/power": {
|
||||
"format" : "⏻ ",
|
||||
"tooltip": false,
|
||||
"menu": "on-click",
|
||||
"menu-file": "~/.config/waybar/power_menu.xml",
|
||||
"menu-actions": {
|
||||
"shutdown": "shutdown",
|
||||
"reboot": "reboot",
|
||||
"suspend": "systemctl suspend",
|
||||
"hibernate": "systemctl hibernate",
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
~/.config/waybar/power_menu.xml :
|
||||
```
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkMenu" id="menu">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="suspend">
|
||||
<property name="label">Suspend</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="hibernat">
|
||||
<property name="label">Hibernate</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="shutdown">
|
||||
<property name="label">Shutdown</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="reboot">
|
||||
<property name="label">Reboot</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
```
|
||||
|
||||
# STYLING MENUS
|
||||
|
||||
- *menu*
|
||||
Style for the menu
|
||||
|
||||
- *menuitem*
|
||||
Style for items in the menu
|
||||
|
||||
# EXAMPLE:
|
||||
|
||||
```
|
||||
menu {
|
||||
border-radius: 15px;
|
||||
background: #161320;
|
||||
color: #B5E8E0;
|
||||
}
|
||||
menuitem {
|
||||
border-radius: 15px;
|
||||
}
|
||||
```
|
|
@ -91,7 +91,7 @@ Addressed by *mpd*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -162,19 +162,6 @@ Addressed by *mpd*
|
|||
default: {} ++
|
||||
Icon to show depending on the "single" option (*{ "on": "...", "off": "..." }*)
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
## WHEN PLAYING/PAUSED
|
||||
|
|
|
@ -107,7 +107,7 @@ The *mpris* module displays currently playing media via libplayerctl.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -142,11 +142,11 @@ The *mpris* module displays currently playing media via libplayerctl.
|
|||
|
||||
*player-icons*: ++
|
||||
typeof: map[string]string ++
|
||||
Allows setting _{player_icon}_ based on player-name property.
|
||||
Allows setting _{player-icon}_ based on player-name property.
|
||||
|
||||
*status-icons*: ++
|
||||
typeof: map[string]string ++
|
||||
Allows setting _{status_icon}_ based on player status (playing, paused, stopped).
|
||||
Allows setting _{status-icon}_ based on player status (playing, paused, stopped).
|
||||
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
|
|
@ -58,7 +58,7 @@ Addressed by *network*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -129,19 +129,6 @@ Addressed by *network*
|
|||
typeof: string ++
|
||||
This format is used when the displayed interface is disabled.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{ifname}*: Name of the network interface.
|
||||
|
@ -156,8 +143,6 @@ Addressed by *network*
|
|||
|
||||
*{essid}*: Name (SSID) of the wireless network.
|
||||
|
||||
*{bssid}*: MAC address (BSSID) of the wireless access point.
|
||||
|
||||
*{signalStrength}*: Signal strength of the wireless network.
|
||||
|
||||
*{signaldBm}*: Signal strength of the wireless network in dBm.
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
waybar-niri-language(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - niri language module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *language* module displays the currently selected language in niri.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *niri/language*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {} ++
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-<lang>* ++
|
||||
typeof: string++
|
||||
Provide an alternative name to display per language where <lang> is the language of your choosing. Can be passed multiple times with multiple languages as shown by the example below.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{short}*: Short name of layout (e.g. "us"). Equals to {}.
|
||||
|
||||
*{shortDescription}*: Short description of layout (e.g. "en").
|
||||
|
||||
*{long}*: Long name of layout (e.g. "English (Dvorak)").
|
||||
|
||||
*{variant}*: Variant of layout (e.g. "dvorak").
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"niri/language": {
|
||||
"format": "Lang: {long}"
|
||||
"format-en": "AMERICA, HELL YEAH!"
|
||||
"format-tr": "As bayrakları"
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#language*
|
|
@ -1,81 +0,0 @@
|
|||
waybar-niri-window(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - niri window module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *window* module displays the title of the currently focused window in niri.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *niri/window*
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {title} ++
|
||||
The format, how information should be displayed. On {} the current window title is displayed.
|
||||
|
||||
*rewrite*: ++
|
||||
typeof: object ++
|
||||
Rules to rewrite window title. See *rewrite rules*.
|
||||
|
||||
*separate-outputs*: ++
|
||||
typeof: bool ++
|
||||
Show the active window of the monitor the bar belongs to, instead of the focused window.
|
||||
|
||||
*icon*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Option to hide the application icon.
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
default: 24 ++
|
||||
Option to change the size of the application icon.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
See the output of "niri msg windows" for examples
|
||||
|
||||
*{title}*: The current title of the focused window.
|
||||
|
||||
*{app_id}*: The current app ID of the focused window.
|
||||
|
||||
# REWRITE RULES
|
||||
|
||||
*rewrite* is an object where keys are regular expressions and values are
|
||||
rewrite rules if the expression matches. Rules may contain references to
|
||||
captures of the expression.
|
||||
|
||||
Regular expression and replacement follow ECMA-script rules.
|
||||
|
||||
If no expression matches, the title is left unchanged.
|
||||
|
||||
Invalid expressions (e.g., mismatched parentheses) are skipped.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"niri/window": {
|
||||
"format": "{}",
|
||||
"rewrite": {
|
||||
"(.*) - Mozilla Firefox": "🌎 $1",
|
||||
"(.*) - zsh": "> [$1]"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#window*
|
||||
- *window#waybar.empty #window* When no windows are on the workspace
|
||||
|
||||
The following classes are applied to the entire Waybar rather than just the
|
||||
window widget:
|
||||
|
||||
- *window#waybar.empty* When no windows are in the workspace
|
||||
- *window#waybar.solo* When only one window is on the workspace
|
||||
- *window#waybar.<app-id>* Where *app-id* is the app ID of the only window on
|
||||
the workspace
|
|
@ -1,97 +0,0 @@
|
|||
waybar-niri-workspaces(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar - niri workspaces module
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
The *workspaces* module displays the currently used workspaces in niri.
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
Addressed by *niri/workspaces*
|
||||
|
||||
*all-outputs*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, workspaces will only be shown on the output they are on. If set to true all workspaces will be shown on every output.
|
||||
|
||||
*format*: ++
|
||||
typeof: string ++
|
||||
default: {value} ++
|
||||
The format, how information should be displayed.
|
||||
|
||||
*format-icons*: ++
|
||||
typeof: array ++
|
||||
Based on the workspace name, index and state, the corresponding icon gets selected. See *icons*.
|
||||
|
||||
*disable-click*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to false, you can click to change workspace. If set to true this behaviour is disabled.
|
||||
|
||||
*disable-markup*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, button label will escape pango markup.
|
||||
|
||||
*current-only*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
If set to true, only the active or focused workspace will be shown.
|
||||
|
||||
*on-update*: ++
|
||||
typeof: string ++
|
||||
Command to execute when the module is updated.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{value}*: Name of the workspace, or index for unnamed workspaces,
|
||||
as defined by niri.
|
||||
|
||||
*{name}*: Name of the workspace for named workspaces.
|
||||
|
||||
*{icon}*: Icon, as defined in *format-icons*.
|
||||
|
||||
*{index}*: Index of the workspace on its output.
|
||||
|
||||
*{output}*: Output where the workspace is located.
|
||||
|
||||
# ICONS
|
||||
|
||||
Additional to workspace name matching, the following *format-icons* can be set.
|
||||
|
||||
- *default*: Will be shown, when no string matches are found.
|
||||
- *focused*: Will be shown, when workspace is focused.
|
||||
- *active*: Will be shown, when workspace is active on its output.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
"niri/workspaces": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
// Named workspaces
|
||||
// (you need to configure them in niri)
|
||||
"browser": "",
|
||||
"discord": "",
|
||||
"chat": "<b></b>",
|
||||
|
||||
// Icons by state
|
||||
"active": "",
|
||||
"default": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Style
|
||||
|
||||
- *#workspaces button*
|
||||
- *#workspaces button.focused*: The single focused workspace.
|
||||
- *#workspaces button.active*: The workspace is active (visible) on its output.
|
||||
- *#workspaces button.empty*: The workspace is empty.
|
||||
- *#workspaces button.current_output*: The workspace is from the same output as
|
||||
the bar that it is displayed on.
|
||||
- *#workspaces button#niri-workspace-<name>*: Workspaces named this, or index
|
||||
for unnamed workspaces.
|
|
@ -31,7 +31,7 @@ The volume can be controlled by dragging the slider across the bar or clicking o
|
|||
|
||||
```
|
||||
"modules-right": [
|
||||
"pulseaudio/slider",
|
||||
"pulseaudio-slider",
|
||||
],
|
||||
"pulseaudio/slider": {
|
||||
"min": 0,
|
||||
|
|
|
@ -40,7 +40,7 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
@ -113,19 +113,6 @@ Additionally, you can control the volume by scrolling *up* or *down* while the c
|
|||
typeof: array ++
|
||||
Sinks in this list will not be shown as active sink by Waybar. Entries should be the sink's description field.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{desc}*: Pulseaudio port's description, for bluetooth it'll be the device name.
|
||||
|
@ -155,8 +142,6 @@ If they are found in the current PulseAudio port name, the corresponding icons w
|
|||
- *hifi*
|
||||
- *phone*
|
||||
|
||||
Additionally, suffixing a device name or port with *-muted* will cause the icon
|
||||
to be selected when the corresponding audio device is muted. This applies to *default* as well.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
|
@ -167,12 +152,10 @@ to be selected when the corresponding audio device is muted. This applies to *de
|
|||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"alsa_output.pci-0000_00_1f.3.analog-stereo": "",
|
||||
"alsa_output.pci-0000_00_1f.3.analog-stereo-muted": "",
|
||||
"headphones": "",
|
||||
"handsfree": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"phone-muted": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", ""]
|
||||
|
|
|
@ -21,7 +21,7 @@ Addressed by *river/layout*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -51,19 +51,6 @@ Addressed by *river/layout*
|
|||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
```
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *river/mode*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -65,19 +65,6 @@ Addressed by *river/mode*
|
|||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *river/window*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -49,19 +49,6 @@ Addressed by *river/window*
|
|||
typeof: string ++
|
||||
Command to execute when you right-click on the module.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
|
|
|
@ -20,7 +20,7 @@ cursor is over the module, and clicking on the module toggles mute.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -74,19 +74,6 @@ cursor is over the module, and clicking on the module toggles mute.
|
|||
typeof: double ++
|
||||
Threshold to be used when scrolling.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{volume}*: Volume in percentage.
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
waybar-styles(5)
|
||||
|
||||
# NAME
|
||||
|
||||
waybar-styles - using stylesheets for waybar
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
Waybar uses Cascading Style Sheets (CSS) to configure its appearance.
|
||||
|
||||
It uses the first file found in this search order:
|
||||
|
||||
- *$XDG_CONFIG_HOME/waybar/style.css*
|
||||
- *~/.config/waybar/style.css*
|
||||
- *~/waybar/style.css*
|
||||
- */etc/xdg/waybar/style.css*
|
||||
- *@sysconfdir@/xdg/waybar/style.css*
|
||||
|
||||
# EXAMPLE
|
||||
|
||||
An example user-controlled stylesheet that just changes the color of the clock to be green on black, while keeping the rest of the system config the same would be:
|
||||
|
||||
```
|
||||
@import url("file:///etc/xdg/waybar/style.css")
|
||||
|
||||
#clock {
|
||||
background: #000000;
|
||||
color: #00ff00;
|
||||
}
|
||||
```
|
||||
|
||||
## Hover-effect
|
||||
|
||||
You can apply special styling to any module for when the cursor hovers it.
|
||||
|
||||
```
|
||||
#clock:hover {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
```
|
||||
|
||||
## Setting cursor style
|
||||
|
||||
Most, if not all, module types support setting the `cursor` option. This is
|
||||
configured in your `config.jsonc`. If set to `false`, when hovering the module a
|
||||
"pointer"(as commonly known from web CSS styling `cursor: pointer`) style cursor
|
||||
will not be shown. Default behavior is to indicate an interaction event is
|
||||
available.
|
||||
|
||||
There are more cursor types to choose from by setting the `cursor` option to
|
||||
a number, see Gdk3 official docs for all possible cursor types:
|
||||
https://docs.gtk.org/gdk3/enum.CursorType.html.
|
||||
However, note that not all cursor options listed may be available on
|
||||
your system. If you attempt to use a cursor which is not available, the
|
||||
application will crash.
|
||||
|
||||
Example of disabling pointer(`Gdk::Hand2`) cursor type on a custom module:
|
||||
|
||||
```
|
||||
"custom/my-custom-module": {
|
||||
...
|
||||
"cursor": false,
|
||||
}
|
||||
```
|
||||
|
||||
Example of setting cursor type to `Gdk::Boat`(according to
|
||||
https://docs.gtk.org/gdk3/enum.CursorType.html#boat):
|
||||
|
||||
```
|
||||
"custom/my-custom-module": {
|
||||
...
|
||||
"cursor": 8,
|
||||
}
|
||||
```
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
- *waybar(5)*
|
|
@ -32,19 +32,6 @@ Addressed by *sway/language*
|
|||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{short}*: Short name of layout (e.g. "us"). Equals to {}.
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *sway/mode*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -70,19 +70,6 @@ Addressed by *sway/mode*
|
|||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
```
|
||||
|
|
|
@ -36,19 +36,6 @@ Addressed by *sway/scratchpad*
|
|||
default: {app}: {title} ++
|
||||
The format, how information in the tooltip should be displayed.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{icon}*: Icon, as defined in *format-icons*.
|
||||
|
|
|
@ -19,7 +19,7 @@ Addressed by *sway/window*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
|
|
@ -87,7 +87,6 @@ warp-on-scroll: ++
|
|||
Regex rules to map window class to an icon or preferred method of representation for a workspace's window.
|
||||
Keys are the rules, while the values are the methods of representation.
|
||||
Rules may specify `class<...>`, `title<...>`, or both in order to fine-tune the matching.
|
||||
You may assign an empty value to a rule to have it ignored from generating any representation in workspaces.
|
||||
|
||||
*window-rewrite-default*:
|
||||
typeof: string ++
|
||||
|
@ -172,7 +171,6 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
|
|||
"window-rewrite": {
|
||||
"class<firefox>": "",
|
||||
"class<kitty>": "k",
|
||||
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -36,19 +36,6 @@ Addressed by *systemd-failed-units*
|
|||
default: *true* ++
|
||||
Option to hide this module when there is no failing units.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{nr_failed_system}*: Number of failed units from systemwide (PID=1) systemd.
|
||||
|
|
|
@ -25,7 +25,6 @@ Addressed by *temperature*
|
|||
*hwmon-path-abs*: ++
|
||||
typeof: string ++
|
||||
The path of the hwmon-directory of the device, e.g. */sys/devices/pci0000:00/0000:00:18.3/hwmon*. (Note that the subdirectory *hwmon/hwmon#*, where *#* is a number is not part of the path!) Has to be used together with *input-filename*.
|
||||
This can also be an array of strings, for which, it just works like *hwmon-path*.
|
||||
|
||||
*input-filename*: ++
|
||||
typeof: string ++
|
||||
|
@ -60,7 +59,7 @@ Addressed by *temperature*
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*max-length*: ++
|
||||
typeof: integer ++
|
||||
|
@ -111,19 +110,6 @@ Addressed by *temperature*
|
|||
default: true ++
|
||||
Option to disable tooltip on hover.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{temperatureC}*: Temperature in Celsius.
|
||||
|
|
|
@ -17,12 +17,6 @@ compatible devices in the tooltip.
|
|||
The battery to monitor. Refer to the https://upower.freedesktop.org/docs/UpDevice.html#UpDevice--native-path ++
|
||||
Can be obtained using `upower --dump`
|
||||
|
||||
*model*: ++
|
||||
typeof: string ++
|
||||
default: ++
|
||||
The battery to monitor, based on the model. (this option is ignored if *native-path* is given). ++
|
||||
Can be obtained using `upower --dump`
|
||||
|
||||
*icon-size*: ++
|
||||
typeof: integer ++
|
||||
default: 20 ++
|
||||
|
@ -68,19 +62,6 @@ compatible devices in the tooltip.
|
|||
default: true ++
|
||||
Option to disable battery icon.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{percentage}*: The battery capacity in percentage
|
||||
|
|
|
@ -31,7 +31,7 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
|||
|
||||
*rotate*: ++
|
||||
typeof: integer ++
|
||||
Positive value to rotate the text label (in 90 degree increments).
|
||||
Positive value to rotate the text label.
|
||||
|
||||
*states*: ++
|
||||
typeof: object ++
|
||||
|
@ -87,19 +87,6 @@ The *wireplumber* module displays the current volume reported by WirePlumber.
|
|||
default: 100 ++
|
||||
The maximum volume that can be set, in percentage.
|
||||
|
||||
*menu*: ++
|
||||
typeof: string ++
|
||||
Action that popups the menu.
|
||||
|
||||
*menu-file*: ++
|
||||
typeof: string ++
|
||||
Location of the menu descriptor file. There need to be an element of type
|
||||
GtkMenu with id *menu*
|
||||
|
||||
*menu-actions*: ++
|
||||
typeof: array ++
|
||||
The actions corresponding to the buttons of the menu.
|
||||
|
||||
# FORMAT REPLACEMENTS
|
||||
|
||||
*{volume}*: Volume in percentage.
|
||||
|
|
|
@ -19,8 +19,6 @@ Valid locations for this file are:
|
|||
A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config.jsonc
|
||||
Also, a minimal example configuration can be found at the bottom of this man page.
|
||||
|
||||
The visual display elements for waybar use a CSS stylesheet, see *waybar-styles(5)* for details.
|
||||
|
||||
# BAR CONFIGURATION
|
||||
|
||||
*layer* ++
|
||||
|
@ -278,11 +276,6 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
|||
default: "hidden" ++
|
||||
Defines the CSS class to be applied to the hidden elements.
|
||||
|
||||
*click-to-reveal*: ++
|
||||
typeof: bool ++
|
||||
default: false ++
|
||||
Whether left click should reveal the content rather than mouse over. Note that grouped modules may still process their own on-click events.
|
||||
|
||||
*transition-left-to-right*: ++
|
||||
typeof: bool ++
|
||||
default: true ++
|
||||
|
@ -323,9 +316,6 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
|||
- *waybar-hyprland-submap(5)*
|
||||
- *waybar-hyprland-window(5)*
|
||||
- *waybar-hyprland-workspaces(5)*
|
||||
- *waybar-niri-language(5)*
|
||||
- *waybar-niri-window(5)*
|
||||
- *waybar-niri-workspaces(5)*
|
||||
- *waybar-idle-inhibitor(5)*
|
||||
- *waybar-image(5)*
|
||||
- *waybar-inhibitor(5)*
|
||||
|
@ -357,4 +347,3 @@ A group may hide all but one element, showing them only on mouse hover. In order
|
|||
# SEE ALSO
|
||||
|
||||
*sway-output(5)*
|
||||
*waybar-styles(5)"
|
||||
|
|
42
meson.build
42
meson.build
|
@ -1,6 +1,6 @@
|
|||
project(
|
||||
'waybar', 'cpp', 'c',
|
||||
version: '0.11.0',
|
||||
version: '0.10.0',
|
||||
license: 'MIT',
|
||||
meson_version: '>= 0.59.0',
|
||||
default_options : [
|
||||
|
@ -69,7 +69,7 @@ is_openbsd = host_machine.system() == 'openbsd'
|
|||
|
||||
thread_dep = dependency('threads')
|
||||
fmt = dependency('fmt', version : ['>=8.1.1'], fallback : ['fmt', 'fmt_dep'])
|
||||
spdlog = dependency('spdlog', version : ['>=1.10.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=enabled', 'std_format=disabled', 'tests=disabled'])
|
||||
spdlog = dependency('spdlog', version : ['>=1.10.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=enabled'])
|
||||
wayland_client = dependency('wayland-client')
|
||||
wayland_cursor = dependency('wayland-cursor')
|
||||
wayland_protos = dependency('wayland-protocols')
|
||||
|
@ -106,7 +106,7 @@ if libsndio.found()
|
|||
endif
|
||||
endif
|
||||
|
||||
gtk_layer_shell = dependency('gtk-layer-shell-0', version: ['>=0.9.0'],
|
||||
gtk_layer_shell = dependency('gtk-layer-shell-0', version: ['>=0.6.0'],
|
||||
default_options: ['introspection=false', 'vapi=false'],
|
||||
fallback: ['gtk-layer-shell', 'gtk_layer_shell'])
|
||||
systemd = dependency('systemd', required: get_option('systemd'))
|
||||
|
@ -192,7 +192,6 @@ man_files = files(
|
|||
'man/waybar-idle-inhibitor.5.scd',
|
||||
'man/waybar-image.5.scd',
|
||||
'man/waybar-states.5.scd',
|
||||
'man/waybar-menu.5.scd',
|
||||
'man/waybar-temperature.5.scd',
|
||||
)
|
||||
|
||||
|
@ -306,9 +305,7 @@ if true
|
|||
'src/modules/hyprland/language.cpp',
|
||||
'src/modules/hyprland/submap.cpp',
|
||||
'src/modules/hyprland/window.cpp',
|
||||
'src/modules/hyprland/workspace.cpp',
|
||||
'src/modules/hyprland/workspaces.cpp',
|
||||
'src/modules/hyprland/windowcreationpayload.cpp',
|
||||
)
|
||||
man_files += files(
|
||||
'man/waybar-hyprland-language.5.scd',
|
||||
|
@ -318,21 +315,6 @@ if true
|
|||
)
|
||||
endif
|
||||
|
||||
if get_option('niri')
|
||||
add_project_arguments('-DHAVE_NIRI', language: 'cpp')
|
||||
src_files += files(
|
||||
'src/modules/niri/backend.cpp',
|
||||
'src/modules/niri/language.cpp',
|
||||
'src/modules/niri/window.cpp',
|
||||
'src/modules/niri/workspaces.cpp',
|
||||
)
|
||||
man_files += files(
|
||||
'man/waybar-niri-language.5.scd',
|
||||
'man/waybar-niri-window.5.scd',
|
||||
'man/waybar-niri-workspaces.5.scd',
|
||||
)
|
||||
endif
|
||||
|
||||
if libnl.found() and libnlgen.found()
|
||||
add_project_arguments('-DHAVE_LIBNL', language: 'cpp')
|
||||
src_files += files('src/modules/network.cpp')
|
||||
|
@ -353,7 +335,10 @@ endif
|
|||
|
||||
if (upower_glib.found() and not get_option('logind').disabled())
|
||||
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
|
||||
src_files += files('src/modules/upower.cpp')
|
||||
src_files += files(
|
||||
'src/modules/upower/upower.cpp',
|
||||
'src/modules/upower/upower_tooltip.cpp',
|
||||
)
|
||||
man_files += files('man/waybar-upower.5.scd')
|
||||
endif
|
||||
|
||||
|
@ -363,8 +348,7 @@ if pipewire.found()
|
|||
src_files += files(
|
||||
'src/modules/privacy/privacy.cpp',
|
||||
'src/modules/privacy/privacy_item.cpp',
|
||||
'src/util/pipewire/pipewire_backend.cpp',
|
||||
'src/util/pipewire/privacy_node_info.cpp',
|
||||
'src/util/pipewire_backend.cpp',
|
||||
)
|
||||
man_files += files('man/waybar-privacy.5.scd')
|
||||
endif
|
||||
|
@ -482,7 +466,7 @@ if get_option('experimental')
|
|||
endif
|
||||
|
||||
cava = dependency('cava',
|
||||
version : '>=0.10.3',
|
||||
version : '>=0.10.1',
|
||||
required: get_option('cava'),
|
||||
fallback : ['cava', 'cava_dep'],
|
||||
not_found_message: 'cava is not found. Building waybar without cava')
|
||||
|
@ -554,14 +538,6 @@ if scdoc.found()
|
|||
}
|
||||
)
|
||||
|
||||
man_files += configure_file(
|
||||
input: 'man/waybar-styles.5.scd.in',
|
||||
output: 'waybar-styles.5.scd',
|
||||
configuration: {
|
||||
'sysconfdir': prefix / sysconfdir
|
||||
}
|
||||
)
|
||||
|
||||
fs = import('fs')
|
||||
mandir = get_option('mandir')
|
||||
foreach file : man_files
|
||||
|
|
|
@ -19,4 +19,3 @@ option('experimental', type : 'boolean', value : false, description: 'Enable exp
|
|||
option('jack', type: 'feature', value: 'auto', description: 'Enable support for JACK')
|
||||
option('wireplumber', type: 'feature', value: 'auto', description: 'Enable support for WirePlumber')
|
||||
option('cava', type: 'feature', value: 'auto', description: 'Enable support for Cava')
|
||||
option('niri', type: 'boolean', description: 'Enable support for niri')
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
}:
|
||||
let
|
||||
libcava = rec {
|
||||
version = "0.10.3";
|
||||
version = "0.10.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "LukashonakV";
|
||||
repo = "cava";
|
||||
rev = version;
|
||||
hash = "sha256-ZDFbI69ECsUTjbhlw2kHRufZbQMu+FQSMmncCJ5pagg=";
|
||||
hash = "sha256-iIYKvpOWafPJB5XhDOSIW9Mb4I3A4pcgIIPQdQYEqUw=";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
@ -25,9 +25,6 @@ in
|
|||
|
||||
mesonFlags = lib.remove "-Dgtk-layer-shell=enabled" oldAttrs.mesonFlags;
|
||||
|
||||
# downstream patch should not affect upstream
|
||||
patches = [];
|
||||
|
||||
buildInputs = (builtins.filter (p: p.pname != "wireplumber") oldAttrs.buildInputs) ++ [
|
||||
pkgs.wireplumber
|
||||
];
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
"battery",
|
||||
"battery#bat2",
|
||||
"clock",
|
||||
"tray",
|
||||
"custom/power"
|
||||
"tray"
|
||||
],
|
||||
// Modules configuration
|
||||
// "sway/workspaces": {
|
||||
|
@ -189,7 +188,7 @@
|
|||
"on-click": "pavucontrol"
|
||||
},
|
||||
"custom/media": {
|
||||
"format": "{icon} {text}",
|
||||
"format": "{icon} {}",
|
||||
"return-type": "json",
|
||||
"max-length": 40,
|
||||
"format-icons": {
|
||||
|
@ -199,17 +198,5 @@
|
|||
"escape": true,
|
||||
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
||||
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
||||
},
|
||||
"custom/power": {
|
||||
"format" : "⏻ ",
|
||||
"tooltip": false,
|
||||
"menu": "on-click",
|
||||
"menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
|
||||
"menu-actions": {
|
||||
"shutdown": "shutdown",
|
||||
"reboot": "reboot",
|
||||
"suspend": "systemctl suspend",
|
||||
"hibernate": "systemctl hibernate"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,6 @@ class PlayerManager:
|
|||
player_name = player.props.player_name
|
||||
artist = player.get_artist()
|
||||
title = player.get_title()
|
||||
title = title.replace("&", "&")
|
||||
|
||||
track_info = ""
|
||||
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
||||
|
@ -137,10 +136,6 @@ class PlayerManager:
|
|||
|
||||
def on_player_appeared(self, _, player):
|
||||
logger.info(f"Player has appeared: {player.name}")
|
||||
if player.name in self.excluded_player:
|
||||
logger.debug(
|
||||
"New player appeared, but it's in exclude player list, skipping")
|
||||
return
|
||||
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
||||
self.init_player(player)
|
||||
else:
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkMenu" id="menu">
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="suspend">
|
||||
<property name="label">Suspend</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="hibernate">
|
||||
<property name="label">Hibernate</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="shutdown">
|
||||
<property name="label">Shutdown</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="reboot">
|
||||
<property name="label">Reboot</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -48,11 +48,6 @@ button:hover {
|
|||
box-shadow: inset 0 -3px #ffffff;
|
||||
}
|
||||
|
||||
/* you can set a style on hover for any module like this */
|
||||
#pulseaudio:hover {
|
||||
background-color: #a37800;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue