pax_global_header00006660000000000000000000000064151026133530014511gustar00rootroot0000000000000052 comment=f26aeae20d3bc6d3fae352bc7b5641f78098ea3a SwayNotificationCenter-0.12.3/000077500000000000000000000000001510261335300162275ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/.clang-format000066400000000000000000000001411510261335300205760ustar00rootroot00000000000000UseTab: Always IndentWidth: 4 TabWidth: 4 ColumnLimit: 80 AllowShortFunctionsOnASingleLine: None SwayNotificationCenter-0.12.3/.editorconfig000066400000000000000000000004431510261335300207050ustar00rootroot00000000000000root = true # elementary defaults [*] charset = utf-8 end_of_line = lf indent_size = tab indent_style = space insert_final_newline = true max_line_length = 100 tab_width = 4 # Markup files [{*.html,*.xml,*.xml.in,*.yml}] tab_width = 2 # Man pages [*.scd] indent_style = tab tab_width = 4 SwayNotificationCenter-0.12.3/.github/000077500000000000000000000000001510261335300175675ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/.github/FUNDING.yml000066400000000000000000000016461510261335300214130ustar00rootroot00000000000000# 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'] SwayNotificationCenter-0.12.3/.github/ISSUE_TEMPLATE/000077500000000000000000000000001510261335300217525ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000022421510261335300244440ustar00rootroot00000000000000--- 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** **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.0] **Additional context** Add any other context about the problem here. SwayNotificationCenter-0.12.3/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000013671510261335300255060ustar00rootroot00000000000000--- 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. SwayNotificationCenter-0.12.3/.github/workflows/000077500000000000000000000000001510261335300216245ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/.github/workflows/PKGBUILD-build.yml000066400000000000000000000030171510261335300246460ustar00rootroot00000000000000# 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" SwayNotificationCenter-0.12.3/.github/workflows/fedora-build.yml000066400000000000000000000027641510261335300247150ustar00rootroot00000000000000name: 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 SwayNotificationCenter-0.12.3/.github/workflows/fedora-copr.yml000066400000000000000000000031621510261335300245520ustar00rootroot00000000000000name: 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 }} SwayNotificationCenter-0.12.3/.github/workflows/linting.yml000066400000000000000000000035701510261335300240200ustar00rootroot00000000000000# 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 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 SwayNotificationCenter-0.12.3/.github/workflows/ubuntu-build.yml000066400000000000000000000020221510261335300247620ustar00rootroot00000000000000# 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 SwayNotificationCenter-0.12.3/.gitignore000066400000000000000000000001431510261335300202150ustar00rootroot00000000000000*.ui~ *.ui# pkg build SwayNotificationCenter ./swaync ./swaync* ./src/swaync ./src/swaync* .cache/ SwayNotificationCenter-0.12.3/.uncrustify.cfg000066400000000000000000002210571510261335300212100ustar00rootroot00000000000000# Uncrustify 0.60 # Rules for vala # Version: 0.5 # Refactored to match the style used on this project: https://github.com/GNOME/vala # # General options # # The type of line endings newlines = auto # auto/lf/crlf/cr # The original size of tabs in the input input_tab_size = 8 # number # The size of tabs in the output (only used if align_with_tabs=true) output_tab_size = 4 # number # The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) string_escape_char = 92 # number # Alternate string escape char for Pawn. Only works right before the quote char. string_escape_char2 = 0 # number # Replace tab characters found in string literals with the escape sequence \t # instead. string_replace_tab_chars = true # true/false # Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. # If true (default), 'assert(x<0 && y>=3)' will be broken. # Improvements to template detection may make this option obsolete. tok_split_gte = false # false/true # Control what to do with the UTF-8 BOM (recommend 'remove') utf8_bom = ignore # ignore/add/remove/force # If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 utf8_byte = false # false/true # Force the output encoding to UTF-8 utf8_force = false # false/true # # Indenting # # The number of columns to indent per level. # Usually 2, 3, 4, or 8. indent_columns = 4 # number # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. # For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level indent_continue = 0 # number # How to use tabs when indenting code # 0=spaces only # 1=indent with tabs to brace level, align with spaces # 2=indent and align with tabs, using spaces when not on a tabstop indent_with_tabs = 0 # number # Comments that are not a brace level are indented with tabs on a tabstop. # Requires indent_with_tabs=2. If false, will use spaces. indent_cmt_with_tabs = false # false/true # Whether to indent strings broken by '\' so that they line up indent_align_string = false # false/true # The number of spaces to indent multi-line XML strings. # Requires indent_align_string=True indent_xml_string = 0 # number # Spaces to indent '{' from level indent_brace = 0 # number # Whether braces are indented to the body level indent_braces = false # false/true # Disabled indenting function braces if indent_braces is true indent_braces_no_func = false # false/true # Disabled indenting class braces if indent_braces is true indent_braces_no_class = false # false/true # Disabled indenting struct braces if indent_braces is true indent_braces_no_struct = false # false/true # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. indent_brace_parent = false # false/true # Whether the 'namespace' body is indented indent_namespace = true # false/true # The number of spaces to indent a namespace block indent_namespace_level = 0 # number # If the body of the namespace is longer than this number, it won't be indented. # Requires indent_namespace=true. Default=0 (no limit) indent_namespace_limit = 0 # number # Whether the 'extern "C"' body is indented indent_extern = false # false/true # Whether the 'class' body is indented indent_class = true # false/true # Whether to indent the stuff after a leading class colon indent_class_colon = false # false/true # Whether to indent the stuff after a leading class initializer colon indent_constr_colon = false # false/true # Virtual indent from the ':' for member initializers. Default is 2 indent_ctor_init_leading = 2 # number # Additional indenting for constructor initializer list indent_ctor_init = 0 # number # False=treat 'else\nif' as 'else if' for indenting purposes # True=indent the 'if' one level indent_else_if = false # false/true # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute indent_var_def_blk = 0 # number # Indent continued variable declarations instead of aligning. indent_var_def_cont = false # false/true # True: force indentation of function definition to start in column 1 # False: use the default behavior indent_func_def_force_col1 = false # false/true # True: indent continued function call parameters one indent level # False: align parameters under the open paren indent_func_call_param = false # false/true # Same as indent_func_call_param, but for function defs indent_func_def_param = false # false/true # Same as indent_func_call_param, but for function protos indent_func_proto_param = false # false/true # Same as indent_func_call_param, but for class declarations indent_func_class_param = false # false/true # Same as indent_func_call_param, but for class variable constructors indent_func_ctor_var_param = false # false/true # Same as indent_func_call_param, but for templates indent_template_param = false # false/true # Double the indent for indent_func_xxx_param options indent_func_param_double = false # false/true # Indentation column for standalone 'const' function decl/proto qualifier indent_func_const = 0 # number # Indentation column for standalone 'throw' function decl/proto qualifier indent_func_throw = 0 # number # The number of spaces to indent a continued '->' or '.' # Usually set to 0, 1, or indent_columns. indent_member = 1 # number # Spaces to indent single line ('//') comments on lines before code indent_sing_line_comments = 0 # number # If set, will indent trailing single line ('//') comments relative # to the code instead of trying to keep the same absolute column indent_relative_single_line_comments = false # false/true # Spaces to indent 'case' from 'switch' # Usually 0 or indent_columns. indent_switch_case = indent_columns # number indent_switch_body = indent_columns # Spaces to shift the 'case' line, without affecting any other lines # Usually 0. indent_case_shift = 0 # number # Spaces to indent '{' from 'case'. # By default, the brace will appear under the 'c' in case. # Usually set to 0 or indent_columns. indent_case_brace = 0 # number # Whether to indent comments found in first column indent_col1_comment = false # false/true # How to indent goto labels # >0 : absolute column where 1 is the leftmost column # <=0 : subtract from brace indent indent_label = 1 # number # Same as indent_label, but for access specifiers that are followed by a colon indent_access_spec = 1 # number # Indent the code after an access specifier by one level. # If set, this option forces 'indent_access_spec=0' indent_access_spec_body = false # false/true # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) indent_paren_nl = false # false/true # Controls the indent of a close paren after a newline. # 0: Indent to body level # 1: Align under the open paren # 2: Indent to the brace level indent_paren_close = 2 # number # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren indent_comma_paren = 0 # false/true # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren indent_bool_paren = 0 # false/true # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones indent_first_bool_expr = false # false/true # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) indent_square_nl = false # false/true # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies indent_preserve_sql = false # false/true # Align continued statements at the '='. Default=True # If FALSE or the '=' is followed by a newline, the next line is indent one tab. indent_align_assign = false # false/true # Indent OC blocks at brace level instead of usual rules. indent_oc_block = false # false/true # Indent OC blocks in a message relative to the parameter name. # 0=use indent_oc_block rules, 1+=spaces to indent indent_oc_block_msg = 0 # number # Minimum indent for subsequent parameters indent_oc_msg_colon = 0 # number # Objective C # If true, prioritize aligning with initial colon (and stripping spaces from lines, if necessary). # Default is true. indent_oc_msg_prioritize_first_colon = true # If indent_oc_block_msg and this option are on, blocks will be indented the way that Xcode does by default (from keyword if the parameter is on its own line; otherwise, from the previous indentation level). indent_oc_block_msg_xcode_style = true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg keyword. indent_oc_block_msg_from_keyword = true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg colon. indent_oc_block_msg_from_colon = true # If indent_oc_block_msg and this option are on, blocks will be indented from where the block caret is. indent_oc_block_msg_from_caret = true # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is. indent_oc_block_msg_from_brace = true # # Spacing options # # Add or remove space around arithmetic operator '+', '-', '/', '*', etc sp_arith = force # ignore/add/remove/force # Add or remove space around assignment operator '=', '+=', etc sp_assign = force # ignore/add/remove/force # Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign sp_cpp_lambda_assign = force # ignore/add/remove/force # Add or remove space after the capture specification in C++11 lambda. # sp_cpp_lambda_paren = force # ignore/add/remove/force # Add or remove space around assignment operator '=' in a prototype sp_assign_default = force # ignore/add/remove/force # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. sp_before_assign = force # ignore/add/remove/force # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. sp_after_assign = force # ignore/add/remove/force # Add or remove space around assignment '=' in enum sp_enum_assign = force # ignore/add/remove/force # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. sp_enum_before_assign = ignore # ignore/add/remove/force # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. sp_enum_after_assign = force # ignore/add/remove/force # Add or remove space around preprocessor '##' concatenation operator. Default=Add sp_pp_concat = add # ignore/add/remove/force # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. sp_pp_stringify = ignore # ignore/add/remove/force # Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'. sp_before_pp_stringify = ignore # ignore/add/remove/force # Add or remove space around boolean operators '&&' and '||' sp_bool = force # ignore/add/remove/force # Add or remove space around compare operator '<', '>', '==', etc sp_compare = force # ignore/add/remove/force # Add or remove space inside '(' and ')' sp_inside_paren = remove # ignore/add/remove/force # Add or remove space between nested parens sp_paren_paren = remove # ignore/add/remove/force # Add or remove space between back-to-back parens: ')(' vs ') (' sp_cparen_oparen = remove # ignore/add/remove/force # Whether to balance spaces inside nested parens sp_balance_nested_parens = false # false/true # Add or remove space between ')' and '{' sp_paren_brace = force # ignore/add/remove/force # Add or remove space before pointer star '*' sp_before_ptr_star = force # ignore/add/remove/force # Add or remove space before pointer star '*' that isn't followed by a variable name # If set to 'ignore', sp_before_ptr_star is used instead. sp_before_unnamed_ptr_star = force # ignore/add/remove/force # Add or remove space between pointer stars '*' sp_between_ptr_star = remove # ignore/add/remove/force # Add or remove space after pointer star '*', if followed by a word. sp_after_ptr_star = remove # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by a func proto/def. sp_after_ptr_star_func = remove # ignore/add/remove/force # Add or remove space after a pointer star '*', if followed by an open paren (function types). sp_ptr_star_paren = remove # ignore/add/remove/force # Add or remove space before a pointer star '*', if followed by a func proto/def. sp_before_ptr_star_func = force # ignore/add/remove/force # Add or remove space before a reference sign '&' sp_before_byref = force # ignore/add/remove/force # Add or remove space before a reference sign '&' that isn't followed by a variable name # If set to 'ignore', sp_before_byref is used instead. sp_before_unnamed_byref = ignore # ignore/add/remove/force # Add or remove space after reference sign '&', if followed by a word. sp_after_byref = ignore # ignore/add/remove/force # Add or remove space after a reference sign '&', if followed by a func proto/def. sp_after_byref_func = remove # ignore/add/remove/force # Add or remove space before a reference sign '&', if followed by a func proto/def. sp_before_byref_func = force # ignore/add/remove/force # Add or remove space between type and word. Default=Force sp_after_type = force # ignore/add/remove/force # Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('. sp_before_template_paren = force # ignore/add/remove/force # Add or remove space in 'template <' vs 'template<'. # If set to ignore, sp_before_angle is used. sp_template_angle = ignore # ignore/add/remove/force # Add or remove space before '<>' sp_before_angle = remove # ignore/add/remove/force # Add or remove space inside '<' and '>' sp_inside_angle = remove # ignore/add/remove/force # Add or remove space after '<>' sp_after_angle = remove # ignore/add/remove/force # Add or remove space between '<>' and '(' as found in 'new List();' sp_angle_paren = force # ignore/add/remove/force # Add or remove space between '<>' and a word as in 'List m;' sp_angle_word = force # ignore/add/remove/force # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add sp_angle_shift = add # ignore/add/remove/force # Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False # sp_angle_shift cannot remove the space without this option. sp_permit_cpp11_shift = false # false/true # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' sp_before_sparen = force # ignore/add/remove/force # Add or remove space inside if-condition '(' and ')' sp_inside_sparen = remove # ignore/add/remove/force # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. sp_inside_sparen_close = ignore # ignore/add/remove/force # Add or remove space before if-condition '('. Overrides sp_inside_sparen. sp_inside_sparen_open = ignore # ignore/add/remove/force # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' sp_after_sparen = force # ignore/add/remove/force # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' sp_sparen_brace = force # ignore/add/remove/force # Add or remove space between 'invariant' and '(' in the D language. sp_invariant_paren = ignore # ignore/add/remove/force # Add or remove space after the ')' in 'invariant (C) c' in the D language. sp_after_invariant_paren = ignore # ignore/add/remove/force # Add or remove space before empty statement ';' on 'if', 'for' and 'while' sp_special_semi = remove # ignore/add/remove/force # Add or remove space before ';'. Default=Remove sp_before_semi = remove # ignore/add/remove/force # Add or remove space before ';' in non-empty 'for' statements sp_before_semi_for = remove # ignore/add/remove/force # Add or remove space before a semicolon of an empty part of a for statement. sp_before_semi_for_empty = force # ignore/add/remove/force # Add or remove space after ';', except when followed by a comment. Default=Add sp_after_semi = add # ignore/add/remove/force # Add or remove space after ';' in non-empty 'for' statements. Default=Force sp_after_semi_for = force # ignore/add/remove/force # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). sp_after_semi_for_empty = force # ignore/add/remove/force # Add or remove space before '[' (except '[]') sp_before_square = remove # ignore/add/remove/force # Add or remove space before '[]' sp_before_squares = remove # ignore/add/remove/force # Add or remove space inside a non-empty '[' and ']' sp_inside_square = remove # ignore/add/remove/force # Add or remove space after ',' sp_after_comma = force # ignore/add/remove/force # Add or remove space before ',' sp_before_comma = remove # ignore/add/remove/force # Add or remove space between an open paren and comma: '(,' vs '( ,' sp_paren_comma = force # ignore/add/remove/force # Add or remove space before the variadic '...' when preceded by a non-punctuator sp_before_ellipsis = remove # ignore/add/remove/force # Add or remove space after class ':' sp_after_class_colon = force # ignore/add/remove/force # Add or remove space before class ':' sp_before_class_colon = force # ignore/add/remove/force # Add or remove space after class constructor ':' sp_after_constr_colon = ignore # ignore/add/remove/force # Add or remove space before class constructor ':' sp_before_constr_colon = ignore # ignore/add/remove/force # Add or remove space before case ':'. Default=Remove sp_before_case_colon = remove # ignore/add/remove/force # Add or remove space between 'operator' and operator sign sp_after_operator = force # ignore/add/remove/force # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' sp_after_operator_sym = ignore # ignore/add/remove/force # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' sp_after_cast = force # ignore/add/remove/force # Add or remove spaces inside cast parens sp_inside_paren_cast = remove # ignore/add/remove/force # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' sp_cpp_cast_paren = ignore # ignore/add/remove/force # Add or remove space between 'sizeof' and '(' sp_sizeof_paren = force # ignore/add/remove/force # Add or remove space after the tag keyword (Pawn) sp_after_tag = ignore # ignore/add/remove/force # Add or remove space inside enum '{' and '}' sp_inside_braces_enum = force # ignore/add/remove/force # Add or remove space inside struct/union '{' force '}' sp_inside_braces_struct = force # ignore/add/remove/force # Add or remove space inside '{' and '}' sp_inside_braces = force # ignore/add/remove/force # Add or remove space inside '{}' sp_inside_braces_empty = remove # ignore/add/remove/force # Add or remove space between return type and function name # A minimum of 1 is forced except for pointer return types. sp_type_func = remove # ignore/add/remove/force # Add or remove space between function name and '(' on function declaration sp_func_proto_paren = force # ignore/add/remove/force # CARL duplicates ERROR ?? # Add or remove space between function name and '(' on function definition sp_func_def_paren = force # ignore/add/remove/force # Add or remove space inside empty function '()' sp_inside_fparens = remove # ignore/add/remove/force # Add or remove space inside function '(' and ')' sp_inside_fparen = remove # ignore/add/remove/force # Add or remove space inside the first parens in the function type: 'void (*x)(...)' sp_inside_tparen = remove # ignore/add/remove/force # Add or remove between the parens in the function type: 'void (*x)(...)' sp_after_tparen_close = remove # ignore/add/remove/force # Add or remove space between ']' and '(' when part of a function call. sp_square_fparen = force # ignore/add/remove/force # Add or remove space between ')' and '{' of function sp_fparen_brace = force # ignore/add/remove/force # Add or remove space between function name and '(' on function calls sp_func_call_paren = force # ignore/add/remove/force # Add or remove space between function name and '()' on function calls without parameters. # If set to 'ignore' (the default), sp_func_call_paren is used. sp_func_call_paren_empty = force # ignore/add/remove/force # Add or remove space between the user function name and '(' on function calls # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. sp_func_call_user_paren = ignore # ignore/add/remove/force set func_call_user _ # Add or remove space between a constructor/destructor and the open paren sp_func_class_paren = force # ignore/add/remove/force # Add or remove space between 'return' and '(' sp_return_paren = force # ignore/add/remove/force # Add or remove space between '__attribute__' and '(' sp_attribute_paren = force # ignore/add/remove/force # Add or remove space between 'defined' and '(' in '#if defined (FOO)' sp_defined_paren = force # ignore/add/remove/force # Add or remove space between 'throw' and '(' in 'throw (something)' sp_throw_paren = force # ignore/add/remove/force # Add or remove space between 'throw' and anything other than '(' as in '@throw [...];' sp_after_throw = force # ignore/add/remove/force # Add or remove space between 'catch' and '(' in 'catch (something) { }' # If set to ignore, sp_before_sparen is used. sp_catch_paren = force # ignore/add/remove/force # D # Add or remove space between 'version' and '(' in 'version (something) { }' (D language) # If set to ignore, sp_before_sparen is used. sp_version_paren = ignore # ignore/add/remove/force # D # Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) # If set to ignore, sp_before_sparen is used. sp_scope_paren = ignore # ignore/add/remove/force # Add or remove space between macro and value sp_macro = ignore # ignore/add/remove/force # MACRO # Add or remove space between macro function ')' and value sp_macro_func = ignore # ignore/add/remove/force # Add or remove space between 'else' and '{' if on the same line sp_else_brace = force # ignore/add/remove/force # Add or remove space between '}' and 'else' if on the same line sp_brace_else = force # ignore/add/remove/force # Add or remove space between '}' and the name of a typedef on the same line sp_brace_typedef = force # ignore/add/remove/force # Add or remove space between 'catch' and '{' if on the same line sp_catch_brace = force # ignore/add/remove/force # Add or remove space between '}' and 'catch' if on the same line sp_brace_catch = force # ignore/add/remove/force # Add or remove space between 'finally' and '{' if on the same line sp_finally_brace = force # ignore/add/remove/force # Add or remove space between '}' and 'finally' if on the same line sp_brace_finally = force # ignore/add/remove/force # Add or remove space between 'try' and '{' if on the same line sp_try_brace = force # ignore/add/remove/force # Add or remove space between get/set and '{' if on the same line sp_getset_brace = force # ignore/add/remove/force # CARL TODO # Add or remove space between a variable and '{' for C++ uniform initialization # sp_word_brace = ignore # Add or remove space between a variable and '{' for a namespace sp_word_brace_ns = force # C++ # Add or remove space before the '::' operator sp_before_dc = remove # ignore/add/remove/force # C++ # Add or remove space after the '::' operator sp_after_dc = remove # ignore/add/remove/force # Add or remove around the D named array initializer ':' operator sp_d_array_colon = ignore # ignore/add/remove/force # Add or remove space after the '!' (not) operator. Default=Remove sp_not = remove # ignore/add/remove/force # Add or remove space after the '~' (invert) operator. Default=Remove sp_inv = remove # ignore/add/remove/force # Add or remove space after the '&' (address-of) operator. Default=Remove # This does not affect the spacing after a '&' that is part of a type. sp_addr = remove # ignore/add/remove/force # Add or remove space around the '.' or '->' operators. Default=Remove sp_member = remove # ignore/add/remove/force # Add or remove space after the '*' (dereference) operator. Default=Remove # This does not affect the spacing after a '*' that is part of a type. sp_deref = remove # ignore/add/remove/force # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove sp_sign = remove # ignore/add/remove/force # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove sp_incdec = remove # ignore/add/remove/force # Add or remove space before a backslash-newline at the end of a line. Default=Add sp_before_nl_cont = add # ignore/add/remove/force # Obj c # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' sp_after_oc_scope = ignore # ignore/add/remove/force # Obj c # Add or remove space after the colon in message specs # '-(int) f:(int) x;' vs '-(int) f: (int) x;' sp_after_oc_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space before the colon in message specs # '-(int) f: (int) x;' vs '-(int) f : (int) x;' sp_before_oc_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space after the colon in immutable dictionary expression # 'NSDictionary *test = @{@"foo" :@"bar"};' sp_after_oc_dict_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space before the colon in immutable dictionary expression # 'NSDictionary *test = @{@"foo" :@"bar"};' sp_before_oc_dict_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space after the colon in message specs # '[object setValue:1];' vs '[object setValue: 1];' sp_after_send_oc_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space before the colon in message specs # '[object setValue:1];' vs '[object setValue :1];' sp_before_send_oc_colon = ignore # ignore/add/remove/force # Obj c # Add or remove space after the (type) in message specs # '-(int)f: (int) x;' vs '-(int)f: (int)x;' sp_after_oc_type = ignore # ignore/add/remove/force # Obj c # Add or remove space after the first (type) in message specs # '-(int) f:(int)x;' vs '-(int)f:(int)x;' sp_after_oc_return_type = ignore # ignore/add/remove/force # Obj c # Add or remove space between '@selector' and '(' # '@selector(msgName)' vs '@selector (msgName)' # Also applies to @protocol() constructs sp_after_oc_at_sel = ignore # ignore/add/remove/force # Obj c # Add or remove space between '@selector(x)' and the following word # '@selector(foo) a:' vs '@selector(foo)a:' sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force # Obj c # Add or remove space inside '@selector' parens # '@selector(foo)' vs '@selector( foo )' # Also applies to @protocol() constructs sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force # Obj c # Add or remove space before a block pointer caret # '^int (int arg){...}' vs. ' ^int (int arg){...}' sp_before_oc_block_caret = ignore # ignore/add/remove/force # Obj c # Add or remove space after a block pointer caret # '^int (int arg){...}' vs. '^ int (int arg){...}' sp_after_oc_block_caret = ignore # ignore/add/remove/force # Obj c # Add or remove space between the receiver and selector in a message. # '[receiver selector ...]' sp_after_oc_msg_receiver = ignore # ignore/add/remove/force # Obj c # Add or remove space after @property. sp_after_oc_property = ignore # ignore/add/remove/force # Add or remove space around the ':' in 'b ? t : f' sp_cond_colon = force # ignore/add/remove/force # TODO # Add or remove space before the ':' in 'b ? t : f'. Overrides sp_cond_colon. sp_cond_colon_before = force # Add or remove space after the ':' in 'b ? t : f'. Overrides sp_cond_colon. sp_cond_colon_after = force # Add or remove space around the '?' in 'b ? t : f' sp_cond_question = force # Add or remove space before the '?' in 'b ? t : f'. Overrides sp_cond_question. sp_cond_question_before = force # Add or remove space after the '?' in 'b ? t : f'. Overrides sp_cond_question. sp_cond_question_after = force # In the abbreviated ternary form (a ?: b), add/remove space between ? and :.'. Overrides all other sp_cond_* options. sp_cond_ternary_short = force # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. sp_case_label = force # ignore/add/remove/force # Control the space around the D '..' operator. sp_range = ignore # ignore/add/remove/force # Control the spacing after ':' in 'for (TYPE VAR : EXPR)' (Java) sp_after_for_colon = ignore # ignore/add/remove/force # Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java) sp_before_for_colon = ignore # ignore/add/remove/force # Control the spacing in 'extern (C)' (D) sp_extern_paren = ignore # ignore/add/remove/force # Control the space after the opening of a C++ comment '// A' vs '//A' sp_cmt_cpp_start = force # ignore/add/remove/force # Controls the spaces between #else or #endif and a trailing comment sp_endif_cmt = remove # ignore/add/remove/force # Controls the spaces after 'new', 'delete', and 'delete[]' sp_after_new = force # ignore/add/remove/force # Controls the spaces before a trailing or embedded comment sp_before_tr_emb_cmt = force # ignore/add/remove/force # Number of spaces before a trailing or embedded comment sp_num_before_tr_emb_cmt = 0 # number # Control space between a Java annotation and the open paren. sp_annotation_paren = ignore # ignore/add/remove/force # # Code alignment (not left column spaces/tabs) # # Whether to keep non-indenting tabs align_keep_tabs = false # false/true # Whether to use tabs for aligning align_with_tabs = false # false/true # Whether to bump out to the next tab when aligning align_on_tabstop = false # false/true # Whether to left-align numbers # align_number_left = false # false/true # TODO DOC # Whether to keep whitespace not required for alignment. align_keep_extra_space = true # Align variable definitions in prototypes and functions align_func_params = false # false/true # Align parameters in single-line functions that have the same name. # The function names must already be aligned with each other. align_same_func_call_params = false # false/true # The span for aligning variable definitions (0=don't align) align_var_def_span = 0 # number # How to align the star in variable definitions. # 0=Part of the type 'void * foo;' # 1=Part of the variable 'void *foo;' # 2=Dangling 'void *foo;' align_var_def_star_style = 1 # number # How to align the '&' in variable definitions. # 0=Part of the type # 1=Part of the variable # 2=Dangling align_var_def_amp_style = 1 # number # The threshold for aligning variable definitions (0=no limit) align_var_def_thresh = 0 # number # The gap for aligning variable definitions align_var_def_gap = 0 # number # Whether to align the colon in struct bit fields align_var_def_colon = false # false/true # Whether to align any attribute after the variable name align_var_def_attribute = false # false/true # Whether to align inline struct/enum/union variable definitions align_var_def_inline = false # false/true # The span for aligning on '=' in assignments (0=don't align) align_assign_span = 0 # number # The threshold for aligning on '=' in assignments (0=no limit) align_assign_thresh = 0 # number # The span for aligning on '=' in enums (0=don't align) align_enum_equ_span = 0 # number # The threshold for aligning on '=' in enums (0=no limit) align_enum_equ_thresh = 0 # number # The span for aligning struct/union (0=don't align) align_var_struct_span = 0 # number # The threshold for aligning struct/union member definitions (0=no limit) align_var_struct_thresh = 0 # number # The gap for aligning struct/union member definitions align_var_struct_gap = 0 # number # The span for aligning struct initializer values (0=don't align) align_struct_init_span = 0 # number # The minimum space between the type and the synonym of a typedef align_typedef_gap = 0 # number # The span for aligning single-line typedefs (0=don't align) align_typedef_span = 0 # number # How to align typedef'd functions with other typedefs # 0: Don't mix them at all # 1: align the open paren with the types # 2: align the function type name with the other type names align_typedef_func = 0 # number # Controls the positioning of the '*' in typedefs. Just try it. # 0: Align on typedef type, ignore '*' # 1: The '*' is part of type name: typedef int *pint; # 2: The '*' is part of the type, but dangling: typedef int *pint; align_typedef_star_style = 0 # number # Controls the positioning of the '&' in typedefs. Just try it. # 0: Align on typedef type, ignore '&' # 1: The '&' is part of type name: typedef int &pint; # 2: The '&' is part of the type, but dangling: typedef int &pint; align_typedef_amp_style = 0 # number # The span for aligning comments that end lines (0=don't align) align_right_cmt_span = 0 # number # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment align_right_cmt_mix = false # false/true # If a trailing comment is more than this number of columns away from the text it follows, # it will qualify for being aligned. This has to be > 0 to do anything. align_right_cmt_gap = 0 # number # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) align_right_cmt_at_col = 0 # number # The span for aligning function prototypes (0=don't align) align_func_proto_span = 0 # number # Minimum gap between the return type and the function name. align_func_proto_gap = 0 # number # Align function protos on the 'operator' keyword instead of what follows align_on_operator = false # false/true # Whether to mix aligning prototype and variable declarations. # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. align_mix_var_proto = false # false/true # Align single-line functions with function prototypes, uses align_func_proto_span align_single_line_func = false # false/true # Aligning the open brace of single-line functions. # Requires align_single_line_func=true, uses align_func_proto_span align_single_line_brace = false # false/true # Gap for align_single_line_brace. align_single_line_brace_gap = 0 # number # The span for aligning ObjC msg spec (0=don't align) align_oc_msg_spec_span = 0 # number # Whether to align macros wrapped with a backslash and a newline. # This will not work right if the macro contains a multi-line comment. align_nl_cont = false # false/true # # Align macro functions and variables together align_pp_define_together = false # false/true # The minimum space between label and value of a preprocessor define align_pp_define_gap = 0 # number # The span for aligning on '#define' bodies (0=don't align) align_pp_define_span = 0 # number # Align lines that start with '<<' with previous '<<'. Default=true align_left_shift = true # false/true # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) align_oc_msg_colon_span = 0 # number # If true, always align with the first parameter, even if it is too short. align_oc_msg_colon_first = false # false/true # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' align_oc_decl_colon = false # false/true # # Newline adding and removing options # # Whether to collapse empty blocks between '{' and '}' nl_collapse_empty_body = true # false/true # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' nl_assign_leave_one_liners = true # false/true # Don't split one-line braced statements inside a class xx { } body nl_class_leave_one_liners = false # false/true # Don't split one-line enums: 'enum foo { BAR = 15 };' nl_enum_leave_one_liners = false # false/true # Don't split one-line get or set functions nl_getset_leave_one_liners = false # false/true # Don't split one-line function definitions - 'int foo() { return 0; }' nl_func_leave_one_liners = false # false/true # Don't split one-line if/else statements - 'if(a) b++;' nl_if_leave_one_liners = false # false/true # Don't split one-line OC messages nl_oc_msg_leave_one_liner = false # false/true # Add or remove newlines at the start of the file nl_start_of_file = ignore # ignore/add/remove/force # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' nl_start_of_file_min = 0 # number # Add or remove newline at the end of the file nl_end_of_file = add # ignore/add/remove/force # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') nl_end_of_file_min = 1 # number # Add or remove newline between '=' and '{' nl_assign_brace = ignore # ignore/add/remove/force # Add or remove newline between '=' and '[' (D only) nl_assign_square = ignore # ignore/add/remove/force # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' nl_after_square_assign = ignore # ignore/add/remove/force # The number of blank lines after a block of variable definitions at the top of a function body # 0 = No change (default) nl_func_var_def_blk = 0 # number # The number of newlines before a block of typedefs # 0 = No change (default) nl_typedef_blk_start = 0 # number # The number of newlines after a block of typedefs # 0 = No change (default) nl_typedef_blk_end = 0 # number # The maximum consecutive newlines within a block of typedefs # 0 = No change (default) nl_typedef_blk_in = 0 # number # The number of newlines before a block of variable definitions not at the top of a function body # 0 = No change (default) nl_var_def_blk_start = 0 # number # The number of newlines after a block of variable definitions not at the top of a function body # 0 = No change (default) nl_var_def_blk_end = 0 # number # The maximum consecutive newlines within a block of variable definitions # 0 = No change (default) nl_var_def_blk_in = 0 # number # Add or remove newline between a function call's ')' and '{', as in: # list_for_each(item, &list) { } nl_fcall_brace = ignore # ignore/add/remove/force # Add or remove newline between 'enum' and '{' nl_enum_brace = remove # ignore/add/remove/force # Add or remove newline between 'struct and '{' nl_struct_brace = remove # ignore/add/remove/force # Add or remove newline between 'union' and '{' nl_union_brace = remove # ignore/add/remove/force # Add or remove newline between 'if' and '{' nl_if_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'else' nl_brace_else = remove # ignore/add/remove/force # Add or remove newline between 'else if' and '{' # If set to ignore, nl_if_brace is used instead nl_elseif_brace = remove # ignore/add/remove/force # Add or remove newline between 'else' and '{' nl_else_brace = remove # ignore/add/remove/force # Add or remove newline between 'else' and 'if' nl_else_if = remove # ignore/add/remove/force # Add or remove newline between '}' and 'finally' nl_brace_finally = remove # ignore/add/remove/force # Add or remove newline between 'finally' and '{' nl_finally_brace = remove # ignore/add/remove/force # Add or remove newline between 'try' and '{' nl_try_brace = remove # ignore/add/remove/force # Add or remove newline between get/set and '{' nl_getset_brace = remove # ignore/add/remove/force # Add or remove newline between 'for' and '{' nl_for_brace = remove # ignore/add/remove/force # Add or remove newline between 'catch' and '{' nl_catch_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'catch' nl_brace_catch = remove # ignore/add/remove/force # Add or remove newline between '}' and ']' nl_brace_square = remove # ignore/add/remove/force # Add or remove newline between '}' and ')' in a function invocation nl_brace_fparen = remove # ignore/add/remove/force # Add or remove newline between 'while' and '{' nl_while_brace = remove # ignore/add/remove/force # Add or remove newline between 'scope (x)' and '{' (D) nl_scope_brace = ignore # ignore/add/remove/force # Add or remove newline between 'unittest' and '{' (D) nl_unittest_brace = ignore # ignore/add/remove/force # Add or remove newline between 'version (x)' and '{' (D) nl_version_brace = ignore # ignore/add/remove/force # Add or remove newline between 'using' and '{' nl_using_brace = remove # ignore/add/remove/force # Add or remove newline between two open or close braces. # Due to general newline/brace handling, REMOVE may not work. nl_brace_brace = ignore # ignore/add/remove/force # Add or remove newline between 'do' and '{' nl_do_brace = remove # ignore/add/remove/force # Add or remove newline between '}' and 'while' of 'do' statement nl_brace_while = remove # ignore/add/remove/force # Add or remove newline between 'switch' and '{' nl_switch_brace = remove # ignore/add/remove/force # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. nl_multi_line_cond = false # false/true # Force a newline in a define after the macro name for multi-line defines. nl_multi_line_define = false # false/true # Whether to put a newline before 'case' statement nl_before_case = false # false/true # Add or remove newline between ')' and 'throw' nl_before_throw = remove # ignore/add/remove/force # Whether to put a newline after 'case' statement nl_after_case = false # false/true # Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. nl_case_colon_brace = remove # ignore/add/remove/force # Newline between namespace and { nl_namespace_brace = remove # ignore/add/remove/force # Add or remove newline between 'template<>' and whatever follows. nl_template_class = ignore # ignore/add/remove/force # Add or remove newline between 'class' and '{' nl_class_brace = remove # ignore/add/remove/force # Add or remove newline after each ',' in the class base list nl_class_init_args = remove # ignore/add/remove/force # Add or remove newline after each ',' in the constructor member initialization nl_class_init_args = remove # ignore/add/remove/force # Add or remove newline between return type and function name in a function definition nl_func_type_name = remove # ignore/add/remove/force # Add or remove newline between return type and function name inside a class {} # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. nl_func_type_name_class = remove # ignore/add/remove/force # Add or remove newline between function scope and name in a definition # Controls the newline after '::' in 'void A::f() { }' nl_func_scope_name = ignore # ignore/add/remove/force # Add or remove newline between return type and function name in a prototype nl_func_proto_type_name = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' nl_func_paren = remove # ignore/add/remove/force # Add or remove newline between a function name and the opening '(' in the definition nl_func_def_paren = remove # ignore/add/remove/force # Add or remove newline after '(' in a function declaration nl_func_decl_start = remove # ignore/add/remove/force # Add or remove newline after '(' in a function definition nl_func_def_start = remove # ignore/add/remove/force # Overrides nl_func_decl_start when there is only one parameter. nl_func_decl_start_single = ignore # ignore/add/remove/force # Overrides nl_func_def_start when there is only one parameter. nl_func_def_start_single = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function declaration nl_func_decl_args = ignore # ignore/add/remove/force # Add or remove newline after each ',' in a function definition nl_func_def_args = ignore # ignore/add/remove/force # Add or remove newline before the ')' in a function declaration nl_func_decl_end = remove # ignore/add/remove/force # Add or remove newline before the ')' in a function definition nl_func_def_end = remove # ignore/add/remove/force # Overrides nl_func_decl_end when there is only one parameter. nl_func_decl_end_single = ignore # ignore/add/remove/force # Overrides nl_func_def_end when there is only one parameter. nl_func_def_end_single = ignore # ignore/add/remove/force # Add or remove newline between '()' in a function declaration. nl_func_decl_empty = remove # ignore/add/remove/force # Add or remove newline between '()' in a function definition. nl_func_def_empty = remove # ignore/add/remove/force # Whether to put each OC message parameter on a separate line # See nl_oc_msg_leave_one_liner nl_oc_msg_args = false # false/true # Add or remove newline between function signature and '{' nl_fdef_brace = remove # ignore/add/remove/force # Add or remove newline between C++11 lambda signature and '{' nl_cpp_ldef_brace = ignore # ignore/add/remove/force # Add or remove a newline between the return keyword and return expression. nl_return_expr = remove # ignore/add/remove/force # Whether to put a newline after semicolons, except in 'for' statements nl_after_semicolon = false # false/true # CARL ?? # Whether to put a newline after brace open. # This also adds a newline before the matching brace close. nl_after_brace_open = false # false/true # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is # placed between the open brace and a trailing single-line comment. nl_after_brace_open_cmt = false # false/true # Whether to put a newline after a virtual brace open with a non-empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open = false # false/true # Whether to put a newline after a virtual brace open with an empty body. # These occur in un-braced if/while/do/for statement bodies. nl_after_vbrace_open_empty = false # false/true # Whether to put a newline after a brace close. # Does not apply if followed by a necessary ';'. nl_after_brace_close = false # false/true # Whether to put a newline after a virtual brace close. # Would add a newline before return in: 'if (foo) a++; return;' nl_after_vbrace_close = false # false/true # Control the newline between the close brace and 'b' in: 'struct { int a; } b;' # Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close nl_brace_struct_var = ignore # ignore/add/remove/force # Whether to alter newlines in '#define' macros nl_define_macro = false # false/true # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' nl_squeeze_ifdef = false # false/true # Add or remove blank line before 'if' nl_before_if = ignore # ignore/add/remove/force # Add or remove blank line after 'if' statement nl_after_if = ignore # ignore/add/remove/force # Add or remove blank line before 'for' nl_before_for = ignore # ignore/add/remove/force # Add or remove blank line after 'for' statement nl_after_for = ignore # ignore/add/remove/force # Add or remove blank line before 'while' nl_before_while = ignore # ignore/add/remove/force # Add or remove blank line after 'while' statement nl_after_while = ignore # ignore/add/remove/force # Add or remove blank line before 'switch' nl_before_switch = ignore # ignore/add/remove/force # Add or remove blank line after 'switch' statement nl_after_switch = ignore # ignore/add/remove/force # Add or remove blank line before 'do' nl_before_do = ignore # ignore/add/remove/force # Add or remove blank line after 'do/while' statement nl_after_do = ignore # ignore/add/remove/force # Whether to double-space commented-entries in struct/enum nl_ds_struct_enum_cmt = false # false/true # Whether to double-space before the close brace of a struct/union/enum # (lower priority than 'eat_blanks_before_close_brace') nl_ds_struct_enum_close_brace = false # false/true # Add or remove a newline around a class colon. # Related to pos_class_colon, nl_class_init_args, and pos_comma. nl_class_colon = ignore # ignore/add/remove/force # Add or remove a newline around a class constructor colon. # Related to pos_constr_colon, nl_constr_init_args, and pos_constr_comma. nl_constr_colon = ignore # ignore/add/remove/force # Change simple unbraced if statements into a one-liner # 'if(b)\n i++;' => 'if(b) i++;' nl_create_if_one_liner = false # false/true # Change simple unbraced for statements into a one-liner # 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' nl_create_for_one_liner = false # false/true # Change simple unbraced while statements into a one-liner # 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' nl_create_while_one_liner = false # false/true # # Positioning options # # The position of arithmetic operators in wrapped expressions pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of assignment in wrapped expressions. # Do not affect '=' followed by '{' pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of boolean operators in wrapped expressions pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of comparison operators in wrapped expressions pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of conditional (b ? t : f) operators in wrapped expressions pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in wrapped expressions pos_comma = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the class base list pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in the constructor initialization list pos_constr_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between class and base class list pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of colons between constructor and member initialization pos_constr_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # # Line Splitting options # # Try to limit code width to N number of columns code_width = 100 # number # Whether to fully split long 'for' statements at semi-colons ls_for_split_full = false # false/true # Whether to fully split long function protos/calls at commas ls_func_split_full = false # false/true # Whether to split lines as close to code_width as possible and ignore some groupings ls_code_width = false # false/true # # Blank line options # # The maximum consecutive newlines nl_max = 0 # number # The number of newlines after a function prototype, if followed by another function prototype nl_after_func_proto = 0 # number # The number of newlines after a function prototype, if not followed by another function prototype nl_after_func_proto_group = 2 # number # The number of newlines after '}' of a multi-line function body nl_after_func_body = 2 # number # The number of newlines after '}' of a multi-line function body in a class declaration nl_after_func_body_class = 2 # number # The number of newlines after '}' of a single line function body nl_after_func_body_one_liner = 0 # number # The minimum number of newlines before a multi-line comment. # Doesn't apply if after a brace open or another multi-line comment. nl_before_block_comment = 0 # number # The minimum number of newlines before a single-line C comment. # Doesn't apply if after a brace open or other single-line C comments. nl_before_c_comment = 0 # number # The minimum number of newlines before a CPP comment. # Doesn't apply if after a brace open or other CPP comments. nl_before_cpp_comment = 0 # number # Whether to force a newline after a multi-line comment. nl_after_multiline_comment = false # false/true # The number of newlines after '}' or ';' of a struct/enum/union definition nl_after_struct = 2 # number # The number of newlines after '}' or ';' of a class definition nl_after_class = 2 # number # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # Will not change the newline count if after a brace open. # 0 = No change. nl_before_access_spec = 0 # number # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. # 0 = No change. nl_after_access_spec = 0 # number # The number of newlines between a function def and the function comment. # 0 = No change. nl_comment_func_def = 0 # number # The number of newlines after a try-catch-finally block that isn't followed by a brace close. # 0 = No change. nl_after_try_catch_finally = 0 # number # The number of newlines before and after a property, indexer or event decl. # 0 = No change. nl_around_cs_property = 0 # number # The number of newlines between the get/set/add/remove handlers in C#. # 0 = No change. nl_between_get_set = 0 # number # Add or remove newline between C# property and the '{' nl_property_brace = ignore # ignore/add/remove/force # Whether to remove blank lines after '{' eat_blanks_after_open_brace = true # false/true # Whether to remove blank lines before '}' eat_blanks_before_close_brace = true # false/true # How aggressively to remove extra newlines not in preproc. # 0: No change # 1: Remove most newlines not handled by other config # 2: Remove all newlines and reformat completely by config nl_remove_extra_newlines = 0 # number # Whether to put a blank line before 'return' statements, unless after an open brace. nl_before_return = false # false/true # Whether to put a blank line after 'return' statements, unless followed by a close brace. nl_after_return = false # false/true # Whether to put a newline after a Java annotation statement. # Only affects annotations that are after a newline. nl_after_annotation = ignore # ignore/add/remove/force # Controls the newline between two annotations. nl_between_annotation = ignore # ignore/add/remove/force # # Code modifying options (non-whitespace) # # Add or remove braces on single-line 'do' statement mod_full_brace_do = force # ignore/add/remove/force # Add or remove braces on single-line 'for' statement mod_full_brace_for = force # ignore/add/remove/force # Add or remove braces on single-line function definitions. (Pawn) mod_full_brace_function = force # ignore/add/remove/force # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. mod_full_brace_if = force # ignore/add/remove/force # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. mod_full_brace_if_chain = 0 # false/true # Don't remove braces around statements that span N newlines mod_full_brace_nl = 0 # number # Add or remove braces on single-line 'while' statement mod_full_brace_while = force # ignore/add/remove/force # Add or remove braces on single-line 'using ()' statement mod_full_brace_using = ignore # ignore/add/remove/force # Add or remove unnecessary paren on 'return' statement mod_paren_on_return = ignore # ignore/add/remove/force # Whether to change optional semicolons to real semicolons mod_pawn_semicolon = false # false/true # Add parens on 'while' and 'if' statement around bools mod_full_paren_if_bool = false # false/true # Whether to remove superfluous semicolons mod_remove_extra_semicolon = false # false/true # If a function body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_function_closebrace_comment = 0 # number # If a namespace body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_namespace_closebrace_comment = 0 # number # If a switch body exceeds the specified number of newlines and doesn't have a comment after # the close brace, a comment will be added. mod_add_long_switch_closebrace_comment = 0 # number # If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after # the #endif, a comment will be added. mod_add_long_ifdef_endif_comment = 0 # number # If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after # the #else, a comment will be added. mod_add_long_ifdef_else_comment = 0 # number # If TRUE, will sort consecutive single-line 'import' statements [Java, D] mod_sort_import = false # false/true # If TRUE, will sort consecutive single-line 'using' statements [C#] mod_sort_using = true # false/true # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] # This is generally a bad idea, as it may break your code. mod_sort_include = false # false/true # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. mod_move_case_break = false # false/true # Will add or remove the braces around a fully braced case statement. # Will only remove the braces if there are no variable declarations in the block. mod_case_brace = ignore # ignore/add/remove/force # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. mod_remove_empty_return = false # false/true # # Comment modifications # # Try to wrap comments at cmt_width columns cmt_width = 0 # number # Set the comment reflow mode (default: 0) # 0: no reflowing (apart from the line wrapping due to cmt_width) # 1: no touching at all # 2: full reflow cmt_reflow_mode = 0 # number # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. # Default is true. cmt_indent_multi = true # false/true # Whether to group c-comments that look like they are in a block cmt_c_group = false # false/true # Whether to put an empty '/*' on the first line of the combined c-comment cmt_c_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined c-comment cmt_c_nl_end = false # false/true # Whether to group cpp-comments that look like they are in a block cmt_cpp_group = false # false/true # Whether to put an empty '/*' on the first line of the combined cpp-comment cmt_cpp_nl_start = false # false/true # Whether to put a newline before the closing '*/' of the combined cpp-comment cmt_cpp_nl_end = false # false/true # Whether to change cpp-comments into c-comments cmt_cpp_to_c = false # false/true # Whether to put a star on subsequent comment lines cmt_star_cont = false # false/true # The number of spaces to insert at the start of subsequent comment lines cmt_sp_before_star_cont = 0 # number # The number of spaces to insert after the star on subsequent comment lines cmt_sp_after_star_cont = 0 # number # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of # the comment are the same length. Default=True cmt_multi_check_last = true # false/true # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_header = "" # string # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. # Will substitute $(filename) with the current file's name. cmt_insert_file_footer = "" # string # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } cmt_insert_func_header = "" # string # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. # Will substitute $(class) with the class name. cmt_insert_class_header = "" # string # The filename that contains text to insert before a Obj-C message specification if the method isn't preceeded with a C/C++ comment. # Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. cmt_insert_oc_msg_header = "" # string # If a preprocessor is encountered when stepping backwards from a function name, then # this option decides whether the comment should be inserted. # Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. cmt_insert_before_preproc = false # false/true # # Preprocessor options # # Control indent of preprocessors inside #if blocks at brace level 0 pp_indent = force # ignore/add/remove/force # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) pp_indent_at_level = false # false/true # If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1. pp_indent_count = 1 # number # Add or remove space after # based on pp_level of #if blocks pp_space = ignore # ignore/add/remove/force # Sets the number of spaces added with pp_space pp_space_count = 0 # number # The indent for #region and #endregion in C# and '#pragma region' in C/C++ pp_indent_region = 0 # number # Whether to indent the code between #region and #endregion pp_region_indent_code = false # false/true # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level pp_indent_if = 0 # number # Control whether to indent the code between #if, #else and #endif when not at file-level pp_if_indent_code = false # false/true # Whether to indent '#define' at the brace level (true) or from column 1 (false) pp_define_at_level = false # false/true SwayNotificationCenter-0.12.3/.vala-lint.conf000066400000000000000000000007211510261335300210430ustar00rootroot00000000000000[Checks] block-opening-brace-space-before=error double-semicolon=error double-spaces=error ellipsis=off line-length=error naming-convention=error no-space=error note=warn space-before-paren=error use-of-tabs=error trailing-newlines=error trailing-whitespace=error unnecessary-string-template=error [Disabler] disable-by-inline-comments=true [line-length] max-line-length=100 ignore-comments=true [naming-convention] exceptions=UUID, [note] keywords=TODO,FIXME, SwayNotificationCenter-0.12.3/COPYING000066400000000000000000001045141510261335300172670ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . SwayNotificationCenter-0.12.3/README.md000066400000000000000000000313541510261335300175140ustar00rootroot00000000000000# SwayNotificationCenter [![Check PKGBUILD builds for Arch.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/PKGBUILD-build.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/PKGBUILD-buildd.yml) [![Check build for Fedora.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/fedora-build.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/fedora-build.yml) [![Check build for latest Ubuntu LTS.](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/ubuntu-build.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/ubuntu-build.yml) [![Linting](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/linting.yml/badge.svg)](https://github.com/ErikReider/SwayNotificationCenter/actions/workflows/linting.yml) A simple notification daemon with a GTK gui for notifications and the control center *Note: SwayNotificationCenter only supports Desktops / Window Managers that support `wlr_layer_shell_unstable_v1` like Sway or anything wlroots based* *Note 2: SwayNotificationCenter does not support third-party GTK3 themes and is only tested with the default GTK **Adwaita** theme. Usage of any third-party theme might require extra tweaks to the default CSS style file* ## Demo https://github.com/user-attachments/assets/5c054ac3-90bb-483e-a8f2-5af191805f04 ## Table of Contents * [Want to show off your sick config?](#want-to-show-off-your-sick-config) * [Features](#features) * [Available Widgets](#available-widgets) * [Planned Features](#planned-features) * [Install](#install) * [Arch](#arch) * [Fedora](#fedora) * [Fedora Silverblue (and other rpm-ostree variants)](#fedora-silverblue-and-other-rpm-ostree-variants) * [Gentoo](#gentoo) * [OpenSUSE Tumbleweed](#opensuse-tumbleweed) * [Ubuntu](#ubuntu) * [Debian](#debian) * [Guix](#guix) * [rde](#rde) * [Other](#other) * [Sway Usage](#sway-usage) * [Run](#run) * [Control Center Shortcuts](#control-center-shortcuts) * [Configuring](#configuring) * [Toggle Buttons](#toggle-buttons) * [Notification Inhibition](#notification-inhibition) * [Scripting](#scripting) * [Disable scripting](#disable-scripting) * [i3status-rs Example](#i3status-rs-example) * [Waybar Example](#waybar-example) * [Debugging Environment Variables](#debugging-environment-variables) ## Want to show off your sick config? Post your setup here: [Config flex 💪](https://github.com/ErikReider/SwayNotificationCenter/discussions/183)

Config

Example of my config (link)

## Features - Grouped notifications - Keyboard shortcuts - Notification body markup with image support - Inline replies - A panel to view previous notifications - Show album art for notifications like Spotify - Do not disturb - Notification action filtering - Inhibiting notifications through DBUS or client - Restores previous Do not disturb value after restart - Click notification to execute default action - Show alternative notification actions - Copy detected 2FA codes to clipboard - Customization through a CSS file - Trackpad/mouse gesture to close notification - The same features as any other basic notification daemon - Basic configuration through a JSON config file - Hot-reload config through `swaync-client` - Customizable widgets - Select the preferred monitor to display on (with swaync-client command for scripting) ## Available Widgets These widgets can be customized, added, removed and even reordered - Title - Do Not Disturb - Notifications (Will always be visible) - Label - Mpris (Media player controls for Spotify, Firefox, Chrome, etc...) - Menubar with dropdown and buttons - Button grid - Volume slider using PulseAudio - Backlight slider ## Planned Features - Slick animations 😎 ## Install ### Alpine Linux ```zsh apk add swaync ```` ### Arch ```zsh sudo pacman -S swaync ``` Alternatively, [swaync-git](https://aur.archlinux.org/packages/swaync-git/) is available on the AUR. ### Fedora The package is available on COPR: ```zsh dnf copr enable erikreider/SwayNotificationCenter # Or latest stable release or -git package dnf install SwayNotificationCenter dnf install SwayNotificationCenter-git ``` ### Fedora Silverblue (and other rpm-ostree variants) The package can be layered over the base image after adding the Copr repo as an ostree repo: ```zsh sudo curl -sL -o /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:erikreider:SwayNotificationCenter.repo https://copr.fedorainfracloud.org/coprs/erikreider/SwayNotificationCenter/repo/fedora-$(rpm -E %fedora)/erikreider-SwayNotificationCenter-fedora-$(rpm -E %fedora).repo rpm-ostree install SwayNotificationCenter ``` ### Gentoo An **unofficial** ebuild is available in [GURU](https://github.com/gentoo/guru) ```zsh eselect repository enable guru emaint sync --repo guru emerge --ask gui-apps/swaync ``` ### OpenSUSE Tumbleweed ```zsh sudo zypper install SwayNotificationCenter ``` ### Ubuntu Lunar and later: ```zsh sudo apt install sway-notification-center ``` ### Debian Bookworm and later: ```zsh sudo apt install sway-notification-center ``` ### Guix The simplest way is to install it to user's profile: ```zsh guix install swaynotificationcenter ``` But we recommend to use [Guix Home](https://guix.gnu.org/manual/devel/en/html_node/Home-Configuration.html) to manage packages and their configurations declaratively. ### rde ```scm (use-modules (rde features wm)) ;; Include the following code into the list of your rde features: (feature-swaynotificationcenter) ``` ### Other #### Dependencies - `vala >= 0.56` - `meson` - `blueprint-compiler` - `git` - `scdoc` - `sassc` - `gtk4` - `gtk4-layer-shell` - `dbus` - `glib2` - `gobject-introspection` - `libgee` - `json-glib` - `libadwaita` - `gvfs` - `granite7` ##### Optional Dependencies - `libpulse` (requires meson build options change) - `libnotify` ```zsh meson setup build --prefix=/usr ninja -C build meson install -C build ``` ## Sway Usage ```ini # Notification Daemon exec swaync # Toggle control center bindsym $mod+Shift+n exec swaync-client -t -sw ``` ## Run To start the daemon (remember to kill any other notification daemon before running) ```zsh ./build/src/swaync ``` To toggle the panel ```zsh ./build/src/swaync-client -t ``` To reload the config ```zsh ./build/src/swaync-client -R ``` To reload css after changes ```zsh ./build/src/swaync-client -rs ``` ## Control Center Shortcuts - Up/Down: Navigate notifications - Home: Navigate to the latest notification - End: Navigate to the oldest notification - Escape/Caps_Lock: Close notification panel - Return: Execute default action or close notification if none - Delete/BackSpace: Close notification - Shift+C: Close all notifications - Shift+D: Toggle Do Not Disturb - Buttons 1-9: Execute alternative actions - Left click button / actions: Activate notification action - Middle/Right click notification: Close notification ## Configuring The main config file is located in `/etc/xdg/swaync/config.json`. Copy it over to your `.config/swaync/` folder to customize without needing root access. See `swaync(5)` man page for more information To reload the config, you'll need to run `swaync-client --reload-config` The main CSS style file is located in `/etc/xdg/swaync/style.css`. Copy it over to your `~/.config/swaync/` folder to customize without needing root access. For more advanced/larger themes, I recommend that you use the SCSS files from source and customize them instead. To use the SCSS files, compile with `sassc`. **Tip**: running swaync with `GTK_DEBUG=interactive swaync` will open a inspector window that'll allow you to see all of the CSS classes + other information. ## Toggle Buttons To add toggle buttons to your control center you can set the "type" in any acton to "toggle". The toggle button supports different commands depending on the state of the button and an "update-command" to update the state in case of changes from outside swaync. The update-command is called every time the control center is opened. The active toggle button also gains the css-class ".toggle:checked" `config.json` example: ```jsonc { "buttons-grid": { // also works with actions in menubar widget "actions": [ { "label": "WiFi", "type": "toggle", "active": true, "command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'", "update-command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'" } ] } } ``` ## Notification Inhibition Notifications can be inhibited through the provided `swaync-client` executable or through the DBus interface `org.erikreider.swaync.cc`. Here's an example of notification inhibition while screen sharing through `xdg-desktop-portal-wlr` ```conf # xdg-desktop-portal-wlr config [screencast] exec_before=swaync-client --inhibitor-add "xdg-desktop-portal-wlr" exec_after=swaync-client --inhibitor-remove "xdg-desktop-portal-wlr" ``` ## Scripting Scripting rules and logic: . Only one script can be fired per notification . Each script requires `exec` and at least one of the other properties . All listed properties must match the notification for the script to be ran . If any of the properties doesn't match, the script will be skipped . If a notification doesn't include one of the properties, that property will be skipped · If a script has `run-on` set to `action`, the script will only run when an action is taken on the notification More information can be found in the `swaync(5)` man page Notification information can be printed into a terminal by running `G_MESSAGES_DEBUG=all swaync` (when a notification appears). Config properties: ```jsonc { "scripts": { "example-script": { "exec": "Your shell command or script here...", "app-name": "Notification app-name Regex", "summary": "Notification summary Regex", "body": "Notification body Regex", "urgency": "Low or Normal or Critical", "category": "Notification category Regex" } } // other non scripting properties... } ``` `config.json` example: ```jsonc { "scripts": { // This script will only run when Spotify sends a notification containing // that exact summary and body "example-script": { "exec": "/path/to/myRickRollScript.sh", "app-name": "Spotify", "summary": "Never Gonna Give You Up", "body": "Rick Astley - Whenever You Need Somebody" } } // other non scripting properties... } ``` ### Disable scripting To completely disable scripting, the project needs to be built like so: ```zsh meson build -Dscripting=false ninja -C build meson install -C build ``` ## i3status-rs Example > **Note** Ths requires i3status-rs version 0.31.0+ i3status-rs config ```toml [[block]] block = "notify" format = " $icon {($notification_count.eng(w:1)) |}" driver = "swaync" [[block.click]] button = "left" action = "show" [[block.click]] button = "right" action = "toggle_paused" ``` ## Waybar Example This example requires a [Nerd Fonts](https://www.nerdfonts.com/) font to get the icons looking right Waybar config ```json "custom/notification": { "tooltip": true, "format": "{icon}", "format-icons": { "notification": "󱅫", "none": "󰂜", "dnd-notification": "󰂠", "dnd-none": "󰪓", "inhibited-notification": "󰂛", "inhibited-none": "󰪑", "dnd-inhibited-notification": "󰂛", "dnd-inhibited-none": "󰪑" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, ``` Waybar css file ```css #custom-notification { font-family: "NotoSansMono Nerd Font"; } ``` Alternatively, the number of notifications can be shown by adding `{0}` anywhere in the `format` field in the Waybar config ```jsonc "custom/notification": { "format": "{0} {icon}", // ... }, ``` ## Debugging Environment Variables - `G_MESSAGES_DEBUG=all`: Displays all of the debug messages. - `GTK_DEBUG=interactive`: Opens the GTK Inspector. - `G_ENABLE_DIAGNOSTIC=1`: If set to a non-zero value, this environment variable enables diagnostic messages, like deprecation messages for GObject properties and signals. - `G_DEBUG=fatal_criticals` or `G_DEBUG=fatal_warnings`: Causes GLib to abort the program at the first call to g_warning() or g_critical(). More can be read [here](https://www.manpagez.com/html/glib/glib-2.56.0/glib-running.php) SwayNotificationCenter-0.12.3/build-aux/000077500000000000000000000000001510261335300201215ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/build-aux/meson/000077500000000000000000000000001510261335300212425ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/build-aux/meson/postinstall.py000077500000000000000000000006261510261335300241770ustar00rootroot00000000000000#!/usr/bin/env python3 from os import environ, path from subprocess import call prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') datadir = path.join(prefix, 'share') destdir = environ.get('DESTDIR', '') # Package managers set this so we don't need to run if not destdir: print('Compiling GSettings schemas...') call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) SwayNotificationCenter-0.12.3/build-scripts/000077500000000000000000000000001510261335300210135ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/build-scripts/.gitignore000066400000000000000000000000341510261335300230000ustar00rootroot00000000000000./* !PKGBUILD* !*.rpkg.spec SwayNotificationCenter-0.12.3/build-scripts/PKGBUILD-git000066400000000000000000000024721510261335300227250ustar00rootroot00000000000000# vim: ft=sh # Maintainer: Erik Reider pkgname=swaync-git _pkgname=swaync pkgver=r645.0998431 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" } SwayNotificationCenter-0.12.3/build-scripts/swaync-git.rpkg.spec000066400000000000000000000070741510261335300247260ustar00rootroot00000000000000# 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}/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 }}} SwayNotificationCenter-0.12.3/build-scripts/swaync.rpkg.spec000066400000000000000000000066271510261335300241500ustar00rootroot00000000000000# vim: syntax=spec %global alt_pkg_name swaync Name: {{{ git_repo_name }}} Version: 0.12.3 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}/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 }}} SwayNotificationCenter-0.12.3/completions/000077500000000000000000000000001510261335300205635ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/completions/bash/000077500000000000000000000000001510261335300215005ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/completions/bash/swaync000066400000000000000000000015131510261335300227270ustar00rootroot00000000000000_swaync() { local cur prev _get_comp_words_by_ref cur prev short=( -h -v -s -c ) long=( --help --version --style --config ) case $prev in -s | --style) _filedir return ;; -c | --config) _filedir return ;; esac if [[ $cur == --* ]]; then COMPREPLY=($(compgen -W "${long[*]}" -- "$cur")) elif [[ $cur == -* ]]; then COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) else COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) COMPREPLY+=($(compgen -c -- "$cur")) fi } && complete -F _swaync swaync SwayNotificationCenter-0.12.3/completions/bash/swaync-client000066400000000000000000000030431510261335300242030ustar00rootroot00000000000000_swaync-client() { local cur prev _get_comp_words_by_ref cur prev short=( -h -v -R -rs -t -op -cp -d -D -dn -df -I -In -Ia -Ir -Ic -c -C -sw -s -swb ) long=( --help --version --reload-config --reload-css --toggle-panel --open-panel --close-panel --toggle-dnd --get-dnd --dnd-on --dnd-off --get-inhibited --get-num-inhibitors --inhibitor-add --inhibitor-remove --inhibitors-clear --count --hide-latest --hide-all --close-latest --close-all --skip-wait --subscribe --subscribe-waybar --change-cc-monitor --change-noti-monitor ) case $prev in -s | --style) _filedir return ;; -c | --config) _filedir return ;; esac if [[ $cur == --* ]]; then COMPREPLY=($(compgen -W "${long[*]}" -- "$cur")) elif [[ $cur == -* ]]; then COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) else COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) COMPREPLY+=($(compgen -c -- "$cur")) fi } && complete -F _swaync-client swaync-client SwayNotificationCenter-0.12.3/completions/fish/000077500000000000000000000000001510261335300215145ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/completions/fish/swaync-client.fish000066400000000000000000000052411510261335300251510ustar00rootroot00000000000000complete -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 SwayNotificationCenter-0.12.3/completions/fish/swaync.fish000066400000000000000000000004711510261335300236750ustar00rootroot00000000000000complete -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 SwayNotificationCenter-0.12.3/completions/zsh/000077500000000000000000000000001510261335300213675ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/completions/zsh/_swaync000066400000000000000000000004461510261335300227610ustar00rootroot00000000000000#compdef swaync _arguments -s \ '(-h --help)'{-h,--help}'[Show help options]' \ '(-v --version)'{-v,--version}'[Prints version]' \ '(-s --style)'{-s,--style}'[Use a custom Stylesheet file]:files:_files' \ '(-c --config)'{-c,--config}'[Use a custom config file]:files:_files' \ SwayNotificationCenter-0.12.3/completions/zsh/_swaync-client000066400000000000000000000043361510261335300242370ustar00rootroot00000000000000#compdef swaync-client _arguments -s \ '(-h --help)'{-h,--help}'[Show help options]' \ '(-v --version)'{-v,--version}'[Prints version]' \ '(-R --reload-config)'{-R,--reload-config}'[Reload the config file]' \ '(-rs --reload-css)'{-rs,--reload-css}'[Reload the css file. Location change requires restart]' \ '(-t --toggle-panel)'{-t,--toggle-panel}'[Toggle the notification panel]' \ '(-op --open-panel)'{-op,--open-panel}'[Opens the notification panel]' \ '(-cp --close-panel)'{-cp,--close-panel}'[Closes the notification panel]' \ '(-d --toggle-dnd)'{-d,--toggle-dnd}'[Toggle and print the current dnd state]' \ '(-D --get-dnd)'{-D,--get-dnd}'[Print the current dnd state]' \ '(-dn --dnd-on)'{-dn,--dnd-on}'[Turn dnd on and print the new dnd state]' \ '(-df --dnd-off)'{-df,--dnd-off}'[Turn dnd off and print the new dnd state]' \ '(-I --get-inhibited)'{-I,--get-inhibited}'[Print if currently inhibited or not]' \ '(-In --get-num-inhibitors)'{-In,--get-num-inhibitors}'[Print number of inhibitors]' \ '(-Ia --inhibitor-add)'{-Ia,--inhibitor-add}'[Add an inhibitor]' \ '(-Ir --inhibitor-remove)'{-Ir,--inhibitor-remove}'[Remove an inhibitor]' \ '(-Ic --inhibitors-clear)'{-Ic,--inhibitors-clear}'[Clears all inhibitors]' \ '(-c --count)'{-c,--count}'[Print the current notification count]' \ '(--hide-latest)'--hide-latest'[Hides latest notification. Still shown in Control Center]' \ '(--hide-all)'--hide-all'[Hides all notifications. Still shown in Control Center]' \ '(--close-latest)'--close-latest'[Closes latest notification]' \ '(-C --close-all)'{-C,--close-all}'[Closes all notifications]' \ '(-sw --skip-wait)'{-sw,--skip-wait}"[Doesn't wait when swaync hasn't been started]" \ '(-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]' \ '(--change-cc-monitor)'--change-cc-monitor'[Changes the preferred control center monitor (resets on config reload)]' \ '(--change-noti-monitor)'--change-noti-monitor'[Changes the preferred notification monitor (resets on config reload)]' \ SwayNotificationCenter-0.12.3/data/000077500000000000000000000000001510261335300171405ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/icons/000077500000000000000000000000001510261335300202535ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/icons/scalable/000077500000000000000000000000001510261335300220215ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/icons/scalable/actions/000077500000000000000000000000001510261335300234615ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/icons/scalable/actions/swaync-close-symbolic.svg000066400000000000000000000013771510261335300304400ustar00rootroot00000000000000 SwayNotificationCenter-0.12.3/data/icons/scalable/actions/swaync-collapse-symbolic.svg000066400000000000000000000014761510261335300311350ustar00rootroot00000000000000 SwayNotificationCenter-0.12.3/data/icons/scalable/actions/swaync-down-small-symbolic.svg000066400000000000000000000007441510261335300314050ustar00rootroot00000000000000 SwayNotificationCenter-0.12.3/data/icons/scalable/actions/swaync-up-small-symbolic.svg000066400000000000000000000007411510261335300310570ustar00rootroot00000000000000 SwayNotificationCenter-0.12.3/data/meson.build000066400000000000000000000024241510261335300213040ustar00rootroot00000000000000install_data('org.erikreider.swaync.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) compile_schemas = find_program('glib-compile-schemas', required: false) if compile_schemas.found() test('Validate schema file', compile_schemas, args: ['--strict', '--dry-run', meson.current_source_dir()] ) endif # SCSS Dependency sassc = find_program('sassc') assert(sassc.found()) # SCSS Compilation style_css = custom_target( 'SCSS Compilation', build_by_default: true, build_always_stale: true, input : 'style/style.scss', output : 'style.css', install: true, install_dir: config_path, command : [ sassc, '-t', 'expanded', '@INPUT@', '@OUTPUT@' ], ) message(style_css.full_path()) blueprints = custom_target('blueprints', input: files(run_command('find', '.', '-name', '*.blp').stdout().strip().split('\n')), output: '.', command: [ find_program('blueprint-compiler', required: true), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@' ], build_always_stale: true, build_by_default: true, ) app_resources += gnome.compile_resources('sway_notification_center-resources', 'sway_notification_center.gresource.xml', dependencies: [ blueprints ], c_name: 'sway_notification_center' ) SwayNotificationCenter-0.12.3/data/org.erikreider.swaync.gschema.xml000066400000000000000000000005631510261335300255120ustar00rootroot00000000000000 false The current do not disturb state Whether notifications should be silent or not SwayNotificationCenter-0.12.3/data/style/000077500000000000000000000000001510261335300203005ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/style/pre-gtk4-variables.scss000066400000000000000000000012541510261335300246020ustar00rootroot00000000000000/* Fallback for older CSS themes */ @define-color cc-bg rgba(46, 46, 46, 0.7); @define-color noti-border-color rgba(255, 255, 255, 0.15); @define-color noti-bg rgba(48, 48, 48, 0.8); @define-color noti-bg-opaque rgb(48, 48, 48); @define-color noti-bg-darker rgb(38, 38, 38); @define-color noti-bg-hover rgb(56, 56, 56); @define-color noti-bg-hover-opaque rgb(56, 56, 56); @define-color noti-bg-focus rgba(68, 68, 68, 0.6); @define-color noti-close-bg rgba(255, 255, 255, 0.1); @define-color noti-close-bg-hover rgba(255, 255, 255, 0.15); @define-color text-color rgb(255, 255, 255); @define-color text-color-disabled rgb(150, 150, 150); @define-color bg-selected rgb(0, 128, 255); SwayNotificationCenter-0.12.3/data/style/style.scss000066400000000000000000000227721510261335300223470ustar00rootroot00000000000000:root { --cc-bg: rgba(46, 46, 46, 0.7); --noti-border-color: rgba(255, 255, 255, 0.15); --noti-bg: 48, 48, 48; --noti-bg-alpha: 0.8; --noti-bg-darker: rgb(38, 38, 38); --noti-bg-hover: rgb(56, 56, 56); --noti-bg-focus: rgba(68, 68, 68, 0.6); --noti-close-bg: rgb(78, 78, 78); --noti-close-bg-hover: rgb(94, 94, 94); --text-color: rgb(255, 255, 255); --text-color-disabled: rgb(150, 150, 150); --bg-selected: rgb(0, 128, 255); --notification-icon-size: 64px; --notification-app-icon-size: calc(var(--notification-icon-size) / 3); --notification-group-icon-size: 32px; --border: 1px solid var(--noti-border-color); --border-radius: 12px; --notification-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), 0 2px 6px 2px rgba(0, 0, 0, 0.3); --font-size-body: 15px; --font-size-summary: 16px; /* Deprecated variables (because of their typos). Keeeping them around for backwards compatibility. */ --hover-tranistion: background 0.15s ease-in-out; --group-collapse-tranistion: opacity 400ms ease-in-out; --hover-transition: var(--hover-tranistion); --group-collapse-transition: var(--group-collapse-tranistion); } /* Fallback for older CSS themes */ @import "pre-gtk4-variables"; $margin: 8px; notificationwindow, blankwindow, blankwindow { background: transparent; } .close-button { /* The notification Close Button */ background: var(--noti-close-bg); color: var(--text-color); text-shadow: none; padding: 0; border-radius: 100%; margin-top: $margin; margin-right: $margin; box-shadow: none; border: none; min-width: 24px; min-height: 24px; &:hover { box-shadow: none; background: var(--noti-close-bg-hover); transition: var(--hover-tranistion); border: none; } } .notification-row { background: none; outline: none; &:focus { background: var(--noti-bg-focus); } .notification-background { padding: 6px 12px; .close-button {} .notification { /* The actual notification */ border-radius: var(--border-radius); border: var(--border); padding: 0; transition: var(--hover-tranistion); background: rgba(var(--noti-bg), var(--noti-bg-alpha)); &.low { /* Low Priority Notification */ } &.normal { /* Normal Priority Notification */ } &.critical { /* Critical Priority Notification */ } .notification-default-action { /* The large action that also displays the notification summary and body */ padding: $margin / 2; margin: 0; box-shadow: none; background: transparent; border: none; color: var(--text-color); transition: var(--hover-tranistion); border-radius: var(--border-radius); &:hover { -gtk-icon-filter: none; background: var(--noti-bg-hover); } &:not(:only-child) { /* When alternative actions are visible */ border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; } .notification-content { background: transparent; border-radius: var(--border-radius); $margin: 4px; padding: 0; .image { /* Notification Primary Image */ -gtk-icon-filter: none; -gtk-icon-size: var(--notification-icon-size); border-radius: 100px; /* Size in px */ margin: $margin; } .app-icon { /* Notification app icon (only visible when the primary image is set) */ -gtk-icon-filter: none; -gtk-icon-size: var(--notification-app-icon-size); -gtk-icon-shadow: 0 1px 4px black; margin: 6px; } .text-box { label { /* Fixes base GTK 4 CSS setting a filter of opacity 50% for some odd reason */ filter: none; } .summary { /* Notification summary/title */ font-size: var(--font-size-summary); font-weight: bold; background: transparent; color: var(--text-color); text-shadow: none; } .time { /* Notification time-ago */ font-size: var(--font-size-summary); font-weight: bold; background: transparent; color: var(--text-color); text-shadow: none; margin-right: 30px; } .body { /* Notification body */ font-size: var(--font-size-body); font-weight: normal; background: transparent; color: var(--text-color); text-shadow: none; } } progressbar { /* The optional notification progress bar */ margin-top: $margin; } .body-image { /* The "extra" optional bottom notification image */ margin-top: $margin; background-color: white; -gtk-icon-filter: none; } .inline-reply { /* The inline reply section */ margin-top: $margin; .inline-reply-entry { background: var(--noti-bg-darker); color: var(--text-color); caret-color: var(--text-color); border: var(--border); border-radius: var(--border-radius); } .inline-reply-button { margin-left: 4px; background: rgba(var(--noti-bg), var(--noti-bg-alpha)); border: var(--border); border-radius: var(--border-radius); color: var(--text-color); &:disabled { background: initial; color: var(--text-color-disabled); border: var(--border); border-color: transparent; } &:hover { background: var(--noti-bg-hover); } } } } } .notification-alt-actions { background: none; border-bottom-left-radius: var(--border-radius); border-bottom-right-radius: var(--border-radius); padding: $margin / 2; } .notification-action { /* The alternative actions below the default action */ margin: $margin / 2; padding: 0; &>button { border-radius: var(--border-radius); color: var(--text-color); } } } } } .notification-group { /* Styling only for Grouped Notifications */ transition: opacity 200ms ease-in-out; &:focus { background: var(--noti-bg-focus); } &.low { /* Low Priority Group */ } &.normal { /* Low Priority Group */ } &.critical { /* Low Priority Group */ } /* The groups close button */ .notification-group-close-button .close-button { margin: $margin * 1.5 $margin * 2.5; } %header { margin: 0 $margin * 2; color: var(--text-color); } .notification-group-headers { /* Notification Group Headers */ @extend %header; .notification-group-icon { color: var(--text-color); -gtk-icon-size: var(--notification-group-icon-size); } .notification-group-header { color: var(--text-color); } } .notification-group-buttons { /* Notification Group Buttons */ @extend %header; } &.collapsed { /* When another group is expanded, lower the opacity of the collapsed ones */ &.not-expanded { opacity: 0.4; } .notification-row { .notification { background-color: rgba(var(--noti-bg), 1); } &:not(:last-child) { /* Top notification in stack */ /* Set lower stacked notifications opacity to 0 */ .notification-action, .notification-default-action { opacity: 0; } } } &:hover { .notification-row:not(:only-child) { .notification { background-color: var(--noti-bg-hover); } } } } } .control-center { /* The Control Center which contains the old notifications + widgets */ background: var(--cc-bg); color: var(--text-color); border-radius: var(--border-radius); .control-center-list-placeholder { /* The placeholder when there are no notifications */ opacity: 0.5; } .control-center-list { /* List of notifications */ background: transparent; .notification { box-shadow: var(--notification-shadow); .notification-default-action, .notification-action { transition: var(--group-collapse-tranistion), var(--hover-tranistion); &:hover { background-color: var(--noti-bg-hover); } } } } } .blank-window { /* Window behind control center and on all other monitors */ background: transparent; } .floating-notifications { background: transparent; .notification { box-shadow: none; } } /*** Widgets ***/ .widget { margin: $margin; padding: $margin; border-radius: var(--border-radius); } /* Title widget */ @import "widgets/title"; /* DND widget */ @import "widgets/dnd"; /* Label widget */ @import "widgets/label"; /* Mpris widget */ @import "widgets/mpris"; /* Buttons widget */ @import "widgets/buttons"; /* Menubar widget */ @import "widgets/menubar"; /* Volume widget */ @import "widgets/volume"; /* Slider widget */ @import "widgets/slider"; /* Backlight widget */ @import "widgets/backlight"; /* Inhibitors widget */ @import "widgets/inhibitors"; SwayNotificationCenter-0.12.3/data/style/widgets/000077500000000000000000000000001510261335300217465ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/style/widgets/backlight.scss000066400000000000000000000000261510261335300245710ustar00rootroot00000000000000.widget-backlight { } SwayNotificationCenter-0.12.3/data/style/widgets/buttons.scss000066400000000000000000000003021510261335300243340ustar00rootroot00000000000000.widget-buttons-grid { & flowboxchild>button { border-radius: var(--border-radius); &.toggle:checked { /* style given to the active toggle button */ } &:hover {} } } SwayNotificationCenter-0.12.3/data/style/widgets/dnd.scss000066400000000000000000000004221510261335300234060ustar00rootroot00000000000000.widget-dnd { label { color: var(--text-color); margin-right: $margin; font-size: 1.1rem; } switch { border-radius: var(--border-radius); margin-left: $margin; &:checked {} slider { border-radius: var(--border-radius); } } } SwayNotificationCenter-0.12.3/data/style/widgets/inhibitors.scss000066400000000000000000000002631510261335300250160ustar00rootroot00000000000000.widget-inhibitors { & > label { margin-right: $margin; font-size: 1.5rem; } & > button { margin-left: $margin; border-radius: var(--border-radius); } } SwayNotificationCenter-0.12.3/data/style/widgets/label.scss000066400000000000000000000000731510261335300237220ustar00rootroot00000000000000.widget-label { & > label { font-size: 1.1rem; } } SwayNotificationCenter-0.12.3/data/style/widgets/menubar.scss000066400000000000000000000017431510261335300243010ustar00rootroot00000000000000.widget-menubar { & > .menu-button-bar { /* The left button container */ & > .start { margin-left: $margin; } /* The right button container */ & > .end { margin-right: $margin; } /* The left and right button container */ & > .widget-menubar-container { button { border-radius: var(--border-radius); margin: 0 $margin / 2; } } } /* The revealer buttons */ & > revealer { * { margin-top: $margin; button { border-radius: var(--border-radius); margin: $margin; margin-top: 0; &:last-child { margin-bottom: 0; } } } } /* .AnyName { Name defined in config after # background-color: rgba(var(--noti-bg), 1.0); padding: 8px; margin: 8px; border-radius: 12px; } .AnyName>button { background: transparent; border: none; } .AnyName>button:hover { background-color: var(--noti-bg-hover); } */ } SwayNotificationCenter-0.12.3/data/style/widgets/mpris.scss000066400000000000000000000025231510261335300237770ustar00rootroot00000000000000:root { --mpris-album-art-overlay: rgba(0, 0, 0, 0.55); --mpris-button-hover: rgba(0, 0, 0, 0.5); --mpris-album-art-icon-size: 96px; --mpris-album-art-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); } .widget-mpris { padding: 0; /* The parent to all players */ .widget-mpris-player { margin: 16px 20px; border-radius: var(--border-radius); box-shadow: var(--mpris-album-art-shadow); .mpris-background { filter: blur(10px); } .mpris-overlay { padding: 16px; background-color: var(--mpris-album-art-overlay); button:hover { /* The media player buttons (play, pause, next, etc...) */ background: var(--noti-bg-hover); } .widget-mpris-album-art { border-radius: var(--border-radius); box-shadow: var(--mpris-album-art-shadow); -gtk-icon-size: var(--mpris-album-art-icon-size); } .widget-mpris-title { font-weight: bold; font-size: 1.25rem; } .widget-mpris-subtitle { font-size: 1.1rem; } &>box>button { /* Change player control buttons */ &:hover { background-color: var(--mpris-button-hover); } } } } &>box>button { /* Change player side buttons */ } &>box>button:disabled { /* Change player side buttons insensitive */ } } SwayNotificationCenter-0.12.3/data/style/widgets/slider.scss000066400000000000000000000000711510261335300241230ustar00rootroot00000000000000.widget-slider { label { font-size: inherit; } } SwayNotificationCenter-0.12.3/data/style/widgets/title.scss000066400000000000000000000002561510261335300237670ustar00rootroot00000000000000.widget-title { & > label { margin-right: $margin; font-size: 1.5rem; } & > button { margin-left: $margin; border-radius: var(--border-radius); } } SwayNotificationCenter-0.12.3/data/style/widgets/volume.scss000066400000000000000000000005321510261335300241520ustar00rootroot00000000000000:root { --widget-volume-row-icon-size: 24px; } .widget-volume { } .widget-volume>box>button {} /* Each row app icon */ .widget-volume row image { -gtk-icon-size: var(--widget-volume-row-icon-size); } .per-app-volume { background-color: var(--noti-bg-alt); margin: $margin; margin-bottom: 0; border-radius: var(--border-radius); } SwayNotificationCenter-0.12.3/data/sway_notification_center.gresource.xml000066400000000000000000000015351510261335300267540ustar00rootroot00000000000000 icons/scalable/actions/swaync-collapse-symbolic.svg icons/scalable/actions/swaync-close-symbolic.svg icons/scalable/actions/swaync-up-small-symbolic.svg icons/scalable/actions/swaync-down-small-symbolic.svg ui/notification_window.ui ui/notification.ui ui/control_center.ui ui/mpris_player.ui ui/notifications_widget.ui SwayNotificationCenter-0.12.3/data/ui/000077500000000000000000000000001510261335300175555ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/data/ui/control_center.blp000066400000000000000000000007031510261335300232740ustar00rootroot00000000000000using Gtk 4.0; template $SwayNotificationCenterControlCenter: ApplicationWindow { name: "control-center-window"; styles [ "blank-window", ] ScrolledWindow window { hscrollbar-policy: never; overflow: hidden; styles [ "control-center", ] child: Viewport { child: $IterBox box { orientation: vertical; vexpand: true; styles [ "widgets", ] }; }; } } SwayNotificationCenter-0.12.3/data/ui/mpris_player.blp000066400000000000000000000044131510261335300227640ustar00rootroot00000000000000using Gtk 4.0; template $SwayNotificationCenterWidgetsMprisMprisPlayer: $Underlay { overflow: hidden; valign: fill; hexpand: true; underlay_child: Picture background_picture { content-fit: cover; styles [ "mpris-background", ] }; child: Box { orientation: vertical; styles [ "mpris-overlay", ] Box { vexpand: true; spacing: 12; Image album_art { icon-name: "audio-x-generic-symbolic"; use-fallback: true; pixel-size: 96; overflow: hidden; styles [ "widget-mpris-album-art", ] } Box { orientation: vertical; spacing: 4; hexpand: true; valign: center; Label title { justify: left; ellipsize: end; wrap-mode: word_char; xalign: 0; yalign: 0; styles [ "widget-mpris-title", ] } Label sub_title { justify: left; ellipsize: end; wrap-mode: word_char; xalign: 0; yalign: 0; styles [ "widget-mpris-subtitle", ] } } } Box { spacing: 6; halign: center; Button button_shuffle { has-frame: false; icon-name: "media-playlist-shuffle-symbolic"; styles [ "circular", "image-button", "flat", ] } Button button_prev { has-frame: false; icon-name: "media-seek-backward-symbolic"; styles [ "circular", "image-button", "flat", ] } Button button_play_pause { has-frame: false; icon-name: "media-playback-pause-symbolic"; styles [ "circular", "image-button", "flat", ] } Button button_next { has-frame: false; icon-name: "media-seek-forward-symbolic"; styles [ "circular", "image-button", "flat", ] } Button button_repeat { has-frame: false; icon-name: "media-playlist-repeat-symbolic"; styles [ "circular", "image-button", "flat", ] } } }; } SwayNotificationCenter-0.12.3/data/ui/notification.blp000066400000000000000000000102571510261335300227470ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $SwayNotificationCenterNotification: Adw.Bin { hexpand: true; styles [ "notification-row", ] Revealer revealer { transition-type: crossfade; reveal-child: false; hexpand: true; child: $DismissibleWidget dismissible_widget { halign: fill; valign: fill; child: Overlay base_widget { hexpand: true; styles [ "notification-background", ] $IterBox base_box { orientation: vertical; overflow: hidden; styles [ "notification", ] Box default_action { orientation: vertical; styles [ "notification-default-action", ] Box { orientation: vertical; spacing: 8; styles [ "notification-content", ] Box { // Box with images/icons Overlay { halign: center; valign: center; child: Image img { valign: center; overflow: hidden; styles [ "image", ] }; [overlay] Image img_app_icon { halign: end; valign: end; overflow: hidden; styles [ "app-icon", ] } } // Body, summary, and time Box { hexpand: true; vexpand: true; valign: center; orientation: vertical; styles [ "text-box", ] Box { orientation: horizontal; valign: center; Label summary { justify: left; ellipsize: end; wrap: false; xalign: 0; hexpand: true; styles [ "summary", ] } Label time { justify: left; ellipsize: none; valign: start; styles [ "time", ] } } Label body { ellipsize: end; justify: left; wrap-mode: word_char; natural-wrap-mode: word; lines: 1; xalign: 0; yalign: 0; hexpand: true; styles [ "body", ] } } } ProgressBar progress_bar { orientation: horizontal; } Picture body_image { halign: center; overflow: hidden; } Box inline_reply_box { styles [ "inline-reply", ] Entry inline_reply_entry { input-purpose: free_form; input-hints: spellcheck | emoji; hexpand: true; styles [ "inline-reply-entry", ] } Button inline_reply_button { styles [ "inline-reply-button", ] } } } } FlowBox alt_actions_box { orientation: horizontal; homogeneous: true; overflow: hidden; selection-mode: none; activate-on-single-click: true; styles [ "notification-alt-actions", ] } } [overlay] $SwayNotificationCenterNotificationCloseButton close_button {} }; }; } } SwayNotificationCenter-0.12.3/data/ui/notification_window.blp000066400000000000000000000006461510261335300243370ustar00rootroot00000000000000using Gtk 4.0; template $SwayNotificationCenterNotificationWindow: Gtk.ApplicationWindow { styles [ "floating-notifications", ] Gtk.ScrolledWindow scrolled_window { propagate-natural-height: true; hscrollbar-policy: never; vscrollbar-policy: automatic; has-frame: false; $AnimatedList list { scroll_to_append: true; transition_children: true; vexpand: true; } } } SwayNotificationCenter-0.12.3/data/ui/notifications_widget.blp000066400000000000000000000023361510261335300244740ustar00rootroot00000000000000using Gtk 4.0; template $SwayNotificationCenterWidgetsNotifications: $SwayNotificationCenterWidgetsBaseWidget { orientation: vertical; overflow: hidden; Stack stack { hhomogeneous: true; vhomogeneous: true; transition-type: crossfade; transition-duration: 200; vexpand: true; StackPage { name: "notifications-list"; child: ScrolledWindow scrolled_window { hscrollbar-policy: never; has-frame: false; child: Viewport viewport { vexpand: true; child: ListBox list_box { valign: fill; styles [ "control-center-list", ] }; }; }; } StackPage { name: "notifications-placeholder"; child: Box { halign: center; valign: center; hexpand: true; vexpand: true; orientation: vertical; spacing: 12; styles [ "control-center-list-placeholder", ] Image { pixel-size: 96; icon-name: "preferences-system-notifications-symbolic"; use-fallback: true; } Label text_empty_label { label: "No Notifications"; } }; } } } SwayNotificationCenter-0.12.3/man/000077500000000000000000000000001510261335300170025ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/man/swaync-client.1.scd000066400000000000000000000033701510261335300224170ustar00rootroot00000000000000swaync-client(1) # NAME swaync-client - Client executable # USAGE *swaync-client* [option] # OPTIONS *-h, --help* Show help options *-v, --version* Prints version *-R, --reload-config* Reload the config file *-rs, --reload-css* Reload the css file. Location change requires restart *-t, --toggle-panel* Toggle the notification panel *-op, --open-panel* Opens the notification panel *-cp, --close-panel* Closes the notification panel *-d, --toggle-dnd* Toggle and print the current dnd state *-D, --get-dnd* Print the current dnd state *-dn, --dnd-on* Turn dnd on and print the new dnd state *-df, --dnd-off* Turn dnd off and print the new dnd state *-I, --get-inhibited* Print if currently inhibited or not *-In, --get-num-inhibitors* Print number of inhibitors *-Ia, --inhibitor-add [APP_ID]* Add an inhibitor *-Ir, --inhibitor-remove [APP_ID]* Remove an inhibitor *-Ic, --inhibitors-clear* Clears all inhibitors *-c, --count* Print the current notification count *--hide-latest* Hides latest notification. Still shown in Control Center *--hide-all* Hides all notifications. Still shown in Control Center *--close-latest* Closes latest notification *-C, --close-all* Closes all notifications *-a, --action [ACTION_INDEX]* Invokes the action [ACTION_INDEX] (or 0) of the latest notification *-sw, --skip-wait* Doesn't wait when swaync hasn't been started *-s, --subscribe* Subscribe to notification add and close events *-swb, --subscribe-waybar* Subscribe to notification add and close events with waybar support. Read README for example *--change-cc-monitor* Changes the preferred control center monitor (resets on config reload) *--change-noti-monitor* Changes the preferred notification monitor (resets on config reload) SwayNotificationCenter-0.12.3/man/swaync.1.scd000066400000000000000000000070661510261335300211510ustar00rootroot00000000000000swaync(1) # NAME swaync - A simple notification daemon with a GTK gui for notifications and the control center # USAGE *swaync* [option] # OPTIONS *-h, --help* Show help options *-v, --version* Prints version *-s, --style* Use a custom Stylesheet file *--skip-system-css* Skip trying to parse the packaged Stylesheet file. Useful for CSS debugging *-c, --config* Use a custom config file # Control Center Keyboard Shortcuts *Up/Down*: Navigate notifications *Home*: Navigate to the latest notification *End*: Navigate to the oldest notification *Escape/Caps_Lock*: Close notification panel *Return*: Execute default action or close notification if none *Delete/BackSpace*: Close notification *Shift+C*: Close all notifications *Shift+D*: Toggle Do Not Disturb *Buttons 1-9*: Execute alternative actions *Left click button / actions*: Activate notification action *Middle/Right click notification*: Close notification # CONFIGURATION The main config file is located in */etc/xdg/swaync/config.json*. Copy it over to your *~/.config/swaync/* folder to customize without needing root access. To reload the config, you'll need to run *swaync-client --reload-config* For information on the config file format, see *swaync*(5) # Scripting Scripting rules and logic: . *Only one* script can be fired per notification . Each script requires `exec` and at least one of the other properties . All listed properties must match the notification for the script to be ran . If any of the properties doesn't match, the script 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 *G_MESSAGES_DEBUG=all swaync* (when a notification appears). Config properties: ``` { "scripts": { "example-script": { "exec": "Your shell command or script here...", "app-name": "Notification app-name Regex", "summary": "Notification summary Regex", "body": "Notification body Regex", "urgency": "Low or Normal or Critical", "category": "Notification category Regex" } } other non scripting properties... } ``` *config.json* example: ``` { "scripts": { // This script will only run when Spotify sends a notification containing // that exact summary and body "example-script": { "exec": "~/.config/swaync/myRickRollScript.sh", "app-name": "Spotify" "summary": "Never Gonna Give You Up", "body": "Rick Astley - Whenever You Need Somebody" } } other non scripting properties... } ``` ## Disable scripting To completely disable scripting, the project needs to be built like so: ``` meson build -Dscripting=false ninja -C build meson install -C build ``` # Waybar Example This example requires *NotoSansMono Nerd Font* to get the icons looking right Waybar config ``` "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "", "none": "", "dnd-notification": "", "dnd-none": "", "inhibited-notification": "", "inhibited-none": "", "dnd-inhibited-notification": "", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, ``` Waybar css file ``` #custom-notification { font-family: "NotoSansMono Nerd Font"; } ``` SwayNotificationCenter-0.12.3/man/swaync.5.scd000066400000000000000000000642051510261335300211530ustar00rootroot00000000000000swaync(5) # NAME swaync - Configuration file # CONFIGURATION Using a text editor with a JSON language server is recommended when editing the config file to be able to detect config errors *ignore-gtk-theme* ++ type: bool ++ default: true ++ description: Unsets the GTK_THEME environment variable, fixing a lot of ++ issues with GTK themes ruining the users custom CSS themes. *positionX* ++ type: string ++ default: right ++ values: left, right, center ++ description: Horizontal position of control center and notification window *positionY* ++ type: string ++ default: top ++ values: top, center, bottom ++ description: Vertical position of control center and notification window *layer* ++ type: string ++ default: overlay ++ values: background, bottom, top, overlay ++ description: Layer of notification window relative to normal windows. ++ background is below all windows, overlay is above all windows. *layer-shell* ++ type: bool ++ default: true ++ description: Wether or not the windows should be opened as layer-shell ++ surfaces. Note: Requires swaync restart to apply *cssPriority* ++ type: string ++ default: application ++ values: application, user ++ description: Which GTK priority to use when loading the default and user ++ CSS files. Pick "user" to override *XDG_CONFIG_HOME/gtk-3.0/gtk.css* *control-center-positionX* ++ type: string ++ default: right ++ values: left, right, center ++ description: Optional: Horizontal position of the control center. ++ Supersedes positionX if not set to `none`. *control-center-positionY* ++ type: string ++ default: top ++ values: top, center, bottom ++ description: Optional: Vertical position of the control center. ++ Supersedes positionY if not set to `none`. *control-center-margin-top* ++ type: integer ++ default: 0 ++ description: The margin (in pixels) at the top of the notification center. 0 to disable *control-center-margin-bottom* ++ type: integer ++ default: 0 ++ description: The margin (in pixels) at the bottom of the notification center. 0 to disable *control-center-margin-right* ++ type: integer ++ default: 0 ++ description: The margin (in pixels) at the right of the notification center. 0 to disable *control-center-margin-left* ++ type: integer ++ default: 0 ++ description: The margin (in pixels) at the left of the notification center. 0 to disable *control-center-layer* ++ type: string ++ default: top ++ values: background, bottom, top, overlay ++ description: Layer of control center window relative to normal windows. ++ background is below all windows, overlay is above all windows. *control-center-exclusive-zone* ++ type: bool ++ default: true ++ description: Whether or not the control center should follow the ++ compositors exclusive zones. An example would be setting it to ++ *false* to cover your panel/dock. *notification-2fa-action* ++ type: bool ++ default: true ++ description: If each notification should display a 'COPY \"1234\"' action *timeout* ++ type: integer ++ default: 10 ++ description: The notification timeout for notifications with normal priority *timeout-low* ++ type: integer ++ default: 5 ++ description: The notification timeout for notifications with low priority *timeout-critical* ++ type: integer ++ default: 0 ++ description: The notification timeout for notifications with critical priority. 0 to disable *notification-window-width* ++ type: integer ++ default: 500 ++ description: Width of the notification in pixels *notification-window-height* ++ type: integer ++ default: -1 ++ description: Max height of the notification in pixels. -1 to use ++ the full amount of space given by the compositor. *notification-window-preferred-output* ++ type: string ++ default: "" ++ description: The preferred output to open the notification window ++ (popup notifications). Can either be the monitor connector ++ name (ex: "DP-1"), or the full name, manufacturer model serial ++ (ex: "Acer Technologies XV272U V 503023B314202"). ++ If the output is not found, the currently focused one is picked. *keyboard-shortcuts* ++ type: bool ++ default: true ++ description: If control center should use keyboard shortcuts *notification-grouping* ++ type: bool ++ default: true ++ description: If notifications should be grouped by app name *image-visibility* ++ type: string ++ default: always ++ values: always, when-available, never ++ description: An explanation about the purpose of this instance. *transition-time* ++ type: integer ++ default: 200 ++ description: The notification animation duration. 0 to disable *hide-on-clear* ++ type: bool ++ default: false ++ description: Hides the control center after pressing "Clear All" *hide-on-action* ++ type: bool ++ default: true ++ description: Hides the control center when clicking on notification action *text-empty* ++ type: string ++ default: "No Notifications" ++ description: Text that appears when there are no notifications to show *fit-to-screen* ++ type: bool ++ default: true ++ description: Whether the control center should expand vertically to fill the screen *relative-timestamps* ++ type: bool ++ default: true ++ description: Display notification timestamps relative to now e.g. \"26 minutes ago\". ++ If false, a local iso8601-formatted absolute timestamp is displayed. *control-center-height* ++ type: integer ++ default: 500 ++ description: Height of the control center in pixels. ++ A value of -1 means that it will fit to the content. ++ Ignored when 'fit-to-screen' is set to 'true'. ++ Also limited to the height of the monitor, unless ++ 'layer-shell-cover-screen' is set to false. *control-center-width* ++ type: integer ++ default: 500 ++ description: The control center width in pixels *control-center-preferred-output* ++ type: string ++ default: "" ++ description: The preferred output to open the control center. Can either ++ be the monitor connector name (ex: "DP-1"), or ++ the full name, manufacturer model serial ++ (ex: "Acer Technologies XV272U V 503023B314202"). If the ++ output is not found, the currently focused one is picked. *notification-action-filter* ++ type: object ++ visibility object properties: ++ *use-regex*++ type: bool ++ optional: true ++ default: false ++ description: Indicates if all the below fields should use ++ regex or not.++ *app-name*++ type: string ++ optional: true ++ description: The app-name.++ *desktop-entry*++ type: string ++ optional: true ++ description: The desktop-entry.++ *id-matcher*++ type: string ++ optional: true (needs at least one *matcher*) ++ description: Matches the actions identifier. Can be found by ++ reading the output of swaync when run with the ++ *G_MESSAGES_DEBUG=all* environment variable.++ *text-matcher*++ type: string ++ optional: true (needs at least one *matcher*) ++ description: Matches the actions text visible in the notification. ++ description: Hides matching action(s) of matching notifications. ++ If the notification doesn't include one of the properties, that ++ property will be ignored. If all properties match the given ++ notification, the matching actions will be hidden. ++ example: ``` { "notification-action-filter": { "hide-chromium-settings": { "desktop-entry": "chromium-browser", "use-regex": false, "id-matcher": "settings", "text-matcher": "Settings" } }, } ``` *notification-visibility* ++ type: object ++ visibility object properties: ++ *state*++ type: string ++ optional: false ++ default: enabled ++ values: ignored, muted, transient, enabled ++ description: The notification visibility state. ++ *override-urgency*++ type: string ++ optional: true ++ default: unset ++ values: unset, low, normal, critical ++ description: The new urgency for the notification if set.++ *app-name*++ type: string ++ optional: true ++ description: The app-name. Uses Regex.++ *desktop-entry*++ type: string ++ optional: true ++ description: The desktop-entry. Uses Regex.++ *summary*++ type: string ++ optional: true ++ description: The summary of the notification. Uses Regex.++ *body*++ type: string ++ optional: true ++ description: The body of the notification. Uses Regex.++ *urgency*++ type: string ++ optional: true ++ default: Normal ++ values: Low, Normal, Critical ++ description: The urgency of the notification.++ *category*++ type: string ++ optional: true ++ description: Which category the notification belongs to. Uses Regex.++ description: Set the visibility or override urgency of each incoming ++ notification. ++ If the notification doesn't include one of the properties, that ++ property will be ignored. All properties (except for state) use ++ regex. If all properties match the given notification, the ++ notification will be follow the provided state. ++ Only the first matching object will be used. ++ example: ``` { "notification-visibility": { "example-name": { "state": "The notification state", "app-name": "Notification app-name Regex", "summary": "Notification summary Regex", "body": "Notification body Regex", "urgency": "Low or Normal or Critical", "category": "Notification category Regex" } } } ``` *widgets* ++ type: array ++ Default values: ["title", "dnd", "notifications"] ++ Valid array values (see *widget-config* for more information): ++ *notifications*++ required: true ++ optional: false ++ *title*++ optional: true ++ *dnd*++ optional: true ++ *label*++ optional: true ++ *mpris*++ optional: true ++ *menubar*++ optional: true ++ *buttons-grid*++ optional: true ++ *slider*++ optional: true ++ #START pulse-audio *volume*++ optional: true ++ #END pulse-audio *backlight*++ optional: true ++ *inhibitors*++ optional: true ++ description: ++ Which order and which widgets to display. ++ If the \"notifications\" widget isn't specified, it ++ will be placed at the bottom. ++ multiple of same widget: ++ Append a # with any value to the end of the widget name. ++ Example: "title#TheMainTitle" ++ To address this widget specifically in the css file use the css class .TheMainTitle ++ example: ``` { "widgets": [ "inhibitors", "title", "dnd", "notifications" ] } ``` *widget-config* ++ type: object ++ description: Configure specific widget properties. ++ multiple of same widget: ++ Append a # with any value to the end of the widget name. ++ Example: "title#TheMainTitle" ++ To address this widget specifically in the css file use the css class .TheMainTitle ++ Widgets to customize: ++ *notifications*++ type: object ++ css class: widget-notifications ++ properties: ++ vexpand: ++ type: bool ++ optional: true ++ default: true ++ description: Whether or not the notifications widget ++ should vertically expand or not ++ description: The Notifications Widget. ++ *title*++ type: object ++ css class: widget-title ++ properties: ++ text: ++ type: string ++ optional: true ++ default: "Notifications" ++ description: The title of the widget ++ clear-all-button: ++ type: bool ++ optional: true ++ default: true ++ description: Whether to display a "Clear All" button ++ button-text: ++ type: string ++ optional: true ++ default: "Clear All" ++ description: "Clear All" button text ++ description: The notification visibility state. ++ *dnd*++ type: object ++ css class: widget-dnd ++ properties: ++ text: ++ type: string ++ optional: true ++ default: "Do Not Disturb" ++ description: The title of the widget ++ description: Control Center Do Not Disturb Widget. ++ *label*++ type: object ++ css class: widget-label ++ properties: ++ text: ++ type: string ++ optional: true ++ default: "Label Text" ++ description: The text content of the widget ++ clear-all-button: ++ type: integer ++ optional: true ++ default: 5 ++ description: The maximum lines ++ description: A generic widget that allows the user to add custom text. ++ *mpris*++ type: object ++ css classes: ++ widget-mpris ++ widget-mpris-player ++ widget-mpris-title ++ widget-mpris-subtitle ++ properties: ++ blacklist: ++ type: array ++ optional: true ++ default: [] ++ description: Audio sources for the mpris widget to ignore. ++ Valid array values: ++ type: string ++ description: Audio source/app name. Regex allowed. Hint ++ `$ qdbus | grep mpris` to find source names. ++ autohide: ++ type: bool ++ optional: true ++ default: false ++ description: Whether to hide the widget when the ++ player has no metadata. ++ show-album-art: ++ type: string ++ optional: true ++ default: "always" ++ description: Whether or not the album art should be ++ hidden, always visible, or only visible ++ when a valid album art is provided. ++ enum: ["right", "left"] ++ loop-carousel: ++ type: bool ++ optional: true ++ default: false ++ description: Whether to loop through the mpris carousel. ++ description: A widget that displays multiple music players. ++ *menubar*++ type: object ++ css classes: ++ widget-menubar ++ .widget-menubar>box>.menu-button-bar ++ name of element given after menu or buttons with # ++ patternProperties: ++ menu#: ++ type: object ++ properties: ++ label: ++ type: string ++ optional: true ++ default: "Menu" ++ description: Label of button to show/hide menu dropdown ++ position: ++ type: string ++ optional: true ++ default: "right" ++ description: Horizontal position of the button in the bar ++ enum: ["right", "left"] ++ animation-type: ++ type: string ++ optional: true ++ default: "slide_down" ++ description: Animation type for menu++ enum: ["slide_down", "slide_up", "none"] ++ animation-duration: ++ type: integer ++ optional: true ++ default: 250 ++ description: Duration of animation in milliseconds ++ actions: ++ type: array ++ Default values: [] ++ Valid array values: ++ type: object ++ properties: ++ label: ++ type: string ++ default: "label" ++ description: Text to be displayed in button ++ command: ++ type: string ++ default: "" ++ description: "Command to be executed on click" ++ type: ++ type: string ++ default: "normal" ++ description: Type of the button. ++ Toggle buttons receive the '.active' css class ++ enum: ["normal", "toggle"] ++ update-command: ++ type: string ++ default: "" ++ description: "Command to be executed on visibility change of ++ cc to update the active state of the toggle button (should ++ echo true or false)" ++ active: ++ type: bool ++ default: false ++ description: Wether the toggle button is active as default or not ++ description: A list of actions containing a label and a command ++ description: A button to reveal a dropdown with action-buttons ++ buttons#: ++ type: object ++ properties: ++ position: ++ type: string ++ optional: true ++ default: "right" ++ description: Horizontal position of the buttons in the bar ++ enum: ["right", "left"] ++ actions: ++ type: array ++ Default values: [] ++ Valid array values: ++ type: object ++ properties: ++ label: ++ type: string ++ default: "label" ++ description: Text to be displayed in button ++ command: ++ type: string ++ default: "" ++ description: "Command to be executed on click" ++ type: ++ type: string ++ default: "normal" ++ description: Type of the button ++ Toggle buttons receive the '.active' css class and an env ++ variable "SWAYNC_TOGGLE_STATE" is set. See example usage in the ++ default config.json ++ enum: ["normal", "toggle"] ++ update-command: ++ type: string ++ default: "" ++ description: "Command to be executed on visibility change of ++ cc to update the active state of the toggle button (should ++ echo true or false)" ++ active: ++ type: bool ++ default: false ++ description: Wether the toggle button is active as default or not ++ description: A list of actions containing a label and a command ++ description: A list of buttons to be displayed in the menu-button-bar ++ *buttons-grid*++ type: object ++ css class: widget-buttons (access buttons with >flowbox>flowboxchild>button) ++ properties: ++ buttons-per-row: ++ type: number ++ actions: ++ type: array ++ Default values: [] ++ Valid array values: ++ type: object ++ properties: ++ label: ++ type: string ++ default: "label" ++ description: Text to be displayed in button ++ command: ++ type: string ++ default: "" ++ description: "Command to be executed on click" ++ type: ++ type: string ++ default: "normal" ++ description: Type of the button ++ Toggle buttons receive the '.active' css class and an env ++ variable "SWAYNC_TOGGLE_STATE" is set. See example usage in the ++ default config.json ++ enum: ["normal", "toggle"] ++ active: ++ type: bool ++ default: false ++ description: Wether the toggle button is active as default or not ++ description: A list of actions containing a label and a command ++ description: A grid of buttons that execute shell commands ++ *slider*++ type: object ++ css class: widget-slider ++ properties: ++ label: ++ type: string ++ optional: true ++ default: "slider" ++ description: Text displayed in front of the slider ++ cmd_setter: ++ type: string ++ optional: true ++ default: "" ++ description: command to set the value. Use $value to get ++ the current value. ++ cmd_getter: ++ type: string ++ optional: true ++ default: "" ++ description: command to get the actual value. ++ Use $value to get the current value. ++ min: ++ type: integer ++ optional: true ++ default: 0 ++ description: minimum value of the slider range ++ max: ++ type: integer ++ optional: true ++ default: 100 ++ description: maximum value of the slider range ++ min_limit: ++ type: integer ++ optional: true ++ default: 0 ++ description: limit minimum value of the slider ++ max_limit: ++ type: integer ++ optional: true ++ default: 100 ++ description: limit maximum value of the slider ++ value_scale: ++ type: integer ++ optional: true ++ default: 0 ++ description: scale small value, slider round digits ++ description: general slider control ++ #START pulse-audio *volume*++ type: object ++ css class: ++ widget-volume ++ per-app-volume ++ properties: ++ label: ++ type: string ++ optional: true ++ default: "Volume" ++ description: Text displayed in front of the volume slider ++ show-per-app: ++ type: bool ++ optional: true ++ default: false ++ description: Show per app volume control ++ show-per-app-icon: ++ type: bool ++ optional: true ++ default: false ++ description: Show application icon in per app control ++ show-per-app-label: ++ type: bool ++ optional: true ++ default: false ++ description: Show application name in per app control ++ expand-per-app: ++ type: bool ++ optional: true ++ default: false ++ description: If the per app section should start expanded ++ empty-list-label: ++ type: string ++ optional: true ++ default: "No active sink input" ++ description: Text displayed when there are not active sink inputs ++ expand-button-label: ++ type: string ++ optional: true ++ default: "⇧" ++ description: Label displayed on button to show per app volume control ++ collapse-button-label: ++ type: string ++ optional: true ++ default: "⇩" ++ description: Label displayed on button to hide per app volume control ++ animation-type: ++ type: string ++ optional: true ++ default: "slide_down" ++ description: Animation type for the per app volume control ++ enum: ["slide_down", "slide_up", "none"] ++ animation-duration: ++ type: integer ++ optional: true ++ default: 250 ++ description: Duration of animation in milliseconds ++ description: Slider to control pulse volume ++ #END pulse-audio *backlight*++ type: object ++ css class: widget-backlight ++ properties: ++ label: ++ type: string ++ optional: true ++ default: "Brightness" ++ description: Text displayed in front of the backlight slider ++ device: ++ type: string ++ optional: true ++ default: "intel_backlight" ++ description: Device in `/sys/class/backlight` or `/sys/class/leds` ++ subsystem: ++ type: string ++ optional: true ++ default: "backlight" ++ description: Kernel subsystem for brightness control ++ enum: ["backlight", "leds"] ++ min: ++ type: integer ++ optional: true ++ default: 0 ++ description: Lowest possible value for brightness ++ description: Slider to control screen brightness ++ *inhibitors*++ type: object ++ css class: widget-inhibitors ++ properties: ++ text: ++ type: string ++ optional: true ++ default: "Inhibitors" ++ description: The title of the widget ++ clear-all-button: ++ type: bool ++ optional: true ++ default: true ++ description: Whether to display a "Clear All" button ++ button-text: ++ type: string ++ optional: true ++ default: "Clear All" ++ description: "Clear All" button text ++ description: Displayed if notifications are inhibited. example: ``` { "widget-config": { "title": { "text": "Notifications", "clear-all-button": true, "button-text": "Clear All" }, "dnd": { "text": "Do Not Disturb" }, "label": { "max-lines": 5, "text": "Label Text" }, "mpris": { "blacklist": ["playerctld"], "autohide": true, "show-album-art": "always", "loop-carousel": false }, "menubar": { "menu#power": { "label": "Power", "position": "right", "actions": [ { "label": "Shut down", "command": "systemctl poweroff" }, ... ] }, "buttons#screenshot": { "position": "left", "actions": [ { "label": "Screenshot", "command": "grim" }, ... ] } }, "buttons": { "actions": [ { "label": "wifi", "command": "rofi-wifi-menu" }, ... ] } } } ``` #START scripting # Scripts *script-fail-notify* ++ type: bool ++ default: true ++ description: Sends a notification if a script fails to run *scripts* ++ type: object ++ script object properties: ++ *exec*++ type: string ++ optional: false ++ description: The script to run. Can also run regular shell commands.++ *app-name*++ type: string ++ optional: true ++ description: The app-name. Uses Regex.++ *desktop-entry*++ type: string ++ optional: true ++ description: The desktop-entry. Uses Regex.++ *summary*++ type: string ++ optional: true ++ description: The summary of the notification. Uses Regex.++ *body*++ type: string ++ optional: true ++ description: The body of the notification. Uses Regex.++ *urgency*++ type: string ++ optional: true ++ default: Normal ++ values: Low, Normal, Critical ++ description: The urgency of the notification.++ *category*++ type: string ++ optional: true ++ description: Which category the notification belongs to. Uses Regex.++ *sound-file*++ type: string ++ optional: true ++ description: Which sound file the notification requested. Uses Regex.++ *sound-name*++ type: string ++ optional: true ++ description: Which sound name the notification requested. Uses Regex.++ *run-on*++ type: string ++ optional: true ++ values: action, receive ++ default: receive ++ description: Whether to run this action when the notification is ++ received, or when an action is taken on it. ++ description: Which scripts to check and potentially run for every ++ notification. If the notification doesn't include one of the properties, ++ that property will be ignored. All properties (except for exec) use regex. ++ If all properties match the given notification, the script will be run. ++ Only the first matching script will be run. ++ example: ``` { "scripts": { "example-script": { "exec": "Your shell command or script here...", "app-name": "Notification app-name Regex", "summary": "Notification summary Regex", "body": "Notification body Regex", "urgency": "Low or Normal or Critical", "category": "Notification category Regex" } } } ``` You can also use these environment variables in your script: ``` $SWAYNC_BODY="Notification body content" $SWAYNC_DESKTOP_ENTRY="Desktop entry" $SWAYNC_URGENCY="Notification urgency" $SWAYNC_TIME="Notification time" $SWAYNC_APP_NAME="Notification app name" $SWAYNC_CATEGORY="SwayNC notification category" $SWAYNC_REPLACES_ID="ID of notification to replace" $SWAYNC_ID="SwayNC notification ID" $SWAYNC_SUMMARY="Notification summary" $SWAYNC_HINT_[NAME]="Value of the hint [NAME]" $SWAYNC_SOUND_NAME="The name of the requested sound" $SWAYNC_SOUND_FILE="The file path of the requested sound" ``` #END scripting SwayNotificationCenter-0.12.3/meson.build000066400000000000000000000114001510261335300203650ustar00rootroot00000000000000project('sway-notificaton-center', ['c', 'vala'], version: '0.12.3', meson_version: '>= 0.60.0', default_options: [ 'warning_level=2' ], ) add_project_arguments(['-Wno-error=int-conversion'], language: 'c') add_project_arguments(['--enable-gobject-tracing'], language: 'vala') add_project_arguments(['--enable-checking'], language: 'vala') cc = meson.get_compiler('c') vala = meson.get_compiler('vala') gnome = import('gnome') app_resources = [] config_path = join_paths(get_option('sysconfdir'), 'xdg', 'swaync') # Wayland protocols protocol_dep = [] subdir('protocols') subdir('data') subdir('src') datadir = get_option('datadir') libdir = get_option('libdir') conf_data = configuration_data() conf_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir'))) # Dbus service configure_file( configuration: conf_data, input: 'services/dbus/org.erikreider.swaync.service.in', output: '@BASENAME@', install_dir: datadir + '/dbus-1/services' ) # Systemd service unit systemd = dependency('systemd', required: false) if get_option('systemd-service') if systemd.found() systemd_service_install_dir = systemd.get_variable(pkgconfig :'systemduserunitdir') else systemd_service_install_dir = join_paths(libdir, 'systemd', 'user') endif configure_file( configuration: conf_data, input: 'services/systemd/swaync.service.in', output: '@BASENAME@', install_dir: systemd_service_install_dir ) endif # Zsh completion if get_option('zsh-completions') zsh_files = files( 'completions/zsh/_swaync', 'completions/zsh/_swaync-client', ) zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions') install_data(zsh_files, install_dir: zsh_install_dir) endif # Bash completion bash_comp = dependency('bash-completion', required: false) if get_option('bash-completions') bash_files = files( 'completions/bash/swaync', 'completions/bash/swaync-client', ) if bash_comp.found() bash_install_dir = bash_comp.get_variable( pkgconfig: 'completionsdir', pkgconfig_define: ['datadir', datadir] ) else bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') endif install_data(bash_files, install_dir: bash_install_dir) endif # Fish completion fish_comp = dependency('fish', required: false) if get_option('fish-completions') fish_files = files( 'completions/fish/swaync.fish', 'completions/fish/swaync-client.fish', ) if fish_comp.found() fish_install_dir = fish_comp.get_variable( pkgconfig: 'completionsdir', pkgconfig_define: ['datadir', datadir] ) else fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') endif install_data(fish_files, install_dir: fish_install_dir) endif # Man pages if get_option('man-pages') scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: true) sed = find_program(['sed', '/usr/bin/sed'], required : true) if scdoc.found() and sed.found() scdoc_prog = find_program(scdoc.get_variable(pkgconfig :'scdoc'), native: true) # Remove parts of man page if necessary sed_command = [] foreach option : ['pulse-audio', 'scripting'] if get_option(option) == false # Removes all lines between the #START and #END lines (inclusive) sed_command += ['-e', '/#START @0@/,/#END @0@/d'.format(option)] else # Removes the #START and #END lines sed_command += ['-e', '/#START @0@/d;/#END @0@/d'.format(option)] endif endforeach mandir = get_option('mandir') man_files = [ 'swaync.1.scd', 'swaync.5.scd', 'swaync-client.1.scd', ] foreach filename : man_files topic = filename.split('.')[-3].split('/')[-1] section = filename.split('.')[-2] input = join_paths('man', filename) output = '@0@.@1@'.format(topic, section) message(mandir, section, '@0@/man@1@'.format(mandir, section)) # Remove parts of man page if necessary if sed_command.length() > 0 output_stripped = '.stripped-@0@.@1@'.format(topic, section) input = custom_target( output_stripped, input: input, output: output_stripped, command: [sed, sed_command], install: false, feed: true, capture: true, build_by_default: true, build_always_stale: true ) endif custom_target( output, input: input, output: output, command: scdoc_prog, install: true, feed: true, capture: true, build_by_default: true, build_always_stale: true, install_dir: '@0@/man@1@'.format(mandir, section) ) endforeach endif endif # Run the postinstall script when installing meson.add_install_script('build-aux/meson/postinstall.py') SwayNotificationCenter-0.12.3/meson_options.txt000066400000000000000000000012751510261335300216710ustar00rootroot00000000000000option('systemd-service', type: 'boolean', value: true, description: 'Install systemd user service unit.') option('scripting', type: 'boolean', value: true, description: 'Enable notification scripting.') option('pulse-audio', type: 'boolean', value: true, description: 'Provide PulseAudio Widget.') option('man-pages', type: 'boolean', value: true, description: 'Install all man pages.') option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') SwayNotificationCenter-0.12.3/protocols/000077500000000000000000000000001510261335300202535ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/protocols/meson.build000066400000000000000000000017431510261335300224220ustar00rootroot00000000000000dep_scanner = dependency('wayland-scanner', native: true) prog_scanner = find_program(dep_scanner.get_variable(pkgconfig: 'wayland_scanner')) protocol_file = files( 'xdg-activation-v1.xml', ) protocol_sources = [] protocol_sources += custom_target( 'xdg-activation-v1-client-protocol.h', command: [prog_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], input: protocol_file, output: 'xdg-activation-v1-client-protocol.h', ) output_type = 'private-code' if dep_scanner.version().version_compare('< 1.14.91') output_type = 'code' endif protocol_sources += custom_target( 'xdg-activation-protocol.c', command: [prog_scanner, output_type, '@INPUT@', '@OUTPUT@'], input: protocol_file, output: 'xdg-activation-protocol.c', ) protocol_dep += declare_dependency( dependencies: [ vala.find_library('xdg-activation-v1', dirs: meson.current_source_dir()), dependency('wayland-client'), ], include_directories: include_directories('.'), sources: protocol_sources, ) SwayNotificationCenter-0.12.3/protocols/xdg-activation-v1.deps000066400000000000000000000000171510261335300243730ustar00rootroot00000000000000wayland-client SwayNotificationCenter-0.12.3/protocols/xdg-activation-v1.vapi000066400000000000000000000037321510261335300244060ustar00rootroot00000000000000// vim: ft=vala namespace XDG.Activation { [CCode (cheader_filename = "xdg-activation-v1-client-protocol.h", cname = "struct xdg_activation_v1", cprefix = "xdg_activation_v1_")] public class Activation : Wl.Proxy { [CCode (cheader_filename = "xdg-activation-v1-client-protocol.h", cname = "xdg_activation_v1_interface")] public static Wl.Interface iface; public void set_user_data (void * user_data); public void * get_user_data (); public uint32 get_version (); public void destroy (); public Token * get_activation_token (); public void activate (string token, Wl.Surface surface); } [CCode (cheader_filename = "xdg-activation-v1-client-protocol.h", cname = "enum xdg_activation_token_v1_error", cprefix = "XDG_ACTIVATION_TOKEN_V1_ERROR_", has_type_id = false)] public enum error { ALREADY_USED = 0, } [CCode (cheader_filename = "xdg-activation-v1-client-protocol.h", cname = "struct xdg_activation_token_v1", cprefix = "xdg_activation_token_v1_")] public class Token : Wl.Proxy { [CCode (cheader_filename = "xdg-activation-v1-client-protocol.h", cname = "xdg_activation_token_v1_listener")] public static Wl.Interface iface; public void set_user_data (void * user_data); public void * get_user_data (); public uint32 get_version (); public void destroy (); public int add_listener (TokenListener listener, void * data); public void set_serial (uint32 serial, Wl.Seat seat); public void set_app_id (string app_id); public void set_surface (Wl.Surface surface); public void commit (); } [CCode (cname = "struct xdg_activation_token_v1_listener", has_type_id = false)] public struct TokenListener { public TokenListenerDone done; } [CCode (has_target = false, has_typedef = false)] public delegate void TokenListenerDone (void * data, Token activation_token, string token); } SwayNotificationCenter-0.12.3/protocols/xdg-activation-v1.xml000066400000000000000000000214701510261335300242460ustar00rootroot00000000000000 Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org> Copyright © 2020 Carlos Garnacho <carlosg@gnome.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The way for a client to pass focus to another toplevel is as follows. The client that intends to activate another toplevel uses the xdg_activation_v1.get_activation_token request to get an activation token. This token is then forwarded to the client, which is supposed to activate one of its surfaces, through a separate band of communication. One established way of doing this is through the XDG_ACTIVATION_TOKEN environment variable of a newly launched child process. The child process should unset the environment variable again right after reading it out in order to avoid propagating it to other child processes. Another established way exists for Applications implementing the D-Bus interface org.freedesktop.Application, which should get their token under activation-token on their platform_data. In general activation tokens may be transferred across clients through means not described in this protocol. The client to be activated will then pass the token it received to the xdg_activation_v1.activate request. The compositor can then use this token to decide how to react to the activation request. The token the activating client gets may be ineffective either already at the time it receives it, for example if it was not focused, for focus stealing prevention. The activating client will have no way to discover the validity of the token, and may still forward it to the to be activated client. The created activation token may optionally get information attached to it that can be used by the compositor to identify the application that we intend to activate. This can for example be used to display a visual hint about what application is being started. Warning! The protocol described in this file is currently in the testing phase. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes can only be done by creating a new major version of the extension. A global interface used for informing the compositor about applications being activated or started, or for applications to request to be activated. Notify the compositor that the xdg_activation object will no longer be used. The child objects created via this interface are unaffected and should be destroyed separately. Creates an xdg_activation_token_v1 object that will provide the initiating client with a unique token for this activation. This token should be offered to the clients to be activated. Requests surface activation. It's up to the compositor to display this information as desired, for example by placing the surface above the rest. The compositor may know who requested this by checking the activation token and might decide not to follow through with the activation if it's considered unwanted. Compositors can ignore unknown activation tokens when an invalid token is passed. An object for setting up a token and receiving a token handle that can be passed as an activation token to another client. The object is created using the xdg_activation_v1.get_activation_token request. This object should then be populated with the app_id, surface and serial information and committed. The compositor shall then issue a done event with the token. In case the request's parameters are invalid, the compositor will provide an invalid token. Provides information about the seat and serial event that requested the token. The serial can come from an input or focus event. For instance, if a click triggers the launch of a third-party client, the launcher client should send a set_serial request with the serial and seat from the wl_pointer.button event. Some compositors might refuse to activate toplevels when the token doesn't have a valid and recent enough event serial. Must be sent before commit. This information is optional. The requesting client can specify an app_id to associate the token being created with it. Must be sent before commit. This information is optional. This request sets the surface requesting the activation. Note, this is different from the surface that will be activated. Some compositors might refuse to activate toplevels when the token doesn't have a requesting surface. Must be sent before commit. This information is optional. Requests an activation token based on the different parameters that have been offered through set_serial, set_surface and set_app_id. The 'done' event contains the unique token of this activation request and notifies that the provider is done. Notify the compositor that the xdg_activation_token_v1 object will no longer be used. The received token stays valid. SwayNotificationCenter-0.12.3/services/000077500000000000000000000000001510261335300200525ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/services/dbus/000077500000000000000000000000001510261335300210075ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/services/dbus/org.erikreider.swaync.service.in000066400000000000000000000001461510261335300272150ustar00rootroot00000000000000[D-BUS Service] Name=org.freedesktop.Notifications Exec=@bindir@/swaync SystemdService=swaync.service SwayNotificationCenter-0.12.3/services/systemd/000077500000000000000000000000001510261335300215425ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/services/systemd/swaync.service.in000066400000000000000000000010011510261335300250250ustar00rootroot00000000000000[Unit] Description=Swaync notification daemon Documentation=https://github.com/ErikReider/SwayNotificationCenter PartOf=graphical-session.target After=graphical-session.target # ConditionEnvironment requires systemd v247 to work correctly ConditionEnvironment=WAYLAND_DISPLAY [Service] Type=dbus BusName=org.freedesktop.Notifications ExecStart=@bindir@/swaync ExecReload=@bindir@/swaync-client --reload-config ; @bindir@/swaync-client --reload-css Restart=on-failure [Install] WantedBy=graphical-session.target SwayNotificationCenter-0.12.3/src/000077500000000000000000000000001510261335300170165ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/src/animatedList/000077500000000000000000000000001510261335300214345ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/src/animatedList/animatedList.vala000066400000000000000000000617221510261335300247270ustar00rootroot00000000000000public enum AnimatedListDirection { TOP_TO_BOTTOM, BOTTOM_TO_TOP; } private struct AnimationData { public Gtk.Adjustment vadj; public unowned AnimatedListItem item; } private struct WidgetHeights { int min_height; int nat_height; } private struct WidgetAlloc { float y; int height; } public class AnimatedList : Gtk.Widget, Gtk.Scrollable { public const int SCROLL_ANIMATION_DURATION = 500; public Gtk.Adjustment hadjustment { get; set construct; } public Gtk.ScrollablePolicy hscroll_policy { get; set; } public Gtk.Adjustment vadjustment { get; set construct; } public Gtk.ScrollablePolicy vscroll_policy { get; set; } public uint n_children { get; private set; } public unowned List children { get; private construct set; } public unowned List visible_children { get; private construct set; } /** * Indicates if new / removed children should display an expand and shrink * animation. */ public bool transition_children { get; construct set; } /** Whether or not the list should display its items in a stack or not */ public bool use_card_animation { get; construct set; } /** The direction that the items should flow in */ public AnimatedListDirection direction { get; construct set; } /** Scroll to the latest item added to the list */ public bool scroll_to_append { get; construct set; } /** The default item reveal animation type */ public AnimatedListItem.RevealAnimationType animation_reveal_type { get; construct set; } /** The default item animation type */ public AnimatedListItem.ChildAnimationType animation_child_type { get; construct set; } // Scroll bottom animation Adw.CallbackAnimationTarget scroll_btm_target; Adw.TimedAnimation scroll_btm_anim; AnimationData ?scroll_btm_anim_data = null; // Scroll top animation Adw.CallbackAnimationTarget scroll_top_target; Adw.TimedAnimation scroll_top_anim; AnimationData ?scroll_top_anim_data = null; // Adding an item to the top compensation Adw.CallbackAnimationTarget scroll_comp_target; Adw.TimedAnimation scroll_comp_anim; AnimationData ?scroll_comp_anim_data = null; // When true, the size_allocate method will scroll to the top/bottom private bool set_initial_scroll_value = false; private float fade_distance = 0.0f; private unowned Gtk.Settings settings = Gtk.Settings.get_default (); construct { hadjustment = null; children = new List (); visible_children = new List (); notify["vadjustment"].connect (() => { if (vadjustment != null) { vadjustment.value_changed.connect (() => { queue_allocate (); }); } }); map.connect (() => { // Ensures that the initial scroll position gets set after // GTK recalculates the layout Idle.add_once (() => { set_initial_scroll_value = true; queue_allocate (); }); }); set_overflow (Gtk.Overflow.HIDDEN); scroll_btm_target = new Adw.CallbackAnimationTarget (scroll_bottom_value_cb); scroll_btm_anim = new Adw.TimedAnimation ( this, 0.0, 1.0, SCROLL_ANIMATION_DURATION, scroll_btm_target); scroll_btm_anim.set_easing (Adw.Easing.EASE_OUT_QUINT); scroll_top_target = new Adw.CallbackAnimationTarget (scroll_top_value_cb); scroll_top_anim = new Adw.TimedAnimation ( this, 0.0, 1.0, SCROLL_ANIMATION_DURATION, scroll_top_target); scroll_top_anim.set_easing (Adw.Easing.EASE_OUT_QUINT); scroll_comp_target = new Adw.CallbackAnimationTarget (scroll_comp_value_cb); scroll_comp_anim = new Adw.TimedAnimation ( this, 0.0, 1.0, SCROLL_ANIMATION_DURATION, scroll_comp_target); scroll_comp_anim.set_easing (Adw.Easing.EASE_OUT_QUINT); } public AnimatedList () { Object ( css_name : "animatedlist", accessible_role : Gtk.AccessibleRole.LIST, transition_children : true, use_card_animation: true, direction: AnimatedListDirection.TOP_TO_BOTTOM, scroll_to_append: false ); } public override void dispose () { foreach (AnimatedListItem child in children) { transition_children = false; remove.begin (child, false); } base.dispose (); } public bool get_border (out Gtk.Border border) { border = Gtk.Border (); return false; } protected override Gtk.SizeRequestMode get_request_mode () { foreach (unowned AnimatedListItem item in children) { if (item.get_request_mode () != Gtk.SizeRequestMode.CONSTANT_SIZE) { return Gtk.SizeRequestMode.HEIGHT_FOR_WIDTH; } } return Gtk.SizeRequestMode.CONSTANT_SIZE; } protected override void compute_expand_internal (out bool hexpand_p, out bool vexpand_p) { hexpand_p = false; vexpand_p = false; foreach (unowned AnimatedListItem item in children) { hexpand_p |= item.compute_expand (Gtk.Orientation.HORIZONTAL); vexpand_p |= item.compute_expand (Gtk.Orientation.VERTICAL); } } private float get_fade_distance (int height) { switch (direction) { case AnimatedListDirection.TOP_TO_BOTTOM: return height - fade_distance; case AnimatedListDirection.BOTTOM_TO_TOP: return fade_distance; } return 0; } private void compute_height (int width, int height, out int total_height, out WidgetAlloc[] child_heights) { total_height = 0; child_heights = new WidgetAlloc[n_children]; fade_distance = 0; int num_vexpand_children = 0; WidgetHeights measured_height = WidgetHeights (); WidgetHeights[] heights = new WidgetHeights[n_children]; int total_min = 0; int total_nat = 0; int i = 0; foreach (AnimatedListItem child in children) { if (!child.should_layout ()) { continue; } // Get the largest minimum height and use it for the fade distance int nat_width; // First, get the minimum width of our widget child.measure (Gtk.Orientation.HORIZONTAL, -1, null, out nat_width, null, null); // Now use the natural width to retrieve the minimum and // natural height to display. int min_height, nat_height; child.measure (Gtk.Orientation.VERTICAL, nat_width, out min_height, out nat_height, null, null); fade_distance = float.max ( fade_distance, int.min (min_height, nat_height) ); int min, nat; child.measure (Gtk.Orientation.VERTICAL, width, out min, out nat, null, null); heights[i] = WidgetHeights () { min_height = min, nat_height = nat, }; total_min += min; total_nat += nat; if (child.compute_expand (Gtk.Orientation.VERTICAL)) { num_vexpand_children++; } i++; } bool allocate_nat = false; int extra_height = 0; if (height >= measured_height.nat_height) { allocate_nat = true; extra_height = height - measured_height.nat_height; } else { warn_if_reached (); } int y = 0; i = 0; foreach (AnimatedListItem child in children) { WidgetHeights computed_height = heights[i]; WidgetAlloc child_allocation = WidgetAlloc () { y = 0, height = computed_height.min_height, }; if (allocate_nat) { child_allocation.height = computed_height.nat_height; } if (child.compute_expand (Gtk.Orientation.VERTICAL)) { child_allocation.height += extra_height / num_vexpand_children; } child_allocation.y = y; child_heights[i] = child_allocation; total_height += child_allocation.height; y += child_allocation.height; i++; } const float LIMIT = 0.2f; if (fade_distance == 0) { fade_distance = height * LIMIT; } else { // Make sure that the fade distance isn't larger than the height fade_distance = float.min (fade_distance, height * LIMIT); } // The padding to add to the bottom/top of the list to compensate // for the fade, but only when the list is large enough to allow // for scrolling. if (should_card_animate () && vadjustment != null && total_height > height) { total_height += (int) fade_distance; } } protected override void size_allocate (int width, int height, int baseline) { // Recalculate which children are visible, so clear the old list while (!visible_children.is_empty ()) { visible_children.delete_link (visible_children.nth (0)); } warn_if_fail (visible_children.is_empty ()); // Save the already computed widget heights. We need the total height // for calculating the reversed list animation, so two loops through the // widgets is necessary... int total_height; WidgetAlloc[] heights; compute_height (width, height, out total_height, out heights); bool is_reversed = direction == AnimatedListDirection.BOTTOM_TO_TOP; bool has_scroll = total_height > height; float scroll_y = 0.0f; if (vadjustment != null) { scroll_y = (float) vadjustment.value; // Set the initial scroll value to the top or bottom // if the user hasn't scrolled yet. if (has_scroll && set_initial_scroll_value) { if (get_mapped ()) { set_initial_scroll_value = false; } switch (direction) { case AnimatedListDirection.TOP_TO_BOTTOM: scroll_y = 0; break; case AnimatedListDirection.BOTTOM_TO_TOP: scroll_y = total_height - height; break; } } } total_height = int.max (height, total_height); // Allocate the size and position of each item uint index = 0; foreach (AnimatedListItem child in children) { if (!child.should_layout ()) { index++; continue; } WidgetAlloc child_allocation = heights[index]; int child_height = child_allocation.height; float scale = 1.0f; float x = 0; float y = child_allocation.y - scroll_y; if (is_reversed) { y = total_height - child_height - child_allocation.y - scroll_y; } float opacity = 1.0f; bool skip_child = true; if (y < height && child_height + y > 0) { skip_child = false; // Deck of cards effect if (should_card_animate () && has_scroll) { float item_center = y + child_height * 0.5f; // Compensate for very tall items being faded out before seeing the top if (child_height > height) { item_center = y + (is_reversed ? child_height : 0); } // The cut off where to start fade away float local_fade_distance = get_fade_distance (height); if ((!is_reversed && item_center > local_fade_distance) || (is_reversed && item_center < local_fade_distance)) { // The distance from the fade edge float dist = Math.fabsf (item_center - local_fade_distance); // Hide when half way across the "circle". // A little trigonometry never killed anybody :-) float radius = fade_distance; if (dist < radius) { float angle = Math.atanf (dist / radius); // The Y value within the circle (dot product) float new_y = Math.sinf (angle) * radius; // The ratio between the untransformed height and the dot product height scale = 1.0f - (new_y / height * 2); // Center the item in the X axis x = (width - (width * scale)) * 0.5f; // Calculate the new distance from the start of the fade // NOTE: Reverse the direction of the animation // depending on the list direction. y += (float) (dist * Math.sin (angle) * (is_reversed ? 1 : -1)); opacity = 1.0f - (dist / radius * 2); skip_child |= opacity <= 0.1; } else { skip_child = true; } } } } // Only display visible items if (!skip_child && y < height && child_height + y > 0) { // Prepend the child so that the child can be rendered first // (to maintain a reversed z-index) visible_children.prepend (child); } Gsk.Transform transform = new Gsk.Transform () .translate (Graphene.Point ().init (x, y)) .scale (scale, scale); child.allocate (width, child_height, baseline, transform); child.set_opacity (opacity); index++; } if (vadjustment != null) { vadjustment.configure (scroll_y, 0, total_height, height * 0.1, height * 0.9, height); } } protected override void measure (Gtk.Orientation orientation, int for_size, out int minimum, out int natural, out int minimum_baseline, out int natural_baseline) { minimum = 0; natural = 0; minimum_baseline = -1; natural_baseline = -1; int min = 0, nat = 0; int largest_min = 0, largest_nat = 0; foreach (AnimatedListItem child in children) { if (!child.should_layout ()) { continue; } int child_min, child_nat; child.measure (orientation, for_size, out child_min, out child_nat, null, null); min += child_min; nat += child_nat; largest_min = int.max (largest_min, child_min); largest_nat = int.max (largest_min, child_nat); } switch (orientation) { case Gtk.Orientation.HORIZONTAL: minimum = largest_min; natural = largest_nat; break; case Gtk.Orientation.VERTICAL: minimum = min; natural = nat; break; } } protected override void snapshot (Gtk.Snapshot snapshot) { // Only render the visible items, backwards to retain a valid z-index foreach (unowned AnimatedListItem child in visible_children) { if (!child.should_layout ()) { continue; } snapshot_child (child, snapshot); } } private Gtk.Adjustment clone_adjustment (Gtk.Adjustment original) { return new Gtk.Adjustment ( original.get_value (), original.get_lower (), original.get_upper (), original.get_step_increment (), original.get_page_increment (), original.get_page_size () ); } private void scroll_bottom_value_cb (double value) { vadjustment.set_value ( scroll_btm_anim_data.vadj.upper - scroll_btm_anim_data.vadj.page_size + scroll_btm_anim_data.item.get_height ()); } private void play_scroll_bottom_anim (AnimatedListItem item) { scroll_btm_anim_data = AnimationData () { item = item, vadj = clone_adjustment (vadjustment), }; scroll_top_anim.duration = item.animation_duration; scroll_top_anim.easing = item.animation_easing; scroll_btm_anim.value_from = 0.0; scroll_btm_anim.value_to = 1.0; scroll_btm_anim.play (); } private void scroll_top_value_cb (double value) { vadjustment.set_value ( Adw.lerp (scroll_top_anim_data.vadj.value, 0, value)); } private void play_scroll_top_anim (AnimatedListItem item) { scroll_top_anim_data = AnimationData () { item = item, vadj = clone_adjustment (vadjustment), }; scroll_top_anim.duration = item.animation_duration; scroll_top_anim.easing = item.animation_easing; scroll_top_anim.value_from = 0.0; scroll_top_anim.value_to = 1.0; scroll_top_anim.play (); } private void scroll_comp_value_cb (double value) { vadjustment.set_value ( scroll_comp_anim_data.vadj.value + scroll_comp_anim_data.item.get_height ()); } private void play_scroll_comp_anim (AnimatedListItem item) { scroll_comp_anim_data = AnimationData () { item = item, vadj = clone_adjustment (vadjustment), }; scroll_comp_anim.duration = item.animation_duration; scroll_comp_anim.easing = Adw.Easing.LINEAR; scroll_comp_anim.value_from = 0.0; scroll_comp_anim.value_to = 1.0; scroll_comp_anim.play (); } private AnimatedListItem get_list_item (Gtk.Widget widget) { AnimatedListItem item; if (widget is AnimatedListItem) { item = widget as AnimatedListItem; } else { item = new AnimatedListItem (); item.child = widget; // Set the defaults item.animation_reveal_type = animation_reveal_type; item.animation_child_type = animation_child_type; widget.unparent (); widget.set_parent (item); } return item; } /** * Inserts a widget last into the list depending on direction: * TOP_TO_BOTTOM: Bottom * BOTTOM_TO_TOP: Top */ public async AnimatedListItem ?prepend (Gtk.Widget widget) { if (widget == null || widget.parent != null) { warn_if_reached (); return null; } AnimatedListItem item = get_list_item (widget); item.unparent (); item.insert_before (this, null); // append children.append (item); n_children++; // Fixes the lack of auto-scrolling when scrolled at the bottom // and a new item gets added if (direction == AnimatedListDirection.TOP_TO_BOTTOM && vadjustment.value == vadjustment.upper - vadjustment.page_size) { play_scroll_bottom_anim (item); } else if (direction == AnimatedListDirection.BOTTOM_TO_TOP) { // Compensate for the scrolling when adding an item to the top of the list play_scroll_comp_anim (item); } yield item.added (transition_children); return item; } /** * Inserts a widget first into the list depending on direction: * TOP_TO_BOTTOM: Top * BOTTOM_TO_TOP: Bottom */ public async AnimatedListItem ?append (Gtk.Widget widget) { if (widget == null || widget.parent != null) { warn_if_reached (); return null; } AnimatedListItem item = get_list_item (widget); item.unparent (); item.insert_after (this, null); // prepend children.prepend (item); n_children++; // Fixes the lack of auto-scrolling when scrolled at the bottom // and a new item gets added if (direction == AnimatedListDirection.BOTTOM_TO_TOP && vadjustment.value == vadjustment.upper - vadjustment.page_size) { play_scroll_bottom_anim (item); } else if (!scroll_to_append && direction == AnimatedListDirection.TOP_TO_BOTTOM) { // Compensate for the scrolling when adding an item to the top of the list play_scroll_comp_anim (item); } else if (scroll_to_append) { // Scrolls to the item if enabled switch (direction) { case AnimatedListDirection.TOP_TO_BOTTOM : play_scroll_top_anim (item); break; case AnimatedListDirection.BOTTOM_TO_TOP : play_scroll_bottom_anim (item); break; } } yield item.added (transition_children); return item; } private AnimatedListItem ?try_get_ancestor (Gtk.Widget widget) { AnimatedListItem item; if (widget is AnimatedListItem) { item = widget as AnimatedListItem; } else if (widget.parent is AnimatedListItem) { item = widget.parent as AnimatedListItem; } else { unowned Gtk.Widget ?ancestor = widget.get_ancestor (typeof (AnimatedListItem)); if (!(ancestor is AnimatedListItem)) { warning ("Widget %p of type \"%s\" is not an ancestor of %s!", widget, widget.get_type ().name (), typeof (AnimatedListItem).name ()); return null; } item = ancestor as AnimatedListItem; } if (item.parent != this) { warn_if_reached (); return null; } return item; } public async bool remove (Gtk.Widget widget, bool transition) { if (widget == null) { warn_if_reached (); return false; } AnimatedListItem ?item = try_get_ancestor (widget); if (item == null) { return false; } // Will unparent itself when done animating bool result = yield item.removed (transition_children && transition); item.unparent (); children.remove (item); n_children--; queue_resize (); return result; } public bool move_to_beginning (Gtk.Widget widget, bool scroll_to) { if (widget == null) { warn_if_reached (); return false; } AnimatedListItem ?item = try_get_ancestor (widget); if (item == null) { warn_if_reached (); return false; } // move to the beginning of the list item.insert_after (this, null); children.remove (item); children.prepend (item); queue_resize (); if (scroll_to) { scroll_to_top (); } return true; } private uint scroll_to_source_id = 0; public void scroll_to_top () { if (scroll_to_source_id > 0) { Source.remove (scroll_to_source_id); } scroll_to_source_id = Idle.add_once (() => { scroll_to_source_id = 0; unowned AnimatedListItem ?item = get_first_item (); return_if_fail (item != null); switch (direction) { case AnimatedListDirection.TOP_TO_BOTTOM : play_scroll_top_anim (item); break; case AnimatedListDirection.BOTTOM_TO_TOP : play_scroll_bottom_anim (item); break; } }); } public bool is_empty () { return children.is_empty (); } public unowned AnimatedListItem ?get_first_item () { if (children.is_empty ()) { return null; } return children.first ().data; } public unowned AnimatedListItem ?get_last_item () { if (children.is_empty ()) { return null; } return children.last ().data; } private bool should_card_animate () { bool value = this.use_card_animation; if (settings != null) { value &= settings.gtk_enable_animations; } return value; } } SwayNotificationCenter-0.12.3/src/animatedList/animatedListItem.vala000066400000000000000000000205351510261335300255430ustar00rootroot00000000000000public class AnimatedListItem : Gtk.Widget { public const int DEFAULT_ANIMATION_DURATION = 350; public enum RevealAnimationType { NONE, SLIDE, SLIDE_WITH } public enum ChildAnimationType { NONE, SLIDE_FROM_LEFT, SLIDE_FROM_RIGHT } protected unowned Gtk.Widget _child = null; public unowned Gtk.Widget child { get { return _child; } set { _child = value; if (_child != null) { _child.unparent (); _child.set_parent (this); } } } public int animation_duration { get; construct set; } public Adw.Easing animation_easing { get; construct set; } public RevealAnimationType animation_reveal_type { get; construct set; } public ChildAnimationType animation_child_type { get; construct set; } public bool animation_child_fade { get; construct set; } public bool destroying { get; private set; default = false; } private Adw.TimedAnimation animation; private double animation_value = 1.0; private ulong animation_done_cb_id = 0; private unowned SourceFunc ?removed_cb = null; private unowned SourceFunc ?added_cb = null; public AnimatedListItem () { Object ( css_name : "animatedlistitem", accessible_role : Gtk.AccessibleRole.LIST_ITEM, overflow: Gtk.Overflow.HIDDEN, animation_duration: DEFAULT_ANIMATION_DURATION, animation_easing: Adw.Easing.EASE_OUT_QUINT, animation_reveal_type: RevealAnimationType.SLIDE, animation_child_type: ChildAnimationType.SLIDE_FROM_RIGHT, animation_child_fade: true ); Adw.CallbackAnimationTarget target = new Adw.CallbackAnimationTarget (set_animation_value); animation = new Adw.TimedAnimation (this, 0.0, 1.0, animation_duration, target); bind_property ("animation-easing", animation, "easing", BindingFlags.SYNC_CREATE, null, null); } public override void dispose () { if (child != null) { child.unparent (); child = null; } base.dispose (); } public override Gtk.SizeRequestMode get_request_mode () { return Gtk.SizeRequestMode.HEIGHT_FOR_WIDTH; } public override void size_allocate (int width, int height, int baseline) { if (child == null || !child.should_layout ()) { return; } if (animation_value >= 1) { child.allocate (width, height, baseline, null); } else if (animation_value < 0) { return; } int child_width = width; int child_height = height; if (animation_value < 1.0) { int min, nat; child.measure (Gtk.Orientation.VERTICAL, width, out min, out nat, null, null); if (Math.ceil (nat * animation_value) == height) { child_height = nat; } else if (Math.ceil (min * animation_value) == height) { child_height = min; } else { double d = Math.floor (height / animation_value); child_height = int.min ((int) d, int.MAX); } } Gsk.Transform transform = new Gsk.Transform (); switch (animation_reveal_type) { case RevealAnimationType.SLIDE_WITH: transform = transform.translate_3d ( Graphene.Point3D ().init (0, height - child_height, 0) ); break; case RevealAnimationType.SLIDE: case RevealAnimationType.NONE: break; } switch (animation_child_type) { case ChildAnimationType.SLIDE_FROM_RIGHT: transform = transform.translate_3d ( Graphene.Point3D () .init (child_width * (float) (1 - animation_value), 0, 0) ); break; case ChildAnimationType.SLIDE_FROM_LEFT: transform = transform.translate_3d ( Graphene.Point3D () .init (-child_width * (float) (1 - animation_value), 0, 0) ); break; case ChildAnimationType.NONE: break; } child.allocate (child_width, child_height, -1, transform); } public override void measure (Gtk.Orientation orientation, int for_size, out int minimum, out int natural, out int minimum_baseline, out int natural_baseline) { minimum = 0; natural = 0; minimum_baseline = -1; natural_baseline = -1; if (child == null || !child.should_layout ()) { return; } child.measure (orientation, for_size, out minimum, out natural, null, null); switch (orientation) { case Gtk.Orientation.HORIZONTAL: break; case Gtk.Orientation.VERTICAL:; minimum = (int) Math.ceil (minimum * animation_value); natural = (int) Math.ceil (natural * animation_value); break; } } public override void snapshot (Gtk.Snapshot snapshot) { if (!child.should_layout ()) { return; } if (animation_child_fade) { snapshot.push_opacity (animation_value); } snapshot_child (child, snapshot); if (animation_child_fade) { snapshot.pop (); } } private void set_animation_value (double value) { animation_value = value; queue_resize (); } private inline void remove_animation_done_cb () { if (animation_done_cb_id != 0) { animation.disconnect (animation_done_cb_id); animation_done_cb_id = 0; } } delegate void animation_done (Adw.Animation animation); private void set_animation_done_cb (animation_done handler) { remove_animation_done_cb (); animation_done_cb_id = animation.done.connect (handler); } private void added_finished_cb () { if (added_cb != null) { added_cb (); added_cb = null; } } public async void added (bool transition) { if (added_cb != null) { // Already running animation return; } remove_animation_done_cb (); if (get_mapped () && transition) { set_animation_done_cb (added_finished_cb); added_cb = added.callback; animation.value_from = animation.state == Adw.AnimationState.PLAYING ? animation_value : 0.0; animation.value_from = animation.value; animation.value_to = 1.0; animation.play (); yield; } else { set_animation_value (1.0); added_finished_cb (); } } private void removed_finised_cb () { if (removed_cb != null) { removed_cb (); removed_cb = null; } } public async bool removed (bool transition) { if (removed_cb != null) { // Already running animation return false; } remove_animation_done_cb (); // Call the `added` callback if it's still stuck in the yield waiting state added_finished_cb (); set_can_focus (false); set_can_target (false); if (get_mapped () && transition) { set_animation_done_cb (removed_finised_cb); removed_cb = removed.callback; animation.value_from = animation.state == Adw.AnimationState.PLAYING ? animation_value : 1.0; animation.value_to = 0.0; destroying = true; animation.play (); yield; } else { set_animation_value (0.0); removed_finised_cb (); } if (child != null) { child.unparent (); child = null; } // Fixes the animation keeping a reference of the widget animation = null; return true; } } SwayNotificationCenter-0.12.3/src/blankWindow/000077500000000000000000000000001510261335300212755ustar00rootroot00000000000000SwayNotificationCenter-0.12.3/src/blankWindow/blankWindow.vala000066400000000000000000000101101510261335300244120ustar00rootroot00000000000000namespace SwayNotificationCenter { public class BlankWindow : Gtk.ApplicationWindow { public unowned Gdk.Monitor monitor { get; private set; } private Gtk.GestureClick blank_window_gesture; private bool blank_window_down = false; private bool blank_window_in = false; public BlankWindow (Gdk.Monitor monitor) { Object (css_name: "blankwindow"); this.monitor = monitor; blank_window_gesture = new Gtk.GestureClick (); ((Gtk.Widget) this).add_controller (blank_window_gesture); blank_window_gesture.touch_only = false; blank_window_gesture.exclusive = true; blank_window_gesture.button = Gdk.BUTTON_PRIMARY; blank_window_gesture.propagation_phase = Gtk.PropagationPhase.BUBBLE; blank_window_gesture.pressed.connect ((n_press, x, y) => { blank_window_in = true; blank_window_down = true; }); blank_window_gesture.released.connect ((n_press, x, y) => { // Emit released if (!blank_window_down) { return; } blank_window_down = false; if (blank_window_in) { try { swaync_daemon.set_visibility (false); } catch (Error e) { stderr.printf ("ControlCenter BlankWindow Click Error: %s\n", e.message); } } if (blank_window_gesture.get_current_sequence () == null) { blank_window_in = false; } }); blank_window_gesture.update.connect ((gesture, sequence) => { Gtk.GestureSingle gesture_single = (Gtk.GestureSingle) gesture; if (sequence != gesture_single.get_current_sequence ()) { return; } // Calculate if the clicked coords intersect other monitors double x, y; gesture.get_point (sequence, out x, out y); Graphene.Point click_point = Graphene.Point () .init ((float) x, (float) y); Graphene.Rect ?bounds = null; this.compute_bounds (this, out bounds); if (bounds != null && bounds.contains_point (click_point)) { blank_window_in = false; } }); blank_window_gesture.cancel.connect (() => { blank_window_down = false; }); if (!GtkLayerShell.is_supported ()) { stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n"); stderr.printf ("Swaync only works on Wayland!\n"); stderr.printf ("If running waylans session, try running:\n"); stderr.printf ("\tGDK_BACKEND=wayland swaync\n"); Process.exit (1); } GtkLayerShell.init_for_window (this); GtkLayerShell.set_namespace (this, "swaync-control-center"); GtkLayerShell.set_monitor (this, monitor); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.TOP, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.BOTTOM, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.LEFT, true); GtkLayerShell.set_anchor (this, GtkLayerShell.Edge.RIGHT, true); GtkLayerShell.set_exclusive_zone (this, -1); GtkLayerShell.set_layer ( this, ConfigModel.instance.control_center_layer.to_layer ()); add_css_class ("blank-window"); } protected override void snapshot (Gtk.Snapshot snapshot) { // HACK: Fixes fully transparent windows not being mapped Gdk.RGBA color = Gdk.RGBA () { red = 0, green = 0, blue = 0, alpha = 0, }; snapshot.append_color (color, Graphene.Rect.zero ()); base.snapshot (snapshot); } } } SwayNotificationCenter-0.12.3/src/client.vala000066400000000000000000000345021510261335300211450ustar00rootroot00000000000000public struct SwayncDaemonData { public bool dnd; public bool cc_open; public uint count; public bool inhibited; } [DBus (name = "org.erikreider.swaync.cc")] interface CcDaemon : Object { public abstract bool reload_css () throws Error; public abstract void reload_config () throws Error; public abstract void hide_latest_notifications (bool close) throws DBusError, IOError; public abstract void hide_all_notifications () throws DBusError, IOError; public abstract void close_all_notifications () throws DBusError, IOError; public abstract uint notification_count () throws DBusError, IOError; public abstract bool get_dnd () throws DBusError, IOError; public abstract void set_dnd (bool state) throws DBusError, IOError; public abstract bool get_visibility () throws DBusError, IOError; public abstract void toggle_visibility () throws DBusError, IOError; public abstract bool toggle_dnd () throws DBusError, IOError; public abstract void set_visibility (bool value) throws DBusError, IOError; public abstract void latest_invoke_action (uint32 action_index) throws DBusError, IOError; public abstract bool set_cc_monitor (string monitor) throws DBusError, IOError; public abstract bool set_noti_window_monitor (string monitor) throws DBusError, IOError; [DBus (name = "GetSubscribeData")] public abstract SwayncDaemonData get_subscribe_data () throws Error; public signal void subscribe_v2 (uint count, bool dnd, bool cc_open, bool inhibited); public abstract bool add_inhibitor (string application_id) throws DBusError, IOError; public abstract bool remove_inhibitor (string application_id) throws DBusError, IOError; public abstract uint number_of_inhibitors () throws DBusError, IOError; public abstract bool is_inhibited () throws DBusError, IOError; public abstract bool clear_inhibitors () throws DBusError, IOError; } private CcDaemon cc_daemon = null; private void print_help (string[] args) { print ("Usage:\n"); print (" %s