rebrand: swaync → ximper-shell-notification-center

parent 3851cbe1
# These are supported funding model platforms
github: [erikreider] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: bug
assignees: ''
---
**Please read through the README and the Man pages before submitting**
**Please also make sure that there isn't any prior issue describing this bug**
**If this is a CSS issue, please make sure that the `cssPriority` config option is set to "user" before reporting**
**Please also make sure that swaync is running with your primary GPU, and not PRIME**
**If you're experiencing VK/vulkan error messages, please first try running with the environment variable `GSK_RENDERER=opengl swaync`**
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Please provide logs if you're experiencing notification errors / bugs**
Attach Gists for swaync logs by running `G_MESSAGES_DEBUG=all swaync` and (if applicable) application logs.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Fedora 42]
- Version [e.g. 0.12.4]
**Additional context**
Add any other context about the problem here.
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature]"
labels: ''
assignees: ''
---
**Please read through the README and the Man pages before submitting**
**Please also make sure that there isn't any prior issue describing this feature**
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
# This is a basic workflow to help you get started with Actions
name: Check PKGBUILD builds for Arch.
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
PKGBUILD-build:
container: archlinux:base-devel
runs-on: ubuntu-latest
steps:
- name: Install packages
run: |
pacman-key --init
pacman -Syu --noconfirm
- name: Add builduser
run: |
# Create the builduser
useradd builduser -m
# Delete the buildusers password
passwd -d builduser
# Allow the builduser passwordless sudo
printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swaync
- name: Test PKGBUILD
run: |
cd swaync
build_dir="/tmp/PKGBUILD-git"
cd build-scripts
mkdir $build_dir
cp ./PKGBUILD-git $build_dir/PKGBUILD
mkdir $build_dir/src
cp -r ../ $build_dir/src/swaync
cd $build_dir
sudo chown -R builduser $build_dir
# Use the locally checked-out branch instead of downloading the source
sudo -H -u builduser bash -c "makepkg -s --noconfirm --noextract SRCDEST=$build_dir"
name: Check build for Fedora.
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
fedora-build:
container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest
steps:
- name: Install tooling for source RPM build
run: |
microdnf -y install --nodocs --setopt=install_weak_deps=0 \
@development-tools @rpm-development-tools rpkg git \
'dnf5-command(builddep)' 'dnf5-command(copr)'
# Enable the official COPR repo
# (in case there are dependencies missing in the upstream repos)
microdnf copr enable erikreider/SwayNotificationCenter -y
# It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swaync
- name: Copy spec into root dir
run: |
cd swaync
cp ./build-scripts/swaync.rpkg.spec ./
- name: Generate spec
run: |
cd swaync
mkdir specs
rpkg spec --source --outdir specs
- name: Install build dependencies
run: |
cd swaync
microdnf -y builddep ./specs/swaync.rpkg.spec
- name: Local build
run: |
cd swaync
mkdir -p out
rpkg local --out `pwd`/out
name: Package for Fedora Copr repo
on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
fedora-copr:
container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest
steps:
- name: Install API token for copr-cli
env:
API_LOGIN: ${{ secrets.COPR_API_LOGIN }}
API_USERNAME: ${{ secrets.COPR_API_USERNAME }}
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }}
run: |
mkdir -p "$HOME/.config"
# To generate a new token: https://copr.fedorainfracloud.org/api/.
echo "[copr-cli]" >> "$HOME/.config/copr"
echo "login = $API_LOGIN" >> "$HOME/.config/copr"
echo "username = $API_USERNAME" >> "$HOME/.config/copr"
echo "token = $API_TOKEN_CONTENT" >> "$HOME/.config/copr"
echo "copr_url = https://copr.fedorainfracloud.org" >> "$HOME/.config/copr"
- name: Install tooling for source RPM build
run: |
microdnf -y install --nodocs --setopt=install_weak_deps=0 \
copr-cli rpkg git
# It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swaync
- name: Copy spec into root dir
run: |
cd swaync
cp ./build-scripts/swaync.rpkg.spec ./
- name: Submit the build to copr
run: |
cd swaync
rpkg -v copr-build -w ${{ secrets.COPR_REPO_NAME }}
# This is a basic workflow to help you get started with Actions
name: Linting
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
vala-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: elementary/actions/vala-lint@master
with:
dir: src/
conf: .vala-lint.conf
fail: true
uncrustify:
container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest
steps:
- name: Install uncrustify
run: |
microdnf -y install --nodocs --setopt=install_weak_deps=0 \
@development-tools git \
uncrustify
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swaync
- name: Run uncrustify
run: |
cd swaync
uncrustify -c ./.uncrustify.cfg -l vala $(find . -name "*.vala" -type f) --check >/dev/null
rpmlint:
container: registry.fedoraproject.org/fedora-minimal:latest
runs-on: ubuntu-latest
steps:
- name: Install rpmlint
run: |
microdnf -y install --nodocs --setopt=install_weak_deps=0 \
rpmlint rpkg
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
path: swaync
- name: Copy spec into root dir
run: |
cd swaync
cp ./build-scripts/swaync.rpkg.spec ./
- name: Generate spec
run: |
cd swaync
mkdir -p specs
rpkg spec --source --outdir specs
- name: Start linting
run: |
cd swaync
rpmlint ./specs/swaync.rpkg.spec
# This is a basic workflow to help you get started with Actions
name: Check build for latest Ubuntu version.
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
ubuntu-build:
container: ubuntu:25.04
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
PACKAGES: meson libwayland-dev libgtk-4-dev gobject-introspection libgirepository1.0-dev valac libjson-glib-dev libgtk4-layer-shell-dev scdoc libgee-0.8-dev libpulse-dev sassc libgranite-7-dev blueprint-compiler libadwaita-1-dev
steps:
- name: Install packages
run: |
apt update
apt install -y $PACKAGES
- name: Check out sources
uses: actions/checkout@v3
- name: Meson configure
run: meson build
- name: Build
run: ninja -C build
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
gschemas.compiled gschemas.compiled
pkg pkg
build build
SwayNotificationCenter XimperShellNotificationCenter
./swaync ./ximper-shell-notification-center
./swaync* ./ximper-shell-notification-center*
./src/swaync ./src/ximper-shell-notification-center
./src/swaync* ./src/ximper-shell-notification-center*
.cache/ .cache/
./*
!PKGBUILD*
!*.rpkg.spec
# vim: ft=sh
# Maintainer: Erik Reider <erik.reider@protonmail.com>
pkgname=swaync-git
_pkgname=swaync
pkgver=r674.5fa4ce8
pkgrel=1
pkgdesc="A simple notification daemon with a GTK panel for checking previous notifications like other DEs"
url="https://github.com/ErikReider/SwayNotificationCenter"
arch=(
'x86_64'
'aarch64' # ARM v8 64-bit
'armv7h' # ARM v7 hardfloat
)
license=('GPL3')
depends=("gtk4" "gtk4-layer-shell>=1.0.4" "dbus" "glib2" "gobject-introspection" "libgee" "json-glib" "libpulse" "gvfs" "libnotify" "granite7" "blueprint-compiler" "libadwaita")
conflicts=("swaync" "swaync-client")
provides=("swaync" "swaync-client" "notification-daemon")
makedepends=("vala>=0.56" meson git scdoc sassc)
source=("$_pkgname::git+$url")
sha256sums=('SKIP')
pkgver() {
cd $_pkgname
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd $_pkgname
git checkout main
}
build() {
# Very important to be in the directory! Otherwise somehow breaks linking to the .ui files
cd $_pkgname
arch-meson build -Dscripting=true
ninja -C build
}
package() {
cd $_pkgname
DESTDIR="$pkgdir/" ninja -C build install
install -Dm644 "COPYING" -t "$pkgdir/usr/share/licenses/$pkgname"
install -Dm644 "README.md" -t "$pkgdir/usr/share/doc/$pkgname"
}
# vim: syntax=spec
%global alt_pkg_name swaync
Name: {{{ git_repo_name }}}-git
Version: {{{ git_repo_release lead="$(git describe --tags --abbrev=0)" }}}
Release: {{{ echo -n "$(git rev-list --all --count)" }}}%{?dist}
Summary: Notification daemon with GTK GUI
Provides: desktop-notification-daemon
Provides: sway-notification-center = %{version}-%{release}
Provides: %{alt_pkg_name} = %{version}-%{release}
Provides: %{alt_pkg_name}-git = %{version}-%{release}
License: GPLv3
URL: https://github.com/ErikReider/SwayNotificationCenter
VCS: {{{ git_repo_vcs }}}
Source: {{{ git_repo_pack }}}
BuildRequires: meson >= 1.5.1
BuildRequires: vala >= 0.56
BuildRequires: scdoc
BuildRequires: pkgconfig(gtk4) >= 4.16
BuildRequires: pkgconfig(gtk4-layer-shell-0) >= 1.0.4
BuildRequires: pkgconfig(json-glib-1.0) >= 1.0
BuildRequires: pkgconfig(libadwaita-1) >= 1.6.5
BuildRequires: pkgconfig(glib-2.0) >= 2.50
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.68
BuildRequires: pkgconfig(gee-0.8) >= 0.20
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(fish)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(granite-7)
BuildRequires: systemd-devel
BuildRequires: systemd
BuildRequires: sassc
BuildRequires: blueprint-compiler >= 0.16
Requires: gvfs
Requires: libnotify
Requires: dbus
%{?systemd_requires}
%description
A simple notification daemon with a GTK gui for notifications and the control center
%package bash-completion
BuildArch: noarch
Summary: Bash completion files for %{name}
Provides: %{alt_pkg_name}-bash-completion = %{version}-%{release}
Requires: bash-completion
Requires: %{name} = %{version}-%{release}
%description bash-completion
This package installs Bash completion files for %{name}
%package zsh-completion
BuildArch: noarch
Summary: Zsh completion files for %{name}
Provides: %{alt_pkg_name}-zsh-completion = %{version}-%{release}
Requires: zsh
Requires: %{name} = %{version}-%{release}
%description zsh-completion
This package installs Zsh completion files for %{name}
%package fish-completion
BuildArch: noarch
Summary: Fish completion files for %{name}
Provides: %{alt_pkg_name}-fish-completion = %{version}-%{release}
Requires: fish
Requires: %{name} = %{version}-%{release}
%description fish-completion
This package installs Fish completion files for %{name}
%prep
{{{ git_repo_setup_macro }}}
%build
%meson
%meson_build
%install
%meson_install
%post
%systemd_user_post swaync.service
%preun
%systemd_user_preun swaync.service
%files
%doc README.md
%{_bindir}/swaync-client
%{_bindir}/swaync
%license COPYING
%config(noreplace) %{_sysconfdir}/xdg/swaync/configSchema.json
%config(noreplace) %{_sysconfdir}/xdg/swaync/config.json
%config(noreplace) %{_sysconfdir}/xdg/swaync/style.css
%{_userunitdir}/swaync.service
%{_datadir}/dbus-1/services/org.erikreider.swaync.service
%{_datadir}/dbus-1/services/org.erikreider.swaync.cc.service
%{_datadir}/glib-2.0/schemas/org.erikreider.swaync.gschema.xml
%{_mandir}/man1/swaync-client.1.gz
%{_mandir}/man1/swaync.1.gz
%{_mandir}/man5/swaync.5.gz
%files bash-completion
%{_datadir}/bash-completion/completions/swaync
%{_datadir}/bash-completion/completions/swaync-client
%files zsh-completion
%{_datadir}/zsh/site-functions/_swaync
%{_datadir}/zsh/site-functions/_swaync-client
%files fish-completion
%{_datadir}/fish/vendor_completions.d/swaync-client.fish
%{_datadir}/fish/vendor_completions.d/swaync.fish
# Changelog will be empty until you make first annotated Git tag.
%changelog
{{{ git_repo_changelog }}}
# vim: syntax=spec
%global alt_pkg_name swaync
Name: {{{ git_repo_name }}}
Version: 0.12.5
Release: 1%{?dist}
Summary: Notification daemon with GTK GUI
Provides: desktop-notification-daemon
Provides: sway-notification-center = %{version}-%{release}
Provides: %{alt_pkg_name} = %{version}-%{release}
License: GPLv3
URL: https://github.com/ErikReider/SwayNotificationCenter
VCS: {{{ git_repo_vcs }}}
Source: {{{ git_repo_pack }}}
BuildRequires: meson >= 1.5.1
BuildRequires: vala >= 0.56
BuildRequires: scdoc
BuildRequires: pkgconfig(gtk4) >= 4.16
BuildRequires: pkgconfig(gtk4-layer-shell-0) >= 1.0.4
BuildRequires: pkgconfig(json-glib-1.0) >= 1.0
BuildRequires: pkgconfig(libadwaita-1) >= 1.6.5
BuildRequires: pkgconfig(glib-2.0) >= 2.50
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.68
BuildRequires: pkgconfig(gee-0.8) >= 0.20
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(fish)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(granite-7)
BuildRequires: systemd-devel
BuildRequires: systemd
BuildRequires: sassc
BuildRequires: blueprint-compiler >= 0.16
Requires: gvfs
Requires: libnotify
Requires: dbus
%{?systemd_requires}
%description
A simple notification daemon with a GTK gui for notifications and the control center
%package bash-completion
BuildArch: noarch
Summary: Bash completion files for %{name}
Provides: %{alt_pkg_name}-bash-completion = %{version}-%{release}
Requires: bash-completion
Requires: %{name} = %{version}-%{release}
%description bash-completion
This package installs Bash completion files for %{name}
%package zsh-completion
BuildArch: noarch
Summary: Zsh completion files for %{name}
Provides: %{alt_pkg_name}-zsh-completion = %{version}-%{release}
Requires: zsh
Requires: %{name} = %{version}-%{release}
%description zsh-completion
This package installs Zsh completion files for %{name}
%package fish-completion
BuildArch: noarch
Summary: Fish completion files for %{name}
Provides: %{alt_pkg_name}-fish-completion = %{version}-%{release}
Requires: fish
Requires: %{name} = %{version}-%{release}
%description fish-completion
This package installs Fish completion files for %{name}
%prep
{{{ git_repo_setup_macro }}}
%build
%meson
%meson_build
%install
%meson_install
%post
%systemd_user_post swaync.service
%preun
%systemd_user_preun swaync.service
%files
%doc README.md
%{_bindir}/swaync-client
%{_bindir}/swaync
%license COPYING
%config(noreplace) %{_sysconfdir}/xdg/swaync/configSchema.json
%config(noreplace) %{_sysconfdir}/xdg/swaync/config.json
%config(noreplace) %{_sysconfdir}/xdg/swaync/style.css
%{_userunitdir}/swaync.service
%{_datadir}/dbus-1/services/org.erikreider.swaync.service
%{_datadir}/dbus-1/services/org.erikreider.swaync.cc.service
%{_datadir}/glib-2.0/schemas/org.erikreider.swaync.gschema.xml
%{_mandir}/man1/swaync-client.1.gz
%{_mandir}/man1/swaync.1.gz
%{_mandir}/man5/swaync.5.gz
%files bash-completion
%{_datadir}/bash-completion/completions/swaync
%{_datadir}/bash-completion/completions/swaync-client
%files zsh-completion
%{_datadir}/zsh/site-functions/_swaync
%{_datadir}/zsh/site-functions/_swaync-client
%files fish-completion
%{_datadir}/fish/vendor_completions.d/swaync-client.fish
%{_datadir}/fish/vendor_completions.d/swaync.fish
# Changelog will be empty until you make first annotated Git tag.
%changelog
{{{ git_repo_changelog }}}
_swaync() { _ximper-shell-notification-center() {
local cur prev local cur prev
_get_comp_words_by_ref cur prev _get_comp_words_by_ref cur prev
...@@ -44,4 +44,4 @@ _swaync() { ...@@ -44,4 +44,4 @@ _swaync() {
COMPREPLY+=($(compgen -c -- "$cur")) COMPREPLY+=($(compgen -c -- "$cur"))
fi fi
} && complete -F _swaync swaync } && complete -F _ximper-shell-notification-center ximper-shell-notification-center
_swaync-client() { _ximper-shell-notification-center-client() {
local cur prev local cur prev
_get_comp_words_by_ref cur prev _get_comp_words_by_ref cur prev
...@@ -76,4 +76,4 @@ _swaync-client() { ...@@ -76,4 +76,4 @@ _swaync-client() {
COMPREPLY+=($(compgen -c -- "$cur")) COMPREPLY+=($(compgen -c -- "$cur"))
fi fi
} && complete -F _swaync-client swaync-client } && complete -F _ximper-shell-notification-center-client ximper-shell-notification-center-client
complete -f -c swaync-client
complete -c swaync-client -s h -l help --description "Show help options"
complete -c swaync-client -s v -l version --description "Prints version"
complete -c swaync-client -s R -l reload-config --description "Reload the config file" -r
complete -c swaync-client -s rs -l reload-css --description "Reload the css file. Location change requires restart" -r
complete -c swaync-client -s t -l toggle-panel --description "Toggle the notification panel" -r
complete -c swaync-client -s op -l open-panel --description "Opens the notification panel" -r
complete -c swaync-client -s cp -l close-panel --description "Closes the notification panel" -r
complete -c swaync-client -s d -l toggle-dnd --description "Toggle and print the current dnd state" -r
complete -c swaync-client -s D -l get-dnd --description "Print the current dnd state" -r
complete -c swaync-client -s dn -l dnd-on --description "Turn dnd on and print the new dnd state" -r
complete -c swaync-client -s df -l dnd-off --description "Turn dnd off and print the new dnd state" -r
complete -c swaync-client -s I -l get-inhibited --description "Print if currently inhibited or not" -r
complete -c swaync-client -s In -l get-num-inhibitors --description "Print number of inhibitors" -r
complete -c swaync-client -s Ia -l inhibitor-add --description "Add an inhibitor" -r
complete -c swaync-client -s Ir -l inhibitor-remove --description "Remove an inhibitor" -r
complete -c swaync-client -s Ic -l inhibitors-clear --description "Clears all inhibitors" -r
complete -c swaync-client -s c -l count --description "Print the current notification count" -r
complete -c swaync-client -l hide-latest --description "Hides latest notification. Still shown in Control Center" -r
complete -c swaync-client -l hide-all --description "Hides all notifications. Still shown in Control Center" -r
complete -c swaync-client -l close-latest --description "Closes latest notification" -r
complete -c swaync-client -s C -l close-all --description "Closes all notifications" -r
complete -c swaync-client -s sw -l skip-wait --description "Doesn't wait when swaync hasn't been started" -r
complete -c swaync-client -s s -l subscribe --description "Subscribe to notification add and close events" -r
complete -c swaync-client -s swb -l subscribe-waybar --description "Subscribe to notification add and close events with waybar support. Read README for example" -r
complete -c swaync-client -l change-cc-monitor --description "Changes the preferred control center monitor (resets on config reload)" -r
complete -c swaync-client -l change-noti-monitor --description "Changes the preferred notification monitor (resets on config reload)" -r
complete -f -c swaync
complete -c swaync -s h -l help --description "Show help options"
complete -c swaync -s v -l version --description "Prints version"
complete -c swaync -s s -l style --description "Use a custom Stylesheet file" -r
complete -c swaync -s c -l config --description "Use a custom config file" -r
complete -c swaync -l replace --description "Replace the currently running instance of SwayNotificationCenter"
complete -c swaync -l skip-system-css --description "Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging"
complete -c swaync -l custom-system-css --description "Pick a custom CSS file to use as the \"system\" CSS. Useful for CSS debugging" -r
complete -f -c ximper-shell-notification-center-client
complete -c ximper-shell-notification-center-client -s h -l help --description "Show help options"
complete -c ximper-shell-notification-center-client -s v -l version --description "Prints version"
complete -c ximper-shell-notification-center-client -s R -l reload-config --description "Reload the config file" -r
complete -c ximper-shell-notification-center-client -s rs -l reload-css --description "Reload the css file. Location change requires restart" -r
complete -c ximper-shell-notification-center-client -s t -l toggle-panel --description "Toggle the notification panel" -r
complete -c ximper-shell-notification-center-client -s op -l open-panel --description "Opens the notification panel" -r
complete -c ximper-shell-notification-center-client -s cp -l close-panel --description "Closes the notification panel" -r
complete -c ximper-shell-notification-center-client -s d -l toggle-dnd --description "Toggle and print the current dnd state" -r
complete -c ximper-shell-notification-center-client -s D -l get-dnd --description "Print the current dnd state" -r
complete -c ximper-shell-notification-center-client -s dn -l dnd-on --description "Turn dnd on and print the new dnd state" -r
complete -c ximper-shell-notification-center-client -s df -l dnd-off --description "Turn dnd off and print the new dnd state" -r
complete -c ximper-shell-notification-center-client -s I -l get-inhibited --description "Print if currently inhibited or not" -r
complete -c ximper-shell-notification-center-client -s In -l get-num-inhibitors --description "Print number of inhibitors" -r
complete -c ximper-shell-notification-center-client -s Ia -l inhibitor-add --description "Add an inhibitor" -r
complete -c ximper-shell-notification-center-client -s Ir -l inhibitor-remove --description "Remove an inhibitor" -r
complete -c ximper-shell-notification-center-client -s Ic -l inhibitors-clear --description "Clears all inhibitors" -r
complete -c ximper-shell-notification-center-client -s c -l count --description "Print the current notification count" -r
complete -c ximper-shell-notification-center-client -l hide-latest --description "Hides latest notification. Still shown in Control Center" -r
complete -c ximper-shell-notification-center-client -l hide-all --description "Hides all notifications. Still shown in Control Center" -r
complete -c ximper-shell-notification-center-client -l close-latest --description "Closes latest notification" -r
complete -c ximper-shell-notification-center-client -s C -l close-all --description "Closes all notifications" -r
complete -c ximper-shell-notification-center-client -s sw -l skip-wait --description "Doesn't wait when ximper-shell-notification-center hasn't been started" -r
complete -c ximper-shell-notification-center-client -s s -l subscribe --description "Subscribe to notification add and close events" -r
complete -c ximper-shell-notification-center-client -s swb -l subscribe-waybar --description "Subscribe to notification add and close events with waybar support. Read README for example" -r
complete -c ximper-shell-notification-center-client -l change-cc-monitor --description "Changes the preferred control center monitor (resets on config reload)" -r
complete -c ximper-shell-notification-center-client -l change-noti-monitor --description "Changes the preferred notification monitor (resets on config reload)" -r
complete -f -c ximper-shell-notification-center
complete -c ximper-shell-notification-center -s h -l help --description "Show help options"
complete -c ximper-shell-notification-center -s v -l version --description "Prints version"
complete -c ximper-shell-notification-center -s s -l style --description "Use a custom Stylesheet file" -r
complete -c ximper-shell-notification-center -s c -l config --description "Use a custom config file" -r
complete -c ximper-shell-notification-center -l replace --description "Replace the currently running instance of XimperShellNotificationCenter"
complete -c ximper-shell-notification-center -l skip-system-css --description "Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging"
complete -c ximper-shell-notification-center -l custom-system-css --description "Pick a custom CSS file to use as the \"system\" CSS. Useful for CSS debugging" -r
#compdef swaync #compdef ximper-shell-notification-center
_arguments -s \ _arguments -s \
'(-h --help)'{-h,--help}'[Show help options]' \ '(-h --help)'{-h,--help}'[Show help options]' \
'(-v --version)'{-v,--version}'[Prints version]' \ '(-v --version)'{-v,--version}'[Prints version]' \
'(-s --style)'{-s,--style}'[Use a custom Stylesheet file]:files:_files' \ '(-s --style)'{-s,--style}'[Use a custom Stylesheet file]:files:_files' \
'(-c --config)'{-c,--config}'[Use a custom config file]:files:_files' \ '(-c --config)'{-c,--config}'[Use a custom config file]:files:_files' \
'( --replace)'--replace'[Replace the currently running instance of SwayNotificationCenter]' \ '( --replace)'--replace'[Replace the currently running instance of XimperShellNotificationCenter]' \
'( --skip-system-css)'--skip-system-css'[Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging]' \ '( --skip-system-css)'--skip-system-css'[Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging]' \
'( --custom-system-css)'--custom-system-css'[Pick a custom CSS file to use as the "system" CSS. Useful for CSS debugging]:files:_files' \ '( --custom-system-css)'--custom-system-css'[Pick a custom CSS file to use as the "system" CSS. Useful for CSS debugging]:files:_files' \
#compdef swaync-client #compdef ximper-shell-notification-center-client
_arguments -s \ _arguments -s \
'(-h --help)'{-h,--help}'[Show help options]' \ '(-h --help)'{-h,--help}'[Show help options]' \
...@@ -22,7 +22,7 @@ _arguments -s \ ...@@ -22,7 +22,7 @@ _arguments -s \
'(--hide-all)'--hide-all'[Hides all notifications. Still shown in Control Center]' \ '(--hide-all)'--hide-all'[Hides all notifications. Still shown in Control Center]' \
'(--close-latest)'--close-latest'[Closes latest notification]' \ '(--close-latest)'--close-latest'[Closes latest notification]' \
'(-C --close-all)'{-C,--close-all}'[Closes all notifications]' \ '(-C --close-all)'{-C,--close-all}'[Closes all notifications]' \
'(-sw --skip-wait)'{-sw,--skip-wait}"[Doesn't wait when swaync hasn't been started]" \ '(-sw --skip-wait)'{-sw,--skip-wait}"[Doesn't wait when ximper-shell-notification-center hasn't been started]" \
'(-s --subscribe)'{-s,--subscribe}'[Subscribe to notification add and close events]' \ '(-s --subscribe)'{-s,--subscribe}'[Subscribe to notification add and close events]' \
'(-swb --subscribe-waybar)'{-swb,--subscribe-waybar}'[Subscribe to notification add and close events with waybar support. Read README for example]' \ '(-swb --subscribe-waybar)'{-swb,--subscribe-waybar}'[Subscribe to notification add and close events with waybar support. Read README for example]' \
'(--change-cc-monitor)'--change-cc-monitor'[Changes the preferred control center monitor (resets on config reload)]' \ '(--change-cc-monitor)'--change-cc-monitor'[Changes the preferred control center monitor (resets on config reload)]' \
......
# GSchema # GSchema
compile_schemas = find_program('glib-compile-schemas', required: true) compile_schemas = find_program('glib-compile-schemas', required: true)
install_data( install_data(
'org.erikreider.swaync.gschema.xml', 'ru.ximperlinux.shell.NotificationCenter.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0/schemas'), install_dir: join_paths(datadir, 'glib-2.0/schemas'),
) )
...@@ -13,7 +13,7 @@ test( ...@@ -13,7 +13,7 @@ test(
if get_option('buildtype') != 'release' if get_option('buildtype') != 'release'
app_resources += custom_target( app_resources += custom_target(
'gschemas', 'gschemas',
input: 'org.erikreider.swaync.gschema.xml', input: 'ru.ximperlinux.shell.NotificationCenter.gschema.xml',
output: 'gschemas.compiled', output: 'gschemas.compiled',
command: [ command: [
compile_schemas, compile_schemas,
...@@ -42,8 +42,8 @@ blueprints = custom_target( ...@@ -42,8 +42,8 @@ blueprints = custom_target(
) )
app_resources += gnome.compile_resources( app_resources += gnome.compile_resources(
'sway_notification_center-resources', 'ximper_shell_notification_center-resources',
'sway_notification_center.gresource.xml', 'ximper_shell_notification_center.gresource.xml',
dependencies: [style_files, blueprints], dependencies: [style_files, blueprints],
c_name: 'sway_notification_center', c_name: 'ximper_shell_notification_center',
) )
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="swaync"> <schemalist gettext-domain="ximper-shell-notification-center">
<schema id="org.erikreider.swaync" path="/org/erikreider/swaync/"> <schema id="ru.ximperlinux.shell.NotificationCenter" path="/ru/ximperlinux/shell/NotificationCenter/">
<key name="dnd-state" type="b"> <key name="dnd-state" type="b">
<default>false</default> <default>false</default>
<summary>The current do not disturb state</summary> <summary>The current do not disturb state</summary>
......
using Gtk 4.0; using Gtk 4.0;
template $SwayNotificationCenterControlCenter: ApplicationWindow { template $XimperShellNotificationCenterControlCenter: ApplicationWindow {
name: "control-center-window"; name: "control-center-window";
styles [ styles [
......
using Gtk 4.0; using Gtk 4.0;
template $SwayNotificationCenterWidgetsMprisMprisPlayer: $Underlay { template $XimperShellNotificationCenterWidgetsMprisMprisPlayer: $Underlay {
overflow: hidden; overflow: hidden;
valign: fill; valign: fill;
hexpand: true; hexpand: true;
......
using Gtk 4.0; using Gtk 4.0;
using Adw 1; using Adw 1;
template $SwayNotificationCenterNotification: Adw.Bin { template $XimperShellNotificationCenterNotification: Adw.Bin {
hexpand: true; hexpand: true;
styles [ styles [
...@@ -176,7 +176,7 @@ template $SwayNotificationCenterNotification: Adw.Bin { ...@@ -176,7 +176,7 @@ template $SwayNotificationCenterNotification: Adw.Bin {
} }
[overlay] [overlay]
$SwayNotificationCenterNotificationCloseButton close_button {} $XimperShellNotificationCenterNotificationCloseButton close_button {}
}; };
}; };
} }
......
using Gtk 4.0; using Gtk 4.0;
template $SwayNotificationCenterNotificationWindow: Gtk.ApplicationWindow { template $XimperShellNotificationCenterNotificationWindow: Gtk.ApplicationWindow {
styles [ styles [
"floating-notifications", "floating-notifications",
] ]
......
using Gtk 4.0; using Gtk 4.0;
template $SwayNotificationCenterWidgetsNotifications: $SwayNotificationCenterWidgetsBaseWidget { template $XimperShellNotificationCenterWidgetsNotifications: $XimperShellNotificationCenterWidgetsBaseWidget {
orientation: vertical; orientation: vertical;
overflow: hidden; overflow: hidden;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/org/erikreider/swaync"> <gresource prefix="/ru/ximperlinux/shell/NotificationCenter">
<file preprocess="xml-stripblanks">icons/scalable/actions/swaync-collapse-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/ximper-shell-notification-center-collapse-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/swaync-close-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/ximper-shell-notification-center-close-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/swaync-up-small-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/ximper-shell-notification-center-up-small-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/swaync-down-small-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/ximper-shell-notification-center-down-small-symbolic.svg</file>
<file preprocess="xml-stripblanks">ui/notification_window.ui</file> <file preprocess="xml-stripblanks">ui/notification_window.ui</file>
<file preprocess="xml-stripblanks">ui/notification.ui</file> <file preprocess="xml-stripblanks">ui/notification.ui</file>
......
swaync-client(1) ximper-shell-notification-center-client(1)
# NAME # NAME
swaync-client - Client executable ximper-shell-notification-center-client - Client executable
# USAGE # USAGE
*swaync-client* [option] *ximper-shell-notification-center-client* [option]
# OPTIONS # OPTIONS
...@@ -77,7 +77,7 @@ swaync-client - Client executable ...@@ -77,7 +77,7 @@ swaync-client - Client executable
Invokes the action [ACTION_INDEX] (or 0) of the latest notification Invokes the action [ACTION_INDEX] (or 0) of the latest notification
*-sw, --skip-wait* *-sw, --skip-wait*
Doesn't wait when swaync hasn't been started Doesn't wait when ximper-shell-notification-center hasn't been started
*-s, --subscribe* *-s, --subscribe*
Subscribe to notification add and close events Subscribe to notification add and close events
......
swaync(1) ximper-shell-notification-center(1)
# NAME # NAME
swaync - A simple notification daemon with a GTK gui for notifications and the control center ximper-shell-notification-center - A simple notification daemon with a GTK gui for notifications and the control center
# USAGE # USAGE
*swaync* [option] *ximper-shell-notification-center* [option]
# OPTIONS # OPTIONS
...@@ -20,7 +20,7 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c ...@@ -20,7 +20,7 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c
Use a custom Stylesheet file Use a custom Stylesheet file
*--replace* *--replace*
Replace the currently running instance of SwayNotificationCenter Replace the currently running instance of XimperShellNotificationCenter
*--skip-system-css* *--skip-system-css*
Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging
...@@ -57,12 +57,12 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c ...@@ -57,12 +57,12 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c
# CONFIGURATION # CONFIGURATION
The main config file is located in */etc/xdg/swaync/config.json*. Copy it over The main config file is located in */etc/xdg/ximper-shell/notification-center/config.json*. Copy it over
to your *~/.config/swaync/* folder to customize without needing root access. to your *~/.config/ximper-shell/notification-center/* folder to customize without needing root access.
To reload the config, you'll need to run *swaync-client --reload-config* To reload the config, you'll need to run *ximper-shell-notification-center-client --reload-config*
For information on the config file format, see *swaync*(5) For information on the config file format, see *ximper-shell-notification-center*(5)
# Scripting # Scripting
...@@ -76,7 +76,7 @@ Scripting rules and logic: ...@@ -76,7 +76,7 @@ Scripting rules and logic:
. If a notification doesn't include one of the properties, that property will be skipped . If a notification doesn't include one of the properties, that property will be skipped
Notification information can be printed into a terminal by running Notification information can be printed into a terminal by running
*G_MESSAGES_DEBUG=all swaync* (when a notification appears). *G_MESSAGES_DEBUG=all ximper-shell-notification-center* (when a notification appears).
Config properties: Config properties:
...@@ -104,7 +104,7 @@ Config properties: ...@@ -104,7 +104,7 @@ Config properties:
// This script will only run when Spotify sends a notification containing // This script will only run when Spotify sends a notification containing
// that exact summary and body // that exact summary and body
"example-script": { "example-script": {
"exec": "~/.config/swaync/myRickRollScript.sh", "exec": "~/.config/ximper-shell/notification-center/myRickRollScript.sh",
"app-name": "Spotify" "app-name": "Spotify"
"summary": "Never Gonna Give You Up", "summary": "Never Gonna Give You Up",
"body": "Rick Astley - Whenever You Need Somebody" "body": "Rick Astley - Whenever You Need Somebody"
...@@ -135,20 +135,20 @@ Waybar config ...@@ -135,20 +135,20 @@ Waybar config
"tooltip": false, "tooltip": false,
"format": "{icon}", "format": "{icon}",
"format-icons": { "format-icons": {
"notification": "<span foreground='red'><sup></sup></span>", "notification": "<span foreground='red'><sup></sup></span>",
"none": "", "none": "",
"dnd-notification": "<span foreground='red'><sup></sup></span>", "dnd-notification": "<span foreground='red'><sup></sup></span>",
"dnd-none": "", "dnd-none": "",
"inhibited-notification": "<span foreground='red'><sup></sup></span>", "inhibited-notification": "<span foreground='red'><sup></sup></span>",
"inhibited-none": "", "inhibited-none": "",
"dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>", "dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>",
"dnd-inhibited-none": "" "dnd-inhibited-none": ""
}, },
"return-type": "json", "return-type": "json",
"exec-if": "which swaync-client", "exec-if": "which ximper-shell-notification-center-client",
"exec": "swaync-client -swb", "exec": "ximper-shell-notification-center-client -swb",
"on-click": "swaync-client -t -sw", "on-click": "ximper-shell-notification-center-client -t -sw",
"on-click-right": "swaync-client -d -sw", "on-click-right": "ximper-shell-notification-center-client -d -sw",
"escape": true "escape": true
}, },
``` ```
......
swaync(5) ximper-shell-notification-center(5)
# NAME # NAME
swaync - Configuration file ximper-shell-notification-center - Configuration file
# CONFIGURATION # CONFIGURATION
...@@ -38,7 +38,7 @@ config file to be able to detect config errors ...@@ -38,7 +38,7 @@ config file to be able to detect config errors
type: bool ++ type: bool ++
default: true ++ default: true ++
description: Wether or not the windows should be opened as layer-shell ++ description: Wether or not the windows should be opened as layer-shell ++
surfaces. Note: Requires swaync restart to apply surfaces. Note: Requires ximper-shell-notification-center restart to apply
*cssPriority* ++ *cssPriority* ++
type: string ++ type: string ++
...@@ -226,7 +226,7 @@ config file to be able to detect config errors ...@@ -226,7 +226,7 @@ config file to be able to detect config errors
type: string ++ type: string ++
optional: true (needs at least one *matcher*) ++ optional: true (needs at least one *matcher*) ++
description: Matches the actions identifier. Can be found by ++ description: Matches the actions identifier. Can be found by ++
reading the output of swaync when run with the ++ reading the output of ximper-shell-notification-center when run with the ++
*G_MESSAGES_DEBUG=all* environment variable.++ *G_MESSAGES_DEBUG=all* environment variable.++
*text-matcher*++ *text-matcher*++
type: string ++ type: string ++
...@@ -556,7 +556,7 @@ config file to be able to detect config errors ...@@ -556,7 +556,7 @@ config file to be able to detect config errors
default: "normal" ++ default: "normal" ++
description: Type of the button ++ description: Type of the button ++
Toggle buttons receive the '.active' css class and an env ++ Toggle buttons receive the '.active' css class and an env ++
variable "SWAYNC_TOGGLE_STATE" is set. See example usage in the ++ variable "XSNC_TOGGLE_STATE" is set. See example usage in the ++
default config.json ++ default config.json ++
enum: ["normal", "toggle"] ++ enum: ["normal", "toggle"] ++
update-command: ++ update-command: ++
...@@ -596,7 +596,7 @@ config file to be able to detect config errors ...@@ -596,7 +596,7 @@ config file to be able to detect config errors
default: "normal" ++ default: "normal" ++
description: Type of the button ++ description: Type of the button ++
Toggle buttons receive the '.active' css class and an env ++ Toggle buttons receive the '.active' css class and an env ++
variable "SWAYNC_TOGGLE_STATE" is set. See example usage in the ++ variable "XSNC_TOGGLE_STATE" is set. See example usage in the ++
default config.json ++ default config.json ++
enum: ["normal", "toggle"] ++ enum: ["normal", "toggle"] ++
active: ++ active: ++
...@@ -896,17 +896,17 @@ config file to be able to detect config errors ...@@ -896,17 +896,17 @@ config file to be able to detect config errors
You can also use these environment variables in your script: You can also use these environment variables in your script:
``` ```
$SWAYNC_BODY="Notification body content" $XSNC_BODY="Notification body content"
$SWAYNC_DESKTOP_ENTRY="Desktop entry" $XSNC_DESKTOP_ENTRY="Desktop entry"
$SWAYNC_URGENCY="Notification urgency" $XSNC_URGENCY="Notification urgency"
$SWAYNC_TIME="Notification time" $XSNC_TIME="Notification time"
$SWAYNC_APP_NAME="Notification app name" $XSNC_APP_NAME="Notification app name"
$SWAYNC_CATEGORY="SwayNC notification category" $XSNC_CATEGORY="Notification category"
$SWAYNC_REPLACES_ID="ID of notification to replace" $XSNC_REPLACES_ID="ID of notification to replace"
$SWAYNC_ID="SwayNC notification ID" $XSNC_ID="Notification ID"
$SWAYNC_SUMMARY="Notification summary" $XSNC_SUMMARY="Notification summary"
$SWAYNC_HINT_[NAME]="Value of the hint [NAME]" $XSNC_HINT_[NAME]="Value of the hint [NAME]"
$SWAYNC_SOUND_NAME="The name of the requested sound" $XSNC_SOUND_NAME="The name of the requested sound"
$SWAYNC_SOUND_FILE="The file path of the requested sound" $XSNC_SOUND_FILE="The file path of the requested sound"
``` ```
#END scripting #END scripting
project('sway-notificaton-center', ['c', 'vala'], project('ximper-shell-notification-center', ['c', 'vala'],
version: '0.12.5', version: '0.12.5',
meson_version: '>= 0.60.0', meson_version: '>= 0.60.0',
default_options: [ 'warning_level=2' ], default_options: [ 'warning_level=2' ],
...@@ -18,7 +18,7 @@ gnome = import('gnome') ...@@ -18,7 +18,7 @@ gnome = import('gnome')
app_resources = [] app_resources = []
config_path = join_paths(get_option('sysconfdir'), 'xdg', 'swaync') config_path = join_paths(get_option('sysconfdir'), 'xdg', 'ximper-shell', 'notification-center')
datadir = get_option('datadir') datadir = get_option('datadir')
libdir = get_option('libdir') libdir = get_option('libdir')
...@@ -37,14 +37,14 @@ conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir'))) ...@@ -37,14 +37,14 @@ conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
# D-Bus Notification service # D-Bus Notification service
configure_file( configure_file(
configuration: conf_data, configuration: conf_data,
input: 'services/dbus/org.erikreider.swaync.service.in', input: 'services/dbus/ru.ximperlinux.shell.NotificationCenter.service.in',
output: '@BASENAME@', output: '@BASENAME@',
install_dir: datadir + '/dbus-1/services' install_dir: datadir + '/dbus-1/services'
) )
# D-Bus Control Center service # D-Bus Control Center service
configure_file( configure_file(
configuration: conf_data, configuration: conf_data,
input: 'services/dbus/org.erikreider.swaync.cc.service.in', input: 'services/dbus/ru.ximperlinux.shell.NotificationCenter.cc.service.in',
output: '@BASENAME@', output: '@BASENAME@',
install_dir: datadir + '/dbus-1/services' install_dir: datadir + '/dbus-1/services'
) )
...@@ -60,7 +60,7 @@ if get_option('systemd-service') ...@@ -60,7 +60,7 @@ if get_option('systemd-service')
configure_file( configure_file(
configuration: conf_data, configuration: conf_data,
input: 'services/systemd/swaync.service.in', input: 'services/systemd/ximper-shell-notification-center.service.in',
output: '@BASENAME@', output: '@BASENAME@',
install_dir: systemd_service_install_dir install_dir: systemd_service_install_dir
) )
...@@ -69,8 +69,8 @@ endif ...@@ -69,8 +69,8 @@ endif
# Zsh completion # Zsh completion
if get_option('zsh-completions') if get_option('zsh-completions')
zsh_files = files( zsh_files = files(
'completions/zsh/_swaync', 'completions/zsh/_ximper-shell-notification-center',
'completions/zsh/_swaync-client', 'completions/zsh/_ximper-shell-notification-center-client',
) )
zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions') zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
...@@ -81,8 +81,8 @@ endif ...@@ -81,8 +81,8 @@ endif
bash_comp = dependency('bash-completion', required: false) bash_comp = dependency('bash-completion', required: false)
if get_option('bash-completions') if get_option('bash-completions')
bash_files = files( bash_files = files(
'completions/bash/swaync', 'completions/bash/ximper-shell-notification-center',
'completions/bash/swaync-client', 'completions/bash/ximper-shell-notification-center-client',
) )
if bash_comp.found() if bash_comp.found()
...@@ -101,8 +101,8 @@ endif ...@@ -101,8 +101,8 @@ endif
fish_comp = dependency('fish', required: false) fish_comp = dependency('fish', required: false)
if get_option('fish-completions') if get_option('fish-completions')
fish_files = files( fish_files = files(
'completions/fish/swaync.fish', 'completions/fish/ximper-shell-notification-center.fish',
'completions/fish/swaync-client.fish', 'completions/fish/ximper-shell-notification-center-client.fish',
) )
if fish_comp.found() if fish_comp.found()
...@@ -138,9 +138,9 @@ if get_option('man-pages') ...@@ -138,9 +138,9 @@ if get_option('man-pages')
mandir = get_option('mandir') mandir = get_option('mandir')
man_files = [ man_files = [
'swaync.1.scd', 'ximper-shell-notification-center.1.scd',
'swaync.5.scd', 'ximper-shell-notification-center.5.scd',
'swaync-client.1.scd', 'ximper-shell-notification-center-client.1.scd',
] ]
foreach filename : man_files foreach filename : man_files
......
[D-BUS Service]
Name=org.erikreider.swaync.cc
Exec=@bindir@/swaync
SystemdService=swaync.service
[D-BUS Service]
Name=ru.ximperlinux.shell.NotificationCenter
Exec=@bindir@/ximper-shell-notification-center
SystemdService=ximper-shell-notification-center.service
[D-BUS Service] [D-BUS Service]
Name=org.freedesktop.Notifications Name=org.freedesktop.Notifications
Exec=@bindir@/swaync Exec=@bindir@/ximper-shell-notification-center
SystemdService=swaync.service SystemdService=ximper-shell-notification-center.service
[Unit] [Unit]
Description=Swaync notification daemon Description=Ximper Shell Notification Center daemon
Documentation=https://github.com/ErikReider/SwayNotificationCenter Documentation=https://github.com/niceos2/ximper-shell-notification-center
PartOf=graphical-session.target PartOf=graphical-session.target
After=graphical-session.target After=graphical-session.target
# ConditionEnvironment requires systemd v247 to work correctly # ConditionEnvironment requires systemd v247 to work correctly
...@@ -9,8 +9,8 @@ ConditionEnvironment=WAYLAND_DISPLAY ...@@ -9,8 +9,8 @@ ConditionEnvironment=WAYLAND_DISPLAY
[Service] [Service]
Type=dbus Type=dbus
BusName=org.freedesktop.Notifications BusName=org.freedesktop.Notifications
ExecStart=@bindir@/swaync ExecStart=@bindir@/ximper-shell-notification-center
ExecReload=@bindir@/swaync-client --reload-config ; @bindir@/swaync-client --reload-css ExecReload=@bindir@/ximper-shell-notification-center-client --reload-config ; @bindir@/ximper-shell-notification-center-client --reload-css
Restart=on-failure Restart=on-failure
[Install] [Install]
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public class BlankWindow : Gtk.ApplicationWindow { public class BlankWindow : Gtk.ApplicationWindow {
public unowned Gdk.Monitor monitor { get; private set; } public unowned Gdk.Monitor monitor { get; private set; }
...@@ -28,7 +28,7 @@ namespace SwayNotificationCenter { ...@@ -28,7 +28,7 @@ namespace SwayNotificationCenter {
blank_window_down = false; blank_window_down = false;
if (blank_window_in) { if (blank_window_in) {
try { try {
swaync_daemon.set_visibility (false); ximper_shell_notification_center_daemon.set_visibility (false);
} catch (Error e) { } catch (Error e) {
stderr.printf ("ControlCenter BlankWindow Click Error: %s\n", stderr.printf ("ControlCenter BlankWindow Click Error: %s\n",
e.message); e.message);
...@@ -61,13 +61,13 @@ namespace SwayNotificationCenter { ...@@ -61,13 +61,13 @@ namespace SwayNotificationCenter {
if (!GtkLayerShell.is_supported ()) { if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n"); stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n"); stderr.printf ("Ximper Shell Notification Center only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n"); stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n"); stderr.printf ("\tGDK_BACKEND=wayland ximper-shell-notification-center\n");
Process.exit (1); Process.exit (1);
} }
GtkLayerShell.init_for_window (this); GtkLayerShell.init_for_window (this);
GtkLayerShell.set_namespace (this, "swaync-control-center"); GtkLayerShell.set_namespace (this, "ximper-shell-notification-center");
GtkLayerShell.set_monitor (this, monitor); GtkLayerShell.set_monitor (this, monitor);
GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true);
......
public struct SwayncDaemonData { public struct XimperShellNotificationCenterDaemonData {
public bool dnd; public bool dnd;
public bool cc_open; public bool cc_open;
public uint count; public uint count;
public bool inhibited; public bool inhibited;
} }
[DBus (name = "org.erikreider.swaync.cc")] [DBus (name = "ru.ximperlinux.shell.NotificationCenter")]
interface CcDaemon : Object { interface CcDaemon : Object {
public abstract bool reload_css () throws Error; public abstract bool reload_css () throws Error;
...@@ -37,7 +37,7 @@ interface CcDaemon : Object { ...@@ -37,7 +37,7 @@ interface CcDaemon : Object {
public abstract bool set_noti_window_monitor (string monitor) throws DBusError, IOError; public abstract bool set_noti_window_monitor (string monitor) throws DBusError, IOError;
[DBus (name = "GetSubscribeData")] [DBus (name = "GetSubscribeData")]
public abstract SwayncDaemonData get_subscribe_data () throws Error; public abstract XimperShellNotificationCenterDaemonData get_subscribe_data () throws Error;
public signal void subscribe_v2 (uint count, bool dnd, bool cc_open, bool inhibited); public signal void subscribe_v2 (uint count, bool dnd, bool cc_open, bool inhibited);
...@@ -79,7 +79,7 @@ private void print_help (string[] args) { ...@@ -79,7 +79,7 @@ private void print_help (string[] args) {
print (" -C, \t --close-all \t\t\t Closes all notifications\n"); print (" -C, \t --close-all \t\t\t Closes all notifications\n");
print (" -a, \t --action [ACTION_INDEX]\t " + print (" -a, \t --action [ACTION_INDEX]\t " +
"Invokes the action [ACTION_INDEX] of the latest notification\n"); "Invokes the action [ACTION_INDEX] of the latest notification\n");
print (" -sw, \t --skip-wait \t\t\t Doesn't wait when swaync hasn't been started\n"); print (" -sw, \t --skip-wait \t\t\t Doesn't wait when ximper-shell-notification-center hasn't been started\n");
print (" -s, \t --subscribe \t\t\t Subscribe to notification add and close events\n"); print (" -s, \t --subscribe \t\t\t Subscribe to notification add and close events\n");
print (" -swb, --subscribe-waybar \t\t Subscribe to notification add and close events " print (" -swb, --subscribe-waybar \t\t Subscribe to notification add and close events "
+ "with waybar support. Read README for example\n"); + "with waybar support. Read README for example\n");
...@@ -98,7 +98,7 @@ private void on_subscribe (uint count, bool dnd, bool cc_open, bool inhibited) { ...@@ -98,7 +98,7 @@ private void on_subscribe (uint count, bool dnd, bool cc_open, bool inhibited) {
private void print_subscribe () { private void print_subscribe () {
try { try {
SwayncDaemonData data = cc_daemon.get_subscribe_data (); XimperShellNotificationCenterDaemonData data = cc_daemon.get_subscribe_data ();
on_subscribe (data.count, data.dnd, data.cc_open, data.inhibited); on_subscribe (data.count, data.dnd, data.cc_open, data.inhibited);
} catch (Error e) { } catch (Error e) {
on_subscribe (0, false, false, false); on_subscribe (0, false, false, false);
...@@ -127,7 +127,7 @@ private void on_subscribe_waybar (uint count, bool dnd, bool cc_open, bool inhib ...@@ -127,7 +127,7 @@ private void on_subscribe_waybar (uint count, bool dnd, bool cc_open, bool inhib
private void print_subscribe_waybar () { private void print_subscribe_waybar () {
try { try {
SwayncDaemonData data = cc_daemon.get_subscribe_data (); XimperShellNotificationCenterDaemonData data = cc_daemon.get_subscribe_data ();
on_subscribe_waybar (data.count, data.dnd, data.cc_open, data.inhibited); on_subscribe_waybar (data.count, data.dnd, data.cc_open, data.inhibited);
} catch (Error e) { } catch (Error e) {
on_subscribe_waybar (0, false, false, false); on_subscribe_waybar (0, false, false, false);
...@@ -269,7 +269,7 @@ public int command_line (ref string[] args, bool skip_wait) { ...@@ -269,7 +269,7 @@ public int command_line (ref string[] args, bool skip_wait) {
var loop = new MainLoop (); var loop = new MainLoop ();
Bus.watch_name ( Bus.watch_name (
BusType.SESSION, BusType.SESSION,
"org.erikreider.swaync.cc", "ru.ximperlinux.shell.NotificationCenter",
BusNameWatcherFlags.NONE, BusNameWatcherFlags.NONE,
print_subscribe, print_subscribe,
print_subscribe); print_subscribe);
...@@ -281,7 +281,7 @@ public int command_line (ref string[] args, bool skip_wait) { ...@@ -281,7 +281,7 @@ public int command_line (ref string[] args, bool skip_wait) {
var loop = new MainLoop (); var loop = new MainLoop ();
Bus.watch_name ( Bus.watch_name (
BusType.SESSION, BusType.SESSION,
"org.erikreider.swaync.cc", "ru.ximperlinux.shell.NotificationCenter",
BusNameWatcherFlags.NONE, BusNameWatcherFlags.NONE,
print_subscribe_waybar, print_subscribe_waybar,
print_subscribe_waybar); print_subscribe_waybar);
...@@ -337,8 +337,8 @@ int try_connect (owned string[] args) { ...@@ -337,8 +337,8 @@ int try_connect (owned string[] args) {
try { try {
cc_daemon = Bus.get_proxy_sync ( cc_daemon = Bus.get_proxy_sync (
BusType.SESSION, BusType.SESSION,
"org.erikreider.swaync.cc", "ru.ximperlinux.shell.NotificationCenter",
"/org/erikreider/swaync/cc"); "/ru/ximperlinux/shell/NotificationCenter");
bool skip_wait = "--skip-wait" in args || "-sw" in args; bool skip_wait = "--skip-wait" in args || "-sw" in args;
bool one_arg = true; bool one_arg = true;
...@@ -373,7 +373,7 @@ public int main (string[] args) { ...@@ -373,7 +373,7 @@ public int main (string[] args) {
MainLoop loop = new MainLoop (); MainLoop loop = new MainLoop ();
Bus.watch_name ( Bus.watch_name (
BusType.SESSION, BusType.SESSION,
"org.erikreider.swaync.cc", "ru.ximperlinux.shell.NotificationCenter",
BusNameWatcherFlags.NONE, BusNameWatcherFlags.NONE,
(conn, name, name_owner) => { (conn, name, name_owner) => {
if (try_connect (args[1 :]) == 0) { if (try_connect (args[1 :]) == 0) {
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
"label": "直", "label": "直",
"type": "toggle", "type": "toggle",
"active": true, "active": true,
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'", "command": "sh -c '[[ $XSNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'",
"update-command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'" "update-command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'"
} }
] ]
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public enum PositionX { public enum PositionX {
RIGHT, LEFT, CENTER, NONE; RIGHT, LEFT, CENTER, NONE;
} }
...@@ -447,22 +447,22 @@ namespace SwayNotificationCenter { ...@@ -447,22 +447,22 @@ namespace SwayNotificationCenter {
public async bool run_script (NotifyParams param, out string msg) { public async bool run_script (NotifyParams param, out string msg) {
string[] spawn_env = {}; string[] spawn_env = {};
spawn_env += "SWAYNC_APP_NAME=%s".printf (param.app_name); spawn_env += "XSNC_APP_NAME=%s".printf (param.app_name);
spawn_env += "SWAYNC_SUMMARY=%s".printf (param.summary); spawn_env += "XSNC_SUMMARY=%s".printf (param.summary);
spawn_env += "SWAYNC_BODY=%s".printf (param.body); spawn_env += "XSNC_BODY=%s".printf (param.body);
spawn_env += "SWAYNC_URGENCY=%s".printf (param.urgency.to_string ()); spawn_env += "XSNC_URGENCY=%s".printf (param.urgency.to_string ());
spawn_env += "SWAYNC_CATEGORY=%s".printf (param.category); spawn_env += "XSNC_CATEGORY=%s".printf (param.category);
spawn_env += "SWAYNC_SOUND_NAME=%s".printf (param.sound_name); spawn_env += "XSNC_SOUND_NAME=%s".printf (param.sound_name);
spawn_env += "SWAYNC_SOUND_FILE=%s".printf (param.sound_file); spawn_env += "XSNC_SOUND_FILE=%s".printf (param.sound_file);
spawn_env += "SWAYNC_ID=%s".printf (param.applied_id.to_string ()); spawn_env += "XSNC_ID=%s".printf (param.applied_id.to_string ());
spawn_env += "SWAYNC_REPLACES_ID=%s".printf (param.replaces_id.to_string ()); spawn_env += "XSNC_REPLACES_ID=%s".printf (param.replaces_id.to_string ());
spawn_env += "SWAYNC_TIME=%s".printf (param.time.to_string ()); spawn_env += "XSNC_TIME=%s".printf (param.time.to_string ());
spawn_env += "SWAYNC_DESKTOP_ENTRY=%s".printf (param.desktop_entry ?? ""); spawn_env += "XSNC_DESKTOP_ENTRY=%s".printf (param.desktop_entry ?? "");
foreach (string hint in param.hints.get_keys ()) { foreach (string hint in param.hints.get_keys ()) {
if (hint.contains ("image") || hint.contains ("icon")) { if (hint.contains ("image") || hint.contains ("icon")) {
continue; continue;
} }
spawn_env += "SWAYNC_HINT_%s=%s".printf ( spawn_env += "XSNC_HINT_%s=%s".printf (
hint.up ().replace ("-", "_"), hint.up ().replace ("-", "_"),
param.hints[hint].print (false)); param.hints[hint].print (false));
} }
...@@ -1365,7 +1365,7 @@ namespace SwayNotificationCenter { ...@@ -1365,7 +1365,7 @@ namespace SwayNotificationCenter {
/** /**
* Writes and replaces settings with the new settings in `path`. If * Writes and replaces settings with the new settings in `path`. If
* `path` is "null", the default user accessible config will be used * `path` is "null", the default user accessible config will be used
* ("~/.config/swaync/config.json") * ("~/.config/ximper-shell/notification-center/config.json")
*/ */
private bool write_to_file (owned string ?path = null) { private bool write_to_file (owned string ?path = null) {
try { try {
...@@ -1374,7 +1374,7 @@ namespace SwayNotificationCenter { ...@@ -1374,7 +1374,7 @@ namespace SwayNotificationCenter {
string dir_path = Path.build_path ( string dir_path = Path.build_path (
Path.DIR_SEPARATOR.to_string (), Path.DIR_SEPARATOR.to_string (),
Environment.get_user_config_dir (), Environment.get_user_config_dir (),
"swaync"); "ximper-shell", "notification-center");
path = Path.build_path (Path.DIR_SEPARATOR.to_string (), path = Path.build_path (Path.DIR_SEPARATOR.to_string (),
dir_path, "config.json"); dir_path, "config.json");
var dir = File.new_for_path (dir_path); var dir = File.new_for_path (dir_path);
......
{ {
"$schema": "https://json-schema.org/draft/2020-12/schema", "$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "SwayNotificationCenter JSON schema", "title": "XimperShellNotificationCenter JSON schema",
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
}, },
"layer-shell": { "layer-shell": {
"type": "boolean", "type": "boolean",
"description": "Whether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply", "description": "Whether or not the windows should be opened as layer-shell surfaces. Note: Requires ximper-shell-notification-center restart to apply",
"default": true "default": true
}, },
"layer-shell-cover-screen": { "layer-shell-cover-screen": {
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
}, },
"id-matcher": { "id-matcher": {
"type": "string", "type": "string",
"description": "Matches the action identifier. Can be found by reading the output of swaync when run with the `G_MESSAGES_DEBUG=all` environment variable." "description": "Matches the action identifier. Can be found by reading the output of ximper-shell-notification-center when run with the `G_MESSAGES_DEBUG=all` environment variable."
}, },
"text-matcher": { "text-matcher": {
"type": "string", "type": "string",
...@@ -556,7 +556,7 @@ ...@@ -556,7 +556,7 @@
}, },
"type": { "type": {
"type": "string", "type": "string",
"description": "Type of the button; toggle buttons receive the .active css class and an env variable 'SWAYNC_TOGGLE_STATE' is set. See example in the default config.json", "description": "Type of the button; toggle buttons receive the .active css class and an env variable 'XSNC_TOGGLE_STATE' is set. See example in the default config.json",
"default": "normal", "default": "normal",
"enum": ["normal", "toggle"] "enum": ["normal", "toggle"]
}, },
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
[GtkTemplate (ui = "/org/erikreider/swaync/ui/control_center.ui")] [GtkTemplate (ui = "/ru/ximperlinux/shell/NotificationCenter/ui/control_center.ui")]
public class ControlCenter : Gtk.ApplicationWindow { public class ControlCenter : Gtk.ApplicationWindow {
[GtkChild] [GtkChild]
unowned Gtk.ScrolledWindow window; unowned Gtk.ScrolledWindow window;
...@@ -27,13 +27,13 @@ namespace SwayNotificationCenter { ...@@ -27,13 +27,13 @@ namespace SwayNotificationCenter {
if (app.use_layer_shell) { if (app.use_layer_shell) {
if (!GtkLayerShell.is_supported ()) { if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n"); stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n"); stderr.printf ("Ximper Shell Notification Center only works on Wayland!\n");
stderr.printf ("If running wayland session, try running:\n"); stderr.printf ("If running wayland session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n"); stderr.printf ("\tGDK_BACKEND=wayland ximper-shell-notification-center\n");
Process.exit (1); Process.exit (1);
} }
GtkLayerShell.init_for_window (this); GtkLayerShell.init_for_window (this);
GtkLayerShell.set_namespace (this, "swaync-control-center"); GtkLayerShell.set_namespace (this, "ximper-shell-notification-center");
set_anchor (); set_anchor ();
} }
...@@ -158,7 +158,7 @@ namespace SwayNotificationCenter { ...@@ -158,7 +158,7 @@ namespace SwayNotificationCenter {
switch (Gdk.keyval_name (keyval)) { switch (Gdk.keyval_name (keyval)) {
case "D": case "D":
try { try {
swaync_daemon.toggle_dnd (); ximper_shell_notification_center_daemon.toggle_dnd ();
} catch (Error e) { } catch (Error e) {
critical ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
...@@ -393,7 +393,7 @@ namespace SwayNotificationCenter { ...@@ -393,7 +393,7 @@ namespace SwayNotificationCenter {
} else { } else {
remove_css_class ("open"); remove_css_class ("open");
} }
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
} }
public inline bool get_visibility () { public inline bool get_visibility () {
......
using GLib; using GLib;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Backlight : BaseWidget { public class Backlight : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
class BacklightUtil { class BacklightUtil {
[DBus (name = "org.freedesktop.login1.Session")] [DBus (name = "org.freedesktop.login1.Session")]
interface Login1 : Object { interface Login1 : Object {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public struct DdcDisplayInfo { public struct DdcDisplayInfo {
int dispno; int dispno;
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public abstract class BaseWidget : Gtk.Box { public abstract class BaseWidget : Gtk.Box {
public abstract string widget_name { get; } public abstract string widget_name { get; }
......
using GLib; using GLib;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class ButtonsGrid : BaseWidget { public class ButtonsGrid : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Dnd : BaseWidget { public class Dnd : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public static BaseWidget ?get_widget_from_key (owned string key, out bool is_notifications) { public static BaseWidget ?get_widget_from_key (owned string key, out bool is_notifications) {
is_notifications = false; is_notifications = false;
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Inhibitors : BaseWidget { public class Inhibitors : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
...@@ -17,8 +17,8 @@ namespace SwayNotificationCenter.Widgets { ...@@ -17,8 +17,8 @@ namespace SwayNotificationCenter.Widgets {
public Inhibitors (string suffix) { public Inhibitors (string suffix) {
base (suffix); base (suffix);
swaync_daemon.inhibited_changed.connect ((length) => { ximper_shell_notification_center_daemon.inhibited_changed.connect ((length) => {
if (!swaync_daemon.inhibited) { if (!ximper_shell_notification_center_daemon.inhibited) {
hide (); hide ();
return; return;
} }
...@@ -57,7 +57,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -57,7 +57,7 @@ namespace SwayNotificationCenter.Widgets {
clear_all_button = new Gtk.Button.with_label (button_text); clear_all_button = new Gtk.Button.with_label (button_text);
clear_all_button.clicked.connect (() => { clear_all_button.clicked.connect (() => {
try { try {
swaync_daemon.clear_inhibitors (); ximper_shell_notification_center_daemon.clear_inhibitors ();
} catch (Error e) { } catch (Error e) {
critical ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Label : BaseWidget { public class Label : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
......
using GLib; using GLib;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public enum MenuType { public enum MenuType {
BUTTONS, BUTTONS,
MENU, MENU,
......
namespace SwayNotificationCenter.Widgets.Mpris { namespace XimperShellNotificationCenter.Widgets.Mpris {
public class MprisSource : Object { public class MprisSource : Object {
public MprisMediaPlayer media_player { private set; get; } public MprisMediaPlayer media_player { private set; get; }
private DbusPropChange props; private DbusPropChange props;
......
namespace SwayNotificationCenter.Widgets.Mpris { namespace XimperShellNotificationCenter.Widgets.Mpris {
public enum AlbumArtState { public enum AlbumArtState {
ALWAYS, WHEN_AVAILABLE, NEVER; ALWAYS, WHEN_AVAILABLE, NEVER;
......
namespace SwayNotificationCenter.Widgets.Mpris { namespace XimperShellNotificationCenter.Widgets.Mpris {
[GtkTemplate (ui = "/org/erikreider/swaync/ui/mpris_player.ui")] [GtkTemplate (ui = "/ru/ximperlinux/shell/NotificationCenter/ui/mpris_player.ui")]
public class MprisPlayer : Underlay { public class MprisPlayer : Underlay {
[GtkChild] [GtkChild]
public unowned Gtk.Label title; public unowned Gtk.Label title;
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
[GtkTemplate (ui = "/org/erikreider/swaync/ui/notifications_widget.ui")] [GtkTemplate (ui = "/ru/ximperlinux/shell/NotificationCenter/ui/notifications_widget.ui")]
public class Notifications : BaseWidget { public class Notifications : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
...@@ -322,7 +322,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -322,7 +322,7 @@ namespace SwayNotificationCenter.Widgets {
break; break;
case "D" : case "D" :
try { try {
swaync_daemon.toggle_dnd (); ximper_shell_notification_center_daemon.toggle_dnd ();
} catch (Error e) { } catch (Error e) {
critical ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
[DBus (name = "net.hadess.PowerProfiles")] [DBus (name = "net.hadess.PowerProfiles")]
interface PowerProfilesProxy : Object { interface PowerProfilesProxy : Object {
public abstract string active_profile { owned get; set; } public abstract string active_profile { owned get; set; }
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
class ToggleButton : Gtk.ToggleButton { class ToggleButton : Gtk.ToggleButton {
private string command; private string command;
private string update_command; private string update_command;
...@@ -20,7 +20,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -20,7 +20,7 @@ namespace SwayNotificationCenter.Widgets {
private async void on_toggle () { private async void on_toggle () {
string msg = ""; string msg = "";
string[] env_additions = { "SWAYNC_TOGGLE_STATE=" + this.active.to_string () }; string[] env_additions = { "XSNC_TOGGLE_STATE=" + this.active.to_string () };
yield Functions.execute_command (this.command, env_additions, out msg); yield Functions.execute_command (this.command, env_additions, out msg);
} }
...@@ -29,7 +29,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -29,7 +29,7 @@ namespace SwayNotificationCenter.Widgets {
return; return;
} }
string msg = ""; string msg = "";
string[] env_additions = { "SWAYNC_TOGGLE_STATE=" + this.active.to_string () }; string[] env_additions = { "XSNC_TOGGLE_STATE=" + this.active.to_string () };
yield Functions.execute_command (this.update_command, env_additions, out msg); yield Functions.execute_command (this.update_command, env_additions, out msg);
try { try {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Slider : BaseWidget { public class Slider : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Title : BaseWidget { public class Title : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
...@@ -50,7 +50,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -50,7 +50,7 @@ namespace SwayNotificationCenter.Widgets {
}); });
clear_all_button.set_sensitive (!notifications_widget.is_empty ()); clear_all_button.set_sensitive (!notifications_widget.is_empty ());
swaync_daemon.subscribe_v2.connect ((count) => { ximper_shell_notification_center_daemon.subscribe_v2.connect ((count) => {
clear_all_button.set_sensitive (count > 0); clear_all_button.set_sensitive (count > 0);
}); });
clear_all_button.set_can_focus (false); clear_all_button.set_can_focus (false);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using Gee; using Gee;
using PulseAudio; using PulseAudio;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
/** /**
* Loosely based off of Elementary OS switchboard-plug-sound * Loosely based off of Elementary OS switchboard-plug-sound
* https://github.com/elementary/switchboard-plug-sound * https://github.com/elementary/switchboard-plug-sound
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using Gee; using Gee;
using PulseAudio; using PulseAudio;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class PulseCardProfile : Object { public class PulseCardProfile : Object {
public string name; public string name;
public string description; public string description;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using Gee; using Gee;
using PulseAudio; using PulseAudio;
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class PulseSinkInput : Object { public class PulseSinkInput : Object {
/** The card index: ex. `Sink Input #227` */ /** The card index: ex. `Sink Input #227` */
public uint32 index; public uint32 index;
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class SinkInputRow : Gtk.ListBoxRow { public class SinkInputRow : Gtk.ListBoxRow {
Gtk.Box container; Gtk.Box container;
Gtk.Image icon = new Gtk.Image (); Gtk.Image icon = new Gtk.Image ();
......
namespace SwayNotificationCenter.Widgets { namespace XimperShellNotificationCenter.Widgets {
public class Volume : BaseWidget { public class Volume : BaseWidget {
public override string widget_name { public override string widget_name {
get { get {
...@@ -179,13 +179,13 @@ namespace SwayNotificationCenter.Widgets { ...@@ -179,13 +179,13 @@ namespace SwayNotificationCenter.Widgets {
private void set_button_icon () { private void set_button_icon () {
if (!reveal_button.active) { if (!reveal_button.active) {
if (expand_label == null) { if (expand_label == null) {
reveal_button.set_icon_name ("swaync-up-small-symbolic"); reveal_button.set_icon_name ("ximper-shell-notification-center-up-small-symbolic");
} else { } else {
reveal_button.set_label (expand_label); reveal_button.set_label (expand_label);
} }
} else { } else {
if (collapse_label == null) { if (collapse_label == null) {
reveal_button.set_icon_name ("swaync-down-small-symbolic"); reveal_button.set_icon_name ("ximper-shell-notification-center-down-small-symbolic");
} else { } else {
reveal_button.set_label (collapse_label); reveal_button.set_label (collapse_label);
} }
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public class Functions { public class Functions {
const Gsk.ScalingFilter SCALING_FILTER = Gsk.ScalingFilter.NEAREST; const Gsk.ScalingFilter SCALING_FILTER = Gsk.ScalingFilter.NEAREST;
...@@ -13,7 +13,7 @@ namespace SwayNotificationCenter { ...@@ -13,7 +13,7 @@ namespace SwayNotificationCenter {
// Init resources // Init resources
var theme = Gtk.IconTheme.get_for_display (Gdk.Display.get_default ()); var theme = Gtk.IconTheme.get_for_display (Gdk.Display.get_default ());
theme.add_resource_path ("/org/erikreider/swaync/icons"); theme.add_resource_path ("/ru/ximperlinux/shell/NotificationCenter/icons");
} }
public static string uri_to_path (owned string uri) { public static string uri_to_path (owned string uri) {
...@@ -137,15 +137,15 @@ namespace SwayNotificationCenter { ...@@ -137,15 +137,15 @@ namespace SwayNotificationCenter {
if (!only_system) { if (!only_system) {
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
Environment.get_user_config_dir (), Environment.get_user_config_dir (),
"swaync/style.css"); "ximper-shell/notification-center/style.css");
} }
foreach (var path in Environment.get_system_config_dirs ()) { foreach (var path in Environment.get_system_config_dirs ()) {
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
path, "swaync/style.css"); path, "ximper-shell/notification-center/style.css");
} }
// Fallback location. Specified in postinstall.py. Mostly for Debian // Fallback location. Specified in postinstall.py. Mostly for Debian
paths += "/usr/local/etc/xdg/swaync/style.css"; paths += "/usr/local/etc/xdg/ximper-shell/notification-center/style.css";
info ("Looking for CSS file in these directories:\n\t- %s", info ("Looking for CSS file in these directories:\n\t- %s",
string.joinv ("\n\t- ", paths)); string.joinv ("\n\t- ", paths));
...@@ -181,13 +181,13 @@ namespace SwayNotificationCenter { ...@@ -181,13 +181,13 @@ namespace SwayNotificationCenter {
} }
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
Environment.get_user_config_dir (), Environment.get_user_config_dir (),
"swaync/config.json"); "ximper-shell/notification-center/config.json");
foreach (var path in Environment.get_system_config_dirs ()) { foreach (var path in Environment.get_system_config_dirs ()) {
paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), paths += Path.build_path (Path.DIR_SEPARATOR.to_string (),
path, "swaync/config.json"); path, "ximper-shell/notification-center/config.json");
} }
// Fallback location. Specified in postinstall.py. Mostly for Debian // Fallback location. Specified in postinstall.py. Mostly for Debian
paths += "/usr/local/etc/xdg/swaync/config.json"; paths += "/usr/local/etc/xdg/ximper-shell/notification-center/config.json";
info ("Looking for config file in these directories:\n\t- %s", info ("Looking for config file in these directories:\n\t- %s",
string.joinv ("\n\t- ", paths)); string.joinv ("\n\t- ", paths));
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
static NotiDaemon noti_daemon; static NotiDaemon noti_daemon;
static SwayncDaemon swaync_daemon; static XimperShellNotificationCenterDaemon ximper_shell_notification_center_daemon;
static Widgets.Notifications notifications_widget; static Widgets.Notifications notifications_widget;
static ControlCenter control_center; static ControlCenter control_center;
static NotificationWindow floating_notifications; static NotificationWindow floating_notifications;
static unowned ListModel ?monitors = null; static unowned ListModel ?monitors = null;
static Swaync app; static NotificationCenter app;
static Settings self_settings; static Settings self_settings;
static HashTable<string, unowned Gdk.PixbufFormat> pixbuf_mime_types; static HashTable<string, unowned Gdk.PixbufFormat> pixbuf_mime_types;
...@@ -30,11 +30,11 @@ namespace SwayNotificationCenter { ...@@ -30,11 +30,11 @@ namespace SwayNotificationCenter {
} }
} }
public class Swaync : Gtk.Application { public class NotificationCenter : Gtk.Application {
private bool activated = false; private bool activated = false;
private Array<BlankWindow> blank_windows = new Array<BlankWindow> (); private Array<BlankWindow> blank_windows = new Array<BlankWindow> ();
// Only set on swaync start due to some limitations of GtkLayerShell // Only set on start due to some limitations of GtkLayerShell
public bool use_layer_shell = true; public bool use_layer_shell = true;
public bool has_layer_on_demand = true; public bool has_layer_on_demand = true;
...@@ -42,9 +42,9 @@ namespace SwayNotificationCenter { ...@@ -42,9 +42,9 @@ namespace SwayNotificationCenter {
public signal void config_reload (ConfigModel ?old_config, ConfigModel new_config); public signal void config_reload (ConfigModel ?old_config, ConfigModel new_config);
public Swaync (bool replace) { public NotificationCenter (bool replace) {
Object ( Object (
application_id : "org.erikreider.swaync", application_id : "ru.ximperlinux.shell.NotificationCenter",
flags: ApplicationFlags.DEFAULT_FLAGS flags: ApplicationFlags.DEFAULT_FLAGS
| ApplicationFlags.ALLOW_REPLACEMENT | ApplicationFlags.ALLOW_REPLACEMENT
| (replace ? ApplicationFlags.REPLACE : 0) | (replace ? ApplicationFlags.REPLACE : 0)
...@@ -53,7 +53,7 @@ namespace SwayNotificationCenter { ...@@ -53,7 +53,7 @@ namespace SwayNotificationCenter {
try { try {
register (); register ();
if (get_is_remote ()) { if (get_is_remote ()) {
printerr ("An instance of SwayNotificationCenter is already running!\n"); printerr ("An instance of Ximper Shell Notification Center is already running!\n");
Process.exit (1); Process.exit (1);
} }
} catch (Error e) { } catch (Error e) {
...@@ -103,7 +103,7 @@ namespace SwayNotificationCenter { ...@@ -103,7 +103,7 @@ namespace SwayNotificationCenter {
} }
noti_daemon = new NotiDaemon (); noti_daemon = new NotiDaemon ();
swaync_daemon = new SwayncDaemon (); ximper_shell_notification_center_daemon = new XimperShellNotificationCenterDaemon ();
// Notification Daemon // Notification Daemon
Bus.own_name_on_connection (conn, Bus.own_name_on_connection (conn,
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
...@@ -125,20 +125,20 @@ namespace SwayNotificationCenter { ...@@ -125,20 +125,20 @@ namespace SwayNotificationCenter {
}); });
yield; yield;
// Swaync Daemon // Ximper Shell Notification Center Daemon
Bus.own_name_on_connection (conn, Bus.own_name_on_connection (conn,
"org.erikreider.swaync.cc", "ru.ximperlinux.shell.NotificationCenter",
BusNameOwnerFlags.NONE, BusNameOwnerFlags.NONE,
() => { () => {
try { try {
conn.register_object ("/org/erikreider/swaync/cc", swaync_daemon); conn.register_object ("/ru/ximperlinux/shell/NotificationCenter", ximper_shell_notification_center_daemon);
init.callback (); init.callback ();
} catch (Error e) { } catch (Error e) {
error ("Could not register CC service: \"%s\"", e.message); error ("Could not register CC service: \"%s\"", e.message);
} }
}, },
() => { () => {
error ("Could not acquire swaync name!"); error ("Could not acquire Ximper Shell Notification Center name!");
}); });
yield; yield;
...@@ -159,10 +159,10 @@ namespace SwayNotificationCenter { ...@@ -159,10 +159,10 @@ namespace SwayNotificationCenter {
}); });
} }
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
}); });
// Update on start // Update on start
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
monitors.items_changed.connect (monitors_changed); monitors.items_changed.connect (monitors_changed);
Idle.add_once (() => monitors_changed (0, 0, monitors.get_n_items ())); Idle.add_once (() => monitors_changed (0, 0, monitors.get_n_items ()));
...@@ -189,9 +189,9 @@ namespace SwayNotificationCenter { ...@@ -189,9 +189,9 @@ namespace SwayNotificationCenter {
// Set preferred output // Set preferred output
try { try {
swaync_daemon.set_cc_monitor ( ximper_shell_notification_center_daemon.set_cc_monitor (
ConfigModel.instance.control_center_preferred_output); ConfigModel.instance.control_center_preferred_output);
swaync_daemon.set_noti_window_monitor ( ximper_shell_notification_center_daemon.set_noti_window_monitor (
ConfigModel.instance.notification_window_preferred_output); ConfigModel.instance.notification_window_preferred_output);
} catch (Error e) { } catch (Error e) {
critical (e.message); critical (e.message);
...@@ -287,14 +287,14 @@ namespace SwayNotificationCenter { ...@@ -287,14 +287,14 @@ namespace SwayNotificationCenter {
Adw.init (); Adw.init ();
Functions.init (); Functions.init ();
self_settings = new Settings ("org.erikreider.swaync"); self_settings = new Settings ("ru.ximperlinux.shell.NotificationCenter");
app = new Swaync (replace); app = new NotificationCenter (replace);
return app.run (); return app.run ();
} }
private static void print_startup_info () { private static void print_startup_info () {
print ("Starting SwayNotificationCenter version %s\n", Constants.VERSION); print ("Starting Ximper Shell Notification Center version %s\n", Constants.VERSION);
// Log distro information // Log distro information
string info_paths[5] = { string info_paths[5] = {
......
...@@ -12,7 +12,7 @@ if git.found() ...@@ -12,7 +12,7 @@ if git.found()
) )
endif endif
endif endif
version = 'swaync @0@'.format(version) version = 'ximper-shell-notification-center @0@'.format(version)
const_config_data = configuration_data() const_config_data = configuration_data()
const_config_data.set_quoted('VERSION', version) const_config_data.set_quoted('VERSION', version)
const_config_data.set_quoted('VERSION_NUM', meson.project_version()) const_config_data.set_quoted('VERSION_NUM', meson.project_version())
...@@ -63,7 +63,7 @@ app_sources = [ ...@@ -63,7 +63,7 @@ app_sources = [
'iterHelpers/iterListBoxController.vala', 'iterHelpers/iterListBoxController.vala',
'underlay/underlay.vala', 'underlay/underlay.vala',
'configModel/configModel.vala', 'configModel/configModel.vala',
'swayncDaemon/swayncDaemon.vala', 'ximperShellNotificationCenterDaemon/ximperShellNotificationCenterDaemon.vala',
'notiDaemon/notiDaemon.vala', 'notiDaemon/notiDaemon.vala',
'notiModel/notiModel.vala', 'notiModel/notiModel.vala',
'notificationWindow/notificationWindow.vala', 'notificationWindow/notificationWindow.vala',
...@@ -137,14 +137,14 @@ args = [ ...@@ -137,14 +137,14 @@ args = [
'--target-glib=2.82', '--target-glib=2.82',
] ]
executable('swaync', executable('ximper-shell-notification-center',
[ app_sources, app_resources ], [ app_sources, app_resources ],
vala_args: args, vala_args: args,
dependencies: app_deps, dependencies: app_deps,
install: true, install: true,
) )
executable('swaync-client', executable('ximper-shell-notification-center-client',
['client.vala', constants], ['client.vala', constants],
vala_args: args, vala_args: args,
dependencies: app_deps, dependencies: app_deps,
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
/** Return true to remove notification, false to skip */ /** Return true to remove notification, false to skip */
public delegate bool notification_filter_func (Notification notification); public delegate bool notification_filter_func (Notification notification);
...@@ -46,7 +46,7 @@ namespace SwayNotificationCenter { ...@@ -46,7 +46,7 @@ namespace SwayNotificationCenter {
notifications_widget.remove_notification (id); notifications_widget.remove_notification (id);
floating_notifications.remove_notification (id); floating_notifications.remove_notification (id);
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
} }
internal inline void request_dismiss_notification (NotifyParams param, internal inline void request_dismiss_notification (NotifyParams param,
...@@ -66,7 +66,7 @@ namespace SwayNotificationCenter { ...@@ -66,7 +66,7 @@ namespace SwayNotificationCenter {
} }
notifications_widget.remove_group (group_name_id); notifications_widget.remove_group (group_name_id);
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
} }
internal void request_dismiss_all_notifications (ClosedReasons reason) { internal void request_dismiss_all_notifications (ClosedReasons reason) {
...@@ -79,7 +79,7 @@ namespace SwayNotificationCenter { ...@@ -79,7 +79,7 @@ namespace SwayNotificationCenter {
remove_all_floating_notifications (false, null); remove_all_floating_notifications (false, null);
notifications_widget.remove_all_notifications (true); notifications_widget.remove_all_notifications (true);
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
} }
/** Hides all floating notifications (closes transient) */ /** Hides all floating notifications (closes transient) */
...@@ -221,8 +221,8 @@ namespace SwayNotificationCenter { ...@@ -221,8 +221,8 @@ namespace SwayNotificationCenter {
hide_floating_notification_reasons += "Control Center is visible"; hide_floating_notification_reasons += "Control Center is visible";
} }
// Don't show the notification window if dnd or inhibited // Don't show the notification window if dnd or inhibited
bool bypass_dnd = param.urgency == UrgencyLevels.CRITICAL || param.swaync_bypass_dnd; bool bypass_dnd = param.urgency == UrgencyLevels.CRITICAL || param.ximper_shell_notification_center_bypass_dnd;
if (!bypass_dnd && (dnd || swaync_daemon.inhibited)) { if (!bypass_dnd && (dnd || ximper_shell_notification_center_daemon.inhibited)) {
hide_floating_notification_reasons += hide_floating_notification_reasons +=
"Do Not Disturb is enabled or an Inhibitor is running"; "Do Not Disturb is enabled or an Inhibitor is running";
} }
...@@ -286,11 +286,11 @@ namespace SwayNotificationCenter { ...@@ -286,11 +286,11 @@ namespace SwayNotificationCenter {
notification_ids.add (id); notification_ids.add (id);
} }
swaync_daemon.emit_subscribe (); ximper_shell_notification_center_daemon.emit_subscribe ();
} }
#if WANT_SCRIPTING #if WANT_SCRIPTING
if (param.swaync_no_script) { if (param.ximper_shell_notification_center_no_script) {
debug ("Skipped scripts for this notification\n"); debug ("Skipped scripts for this notification\n");
return id; return id;
} }
...@@ -310,7 +310,7 @@ namespace SwayNotificationCenter { ...@@ -310,7 +310,7 @@ namespace SwayNotificationCenter {
*/ */
internal void run_scripts (NotifyParams param, ScriptRunOnType run_on) { internal void run_scripts (NotifyParams param, ScriptRunOnType run_on) {
#if WANT_SCRIPTING #if WANT_SCRIPTING
if (param.swaync_no_script) { if (param.ximper_shell_notification_center_no_script) {
debug ("Skipped action scripts for this notification\n"); debug ("Skipped action scripts for this notification\n");
return; return;
} }
...@@ -346,13 +346,13 @@ namespace SwayNotificationCenter { ...@@ -346,13 +346,13 @@ namespace SwayNotificationCenter {
str_hash, str_hash,
str_equal); str_equal);
// Disable scripts for this notification // Disable scripts for this notification
_hints.insert ("SWAYNC_NO_SCRIPT", true); _hints.insert ("XSNC_NO_SCRIPT", true);
_hints.insert ("urgency", _hints.insert ("urgency",
UrgencyLevels.CRITICAL.to_byte ()); UrgencyLevels.CRITICAL.to_byte ());
string _summary = "Failed to run script: %s".printf (key); string _summary = "Failed to run script: %s".printf (key);
string _body = "<b>Output:</b> " + error_msg; string _body = "<b>Output:</b> " + error_msg;
this.new_notification ("SwayNotificationCenter", this.new_notification ("XimperShellNotificationCenter",
0, 0,
"dialog-error", "dialog-error",
_summary, _summary,
...@@ -397,8 +397,8 @@ namespace SwayNotificationCenter { ...@@ -397,8 +397,8 @@ namespace SwayNotificationCenter {
out string version, out string version,
out string spec_version) out string spec_version)
throws DBusError, IOError { throws DBusError, IOError {
name = "SwayNotificationCenter"; name = "XimperShellNotificationCenter";
vendor = "ErikReider"; vendor = "XimperLinux";
version = Constants.VERSIONNUM; version = Constants.VERSIONNUM;
spec_version = "1.3"; spec_version = "1.3";
} }
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public enum ClosedReasons { public enum ClosedReasons {
EXPIRED = 1, EXPIRED = 1,
DISMISSED = 2, DISMISSED = 2,
...@@ -153,10 +153,10 @@ namespace SwayNotificationCenter { ...@@ -153,10 +153,10 @@ namespace SwayNotificationCenter {
// Custom hints // Custom hints
/** Disables scripting for notification */ /** Disables scripting for notification */
public bool swaync_no_script { get; private set; } public bool ximper_shell_notification_center_no_script { get; private set; }
/** Always show the notification, regardless of dnd/inhibit state */ /** Always show the notification, regardless of dnd/inhibit state */
public bool swaync_bypass_dnd { get; private set; } public bool ximper_shell_notification_center_bypass_dnd { get; private set; }
public Array<Action> actions { get; private set; } public Array<Action> actions { get; private set; }
...@@ -247,18 +247,18 @@ namespace SwayNotificationCenter { ...@@ -247,18 +247,18 @@ namespace SwayNotificationCenter {
foreach (var hint in hints.get_keys ()) { foreach (var hint in hints.get_keys ()) {
Variant hint_value = hints[hint]; Variant hint_value = hints[hint];
switch (hint) { switch (hint) {
case "SWAYNC_NO_SCRIPT" : case "XSNC_NO_SCRIPT" :
if (hint_value.is_of_type (VariantType.INT32)) { if (hint_value.is_of_type (VariantType.INT32)) {
swaync_no_script = hint_value.get_int32 () == 1; ximper_shell_notification_center_no_script = hint_value.get_int32 () == 1;
} else if (hint_value.is_of_type (VariantType.BOOLEAN)) { } else if (hint_value.is_of_type (VariantType.BOOLEAN)) {
swaync_no_script = hint_value.get_boolean (); ximper_shell_notification_center_no_script = hint_value.get_boolean ();
} }
break; break;
case "SWAYNC_BYPASS_DND" : case "XSNC_BYPASS_DND" :
if (hint_value.is_of_type (VariantType.INT32)) { if (hint_value.is_of_type (VariantType.INT32)) {
swaync_bypass_dnd = hint_value.get_int32 () == 1; ximper_shell_notification_center_bypass_dnd = hint_value.get_int32 () == 1;
} else if (hint_value.is_of_type (VariantType.BOOLEAN)) { } else if (hint_value.is_of_type (VariantType.BOOLEAN)) {
swaync_bypass_dnd = hint_value.get_boolean (); ximper_shell_notification_center_bypass_dnd = hint_value.get_boolean ();
} }
break; break;
case "value" : case "value" :
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public enum NotificationType { CONTROL_CENTER, FLOATING } public enum NotificationType { CONTROL_CENTER, FLOATING }
[GtkTemplate (ui = "/org/erikreider/swaync/ui/notification.ui")] [GtkTemplate (ui = "/ru/ximperlinux/shell/NotificationCenter/ui/notification.ui")]
public class Notification : Adw.Bin { public class Notification : Adw.Bin {
[GtkChild] [GtkChild]
unowned Gtk.Revealer revealer; unowned Gtk.Revealer revealer;
...@@ -473,7 +473,7 @@ namespace SwayNotificationCenter { ...@@ -473,7 +473,7 @@ namespace SwayNotificationCenter {
noti_daemon.ActionInvoked (param.applied_id, action.identifier); noti_daemon.ActionInvoked (param.applied_id, action.identifier);
if (ConfigModel.instance.hide_on_action) { if (ConfigModel.instance.hide_on_action) {
try { try {
swaync_daemon.set_visibility (false); ximper_shell_notification_center_daemon.set_visibility (false);
} catch (Error e) { } catch (Error e) {
critical ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public class NotificationCloseButton : Adw.Bin { public class NotificationCloseButton : Adw.Bin {
Gtk.Revealer revealer; Gtk.Revealer revealer;
Gtk.Button button; Gtk.Button button;
...@@ -17,7 +17,7 @@ namespace SwayNotificationCenter { ...@@ -17,7 +17,7 @@ namespace SwayNotificationCenter {
}); });
set_child (revealer); set_child (revealer);
button = new Gtk.Button.from_icon_name ("swaync-close-symbolic") { button = new Gtk.Button.from_icon_name ("ximper-shell-notification-center-close-symbolic") {
has_frame = false, has_frame = false,
halign = Gtk.Align.CENTER, halign = Gtk.Align.CENTER,
valign = Gtk.Align.CENTER, valign = Gtk.Align.CENTER,
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
private class ExpandableGroup : Gtk.Widget { private class ExpandableGroup : Gtk.Widget {
const int NUM_STACKED_NOTIFICATIONS = 3; const int NUM_STACKED_NOTIFICATIONS = 3;
const int COLLAPSED_NOTIFICATION_OFFSET = 8; const int COLLAPSED_NOTIFICATION_OFFSET = 8;
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public enum NotificationGroupState { public enum NotificationGroupState {
EMPTY = 0, EMPTY = 0,
SINLGE = 1, SINLGE = 1,
...@@ -85,7 +85,7 @@ namespace SwayNotificationCenter { ...@@ -85,7 +85,7 @@ namespace SwayNotificationCenter {
// Collapse button // Collapse button
Gtk.Button collapse_button = new Gtk.Button.from_icon_name ( Gtk.Button collapse_button = new Gtk.Button.from_icon_name (
"swaync-collapse-symbolic"); "ximper-shell-notification-center-collapse-symbolic");
collapse_button.add_css_class ("circular"); collapse_button.add_css_class ("circular");
collapse_button.add_css_class ("notification-group-collapse-button"); collapse_button.add_css_class ("notification-group-collapse-button");
collapse_button.set_halign (Gtk.Align.END); collapse_button.set_halign (Gtk.Align.END);
...@@ -98,7 +98,7 @@ namespace SwayNotificationCenter { ...@@ -98,7 +98,7 @@ namespace SwayNotificationCenter {
// Close all button // Close all button
Gtk.Button close_all_button = new Gtk.Button.from_icon_name ( Gtk.Button close_all_button = new Gtk.Button.from_icon_name (
"swaync-close-symbolic"); "ximper-shell-notification-center-close-symbolic");
close_all_button.add_css_class ("circular"); close_all_button.add_css_class ("circular");
close_all_button.add_css_class ("notification-group-close-all-button"); close_all_button.add_css_class ("notification-group-close-all-button");
close_all_button.set_halign (Gtk.Align.END); close_all_button.set_halign (Gtk.Align.END);
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
[GtkTemplate (ui = "/org/erikreider/swaync/ui/notification_window.ui")] [GtkTemplate (ui = "/ru/ximperlinux/shell/NotificationCenter/ui/notification_window.ui")]
public class NotificationWindow : Gtk.ApplicationWindow { public class NotificationWindow : Gtk.ApplicationWindow {
[GtkChild] [GtkChild]
unowned Gtk.ScrolledWindow scrolled_window; unowned Gtk.ScrolledWindow scrolled_window;
...@@ -19,13 +19,13 @@ namespace SwayNotificationCenter { ...@@ -19,13 +19,13 @@ namespace SwayNotificationCenter {
if (app.use_layer_shell) { if (app.use_layer_shell) {
if (!GtkLayerShell.is_supported ()) { if (!GtkLayerShell.is_supported ()) {
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n"); stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
stderr.printf ("Swaync only works on Wayland!\n"); stderr.printf ("Ximper Shell Notification Center only works on Wayland!\n");
stderr.printf ("If running waylans session, try running:\n"); stderr.printf ("If running waylans session, try running:\n");
stderr.printf ("\tGDK_BACKEND=wayland swaync\n"); stderr.printf ("\tGDK_BACKEND=wayland ximper-shell-notification-center\n");
Process.exit (1); Process.exit (1);
} }
GtkLayerShell.init_for_window (this); GtkLayerShell.init_for_window (this);
GtkLayerShell.set_namespace (this, "swaync-notification-window"); GtkLayerShell.set_namespace (this, "ximper-shell-notification-window");
} }
this.set_anchor (); this.set_anchor ();
...@@ -166,11 +166,11 @@ namespace SwayNotificationCenter { ...@@ -166,11 +166,11 @@ namespace SwayNotificationCenter {
} }
switch (ConfigModel.instance.positionY) { switch (ConfigModel.instance.positionY) {
default: default:
case SwayNotificationCenter.PositionY.TOP: case XimperShellNotificationCenter.PositionY.TOP:
case SwayNotificationCenter.PositionY.CENTER: case XimperShellNotificationCenter.PositionY.CENTER:
list.direction = AnimatedListDirection.TOP_TO_BOTTOM; list.direction = AnimatedListDirection.TOP_TO_BOTTOM;
break; break;
case SwayNotificationCenter.PositionY.BOTTOM: case XimperShellNotificationCenter.PositionY.BOTTOM:
list.direction = AnimatedListDirection.BOTTOM_TO_TOP; list.direction = AnimatedListDirection.BOTTOM_TO_TOP;
break; break;
} }
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
/** A regular GLib HashTable but preserves the order of inserted keys and values */ /** A regular GLib HashTable but preserves the order of inserted keys and values */
public class OrderedHashTable<T> { public class OrderedHashTable<T> {
private HashTable<string, T> hash_table; private HashTable<string, T> hash_table;
......
using SwayNotificationCenter; using XimperShellNotificationCenter;
using XDG.Activation; using XDG.Activation;
public class XdgActivationHelper : Object { public class XdgActivationHelper : Object {
......
namespace SwayNotificationCenter { namespace XimperShellNotificationCenter {
public struct Data { public struct Data {
public bool dnd; public bool dnd;
public bool cc_open; public bool cc_open;
...@@ -6,13 +6,13 @@ namespace SwayNotificationCenter { ...@@ -6,13 +6,13 @@ namespace SwayNotificationCenter {
public bool inhibited; public bool inhibited;
} }
[DBus (name = "org.erikreider.swaync.cc")] [DBus (name = "ru.ximperlinux.shell.NotificationCenter")]
public class SwayncDaemon : Object { public class XimperShellNotificationCenterDaemon : Object {
private GenericSet<string> inhibitors = new GenericSet<string> (str_hash, str_equal); private GenericSet<string> inhibitors = new GenericSet<string> (str_hash, str_equal);
public bool inhibited { get; private set; default = false; } public bool inhibited { get; private set; default = false; }
internal signal void inhibited_changed (uint length); internal signal void inhibited_changed (uint length);
public SwayncDaemon () { public XimperShellNotificationCenterDaemon () {
subscribe_v2.connect ((count, dnd, visible, inhibited) => { subscribe_v2.connect ((count, dnd, visible, inhibited) => {
debug ("Emitted subscribe_v2: %u, %s, %s, %s", debug ("Emitted subscribe_v2: %u, %s, %s, %s",
count, dnd.to_string (), visible.to_string (), inhibited.to_string ()); count, dnd.to_string (), visible.to_string (), inhibited.to_string ());
...@@ -21,7 +21,7 @@ namespace SwayNotificationCenter { ...@@ -21,7 +21,7 @@ namespace SwayNotificationCenter {
internal inline void emit_subscribe () { internal inline void emit_subscribe () {
try { try {
swaync_daemon.subscribe_v2 (noti_daemon.n_notifications, ximper_shell_notification_center_daemon.subscribe_v2 (noti_daemon.n_notifications,
get_dnd (), get_dnd (),
get_visibility (), get_visibility (),
inhibited); inhibited);
...@@ -51,7 +51,7 @@ namespace SwayNotificationCenter { ...@@ -51,7 +51,7 @@ namespace SwayNotificationCenter {
* Called when Dot Not Disturb state changes, notification gets * Called when Dot Not Disturb state changes, notification gets
* added/removed, Control Center opens, and when inhibitor state changes * added/removed, Control Center opens, and when inhibitor state changes
*/ */
[Version (deprecated = true, replacement = "SwayncDaemon.subscribe_v2")] [Version (deprecated = true, replacement = "XimperShellNotificationCenterDaemon.subscribe_v2")]
public signal void subscribe (uint count, bool dnd, bool cc_open); public signal void subscribe (uint count, bool dnd, bool cc_open);
/** Reloads the CSS file */ /** Reloads the CSS file */
...@@ -72,7 +72,7 @@ namespace SwayNotificationCenter { ...@@ -72,7 +72,7 @@ namespace SwayNotificationCenter {
* Changes `name` to `value`. * Changes `name` to `value`.
* *
* If `write_to_file` is True, it will write to the users * If `write_to_file` is True, it will write to the users
* config file (`~/.config/swaync/config.json`) or `path` * config file (`~/.config/ximper-shell/notification-center/config.json`) or `path`
* if it's a valid path. Otherwise the changes will only * if it's a valid path. Otherwise the changes will only
* apply to the current instance. * apply to the current instance.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment