diff --git a/README.md b/README.md deleted file mode 100644 index ccbc579..0000000 --- a/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# This is my Hyprland dotfiles - -## To install all configs you need to create backup your configurations and start -```bash -./install_scripts/install.sh -``` -### or -```bash -~/dotfiles/install_scripts/install.sh -``` -## Full install commands -```bash -cd ~/ -git clone https://github.com/TolaMironcenko/hyprland_dotfiles.git dotfiles -cd ~/dotfiles/install_scripts -./install.sh -``` - -## Keybinds -| key | doing | -| --- | ----- | -| mainMod | alt | -| mainMod + q | close window | -| mainMod + v | toggle floating window | -| mainMod + return | open terminal (kitty as default) | -| mainMod + d | open rofi launcher | -| mainMod + shift + p | open rofi powermenu | -| mainMod + c | open rofi greenclip | -| mainMod + b | open hyprlock | -| mainMod + shift + c | do screenshot in clipboard | -| mainMod + [1 ... 0] | open workspase [1 ... 10] | -| mainMod + x | open xpad | -| mainMod + shift + x | open new note in xpad | -| mainMod + a | open telegram-desktop | -| mainMod + g | open google-chrome-stable | - -## To install system (Arch Linux) you can change file install_scripts/install-arch.sh -### and start -```bash -./install-arch.sh -``` diff --git a/ags/HyprPanel/.eslintignore b/ags/HyprPanel/.eslintignore deleted file mode 100644 index 980d7f4..0000000 --- a/ags/HyprPanel/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -types -node_modules diff --git a/ags/HyprPanel/.eslintrc.js b/ags/HyprPanel/.eslintrc.js deleted file mode 100644 index b650cfe..0000000 --- a/ags/HyprPanel/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: __dirname, - sourceType: 'module', - }, - plugins: ['@typescript-eslint', 'import'], - extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], - root: true, - ignorePatterns: ['.eslintrc.js', 'types/**/*.ts', 'scripts/**/*.js'], - env: { - es6: true, - browser: true, - }, - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'error', - '@typescript-eslint/explicit-module-boundary-types': 'error', - '@typescript-eslint/no-explicit-any': 'error', - 'import/extensions': ['off'], - 'import/no-unresolved': 'off', - quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }], - }, -}; diff --git a/ags/HyprPanel/.github/ISSUE_TEMPLATE/bug_report.md b/ags/HyprPanel/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index e41ef8d..0000000 --- a/ags/HyprPanel/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Bug report -about: Create a report to help HyprPanel improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - Distribution: [e.g. Arch Linux] - - Window Manager/Desktop Environment: [e.g. Hyprland] - -**Additional context** -Add any other context about the problem here. diff --git a/ags/HyprPanel/.github/ISSUE_TEMPLATE/feature_request.md b/ags/HyprPanel/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/ags/HyprPanel/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**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. diff --git a/ags/HyprPanel/.github/workflows/ci.yml b/ags/HyprPanel/.github/workflows/ci.yml deleted file mode 100644 index 27ec51a..0000000 --- a/ags/HyprPanel/.github/workflows/ci.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - -on: - pull_request: - branches: - - master - -jobs: - code_quality: - runs-on: ubuntu-latest - - steps: - - name: Checkout main repository - uses: actions/checkout@v3 - - - name: Clone ags-types to temp dir - uses: actions/checkout@v3 - with: - repository: Jas-SinghFSU/ags-types - path: temp-ags-types - - - name: Copy types to types/ - run: | - rm -rf types - mkdir -p types - cp -R temp-ags-types/types/* types/ - rm -rf temp-ags-types - - - name: Node Setup - uses: actions/setup-node@v3 - with: - node-version: '21' - - - name: Install Dependencies - run: npm install - - - name: ESLint - run: npm run lint - - - name: Type Check - run: npx tsc --noEmit --pretty --extendedDiagnostics diff --git a/ags/HyprPanel/.gitignore b/ags/HyprPanel/.gitignore deleted file mode 100644 index 9144fba..0000000 --- a/ags/HyprPanel/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.weather.json -node_modules diff --git a/ags/HyprPanel/.gitmodules b/ags/HyprPanel/.gitmodules deleted file mode 100644 index b165aa5..0000000 --- a/ags/HyprPanel/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "external/ags-types"] - path = external/ags-types - url = https://github.com/Jas-SinghFSU/ags-types.git diff --git a/ags/HyprPanel/.prettierignore b/ags/HyprPanel/.prettierignore deleted file mode 100644 index 97843e6..0000000 --- a/ags/HyprPanel/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -.eslintrc.js -types/**/*.ts diff --git a/ags/HyprPanel/.prettierrc b/ags/HyprPanel/.prettierrc deleted file mode 100644 index 6e88f12..0000000 --- a/ags/HyprPanel/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "singleQuote": true, - "semi": true, - "trailingComma": "all", - "printWidth": 120, - "tabWidth": 4, - "useTabs": false -} diff --git a/ags/HyprPanel/LICENSE b/ags/HyprPanel/LICENSE deleted file mode 100644 index 75c0349..0000000 --- a/ags/HyprPanel/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Jas Singh - -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 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. diff --git a/ags/HyprPanel/README.md b/ags/HyprPanel/README.md deleted file mode 100644 index bca09ea..0000000 --- a/ags/HyprPanel/README.md +++ /dev/null @@ -1,317 +0,0 @@ -

- - Hyprpanel logo - -

-
-

- wiki - discord chat -

-
- -# HyprPanel 🚀 - -A panel built for Hyprland with [AGS](https://github.com/Aylur/ags) - -![HyprPanel1](./assets/hp1.png) -![HyprPanel2](./assets/hp2.png) - -## Installation - -The [HyprPanel Wiki](https://hyprpanel.com/getting_started/installation.html) contains in depth instructions for installing the panel and all of its dependencies. The instructions below are general instructions for installing the panel. - -## Requirements - -Bun - -```sh -curl -fsSL https://bun.sh/install | bash && \ - sudo ln -s $HOME/.bun/bin/bun /usr/local/bin/bun -``` - -Additional dependencies: - -```sh -pipewire -libgtop -bluez -bluez-utils -grimblast -gpu-screen-recorder -hyprpicker -btop -networkmanager -matugen -wl-clipboard -swww -dart-sass -brightnessctl -gnome-bluetooth-3.0 -``` - -Optional Dependencies: - -```sh -## Used for Tracking GPU Usage in your Dashboard (NVidia only) -python -python-gpustat - -## Only if a pywal hook from wallpaper changes applied through settings is desired -pywal - -## To check for pacman updates in the default script used in the updates module -pacman-contrib - -## To switch between power profiles in battery module -power-profiles-daemon -``` - -### Arch - -pacman: - -```bash -sudo pacman -S pipewire libgtop bluez bluez-utils btop networkmanager dart-sass wl-clipboard brightnessctl swww python gnome-bluetooth-3.0 pacman-contrib power-profiles-daemon -``` - -AUR: - -```bash -yay -S grimblast-git gpu-screen-recorder hyprpicker matugen-bin python-gpustat aylurs-gtk-shell-git -``` - -### Fedora - -COPR - Add [solopasha/hyprland](https://copr.fedorainfracloud.org/coprs/solopasha/hyprland/) for most hyprland-related dependencies, and [hues-sueh/packages](https://copr.fedorainfracloud.org/coprs/heus-sueh/packages/) for matugen. Both provide the `swww` package, so prioritise the former repo: - -```bash -sudo dnf copr enable solopasha/hyprland -sudo dnf copr enable heus-sueh/packages -sudo dnf config-manager --save --setopt=copr:copr.fedorainfracloud.org:heus-sueh:packages.priority=200 -``` - -DNF: - -```bash -sudo dnf install pipewire libgtop2 bluez bluez-tools grimblast hyprpicker btop NetworkManager wl-clipboard swww brightnessctl gnome-bluetooth aylurs-gtk-shell power-profiles-daemon gvfs -``` - -bun: - -```bash -bun install -g sass -``` - -flatpak: - -```bash -flatpak install flathub --system com.dec05eba.gpu_screen_recorder -``` - -#### Optional Dependencies - -pip: - -```bash -sudo dnf install python python3-pip; pip install gpustat pywal -``` - -### NixOS - -For NixOS/Home-Manager, see [NixOS & Home-Manager instructions](#nixos--home-manager). - -## Instructions - -### AGS - -Once everything is installed you need to put the contents of this repo in `~/.config/ags`. -If you already have something in `~/.config/ags`, it's recommended that you back it up with: - -```bash -mv $HOME/.config/ags $HOME/.config/ags.bkup -``` - -Otherwise you can use this command to install the panel: - -```bash -git clone https://github.com/Jas-SinghFSU/HyprPanel.git && \ - ln -s $(pwd)/HyprPanel $HOME/.config/ags -``` - -### Nerd Fonts - -Additionally, you need to ensure that you have a [Nerd Font](https://www.nerdfonts.com/font-downloads) installed for your icons to render properly. - -### Launch the panel - -Afterwards you can run the panel with the following command in your terminal: - -```bash -ags -``` - -Or you can add it to your Hyprland config (hyprland.conf) to auto-start with: - -```bash -exec-once = ags -``` - -### NixOS & Home-Manager - -Alternatively, if you're using NixOS and/or Home-Manager, you can setup AGS using the provided Nix Flake. First, add the repository to your Flake's inputs, and enable the overlay. - -```nix -# flake.nix - -{ - inputs.hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; - # ... - - outputs = { self, nixpkgs, ... }@inputs: - let - # ... - system = "x86_64-linux"; # change to whatever your system should be. - pkgs = import nixpkgs { - inherit system; - # ... - overlays = [ - inputs.hyprpanel.overlay - ]; - }; - in { - # ... - } -} -``` - -Once you've set up the overlay, you can reference HyprPanel with `pkgs.hyprpanel` as if it were any other Nix package. This means you can reference it as a NixOS system/user package, a Home-Manager user package, or as a direct reference in your Hyprland configuration (if your configuration is managed by Home-Manager). The first three methods will add it to your `$PATH` (first globally, second two user-only), however the final will not. - -```nix -# configuration.nix - -# install it as a system package -environment.systemPackages = with pkgs; [ - # ... - hyprpanel - # ... -]; - -# or install it as a user package -users.users..packages = with pkgs; [ - # ... - hyprpanel - # ... -]; - - -# home.nix - -# install it as a user package with home-manager -home.packages = with pkgs; [ - # ... - hyprpanel - # ... -]; - -# or reference it directly in your Hyprland configuration -wayland.windowManager.hyprland.settings.exec-once = [ - "${pkgs.hyprpanel}/bin/hyprpanel" -]; - -``` - -### Notifications - -HyprPanel handles notifications through the AGS built-in notification service. If you're already using a notification daemon such as Dunst or Mako, you may have to stop them to prevent conflicts with HyprPanel. - -> NOTE: If your system is in a language other than English, the resource monitor in the dashboard may not work properly. - -## Configuration - -The HyprPanel comes with a configuration menu which is available by opening the Dashboard menu (click the button in the bar with the default - Arch - icon) and then clicking the Gear icon. - -### Size - -The panel is automatically scaled based on your font size in `Configuration > General`. - -### Specifying bar layouts per monitor - -To specify layouts for each monitor you can create a JSON object such as: - -```JSON -{ - "0": { - "left": [ - "dashboard", - "workspaces", - "windowtitle" - ], - "middle": [ - "media" - ], - "right": [ - "volume", - "clock", - "notifications" - ] - }, - "1": { - "left": [ - "dashboard", - "workspaces", - "windowtitle" - ], - "middle": [ - "media" - ], - "right": [ - "volume", - "clock", - "notifications" - ] - }, - "2": { - "left": [ - "dashboard", - "workspaces", - "windowtitle" - ], - "middle": [ - "media" - ], - "right": [ - "volume", - "network", - "bluetooth", - "systray", - "clock", - "notifications" - ] - } -} -``` - -Where each monitor is defined by its index (0, 1, 2 in this case) and each section (left, middle, right) contains one or more of the following modules: - -```js -'battery'; -'dashboard'; -'workspaces'; -'windowtitle'; -'media'; -'notifications'; -'volume'; -'network'; -'bluetooth'; -'clock'; -'systray'; -``` - -Since the text-box in the options dialog isn't sufficient, it is recommended that you create this JSON configuration in a text editor elsewhere and paste it into the layout text-box under Configuration > Bar > "Bar Layouts for Monitors". - -### Additional Configuration - -#### GPU Tracking - -If you have an NVidia GPU, you can track your GPU usage in your Dashboard by going to your `Settings > Configuration > Dashboard Menu > Track GPU` and turning it on. diff --git a/ags/HyprPanel/assets/21210205.png b/ags/HyprPanel/assets/21210205.png deleted file mode 100644 index c1f3edc..0000000 Binary files a/ags/HyprPanel/assets/21210205.png and /dev/null differ diff --git a/ags/HyprPanel/assets/HyprPanel.png b/ags/HyprPanel/assets/HyprPanel.png deleted file mode 100644 index 3ea158a..0000000 Binary files a/ags/HyprPanel/assets/HyprPanel.png and /dev/null differ diff --git a/ags/HyprPanel/assets/Mocha_Wolf.png b/ags/HyprPanel/assets/Mocha_Wolf.png deleted file mode 100644 index 219857c..0000000 Binary files a/ags/HyprPanel/assets/Mocha_Wolf.png and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf deleted file mode 100644 index 3bed27f..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf deleted file mode 100644 index 99cfe5b..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf deleted file mode 100644 index 1e8103b..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf deleted file mode 100644 index 82dcd0b..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf deleted file mode 100644 index d134c56..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf deleted file mode 100644 index de31c48..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf deleted file mode 100644 index 059f6b3..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf b/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf deleted file mode 100644 index 8aad716..0000000 Binary files a/ags/HyprPanel/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf and /dev/null differ diff --git a/ags/HyprPanel/assets/hp1.png b/ags/HyprPanel/assets/hp1.png deleted file mode 100644 index e42b363..0000000 Binary files a/ags/HyprPanel/assets/hp1.png and /dev/null differ diff --git a/ags/HyprPanel/assets/hp2.png b/ags/HyprPanel/assets/hp2.png deleted file mode 100644 index a912e32..0000000 Binary files a/ags/HyprPanel/assets/hp2.png and /dev/null differ diff --git a/ags/HyprPanel/assets/hyprpanel.png b/ags/HyprPanel/assets/hyprpanel.png deleted file mode 100644 index b4707c0..0000000 Binary files a/ags/HyprPanel/assets/hyprpanel.png and /dev/null differ diff --git a/ags/HyprPanel/assets/solar_system_mocha.png b/ags/HyprPanel/assets/solar_system_mocha.png deleted file mode 100644 index 14ca154..0000000 Binary files a/ags/HyprPanel/assets/solar_system_mocha.png and /dev/null differ diff --git a/ags/HyprPanel/config.js b/ags/HyprPanel/config.js deleted file mode 100644 index 01d6ae8..0000000 --- a/ags/HyprPanel/config.js +++ /dev/null @@ -1,58 +0,0 @@ -import GLib from 'gi://GLib'; - -const main = '/tmp/ags/hyprpanel/main.js'; -const entry = `${App.configDir}/main.ts`; -const bundler = GLib.getenv('AGS_BUNDLER') || 'bun'; - -const v = { - ags: pkg.version?.split('.').map(Number) || [], - expect: [1, 8, 1], -}; - -try { - switch (bundler) { - case 'bun': - await Utils.execAsync([ - 'bun', - 'build', - entry, - '--outfile', - main, - '--external', - 'resource://*', - '--external', - 'gi://*', - '--external', - 'file://*', - ]); - break; - - case 'esbuild': - await Utils.execAsync([ - 'esbuild', - '--bundle', - entry, - '--format=esm', - `--outfile=${main}`, - '--external:resource://*', - '--external:gi://*', - '--external:file://*', - ]); - break; - - default: - throw `"${bundler}" is not a valid bundler`; - } - - if (v.ags[1] < v.expect[1] || v.ags[2] < v.expect[2]) { - print(`HyprPanel needs atleast v${v.expect.join('.')} of AGS, yours is v${v.ags.join('.')}`); - App.quit(); - } - - await import(`file://${main}`); -} catch (error) { - console.error(error); - App.quit(); -} - -export {}; diff --git a/ags/HyprPanel/customModules/PollVar.ts b/ags/HyprPanel/customModules/PollVar.ts deleted file mode 100644 index 2381e89..0000000 --- a/ags/HyprPanel/customModules/PollVar.ts +++ /dev/null @@ -1,77 +0,0 @@ -import GLib from 'gi://GLib?version=2.0'; -import { GenericFunction } from 'lib/types/customModules/generic'; -import { Bind } from 'lib/types/variable'; -import { Variable as VariableType } from 'types/variable'; - -/** - * @param {VariableType} targetVariable - The Variable to update with the function's result. - * @param {Array} trackers - Array of trackers to watch. - * @param {Bind} pollingInterval - The polling interval in milliseconds. - * @param {GenericFunction} someFunc - The function to execute at each interval, which updates the Variable. - * @param {...P} params - Parameters to pass to someFunc. - */ -export const pollVariable = >( - targetVariable: VariableType, - trackers: Array, - pollingInterval: Bind, - someFunc: F, - ...params: P -): void => { - let intervalInstance: number | null = null; - - const intervalFn = (pollIntrvl: number): void => { - if (intervalInstance !== null) { - GLib.source_remove(intervalInstance); - } - - intervalInstance = Utils.interval(pollIntrvl, () => { - targetVariable.value = someFunc(...params); - }); - }; - - Utils.merge([pollingInterval, ...trackers], (pollIntrvl: number) => { - intervalFn(pollIntrvl); - }); -}; - -/** - * @param {VariableType} targetVariable - The Variable to update with the result of the command. - * @param {Array} trackers - Array of trackers to watch. - * @param {Bind} pollingInterval - The polling interval in milliseconds. - * @param {string} someCommand - The bash command to execute. - * @param {GenericFunction} someFunc - The function to execute after processing the command result; - * with the first argument being the result of the command execution. - * @param {...P} params - Additional parameters to pass to someFunc. - */ -export const pollVariableBash = >( - targetVariable: VariableType, - trackers: Array, - pollingInterval: Bind, - someCommand: string, - someFunc: F, - ...params: P -): void => { - let intervalInstance: number | null = null; - - const intervalFn = (pollIntrvl: number): void => { - if (intervalInstance !== null) { - GLib.source_remove(intervalInstance); - } - - intervalInstance = Utils.interval(pollIntrvl, () => { - Utils.execAsync(`bash -c "${someCommand}"`) - .then((res: string) => { - try { - targetVariable.value = someFunc(res, ...params); - } catch (error) { - console.warn(`An error occurred when running interval bash function: ${error}`); - } - }) - .catch((err) => console.error(`Error running command "${someCommand}": ${err}`)); - }); - }; - - Utils.merge([pollingInterval, ...trackers], (pollIntrvl: number) => { - intervalFn(pollIntrvl); - }); -}; diff --git a/ags/HyprPanel/customModules/config.ts b/ags/HyprPanel/customModules/config.ts deleted file mode 100644 index 36e2c4c..0000000 --- a/ags/HyprPanel/customModules/config.ts +++ /dev/null @@ -1,595 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, GtkWidget } from 'lib/types/widget'; - -export const CustomModuleSettings = (): Scrollable => - Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page customModules paged-container', - child: Widget.Box({ - class_name: 'menu-theme-page paged-container', - vertical: true, - children: [ - /* - ************************************ - * GENERAL * - ************************************ - */ - Header('General'), - Option({ - opt: options.bar.customModules.scrollSpeed, - title: 'Scrolling Speed', - type: 'number', - }), - - /* - ************************************ - * RAM * - ************************************ - */ - Header('RAM'), - Option({ - opt: options.theme.bar.buttons.modules.ram.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.ram.icon, - title: 'Ram Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.ram.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.ram.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.ram.labelType, - title: 'Label Type', - type: 'enum', - enums: ['used/total', 'used', 'free', 'percentage'], - }), - Option({ - opt: options.bar.customModules.ram.round, - title: 'Round', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.ram.pollingInterval, - title: 'Polling Interval', - type: 'number', - min: 100, - max: 60 * 24 * 1000, - increment: 1000, - }), - Option({ - opt: options.bar.customModules.ram.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.ram.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.ram.middleClick, - title: 'Middle Click', - type: 'string', - }), - - /* - ************************************ - * CPU * - ************************************ - */ - Header('CPU'), - Option({ - opt: options.theme.bar.buttons.modules.cpu.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.cpu.icon, - title: 'Cpu Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.cpu.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.round, - title: 'Round', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.cpu.pollingInterval, - title: 'Polling Interval', - type: 'number', - min: 100, - max: 60 * 24 * 1000, - increment: 1000, - }), - Option({ - opt: options.bar.customModules.cpu.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.cpu.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ************************************ - * STORAGE * - ************************************ - */ - Header('Storage'), - Option({ - opt: options.theme.bar.buttons.modules.storage.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.storage.icon, - title: 'Storage Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.storage.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.storage.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.storage.labelType, - title: 'Label Type', - type: 'enum', - enums: ['used/total', 'used', 'free', 'percentage'], - }), - Option({ - opt: options.bar.customModules.storage.round, - title: 'Round', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.storage.pollingInterval, - title: 'Polling Interval', - type: 'number', - min: 100, - max: 60 * 24 * 1000, - increment: 1000, - }), - Option({ - opt: options.bar.customModules.storage.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.storage.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.storage.middleClick, - title: 'Middle Click', - type: 'string', - }), - - /* - ************************************ - * NETSTAT * - ************************************ - */ - Header('Netstat'), - Option({ - opt: options.theme.bar.buttons.modules.netstat.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.netstat.networkInterface, - title: 'Network Interface', - subtitle: - "Name of the network interface to poll.\nHINT: Get list of interfaces with 'cat /proc/net/dev'", - type: 'string', - }), - Option({ - opt: options.bar.customModules.netstat.icon, - title: 'Netstat Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.netstat.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.netstat.rateUnit, - title: 'Rate Unit', - type: 'enum', - enums: ['GiB', 'MiB', 'KiB', 'auto'], - }), - Option({ - opt: options.theme.bar.buttons.modules.netstat.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.netstat.labelType, - title: 'Label Type', - type: 'enum', - enums: ['full', 'in', 'out'], - }), - Option({ - opt: options.bar.customModules.netstat.round, - title: 'Round', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.netstat.pollingInterval, - title: 'Polling Interval', - type: 'number', - min: 100, - max: 60 * 24 * 1000, - increment: 1000, - }), - Option({ - opt: options.bar.customModules.netstat.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.netstat.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.netstat.middleClick, - title: 'Middle Click', - type: 'string', - }), - - /* - ************************************ - * KEYBOARD LAYOUT * - ************************************ - */ - Header('Keyboard Layout'), - Option({ - opt: options.theme.bar.buttons.modules.kbLayout.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.kbLayout.icon, - title: 'Keyboard Layout Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.kbLayout.labelType, - title: 'Label Type', - type: 'enum', - enums: ['layout', 'code'], - }), - Option({ - opt: options.theme.bar.buttons.modules.kbLayout.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.kbLayout.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ************************************ - * UPDATES * - ************************************ - */ - Header('Updates'), - Option({ - opt: options.theme.bar.buttons.modules.updates.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.updates.updateCommand, - title: 'Check Updates Command', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.icon, - title: 'Updates Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.updates.padZero, - title: 'Pad with 0', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.updates.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.pollingInterval, - title: 'Polling Interval', - type: 'number', - subtitle: "WARNING: Be careful of your package manager's rate limit.", - min: 100, - max: 60 * 24 * 1000, - increment: 1000, - }), - Option({ - opt: options.bar.customModules.updates.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.updates.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ************************************ - * SUBMAP * - ************************************ - */ - Header('Submap'), - Option({ - opt: options.theme.bar.buttons.modules.submap.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.submap.showSubmapName, - title: 'Show Submap Name', - subtitle: - 'When enabled, the name of the current submap will be displayed' + - ' instead of the Submap Enabled or Disabled text.', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.submap.enabledIcon, - title: 'Enabled Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.disabledIcon, - title: 'Disabled Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.enabledText, - title: 'Enabled Text', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.disabledText, - title: 'Disabled Text', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.submap.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.submap.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ************************************ - * WEATHER * - ************************************ - */ - Header('Weather'), - Option({ - opt: options.theme.bar.buttons.modules.weather.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.weather.label, - title: 'Show Label', - type: 'boolean', - }), - Option({ - opt: options.bar.customModules.weather.unit, - title: 'Units', - type: 'enum', - enums: ['imperial', 'metric'], - }), - Option({ - opt: options.theme.bar.buttons.modules.weather.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.weather.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.weather.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.weather.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.weather.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.weather.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ************************************ - * POWER * - ************************************ - */ - Header('Power'), - Option({ - opt: options.theme.bar.buttons.modules.power.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.modules.power.spacing, - title: 'Spacing', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.icon, - title: 'Power Button Icon', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.customModules.power.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - ], - }), - }); diff --git a/ags/HyprPanel/customModules/cpu/computeCPU.ts b/ags/HyprPanel/customModules/cpu/computeCPU.ts deleted file mode 100644 index 460b1db..0000000 --- a/ags/HyprPanel/customModules/cpu/computeCPU.ts +++ /dev/null @@ -1,20 +0,0 @@ -// @ts-expect-error: This import is a special directive that tells the compiler to use the GTop library -import GTop from 'gi://GTop'; - -let previousCpuData = new GTop.glibtop_cpu(); -GTop.glibtop_get_cpu(previousCpuData); - -export const computeCPU = (): number => { - const currentCpuData = new GTop.glibtop_cpu(); - GTop.glibtop_get_cpu(currentCpuData); - - // Calculate the differences from the previous to current data - const totalDiff = currentCpuData.total - previousCpuData.total; - const idleDiff = currentCpuData.idle - previousCpuData.idle; - - const cpuUsagePercentage = totalDiff > 0 ? ((totalDiff - idleDiff) / totalDiff) * 100 : 0; - - previousCpuData = currentCpuData; - - return cpuUsagePercentage; -}; diff --git a/ags/HyprPanel/customModules/cpu/index.ts b/ags/HyprPanel/customModules/cpu/index.ts deleted file mode 100644 index a3848e4..0000000 --- a/ags/HyprPanel/customModules/cpu/index.ts +++ /dev/null @@ -1,69 +0,0 @@ -import options from 'options'; - -// Module initializer -import { module } from '../module'; - -import Button from 'types/widgets/button'; - -// Utility Methods -import { inputHandler } from 'customModules/utils'; -import { computeCPU } from './computeCPU'; -import { pollVariable } from 'customModules/PollVar'; -import { BarBoxChild } from 'lib/types/bar'; -import { Attribute, Child } from 'lib/types/widget'; - -// All the user configurable options for the cpu module that are needed -const { label, round, leftClick, rightClick, middleClick, scrollUp, scrollDown, pollingInterval, icon } = - options.bar.customModules.cpu; - -export const cpuUsage = Variable(0); - -pollVariable( - // Variable to poll and update with the result of the function passed in - cpuUsage, - // Variables that should trigger the polling function to update when they change - [round.bind('value')], - // Interval at which to poll - pollingInterval.bind('value'), - // Function to execute to get the network data - computeCPU, -); - -export const Cpu = (): BarBoxChild => { - const renderLabel = (cpuUsg: number, rnd: boolean): string => { - return rnd ? `${Math.round(cpuUsg)}%` : `${cpuUsg.toFixed(2)}%`; - }; - - const cpuModule = module({ - textIcon: icon.bind('value'), - label: Utils.merge([cpuUsage.bind('value'), round.bind('value')], (cpuUsg, rnd) => { - return renderLabel(cpuUsg, rnd); - }), - tooltipText: 'CPU', - boxClass: 'cpu', - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return cpuModule; -}; diff --git a/ags/HyprPanel/customModules/kblayout/getLayout.ts b/ags/HyprPanel/customModules/kblayout/getLayout.ts deleted file mode 100644 index 9c42071..0000000 --- a/ags/HyprPanel/customModules/kblayout/getLayout.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { - HyprctlDeviceLayout, - HyprctlKeyboard, - KbLabelType, - LayoutKeys, - LayoutValues, -} from 'lib/types/customModules/kbLayout'; -import { layoutMap } from './layouts'; - -export const getKeyboardLayout = (obj: string, format: KbLabelType): LayoutKeys | LayoutValues => { - const hyprctlDevices: HyprctlDeviceLayout = JSON.parse(obj); - const keyboards = hyprctlDevices['keyboards']; - - if (keyboards.length === 0) { - return format === 'code' ? 'Unknown' : 'Unknown Layout'; - } - - let mainKb = keyboards.find((kb: HyprctlKeyboard) => kb.main); - - if (!mainKb) { - mainKb = keyboards[keyboards.length - 1]; - } - - const layout: LayoutKeys = mainKb['active_keymap'] as LayoutKeys; - const foundLayout: LayoutValues = layoutMap[layout]; - - return format === 'code' ? foundLayout || layout : layout; -}; diff --git a/ags/HyprPanel/customModules/kblayout/index.ts b/ags/HyprPanel/customModules/kblayout/index.ts deleted file mode 100644 index 8c566e5..0000000 --- a/ags/HyprPanel/customModules/kblayout/index.ts +++ /dev/null @@ -1,73 +0,0 @@ -const hyprland = await Service.import('hyprland'); - -import options from 'options'; -import { module } from '../module'; - -import { inputHandler } from 'customModules/utils'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0'; -import Button from 'types/widgets/button'; -import Label from 'types/widgets/label'; -import { getKeyboardLayout } from './getLayout'; -import { BarBoxChild } from 'lib/types/bar'; -import { Attribute, Child } from 'lib/types/widget'; - -const { label, labelType, icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = - options.bar.customModules.kbLayout; - -export const KbInput = (): BarBoxChild => { - const keyboardModule = module({ - textIcon: icon.bind('value'), - tooltipText: '', - labelHook: (self: Label): void => { - self.hook( - hyprland, - () => { - Utils.execAsync('hyprctl devices -j') - .then((obj) => { - self.label = getKeyboardLayout(obj, labelType.value); - }) - .catch((err) => { - console.error(err); - }); - }, - 'keyboard-layout', - ); - - self.hook(labelType, () => { - Utils.execAsync('hyprctl devices -j') - .then((obj) => { - self.label = getKeyboardLayout(obj, labelType.value); - }) - .catch((err) => { - console.error(err); - }); - }); - }, - - boxClass: 'kblayout', - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return keyboardModule; -}; diff --git a/ags/HyprPanel/customModules/kblayout/layouts.ts b/ags/HyprPanel/customModules/kblayout/layouts.ts deleted file mode 100644 index ccd37c6..0000000 --- a/ags/HyprPanel/customModules/kblayout/layouts.ts +++ /dev/null @@ -1,585 +0,0 @@ -export const layoutMap = { - 'Abkhazian (Russia)': 'RU (Ab)', - Akan: 'GH (Akan)', - Albanian: 'AL', - 'Albanian (Plisi)': 'AL (Plisi)', - 'Albanian (Veqilharxhi)': 'AL (Veqilharxhi)', - Amharic: 'ET', - Arabic: 'ARA', - 'Arabic (Algeria)': 'DZ (Ar)', - 'Arabic (AZERTY, Eastern Arabic numerals)': 'ARA (Azerty Digits)', - 'Arabic (AZERTY)': 'ARA (Azerty)', - 'Arabic (Buckwalter)': 'ARA (Buckwalter)', - 'Arabic (Eastern Arabic numerals)': 'ARA (Digits)', - 'Arabic (Macintosh)': 'ARA (Mac)', - 'Arabic (Morocco)': 'MA', - 'Arabic (OLPC)': 'ARA (Olpc)', - 'Arabic (Pakistan)': 'PK (Ara)', - 'Arabic (QWERTY, Eastern Arabic numerals)': 'ARA (Qwerty Digits)', - 'Arabic (QWERTY)': 'ARA (Qwerty)', - 'Arabic (Syria)': 'SY', - Armenian: 'AM', - 'Armenian (alt. eastern)': 'AM (Eastern-Alt)', - 'Armenian (alt. phonetic)': 'AM (Phonetic-Alt)', - 'Armenian (eastern)': 'AM (Eastern)', - 'Armenian (phonetic)': 'AM (Phonetic)', - 'Armenian (western)': 'AM (Western)', - 'Asturian (Spain, with bottom-dot H and L)': 'ES (Ast)', - Avatime: 'GH (Avn)', - Azerbaijani: 'AZ', - 'Azerbaijani (Cyrillic)': 'AZ (Cyrillic)', - 'Azerbaijani (Iran)': 'IR (Azb)', - Bambara: 'ML', - Bangla: 'BD', - 'Bangla (India, Baishakhi InScript)': 'IN (Ben Inscript)', - 'Bangla (India, Baishakhi)': 'IN (Ben Baishakhi)', - 'Bangla (India, Bornona)': 'IN (Ben Bornona)', - 'Bangla (India, Gitanjali)': 'IN (Ben Gitanjali)', - 'Bangla (India, Probhat)': 'IN (Ben Probhat)', - 'Bangla (India)': 'IN (Ben)', - 'Bangla (Probhat)': 'BD (Probhat)', - Bashkirian: 'RU (Bak)', - Belarusian: 'BY', - 'Belarusian (intl.)': 'BY (Intl)', - 'Belarusian (Latin)': 'BY (Latin)', - 'Belarusian (legacy)': 'BY (Legacy)', - 'Belarusian (phonetic)': 'BY (Phonetic)', - Belgian: 'BE', - 'Belgian (alt.)': 'BE (Oss)', - 'Belgian (ISO, alt.)': 'BE (Iso-Alternate)', - 'Belgian (Latin-9 only, alt.)': 'BE (Oss Latin9)', - 'Belgian (no dead keys)': 'BE (Nodeadkeys)', - 'Belgian (Wang 724 AZERTY)': 'BE (Wang)', - 'Berber (Algeria, Latin)': 'DZ', - 'Berber (Algeria, Tifinagh)': 'DZ (Ber)', - 'Berber (Morocco, Tifinagh alt.)': 'MA (Tifinagh-Alt)', - 'Berber (Morocco, Tifinagh extended phonetic)': 'MA (Tifinagh-Extended-Phonetic)', - 'Berber (Morocco, Tifinagh extended)': 'MA (Tifinagh-Extended)', - 'Berber (Morocco, Tifinagh phonetic, alt.)': 'MA (Tifinagh-Alt-Phonetic)', - 'Berber (Morocco, Tifinagh phonetic)': 'MA (Tifinagh-Phonetic)', - 'Berber (Morocco, Tifinagh)': 'MA (Tifinagh)', - Bosnian: 'BA', - 'Bosnian (US, with Bosnian digraphs)': 'BA (Unicodeus)', - 'Bosnian (US)': 'BA (Us)', - 'Bosnian (with Bosnian digraphs)': 'BA (Unicode)', - 'Bosnian (with guillemets)': 'BA (Alternatequotes)', - Braille: 'BRAI', - 'Braille (left-handed inverted thumb)': 'BRAI (Left Hand Invert)', - 'Braille (left-handed)': 'BRAI (Left Hand)', - 'Braille (right-handed inverted thumb)': 'BRAI (Right Hand Invert)', - 'Braille (right-handed)': 'BRAI (Right Hand)', - 'Breton (France)': 'FR (Bre)', - Bulgarian: 'BG', - 'Bulgarian (enhanced)': 'BG (Bekl)', - 'Bulgarian (new phonetic)': 'BG (Bas Phonetic)', - 'Bulgarian (traditional phonetic)': 'BG (Phonetic)', - Burmese: 'MM', - 'Burmese Zawgyi': 'MM (Zawgyi)', - 'Cameroon (AZERTY, intl.)': 'CM (Azerty)', - 'Cameroon (Dvorak, intl.)': 'CM (Dvorak)', - 'Cameroon Multilingual (QWERTY, intl.)': 'CM (Qwerty)', - 'Canadian (CSA)': 'CA (Multix)', - 'Catalan (Spain, with middle-dot L)': 'ES (Cat)', - Cherokee: 'US (Chr)', - Chinese: 'CN', - Chuvash: 'RU (Cv)', - 'Chuvash (Latin)': 'RU (Cv Latin)', - CloGaelach: 'IE (CloGaelach)', - 'Crimean Tatar (Turkish Alt-Q)': 'UA (Crh Alt)', - 'Crimean Tatar (Turkish F)': 'UA (Crh F)', - 'Crimean Tatar (Turkish Q)': 'UA (Crh)', - Croatian: 'HR', - 'Croatian (US, with Croatian digraphs)': 'HR (Unicodeus)', - 'Croatian (US)': 'HR (Us)', - 'Croatian (with Croatian digraphs)': 'HR (Unicode)', - 'Croatian (with guillemets)': 'HR (Alternatequotes)', - Czech: 'CZ', - 'Czech (QWERTY, extended backslash)': 'CZ (Qwerty Bksl)', - 'Czech (QWERTY, Macintosh)': 'CZ (Qwerty-Mac)', - 'Czech (QWERTY)': 'CZ (Qwerty)', - 'Czech (UCW, only accented letters)': 'CZ (Ucw)', - 'Czech (US, Dvorak, UCW support)': 'CZ (Dvorak-Ucw)', - 'Czech (with <\\|> key)': 'CZ (Bksl)', - Danish: 'DK', - 'Danish (Dvorak)': 'DK (Dvorak)', - 'Danish (Macintosh, no dead keys)': 'DK (Mac Nodeadkeys)', - 'Danish (Macintosh)': 'DK (Mac)', - 'Danish (no dead keys)': 'DK (Nodeadkeys)', - 'Danish (Windows)': 'DK (Winkeys)', - Dari: 'AF', - 'Dari (Afghanistan, OLPC)': 'AF (Fa-Olpc)', - Dhivehi: 'MV', - Dutch: 'NL', - 'Dutch (Macintosh)': 'NL (Mac)', - 'Dutch (standard)': 'NL (Std)', - 'Dutch (US)': 'NL (Us)', - Dzongkha: 'BT', - 'English (Australian)': 'AU', - 'English (Cameroon)': 'CM', - 'English (Canada)': 'CA (Eng)', - 'English (classic Dvorak)': 'US (Dvorak-Classic)', - 'English (Colemak-DH ISO)': 'US (Colemak Dh Iso)', - 'English (Colemak-DH)': 'US (Colemak Dh)', - 'English (Colemak)': 'US (Colemak)', - 'English (Dvorak, alt. intl.)': 'US (Dvorak-Alt-Intl)', - 'English (Dvorak, intl., with dead keys)': 'US (Dvorak-Intl)', - 'English (Dvorak, left-handed)': 'US (Dvorak-L)', - 'English (Dvorak, Macintosh)': 'US (Dvorak-Mac)', - 'English (Dvorak, right-handed)': 'US (Dvorak-R)', - 'English (Dvorak)': 'US (Dvorak)', - 'English (Ghana, GILLBT)': 'GH (Gillbt)', - 'English (Ghana, multilingual)': 'GH (Generic)', - 'English (Ghana)': 'GH', - 'English (India, with rupee)': 'IN (Eng)', - 'English (intl., with AltGr dead keys)': 'US (Altgr-Intl)', - 'English (Macintosh)': 'US (Mac)', - 'English (Mali, US, intl.)': 'ML (Us-Intl)', - 'English (Mali, US, Macintosh)': 'ML (Us-Mac)', - 'English (Nigeria)': 'NG', - 'English (Norman)': 'US (Norman)', - 'English (programmer Dvorak)': 'US (Dvp)', - 'English (South Africa)': 'ZA', - 'English (the divide/multiply toggle the layout)': 'US (Olpc2)', - 'English (UK, Colemak-DH)': 'GB (Colemak Dh)', - 'English (UK, Colemak)': 'GB (Colemak)', - 'English (UK, Dvorak, with UK punctuation)': 'GB (Dvorakukp)', - 'English (UK, Dvorak)': 'GB (Dvorak)', - 'English (UK, extended, Windows)': 'GB (Extd)', - 'English (UK, intl., with dead keys)': 'GB (Intl)', - 'English (UK, Macintosh, intl.)': 'GB (Mac Intl)', - 'English (UK, Macintosh)': 'GB (Mac)', - 'English (UK)': 'GB', - 'English (US, alt. intl.)': 'US (Alt-Intl)', - 'English (US, euro on 5)': 'US (Euro)', - 'English (US, intl., with dead keys)': 'US (Intl)', - 'English (US, Symbolic)': 'US (Symbolic)', - 'English (US)': 'US', - 'English (Workman, intl., with dead keys)': 'US (Workman-Intl)', - 'English (Workman)': 'US (Workman)', - Esperanto: 'EPO', - 'Esperanto (Brazil, Nativo)': 'BR (Nativo-Epo)', - 'Esperanto (legacy)': 'EPO (Legacy)', - 'Esperanto (Portugal, Nativo)': 'PT (Nativo-Epo)', - Estonian: 'EE', - 'Estonian (Dvorak)': 'EE (Dvorak)', - 'Estonian (no dead keys)': 'EE (Nodeadkeys)', - 'Estonian (US)': 'EE (Us)', - Ewe: 'GH (Ewe)', - Faroese: 'FO', - 'Faroese (no dead keys)': 'FO (Nodeadkeys)', - Filipino: 'PH', - 'Filipino (Capewell-Dvorak, Baybayin)': 'PH (Capewell-Dvorak-Bay)', - 'Filipino (Capewell-Dvorak, Latin)': 'PH (Capewell-Dvorak)', - 'Filipino (Capewell-QWERF 2006, Baybayin)': 'PH (Capewell-Qwerf2k6-Bay)', - 'Filipino (Capewell-QWERF 2006, Latin)': 'PH (Capewell-Qwerf2k6)', - 'Filipino (Colemak, Baybayin)': 'PH (Colemak-Bay)', - 'Filipino (Colemak, Latin)': 'PH (Colemak)', - 'Filipino (Dvorak, Baybayin)': 'PH (Dvorak-Bay)', - 'Filipino (Dvorak, Latin)': 'PH (Dvorak)', - 'Filipino (QWERTY, Baybayin)': 'PH (Qwerty-Bay)', - Finnish: 'FI', - 'Finnish (classic, no dead keys)': 'FI (Nodeadkeys)', - 'Finnish (classic)': 'FI (Classic)', - 'Finnish (Macintosh)': 'FI (Mac)', - 'Finnish (Windows)': 'FI (Winkeys)', - French: 'FR', - 'French (alt., Latin-9 only)': 'FR (Oss Latin9)', - 'French (alt., no dead keys)': 'FR (Oss Nodeadkeys)', - 'French (alt.)': 'FR (Oss)', - 'French (AZERTY, AFNOR)': 'FR (Afnor)', - 'French (AZERTY)': 'FR (Azerty)', - 'French (BEPO, AFNOR)': 'FR (Bepo Afnor)', - 'French (BEPO, Latin-9 only)': 'FR (Bepo Latin9)', - 'French (BEPO)': 'FR (Bepo)', - 'French (Cameroon)': 'CM (French)', - 'French (Canada, Dvorak)': 'CA (Fr-Dvorak)', - 'French (Canada, legacy)': 'CA (Fr-Legacy)', - 'French (Canada)': 'CA', - 'French (Democratic Republic of the Congo)': 'CD', - 'French (Dvorak)': 'FR (Dvorak)', - 'French (legacy, alt., no dead keys)': 'FR (Latin9 Nodeadkeys)', - 'French (legacy, alt.)': 'FR (Latin9)', - 'French (Macintosh)': 'FR (Mac)', - 'French (Mali, alt.)': 'ML (Fr-Oss)', - 'French (Morocco)': 'MA (French)', - 'French (no dead keys)': 'FR (Nodeadkeys)', - 'French (Switzerland, Macintosh)': 'CH (Fr Mac)', - 'French (Switzerland, no dead keys)': 'CH (Fr Nodeadkeys)', - 'French (Switzerland)': 'CH (Fr)', - 'French (Togo)': 'TG', - 'French (US)': 'FR (Us)', - 'Friulian (Italy)': 'IT (Fur)', - Fula: 'GH (Fula)', - Ga: 'GH (Ga)', - Georgian: 'GE', - 'Georgian (ergonomic)': 'GE (Ergonomic)', - 'Georgian (France, AZERTY Tskapo)': 'FR (Geo)', - 'Georgian (Italy)': 'IT (Geo)', - 'Georgian (MESS)': 'GE (Mess)', - German: 'DE', - 'German (Austria, Macintosh)': 'AT (Mac)', - 'German (Austria, no dead keys)': 'AT (Nodeadkeys)', - 'German (Austria)': 'AT', - 'German (dead acute)': 'DE (Deadacute)', - 'German (dead grave acute)': 'DE (Deadgraveacute)', - 'German (dead tilde)': 'DE (Deadtilde)', - 'German (Dvorak)': 'DE (Dvorak)', - 'German (E1)': 'DE (E1)', - 'German (E2)': 'DE (E2)', - 'German (Macintosh, no dead keys)': 'DE (Mac Nodeadkeys)', - 'German (Macintosh)': 'DE (Mac)', - 'German (Neo 2)': 'DE (Neo)', - 'German (no dead keys)': 'DE (Nodeadkeys)', - 'German (QWERTY)': 'DE (Qwerty)', - 'German (Switzerland, legacy)': 'CH (Legacy)', - 'German (Switzerland, Macintosh)': 'CH (De Mac)', - 'German (Switzerland, no dead keys)': 'CH (De Nodeadkeys)', - 'German (Switzerland)': 'CH', - 'German (T3)': 'DE (T3)', - 'German (US)': 'DE (Us)', - Greek: 'GR', - 'Greek (extended)': 'GR (Extended)', - 'Greek (no dead keys)': 'GR (Nodeadkeys)', - 'Greek (polytonic)': 'GR (Polytonic)', - 'Greek (simple)': 'GR (Simple)', - Gujarati: 'IN (Guj)', - 'Hanyu Pinyin Letters (with AltGr dead keys)': 'CN (Altgr-Pinyin)', - 'Hausa (Ghana)': 'GH (Hausa)', - 'Hausa (Nigeria)': 'NG (Hausa)', - Hawaiian: 'US (Haw)', - Hebrew: 'IL', - 'Hebrew (Biblical, Tiro)': 'IL (Biblical)', - 'Hebrew (lyx)': 'IL (Lyx)', - 'Hebrew (phonetic)': 'IL (Phonetic)', - 'Hindi (Bolnagri)': 'IN (Bolnagri)', - 'Hindi (KaGaPa, phonetic)': 'IN (Hin-Kagapa)', - 'Hindi (Wx)': 'IN (Hin-Wx)', - Hungarian: 'HU', - 'Hungarian (no dead keys)': 'HU (Nodeadkeys)', - 'Hungarian (QWERTY, 101-key, comma, dead keys)': 'HU (101 Qwerty Comma Dead)', - 'Hungarian (QWERTY, 101-key, comma, no dead keys)': 'HU (101 Qwerty Comma Nodead)', - 'Hungarian (QWERTY, 101-key, dot, dead keys)': 'HU (101 Qwerty Dot Dead)', - 'Hungarian (QWERTY, 101-key, dot, no dead keys)': 'HU (101 Qwerty Dot Nodead)', - 'Hungarian (QWERTY, 102-key, comma, dead keys)': 'HU (102 Qwerty Comma Dead)', - 'Hungarian (QWERTY, 102-key, comma, no dead keys)': 'HU (102 Qwerty Comma Nodead)', - 'Hungarian (QWERTY, 102-key, dot, dead keys)': 'HU (102 Qwerty Dot Dead)', - 'Hungarian (QWERTY, 102-key, dot, no dead keys)': 'HU (102 Qwerty Dot Nodead)', - 'Hungarian (QWERTY)': 'HU (Qwerty)', - 'Hungarian (QWERTZ, 101-key, comma, dead keys)': 'HU (101 Qwertz Comma Dead)', - 'Hungarian (QWERTZ, 101-key, comma, no dead keys)': 'HU (101 Qwertz Comma Nodead)', - 'Hungarian (QWERTZ, 101-key, dot, dead keys)': 'HU (101 Qwertz Dot Dead)', - 'Hungarian (QWERTZ, 101-key, dot, no dead keys)': 'HU (101 Qwertz Dot Nodead)', - 'Hungarian (QWERTZ, 102-key, comma, dead keys)': 'HU (102 Qwertz Comma Dead)', - 'Hungarian (QWERTZ, 102-key, comma, no dead keys)': 'HU (102 Qwertz Comma Nodead)', - 'Hungarian (QWERTZ, 102-key, dot, dead keys)': 'HU (102 Qwertz Dot Dead)', - 'Hungarian (QWERTZ, 102-key, dot, no dead keys)': 'HU (102 Qwertz Dot Nodead)', - 'Hungarian (standard)': 'HU (Standard)', - Icelandic: 'IS', - 'Icelandic (Dvorak)': 'IS (Dvorak)', - 'Icelandic (Macintosh, legacy)': 'IS (Mac Legacy)', - 'Icelandic (Macintosh)': 'IS (Mac)', - Igbo: 'NG (Igbo)', - Indian: 'IN', - 'Indic IPA': 'IN (Iipa)', - 'Indonesian (Arab Melayu, extended phonetic)': 'ID (Melayu-Phoneticx)', - 'Indonesian (Arab Melayu, phonetic)': 'ID (Melayu-Phonetic)', - 'Indonesian (Arab Pegon, phonetic)': 'ID (Pegon-Phonetic)', - 'Indonesian (Latin)': 'ID', - Inuktitut: 'CA (Ike)', - Iraqi: 'IQ', - Irish: 'IE', - 'Irish (UnicodeExpert)': 'IE (UnicodeExpert)', - Italian: 'IT', - 'Italian (IBM 142)': 'IT (Ibm)', - 'Italian (intl., with dead keys)': 'IT (Intl)', - 'Italian (Macintosh)': 'IT (Mac)', - 'Italian (no dead keys)': 'IT (Nodeadkeys)', - 'Italian (US)': 'IT (Us)', - 'Italian (Windows)': 'IT (Winkeys)', - Japanese: 'JP', - 'Japanese (Dvorak)': 'JP (Dvorak)', - 'Japanese (Kana 86)': 'JP (Kana86)', - 'Japanese (Kana)': 'JP (Kana)', - 'Japanese (Macintosh)': 'JP (Mac)', - 'Japanese (OADG 109A)': 'JP (OADG109A)', - Javanese: 'ID (Javanese)', - 'Kabyle (AZERTY, with dead keys)': 'DZ (Azerty-Deadkeys)', - 'Kabyle (QWERTY, UK, with dead keys)': 'DZ (Qwerty-Gb-Deadkeys)', - 'Kabyle (QWERTY, US, with dead keys)': 'DZ (Qwerty-Us-Deadkeys)', - Kalmyk: 'RU (Xal)', - Kannada: 'IN (Kan)', - 'Kannada (KaGaPa, phonetic)': 'IN (Kan-Kagapa)', - Kashubian: 'PL (Csb)', - Kazakh: 'KZ', - 'Kazakh (extended)': 'KZ (Ext)', - 'Kazakh (Latin)': 'KZ (Latin)', - 'Kazakh (with Russian)': 'KZ (Kazrus)', - 'Khmer (Cambodia)': 'KH', - Kikuyu: 'KE (Kik)', - Komi: 'RU (Kom)', - Korean: 'KR', - 'Korean (101/104-key compatible)': 'KR (Kr104)', - 'Kurdish (Iran, Arabic-Latin)': 'IR (Ku Ara)', - 'Kurdish (Iran, F)': 'IR (Ku F)', - 'Kurdish (Iran, Latin Alt-Q)': 'IR (Ku Alt)', - 'Kurdish (Iran, Latin Q)': 'IR (Ku)', - 'Kurdish (Iraq, Arabic-Latin)': 'IQ (Ku Ara)', - 'Kurdish (Iraq, F)': 'IQ (Ku F)', - 'Kurdish (Iraq, Latin Alt-Q)': 'IQ (Ku Alt)', - 'Kurdish (Iraq, Latin Q)': 'IQ (Ku)', - 'Kurdish (Syria, F)': 'SY (Ku F)', - 'Kurdish (Syria, Latin Alt-Q)': 'SY (Ku Alt)', - 'Kurdish (Syria, Latin Q)': 'SY (Ku)', - 'Kurdish (Turkey, F)': 'TR (Ku F)', - 'Kurdish (Turkey, Latin Alt-Q)': 'TR (Ku Alt)', - 'Kurdish (Turkey, Latin Q)': 'TR (Ku)', - Kyrgyz: 'KG', - 'Kyrgyz (phonetic)': 'KG (Phonetic)', - Lao: 'LA', - 'Lao (STEA)': 'LA (Stea)', - Latvian: 'LV', - 'Latvian (adapted)': 'LV (Adapted)', - 'Latvian (apostrophe)': 'LV (Apostrophe)', - 'Latvian (ergonomic, ŪGJRMV)': 'LV (Ergonomic)', - 'Latvian (F)': 'LV (Fkey)', - 'Latvian (modern)': 'LV (Modern)', - 'Latvian (tilde)': 'LV (Tilde)', - Lithuanian: 'LT', - 'Lithuanian (IBM LST 1205-92)': 'LT (Ibm)', - 'Lithuanian (LEKP)': 'LT (Lekp)', - 'Lithuanian (LEKPa)': 'LT (Lekpa)', - 'Lithuanian (Ratise)': 'LT (Ratise)', - 'Lithuanian (standard)': 'LT (Std)', - 'Lithuanian (US)': 'LT (Us)', - 'Lower Sorbian': 'DE (Dsb)', - 'Lower Sorbian (QWERTZ)': 'DE (Dsb Qwertz)', - Macedonian: 'MK', - 'Macedonian (no dead keys)': 'MK (Nodeadkeys)', - 'Malay (Jawi, Arabic Keyboard)': 'MY', - 'Malay (Jawi, phonetic)': 'MY (Phonetic)', - Malayalam: 'IN (Mal)', - 'Malayalam (enhanced InScript, with rupee)': 'IN (Mal Enhanced)', - 'Malayalam (Lalitha)': 'IN (Mal Lalitha)', - Maltese: 'MT', - 'Maltese (UK, with AltGr overrides)': 'MT (Alt-Gb)', - 'Maltese (US, with AltGr overrides)': 'MT (Alt-Us)', - 'Maltese (US)': 'MT (Us)', - 'Manipuri (Eeyek)': 'IN (Eeyek)', - Maori: 'MAO', - 'Marathi (enhanced InScript)': 'IN (Marathi)', - 'Marathi (KaGaPa, phonetic)': 'IN (Mar-Kagapa)', - Mari: 'RU (Chm)', - Mmuock: 'CM (Mmuock)', - Moldavian: 'MD', - 'Moldavian (Gagauz)': 'MD (Gag)', - Mon: 'MM (Mnw)', - 'Mon (A1)': 'MM (Mnw-A1)', - Mongolian: 'MN', - 'Mongolian (Bichig)': 'CN (Mon Trad)', - 'Mongolian (Galik)': 'CN (Mon Trad Galik)', - 'Mongolian (Manchu Galik)': 'CN (Mon Manchu Galik)', - 'Mongolian (Manchu)': 'CN (Mon Trad Manchu)', - 'Mongolian (Todo Galik)': 'CN (Mon Todo Galik)', - 'Mongolian (Todo)': 'CN (Mon Trad Todo)', - 'Mongolian (Xibe)': 'CN (Mon Trad Xibe)', - Montenegrin: 'ME', - 'Montenegrin (Cyrillic, with guillemets)': 'ME (Cyrillicalternatequotes)', - 'Montenegrin (Cyrillic, ZE and ZHE swapped)': 'ME (Cyrillicyz)', - 'Montenegrin (Cyrillic)': 'ME (Cyrillic)', - 'Montenegrin (Latin, QWERTY)': 'ME (Latinyz)', - 'Montenegrin (Latin, Unicode, QWERTY)': 'ME (Latinunicodeyz)', - 'Montenegrin (Latin, Unicode)': 'ME (Latinunicode)', - 'Montenegrin (Latin, with guillemets)': 'ME (Latinalternatequotes)', - "N'Ko (AZERTY)": 'GN', - Nepali: 'NP', - 'Northern Saami (Finland)': 'FI (Smi)', - 'Northern Saami (Norway, no dead keys)': 'NO (Smi Nodeadkeys)', - 'Northern Saami (Norway)': 'NO (Smi)', - 'Northern Saami (Sweden)': 'SE (Smi)', - Norwegian: 'NO', - 'Norwegian (Colemak)': 'NO (Colemak)', - 'Norwegian (Dvorak)': 'NO (Dvorak)', - 'Norwegian (Macintosh, no dead keys)': 'NO (Mac Nodeadkeys)', - 'Norwegian (Macintosh)': 'NO (Mac)', - 'Norwegian (no dead keys)': 'NO (Nodeadkeys)', - 'Norwegian (Windows)': 'NO (Winkeys)', - Occitan: 'FR (Oci)', - Ogham: 'IE (Ogam)', - 'Ogham (IS434)': 'IE (Ogam Is434)', - 'Ol Chiki': 'IN (Olck)', - 'Old Turkic': 'TR (Otk)', - 'Old Turkic (F)': 'TR (Otkf)', - Oriya: 'IN (Ori)', - 'Oriya (Bolnagri)': 'IN (Ori-Bolnagri)', - 'Oriya (Wx)': 'IN (Ori-Wx)', - 'Ossetian (Georgia)': 'GE (Os)', - 'Ossetian (legacy)': 'RU (Os Legacy)', - 'Ossetian (Windows)': 'RU (Os Winkeys)', - 'Ottoman (F)': 'TR (Otf)', - 'Ottoman (Q)': 'TR (Ot)', - 'Pannonian Rusyn': 'RS (Rue)', - Pashto: 'AF (Ps)', - 'Pashto (Afghanistan, OLPC)': 'AF (Ps-Olpc)', - Persian: 'IR', - 'Persian (with Persian keypad)': 'IR (Pes Keypad)', - Polish: 'PL', - 'Polish (British keyboard)': 'GB (Pl)', - 'Polish (Dvorak, with Polish quotes on key 1)': 'PL (Dvorak Altquotes)', - 'Polish (Dvorak, with Polish quotes on quotemark key)': 'PL (Dvorak Quotes)', - 'Polish (Dvorak)': 'PL (Dvorak)', - 'Polish (legacy)': 'PL (Legacy)', - 'Polish (programmer Dvorak)': 'PL (Dvp)', - 'Polish (QWERTZ)': 'PL (Qwertz)', - Portuguese: 'PT', - 'Portuguese (Brazil, Dvorak)': 'BR (Dvorak)', - 'Portuguese (Brazil, IBM/Lenovo ThinkPad)': 'BR (Thinkpad)', - 'Portuguese (Brazil, Nativo for US keyboards)': 'BR (Nativo-Us)', - 'Portuguese (Brazil, Nativo)': 'BR (Nativo)', - 'Portuguese (Brazil, no dead keys)': 'BR (Nodeadkeys)', - 'Portuguese (Brazil)': 'BR', - 'Portuguese (Macintosh, no dead keys)': 'PT (Mac Nodeadkeys)', - 'Portuguese (Macintosh)': 'PT (Mac)', - 'Portuguese (Nativo for US keyboards)': 'PT (Nativo-Us)', - 'Portuguese (Nativo)': 'PT (Nativo)', - 'Portuguese (no dead keys)': 'PT (Nodeadkeys)', - 'Punjabi (Gurmukhi Jhelum)': 'IN (Jhelum)', - 'Punjabi (Gurmukhi)': 'IN (Guru)', - Romanian: 'RO', - 'Romanian (Germany, no dead keys)': 'DE (Ro Nodeadkeys)', - 'Romanian (Germany)': 'DE (Ro)', - 'Romanian (standard)': 'RO (Std)', - 'Romanian (Windows)': 'RO (Winkeys)', - Russian: 'RU', - 'Russian (Belarus)': 'BY (Ru)', - 'Russian (Czech, phonetic)': 'CZ (Rus)', - 'Russian (DOS)': 'RU (Dos)', - 'Russian (engineering, EN)': 'RU (Ruchey En)', - 'Russian (engineering, RU)': 'RU (Ruchey Ru)', - 'Russian (Georgia)': 'GE (Ru)', - 'Russian (Germany, phonetic)': 'DE (Ru)', - 'Russian (Kazakhstan, with Kazakh)': 'KZ (Ruskaz)', - 'Russian (legacy)': 'RU (Legacy)', - 'Russian (Macintosh)': 'RU (Mac)', - 'Russian (phonetic, AZERTY)': 'RU (Phonetic Azerty)', - 'Russian (phonetic, Dvorak)': 'RU (Phonetic Dvorak)', - 'Russian (phonetic, French)': 'RU (Phonetic Fr)', - 'Russian (phonetic, Windows)': 'RU (Phonetic Winkeys)', - 'Russian (phonetic, YAZHERTY)': 'RU (Phonetic YAZHERTY)', - 'Russian (phonetic)': 'RU (Phonetic)', - 'Russian (Poland, phonetic Dvorak)': 'PL (Ru Phonetic Dvorak)', - 'Russian (Sweden, phonetic, no dead keys)': 'SE (Rus Nodeadkeys)', - 'Russian (Sweden, phonetic)': 'SE (Rus)', - 'Russian (typewriter, legacy)': 'RU (Typewriter-Legacy)', - 'Russian (typewriter)': 'RU (Typewriter)', - 'Russian (Ukraine, standard RSTU)': 'UA (Rstu Ru)', - 'Russian (US, phonetic)': 'US (Rus)', - 'Saisiyat (Taiwan)': 'TW (Saisiyat)', - Samogitian: 'LT (Sgs)', - 'Sanskrit (KaGaPa, phonetic)': 'IN (San-Kagapa)', - 'Scottish Gaelic': 'GB (Gla)', - Serbian: 'RS', - 'Serbian (Cyrillic, with guillemets)': 'RS (Alternatequotes)', - 'Serbian (Cyrillic, ZE and ZHE swapped)': 'RS (Yz)', - 'Serbian (Latin, QWERTY)': 'RS (Latinyz)', - 'Serbian (Latin, Unicode, QWERTY)': 'RS (Latinunicodeyz)', - 'Serbian (Latin, Unicode)': 'RS (Latinunicode)', - 'Serbian (Latin, with guillemets)': 'RS (Latinalternatequotes)', - 'Serbian (Latin)': 'RS (Latin)', - 'Serbian (Russia)': 'RU (Srp)', - 'Serbo-Croatian (US)': 'US (Hbs)', - Shan: 'MM (Shn)', - 'Shan (Zawgyi Tai)': 'MM (Zgt)', - Sicilian: 'IT (Scn)', - Silesian: 'PL (Szl)', - Sindhi: 'PK (Snd)', - 'Sinhala (phonetic)': 'LK', - 'Sinhala (US)': 'LK (Us)', - Slovak: 'SK', - 'Slovak (extended backslash)': 'SK (Bksl)', - 'Slovak (QWERTY, extended backslash)': 'SK (Qwerty Bksl)', - 'Slovak (QWERTY)': 'SK (Qwerty)', - Slovenian: 'SI', - 'Slovenian (US)': 'SI (Us)', - 'Slovenian (with guillemets)': 'SI (Alternatequotes)', - Spanish: 'ES', - 'Spanish (dead tilde)': 'ES (Deadtilde)', - 'Spanish (Dvorak)': 'ES (Dvorak)', - 'Spanish (Latin American, Colemak)': 'LATAM (Colemak)', - 'Spanish (Latin American, dead tilde)': 'LATAM (Deadtilde)', - 'Spanish (Latin American, Dvorak)': 'LATAM (Dvorak)', - 'Spanish (Latin American, no dead keys)': 'LATAM (Nodeadkeys)', - 'Spanish (Latin American)': 'LATAM', - 'Spanish (Macintosh)': 'ES (Mac)', - 'Spanish (no dead keys)': 'ES (Nodeadkeys)', - 'Spanish (Windows)': 'ES (Winkeys)', - 'Swahili (Kenya)': 'KE', - 'Swahili (Tanzania)': 'TZ', - Swedish: 'SE', - 'Swedish (Dvorak, intl.)': 'SE (Us Dvorak)', - 'Swedish (Dvorak)': 'SE (Dvorak)', - 'Swedish (Macintosh)': 'SE (Mac)', - 'Swedish (no dead keys)': 'SE (Nodeadkeys)', - 'Swedish (Svdvorak)': 'SE (Svdvorak)', - 'Swedish (US)': 'SE (Us)', - 'Swedish Sign Language': 'SE (Swl)', - Syriac: 'SY (Syc)', - 'Syriac (phonetic)': 'SY (Syc Phonetic)', - Taiwanese: 'TW', - 'Taiwanese (indigenous)': 'TW (Indigenous)', - Tajik: 'TJ', - 'Tajik (legacy)': 'TJ (Legacy)', - 'Tamil (InScript, with Arabic numerals)': 'IN (Tam)', - 'Tamil (InScript, with Tamil numerals)': 'IN (Tam Tamilnumbers)', - "Tamil (Sri Lanka, TamilNet '99, TAB encoding)": 'LK (Tam TAB)', - "Tamil (Sri Lanka, TamilNet '99)": 'LK (Tam Unicode)', - "Tamil (TamilNet '99 with Tamil numerals)": 'IN (Tamilnet Tamilnumbers)', - "Tamil (TamilNet '99, TAB encoding)": 'IN (Tamilnet TAB)', - "Tamil (TamilNet '99, TSCII encoding)": 'IN (Tamilnet TSCII)', - "Tamil (TamilNet '99)": 'IN (Tamilnet)', - Tarifit: 'MA (Rif)', - Tatar: 'RU (Tt)', - Telugu: 'IN (Tel)', - 'Telugu (KaGaPa, phonetic)': 'IN (Tel-Kagapa)', - 'Telugu (Sarala)': 'IN (Tel-Sarala)', - Thai: 'TH', - 'Thai (Pattachote)': 'TH (Pat)', - 'Thai (TIS-820.2538)': 'TH (Tis)', - Tibetan: 'CN (Tib)', - 'Tibetan (with ASCII numerals)': 'CN (Tib Asciinum)', - Tswana: 'BW', - Turkish: 'TR', - 'Turkish (Alt-Q)': 'TR (Alt)', - 'Turkish (E)': 'TR (E)', - 'Turkish (F)': 'TR (F)', - 'Turkish (Germany)': 'DE (Tr)', - 'Turkish (intl., with dead keys)': 'TR (Intl)', - Turkmen: 'TM', - 'Turkmen (Alt-Q)': 'TM (Alt)', - Udmurt: 'RU (Udm)', - Ukrainian: 'UA', - 'Ukrainian (homophonic)': 'UA (Homophonic)', - 'Ukrainian (legacy)': 'UA (Legacy)', - 'Ukrainian (macOS)': 'UA (MacOS)', - 'Ukrainian (phonetic)': 'UA (Phonetic)', - 'Ukrainian (standard RSTU)': 'UA (Rstu)', - 'Ukrainian (typewriter)': 'UA (Typewriter)', - 'Ukrainian (Windows)': 'UA (Winkeys)', - 'Urdu (alt. phonetic)': 'IN (Urd-Phonetic3)', - 'Urdu (Pakistan, CRULP)': 'PK (Urd-Crulp)', - 'Urdu (Pakistan, NLA)': 'PK (Urd-Nla)', - 'Urdu (Pakistan)': 'PK', - 'Urdu (phonetic)': 'IN (Urd-Phonetic)', - 'Urdu (Windows)': 'IN (Urd-Winkeys)', - Uyghur: 'CN (Ug)', - Uzbek: 'UZ', - 'Uzbek (Afghanistan, OLPC)': 'AF (Uz-Olpc)', - 'Uzbek (Afghanistan)': 'AF (Uz)', - 'Uzbek (Latin)': 'UZ (Latin)', - Vietnamese: 'VN', - 'Vietnamese (France)': 'VN (Fr)', - 'Vietnamese (US)': 'VN (Us)', - Wolof: 'SN', - Yakut: 'RU (Sah)', - Yoruba: 'NG (Yoruba)', - 'Unknown Layout': 'Unknown', -} as const; diff --git a/ags/HyprPanel/customModules/module.ts b/ags/HyprPanel/customModules/module.ts deleted file mode 100644 index 5438ade..0000000 --- a/ags/HyprPanel/customModules/module.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { BarBoxChild, Module } from 'lib/types/bar'; -import { BarButtonStyles } from 'lib/types/options'; -import { Bind } from 'lib/types/variable'; -import { GtkWidget } from 'lib/types/widget'; -import options from 'options'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0'; - -const { style } = options.theme.bar.buttons; - -const undefinedVar = Variable(undefined); - -export const module = ({ - icon, - textIcon, - label, - tooltipText, - boxClass, - props = {}, - showLabelBinding = undefinedVar.bind('value'), - showLabel, - labelHook, - hook, -}: Module): BarBoxChild => { - const getIconWidget = (): GtkWidget | undefined => { - let iconWidget: Gtk.Widget | undefined; - - if (icon !== undefined) { - iconWidget = Widget.Icon({ - class_name: `txt-icon bar-button-icon module-icon ${boxClass}`, - icon: icon, - }) as unknown as Gtk.Widget; - } else if (textIcon !== undefined) { - iconWidget = Widget.Label({ - class_name: `txt-icon bar-button-icon module-icon ${boxClass}`, - label: textIcon, - }) as unknown as Gtk.Widget; - } - - return iconWidget; - }; - - return { - component: Widget.Box({ - className: Utils.merge( - [style.bind('value'), showLabelBinding], - (style: BarButtonStyles, shwLabel: boolean) => { - const shouldShowLabel = shwLabel || showLabel; - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `${boxClass} ${styleMap[style]} ${!shouldShowLabel ? 'no-label' : ''}`; - }, - ), - tooltip_text: tooltipText, - children: Utils.merge([showLabelBinding], (showLabelBinding): Gtk.Widget[] => { - const childrenArray: Gtk.Widget[] = []; - const iconWidget = getIconWidget(); - - if (iconWidget !== undefined) { - childrenArray.push(iconWidget); - } - - if (showLabelBinding) { - childrenArray.push( - Widget.Label({ - class_name: `bar-button-label module-label ${boxClass}`, - label: label, - setup: labelHook, - }) as unknown as Gtk.Widget, - ); - } - return childrenArray; - }) as Bind, - setup: hook, - }), - tooltip_text: tooltipText, - isVisible: true, - boxClass, - props, - }; -}; diff --git a/ags/HyprPanel/customModules/netstat/computeNetwork.ts b/ags/HyprPanel/customModules/netstat/computeNetwork.ts deleted file mode 100644 index e1b2dcd..0000000 --- a/ags/HyprPanel/customModules/netstat/computeNetwork.ts +++ /dev/null @@ -1,110 +0,0 @@ -import GLib from 'gi://GLib'; -import { Variable as VariableType } from 'types/variable'; -import { NetworkResourceData } from 'lib/types/customModules/network'; -import { GET_DEFAULT_NETSTAT_DATA } from 'lib/types/defaults/netstat'; -import { RateUnit } from 'lib/types/bar'; - -let previousNetUsage = { rx: 0, tx: 0, time: 0 }; - -const formatRate = (rate: number, type: string, round: boolean): string => { - const fixed = round ? 0 : 2; - - switch (true) { - case type === 'KiB': - return `${(rate / 1e3).toFixed(fixed)} KiB/s`; - case type === 'MiB': - return `${(rate / 1e6).toFixed(fixed)} MiB/s`; - case type === 'GiB': - return `${(rate / 1e9).toFixed(fixed)} GiB/s`; - case rate >= 1e9: - return `${(rate / 1e9).toFixed(fixed)} GiB/s`; - case rate >= 1e6: - return `${(rate / 1e6).toFixed(fixed)} MiB/s`; - case rate >= 1e3: - return `${(rate / 1e3).toFixed(fixed)} KiB/s`; - default: - return `${rate.toFixed(fixed)} bytes/s`; - } -}; - -interface NetworkUsage { - name: string; - rx: number; - tx: number; -} - -const parseInterfaceData = (line: string): NetworkUsage | null => { - const trimmedLine = line.trim(); - if (!trimmedLine || trimmedLine.startsWith('Inter-') || trimmedLine.startsWith('face')) { - return null; - } - - const [iface, rx, , , , , , , , tx] = trimmedLine.split(/\s+/); - const rxValue = parseInt(rx, 10); - const txValue = parseInt(tx, 10); - const cleanedIface = iface.replace(':', ''); - - return { name: cleanedIface, rx: rxValue, tx: txValue }; -}; - -const isValidInterface = (iface: NetworkUsage | null, interfaceName: string): boolean => { - if (!iface) return false; - if (interfaceName) return iface.name === interfaceName; - return iface.name !== 'lo' && iface.rx > 0 && iface.tx > 0; -}; - -const getNetworkUsage = (interfaceName: string = ''): NetworkUsage => { - const [success, data] = GLib.file_get_contents('/proc/net/dev'); - if (!success) { - console.error('Failed to read /proc/net/dev'); - return { name: '', rx: 0, tx: 0 }; - } - - const lines = new TextDecoder('utf-8').decode(data).split('\n'); - for (const line of lines) { - const iface = parseInterfaceData(line); - if (isValidInterface(iface, interfaceName)) { - return iface!; - } - } - - return { name: '', rx: 0, tx: 0 }; -}; - -export const computeNetwork = ( - round: VariableType, - interfaceNameVar: VariableType, - dataType: VariableType, -): NetworkResourceData => { - const rateUnit = dataType.value; - const interfaceName = interfaceNameVar ? interfaceNameVar.value : ''; - - const DEFAULT_NETSTAT_DATA = GET_DEFAULT_NETSTAT_DATA(rateUnit); - try { - const { rx, tx, name } = getNetworkUsage(interfaceName); - const currentTime = Date.now(); - - if (!name) { - return DEFAULT_NETSTAT_DATA; - } - - if (previousNetUsage.time === 0) { - previousNetUsage = { rx, tx, time: currentTime }; - return DEFAULT_NETSTAT_DATA; - } - - const timeDiff = Math.max((currentTime - previousNetUsage.time) / 1000, 1); - const rxRate = (rx - previousNetUsage.rx) / timeDiff; - const txRate = (tx - previousNetUsage.tx) / timeDiff; - - previousNetUsage = { rx, tx, time: currentTime }; - - return { - in: formatRate(rxRate, rateUnit, round.value), - out: formatRate(txRate, rateUnit, round.value), - }; - } catch (error) { - console.error('Error calculating network usage:', error); - return DEFAULT_NETSTAT_DATA; - } -}; diff --git a/ags/HyprPanel/customModules/netstat/index.ts b/ags/HyprPanel/customModules/netstat/index.ts deleted file mode 100644 index abfe2ca..0000000 --- a/ags/HyprPanel/customModules/netstat/index.ts +++ /dev/null @@ -1,105 +0,0 @@ -import options from 'options'; -import { module } from '../module'; -import { inputHandler } from 'customModules/utils'; -import { computeNetwork } from './computeNetwork'; -import { BarBoxChild, NetstatLabelType } from 'lib/types/bar'; -import Button from 'types/widgets/button'; -import { NetworkResourceData } from 'lib/types/customModules/network'; -import { NETWORK_LABEL_TYPES } from 'lib/types/defaults/bar'; -import { GET_DEFAULT_NETSTAT_DATA } from 'lib/types/defaults/netstat'; -import { pollVariable } from 'customModules/PollVar'; -import { Attribute, Child } from 'lib/types/widget'; - -const { - label, - labelType, - networkInterface, - rateUnit, - icon, - round, - leftClick, - rightClick, - middleClick, - pollingInterval, -} = options.bar.customModules.netstat; - -export const networkUsage = Variable(GET_DEFAULT_NETSTAT_DATA(rateUnit.value)); - -pollVariable( - // Variable to poll and update with the result of the function passed in - networkUsage, - // Variables that should trigger the polling function to update when they change - [rateUnit.bind('value'), networkInterface.bind('value'), round.bind('value')], - // Interval at which to poll - pollingInterval.bind('value'), - // Function to execute to get the network data - computeNetwork, - // Optional parameters to pass to the function - // round is a boolean that determines whether to round the values - round, - // Optional parameters to pass to the function - // networkInterface is the interface name to filter the data - networkInterface, - // Optional parameters to pass to the function - // rateUnit is the unit to display the data in - // e.g. KiB, MiB, GiB, etc. - rateUnit, -); - -export const Netstat = (): BarBoxChild => { - const renderNetworkLabel = (lblType: NetstatLabelType, network: NetworkResourceData): string => { - switch (lblType) { - case 'in': - return `↓ ${network.in}`; - case 'out': - return `↑ ${network.out}`; - default: - return `↓ ${network.in} ↑ ${network.out}`; - } - }; - - const netstatModule = module({ - textIcon: icon.bind('value'), - label: Utils.merge( - [networkUsage.bind('value'), labelType.bind('value')], - (network: NetworkResourceData, lblTyp: NetstatLabelType) => renderNetworkLabel(lblTyp, network), - ), - tooltipText: labelType.bind('value').as((lblTyp) => { - return lblTyp === 'full' ? 'Ingress / Egress' : lblTyp === 'in' ? 'Ingress' : 'Egress'; - }), - boxClass: 'netstat', - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - fn: () => { - labelType.value = NETWORK_LABEL_TYPES[ - (NETWORK_LABEL_TYPES.indexOf(labelType.value) + 1) % NETWORK_LABEL_TYPES.length - ] as NetstatLabelType; - }, - }, - onScrollDown: { - fn: () => { - labelType.value = NETWORK_LABEL_TYPES[ - (NETWORK_LABEL_TYPES.indexOf(labelType.value) - 1 + NETWORK_LABEL_TYPES.length) % - NETWORK_LABEL_TYPES.length - ] as NetstatLabelType; - }, - }, - }); - }, - }, - }); - - return netstatModule; -}; diff --git a/ags/HyprPanel/customModules/power/index.ts b/ags/HyprPanel/customModules/power/index.ts deleted file mode 100644 index da678ad..0000000 --- a/ags/HyprPanel/customModules/power/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import options from 'options'; -import { module } from '../module'; - -import { inputHandler } from 'customModules/utils'; -import Button from 'types/widgets/button'; -import { Attribute, Child } from 'lib/types/widget'; -import { BarBoxChild } from 'lib/types/bar'; - -const { icon, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.power; - -export const Power = (): BarBoxChild => { - const powerModule = module({ - tooltipText: 'Power Menu', - textIcon: icon.bind('value'), - boxClass: 'powermodule', - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return powerModule; -}; diff --git a/ags/HyprPanel/customModules/ram/computeRam.ts b/ags/HyprPanel/customModules/ram/computeRam.ts deleted file mode 100644 index b8026c2..0000000 --- a/ags/HyprPanel/customModules/ram/computeRam.ts +++ /dev/null @@ -1,40 +0,0 @@ -const GLib = imports.gi.GLib; - -import { divide } from 'customModules/utils'; -import { GenericResourceData } from 'lib/types/customModules/generic'; -import { Variable as VariableType } from 'types/variable'; - -export const calculateRamUsage = (round: VariableType): GenericResourceData => { - try { - const [success, meminfoBytes] = GLib.file_get_contents('/proc/meminfo'); - - if (!success || !meminfoBytes) { - throw new Error('Failed to read /proc/meminfo or file content is null.'); - } - - const meminfo = new TextDecoder('utf-8').decode(meminfoBytes); - - const totalMatch = meminfo.match(/MemTotal:\s+(\d+)/); - const availableMatch = meminfo.match(/MemAvailable:\s+(\d+)/); - - if (!totalMatch || !availableMatch) { - throw new Error('Failed to parse /proc/meminfo for memory values.'); - } - - const totalRamInBytes = parseInt(totalMatch[1], 10) * 1024; - const availableRamInBytes = parseInt(availableMatch[1], 10) * 1024; - - let usedRam = totalRamInBytes - availableRamInBytes; - usedRam = isNaN(usedRam) || usedRam < 0 ? 0 : usedRam; - - return { - percentage: divide([totalRamInBytes, usedRam], round.value), - total: totalRamInBytes, - used: usedRam, - free: availableRamInBytes, - }; - } catch (error) { - console.error('Error calculating RAM usage:', error); - return { total: 0, used: 0, percentage: 0, free: 0 }; - } -}; diff --git a/ags/HyprPanel/customModules/ram/index.ts b/ags/HyprPanel/customModules/ram/index.ts deleted file mode 100644 index b651aaa..0000000 --- a/ags/HyprPanel/customModules/ram/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -import options from 'options'; - -// Module initializer -import { module } from '../module'; - -// Types -import { GenericResourceData } from 'lib/types/customModules/generic'; -import Button from 'types/widgets/button'; - -// Helper Methods -import { calculateRamUsage } from './computeRam'; - -// Utility Methods -import { formatTooltip, inputHandler, renderResourceLabel } from 'customModules/utils'; -import { BarBoxChild, ResourceLabelType } from 'lib/types/bar'; - -// Global Constants -import { LABEL_TYPES } from 'lib/types/defaults/bar'; -import { pollVariable } from 'customModules/PollVar'; -import { Attribute, Child } from 'lib/types/widget'; - -// All the user configurable options for the ram module that are needed -const { label, labelType, round, leftClick, rightClick, middleClick, pollingInterval, icon } = - options.bar.customModules.ram; - -const defaultRamData: GenericResourceData = { total: 0, used: 0, percentage: 0, free: 0 }; -const ramUsage = Variable(defaultRamData); - -pollVariable(ramUsage, [round.bind('value')], pollingInterval.bind('value'), calculateRamUsage, round); - -export const Ram = (): BarBoxChild => { - const ramModule = module({ - textIcon: icon.bind('value'), - label: Utils.merge( - [ramUsage.bind('value'), labelType.bind('value'), round.bind('value')], - (rmUsg: GenericResourceData, lblTyp: ResourceLabelType, round: boolean) => { - const returnValue = renderResourceLabel(lblTyp, rmUsg, round); - - return returnValue; - }, - ), - tooltipText: labelType.bind('value').as((lblTyp) => { - return formatTooltip('RAM', lblTyp); - }), - boxClass: 'ram', - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - fn: () => { - labelType.value = LABEL_TYPES[ - (LABEL_TYPES.indexOf(labelType.value) + 1) % LABEL_TYPES.length - ] as ResourceLabelType; - }, - }, - onScrollDown: { - fn: () => { - labelType.value = LABEL_TYPES[ - (LABEL_TYPES.indexOf(labelType.value) - 1 + LABEL_TYPES.length) % LABEL_TYPES.length - ] as ResourceLabelType; - }, - }, - }); - }, - }, - }); - - return ramModule; -}; diff --git a/ags/HyprPanel/customModules/storage/computeStorage.ts b/ags/HyprPanel/customModules/storage/computeStorage.ts deleted file mode 100644 index 49cbc14..0000000 --- a/ags/HyprPanel/customModules/storage/computeStorage.ts +++ /dev/null @@ -1,28 +0,0 @@ -// @ts-expect-error is a special directive that tells the compiler to use the GTop library -import GTop from 'gi://GTop'; - -import { divide } from 'customModules/utils'; -import { Variable as VariableType } from 'types/variable'; -import { GenericResourceData } from 'lib/types/customModules/generic'; - -export const computeStorage = (round: VariableType): GenericResourceData => { - try { - const currentFsUsage = new GTop.glibtop_fsusage(); - - GTop.glibtop_get_fsusage(currentFsUsage, '/'); - - const total = currentFsUsage.blocks * currentFsUsage.block_size; - const available = currentFsUsage.bavail * currentFsUsage.block_size; - const used = total - available; - - return { - total, - used, - free: available, - percentage: divide([total, used], round.value), - }; - } catch (error) { - console.error('Error calculating RAM usage:', error); - return { total: 0, used: 0, percentage: 0, free: 0 }; - } -}; diff --git a/ags/HyprPanel/customModules/storage/index.ts b/ags/HyprPanel/customModules/storage/index.ts deleted file mode 100644 index 9cfeb85..0000000 --- a/ags/HyprPanel/customModules/storage/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -import options from 'options'; -import { module } from '../module'; - -import { formatTooltip, inputHandler, renderResourceLabel } from 'customModules/utils'; -import { computeStorage } from './computeStorage'; -import { BarBoxChild, ResourceLabelType } from 'lib/types/bar'; -import { GenericResourceData } from 'lib/types/customModules/generic'; -import Button from 'types/widgets/button'; -import { LABEL_TYPES } from 'lib/types/defaults/bar'; -import { pollVariable } from 'customModules/PollVar'; -import { Attribute, Child } from 'lib/types/widget'; - -const { label, labelType, icon, round, leftClick, rightClick, middleClick, pollingInterval } = - options.bar.customModules.storage; - -const defaultStorageData = { total: 0, used: 0, percentage: 0, free: 0 }; - -const storageUsage = Variable(defaultStorageData); - -pollVariable(storageUsage, [round.bind('value')], pollingInterval.bind('value'), computeStorage, round); - -export const Storage = (): BarBoxChild => { - const storageModule = module({ - textIcon: icon.bind('value'), - label: Utils.merge( - [storageUsage.bind('value'), labelType.bind('value'), round.bind('value')], - (storage: GenericResourceData, lblTyp: ResourceLabelType, round: boolean) => { - return renderResourceLabel(lblTyp, storage, round); - }, - ), - tooltipText: labelType.bind('value').as((lblTyp) => { - return formatTooltip('Storage', lblTyp); - }), - boxClass: 'storage', - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - fn: () => { - labelType.value = LABEL_TYPES[ - (LABEL_TYPES.indexOf(labelType.value) + 1) % LABEL_TYPES.length - ] as ResourceLabelType; - }, - }, - onScrollDown: { - fn: () => { - labelType.value = LABEL_TYPES[ - (LABEL_TYPES.indexOf(labelType.value) - 1 + LABEL_TYPES.length) % LABEL_TYPES.length - ] as ResourceLabelType; - }, - }, - }); - }, - }, - }); - - return storageModule; -}; diff --git a/ags/HyprPanel/customModules/submap/helpers.ts b/ags/HyprPanel/customModules/submap/helpers.ts deleted file mode 100644 index 0c38718..0000000 --- a/ags/HyprPanel/customModules/submap/helpers.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Variable } from 'types/variable'; - -const hyprland = await Service.import('hyprland'); - -export const isSubmapEnabled = (submap: string, enabled: string, disabled: string): string => { - return submap !== 'default' ? enabled : disabled; -}; - -export const getInitialSubmap = (submapStatus: Variable): void => { - let submap = hyprland.message('submap'); - - const newLineCarriage = /\n/g; - submap = submap.replace(newLineCarriage, ''); - - if (submap === 'unknown request') { - submap = 'default'; - } - - submapStatus.value = submap; -}; diff --git a/ags/HyprPanel/customModules/submap/index.ts b/ags/HyprPanel/customModules/submap/index.ts deleted file mode 100644 index c83316e..0000000 --- a/ags/HyprPanel/customModules/submap/index.ts +++ /dev/null @@ -1,101 +0,0 @@ -const hyprland = await Service.import('hyprland'); -import options from 'options'; -import { module } from '../module'; - -import { inputHandler } from 'customModules/utils'; -import Button from 'types/widgets/button'; -import { Variable as VariableType } from 'types/variable'; -import { Attribute, Child } from 'lib/types/widget'; -import { BarBoxChild } from 'lib/types/bar'; -import { capitalizeFirstLetter } from 'lib/utils'; -import { getInitialSubmap, isSubmapEnabled } from './helpers'; - -const { - label, - showSubmapName, - enabledIcon, - disabledIcon, - enabledText, - disabledText, - leftClick, - rightClick, - middleClick, - scrollUp, - scrollDown, -} = options.bar.customModules.submap; - -const submapStatus: VariableType = Variable('default'); - -hyprland.connect('submap', (_, currentSubmap) => { - if (currentSubmap.length === 0) { - submapStatus.value = 'default'; - } else { - submapStatus.value = currentSubmap; - } -}); - -getInitialSubmap(submapStatus); - -export const Submap = (): BarBoxChild => { - const submapModule = module({ - textIcon: Utils.merge( - [submapStatus.bind('value'), enabledIcon.bind('value'), disabledIcon.bind('value')], - (status, enabled, disabled) => { - return isSubmapEnabled(status, enabled, disabled); - }, - ), - tooltipText: Utils.merge( - [ - submapStatus.bind('value'), - enabledText.bind('value'), - disabledText.bind('value'), - showSubmapName.bind('value'), - ], - (status, enabled, disabled, showSmName) => { - if (showSmName) { - return capitalizeFirstLetter(status); - } - return isSubmapEnabled(status, enabled, disabled); - }, - ), - boxClass: 'submap', - label: Utils.merge( - [ - submapStatus.bind('value'), - enabledText.bind('value'), - disabledText.bind('value'), - showSubmapName.bind('value'), - ], - (status, enabled, disabled, showSmName) => { - if (showSmName) { - return capitalizeFirstLetter(status); - } - return isSubmapEnabled(status, enabled, disabled); - }, - ), - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return submapModule; -}; diff --git a/ags/HyprPanel/customModules/theme.ts b/ags/HyprPanel/customModules/theme.ts deleted file mode 100644 index 2ac92ff..0000000 --- a/ags/HyprPanel/customModules/theme.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, GtkWidget } from 'lib/types/widget'; - -export const CustomModuleTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page customModules paged-container', - child: Widget.Box({ - class_name: 'bar-theme-page paged-container', - vertical: true, - children: [ - Header('RAM'), - Option({ opt: options.theme.bar.buttons.modules.ram.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.ram.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.ram.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.ram.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.ram.border, title: 'Border', type: 'color' }), - - Header('CPU'), - Option({ opt: options.theme.bar.buttons.modules.cpu.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.cpu.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.cpu.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.cpu.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.cpu.border, title: 'Border', type: 'color' }), - - Header('Storage'), - Option({ opt: options.theme.bar.buttons.modules.storage.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.storage.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.storage.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.storage.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.storage.border, title: 'Border', type: 'color' }), - - Header('Netstat'), - Option({ opt: options.theme.bar.buttons.modules.netstat.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.netstat.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.netstat.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.netstat.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.netstat.border, title: 'Border', type: 'color' }), - - Header('Keyboard Layout'), - Option({ opt: options.theme.bar.buttons.modules.kbLayout.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.kbLayout.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.kbLayout.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.kbLayout.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.kbLayout.border, title: 'Border', type: 'color' }), - - Header('Updates'), - Option({ opt: options.theme.bar.buttons.modules.updates.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.updates.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.updates.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.updates.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.updates.border, title: 'Border', type: 'color' }), - - Header('Submap'), - Option({ opt: options.theme.bar.buttons.modules.submap.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.submap.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.submap.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.submap.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.submap.border, title: 'Border', type: 'color' }), - - Header('Weather'), - Option({ opt: options.theme.bar.buttons.modules.weather.icon, title: 'Icon', type: 'color' }), - Option({ opt: options.theme.bar.buttons.modules.weather.text, title: 'Text', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.weather.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.weather.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.weather.border, title: 'Border', type: 'color' }), - - Header('Power'), - Option({ opt: options.theme.bar.buttons.modules.power.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.modules.power.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.modules.power.icon_background, - title: 'Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.modules.power.border, title: 'Border', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/customModules/updates/index.ts b/ags/HyprPanel/customModules/updates/index.ts deleted file mode 100644 index 4be5ee8..0000000 --- a/ags/HyprPanel/customModules/updates/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -import options from 'options'; -import { module } from '../module'; - -import { inputHandler } from 'customModules/utils'; -import Button from 'types/widgets/button'; -import { Variable as VariableType } from 'types/variable'; -import { pollVariableBash } from 'customModules/PollVar'; -import { Attribute, Child } from 'lib/types/widget'; -import { BarBoxChild } from 'lib/types/bar'; - -const { - updateCommand, - label, - padZero, - pollingInterval, - icon, - leftClick, - rightClick, - middleClick, - scrollUp, - scrollDown, -} = options.bar.customModules.updates; - -const pendingUpdates: VariableType = Variable(' 0'); - -const processUpdateCount = (updateCount: string): string => { - if (!padZero.value) return updateCount; - return `${updateCount.padStart(2, '0')}`; -}; - -pollVariableBash( - pendingUpdates, - [padZero.bind('value')], - pollingInterval.bind('value'), - updateCommand.value, - processUpdateCount, -); - -export const Updates = (): BarBoxChild => { - const updatesModule = module({ - textIcon: icon.bind('value'), - tooltipText: pendingUpdates.bind('value').as((v) => `${v} updates available`), - boxClass: 'updates', - label: pendingUpdates.bind('value'), - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return updatesModule; -}; diff --git a/ags/HyprPanel/customModules/utils.ts b/ags/HyprPanel/customModules/utils.ts deleted file mode 100644 index b68258e..0000000 --- a/ags/HyprPanel/customModules/utils.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { ResourceLabelType } from 'lib/types/bar'; -import { GenericResourceData, Postfix } from 'lib/types/customModules/generic'; -import { InputHandlerEvents, RunAsyncCommand } from 'lib/types/customModules/utils'; -import { ThrottleFn, ThrottleFnCallback } from 'lib/types/utils'; -import { Attribute, Child, EventArgs } from 'lib/types/widget'; -import { Binding } from 'lib/utils'; -import { openMenu } from 'modules/bar/utils'; -import options from 'options'; -import Gdk from 'types/@girs/gdk-3.0/gdk-3.0'; -import { Variable as VariableType } from 'types/variable'; -import Button from 'types/widgets/button'; - -const { scrollSpeed } = options.bar.customModules; - -export const runAsyncCommand: RunAsyncCommand = (cmd, events, fn): void => { - if (cmd.startsWith('menu:')) { - const menuName = cmd.split(':')[1].trim().toLowerCase(); - openMenu(events.clicked, events.event, `${menuName}menu`); - - return; - } - - Utils.execAsync(`bash -c "${cmd}"`) - .then((output) => { - if (fn !== undefined) { - fn(output); - } - }) - .catch((err) => console.error(`Error running command "${cmd}": ${err})`)); -}; - -export function throttle(func: T, limit: number): T { - let inThrottle: boolean; - return function (this: ThisParameterType, ...args: Parameters) { - if (!inThrottle) { - func.apply(this, args); - inThrottle = true; - setTimeout(() => { - inThrottle = false; - }, limit); - } - } as T; -} - -export const throttledScrollHandler = (interval: number): ThrottleFn => - throttle((cmd: string, events: EventArgs, fn: ThrottleFnCallback) => { - runAsyncCommand(cmd, events, fn); - }, 200 / interval); - -const dummyVar = Variable(''); - -export const inputHandler = ( - self: Button, - { onPrimaryClick, onSecondaryClick, onMiddleClick, onScrollUp, onScrollDown }: InputHandlerEvents, -): void => { - const sanitizeInput = (input: VariableType): string => { - if (input === undefined) { - return ''; - } - return input.value; - }; - - const updateHandlers = (): void => { - const interval = scrollSpeed.value; - const throttledHandler = throttledScrollHandler(interval); - - self.on_primary_click = (clicked: Button, event: Gdk.Event): void => - runAsyncCommand(sanitizeInput(onPrimaryClick?.cmd || dummyVar), { clicked, event }, onPrimaryClick.fn); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => - runAsyncCommand(sanitizeInput(onSecondaryClick?.cmd || dummyVar), { clicked, event }, onSecondaryClick.fn); - - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => - runAsyncCommand(sanitizeInput(onMiddleClick?.cmd || dummyVar), { clicked, event }, onMiddleClick.fn); - - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => - throttledHandler(sanitizeInput(onScrollUp?.cmd || dummyVar), { clicked, event }, onScrollUp.fn); - - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => - throttledHandler(sanitizeInput(onScrollDown?.cmd || dummyVar), { clicked, event }, onScrollDown.fn); - }; - - // Initial setup of event handlers - updateHandlers(); - - const sanitizeVariable = (someVar: VariableType | undefined): Binding => { - if (someVar === undefined || typeof someVar.bind !== 'function') { - return dummyVar.bind('value'); - } - return someVar.bind('value'); - }; - - // Re-run the update whenever scrollSpeed changes - Utils.merge( - [ - scrollSpeed.bind('value'), - sanitizeVariable(onPrimaryClick), - sanitizeVariable(onSecondaryClick), - sanitizeVariable(onMiddleClick), - sanitizeVariable(onScrollUp), - sanitizeVariable(onScrollDown), - ], - updateHandlers, - ); -}; - -export const divide = ([total, used]: number[], round: boolean): number => { - const percentageTotal = (used / total) * 100; - if (round) { - return total > 0 ? Math.round(percentageTotal) : 0; - } - return total > 0 ? parseFloat(percentageTotal.toFixed(2)) : 0; -}; - -export const formatSizeInKiB = (sizeInBytes: number, round: boolean): number => { - const sizeInGiB = sizeInBytes / 1024 ** 1; - return round ? Math.round(sizeInGiB) : parseFloat(sizeInGiB.toFixed(2)); -}; -export const formatSizeInMiB = (sizeInBytes: number, round: boolean): number => { - const sizeInGiB = sizeInBytes / 1024 ** 2; - return round ? Math.round(sizeInGiB) : parseFloat(sizeInGiB.toFixed(2)); -}; -export const formatSizeInGiB = (sizeInBytes: number, round: boolean): number => { - const sizeInGiB = sizeInBytes / 1024 ** 3; - return round ? Math.round(sizeInGiB) : parseFloat(sizeInGiB.toFixed(2)); -}; -export const formatSizeInTiB = (sizeInBytes: number, round: boolean): number => { - const sizeInGiB = sizeInBytes / 1024 ** 4; - return round ? Math.round(sizeInGiB) : parseFloat(sizeInGiB.toFixed(2)); -}; - -export const autoFormatSize = (sizeInBytes: number, round: boolean): number => { - // auto convert to GiB, MiB, KiB, TiB, or bytes - if (sizeInBytes >= 1024 ** 4) return formatSizeInTiB(sizeInBytes, round); - if (sizeInBytes >= 1024 ** 3) return formatSizeInGiB(sizeInBytes, round); - if (sizeInBytes >= 1024 ** 2) return formatSizeInMiB(sizeInBytes, round); - if (sizeInBytes >= 1024 ** 1) return formatSizeInKiB(sizeInBytes, round); - - return sizeInBytes; -}; - -export const getPostfix = (sizeInBytes: number): Postfix => { - if (sizeInBytes >= 1024 ** 4) return 'TiB'; - if (sizeInBytes >= 1024 ** 3) return 'GiB'; - if (sizeInBytes >= 1024 ** 2) return 'MiB'; - if (sizeInBytes >= 1024 ** 1) return 'KiB'; - - return 'B'; -}; - -export const renderResourceLabel = (lblType: ResourceLabelType, rmUsg: GenericResourceData, round: boolean): string => { - const { used, total, percentage, free } = rmUsg; - - const formatFunctions = { - TiB: formatSizeInTiB, - GiB: formatSizeInGiB, - MiB: formatSizeInMiB, - KiB: formatSizeInKiB, - B: (size: number): number => size, - }; - - // Get them datas in proper GiB, MiB, KiB, TiB, or bytes - const totalSizeFormatted = autoFormatSize(total, round); - // get the postfix: one of [TiB, GiB, MiB, KiB, B] - const postfix = getPostfix(total); - - // Determine which format function to use - const formatUsed = formatFunctions[postfix] || formatFunctions['B']; - const usedSizeFormatted = formatUsed(used, round); - - if (lblType === 'used/total') { - return `${usedSizeFormatted}/${totalSizeFormatted} ${postfix}`; - } - if (lblType === 'used') { - return `${autoFormatSize(used, round)} ${getPostfix(used)}`; - } - if (lblType === 'free') { - return `${autoFormatSize(free, round)} ${getPostfix(free)}`; - } - - return `${percentage}%`; -}; - -export const formatTooltip = (dataType: string, lblTyp: ResourceLabelType): string => { - switch (lblTyp) { - case 'used': - return `Used ${dataType}`; - case 'free': - return `Free ${dataType}`; - case 'used/total': - return `Used/Total ${dataType}`; - case 'percentage': - return `Percentage ${dataType} Usage`; - default: - return ''; - } -}; diff --git a/ags/HyprPanel/customModules/weather/index.ts b/ags/HyprPanel/customModules/weather/index.ts deleted file mode 100644 index b40995c..0000000 --- a/ags/HyprPanel/customModules/weather/index.ts +++ /dev/null @@ -1,52 +0,0 @@ -import options from 'options'; -import { module } from '../module'; - -import { inputHandler } from 'customModules/utils'; -import Button from 'types/widgets/button'; -import { getWeatherStatusTextIcon, globalWeatherVar } from 'globals/weather'; -import { Attribute, Child } from 'lib/types/widget'; -import { BarBoxChild } from 'lib/types/bar'; - -const { label, unit, leftClick, rightClick, middleClick, scrollUp, scrollDown } = options.bar.customModules.weather; - -export const Weather = (): BarBoxChild => { - const weatherModule = module({ - textIcon: Utils.merge([globalWeatherVar.bind('value')], (wthr) => { - const weatherStatusIcon = getWeatherStatusTextIcon(wthr); - return weatherStatusIcon; - }), - tooltipText: globalWeatherVar.bind('value').as((v) => `Weather Status: ${v.current.condition.text}`), - boxClass: 'weather-custom', - label: Utils.merge([globalWeatherVar.bind('value'), unit.bind('value')], (wthr, unt) => { - if (unt === 'imperial') { - return `${Math.ceil(wthr.current.temp_f)}° F`; - } else { - return `${Math.ceil(wthr.current.temp_c)}° C`; - } - }), - showLabelBinding: label.bind('value'), - props: { - setup: (self: Button) => { - inputHandler(self, { - onPrimaryClick: { - cmd: leftClick, - }, - onSecondaryClick: { - cmd: rightClick, - }, - onMiddleClick: { - cmd: middleClick, - }, - onScrollUp: { - cmd: scrollUp, - }, - onScrollDown: { - cmd: scrollDown, - }, - }); - }, - }, - }); - - return weatherModule; -}; diff --git a/ags/HyprPanel/directoryMonitorService.ts b/ags/HyprPanel/directoryMonitorService.ts deleted file mode 100644 index 2e1a74a..0000000 --- a/ags/HyprPanel/directoryMonitorService.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Service from 'resource:///com/github/Aylur/ags/service.js'; -import App from 'resource:///com/github/Aylur/ags/app.js'; -import { monitorFile } from 'resource:///com/github/Aylur/ags/utils.js'; -import Gio from 'gi://Gio'; -import { FileInfo } from 'types/@girs/gio-2.0/gio-2.0.cjs'; - -class DirectoryMonitorService extends Service { - static { - Service.register(this, {}, {}); - } - - constructor() { - super(); - this.recursiveDirectoryMonitor(`${App.configDir}/scss`); - } - - recursiveDirectoryMonitor(directoryPath: string): void { - monitorFile(directoryPath, (_, eventType) => { - if (eventType === Gio.FileMonitorEvent.CHANGES_DONE_HINT) { - this.emit('changed'); - } - }); - - const directory = Gio.File.new_for_path(directoryPath); - const enumerator = directory.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null); - - let fileInfo: FileInfo; - while ((fileInfo = enumerator.next_file(null) as FileInfo) !== null) { - const childPath = directoryPath + '/' + fileInfo.get_name(); - if (fileInfo.get_file_type() === Gio.FileType.DIRECTORY) { - this.recursiveDirectoryMonitor(childPath); - } - } - } -} - -const service = new DirectoryMonitorService(); -export default service; diff --git a/ags/HyprPanel/flake.lock b/ags/HyprPanel/flake.lock deleted file mode 100644 index 2417d92..0000000 --- a/ags/HyprPanel/flake.lock +++ /dev/null @@ -1,78 +0,0 @@ -{ - "nodes": { - "ags": { - "inputs": { - "nixpkgs": "nixpkgs", - "systems": "systems" - }, - "locked": { - "lastModified": 1727303518, - "narHash": "sha256-lO5JMynTxNZxg/+E4/Y9reeLGIz/M8cEue+Re4cP6qo=", - "owner": "Aylur", - "repo": "ags", - "rev": "cd543afec4d9ed708990e5ba52184716809bf248", - "type": "github" - }, - "original": { - "owner": "Aylur", - "repo": "ags", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1725634671, - "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1727634051, - "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "ags": "ags", - "nixpkgs": "nixpkgs_2" - } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/ags/HyprPanel/flake.nix b/ags/HyprPanel/flake.nix deleted file mode 100644 index 685fed7..0000000 --- a/ags/HyprPanel/flake.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - description = "A Bar/Panel for Hyprland with extensive customizability."; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - ags.url = "github:Aylur/ags"; - }; - - outputs = inputs: let - systems = [ - "x86_64-linux" - "x86_64-darwin" - "aarch64-darwin" - "aarch64-linux" - ]; - forEachSystem = inputs.nixpkgs.lib.genAttrs systems; - pkgsFor = forEachSystem ( - system: - import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - } - ); - - devShellFor = system: - inputs.nixpkgs.lib.genAttrs ["default"] ( - _: - inputs.nixpkgs.legacyPackages.${system}.mkShell { - buildInputs = [ - pkgsFor.${system}.esbuild - pkgsFor.${system}.fish - pkgsFor.${system}.typescript - pkgsFor.${system}.bun - pkgsFor.${system}.libnotify - pkgsFor.${system}.dart-sass - pkgsFor.${system}.fd - pkgsFor.${system}.btop - pkgsFor.${system}.bluez - pkgsFor.${system}.libgtop - pkgsFor.${system}.gobject-introspection - pkgsFor.${system}.glib - pkgsFor.${system}.bluez-tools - pkgsFor.${system}.grimblast - pkgsFor.${system}.gpu-screen-recorder - pkgsFor.${system}.brightnessctl - pkgsFor.${system}.gnome-bluetooth - pkgsFor.${system}.python3 - pkgsFor.${system}.matugen - inputs.ags.packages.${system}.agsWithTypes - ]; - nativeBuildInputs = with pkgsFor.${system}; [ - nixfmt-rfc-style - nil - ]; - shellHook = '' - export GDK_BACKEND=wayland - export GI_TYPELIB_PATH=${pkgsFor.${system}.libgtop}/lib/girepository-1.0:${pkgsFor.${system}.glib}/lib/girepository-1.0:$GI_TYPELIB_PATH - ''; - } - ); - in { - devShells = forEachSystem devShellFor; - - overlay = final: prev: { - hyprpanel = - if final ? callPackage - then (final.callPackage ./nix {inherit inputs;}).desktop.script - else inputs.self.packages.${prev.stdenv.system}.default; - }; - packages = forEachSystem ( - system: let - pkgs = pkgsFor.${system}; - in { - default = (pkgs.callPackage ./nix {inherit inputs;}).desktop.script; - } - ); - }; -} diff --git a/ags/HyprPanel/globals.d.ts b/ags/HyprPanel/globals.d.ts deleted file mode 100644 index 8e44a87..0000000 --- a/ags/HyprPanel/globals.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// globals.d.ts -/* eslint-disable no-var */ - -import { Options, Variable as VariableType } from 'types/variable'; - -declare global { - var useTheme: (filePath: string) => void; - var isWindowVisible: (windowName: string) => boolean; - var globalWeatherVar: VariableType; - var options: Options; - var removingNotifications: VariableType; -} - -export {}; diff --git a/ags/HyprPanel/globals/dropdown.ts b/ags/HyprPanel/globals/dropdown.ts deleted file mode 100644 index b1178bf..0000000 --- a/ags/HyprPanel/globals/dropdown.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Variable as VariableType } from 'types/variable'; - -type GlobalEventBoxes = { - [key: string]: unknown; -}; -export const globalEventBoxes: VariableType = Variable({}); diff --git a/ags/HyprPanel/globals/network.ts b/ags/HyprPanel/globals/network.ts deleted file mode 100644 index 44fbf77..0000000 --- a/ags/HyprPanel/globals/network.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const WIFI_STATUS_MAP = { - unknown: 'Status Unknown', - unmanaged: 'Unmanaged', - unavailable: 'Unavailable', - disconnected: 'Disconnected', - prepare: 'Preparing Connecting', - config: 'Connecting', - need_auth: 'Needs Authentication', - ip_config: 'Requesting IP', - ip_check: 'Checking Access', - secondaries: 'Waiting on Secondaries', - activated: 'Connected', - deactivating: 'Disconnecting', - failed: 'Connection Failed', -} as const; diff --git a/ags/HyprPanel/globals/notification.ts b/ags/HyprPanel/globals/notification.ts deleted file mode 100644 index f382bc4..0000000 --- a/ags/HyprPanel/globals/notification.ts +++ /dev/null @@ -1,37 +0,0 @@ -import icons from 'modules/icons/index'; -import { Notification } from 'types/service/notifications'; - -export const removingNotifications = Variable(false); - -export const getNotificationIcon = (app_name: string, app_icon: string, app_entry: string): string => { - let icon: string = icons.fallback.notification; - - if (Utils.lookUpIcon(app_name) || Utils.lookUpIcon(app_name.toLowerCase() || '')) { - icon = Utils.lookUpIcon(app_name) - ? app_name - : Utils.lookUpIcon(app_name.toLowerCase()) - ? app_name.toLowerCase() - : ''; - } - - if (Utils.lookUpIcon(app_icon) && icon === '') { - icon = app_icon; - } - - if (Utils.lookUpIcon(app_entry || '') && icon === '') { - icon = app_entry || ''; - } - - return icon; -}; - -export const closeNotifications = async (notifications: Notification[], delay: number): Promise => { - removingNotifications.value = true; - for (const notif of notifications) { - notif.close(); - await new Promise((resolve) => setTimeout(resolve, delay)); - } - removingNotifications.value = false; -}; - -globalThis['removingNotifications'] = removingNotifications; diff --git a/ags/HyprPanel/globals/useTheme.ts b/ags/HyprPanel/globals/useTheme.ts deleted file mode 100644 index 15c2322..0000000 --- a/ags/HyprPanel/globals/useTheme.ts +++ /dev/null @@ -1,43 +0,0 @@ -import Gio from 'gi://Gio'; -import { bash, Notify } from 'lib/utils'; -import icons from 'lib/icons'; -import { filterConfigForThemeOnly, loadJsonFile, saveConfigToFile } from 'widget/settings/shared/FileChooser'; - -export const hexColorPattern = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/; - -globalThis.useTheme = (filePath: string): void => { - const importedConfig = loadJsonFile(filePath); - - if (!importedConfig) { - return; - } - - Notify({ - summary: `Importing Theme`, - body: `Importing: ${filePath}`, - iconName: icons.ui.info, - timeout: 7000, - }); - - const tmpConfigFile = Gio.File.new_for_path(`${TMP}/config.json`); - const optionsConfigFile = Gio.File.new_for_path(OPTIONS); - - const [tmpSuccess, tmpContent] = tmpConfigFile.load_contents(null); - const [optionsSuccess, optionsContent] = optionsConfigFile.load_contents(null); - - if (!tmpSuccess || !optionsSuccess) { - console.error('Failed to read existing configuration files.'); - return; - } - - let tmpConfig = JSON.parse(new TextDecoder('utf-8').decode(tmpContent)); - let optionsConfig = JSON.parse(new TextDecoder('utf-8').decode(optionsContent)); - - const filteredConfig = filterConfigForThemeOnly(importedConfig); - tmpConfig = { ...tmpConfig, ...filteredConfig }; - optionsConfig = { ...optionsConfig, ...filteredConfig }; - - saveConfigToFile(tmpConfig, `${TMP}/config.json`); - saveConfigToFile(optionsConfig, OPTIONS); - bash('pkill ags && ags'); -}; diff --git a/ags/HyprPanel/globals/utilities.ts b/ags/HyprPanel/globals/utilities.ts deleted file mode 100644 index 438c666..0000000 --- a/ags/HyprPanel/globals/utilities.ts +++ /dev/null @@ -1,8 +0,0 @@ -globalThis.isWindowVisible = (windowName: string): boolean => { - const appWindow = App.getWindow(windowName); - - if (appWindow === undefined) { - return false; - } - return appWindow.visible; -}; diff --git a/ags/HyprPanel/globals/variables.ts b/ags/HyprPanel/globals/variables.ts deleted file mode 100644 index ea2eb5d..0000000 --- a/ags/HyprPanel/globals/variables.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Opt } from 'lib/option'; -import { HexColor, MatugenTheme, RecursiveOptionsObject } from 'lib/types/options'; - -export const isOpt = (value: unknown): value is Opt => - typeof value === 'object' && value !== null && 'value' in value && value instanceof Opt; - -export const isOptString = (value: unknown): value is Opt => { - return value instanceof Opt && typeof value.value === 'string'; -}; - -export const isOptNumber = (value: unknown): value is Opt => { - return value instanceof Opt && typeof value.value === 'number'; -}; - -export const isOptBoolean = (value: unknown): value is Opt => { - return value instanceof Opt && typeof value.value === 'boolean'; -}; - -export const isOptMatugenTheme = (value: unknown): value is Opt => { - return value instanceof Opt && typeof value.value === 'object' && 'specificProperty' in value.value; // Replace 'specificProperty' with an actual property of MatugenTheme -}; - -export const isRecursiveOptionsObject = (value: unknown): value is RecursiveOptionsObject => { - return typeof value === 'object' && value !== null && !(value instanceof Opt); -}; - -export const isHexColor = (val: unknown): val is HexColor => { - return typeof val === 'string' && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(val); -}; diff --git a/ags/HyprPanel/globals/weather.ts b/ags/HyprPanel/globals/weather.ts deleted file mode 100644 index 3da7ba1..0000000 --- a/ags/HyprPanel/globals/weather.ts +++ /dev/null @@ -1,122 +0,0 @@ -import options from 'options'; -import { UnitType, Weather, WeatherIconTitle, WeatherIcon } from 'lib/types/weather.js'; -import { DEFAULT_WEATHER } from 'lib/types/defaults/weather.js'; -import GLib from 'gi://GLib?version=2.0'; -import { weatherIcons } from 'modules/icons/weather.js'; - -const { key, interval, location } = options.menus.clock.weather; - -export const globalWeatherVar = Variable(DEFAULT_WEATHER); - -let weatherIntervalInstance: null | number = null; - -const weatherIntervalFn = (weatherInterval: number, loc: string, weatherKey: string): void => { - if (weatherIntervalInstance !== null) { - GLib.source_remove(weatherIntervalInstance); - } - - const formattedLocation = loc.replace(' ', '%20'); - - weatherIntervalInstance = Utils.interval(weatherInterval, () => { - Utils.execAsync( - `curl "https://api.weatherapi.com/v1/forecast.json?key=${weatherKey}&q=${formattedLocation}&days=1&aqi=no&alerts=no"`, - ) - .then((res) => { - try { - if (typeof res !== 'string') { - return (globalWeatherVar.value = DEFAULT_WEATHER); - } - - const parsedWeather = JSON.parse(res); - - if (Object.keys(parsedWeather).includes('error')) { - return (globalWeatherVar.value = DEFAULT_WEATHER); - } - - return (globalWeatherVar.value = parsedWeather); - } catch (error) { - globalWeatherVar.value = DEFAULT_WEATHER; - console.warn(`Failed to parse weather data: ${error}`); - } - }) - .catch((err) => { - console.error(`Failed to fetch weather: ${err}`); - globalWeatherVar.value = DEFAULT_WEATHER; - }); - }); -}; - -Utils.merge([key.bind('value'), interval.bind('value'), location.bind('value')], (weatherKey, weatherInterval, loc) => { - if (!weatherKey) { - return (globalWeatherVar.value = DEFAULT_WEATHER); - } - weatherIntervalFn(weatherInterval, loc, weatherKey); -}); - -export const getTemperature = (wthr: Weather, unt: UnitType): string => { - if (unt === 'imperial') { - return `${Math.ceil(wthr.current.temp_f)}° F`; - } else { - return `${Math.ceil(wthr.current.temp_c)}° C`; - } -}; - -export const getWeatherIcon = (fahren: number): Record => { - const icons = { - 100: '', - 75: '', - 50: '', - 25: '', - 0: '', - } as const; - const colors = { - 100: 'weather-color red', - 75: 'weather-color orange', - 50: 'weather-color lavender', - 25: 'weather-color blue', - 0: 'weather-color sky', - } as const; - - type IconKeys = keyof typeof icons; - - const threshold: IconKeys = - fahren < 0 ? 0 : ([100, 75, 50, 25, 0] as IconKeys[]).find((threshold) => threshold <= fahren) || 0; - - const icon = icons[threshold || 50]; - const color = colors[threshold || 50]; - - return { - icon, - color, - }; -}; - -export const getWindConditions = (wthr: Weather, unt: UnitType): string => { - if (unt === 'imperial') { - return `${Math.floor(wthr.current.wind_mph)} mph`; - } - return `${Math.floor(wthr.current.wind_kph)} kph`; -}; - -export const getRainChance = (wthr: Weather): string => `${wthr.forecast.forecastday[0].day.daily_chance_of_rain}%`; - -export const isValidWeatherIconTitle = (title: string): title is WeatherIconTitle => { - return title in weatherIcons; -}; - -export const getWeatherStatusTextIcon = (wthr: Weather): WeatherIcon => { - let iconQuery = wthr.current.condition.text.trim().toLowerCase().replaceAll(' ', '_'); - - if (!wthr.current.is_day && iconQuery === 'partly_cloudy') { - iconQuery = 'partly_cloudy_night'; - } - - if (isValidWeatherIconTitle(iconQuery)) { - return weatherIcons[iconQuery]; - } else { - console.warn(`Unknown weather icon title: ${iconQuery}`); - return weatherIcons['warning']; - } -}; - -globalThis['globalWeatherVar'] = globalWeatherVar; diff --git a/ags/HyprPanel/globals/window.ts b/ags/HyprPanel/globals/window.ts deleted file mode 100644 index ae823bb..0000000 --- a/ags/HyprPanel/globals/window.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const WINDOW_LAYOUTS: string[] = [ - 'center', - 'top', - 'top-right', - 'top-center', - 'top-left', - 'bottom-left', - 'bottom-center', - 'bottom-right', -]; diff --git a/ags/HyprPanel/install_fonts.sh b/ags/HyprPanel/install_fonts.sh deleted file mode 100755 index c40b022..0000000 --- a/ags/HyprPanel/install_fonts.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -SOURCE_DIR="./assets/fonts" -DEST_DIR="$HOME/.local/share/fonts" -DEST_PATH="$DEST_DIR/NFP" - -if [ ! -d "$SOURCE_DIR" ]; then - echo "Source directory '$SOURCE_DIR' does not exist." - exit 1 -fi - -if [ ! -d "$DEST_PATH" ]; then - echo "Destination directory '$DEST_PATH' does not exist. Creating it..." - mkdir -p "$DEST_PATH" -fi - -if [ -z "$(ls -A "$SOURCE_DIR")" ]; then - echo "Source directory '$SOURCE_DIR' is empty. No files to copy." - exit 1 -fi - -echo "Copying fonts from '$SOURCE_DIR' to '$DEST_PATH'..." -cp -r "$SOURCE_DIR"/* "$DEST_PATH" - -echo "Updating font cache..." -fc-cache -fv - -echo "Fonts installed successfully." diff --git a/ags/HyprPanel/lib/constants/colors.ts b/ags/HyprPanel/lib/constants/colors.ts deleted file mode 100644 index 95ac5cf..0000000 --- a/ags/HyprPanel/lib/constants/colors.ts +++ /dev/null @@ -1,142 +0,0 @@ -export const namedColors = new Set([ - 'alice blue', - 'antique white', - 'aqua', - 'aquamarine', - 'azure', - 'beige', - 'bisque', - 'black', - 'blanched almond', - 'blue', - 'blue violet', - 'brown', - 'burlywood', - 'cadet blue', - 'chartreuse', - 'chocolate', - 'coral', - 'cornflower blue', - 'cornsilk', - 'crimson', - 'cyan', - 'dark blue', - 'dark cyan', - 'dark goldenrod', - 'dark gray', - 'dark green', - 'dark khaki', - 'dark magenta', - 'dark olive green', - 'dark orange', - 'dark orchid', - 'dark red', - 'dark salmon', - 'dark sea green', - 'dark slate blue', - 'dark slate gray', - 'dark turquoise', - 'dark violet', - 'deep pink', - 'deep sky blue', - 'dim gray', - 'dodger blue', - 'firebrick', - 'floral white', - 'forest green', - 'fuchsia', - 'gainsboro', - 'ghost white', - 'gold', - 'goldenrod', - 'gray', - 'green', - 'green yellow', - 'honeydew', - 'hot pink', - 'indian red', - 'indigo', - 'ivory', - 'khaki', - 'lavender', - 'lavender blush', - 'lawn green', - 'lemon chiffon', - 'light blue', - 'light coral', - 'light cyan', - 'light goldenrod yellow', - 'light green', - 'light grey', - 'light pink', - 'light salmon', - 'light sea green', - 'light sky blue', - 'light slate gray', - 'light steel blue', - 'light yellow', - 'lime', - 'lime green', - 'linen', - 'magenta', - 'maroon', - 'medium aquamarine', - 'medium blue', - 'medium orchid', - 'medium purple', - 'medium sea green', - 'medium slate blue', - 'medium spring green', - 'medium turquoise', - 'medium violet red', - 'midnight blue', - 'mint cream', - 'misty rose', - 'moccasin', - 'navajo white', - 'navy', - 'old lace', - 'olive', - 'olive drab', - 'orange', - 'orange red', - 'orchid', - 'pale goldenrod', - 'pale green', - 'pale turquoise', - 'pale violet red', - 'papaya whip', - 'peach puff', - 'peru', - 'pink', - 'plum', - 'powder blue', - 'purple', - 'red', - 'rosy brown', - 'royal blue', - 'saddle brown', - 'salmon', - 'sandy brown', - 'sea green', - 'seashell', - 'sienna', - 'silver', - 'sky blue', - 'slate blue', - 'slate gray', - 'snow', - 'spring green', - 'steel blue', - 'tan', - 'teal', - 'thistle', - 'tomato', - 'turquoise', - 'violet', - 'wheat', - 'white', - 'white smoke', - 'yellow', - 'yellow green', -]); diff --git a/ags/HyprPanel/lib/icons.ts b/ags/HyprPanel/lib/icons.ts deleted file mode 100644 index 8813940..0000000 --- a/ags/HyprPanel/lib/icons.ts +++ /dev/null @@ -1,145 +0,0 @@ -export const substitutes = { - 'transmission-gtk': 'transmission', - 'blueberry.py': 'blueberry', - Caprine: 'facebook-messenger', - 'com.raggesilver.BlackBox-symbolic': 'terminal-symbolic', - 'org.wezfurlong.wezterm-symbolic': 'terminal-symbolic', - 'audio-headset-bluetooth': 'audio-headphones-symbolic', - 'audio-card-analog-usb': 'audio-speakers-symbolic', - 'audio-card-analog-pci': 'audio-card-symbolic', - 'preferences-system': 'emblem-system-symbolic', - 'com.github.Aylur.ags-symbolic': 'controls-symbolic', - 'com.github.Aylur.ags': 'controls-symbolic', -} as const; - -export default { - missing: 'image-missing-symbolic', - nix: { - nix: 'nix-snowflake-symbolic', - }, - app: { - terminal: 'terminal-symbolic', - }, - fallback: { - executable: 'application-x-executable', - notification: 'dialog-information-symbolic', - video: 'video-x-generic-symbolic', - audio: 'audio-x-generic-symbolic', - }, - ui: { - close: 'window-close-symbolic', - colorpicker: 'color-select-symbolic', - info: 'info-symbolic', - link: 'external-link-symbolic', - lock: 'system-lock-screen-symbolic', - menu: 'open-menu-symbolic', - refresh: 'view-refresh-symbolic', - search: 'system-search-symbolic', - settings: 'emblem-system-symbolic', - themes: 'preferences-desktop-theme-symbolic', - tick: 'object-select-symbolic', - time: 'hourglass-symbolic', - toolbars: 'toolbars-symbolic', - warning: 'dialog-warning-symbolic', - avatar: 'avatar-default-symbolic', - arrow: { - right: 'pan-end-symbolic', - left: 'pan-start-symbolic', - down: 'pan-down-symbolic', - up: 'pan-up-symbolic', - }, - }, - audio: { - mic: { - muted: 'microphone-disabled-symbolic', - low: 'microphone-sensitivity-low-symbolic', - medium: 'microphone-sensitivity-medium-symbolic', - high: 'microphone-sensitivity-high-symbolic', - }, - volume: { - muted: 'audio-volume-muted-symbolic', - low: 'audio-volume-low-symbolic', - medium: 'audio-volume-medium-symbolic', - high: 'audio-volume-high-symbolic', - overamplified: 'audio-volume-overamplified-symbolic', - }, - type: { - headset: 'audio-headphones-symbolic', - speaker: 'audio-speakers-symbolic', - card: 'audio-card-symbolic', - }, - mixer: 'mixer-symbolic', - }, - powerprofile: { - balanced: 'power-profile-balanced-symbolic', - 'power-saver': 'power-profile-power-saver-symbolic', - performance: 'power-profile-performance-symbolic', - }, - asusctl: { - profile: { - Balanced: 'power-profile-balanced-symbolic', - Quiet: 'power-profile-power-saver-symbolic', - Performance: 'power-profile-performance-symbolic', - }, - mode: { - Integrated: 'processor-symbolic', - Hybrid: 'controller-symbolic', - }, - }, - battery: { - charging: 'battery-flash-symbolic', - warning: 'battery-empty-symbolic', - }, - bluetooth: { - enabled: 'bluetooth-active-symbolic', - disabled: 'bluetooth-disabled-symbolic', - }, - brightness: { - indicator: 'display-brightness-symbolic', - keyboard: 'keyboard-brightness-symbolic', - screen: 'display-brightness-symbolic', - }, - powermenu: { - sleep: 'weather-clear-night-symbolic', - reboot: 'system-reboot-symbolic', - logout: 'system-log-out-symbolic', - shutdown: 'system-shutdown-symbolic', - }, - recorder: { - recording: 'media-record-symbolic', - }, - notifications: { - noisy: 'org.gnome.Settings-notifications-symbolic', - silent: 'notifications-disabled-symbolic', - message: 'chat-bubbles-symbolic', - }, - trash: { - full: 'user-trash-full-symbolic', - empty: 'user-trash-symbolic', - }, - mpris: { - shuffle: { - enabled: 'media-playlist-shuffle-symbolic', - disabled: 'media-playlist-consecutive-symbolic', - }, - loop: { - none: 'media-playlist-repeat-symbolic', - track: 'media-playlist-repeat-song-symbolic', - playlist: 'media-playlist-repeat-symbolic', - }, - playing: 'media-playback-pause-symbolic', - paused: 'media-playback-start-symbolic', - stopped: 'media-playback-start-symbolic', - prev: 'media-skip-backward-symbolic', - next: 'media-skip-forward-symbolic', - }, - system: { - cpu: 'org.gnome.SystemMonitor-symbolic', - ram: 'drive-harddisk-solidstate-symbolic', - temp: 'temperature-symbolic', - }, - color: { - dark: 'dark-mode-symbolic', - light: 'light-mode-symbolic', - }, -}; diff --git a/ags/HyprPanel/lib/option.ts b/ags/HyprPanel/lib/option.ts deleted file mode 100644 index c261657..0000000 --- a/ags/HyprPanel/lib/option.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { isHexColor } from 'globals/variables'; -import { Variable } from 'resource:///com/github/Aylur/ags/variable.js'; -import { MkOptionsResult } from './types/options'; - -type OptProps = { - persistent?: boolean; -}; - -export class Opt extends Variable { - static { - Service.register(this); - } - - constructor(initial: T, { persistent = false }: OptProps = {}) { - super(initial); - this.initial = initial; - this.persistent = persistent; - } - - initial: T; - id = ''; - persistent: boolean; - toString(): string { - return `${this.value}`; - } - toJSON(): string { - return `opt:${this.value}`; - } - - getValue = (): T => { - return super.getValue(); - }; - init(cacheFile: string): void { - const cacheV = JSON.parse(Utils.readFile(cacheFile) || '{}')[this.id]; - if (cacheV !== undefined) this.value = cacheV; - - this.connect('changed', () => { - const cache = JSON.parse(Utils.readFile(cacheFile) || '{}'); - cache[this.id] = this.value; - Utils.writeFileSync(JSON.stringify(cache, null, 2), cacheFile); - }); - } - - reset(): string | undefined { - if (this.persistent) return; - - if (JSON.stringify(this.value) !== JSON.stringify(this.initial)) { - this.value = this.initial; - return this.id; - } - } - - doResetColor(): string | undefined { - if (this.persistent) return; - - const isColor = isHexColor(this.value as string); - if (JSON.stringify(this.value) !== JSON.stringify(this.initial) && isColor) { - this.value = this.initial; - return this.id; - } - return; - } -} - -export const opt = (initial: T, opts?: OptProps): Opt => new Opt(initial, opts); - -const getOptions = (object: Record, path = ''): Opt[] => { - return Object.keys(object).flatMap((key) => { - const obj = object[key]; - const id = path ? path + '.' + key : key; - - if (obj instanceof Variable) { - const optValue = obj as Opt; - optValue.id = id; - return optValue; - } - - if (typeof obj === 'object' && obj !== null) { - return getOptions(obj as Record, id); // Recursively process nested objects - } - - return []; - }); -}; - -export function mkOptions( - cacheFile: string, - object: T, - confFile: string = 'config.json', -): T & MkOptionsResult { - for (const opt of getOptions(object as Record)) opt.init(cacheFile); - - Utils.ensureDirectory(cacheFile.split('/').slice(0, -1).join('/')); - - const configFile = `${TMP}/${confFile}`; - const values = getOptions(object as Record).reduce( - (obj, { id, value }) => ({ [id]: value, ...obj }), - {}, - ); - Utils.writeFileSync(JSON.stringify(values, null, 2), configFile); - Utils.monitorFile(configFile, () => { - const cache = JSON.parse(Utils.readFile(configFile) || '{}'); - for (const opt of getOptions(object as Record)) { - if (JSON.stringify(cache[opt.id]) !== JSON.stringify(opt.value)) opt.value = cache[opt.id]; - } - }); - - function sleep(ms = 0): Promise { - return new Promise((r) => setTimeout(r, ms)); - } - - const reset = async ( - [opt, ...list] = getOptions(object as Record), - id = opt?.reset(), - ): Promise> => { - if (!opt) return sleep().then(() => []); - - return id ? [id, ...(await sleep(50).then(() => reset(list)))] : await sleep().then(() => reset(list)); - }; - - const resetTheme = async ( - [opt, ...list] = getOptions(object as Record), - id = opt?.doResetColor(), - ): Promise> => { - if (!opt) return sleep().then(() => []); - - return id - ? [id, ...(await sleep(50).then(() => resetTheme(list)))] - : await sleep().then(() => resetTheme(list)); - }; - - return Object.assign(object, { - configFile, - array: () => getOptions(object as Record), - async reset() { - return (await reset()).join('\n'); - }, - async resetTheme() { - return (await resetTheme()).join('\n'); - }, - handler(deps: string[], callback: () => void) { - for (const opt of getOptions(object as Record)) { - if (deps.some((i) => opt.id.startsWith(i))) opt.connect('changed', callback); - } - }, - }); -} diff --git a/ags/HyprPanel/lib/session.ts b/ags/HyprPanel/lib/session.ts deleted file mode 100644 index 595b366..0000000 --- a/ags/HyprPanel/lib/session.ts +++ /dev/null @@ -1,16 +0,0 @@ -import GLib from 'gi://GLib?version=2.0'; - -declare global { - const OPTIONS: string; - const TMP: string; - const USER: string; -} - -Object.assign(globalThis, { - OPTIONS: `${GLib.get_user_cache_dir()}/ags/hyprpanel/options.json`, - TMP: `${GLib.get_tmp_dir()}/ags/hyprpanel`, - USER: GLib.get_user_name(), -}); - -Utils.ensureDirectory(TMP); -App.addIcons(`${App.configDir}/assets`); diff --git a/ags/HyprPanel/lib/shared/media.ts b/ags/HyprPanel/lib/shared/media.ts deleted file mode 100644 index 23e0c6f..0000000 --- a/ags/HyprPanel/lib/shared/media.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { MprisPlayer } from 'types/service/mpris'; -const mpris = await Service.import('mpris'); - -export const getCurrentPlayer = (activePlayer: MprisPlayer = mpris.players[0]): MprisPlayer => { - const statusOrder = { - Playing: 1, - Paused: 2, - Stopped: 3, - }; - - if (mpris.players.length === 0) { - return mpris.players[0]; - } - - const isPlaying = mpris.players.some((p: MprisPlayer) => p.play_back_status === 'Playing'); - - const playerStillExists = mpris.players.some((p) => activePlayer.bus_name === p.bus_name); - - const nextPlayerUp = mpris.players.sort( - (a: MprisPlayer, b: MprisPlayer) => statusOrder[a.play_back_status] - statusOrder[b.play_back_status], - )[0]; - - if (isPlaying || !playerStillExists) { - return nextPlayerUp; - } - - return activePlayer; -}; diff --git a/ags/HyprPanel/lib/shared/notifications.ts b/ags/HyprPanel/lib/shared/notifications.ts deleted file mode 100644 index f772c69..0000000 --- a/ags/HyprPanel/lib/shared/notifications.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Notification } from 'types/service/notifications'; - -export const filterNotifications = (notifications: Notification[], filter: string[]): Notification[] => { - const notifFilter = new Set(filter.map((name: string) => name.toLowerCase().replace(/\s+/g, '_'))); - - const filteredNotifications = notifications.filter((notif: Notification) => { - const normalizedAppName = notif.app_name.toLowerCase().replace(/\s+/g, '_'); - return !notifFilter.has(normalizedAppName); - }); - - return filteredNotifications; -}; diff --git a/ags/HyprPanel/lib/types/audio.d.ts b/ags/HyprPanel/lib/types/audio.d.ts deleted file mode 100644 index 9332431..0000000 --- a/ags/HyprPanel/lib/types/audio.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type InputDevices = Button, Attribute>, Attribute>, Attribute>[]; - -type DummyDevices = Button, Attribute>, Attribute>, Attribute>[]; -type RealPlaybackDevices = Button, Attribute>, Attribute>, Attribute>[]; -export type PlaybackDevices = DummyDevices | RealPlaybackDevices; diff --git a/ags/HyprPanel/lib/types/bar.d.ts b/ags/HyprPanel/lib/types/bar.d.ts deleted file mode 100644 index 99066d8..0000000 --- a/ags/HyprPanel/lib/types/bar.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Binding, Connectable } from 'types/service'; -import { Variable } from 'types/variable'; -import Box from 'types/widgets/box'; -import Button, { ButtonProps } from 'types/widgets/button'; -import Label from 'types/widgets/label'; -import { Attribute, Child } from './widget'; - -export type BarBoxChild = { - component: Box; - isVisible?: boolean; - isVis?: Variable; - boxClass: string; - tooltip_text?: string | Binding; - props: ButtonProps; -}; - -export type SelfButton = Button; - -export type BoxHook = (self: Box) => void; -export type LabelHook = (self: Label) => void; - -export type Module = { - icon?: string | Binding; - textIcon?: string | Binding; - label?: string | Binding; - labelHook?: LabelHook; - boundLabel?: string; - tooltipText?: string | Binding; - boxClass: string; - props?: ButtonProps; - showLabel?: boolean; - showLabelBinding?: Binding; - hook?: BoxHook; - connection?: Binding; -}; - -export type ResourceLabelType = 'used/total' | 'used' | 'percentage' | 'free'; - -export type NetstatLabelType = 'full' | 'in' | 'out'; -export type RateUnit = 'GiB' | 'MiB' | 'KiB' | 'auto'; - - diff --git a/ags/HyprPanel/lib/types/customModules/generic.d.ts b/ags/HyprPanel/lib/types/customModules/generic.d.ts deleted file mode 100644 index 839e04a..0000000 --- a/ags/HyprPanel/lib/types/customModules/generic.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type GenericFunction = (...args: P) => T; - -export type GenericResourceMetrics = { - total: number; - used: number; - percentage: number; -}; - -type GenericResourceData = ResourceUsage & { - free: number; -}; - -export type Postfix = 'TiB' | 'GiB' | 'MiB' | 'KiB' | 'B'; diff --git a/ags/HyprPanel/lib/types/customModules/kbLayout.d.ts b/ags/HyprPanel/lib/types/customModules/kbLayout.d.ts deleted file mode 100644 index b287e06..0000000 --- a/ags/HyprPanel/lib/types/customModules/kbLayout.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { layoutMap } from 'customModules/kblayout/layouts'; - -export type KbLabelType = 'layout' | 'code'; - -export type HyprctlKeyboard = { - address: string; - name: string; - rules: string; - model: string; - layout: string; - variant: string; - options: string; - active_keymap: string; - main: boolean; -}; - -export type HyprctlMouse = { - address: string; - name: string; - defaultSpeed: number; -}; - -export type HyprctlDeviceLayout = { - mice: HyprctlMouse[]; - keyboards: HyprctlKeyboard[]; - tablets: unknown[]; - touch: unknown[]; - switches: unknown[]; -}; - -export type LayoutKeys = keyof typeof layoutMap; -export type LayoutValues = (typeof layoutMap)[LayoutKeys]; diff --git a/ags/HyprPanel/lib/types/customModules/network.d.ts b/ags/HyprPanel/lib/types/customModules/network.d.ts deleted file mode 100644 index dbef13f..0000000 --- a/ags/HyprPanel/lib/types/customModules/network.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type NetworkResourceData = { - in: string; - out: string; -}; diff --git a/ags/HyprPanel/lib/types/customModules/utils.d.ts b/ags/HyprPanel/lib/types/customModules/utils.d.ts deleted file mode 100644 index 14ccf90..0000000 --- a/ags/HyprPanel/lib/types/customModules/utils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Binding } from 'lib/utils'; - -export type InputHandlerEvents = { - onPrimaryClick?: Binding; - onSecondaryClick?: Binding; - onMiddleClick?: Binding; - onScrollUp?: Binding; - onScrollDown?: Binding; -}; - -export type RunAsyncCommand = (cmd: string, args: EventArgs, fn?: (output: string) => void) => void; diff --git a/ags/HyprPanel/lib/types/defaults/bar.ts b/ags/HyprPanel/lib/types/defaults/bar.ts deleted file mode 100644 index 78966c4..0000000 --- a/ags/HyprPanel/lib/types/defaults/bar.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { NetstatLabelType, ResourceLabelType } from '../bar'; - -export const LABEL_TYPES: ResourceLabelType[] = ['used/total', 'used', 'free', 'percentage']; - -export const NETWORK_LABEL_TYPES: NetstatLabelType[] = ['full', 'in', 'out']; diff --git a/ags/HyprPanel/lib/types/defaults/netstat.ts b/ags/HyprPanel/lib/types/defaults/netstat.ts deleted file mode 100644 index 083344b..0000000 --- a/ags/HyprPanel/lib/types/defaults/netstat.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RateUnit } from '../bar'; -import { NetworkResourceData } from '../customModules/network'; - -export const GET_DEFAULT_NETSTAT_DATA = (dataType: RateUnit): NetworkResourceData => { - if (dataType === 'auto') { - return { in: `0 Kib/s`, out: `0 Kib/s` }; - } - - return { in: `0 ${dataType}/s`, out: `0 ${dataType}/s` }; -}; diff --git a/ags/HyprPanel/lib/types/defaults/options.ts b/ags/HyprPanel/lib/types/defaults/options.ts deleted file mode 100644 index 11b7347..0000000 --- a/ags/HyprPanel/lib/types/defaults/options.ts +++ /dev/null @@ -1,60 +0,0 @@ -export const defaultColorMap = { - rosewater: '#f5e0dc', - flamingo: '#f2cdcd', - pink: '#f5c2e7', - mauve: '#cba6f7', - red: '#f38ba8', - maroon: '#eba0ac', - peach: '#fab387', - yellow: '#f9e2af', - green: '#a6e3a1', - teal: '#94e2d5', - sky: '#89dceb', - sapphire: '#74c7ec', - blue: '#89b4fa', - lavender: '#b4befe', - text: '#cdd6f4', - subtext1: '#bac2de', - subtext2: '#a6adc8', - overlay2: '#9399b2', - overlay1: '#7f849c', - overlay0: '#6c7086', - surface2: '#585b70', - surface1: '#45475a', - surface0: '#313244', - base2: '#242438', - base: '#1e1e2e', - mantle: '#181825', - crust: '#11111b', - surface1_2: '#454759', - text2: '#cdd6f3', - pink2: '#f5c2e6', - red2: '#f38ba7', - peach2: '#fab386', - mantle2: '#181824', - surface0_2: '#313243', - surface2_2: '#585b69', - overlay1_2: '#7f849b', - lavender2: '#b4befd', - mauve2: '#cba6f6', - green2: '#a6e3a0', - sky2: '#89dcea', - teal2: '#94e2d4', - yellow2: '#f9e2ad', - maroon2: '#eba0ab', - crust2: '#11111a', - pink3: '#f5c2e8', - red3: '#f38ba9', - mantle3: '#181826', - surface0_3: '#313245', - surface2_3: '#585b71', - overlay1_3: '#7f849d', - lavender3: '#b4beff', - mauve3: '#cba6f8', - green3: '#a6e3a2', - sky3: '#89dcec', - teal3: '#94e2d6', - yellow3: '#f9e2ae', - maroon3: '#eba0ad', - crust3: '#11111c', -} as const; diff --git a/ags/HyprPanel/lib/types/defaults/weather.ts b/ags/HyprPanel/lib/types/defaults/weather.ts deleted file mode 100644 index cde95e3..0000000 --- a/ags/HyprPanel/lib/types/defaults/weather.ts +++ /dev/null @@ -1,1053 +0,0 @@ -export const DEFAULT_WEATHER = { - location: { - name: 'Tahiti', - region: 'Somewhere', - country: 'United States of America', - lat: 0, - lon: 0, - tz_id: 'Tahiti', - localtime_epoch: 1721981457, - localtime: '2024-07-26 1:10', - }, - current: { - last_updated_epoch: 1721980800, - last_updated: '2024-07-26 01:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'NW', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0.0, - precip_in: 0.0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - vis_km: 0, - vis_miles: 0, - uv: 0, - gust_mph: 0, - gust_kph: 0, - }, - forecast: { - forecastday: [ - { - date: '2024-07-26', - date_epoch: 1721952000, - day: { - maxtemp_c: 0, - maxtemp_f: 0, - mintemp_c: 0, - mintemp_f: 0, - avgtemp_c: 0, - avgtemp_f: 0, - maxwind_mph: 0, - maxwind_kph: 0, - totalprecip_mm: 0, - totalprecip_in: 0, - totalsnow_cm: 0, - avgvis_km: 0, - avgvis_miles: 0, - avghumidity: 0, - daily_will_it_rain: 0, - daily_chance_of_rain: 0, - daily_will_it_snow: 0, - daily_chance_of_snow: 0, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - uv: 0, - }, - astro: { - sunrise: '06:01 AM', - sunset: '08:10 PM', - moonrise: '11:32 PM', - moonset: '12:01 PM', - moon_phase: 'Waning Gibbous', - moon_illumination: 0, - is_moon_up: 0, - is_sun_up: 0, - }, - hour: [ - { - time_epoch: 1721977200, - time: '2024-07-26 00:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721980800, - time: '2024-07-26 01:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721984400, - time: '2024-07-26 02:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721988000, - time: '2024-07-26 03:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721991600, - time: '2024-07-26 04:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721995200, - time: '2024-07-26 05:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1721998800, - time: '2024-07-26 06:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1722002400, - time: '2024-07-26 07:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 7.0, - }, - { - time_epoch: 1722006000, - time: '2024-07-26 08:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 7.0, - }, - { - time_epoch: 1722009600, - time: '2024-07-26 09:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 8.0, - }, - { - time_epoch: 1722013200, - time: '2024-07-26 10:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 8.0, - }, - { - time_epoch: 1722016800, - time: '2024-07-26 11:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 9.0, - }, - { - time_epoch: 1722020400, - time: '2024-07-26 12:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 9.0, - }, - { - time_epoch: 1722024000, - time: '2024-07-26 13:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 9.0, - }, - { - time_epoch: 1722027600, - time: '2024-07-26 14:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 10.0, - }, - { - time_epoch: 1722031200, - time: '2024-07-26 15:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 10.0, - }, - { - time_epoch: 1722034800, - time: '2024-07-26 16:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 10.0, - }, - { - time_epoch: 1722038400, - time: '2024-07-26 17:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 10.0, - }, - { - time_epoch: 1722042000, - time: '2024-07-26 18:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 9.0, - }, - { - time_epoch: 1722045600, - time: '2024-07-26 19:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 9.0, - }, - { - time_epoch: 1722049200, - time: '2024-07-26 20:00', - temp_c: 0, - temp_f: 0, - is_day: 1, - condition: { - text: 'Sunny', - icon: '//cdn.weatherapi.com/weather/64x64/day/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 8.0, - }, - { - time_epoch: 1722052800, - time: '2024-07-26 21:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1722056400, - time: '2024-07-26 22:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - { - time_epoch: 1722060000, - time: '2024-07-26 23:00', - temp_c: 0, - temp_f: 0, - is_day: 0, - condition: { - text: 'Clear ', - icon: '//cdn.weatherapi.com/weather/64x64/night/113.png', - code: 1000, - }, - wind_mph: 0, - wind_kph: 0, - wind_degree: 0, - wind_dir: 'N', - pressure_mb: 0, - pressure_in: 0, - precip_mm: 0, - precip_in: 0, - snow_cm: 0, - humidity: 0, - cloud: 0, - feelslike_c: 0, - feelslike_f: 0, - windchill_c: 0, - windchill_f: 0, - heatindex_c: 0, - heatindex_f: 0, - dewpoint_c: 0, - dewpoint_f: 0, - will_it_rain: 0, - chance_of_rain: 0, - will_it_snow: 0, - chance_of_snow: 0, - vis_km: 0, - vis_miles: 0, - gust_mph: 0, - gust_kph: 0, - uv: 0, - }, - ], - }, - ], - }, -}; diff --git a/ags/HyprPanel/lib/types/dropdownmenu.d.ts b/ags/HyprPanel/lib/types/dropdownmenu.d.ts deleted file mode 100644 index 8d76e5c..0000000 --- a/ags/HyprPanel/lib/types/dropdownmenu.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WindowProps } from 'types/widgets/window'; -import { GtkWidget, Transition } from './widget'; -import { Binding } from 'types/service'; - -export type DropdownMenuProps = { - name: string; - child: GtkWidget; - layout?: string; - transition?: Transition | Binding; - exclusivity?: Exclusivity; - fixed?: boolean; -} & WindowProps; diff --git a/ags/HyprPanel/lib/types/filechooser.d.ts b/ags/HyprPanel/lib/types/filechooser.d.ts deleted file mode 100644 index 8bb9d8f..0000000 --- a/ags/HyprPanel/lib/types/filechooser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type Config = { - [key: string]: string | number | boolean | object; -}; diff --git a/ags/HyprPanel/lib/types/globals.d.ts b/ags/HyprPanel/lib/types/globals.d.ts deleted file mode 100644 index ecdb39f..0000000 --- a/ags/HyprPanel/lib/types/globals.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type MousePos = { - source: string; - pos: number[]; -}; diff --git a/ags/HyprPanel/lib/types/gpustat.d.ts b/ags/HyprPanel/lib/types/gpustat.d.ts deleted file mode 100644 index 49dc75d..0000000 --- a/ags/HyprPanel/lib/types/gpustat.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type GPU_Stat_Process = { - username: string; - command: string; - full_command: string[]; - gpu_memory_usage: number; - cpu_percent: number; - cpu_memory_usage: number; - pid: number; -}; - -export type GPU_Stat = { - index: number; - uuid: string; - name: string; - 'temperature.gpu': number; - 'fan.speed': number; - 'utilization.gpu': number; - 'utilization.enc': number; - 'utilization.dec': number; - 'power.draw': number; - 'enforced.power.limit': number; - 'memory.used': number; - 'memory.total': number; - processes: Process[]; -}; diff --git a/ags/HyprPanel/lib/types/mpris.d.ts b/ags/HyprPanel/lib/types/mpris.d.ts deleted file mode 100644 index 5450e80..0000000 --- a/ags/HyprPanel/lib/types/mpris.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type LoopStatus = 'none' | 'track' | 'playlist'; -export type PlaybackStatus = 'playing' | 'paused' | 'stopped'; diff --git a/ags/HyprPanel/lib/types/network.d.ts b/ags/HyprPanel/lib/types/network.d.ts deleted file mode 100644 index 58dcdec..0000000 --- a/ags/HyprPanel/lib/types/network.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { WIFI_STATUS_MAP } from 'globals/network'; - -export type AccessPoint = { - bssid: string | null; - address: string | null; - lastSeen: number; - ssid: string | null; - active: boolean; - strength: number; - frequency: number; - iconName: string | undefined; -}; - -export type WifiStatus = keyof typeof WIFI_STATUS_MAP; - -export type WifiIcon = '󰤩' | '󰤨' | '󰤪' | '󰤨' | '󰤩' | '󰤮' | '󰤨' | '󰤥' | '󰤢' | '󰤟' | '󰤯'; diff --git a/ags/HyprPanel/lib/types/notification.d.ts b/ags/HyprPanel/lib/types/notification.d.ts deleted file mode 100644 index 027f195..0000000 --- a/ags/HyprPanel/lib/types/notification.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import icons from 'modules/icons/index'; - -export interface NotificationArgs { - appName?: string; - body?: string; - iconName?: string; - id?: number; - summary?: string; - urgency?: Urgency; - category?: string; - timeout?: number; - transient?: boolean; -} - -export type NotificationIcon = keyof typeof icons.notifications; diff --git a/ags/HyprPanel/lib/types/options.d.ts b/ags/HyprPanel/lib/types/options.d.ts deleted file mode 100644 index 51e7f76..0000000 --- a/ags/HyprPanel/lib/types/options.d.ts +++ /dev/null @@ -1,217 +0,0 @@ -import { Opt } from 'lib/option'; -import { Variable } from 'types/variable'; -import { defaultColorMap } from './defaults/options'; - -export type MkOptionsResult = { - configFile: string; - array: () => Opt[]; - reset: () => Promise; - resetTheme: () => Promise; - handler: (deps: string[], callback: () => void) => void; -}; - -export type RecursiveOptionsObject = { - [key: string]: RecursiveOptionsObject | Opt | Opt | Opt; -}; - -export type BarLocation = 'top' | 'bottom'; - -export type Unit = 'imperial' | 'metric'; -export type PowerOptions = 'sleep' | 'reboot' | 'logout' | 'shutdown'; -export type NotificationAnchor = - | 'top' - | 'top right' - | 'top left' - | 'bottom' - | 'bottom right' - | 'bottom left' - | 'left' - | 'right'; -export type OSDAnchor = 'top left' | 'top' | 'top right' | 'right' | 'bottom right' | 'bottom' | 'bottom left' | 'left'; -export type BarButtonStyles = 'default' | 'split' | 'wave' | 'wave2'; - -export type ThemeExportData = { - filePath: string; - themeOnly: boolean; -}; -export type RowProps = { - opt: Opt; - title: string; - note?: string; - type?: - | 'number' - | 'color' - | 'float' - | 'object' - | 'string' - | 'enum' - | 'boolean' - | 'img' - | 'wallpaper' - | 'export' - | 'import' - | 'config_import' - | 'font'; - enums?: T[]; - max?: number; - min?: number; - disabledBinding?: Variable; - exportData?: ThemeExportData; - subtitle?: string | VarType | Opt; - subtitleLink?: string; - dependencies?: string[]; - increment?: number; -}; - -export type OSDOrientation = 'horizontal' | 'vertical'; - -export type HexColor = `#${string}`; - -export type WindowLayer = 'top' | 'bottom' | 'overlay' | 'background'; - -export type ActiveWsIndicator = 'underline' | 'highlight' | 'color'; - -export type MatugenColors = { - background: HexColor; - error: HexColor; - error_container: HexColor; - inverse_on_surface: HexColor; - inverse_primary: HexColor; - inverse_surface: HexColor; - on_background: HexColor; - on_error: HexColor; - on_error_container: HexColor; - on_primary: HexColor; - on_primary_container: HexColor; - on_primary_fixed: HexColor; - on_primary_fixed_variant: HexColor; - on_secondary: HexColor; - on_secondary_container: HexColor; - on_secondary_fixed: HexColor; - on_secondary_fixed_variant: HexColor; - on_surface: HexColor; - on_surface_variant: HexColor; - on_tertiary: HexColor; - on_tertiary_container: HexColor; - on_tertiary_fixed: HexColor; - on_tertiary_fixed_variant: HexColor; - outline: HexColor; - outline_variant: HexColor; - primary: HexColor; - primary_container: HexColor; - primary_fixed: HexColor; - primary_fixed_dim: HexColor; - scrim: HexColor; - secondary: HexColor; - secondary_container: HexColor; - secondary_fixed: HexColor; - secondary_fixed_dim: HexColor; - shadow: HexColor; - surface: HexColor; - surface_bright: HexColor; - surface_container: HexColor; - surface_container_high: HexColor; - surface_container_highest: HexColor; - surface_container_low: HexColor; - surface_container_lowest: HexColor; - surface_dim: HexColor; - surface_variant: HexColor; - tertiary: HexColor; - tertiary_container: HexColor; - tertiary_fixed: HexColor; - tertiary_fixed_dim: HexColor; -}; - -export type MatugenVariation = { - rosewater: HexColor; - flamingo: HexColor; - pink: HexColor; - mauve: HexColor; - red: HexColor; - maroon: HexColor; - peach: HexColor; - yellow: HexColor; - green: HexColor; - teal: HexColor; - sky: HexColor; - sapphire: HexColor; - blue: HexColor; - lavender: HexColor; - text: HexColor; - subtext1: HexColor; - subtext2: HexColor; - overlay2: HexColor; - overlay1: HexColor; - overlay0: HexColor; - surface2: HexColor; - surface1: HexColor; - surface0: HexColor; - base2: HexColor; - base: HexColor; - mantle: HexColor; - crust: HexColor; - notifications_closer: HexColor; - notifications_background: HexColor; - dashboard_btn_text: HexColor; - red2: HexColor; - peach2: HexColor; - pink2: HexColor; - mantle2: HexColor; - surface1_2: HexColor; - surface0_2: HexColor; - overlay1_2: HexColor; - text2: HexColor; - lavender2: HexColor; - crust2: HexColor; - maroon2: HexColor; - mauve2: HexColor; - green2: HexColor; - surface2_2: HexColor; - sky2: HexColor; - teal2: HexColor; - yellow2: HexColor; - pink3: HexColor; - red3: HexColor; - mantle3: HexColor; - surface0_3: HexColor; - surface2_3: HexColor; - overlay1_3: HexColor; - lavender3: HexColor; - mauve3: HexColor; - green3: HexColor; - sky3: HexColor; - teal3: HexColor; - yellow3: HexColor; - maroon3: HexColor; - crust3: HexColor; - notifications_closer?: HexColor; - notifications_background?: HexColor; - dashboard_btn_text?: HexColor; -}; -export type MatugenScheme = - | 'content' - | 'expressive' - | 'fidelity' - | 'fruit-salad' - | 'monochrome' - | 'neutral' - | 'rainbow' - | 'tonal-spot'; - -export type MatugenVariations = - | 'standard_1' - | 'standard_2' - | 'standard_3' - | 'monochrome_1' - | 'monochrome_2' - | 'monochrome_3' - | 'vivid_1' - | 'vivid_2' - | 'vivid_3'; - -type MatugenTheme = 'light' | 'dark'; - -export type ColorMapKey = keyof typeof defaultColorMap; -export type ColorMapValue = (typeof defaultColorMap)[ColorMapKey]; - -export type ScalingPriority = 'gdk' | 'hyprland' | 'both'; diff --git a/ags/HyprPanel/lib/types/popupwindow.d.ts b/ags/HyprPanel/lib/types/popupwindow.d.ts deleted file mode 100644 index 300baab..0000000 --- a/ags/HyprPanel/lib/types/popupwindow.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Widget } from 'types/widgets/widget'; -import { WindowProps } from 'types/widgets/window'; -import { Transition } from './widget'; - -export type PopupWindowProps = { - name: string; - child: Widget; - layout?: Layouts; - transition?: Transition | Binding; - exclusivity?: Exclusivity; -} & WindowProps; - -export type LayoutFunction = ( - name: string, - child: Widget, - transition: Transition, -) => { - center: () => Widget; - top: () => Widget; - 'top-right': () => Widget; - 'top-center': () => Widget; - 'top-left': () => Widget; - 'bottom-left': () => Widget; - 'bottom-center': () => Widget; - 'bottom-right': () => Widget; -}; -export type Layouts = - | 'center' - | 'top' - | 'top-right' - | 'top-center' - | 'top-left' - | 'bottom-left' - | 'bottom-center' - | 'bottom-right'; diff --git a/ags/HyprPanel/lib/types/power.d.ts b/ags/HyprPanel/lib/types/power.d.ts deleted file mode 100644 index ef3c536..0000000 --- a/ags/HyprPanel/lib/types/power.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Action = 'sleep' | 'reboot' | 'logout' | 'shutdown'; diff --git a/ags/HyprPanel/lib/types/powerprofiles.d.ts b/ags/HyprPanel/lib/types/powerprofiles.d.ts deleted file mode 100644 index 980ac3b..0000000 --- a/ags/HyprPanel/lib/types/powerprofiles.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import PowerProfiles from 'types/service/powerprofiles.js'; - -export type PowerProfiles = InstanceType; -export type PowerProfile = 'power-saver' | 'balanced' | 'performance'; -export type PowerProfileObject = { - [key: string]: string; -}; diff --git a/ags/HyprPanel/lib/types/systray.d.ts b/ags/HyprPanel/lib/types/systray.d.ts deleted file mode 100644 index e69de29..0000000 diff --git a/ags/HyprPanel/lib/types/utils.d.ts b/ags/HyprPanel/lib/types/utils.d.ts deleted file mode 100644 index b35af46..0000000 --- a/ags/HyprPanel/lib/types/utils.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { substitutes } from 'lib/icons'; -import { EventArgs } from './widget'; - -type SubstituteKeys = keyof typeof substitutes; - -export type ThrottleFn = (cmd: string, args: EventArgs, fn?: (output: string) => void) => void; -export type ThrottleFnCallback = ((output: string) => void) | undefined; diff --git a/ags/HyprPanel/lib/types/variable.d.ts b/ags/HyprPanel/lib/types/variable.d.ts deleted file mode 100644 index af540dd..0000000 --- a/ags/HyprPanel/lib/types/variable.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Bind = OriginalBinding, unknown>; diff --git a/ags/HyprPanel/lib/types/volume.d.ts b/ags/HyprPanel/lib/types/volume.d.ts deleted file mode 100644 index 5e2cf32..0000000 --- a/ags/HyprPanel/lib/types/volume.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type VolumeIcons = { - [index: number]: string; -}; diff --git a/ags/HyprPanel/lib/types/weather.d.ts b/ags/HyprPanel/lib/types/weather.d.ts deleted file mode 100644 index daf0e1a..0000000 --- a/ags/HyprPanel/lib/types/weather.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { weatherIcons } from 'modules/icons/weather'; - -export type UnitType = 'imperial' | 'metric'; - -export type Weather = { - location: Location; - current: Current; - forecast: Forecast; -}; - -export type Current = { - last_updated_epoch?: number; - last_updated?: string; - temp_c: number; - temp_f: number; - is_day: number; - condition: Condition; - wind_mph: number; - wind_kph: number; - wind_degree: number; - wind_dir: string; - pressure_mb: number; - pressure_in: number; - precip_mm: number; - precip_in: number; - humidity: number; - cloud: number; - feelslike_c: number; - feelslike_f: number; - windchill_c: number; - windchill_f: number; - heatindex_c: number; - heatindex_f: number; - dewpoint_c: number; - dewpoint_f: number; - vis_km: number; - vis_miles: number; - uv: number; - gust_mph: number; - gust_kph: number; - time_epoch?: number; - time?: string; - snow_cm?: number; - will_it_rain?: number; - chance_of_rain?: number; - will_it_snow?: number; - chance_of_snow?: number; -}; - -export type Condition = { - text: string; - icon: string; - code: number; -}; - -export type Forecast = { - forecastday: Forecastday[]; -}; - -export type Forecastday = { - date: string; - date_epoch: number; - day: Day; - astro: Astro; - hour: Current[]; -}; - -export type Astro = { - sunrise: string; - sunset: string; - moonrise: string; - moonset: string; - moon_phase: string; - moon_illumination: number; - is_moon_up: number; - is_sun_up: number; -}; - -export type Day = { - maxtemp_c: number; - maxtemp_f: number; - mintemp_c: number; - mintemp_f: number; - avgtemp_c: number; - avgtemp_f: number; - maxwind_mph: number; - maxwind_kph: number; - totalprecip_mm: number; - totalprecip_in: number; - totalsnow_cm: number; - avgvis_km: number; - avgvis_miles: number; - avghumidity: number; - daily_will_it_rain: number; - daily_chance_of_rain: number; - daily_will_it_snow: number; - daily_chance_of_snow: number; - condition: Condition; - uv: number; -}; - -export type Location = { - name: string; - region: string; - country: string; - lat: number; - lon: number; - tz_id: string; - localtime_epoch: number; - localtime: string; -}; - -export type TemperatureIconColorMap = { - [key: number]: string; -}; - -export type WeatherIconTitle = keyof typeof weatherIcons; -export type WeatherIcon = (typeof weatherIcons)[WeatherIconTitle]; diff --git a/ags/HyprPanel/lib/types/widget.d.ts b/ags/HyprPanel/lib/types/widget.d.ts deleted file mode 100644 index ebb09a4..0000000 --- a/ags/HyprPanel/lib/types/widget.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0'; -import Box from 'types/widgets/box'; - -export type Exclusivity = 'normal' | 'ignore' | 'exclusive'; -export type Anchor = 'left' | 'right' | 'top' | 'down'; -export type Transition = 'none' | 'crossfade' | 'slide_right' | 'slide_left' | 'slide_up' | 'slide_down'; - -export type Layouts = - | 'center' - | 'top' - | 'top-right' - | 'top-center' - | 'top-left' - | 'bottom-left' - | 'bottom-center' - | 'bottom-right'; - -export type Attribute = unknown; -export type Child = Gtk.Widget; -export type GtkWidget = Gtk.Widget; -export type BoxWidget = Box; - -export type GButton = Gtk.Button; -export type GBox = Gtk.Box; -export type GLabel = Gtk.Label; -export type GCenterBox = Gtk.Box; - -export type EventHandler = (self: Self, event: Gdk.Event) => boolean | unknown; -export type EventArgs = { clicked: Button; event: Gdk.Event }; diff --git a/ags/HyprPanel/lib/types/workspace.d.ts b/ags/HyprPanel/lib/types/workspace.d.ts deleted file mode 100644 index 9c46c15..0000000 --- a/ags/HyprPanel/lib/types/workspace.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type WorkspaceRule = { - workspaceString: string; - monitor: string; -}; - -export type WorkspaceMap = { - [key: string]: number[]; -}; - -export type MonitorMap = { - [key: number]: string; -}; - -export type WorkspaceIcons = { - [key: string]: string; -}; - -export type WorkspaceIconsColored = { - [key: string]: { - color: string; - icon: string; - }; -}; - -export type WorkspaceIconMap = WorkspaceIcons | WorkspaceIconsColored; diff --git a/ags/HyprPanel/lib/utils.ts b/ags/HyprPanel/lib/utils.ts deleted file mode 100644 index 8b8fd04..0000000 --- a/ags/HyprPanel/lib/utils.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { type Application } from 'types/service/applications'; -import { NotificationAnchor } from './types/options'; -import { OSDAnchor } from 'lib/types/options'; -import icons, { substitutes } from './icons'; -import Gtk from 'gi://Gtk?version=3.0'; -import Gdk from 'gi://Gdk'; -import GLib from 'gi://GLib?version=2.0'; -import GdkPixbuf from 'gi://GdkPixbuf'; -import { NotificationArgs } from 'types/utils/notify'; -import { SubstituteKeys } from './types/utils'; -import { Window } from 'types/@girs/gtk-3.0/gtk-3.0.cjs'; -import { namedColors } from './constants/colors'; - -export type Binding = import('types/service').Binding; - -/** - * @returns substitute icon || name || fallback icon - */ -export function icon(name: string | null, fallback = icons.missing): string { - const validateSubstitute = (name: string): name is SubstituteKeys => name in substitutes; - - if (!name) return fallback || ''; - - if (GLib.file_test(name, GLib.FileTest.EXISTS)) return name; - - let icon: string = name; - - if (validateSubstitute(name)) { - icon = substitutes[name]; - } - - if (Utils.lookUpIcon(icon)) return icon; - - print(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`); - return fallback; -} - -/** - * @returns execAsync(["bash", "-c", cmd]) - */ -export async function bash(strings: TemplateStringsArray | string, ...values: unknown[]): Promise { - const cmd = - typeof strings === 'string' ? strings : strings.flatMap((str, i) => str + `${values[i] ?? ''}`).join(''); - - return Utils.execAsync(['bash', '-c', cmd]).catch((err) => { - console.error(cmd, err); - return ''; - }); -} - -/** - * @returns execAsync(cmd) - */ -export async function sh(cmd: string | string[]): Promise { - return Utils.execAsync(cmd).catch((err) => { - console.error(typeof cmd === 'string' ? cmd : cmd.join(' '), err); - return ''; - }); -} - -export function forMonitors(widget: (monitor: number) => Gtk.Window): Window[] { - const n = Gdk.Display.get_default()?.get_n_monitors() || 1; - return range(n, 0).flatMap(widget); -} - -/** - * @returns [start...length] - */ -export function range(length: number, start = 1): number[] { - return Array.from({ length }, (_, i) => i + start); -} - -/** - * @returns true if all of the `bins` are found - */ -export function dependencies(...bins: string[]): boolean { - const missing = bins.filter((bin) => - Utils.exec({ - cmd: `which ${bin}`, - out: () => false, - err: () => true, - }), - ); - - if (missing.length > 0) { - console.warn(Error(`missing dependencies: ${missing.join(', ')}`)); - Notify({ - summary: 'Dependencies not found!', - body: `The following dependencies are missing: ${missing.join(', ')}`, - iconName: icons.ui.warning, - timeout: 7000, - }); - } - - return missing.length === 0; -} - -/** - * run app detached - */ -export function launchApp(app: Application): void { - const exe = app.executable - .split(/\s+/) - .filter((str) => !str.startsWith('%') && !str.startsWith('@')) - .join(' '); - - bash(`${exe} &`); - app.frequency += 1; -} - -/** - * to use with drag and drop - */ -export function createSurfaceFromWidget(widget: Gtk.Widget): GdkPixbuf.Pixbuf { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const cairo = imports.gi.cairo as any; - const alloc = widget.get_allocation(); - const surface = new cairo.ImageSurface(cairo.Format.ARGB32, alloc.width, alloc.height); - const cr = new cairo.Context(surface); - cr.setSourceRGBA(255, 255, 255, 0); - cr.rectangle(0, 0, alloc.width, alloc.height); - cr.fill(); - widget.draw(cr); - return surface; -} - -/** - * Ensure that the provided filepath is a valid image - */ -export const isAnImage = (imgFilePath: string): boolean => { - try { - GdkPixbuf.Pixbuf.new_from_file(imgFilePath); - return true; - } catch (error) { - console.error(error); - return false; - } -}; - -export const Notify = (notifPayload: NotificationArgs): void => { - let command = 'notify-send'; - command += ` "${notifPayload.summary} "`; - if (notifPayload.body) command += ` "${notifPayload.body}" `; - if (notifPayload.appName) command += ` -a "${notifPayload.appName}"`; - if (notifPayload.iconName) command += ` -i "${notifPayload.iconName}"`; - if (notifPayload.urgency) command += ` -u "${notifPayload.urgency}"`; - if (notifPayload.timeout !== undefined) command += ` -t ${notifPayload.timeout}`; - if (notifPayload.category) command += ` -c "${notifPayload.category}"`; - if (notifPayload.transient) command += ` -e`; - if (notifPayload.id !== undefined) command += ` -r ${notifPayload.id}`; - - Utils.execAsync(command); -}; - -export const getPosition = (pos: NotificationAnchor | OSDAnchor): ('top' | 'bottom' | 'left' | 'right')[] => { - const positionMap: { [key: string]: ('top' | 'bottom' | 'left' | 'right')[] } = { - top: ['top'], - 'top right': ['top', 'right'], - 'top left': ['top', 'left'], - bottom: ['bottom'], - 'bottom right': ['bottom', 'right'], - 'bottom left': ['bottom', 'left'], - right: ['right'], - left: ['left'], - }; - - return positionMap[pos] || ['top']; -}; -export const isValidGjsColor = (color: string): boolean => { - const colorLower = color.toLowerCase().trim(); - - if (namedColors.has(colorLower)) { - return true; - } - - const hexColorRegex = /^#(?:[a-fA-F0-9]{3,4}|[a-fA-F0-9]{6,8})$/; - - const rgbRegex = /^rgb\(\s*(\d{1,3}%?\s*,\s*){2}\d{1,3}%?\s*\)$/; - const rgbaRegex = /^rgba\(\s*(\d{1,3}%?\s*,\s*){3}(0|1|0?\.\d+)\s*\)$/; - - if (hexColorRegex.test(color)) { - return true; - } - - if (rgbRegex.test(colorLower) || rgbaRegex.test(colorLower)) { - return true; - } - - return false; -}; - -export const capitalizeFirstLetter = (str: string): string => { - return str.charAt(0).toUpperCase() + str.slice(1); -}; diff --git a/ags/HyprPanel/lib/variables.ts b/ags/HyprPanel/lib/variables.ts deleted file mode 100644 index 303c121..0000000 --- a/ags/HyprPanel/lib/variables.ts +++ /dev/null @@ -1,15 +0,0 @@ -import GLib from 'gi://GLib'; -import { DateTime } from 'types/@girs/glib-2.0/glib-2.0.cjs'; - -export const clock = Variable(GLib.DateTime.new_now_local(), { - poll: [1000, (): DateTime => GLib.DateTime.new_now_local()], -}); - -export const uptime = Variable(0, { - poll: [60_000, 'cat /proc/uptime', (line): number => Number.parseInt(line.split('.')[0]) / 60], -}); - -export const distro = { - id: GLib.get_os_info('ID'), - logo: GLib.get_os_info('LOGO'), -}; diff --git a/ags/HyprPanel/main.ts b/ags/HyprPanel/main.ts deleted file mode 100644 index 399c1f9..0000000 --- a/ags/HyprPanel/main.ts +++ /dev/null @@ -1,22 +0,0 @@ -import 'lib/session'; -import 'scss/style'; -import 'globals/useTheme'; -import 'globals/dropdown.js'; -import 'globals/utilities'; - -import { Bar } from 'modules/bar/Bar'; -import MenuWindows from './modules/menus/main.js'; -import SettingsDialog from 'widget/settings/SettingsDialog'; -import Notifications from './modules/notifications/index.js'; -import { forMonitors } from 'lib/utils'; -import OSD from 'modules/osd/index'; - -App.config({ - onConfigParsed: () => Utils.execAsync(`python3 ${App.configDir}/services/bluetooth.py`), - windows: [...MenuWindows, Notifications(), SettingsDialog(), ...forMonitors(Bar), OSD()], - closeWindowDelay: { - sideright: 350, - launcher: 350, - bar0: 350, - }, -}); diff --git a/ags/HyprPanel/modules/bar/Bar.ts b/ags/HyprPanel/modules/bar/Bar.ts deleted file mode 100644 index b5eff25..0000000 --- a/ags/HyprPanel/modules/bar/Bar.ts +++ /dev/null @@ -1,315 +0,0 @@ -const hyprland = await Service.import('hyprland'); - -import { - Menu, - Workspaces, - ClientTitle, - Media, - Notifications, - Volume, - Network, - Bluetooth, - BatteryLabel, - Clock, - SysTray, - - // Custom Modules - Ram, - Cpu, - Storage, - Netstat, - KbInput, - Updates, - Submap, - Weather, - Power, -} from './Exports'; - -import { BarItemBox as WidgetContainer } from '../shared/barItemBox.js'; -import options from 'options'; -import Gdk from 'gi://Gdk?version=3.0'; -import Button from 'types/widgets/button.js'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0.js'; - -import './SideEffects'; -import { WindowLayer } from 'lib/types/options.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import Window from 'types/widgets/window.js'; - -const { layouts } = options.bar; -const { location } = options.theme.bar; - -export type BarWidget = keyof typeof widget; - -type Section = - | 'battery' - | 'dashboard' - | 'workspaces' - | 'windowtitle' - | 'media' - | 'notifications' - | 'volume' - | 'network' - | 'bluetooth' - | 'clock' - | 'ram' - | 'cpu' - | 'storage' - | 'netstat' - | 'kbinput' - | 'updates' - | 'submap' - | 'weather' - | 'power' - | 'systray'; - -type Layout = { - left: Section[]; - middle: Section[]; - right: Section[]; -}; - -type BarLayout = { - [key: string]: Layout; -}; - -const getLayoutForMonitor = (monitor: number, layouts: BarLayout): Layout => { - const matchingKey = Object.keys(layouts).find((key) => key === monitor.toString()); - const wildcard = Object.keys(layouts).find((key) => key === '*'); - - if (matchingKey) { - return layouts[matchingKey]; - } - - if (wildcard) { - return layouts[wildcard]; - } - - return { - left: ['dashboard', 'workspaces', 'windowtitle'], - middle: ['media'], - right: ['volume', 'network', 'bluetooth', 'battery', 'systray', 'clock', 'notifications'], - }; -}; - -const widget = { - battery: (): Button => WidgetContainer(BatteryLabel()), - dashboard: (): Button => WidgetContainer(Menu()), - workspaces: (monitor: number): Button => WidgetContainer(Workspaces(monitor)), - windowtitle: (): Button => WidgetContainer(ClientTitle()), - media: (): Button => WidgetContainer(Media()), - notifications: (): Button => WidgetContainer(Notifications()), - volume: (): Button => WidgetContainer(Volume()), - network: (): Button => WidgetContainer(Network()), - bluetooth: (): Button => WidgetContainer(Bluetooth()), - clock: (): Button => WidgetContainer(Clock()), - systray: (): Button => WidgetContainer(SysTray()), - ram: (): Button => WidgetContainer(Ram()), - cpu: (): Button => WidgetContainer(Cpu()), - storage: (): Button => WidgetContainer(Storage()), - netstat: (): Button => WidgetContainer(Netstat()), - kbinput: (): Button => WidgetContainer(KbInput()), - updates: (): Button => WidgetContainer(Updates()), - submap: (): Button => WidgetContainer(Submap()), - weather: (): Button => WidgetContainer(Weather()), - power: (): Button => WidgetContainer(Power()), -}; - -type GdkMonitors = { - [key: string]: { - key: string; - model: string; - used: boolean; - }; -}; - -function getGdkMonitors(): GdkMonitors { - const display = Gdk.Display.get_default(); - - if (display === null) { - console.error('Failed to get Gdk display.'); - return {}; - } - - const numGdkMonitors = display.get_n_monitors(); - const gdkMonitors: GdkMonitors = {}; - - for (let i = 0; i < numGdkMonitors; i++) { - const curMonitor = display.get_monitor(i); - - if (curMonitor === null) { - console.warn(`Monitor at index ${i} is null.`); - continue; - } - - const model = curMonitor.get_model() || ''; - const geometry = curMonitor.get_geometry(); - const scaleFactor = curMonitor.get_scale_factor(); - - const key = `${model}_${geometry.width}x${geometry.height}_${scaleFactor}`; - gdkMonitors[i] = { key, model, used: false }; - } - - return gdkMonitors; -} - -/** - * NOTE: Some more funky stuff being done by GDK. - * We render windows/bar based on the monitor ID. So if you have 3 monitors, then your - * monitor IDs will be [0, 1, 2]. Hyprland will NEVER change what ID belongs to what monitor. - * - * So if hyprland determines id 0 = DP-1, even after you unplug, shut off or restart your monitor, - * the id 0 will ALWAYS be DP-1. - * - * However, GDK (the righteous genius that it is) will change the order of ID anytime your monitor - * setup is changed. So if you unplug your monitor and plug it back it, it now becomes the last id. - * So if DP-1 was id 0 and you unplugged it, it will reconfigure to id 2. This sucks because now - * there's a mismtach between what GDK determines the monitor is at id 2 and what Hyprland determines - * is at id 2. - * - * So for that reason, we need to redirect the input `monitor` that the Bar module takes in, to the - * proper Hyprland monitor. So when monitor id 0 comes in, we need to find what the id of that monitor - * is being determined as by Hyprland so the bars show up on the right monitors. - * - * Since GTK3 doesn't contain connection names and only monitor models, we have to make the best guess - * in the case that there are multiple models in the same resolution with the same scale. We find the - * 'right' monitor by checking if the model matches along with the resolution and scale. If monitor at - * ID 0 for GDK is being reported as 'MSI MAG271CQR' we find the same model in the Hyprland monitor list - * and check if the resolution and scaling is the same... if it is then we determine it's a match. - * - * The edge-case that we just can't handle is if you have the same monitors in the same resolution at the same - * scale. So if you've got 2 'MSI MAG271CQR' monitors at 2560x1440 at scale 1, then we just match the first - * monitor in the list as the first match and then the second 'MSI MAG271CQR' as a match in the 2nd iteration. - * You may have the bar showing up on the wrong one in this case because we don't know what the connector id - * is of either of these monitors (DP-1, DP-2) which are unique values - as these are only in GTK4. - * - * Keep in mind though, this is ONLY an issue if you change your monitor setup by plugging in a new one, restarting - * an existing one or shutting it off. - * - * If your monitors aren't changed in the current session you're in then none of this safeguarding is relevant. - * - * Fun stuff really... :facepalm: - */ - -const gdkMonitorIdToHyprlandId = (monitor: number, usedHyprlandMonitors: Set): number => { - const gdkMonitors = getGdkMonitors(); - - if (Object.keys(gdkMonitors).length === 0) { - console.error('No GDK monitors were found.'); - return monitor; - } - - // Get the GDK monitor for the given monitor index - const gdkMonitor = gdkMonitors[monitor]; - - // First pass: Strict matching including the monitor index (i.e., hypMon.id === monitor + resolution+scale criteria) - const directMatch = hyprland.monitors.find((hypMon) => { - const hyprlandKey = `${hypMon.model}_${hypMon.width}x${hypMon.height}_${hypMon.scale}`; - return gdkMonitor.key.startsWith(hyprlandKey) && !usedHyprlandMonitors.has(hypMon.id) && hypMon.id === monitor; - }); - - if (directMatch) { - usedHyprlandMonitors.add(directMatch.id); - return directMatch.id; - } - - // Second pass: Relaxed matching without considering the monitor index - const hyprlandMonitor = hyprland.monitors.find((hypMon) => { - const hyprlandKey = `${hypMon.model}_${hypMon.width}x${hypMon.height}_${hypMon.scale}`; - return gdkMonitor.key.startsWith(hyprlandKey) && !usedHyprlandMonitors.has(hypMon.id); - }); - - if (hyprlandMonitor) { - usedHyprlandMonitors.add(hyprlandMonitor.id); - return hyprlandMonitor.id; - } - - // Fallback: Find the first available monitor ID that hasn't been used - const fallbackMonitor = hyprland.monitors.find((hypMon) => !usedHyprlandMonitors.has(hypMon.id)); - - if (fallbackMonitor) { - usedHyprlandMonitors.add(fallbackMonitor.id); - return fallbackMonitor.id; - } - - // Ensure we return a valid monitor ID that actually exists - for (let i = 0; i < hyprland.monitors.length; i++) { - if (!usedHyprlandMonitors.has(i)) { - usedHyprlandMonitors.add(i); - return i; - } - } - - // As a last resort, return the original monitor index if no unique monitor can be found - console.warn(`Returning original monitor index as a last resort: ${monitor}`); - return monitor; -}; - -export const Bar = (() => { - const usedHyprlandMonitors = new Set(); - - return (monitor: number): Window => { - const hyprlandMonitor = gdkMonitorIdToHyprlandId(monitor, usedHyprlandMonitors); - - return Widget.Window({ - name: `bar-${hyprlandMonitor}`, - class_name: 'bar', - monitor, - visible: true, - anchor: location.bind('value').as((ln) => [ln, 'left', 'right']), - exclusivity: 'exclusive', - layer: Utils.merge( - [options.theme.bar.layer.bind('value'), options.tear.bind('value')], - (barLayer: WindowLayer, tear: boolean) => { - if (tear && barLayer === 'overlay') { - return 'top'; - } - return barLayer; - }, - ), - child: Widget.Box({ - class_name: 'bar-panel-container', - child: Widget.CenterBox({ - class_name: 'bar-panel', - css: 'padding: 1px', - startWidget: Widget.Box({ - class_name: 'box-left', - hexpand: true, - setup: (self) => { - self.hook(layouts, (self) => { - const foundLayout = getLayoutForMonitor(hyprlandMonitor, layouts.value as BarLayout); - self.children = foundLayout.left - .filter((mod) => Object.keys(widget).includes(mod)) - .map((w) => widget[w](hyprlandMonitor) as Button); - }); - }, - }), - centerWidget: Widget.Box({ - class_name: 'box-center', - hpack: 'center', - setup: (self) => { - self.hook(layouts, (self) => { - const foundLayout = getLayoutForMonitor(hyprlandMonitor, layouts.value as BarLayout); - self.children = foundLayout.middle - .filter((mod) => Object.keys(widget).includes(mod)) - .map((w) => widget[w](hyprlandMonitor) as Button); - }); - }, - }), - endWidget: Widget.Box({ - class_name: 'box-right', - hpack: 'end', - setup: (self) => { - self.hook(layouts, (self) => { - const foundLayout = getLayoutForMonitor(hyprlandMonitor, layouts.value as BarLayout); - self.children = foundLayout.right - .filter((mod) => Object.keys(widget).includes(mod)) - .map((w) => widget[w](hyprlandMonitor) as Button); - }); - }, - }), - }), - }), - }); - }; -})(); diff --git a/ags/HyprPanel/modules/bar/Exports.ts b/ags/HyprPanel/modules/bar/Exports.ts deleted file mode 100644 index 6a17b2f..0000000 --- a/ags/HyprPanel/modules/bar/Exports.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Menu } from './menu/index'; -import { Workspaces } from './workspaces/index'; -import { ClientTitle } from './window_title/index'; -import { Media } from './media/index'; -import { Notifications } from './notifications/index'; -import { Volume } from './volume/index'; -import { Network } from './network/index'; -import { Bluetooth } from './bluetooth/index'; -import { BatteryLabel } from './battery/index'; -import { Clock } from './clock/index'; -import { SysTray } from './systray/index'; - -// Custom Modules -import { Ram } from '../../customModules/ram/index'; -import { Cpu } from '../../customModules/cpu/index'; -import { Storage } from 'customModules/storage/index'; -import { Netstat } from 'customModules/netstat/index'; -import { KbInput } from 'customModules/kblayout/index'; -import { Updates } from 'customModules/updates/index'; -import { Submap } from 'customModules/submap/index'; -import { Weather } from 'customModules/weather/index'; -import { Power } from 'customModules/power/index'; - -export { - Menu, - Workspaces, - ClientTitle, - Media, - Notifications, - Volume, - Network, - Bluetooth, - BatteryLabel, - Clock, - SysTray, - - // Custom Modules - Ram, - Cpu, - Storage, - Netstat, - KbInput, - Updates, - Submap, - Weather, - Power, -}; diff --git a/ags/HyprPanel/modules/bar/SideEffects.ts b/ags/HyprPanel/modules/bar/SideEffects.ts deleted file mode 100644 index e4aabec..0000000 --- a/ags/HyprPanel/modules/bar/SideEffects.ts +++ /dev/null @@ -1,29 +0,0 @@ -import options from 'options'; - -const { showIcon, showTime } = options.bar.clock; - -showIcon.connect('changed', () => { - if (!showTime.value && !showIcon.value) { - showTime.value = true; - } -}); - -showTime.connect('changed', () => { - if (!showTime.value && !showIcon.value) { - showIcon.value = true; - } -}); - -const { label, icon } = options.bar.windowtitle; - -label.connect('changed', () => { - if (!label.value && !icon.value) { - icon.value = true; - } -}); - -icon.connect('changed', () => { - if (!label.value && !icon.value) { - label.value = true; - } -}); diff --git a/ags/HyprPanel/modules/bar/battery/index.ts b/ags/HyprPanel/modules/bar/battery/index.ts deleted file mode 100644 index 8d22ef7..0000000 --- a/ags/HyprPanel/modules/bar/battery/index.ts +++ /dev/null @@ -1,133 +0,0 @@ -const battery = await Service.import('battery'); -import Gdk from 'gi://Gdk?version=3.0'; -import { openMenu } from '../utils.js'; -import options from 'options'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { label: show_label, rightClick, middleClick, scrollUp, scrollDown, hideLabelWhenFull } = options.bar.battery; - -const BatteryLabel = (): BarBoxChild => { - const isVis = Variable(battery.available); - - const batIcon = Utils.merge( - [battery.bind('percent'), battery.bind('charging'), battery.bind('charged')], - (batPercent: number, batCharging, batCharged) => { - if (batCharged) return `battery-level-100-charged-symbolic`; - else return `battery-level-${Math.floor(batPercent / 10) * 10}${batCharging ? '-charging' : ''}-symbolic`; - }, - ); - - battery.connect('changed', ({ available }) => { - isVis.value = available; - }); - - const formatTime = (seconds: number): Record => { - const hours = Math.floor(seconds / 3600); - const minutes = Math.floor((seconds % 3600) / 60); - return { hours, minutes }; - }; - - const generateTooltip = (timeSeconds: number, isCharging: boolean, isCharged: boolean): string => { - if (isCharged) { - return 'Fully Charged!!!'; - } - - const { hours, minutes } = formatTime(timeSeconds); - if (isCharging) { - return `${hours} hours ${minutes} minutes until full`; - } else { - return `${hours} hours ${minutes} minutes left`; - } - }; - - return { - component: Widget.Box({ - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), show_label.bind('value')], - (style, showLabel) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `battery-container ${styleMap[style]} ${!showLabel ? 'no-label' : ''}`; - }, - ), - visible: battery.bind('available'), - tooltip_text: battery.bind('time_remaining').as((t) => t.toString()), - children: Utils.merge( - [ - battery.bind('available'), - show_label.bind('value'), - battery.bind('charged'), - hideLabelWhenFull.bind('value'), - ], - (batAvail, showLabel, isCharged, hideWhenFull) => { - if (batAvail && showLabel) { - return [ - Widget.Icon({ - class_name: 'bar-button-icon battery', - icon: batIcon, - }), - ...(hideWhenFull && isCharged - ? [] - : [ - Widget.Label({ - class_name: 'bar-button-label battery', - label: battery.bind('percent').as((p) => `${Math.floor(p)}%`), - }), - ]), - ]; - } else if (batAvail && !showLabel) { - return [ - Widget.Icon({ - class_name: 'bar-button-icon battery', - icon: batIcon, - }), - ]; - } else { - return []; - } - }, - ), - setup: (self) => { - self.hook(battery, () => { - if (battery.available) { - self.tooltip_text = generateTooltip(battery.time_remaining, battery.charging, battery.charged); - } - }); - }, - }), - isVis, - boxClass: 'battery', - props: { - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - onPrimaryClick: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'energymenu'); - }, - }, - }; -}; - -export { BatteryLabel }; diff --git a/ags/HyprPanel/modules/bar/bluetooth/index.ts b/ags/HyprPanel/modules/bar/bluetooth/index.ts deleted file mode 100644 index 55381a3..0000000 --- a/ags/HyprPanel/modules/bar/bluetooth/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -const bluetooth = await Service.import('bluetooth'); -import Gdk from 'gi://Gdk?version=3.0'; -import options from 'options'; -import { openMenu } from '../utils.js'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { label, rightClick, middleClick, scrollDown, scrollUp } = options.bar.bluetooth; - -const Bluetooth = (): BarBoxChild => { - const btIcon = Widget.Label({ - label: bluetooth.bind('enabled').as((v) => (v ? '󰂯' : '󰂲')), - class_name: 'bar-button-icon bluetooth txt-icon bar', - }); - - const btText = Widget.Label({ - label: Utils.merge([bluetooth.bind('enabled'), bluetooth.bind('connected_devices')], (btEnabled, btDevices) => { - return btEnabled && btDevices.length ? ` Connected (${btDevices.length})` : btEnabled ? 'On' : 'Off'; - }), - class_name: 'bar-button-label bluetooth', - }); - - return { - component: Widget.Box({ - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), label.bind('value')], - (style, showLabel) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `bluetooth-container ${styleMap[style]} ${!showLabel ? 'no-label' : ''}`; - }, - ), - children: options.bar.bluetooth.label.bind('value').as((showLabel) => { - if (showLabel) { - return [btIcon, btText]; - } - return [btIcon]; - }), - }), - isVisible: true, - boxClass: 'bluetooth', - props: { - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'bluetoothmenu'); - }, - }, - }; -}; - -export { Bluetooth }; diff --git a/ags/HyprPanel/modules/bar/clock/index.ts b/ags/HyprPanel/modules/bar/clock/index.ts deleted file mode 100644 index 0b2fe21..0000000 --- a/ags/HyprPanel/modules/bar/clock/index.ts +++ /dev/null @@ -1,83 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -import GLib from 'gi://GLib'; -import { openMenu } from '../utils.js'; -import options from 'options'; -import { DateTime } from 'types/@girs/glib-2.0/glib-2.0.cjs'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { format, icon, showIcon, showTime, rightClick, middleClick, scrollUp, scrollDown } = options.bar.clock; -const { style } = options.theme.bar.buttons; - -const date = Variable(GLib.DateTime.new_now_local(), { - poll: [1000, (): DateTime => GLib.DateTime.new_now_local()], -}); -const time = Utils.derive([date, format], (c, f) => c.format(f) || ''); - -const Clock = (): BarBoxChild => { - const clockTime = Widget.Label({ - class_name: 'bar-button-label clock bar', - label: time.bind(), - }); - - const clockIcon = Widget.Label({ - label: icon.bind('value'), - class_name: 'bar-button-icon clock txt-icon bar', - }); - - return { - component: Widget.Box({ - className: Utils.merge( - [style.bind('value'), showIcon.bind('value'), showTime.bind('value')], - (btnStyle, shwIcn, shwLbl) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - - return `clock-container ${styleMap[btnStyle]} ${!shwLbl ? 'no-label' : ''} ${!shwIcn ? 'no-icon' : ''}`; - }, - ), - children: Utils.merge([showIcon.bind('value'), showTime.bind('value')], (shIcn, shTm) => { - if (shIcn && !shTm) { - return [clockIcon]; - } else if (shTm && !shIcn) { - return [clockTime]; - } - - return [clockIcon, clockTime]; - }), - }), - isVisible: true, - boxClass: 'clock', - props: { - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'calendarmenu'); - }, - }, - }; -}; - -export { Clock }; diff --git a/ags/HyprPanel/modules/bar/media/index.ts b/ags/HyprPanel/modules/bar/media/index.ts deleted file mode 100644 index 5892d7b..0000000 --- a/ags/HyprPanel/modules/bar/media/index.ts +++ /dev/null @@ -1,113 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -const mpris = await Service.import('mpris'); -import { openMenu } from '../utils.js'; -import options from 'options'; -import { getCurrentPlayer } from 'lib/shared/media.js'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand } from 'customModules/utils.js'; - -const { show_artist, truncation, truncation_size, show_label, show_active_only, rightClick, middleClick } = - options.bar.media; - -const Media = (): BarBoxChild => { - const activePlayer = Variable(mpris.players[0]); - const isVis = Variable(!show_active_only.value); - - show_active_only.connect('changed', () => { - isVis.value = !show_active_only.value || mpris.players.length > 0; - }); - - mpris.connect('changed', () => { - const curPlayer = getCurrentPlayer(activePlayer.value); - activePlayer.value = curPlayer; - isVis.value = !show_active_only.value || mpris.players.length > 0; - }); - - const getIconForPlayer = (playerName: string): string => { - const windowTitleMap = [ - ['Firefox', '󰈹'], - ['Microsoft Edge', '󰇩'], - ['Discord', ''], - ['Plex', '󰚺'], - ['Spotify', '󰓇'], - ['(.*)', '󰝚'], - ]; - - const foundMatch = windowTitleMap.find((wt) => RegExp(wt[0], 'i').test(playerName)); - - return foundMatch ? foundMatch[1] : '󰝚'; - }; - - const songIcon = Variable(''); - - const mediaLabel = Utils.watch('Media', [mpris, show_artist, truncation, truncation_size, show_label], () => { - if (activePlayer.value && show_label.value) { - const { track_title, identity, track_artists } = activePlayer.value; - songIcon.value = getIconForPlayer(identity); - const trackArtist = show_artist.value ? ` - ${track_artists.join(', ')}` : ``; - const truncatedLabel = truncation.value - ? `${track_title + trackArtist}`.substring(0, truncation_size.value) - : `${track_title + trackArtist}`; - - return track_title.length === 0 - ? `No media playing...` - : truncatedLabel.length < truncation_size.value || !truncation.value - ? `${truncatedLabel}` - : `${truncatedLabel.substring(0, truncatedLabel.length - 3)}...`; - } else { - songIcon.value = getIconForPlayer(activePlayer.value?.identity || ''); - return `Media`; - } - }); - - return { - component: Widget.Box({ - visible: false, - child: Widget.Box({ - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), show_label.bind('value')], - (style) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `media-container ${styleMap[style]}`; - }, - ), - child: Widget.Box({ - children: [ - Widget.Label({ - class_name: 'bar-button-icon media txt-icon bar', - label: songIcon.bind('value').as((v) => v || '󰝚'), - }), - Widget.Label({ - class_name: 'bar-button-label media', - label: mediaLabel, - }), - ], - }), - }), - }), - isVis, - boxClass: 'media', - props: { - on_scroll_up: () => activePlayer.value?.next(), - on_scroll_down: () => activePlayer.value?.previous(), - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'mediamenu'); - }, - onSecondaryClick: (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }, - onMiddleClick: (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }, - }, - }; -}; - -export { Media }; diff --git a/ags/HyprPanel/modules/bar/menu/index.ts b/ags/HyprPanel/modules/bar/menu/index.ts deleted file mode 100644 index 5c55bfb..0000000 --- a/ags/HyprPanel/modules/bar/menu/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -import { openMenu } from '../utils.js'; -import options from 'options'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { rightClick, middleClick, scrollUp, scrollDown } = options.bar.launcher; - -const Menu = (): BarBoxChild => { - return { - component: Widget.Box({ - className: Utils.merge([options.theme.bar.buttons.style.bind('value')], (style) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `dashboard ${styleMap[style]}`; - }), - child: Widget.Label({ - class_name: 'bar-menu_label bar-button_icon txt-icon bar', - label: options.bar.launcher.icon.bind('value'), - }), - }), - isVisible: true, - boxClass: 'dashboard', - props: { - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'dashboardmenu'); - }, - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - }, - }; -}; - -export { Menu }; diff --git a/ags/HyprPanel/modules/bar/network/index.ts b/ags/HyprPanel/modules/bar/network/index.ts deleted file mode 100644 index 056f455..0000000 --- a/ags/HyprPanel/modules/bar/network/index.ts +++ /dev/null @@ -1,106 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -const network = await Service.import('network'); -import options from 'options'; -import { openMenu } from '../utils.js'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { - label: networkLabel, - truncation, - truncation_size, - rightClick, - middleClick, - scrollDown, - scrollUp, -} = options.bar.network; - -const Network = (): BarBoxChild => { - return { - component: Widget.Box({ - vpack: 'fill', - vexpand: true, - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), networkLabel.bind('value')], - (style, showLabel) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `network-container ${styleMap[style]}${!showLabel ? ' no-label' : ''}`; - }, - ), - children: [ - Widget.Icon({ - class_name: 'bar-button-icon network-icon', - icon: Utils.merge( - [network.bind('primary'), network.bind('wifi'), network.bind('wired')], - (pmry, wfi, wrd) => { - if (pmry === 'wired') { - return wrd.icon_name; - } - return wfi.icon_name; - }, - ), - }), - Widget.Box({ - child: Utils.merge( - [ - network.bind('primary'), - network.bind('wifi'), - networkLabel.bind('value'), - truncation.bind('value'), - truncation_size.bind('value'), - ], - (pmry, wfi, showLbl, trunc, tSize) => { - if (!showLbl) { - return Widget.Box(); - } - if (pmry === 'wired') { - return Widget.Label({ - class_name: 'bar-button-label network-label', - label: 'Wired'.substring(0, tSize), - }); - } - return Widget.Label({ - class_name: 'bar-button-label network-label', - label: wfi.ssid ? `${trunc ? wfi.ssid.substring(0, tSize) : wfi.ssid}` : '--', - }); - }, - ), - }), - ], - }), - isVisible: true, - boxClass: 'network', - props: { - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'networkmenu'); - }, - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - }, - }; -}; - -export { Network }; diff --git a/ags/HyprPanel/modules/bar/notifications/index.ts b/ags/HyprPanel/modules/bar/notifications/index.ts deleted file mode 100644 index f0e721d..0000000 --- a/ags/HyprPanel/modules/bar/notifications/index.ts +++ /dev/null @@ -1,94 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -import { openMenu } from '../utils.js'; -import options from 'options'; -import { filterNotifications } from 'lib/shared/notifications.js'; -import { BarBoxChild } from 'lib/types/bar.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { show_total, rightClick, middleClick, scrollUp, scrollDown, hideCountWhenZero } = options.bar.notifications; -const { ignore } = options.notifications; - -const notifs = await Service.import('notifications'); - -export const Notifications = (): BarBoxChild => { - return { - component: Widget.Box({ - hpack: 'start', - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), show_total.bind('value')], - (style, showTotal) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `notifications-container ${styleMap[style]} ${!showTotal ? 'no-label' : ''}`; - }, - ), - child: Widget.Box({ - hpack: 'start', - class_name: 'bar-notifications', - children: Utils.merge( - [ - notifs.bind('notifications'), - notifs.bind('dnd'), - show_total.bind('value'), - ignore.bind('value'), - hideCountWhenZero.bind('value'), - ], - (notif, dnd, showTotal, ignoredNotifs, hideCountForZero) => { - const filteredNotifications = filterNotifications(notif, ignoredNotifs); - - const notifIcon = Widget.Label({ - hpack: 'center', - class_name: 'bar-button-icon notifications txt-icon bar', - label: dnd ? '󰂛' : filteredNotifications.length > 0 ? '󱅫' : '󰂚', - }); - - const notifLabel = Widget.Label({ - hpack: 'center', - class_name: 'bar-button-label notifications', - label: filteredNotifications.length.toString(), - }); - - if (showTotal) { - if (hideCountForZero && filteredNotifications.length === 0) { - return [notifIcon]; - } - return [notifIcon, notifLabel]; - } - return [notifIcon]; - }, - ), - }), - }), - isVisible: true, - boxClass: 'notifications', - props: { - on_primary_click: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'notificationsmenu'); - }, - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - }, - }; -}; diff --git a/ags/HyprPanel/modules/bar/systray/index.ts b/ags/HyprPanel/modules/bar/systray/index.ts deleted file mode 100644 index b6fece3..0000000 --- a/ags/HyprPanel/modules/bar/systray/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -import { BarBoxChild, SelfButton } from 'lib/types/bar'; -import { Notify } from 'lib/utils'; -const systemtray = await Service.import('systemtray'); -import options from 'options'; - -const { ignore } = options.bar.systray; - -const SysTray = (): BarBoxChild => { - const isVis = Variable(false); - - const items = Utils.merge([systemtray.bind('items'), ignore.bind('value')], (items, ignored) => { - const filteredTray = items.filter(({ id }) => !ignored.includes(id)); - - isVis.value = filteredTray.length > 0; - - return filteredTray.map((item) => { - return Widget.Button({ - cursor: 'pointer', - child: Widget.Icon({ - class_name: 'systray-icon', - icon: item.bind('icon'), - }), - on_primary_click: (_: SelfButton, event: Gdk.Event) => item.activate(event), - on_secondary_click: (_, event) => item.openMenu(event), - onMiddleClick: () => Notify({ summary: 'App Name', body: item.id }), - tooltip_markup: item.bind('tooltip_markup'), - }); - }); - }); - - return { - component: Widget.Box({ - class_name: 'systray-container', - children: items, - }), - isVisible: true, - boxClass: 'systray', - isVis, - props: {}, - }; -}; - -export { SysTray }; diff --git a/ags/HyprPanel/modules/bar/utils.ts b/ags/HyprPanel/modules/bar/utils.ts deleted file mode 100644 index f2f545a..0000000 --- a/ags/HyprPanel/modules/bar/utils.ts +++ /dev/null @@ -1,56 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -import { Attribute, Child } from 'lib/types/widget'; -import { calculateMenuPosition } from 'modules/menus/shared/dropdown/locationHandler/index'; -import Button from 'types/widgets/button'; - -export const closeAllMenus = (): void => { - const menuWindows = App.windows - .filter((w) => { - if (w.name) { - return /.*menu/.test(w.name); - } - - return false; - }) - .map((w) => w.name); - - menuWindows.forEach((w) => { - if (w) { - App.closeWindow(w); - } - }); -}; - -export const openMenu = async (clicked: Button, event: Gdk.Event, window: string): Promise => { - /* - * NOTE: We have to make some adjustments so the menu pops up relatively - * to the center of the button clicked. We don't want the menu to spawn - * offcenter dependending on which edge of the button you click on. - * ------------- - * To fix this, we take the x coordinate of the click within the button's bounds. - * If you click the left edge of a 100 width button, then the x axis will be 0 - * and if you click the right edge then the x axis will be 100. - * ------------- - * Then we divide the width of the button by 2 to get the center of the button and then get - * the offset by subtracting the clicked x coordinate. Then we can apply that offset - * to the x coordinate of the click relative to the screen to get the center of the - * icon click. - */ - - const middleOfButton = Math.floor(clicked.get_allocated_width() / 2); - const xAxisOfButtonClick = clicked.get_pointer()[0]; - const middleOffset = middleOfButton - xAxisOfButtonClick; - - const clickPos = event.get_root_coords(); - const adjustedXCoord = clickPos[1] + middleOffset; - const coords = [adjustedXCoord, clickPos[2]]; - - try { - await calculateMenuPosition(coords, window); - } catch (error) { - console.error(`Error calculating menu position: ${error}`); - } - - closeAllMenus(); - App.toggleWindow(window); -}; diff --git a/ags/HyprPanel/modules/bar/volume/index.ts b/ags/HyprPanel/modules/bar/volume/index.ts deleted file mode 100644 index e85dc52..0000000 --- a/ags/HyprPanel/modules/bar/volume/index.ts +++ /dev/null @@ -1,106 +0,0 @@ -import Gdk from 'gi://Gdk?version=3.0'; -const audio = await Service.import('audio'); -import { openMenu } from '../utils.js'; -import options from 'options'; -import { Binding } from 'lib/utils.js'; -import { VolumeIcons } from 'lib/types/volume.js'; -import { BarBoxChild } from 'lib/types/bar.js'; -import { Bind } from 'lib/types/variable.js'; -import Button from 'types/widgets/button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js'; - -const { rightClick, middleClick, scrollUp, scrollDown } = options.bar.volume; - -const Volume = (): BarBoxChild => { - const icons: VolumeIcons = { - 101: '󰕾', - 66: '󰕾', - 34: '󰖀', - 1: '󰕿', - 0: '󰝟', - }; - - const getIcon = (): Bind => { - const icon: Binding = Utils.merge( - [audio.speaker.bind('is_muted'), audio.speaker.bind('volume')], - (isMuted, vol) => { - if (isMuted) return 0; - - const foundVol = [101, 66, 34, 1, 0].find((threshold) => threshold <= vol * 100); - - if (foundVol !== undefined) { - return foundVol; - } - - return 101; - }, - ); - - return icon.as((i: number) => (i !== undefined ? icons[i] : icons[101])); - }; - - const volIcn = Widget.Label({ - hexpand: true, - label: getIcon(), - class_name: 'bar-button-icon volume txt-icon bar', - }); - - const volPct = Widget.Label({ - hexpand: true, - label: audio.speaker.bind('volume').as((v) => `${Math.round(v * 100)}%`), - class_name: 'bar-button-label volume', - }); - - return { - component: Widget.Box({ - hexpand: true, - vexpand: true, - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), options.bar.volume.label.bind('value')], - (style, showLabel) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `volume-container ${styleMap[style]} ${!showLabel ? 'no-label' : ''}`; - }, - ), - children: options.bar.volume.label.bind('value').as((showLabel) => { - if (showLabel) { - return [volIcn, volPct]; - } - return [volIcn]; - }), - }), - isVisible: true, - boxClass: 'volume', - props: { - onPrimaryClick: (clicked: Button, event: Gdk.Event): void => { - openMenu(clicked, event, 'audiomenu'); - }, - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - }, - }; -}; - -export { Volume }; diff --git a/ags/HyprPanel/modules/bar/window_title/index.ts b/ags/HyprPanel/modules/bar/window_title/index.ts deleted file mode 100644 index ddfd44b..0000000 --- a/ags/HyprPanel/modules/bar/window_title/index.ts +++ /dev/null @@ -1,241 +0,0 @@ -const hyprland = await Service.import('hyprland'); -import { BarBoxChild } from 'lib/types/bar'; -import options from 'options'; -import { Attribute, Child } from 'lib/types/widget'; -import { ActiveClient } from 'types/service/hyprland'; -import Label from 'types/widgets/label'; -import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils'; -import Button from 'types/widgets/button'; -import Gdk from 'types/@girs/gdk-3.0/gdk-3.0'; - -const { leftClick, rightClick, middleClick, scrollDown, scrollUp } = options.bar.windowtitle; - -const filterTitle = (windowtitle: ActiveClient): Record => { - const windowTitleMap = [ - // user provided values - ...options.bar.windowtitle.title_map.value, - // Original Entries - ['kitty', '󰄛', 'Kitty Terminal'], - ['firefox', '󰈹', 'Firefox'], - ['microsoft-edge', '󰇩', 'Edge'], - ['discord', '', 'Discord'], - ['vesktop', '', 'Vesktop'], - ['org.kde.dolphin', '', 'Dolphin'], - ['plex', '󰚺', 'Plex'], - ['steam', '', 'Steam'], - ['spotify', '󰓇', 'Spotify'], - ['ristretto', '󰋩', 'Ristretto'], - ['obsidian', '󱓧', 'Obsidian'], - - // Browsers - ['google-chrome', '', 'Google Chrome'], - ['brave-browser', '󰖟', 'Brave Browser'], - ['chromium', '', 'Chromium'], - ['opera', '', 'Opera'], - ['vivaldi', '󰖟', 'Vivaldi'], - ['waterfox', '󰖟', 'Waterfox'], - ['thorium', '󰖟', 'Waterfox'], - ['tor-browser', '', 'Tor Browser'], - ['floorp', '󰈹', 'Floorp'], - - // Terminals - ['gnome-terminal', '', 'GNOME Terminal'], - ['konsole', '', 'Konsole'], - ['alacritty', '', 'Alacritty'], - ['wezterm', '', 'Wezterm'], - ['foot', '󰽒', 'Foot Terminal'], - ['tilix', '', 'Tilix'], - ['xterm', '', 'XTerm'], - ['urxvt', '', 'URxvt'], - ['st', '', 'st Terminal'], - - // Development Tools - ['code', '󰨞', 'Visual Studio Code'], - ['vscode', '󰨞', 'VS Code'], - ['sublime-text', '', 'Sublime Text'], - ['atom', '', 'Atom'], - ['android-studio', '󰀴', 'Android Studio'], - ['intellij-idea', '', 'IntelliJ IDEA'], - ['pycharm', '󱃖', 'PyCharm'], - ['webstorm', '󱃖', 'WebStorm'], - ['phpstorm', '󱃖', 'PhpStorm'], - ['eclipse', '', 'Eclipse'], - ['netbeans', '', 'NetBeans'], - ['docker', '', 'Docker'], - ['vim', '', 'Vim'], - ['neovim', '', 'Neovim'], - ['neovide', '', 'Neovide'], - ['emacs', '', 'Emacs'], - - // Communication Tools - ['slack', '󰒱', 'Slack'], - ['telegram-desktop', '', 'Telegram'], - ['org.telegram.desktop', '', 'Telegram'], - ['whatsapp', '󰖣', 'WhatsApp'], - ['teams', '󰊻', 'Microsoft Teams'], - ['skype', '󰒯', 'Skype'], - ['thunderbird', '', 'Thunderbird'], - - // File Managers - ['nautilus', '󰝰', 'Files (Nautilus)'], - ['thunar', '󰝰', 'Thunar'], - ['pcmanfm', '󰝰', 'PCManFM'], - ['nemo', '󰝰', 'Nemo'], - ['ranger', '󰝰', 'Ranger'], - ['doublecmd', '󰝰', 'Double Commander'], - ['krusader', '󰝰', 'Krusader'], - - // Media Players - ['vlc', '󰕼', 'VLC Media Player'], - ['mpv', '', 'MPV'], - ['rhythmbox', '󰓃', 'Rhythmbox'], - - // Graphics Tools - ['gimp', '', 'GIMP'], - ['inkscape', '', 'Inkscape'], - ['krita', '', 'Krita'], - ['blender', '󰂫', 'Blender'], - - // Video Editing - ['kdenlive', '', 'Kdenlive'], - - // Games and Gaming Platforms - ['lutris', '󰺵', 'Lutris'], - ['heroic', '󰺵', 'Heroic Games Launcher'], - ['minecraft', '󰍳', 'Minecraft'], - ['csgo', '󰺵', 'CS:GO'], - ['dota2', '󰺵', 'Dota 2'], - - // Office and Productivity - ['evernote', '', 'Evernote'], - ['sioyek', '', 'Sioyek'], - - // Cloud Services and Sync - ['dropbox', '󰇣', 'Dropbox'], - - // Desktop - ['^$', '󰇄', 'Desktop'], - - // Fallback icon - ['(.+)', '󰣆', `${windowtitle.class.charAt(0).toUpperCase() + windowtitle.class.slice(1)}`], - ]; - - const foundMatch = windowTitleMap.find((wt) => RegExp(wt[0]).test(windowtitle.class.toLowerCase())); - - // return the default icon if no match is found or - // if the array element matched is not of size 3 - if (!foundMatch || foundMatch.length !== 3) { - return { - icon: windowTitleMap[windowTitleMap.length - 1][1], - label: windowTitleMap[windowTitleMap.length - 1][2], - }; - } - - return { - icon: foundMatch[1], - label: foundMatch[2], - }; -}; - -const getTitle = (client: ActiveClient, useCustomTitle: boolean, useClassName: boolean): string => { - if (useCustomTitle) return filterTitle(client).label; - if (useClassName) return client.class; - - const title = client.title; - // If the title is empty or only filled with spaces, fallback to the class name - if (title.length === 0 || title.match(/^ *$/)) { - return client.class; - } - return title; -}; - -const truncateTitle = (title: string, max_size: number): string => { - if (max_size > 0 && title.length > max_size) { - return title.substring(0, max_size).trim() + '...'; - } - return title; -}; - -const ClientTitle = (): BarBoxChild => { - const { custom_title, class_name, label, icon, truncation, truncation_size } = options.bar.windowtitle; - - return { - component: Widget.Box({ - className: Utils.merge( - [options.theme.bar.buttons.style.bind('value'), label.bind('value')], - (style, showLabel) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style3', - }; - return `windowtitle-container ${styleMap[style]} ${!showLabel ? 'no-label' : ''}`; - }, - ), - children: Utils.merge( - [ - hyprland.active.bind('client'), - custom_title.bind('value'), - class_name.bind('value'), - label.bind('value'), - icon.bind('value'), - truncation.bind('value'), - truncation_size.bind('value'), - ], - (client, useCustomTitle, useClassName, showLabel, showIcon, truncate, truncationSize) => { - const children: Label[] = []; - if (showIcon) { - children.push( - Widget.Label({ - class_name: 'bar-button-icon windowtitle txt-icon bar', - label: filterTitle(client).icon, - }), - ); - } - - if (showLabel) { - children.push( - Widget.Label({ - class_name: `bar-button-label windowtitle ${showIcon ? '' : 'no-icon'}`, - label: truncateTitle( - getTitle(client, useCustomTitle, useClassName), - truncate ? truncationSize : -1, - ), - }), - ); - } - - return children; - }, - ), - }), - isVisible: true, - boxClass: 'windowtitle', - props: { - setup: (self: Button): void => { - self.hook(options.bar.scrollSpeed, () => { - const throttledHandler = throttledScrollHandler(options.bar.scrollSpeed.value); - - self.on_primary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(leftClick.value, { clicked, event }); - }; - self.on_secondary_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(rightClick.value, { clicked, event }); - }; - self.on_middle_click = (clicked: Button, event: Gdk.Event): void => { - runAsyncCommand(middleClick.value, { clicked, event }); - }; - self.on_scroll_up = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollUp.value, { clicked, event }); - }; - self.on_scroll_down = (clicked: Button, event: Gdk.Event): void => { - throttledHandler(scrollDown.value, { clicked, event }); - }; - }); - }, - }, - }; -}; - -export { ClientTitle }; diff --git a/ags/HyprPanel/modules/bar/workspaces/helpers.ts b/ags/HyprPanel/modules/bar/workspaces/helpers.ts deleted file mode 100644 index daf3cb3..0000000 --- a/ags/HyprPanel/modules/bar/workspaces/helpers.ts +++ /dev/null @@ -1,162 +0,0 @@ -const hyprland = await Service.import('hyprland'); - -import { MonitorMap, WorkspaceMap, WorkspaceRule } from 'lib/types/workspace'; -import options from 'options'; -import { Variable } from 'types/variable'; - -const { workspaces, reverse_scroll, ignored } = options.bar.workspaces; - -export const getWorkspacesForMonitor = (curWs: number, wsRules: WorkspaceMap, monitor: number): boolean => { - if (!wsRules || !Object.keys(wsRules).length) { - return true; - } - - const monitorMap: MonitorMap = {}; - const workspaceMonitorList = hyprland?.workspaces?.map((m) => ({ id: m.monitorID, name: m.monitor })); - const monitors = [ - ...new Map([...workspaceMonitorList, ...hyprland.monitors].map((item) => [item.id, item])).values(), - ]; - - monitors.forEach((m) => (monitorMap[m.id] = m.name)); - - const currentMonitorName = monitorMap[monitor]; - const monitorWSRules = wsRules[currentMonitorName]; - - if (monitorWSRules === undefined) { - return true; - } - return monitorWSRules.includes(curWs); -}; - -export const getWorkspaceRules = (): WorkspaceMap => { - try { - const rules = Utils.exec('hyprctl workspacerules -j'); - - const workspaceRules: WorkspaceMap = {}; - - JSON.parse(rules).forEach((rule: WorkspaceRule) => { - const workspaceNum = parseInt(rule.workspaceString, 10); - if (isNaN(workspaceNum)) { - return; - } - if (Object.hasOwnProperty.call(workspaceRules, rule.monitor)) { - workspaceRules[rule.monitor].push(workspaceNum); - } else { - workspaceRules[rule.monitor] = [workspaceNum]; - } - }); - - return workspaceRules; - } catch (err) { - console.error(err); - return {}; - } -}; - -export const getCurrentMonitorWorkspaces = (monitor: number): number[] => { - if (hyprland.monitors.length === 1) { - return Array.from({ length: workspaces.value }, (_, i) => i + 1); - } - - const monitorWorkspaces = getWorkspaceRules(); - const monitorMap: MonitorMap = {}; - hyprland.monitors.forEach((m) => (monitorMap[m.id] = m.name)); - - const currentMonitorName = monitorMap[monitor]; - - return monitorWorkspaces[currentMonitorName]; -}; - -type ThrottledScrollHandlers = { - throttledScrollUp: () => void; - throttledScrollDown: () => void; -}; - -export const isWorkspaceIgnored = (ignoredWorkspaces: Variable, workspaceNumber: number): boolean => { - if (ignoredWorkspaces.value === '') return false; - - const ignoredWsRegex = new RegExp(ignoredWorkspaces.value); - - return ignoredWsRegex.test(workspaceNumber.toString()); -}; - -const navigateWorkspace = ( - direction: 'next' | 'prev', - currentMonitorWorkspaces: Variable, - activeWorkspaces: boolean, - ignoredWorkspaces: Variable, -): void => { - const workspacesList = activeWorkspaces - ? hyprland.workspaces.filter((ws) => hyprland.active.monitor.id === ws.monitorID).map((ws) => ws.id) - : currentMonitorWorkspaces.value || Array.from({ length: workspaces.value }, (_, i) => i + 1); - - if (workspacesList.length === 0) return; - - const currentIndex = workspacesList.indexOf(hyprland.active.workspace.id); - const step = direction === 'next' ? 1 : -1; - let newIndex = (currentIndex + step + workspacesList.length) % workspacesList.length; - let attempts = 0; - - while (attempts < workspacesList.length) { - const targetWS = workspacesList[newIndex]; - if (!isWorkspaceIgnored(ignoredWorkspaces, targetWS)) { - hyprland.messageAsync(`dispatch workspace ${targetWS}`); - return; - } - newIndex = (newIndex + step + workspacesList.length) % workspacesList.length; - attempts++; - } -}; - -export const goToNextWS = ( - currentMonitorWorkspaces: Variable, - activeWorkspaces: boolean, - ignoredWorkspaces: Variable, -): void => { - navigateWorkspace('next', currentMonitorWorkspaces, activeWorkspaces, ignoredWorkspaces); -}; - -export const goToPrevWS = ( - currentMonitorWorkspaces: Variable, - activeWorkspaces: boolean, - ignoredWorkspaces: Variable, -): void => { - navigateWorkspace('prev', currentMonitorWorkspaces, activeWorkspaces, ignoredWorkspaces); -}; - -export function throttle void>(func: T, limit: number): T { - let inThrottle: boolean; - return function (this: ThisParameterType, ...args: Parameters) { - if (!inThrottle) { - func.apply(this, args); - inThrottle = true; - setTimeout(() => { - inThrottle = false; - }, limit); - } - } as T; -} - -export const createThrottledScrollHandlers = ( - scrollSpeed: number, - currentMonitorWorkspaces: Variable, - activeWorkspaces: boolean = false, -): ThrottledScrollHandlers => { - const throttledScrollUp = throttle(() => { - if (reverse_scroll.value) { - goToPrevWS(currentMonitorWorkspaces, activeWorkspaces, ignored); - } else { - goToNextWS(currentMonitorWorkspaces, activeWorkspaces, ignored); - } - }, 200 / scrollSpeed); - - const throttledScrollDown = throttle(() => { - if (reverse_scroll.value) { - goToNextWS(currentMonitorWorkspaces, activeWorkspaces, ignored); - } else { - goToPrevWS(currentMonitorWorkspaces, activeWorkspaces, ignored); - } - }, 200 / scrollSpeed); - - return { throttledScrollUp, throttledScrollDown }; -}; diff --git a/ags/HyprPanel/modules/bar/workspaces/index.ts b/ags/HyprPanel/modules/bar/workspaces/index.ts deleted file mode 100644 index c95e212..0000000 --- a/ags/HyprPanel/modules/bar/workspaces/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import options from 'options'; -import { createThrottledScrollHandlers, getCurrentMonitorWorkspaces } from './helpers'; -import { BarBoxChild, SelfButton } from 'lib/types/bar'; -import { occupiedWses } from './variants/occupied'; -import { defaultWses } from './variants/default'; - -const { workspaces, scroll_speed } = options.bar.workspaces; - -const Workspaces = (monitor = -1): BarBoxChild => { - const currentMonitorWorkspaces = Variable(getCurrentMonitorWorkspaces(monitor)); - - workspaces.connect('changed', () => { - currentMonitorWorkspaces.value = getCurrentMonitorWorkspaces(monitor); - }); - - return { - component: Widget.Box({ - class_name: 'workspaces-box-container', - child: options.bar.workspaces.hideUnoccupied.bind('value').as((hideUnoccupied) => { - return hideUnoccupied ? occupiedWses(monitor) : defaultWses(monitor); - }), - }), - isVisible: true, - boxClass: 'workspaces', - props: { - setup: (self: SelfButton): void => { - Utils.merge( - [scroll_speed.bind('value'), options.bar.workspaces.hideUnoccupied.bind('value')], - (scroll_speed, hideUnoccupied) => { - const { throttledScrollUp, throttledScrollDown } = createThrottledScrollHandlers( - scroll_speed, - currentMonitorWorkspaces, - hideUnoccupied, - ); - self.on_scroll_up = throttledScrollUp; - self.on_scroll_down = throttledScrollDown; - }, - ); - }, - }, - }; -}; - -export { Workspaces }; diff --git a/ags/HyprPanel/modules/bar/workspaces/utils.ts b/ags/HyprPanel/modules/bar/workspaces/utils.ts deleted file mode 100644 index c9f2bc2..0000000 --- a/ags/HyprPanel/modules/bar/workspaces/utils.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { WorkspaceIconMap } from 'lib/types/workspace'; -import { isValidGjsColor } from 'lib/utils'; -import options from 'options'; -import { Monitor } from 'types/service/hyprland'; - -const hyprland = await Service.import('hyprland'); - -const { monochrome, background } = options.theme.bar.buttons; -const { background: wsBackground, active } = options.theme.bar.buttons.workspaces; - -const { showWsIcons, showAllActive, numbered_active_indicator: activeIndicator } = options.bar.workspaces; - -const isWorkspaceActiveOnMonitor = (monitor: number, monitors: Monitor[], i: number): boolean => { - return showAllActive.value && monitors[monitor]?.activeWorkspace?.id === i; -}; - -const getWsIcon = (wsIconMap: WorkspaceIconMap, i: number): string => { - const iconEntry = wsIconMap[i]; - - if (!iconEntry) { - return `${i}`; - } - - const hasIcon = typeof iconEntry === 'object' && 'icon' in iconEntry && iconEntry.icon !== ''; - - if (typeof iconEntry === 'string' && iconEntry !== '') { - return iconEntry; - } - - if (hasIcon) { - return iconEntry.icon; - } - - return `${i}`; -}; - -export const getWsColor = ( - wsIconMap: WorkspaceIconMap, - i: number, - smartHighlight: boolean, - monitor: number, - monitors: Monitor[], -): string => { - const iconEntry = wsIconMap[i]; - const hasColor = typeof iconEntry === 'object' && 'color' in iconEntry && isValidGjsColor(iconEntry.color); - if (!iconEntry) { - return ''; - } - - if ( - showWsIcons.value && - smartHighlight && - activeIndicator.value === 'highlight' && - (hyprland.active.workspace.id === i || isWorkspaceActiveOnMonitor(monitor, monitors, i)) - ) { - const iconColor = monochrome.value ? background : wsBackground; - const iconBackground = hasColor && isValidGjsColor(iconEntry.color) ? iconEntry.color : active.value; - const colorCss = `color: ${iconColor};`; - const backgroundCss = `background: ${iconBackground};`; - - return colorCss + backgroundCss; - } - - if (hasColor && isValidGjsColor(iconEntry.color)) { - return `color: ${iconEntry.color}; border-bottom-color: ${iconEntry.color};`; - } - - return ''; -}; - -export const renderClassnames = ( - showIcons: boolean, - showNumbered: boolean, - numberedActiveIndicator: string, - showWsIcons: boolean, - smartHighlight: boolean, - monitor: number, - monitors: Monitor[], - i: number, -): string => { - if (showIcons) { - return 'workspace-icon txt-icon bar'; - } - - if (showNumbered || showWsIcons) { - const numActiveInd = - hyprland.active.workspace.id === i || isWorkspaceActiveOnMonitor(monitor, monitors, i) - ? numberedActiveIndicator - : ''; - - const wsIconClass = showWsIcons ? 'txt-icon' : ''; - const smartHighlightClass = smartHighlight ? 'smart-highlight' : ''; - - const className = `workspace-number can_${numberedActiveIndicator} ${numActiveInd} ${wsIconClass} ${smartHighlightClass}`; - - return className.trim(); - } - - return 'default'; -}; - -export const renderLabel = ( - showIcons: boolean, - available: string, - active: string, - occupied: string, - workspaceMask: boolean, - showWsIcons: boolean, - wsIconMap: WorkspaceIconMap, - i: number, - index: number, - monitor: number, - monitors: Monitor[], -): string => { - if (showIcons) { - if (hyprland.active.workspace.id === i || isWorkspaceActiveOnMonitor(monitor, monitors, i)) { - return active; - } - if ((hyprland.getWorkspace(i)?.windows || 0) > 0) { - return occupied; - } - if (monitor !== -1) { - return available; - } - } - if (showWsIcons) { - return getWsIcon(wsIconMap, i); - } - return workspaceMask ? `${index + 1}` : `${i}`; -}; diff --git a/ags/HyprPanel/modules/bar/workspaces/variants/default.ts b/ags/HyprPanel/modules/bar/workspaces/variants/default.ts deleted file mode 100644 index dddabc9..0000000 --- a/ags/HyprPanel/modules/bar/workspaces/variants/default.ts +++ /dev/null @@ -1,141 +0,0 @@ -const hyprland = await Service.import('hyprland'); -import options from 'options'; -import { getWorkspaceRules, getWorkspacesForMonitor, isWorkspaceIgnored } from '../helpers'; -import { range } from 'lib/utils'; -import { BoxWidget } from 'lib/types/widget'; -import { getWsColor, renderClassnames, renderLabel } from '../utils'; -import { WorkspaceIconMap } from 'lib/types/workspace'; -import { Monitor } from 'types/service/hyprland'; - -const { workspaces, monitorSpecific, workspaceMask, spacing, ignored } = options.bar.workspaces; -export const defaultWses = (monitor: number): BoxWidget => { - return Widget.Box({ - children: Utils.merge( - [workspaces.bind('value'), monitorSpecific.bind('value'), ignored.bind('value')], - (workspaces: number, monitorSpecific: boolean) => { - return range(workspaces || 8) - .filter((workspaceNumber) => { - if (!monitorSpecific) { - return true; - } - const workspaceRules = getWorkspaceRules(); - return ( - getWorkspacesForMonitor(workspaceNumber, workspaceRules, monitor) && - !isWorkspaceIgnored(ignored, workspaceNumber) - ); - }) - .sort((a, b) => { - return a - b; - }) - .map((i, index) => { - return Widget.Button({ - class_name: 'workspace-button', - on_primary_click: () => { - hyprland.messageAsync(`dispatch workspace ${i}`); - }, - child: Widget.Label({ - attribute: i, - vpack: 'center', - css: Utils.merge( - [ - spacing.bind('value'), - options.bar.workspaces.showWsIcons.bind('value'), - options.bar.workspaces.workspaceIconMap.bind('value'), - options.theme.matugen.bind('value'), - options.theme.bar.buttons.workspaces.smartHighlight.bind('value'), - hyprland.bind('monitors'), - ], - ( - sp: number, - showWsIcons: boolean, - workspaceIconMap: WorkspaceIconMap, - matugen: boolean, - smartHighlight: boolean, - monitors: Monitor[], - ) => { - return ( - `margin: 0rem ${0.375 * sp}rem;` + - `${showWsIcons && !matugen ? getWsColor(workspaceIconMap, i, smartHighlight, monitor, monitors) : ''}` - ); - }, - ), - class_name: Utils.merge( - [ - options.bar.workspaces.show_icons.bind('value'), - options.bar.workspaces.show_numbered.bind('value'), - options.bar.workspaces.numbered_active_indicator.bind('value'), - options.bar.workspaces.showWsIcons.bind('value'), - options.theme.bar.buttons.workspaces.smartHighlight.bind('value'), - hyprland.bind('monitors'), - options.bar.workspaces.icons.available.bind('value'), - options.bar.workspaces.icons.active.bind('value'), - ], - ( - showIcons: boolean, - showNumbered: boolean, - numberedActiveIndicator: string, - showWsIcons: boolean, - smartHighlight: boolean, - monitors: Monitor[], - ) => { - return renderClassnames( - showIcons, - showNumbered, - numberedActiveIndicator, - showWsIcons, - smartHighlight, - monitor, - monitors, - i, - ); - }, - ), - label: Utils.merge( - [ - options.bar.workspaces.show_icons.bind('value'), - options.bar.workspaces.icons.available.bind('value'), - options.bar.workspaces.icons.active.bind('value'), - options.bar.workspaces.icons.occupied.bind('value'), - options.bar.workspaces.workspaceIconMap.bind('value'), - options.bar.workspaces.showWsIcons.bind('value'), - workspaceMask.bind('value'), - hyprland.bind('monitors'), - ], - ( - showIcons: boolean, - available: string, - active: string, - occupied: string, - wsIconMap: WorkspaceIconMap, - showWsIcons: boolean, - workspaceMask: boolean, - monitors: Monitor[], - ) => { - return renderLabel( - showIcons, - available, - active, - occupied, - workspaceMask, - showWsIcons, - wsIconMap, - i, - index, - monitor, - monitors, - ); - }, - ), - setup: (self) => { - self.hook(hyprland, () => { - self.toggleClassName('active', hyprland.active.workspace.id === i); - self.toggleClassName('occupied', (hyprland.getWorkspace(i)?.windows || 0) > 0); - }); - }, - }), - }); - }); - }, - ), - }); -}; diff --git a/ags/HyprPanel/modules/bar/workspaces/variants/occupied.ts b/ags/HyprPanel/modules/bar/workspaces/variants/occupied.ts deleted file mode 100644 index 31f3f14..0000000 --- a/ags/HyprPanel/modules/bar/workspaces/variants/occupied.ts +++ /dev/null @@ -1,145 +0,0 @@ -const hyprland = await Service.import('hyprland'); -import options from 'options'; -import { getWorkspaceRules, getWorkspacesForMonitor, isWorkspaceIgnored } from '../helpers'; -import { Monitor, Workspace } from 'types/service/hyprland'; -import { getWsColor, renderClassnames, renderLabel } from '../utils'; -import { range } from 'lib/utils'; -import { BoxWidget } from 'lib/types/widget'; -import { WorkspaceIconMap } from 'lib/types/workspace'; - -const { workspaces, monitorSpecific, workspaceMask, spacing, ignored, showAllActive } = options.bar.workspaces; - -export const occupiedWses = (monitor: number): BoxWidget => { - return Widget.Box({ - children: Utils.merge( - [ - monitorSpecific.bind('value'), - hyprland.bind('workspaces'), - workspaceMask.bind('value'), - workspaces.bind('value'), - options.bar.workspaces.show_icons.bind('value'), - options.bar.workspaces.icons.available.bind('value'), - options.bar.workspaces.icons.active.bind('value'), - options.bar.workspaces.icons.occupied.bind('value'), - options.bar.workspaces.show_numbered.bind('value'), - options.bar.workspaces.numbered_active_indicator.bind('value'), - spacing.bind('value'), - options.bar.workspaces.workspaceIconMap.bind('value'), - options.bar.workspaces.showWsIcons.bind('value'), - options.theme.matugen.bind('value'), - options.theme.bar.buttons.workspaces.smartHighlight.bind('value'), - hyprland.bind('monitors'), - ignored.bind('value'), - showAllActive.bind('value'), - ], - ( - monitorSpecific: boolean, - wkSpaces: Workspace[], - workspaceMask: boolean, - totalWkspcs: number, - showIcons: boolean, - available: string, - active: string, - occupied: string, - showNumbered: boolean, - numberedActiveIndicator: string, - spacing: number, - wsIconMap: WorkspaceIconMap, - showWsIcons: boolean, - matugen: boolean, - smartHighlight: boolean, - monitors: Monitor[], - ) => { - const activeId = hyprland.active.workspace.id; - let allWkspcs = range(totalWkspcs || 8); - - const activeWorkspaces = wkSpaces.map((w) => w.id); - const workspaceRules = getWorkspaceRules(); - - // Sometimes hyprland doesn't have all the monitors in the list - // so we complement it with monitors from the workspace list - const workspaceMonitorList = hyprland?.workspaces?.map((m) => ({ - id: m.monitorID, - name: m.monitor, - })); - const curMonitor = - hyprland.monitors.find((m) => m.id === monitor) || - workspaceMonitorList.find((m) => m.id === monitor); - - const workspacesWithRules = Object.keys(workspaceRules).reduce((acc: number[], k: string) => { - return [...acc, ...workspaceRules[k]]; - }, [] as number[]); - - const activesForMonitor = activeWorkspaces.filter((w) => { - if ( - curMonitor && - Object.hasOwnProperty.call(workspaceRules, curMonitor.name) && - workspacesWithRules.includes(w) - ) { - return workspaceRules[curMonitor.name].includes(w); - } - return true; - }); - - if (monitorSpecific) { - const wrkspcsInRange = range(totalWkspcs).filter((w) => { - return getWorkspacesForMonitor(w, workspaceRules, monitor); - }); - allWkspcs = [...new Set([...activesForMonitor, ...wrkspcsInRange])]; - } else { - allWkspcs = [...new Set([...allWkspcs, ...activeWorkspaces])]; - } - - return allWkspcs - .sort((a, b) => { - return a - b; - }) - .map((i, index) => { - if (isWorkspaceIgnored(ignored, i)) { - return Widget.Box(); - } - return Widget.Button({ - class_name: 'workspace-button', - on_primary_click: () => { - hyprland.messageAsync(`dispatch workspace ${i}`); - }, - child: Widget.Label({ - attribute: i, - vpack: 'center', - css: - `margin: 0rem ${0.375 * spacing}rem;` + - `${showWsIcons && !matugen ? getWsColor(wsIconMap, i, smartHighlight, monitor, monitors) : ''}`, - class_name: renderClassnames( - showIcons, - showNumbered, - numberedActiveIndicator, - showWsIcons, - smartHighlight, - monitor, - monitors, - i, - ), - label: renderLabel( - showIcons, - available, - active, - occupied, - workspaceMask, - showWsIcons, - wsIconMap, - i, - index, - monitor, - monitors, - ), - setup: (self) => { - self.toggleClassName('active', activeId === i); - self.toggleClassName('occupied', (hyprland.getWorkspace(i)?.windows || 0) > 0); - }, - }), - }); - }); - }, - ), - }); -}; diff --git a/ags/HyprPanel/modules/icons/index.ts b/ags/HyprPanel/modules/icons/index.ts deleted file mode 100644 index 14d0a06..0000000 --- a/ags/HyprPanel/modules/icons/index.ts +++ /dev/null @@ -1,199 +0,0 @@ -export const substitutes = { - 'transmission-gtk': 'transmission', - 'blueberry.py': 'blueberry', - Caprine: 'facebook-messenger', - 'com.raggesilver.BlackBox-symbolic': 'terminal-symbolic', - 'org.wezfurlong.wezterm-symbolic': 'terminal-symbolic', - 'audio-headset-bluetooth': 'audio-headphones-symbolic', - 'audio-card-analog-usb': 'audio-speakers-symbolic', - 'audio-card-analog-pci': 'audio-card-symbolic', - 'preferences-system': 'emblem-system-symbolic', - 'com.github.Aylur.ags-symbolic': 'controls-symbolic', - 'com.github.Aylur.ags': 'controls-symbolic', -}; - -export default { - missing: 'image-missing-symbolic', - nix: { - nix: 'nix-snowflake-symbolic', - }, - app: { - terminal: 'terminal-symbolic', - }, - fallback: { - executable: 'application-x-executable', - notification: 'dialog-information-symbolic', - video: 'video-x-generic-symbolic', - audio: 'audio-x-generic-symbolic', - }, - ui: { - close: 'window-close-symbolic', - colorpicker: 'color-select-symbolic', - info: 'info-symbolic', - link: 'external-link-symbolic', - lock: 'system-lock-screen-symbolic', - menu: 'open-menu-symbolic', - refresh: 'view-refresh-symbolic', - search: 'system-search-symbolic', - settings: 'emblem-system-symbolic', - themes: 'preferences-desktop-theme-symbolic', - tick: 'object-select-symbolic', - time: 'hourglass-symbolic', - toolbars: 'toolbars-symbolic', - warning: 'dialog-warning-symbolic', - avatar: 'avatar-default-symbolic', - arrow: { - right: 'pan-end-symbolic', - left: 'pan-start-symbolic', - down: 'pan-down-symbolic', - up: 'pan-up-symbolic', - }, - }, - audio: { - mic: { - muted: 'microphone-disabled-symbolic', - low: 'microphone-sensitivity-low-symbolic', - medium: 'microphone-sensitivity-medium-symbolic', - high: 'microphone-sensitivity-high-symbolic', - }, - volume: { - muted: 'audio-volume-muted-symbolic', - low: 'audio-volume-low-symbolic', - medium: 'audio-volume-medium-symbolic', - high: 'audio-volume-high-symbolic', - overamplified: 'audio-volume-overamplified-symbolic', - }, - type: { - headset: 'audio-headphones-symbolic', - speaker: 'audio-speakers-symbolic', - card: 'audio-card-symbolic', - }, - mixer: 'mixer-symbolic', - }, - powerprofile: { - balanced: 'power-profile-balanced-symbolic', - 'power-saver': 'power-profile-power-saver-symbolic', - performance: 'power-profile-performance-symbolic', - }, - asusctl: { - profile: { - Balanced: 'power-profile-balanced-symbolic', - Quiet: 'power-profile-power-saver-symbolic', - Performance: 'power-profile-performance-symbolic', - }, - mode: { - Integrated: 'processor-symbolic', - Hybrid: 'controller-symbolic', - }, - }, - battery: { - charging: 'battery-flash-symbolic', - warning: 'battery-empty-symbolic', - }, - bluetooth: { - enabled: 'bluetooth-active-symbolic', - disabled: 'bluetooth-disabled-symbolic', - }, - brightness: { - indicator: 'display-brightness-symbolic', - keyboard: 'keyboard-brightness-symbolic', - screen: 'display-brightness-symbolic', - }, - powermenu: { - sleep: 'weather-clear-night-symbolic', - reboot: 'system-reboot-symbolic', - logout: 'system-log-out-symbolic', - shutdown: 'system-shutdown-symbolic', - }, - recorder: { - recording: 'media-record-symbolic', - }, - notifications: { - noisy: 'org.gnome.Settings-notifications-symbolic', - silent: 'notifications-disabled-symbolic', - message: 'chat-bubbles-symbolic', - }, - trash: { - full: 'user-trash-full-symbolic', - empty: 'user-trash-symbolic', - }, - mpris: { - shuffle: { - enabled: 'media-playlist-shuffle-symbolic', - disabled: 'media-playlist-consecutive-symbolic', - }, - loop: { - none: 'media-playlist-repeat-symbolic', - track: 'media-playlist-repeat-song-symbolic', - playlist: 'media-playlist-repeat-symbolic', - }, - playing: 'media-playback-pause-symbolic', - paused: 'media-playback-start-symbolic', - stopped: 'media-playback-start-symbolic', - prev: 'media-skip-backward-symbolic', - next: 'media-skip-forward-symbolic', - }, - system: { - cpu: 'org.gnome.SystemMonitor-symbolic', - ram: 'drive-harddisk-solidstate-symbolic', - temp: 'temperature-symbolic', - }, - color: { - dark: 'dark-mode-symbolic', - light: 'light-mode-symbolic', - }, - weather: { - warning: 'dialog-warning-symbolic', - sunny: 'weather-clear-symbolic', - clear: 'weather-clear-night-symbolic', - partly_cloudy: 'weather-few-clouds-symbolic', - partly_cloudy_night: 'weather-few-clouds-night-symbolic', - cloudy: 'weather-overcast-symbolic', - overcast: 'weather-overcast-symbolic', - mist: 'weather-overcast-symbolic', - patchy_rain_nearby: 'weather-showers-scattered-symbolic', - patchy_rain_possible: 'weather-showers-scattered-symbolic', - patchy_snow_possible: 'weather-snow-symbolic', - patchy_sleet_possible: 'weather-snow-symbolic', - patchy_freezing_drizzle_possible: 'weather-showers-scattered-symbolic', - thundery_outbreaks_possible: 'weather-overcast-symbolic', - blowing_snow: 'weather-snow-symbolic', - blizzard: 'weather-snow-symbolic', - fog: 'weather-fog-symbolic', - freezing_fog: 'weather-fog-symbolic', - patchy_light_drizzle: 'weather-showers-scattered-symbolic', - light_drizzle: 'weather-showers-symbolic', - freezing_drizzle: 'weather-showers-symbolic', - heavy_freezing_drizzle: 'weather-showers-symbolic', - patchy_light_rain: 'weather-showers-scattered-symbolic', - light_rain: 'weather-showers-symbolic', - moderate_rain_at_times: 'weather-showers-symbolic', - moderate_rain: 'weather-showers-symbolic', - heavy_rain_at_times: 'weather-showers-symbolic', - heavy_rain: 'weather-showers-symbolic', - light_freezing_rain: 'weather-showers-symbolic', - moderate_or_heavy_freezing_rain: 'weather-showers-symbolic', - light_sleet: 'weather-snow-symbolic', - moderate_or_heavy_sleet: 'weather-snow-symbolic', - patchy_light_snow: 'weather-snow-symbolic', - light_snow: 'weather-snow-symbolic', - patchy_moderate_snow: 'weather-snow-symbolic', - moderate_snow: 'weather-snow-symbolic', - patchy_heavy_snow: 'weather-snow-symbolic', - heavy_snow: 'weather-snow-symbolic', - ice_pellets: 'weather-showers-symbolic', - light_rain_shower: 'weather-showers-symbolic', - moderate_or_heavy_rain_shower: 'weather-showers-symbolic', - torrential_rain_shower: 'weather-showers-symbolic', - light_sleet_showers: 'weather-showers-symbolic', - moderate_or_heavy_sleet_showers: 'weather-showers-symbolic', - light_snow_showers: 'weather-snow-symbolic', - moderate_or_heavy_snow_showers: 'weather-snow-symbolic', - light_showers_of_ice_pellets: 'weather-showers-symbolic', - moderate_or_heavy_showers_of_ice_pellets: 'weather-showers-symbolic', - patchy_light_rain_with_thunder: 'weather-showers-scattered-symbolic', - moderate_or_heavy_rain_with_thunder: 'weather-showers-symbolic', - patchy_light_snow_with_thunder: 'weather-snow-symbolic', - moderate_or_heavy_snow_with_thunder: 'weather-snow-symbolic', - }, -} as const; diff --git a/ags/HyprPanel/modules/icons/weather.ts b/ags/HyprPanel/modules/icons/weather.ts deleted file mode 100644 index 90980a0..0000000 --- a/ags/HyprPanel/modules/icons/weather.ts +++ /dev/null @@ -1,54 +0,0 @@ -export const weatherIcons = { - warning: '󰼯', - sunny: '󰖙', - clear: '󰖔', - partly_cloudy: '󰖕', - partly_cloudy_night: '󰼱', - cloudy: '󰖐', - overcast: '󰖕', - mist: '󰖑', - patchy_rain_nearby: '󰼳', - patchy_rain_possible: '󰼳', - patchy_snow_possible: '󰼴', - patchy_sleet_possible: '󰙿', - patchy_freezing_drizzle_possible: '󰙿', - thundery_outbreaks_possible: '󰙾', - blowing_snow: '󰼶', - blizzard: '󰼶', - fog: '󰖑', - freezing_fog: '󰖑', - patchy_light_drizzle: '󰼳', - light_drizzle: '󰼳', - freezing_drizzle: '󰙿', - heavy_freezing_drizzle: '󰙿', - patchy_light_rain: '󰼳', - light_rain: '󰼳', - moderate_rain_at_times: '󰖗', - moderate_rain: '󰼳', - heavy_rain_at_times: '󰖖', - heavy_rain: '󰖖', - light_freezing_rain: '󰙿', - moderate_or_heavy_freezing_rain: '󰙿', - light_sleet: '󰙿', - moderate_or_heavy_sleet: '󰙿', - patchy_light_snow: '󰼴', - light_snow: '󰼴', - patchy_moderate_snow: '󰼴', - moderate_snow: '󰼶', - patchy_heavy_snow: '󰼶', - heavy_snow: '󰼶', - ice_pellets: '󰖒', - light_rain_shower: '󰖖', - moderate_or_heavy_rain_shower: '󰖖', - torrential_rain_shower: '󰖖', - light_sleet_showers: '󰼵', - moderate_or_heavy_sleet_showers: '󰼵', - light_snow_showers: '󰼵', - moderate_or_heavy_snow_showers: '󰼵', - light_showers_of_ice_pellets: '󰖒', - moderate_or_heavy_showers_of_ice_pellets: '󰖒', - patchy_light_rain_with_thunder: '󰙾', - moderate_or_heavy_rain_with_thunder: '󰙾', - patchy_light_snow_with_thunder: '󰼶', - moderate_or_heavy_snow_with_thunder: '󰼶', -} as const; diff --git a/ags/HyprPanel/modules/menus/audio/active/SelectedInput.ts b/ags/HyprPanel/modules/menus/audio/active/SelectedInput.ts deleted file mode 100644 index 4e3cff3..0000000 --- a/ags/HyprPanel/modules/menus/audio/active/SelectedInput.ts +++ /dev/null @@ -1,75 +0,0 @@ -const audio = await Service.import('audio'); -import { getIcon } from '../utils.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const renderActiveInput = (): Box[] => { - return [ - Widget.Box({ - class_name: 'menu-slider-container input', - children: [ - Widget.Button({ - vexpand: false, - vpack: 'end', - setup: (self) => { - const updateClass = (): void => { - const mic = audio.microphone; - const className = `menu-active-button input ${mic.is_muted ? 'muted' : ''}`; - self.class_name = className; - }; - - self.hook(audio.microphone, updateClass, 'notify::is-muted'); - }, - on_primary_click: () => (audio.microphone.is_muted = !audio.microphone.is_muted), - child: Widget.Icon({ - class_name: 'menu-active-icon input', - setup: (self) => { - const updateIcon = (): void => { - const isMicMuted = - audio.microphone.is_muted !== null ? audio.microphone.is_muted : true; - - if (audio.microphone.volume > 0) { - self.icon = getIcon(audio.microphone.volume, isMicMuted)['mic']; - } else { - self.icon = getIcon(100, true)['mic']; - } - }; - self.hook(audio.microphone, updateIcon, 'notify::volume'); - self.hook(audio.microphone, updateIcon, 'notify::is-muted'); - }, - }), - }), - Widget.Box({ - vertical: true, - children: [ - Widget.Label({ - class_name: 'menu-active input', - hpack: 'start', - truncate: 'end', - wrap: true, - label: audio.bind('microphone').as((v) => { - return v.description === null ? 'No input device found...' : v.description; - }), - }), - Widget.Slider({ - value: audio.microphone.bind('volume').as((v) => v), - class_name: 'menu-active-slider menu-slider inputs', - draw_value: false, - hexpand: true, - min: 0, - max: 1, - onChange: ({ value }) => (audio.microphone.volume = value), - }), - ], - }), - Widget.Label({ - class_name: 'menu-active-percentage input', - vpack: 'end', - label: audio.microphone.bind('volume').as((v) => `${Math.round(v * 100)}%`), - }), - ], - }), - ]; -}; - -export { renderActiveInput }; diff --git a/ags/HyprPanel/modules/menus/audio/active/SelectedPlayback.ts b/ags/HyprPanel/modules/menus/audio/active/SelectedPlayback.ts deleted file mode 100644 index 29e5afd..0000000 --- a/ags/HyprPanel/modules/menus/audio/active/SelectedPlayback.ts +++ /dev/null @@ -1,68 +0,0 @@ -const audio = await Service.import('audio'); -import { getIcon } from '../utils.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const renderActivePlayback = (): Box[] => { - return [ - Widget.Box({ - class_name: 'menu-slider-container playback', - children: [ - Widget.Button({ - vexpand: false, - vpack: 'end', - setup: (self) => { - const updateClass = (): void => { - const spkr = audio.speaker; - const className = `menu-active-button playback ${spkr.is_muted ? 'muted' : ''}`; - self.class_name = className; - }; - - self.hook(audio.speaker, updateClass, 'notify::is-muted'); - }, - on_primary_click: () => (audio.speaker.is_muted = !audio.speaker.is_muted), - child: Widget.Icon({ - class_name: 'menu-active-icon playback', - setup: (self) => { - const updateIcon = (): void => { - const isSpeakerMuted = audio.speaker.is_muted !== null ? audio.speaker.is_muted : true; - self.icon = getIcon(audio.speaker.volume, isSpeakerMuted)['spkr']; - }; - self.hook(audio.speaker, updateIcon, 'notify::volume'); - self.hook(audio.speaker, updateIcon, 'notify::is-muted'); - }, - }), - }), - Widget.Box({ - vertical: true, - children: [ - Widget.Label({ - class_name: 'menu-active playback', - hpack: 'start', - truncate: 'end', - expand: true, - wrap: true, - label: audio.bind('speaker').as((v) => v.description || ''), - }), - Widget.Slider({ - value: audio['speaker'].bind('volume'), - class_name: 'menu-active-slider menu-slider playback', - draw_value: false, - hexpand: true, - min: 0, - max: 1, - onChange: ({ value }) => (audio.speaker.volume = value), - }), - ], - }), - Widget.Label({ - vpack: 'end', - class_name: 'menu-active-percentage playback', - label: audio.speaker.bind('volume').as((v) => `${Math.round(v * 100)}%`), - }), - ], - }), - ]; -}; - -export { renderActivePlayback }; diff --git a/ags/HyprPanel/modules/menus/audio/active/index.ts b/ags/HyprPanel/modules/menus/audio/active/index.ts deleted file mode 100644 index 9768ddb..0000000 --- a/ags/HyprPanel/modules/menus/audio/active/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { renderActiveInput } from './SelectedInput.js'; -import { renderActivePlayback } from './SelectedPlayback.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const activeDevices = (): Box => { - return Widget.Box({ - class_name: 'menu-section-container volume', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container volume selected', - hpack: 'fill', - child: Widget.Label({ - class_name: 'menu-label audio volume', - hexpand: true, - hpack: 'start', - label: 'Volume', - }), - }), - Widget.Box({ - class_name: 'menu-items-section selected', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-active-container playback', - vertical: true, - children: renderActivePlayback(), - }), - Widget.Box({ - class_name: 'menu-active-container input', - vertical: true, - children: renderActiveInput(), - }), - ], - }), - ], - }); -}; - -export { activeDevices }; diff --git a/ags/HyprPanel/modules/menus/audio/available/InputDevices.ts b/ags/HyprPanel/modules/menus/audio/available/InputDevices.ts deleted file mode 100644 index 8c75a5a..0000000 --- a/ags/HyprPanel/modules/menus/audio/available/InputDevices.ts +++ /dev/null @@ -1,66 +0,0 @@ -const audio = await Service.import('audio'); -import { InputDevices } from 'lib/types/audio'; -import { Stream } from 'types/service/audio'; - -const renderInputDevices = (inputDevices: Stream[]): InputDevices => { - if (inputDevices.length === 0) { - return [ - Widget.Button({ - class_name: `menu-unfound-button input`, - child: Widget.Box({ - children: [ - Widget.Box({ - hpack: 'start', - children: [ - Widget.Label({ - class_name: 'menu-button-name input', - label: 'No input devices found...', - }), - ], - }), - ], - }), - }), - ]; - } - return inputDevices.map((device) => { - return Widget.Button({ - on_primary_click: () => (audio.microphone = device), - class_name: `menu-button audio input ${device}`, - child: Widget.Box({ - children: [ - Widget.Box({ - hpack: 'start', - children: [ - Widget.Label({ - wrap: true, - class_name: audio.microphone - .bind('description') - .as((v) => - device.description === v - ? 'menu-button-icon active input txt-icon' - : 'menu-button-icon input txt-icon', - ), - label: '', - }), - Widget.Label({ - truncate: 'end', - wrap: true, - class_name: audio.microphone - .bind('description') - .as((v) => - device.description === v - ? 'menu-button-name active input' - : 'menu-button-name input', - ), - label: device.description, - }), - ], - }), - ], - }), - }); - }); -}; - -export { renderInputDevices }; diff --git a/ags/HyprPanel/modules/menus/audio/available/PlaybackDevices.ts b/ags/HyprPanel/modules/menus/audio/available/PlaybackDevices.ts deleted file mode 100644 index 02bc618..0000000 --- a/ags/HyprPanel/modules/menus/audio/available/PlaybackDevices.ts +++ /dev/null @@ -1,60 +0,0 @@ -const audio = await Service.import('audio'); -import { PlaybackDevices } from 'lib/types/audio'; -import { Stream } from 'types/service/audio'; - -const renderPlaybacks = (playbackDevices: Stream[]): PlaybackDevices => { - return playbackDevices.map((device) => { - if (device.description === 'Dummy Output') { - return Widget.Box({ - class_name: 'menu-unfound-button playback', - child: Widget.Box({ - children: [ - Widget.Label({ - class_name: 'menu-button-name playback', - label: 'No playback devices found...', - }), - ], - }), - }); - } - return Widget.Button({ - class_name: `menu-button audio playback ${device}`, - on_primary_click: () => (audio.speaker = device), - child: Widget.Box({ - children: [ - Widget.Box({ - hpack: 'start', - children: [ - Widget.Label({ - truncate: 'end', - wrap: true, - class_name: audio.speaker - .bind('description') - .as((v) => - device.description === v - ? 'menu-button-icon active playback txt-icon' - : 'menu-button-icon playback txt-icon', - ), - label: '', - }), - Widget.Label({ - truncate: 'end', - wrap: true, - class_name: audio.speaker - .bind('description') - .as((v) => - device.description === v - ? 'menu-button-name active playback' - : 'menu-button-name playback', - ), - label: device.description, - }), - ], - }), - ], - }), - }); - }); -}; - -export { renderPlaybacks }; diff --git a/ags/HyprPanel/modules/menus/audio/available/index.ts b/ags/HyprPanel/modules/menus/audio/available/index.ts deleted file mode 100644 index e9b0d48..0000000 --- a/ags/HyprPanel/modules/menus/audio/available/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -const audio = await Service.import('audio'); -import { BoxWidget } from 'lib/types/widget.js'; -import { renderInputDevices } from './InputDevices.js'; -import { renderPlaybacks } from './PlaybackDevices.js'; - -const availableDevices = (): BoxWidget => { - return Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-section-container playback', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container playback', - hpack: 'fill', - child: Widget.Label({ - class_name: 'menu-label audio playback', - hexpand: true, - hpack: 'start', - label: 'Playback Devices', - }), - }), - Widget.Box({ - class_name: 'menu-items-section playback', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-container playback', - vertical: true, - children: [ - Widget.Box({ - vertical: true, - children: audio.bind('speakers').as((v) => renderPlaybacks(v)), - }), - ], - }), - ], - }), - Widget.Box({ - class_name: 'menu-label-container input', - hpack: 'fill', - child: Widget.Label({ - class_name: 'menu-label audio input', - hexpand: true, - hpack: 'start', - label: 'Input Devices', - }), - }), - Widget.Box({ - class_name: 'menu-items-section input', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-container input', - vertical: true, - children: [ - Widget.Box({ - vertical: true, - children: audio.bind('microphones').as((v) => renderInputDevices(v)), - }), - ], - }), - ], - }), - ], - }), - ], - }); -}; - -export { availableDevices }; diff --git a/ags/HyprPanel/modules/menus/audio/index.ts b/ags/HyprPanel/modules/menus/audio/index.ts deleted file mode 100644 index 6801151..0000000 --- a/ags/HyprPanel/modules/menus/audio/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Window from 'types/widgets/window.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -import { activeDevices } from './active/index.js'; -import { availableDevices } from './available/index.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'audiomenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items audio', - hpack: 'fill', - hexpand: true, - child: Widget.Box({ - vertical: true, - hpack: 'fill', - hexpand: true, - class_name: 'menu-items-container audio', - children: [activeDevices(), availableDevices()], - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/audio/utils.ts b/ags/HyprPanel/modules/menus/audio/utils.ts deleted file mode 100644 index aa1de5c..0000000 --- a/ags/HyprPanel/modules/menus/audio/utils.ts +++ /dev/null @@ -1,29 +0,0 @@ -const speakerIcons = { - 101: 'audio-volume-overamplified-symbolic', - 66: 'audio-volume-high-symbolic', - 34: 'audio-volume-medium-symbolic', - 1: 'audio-volume-low-symbolic', - 0: 'audio-volume-muted-symbolic', -} as const; - -const inputIcons = { - 101: 'microphone-sensitivity-high-symbolic', - 66: 'microphone-sensitivity-high-symbolic', - 34: 'microphone-sensitivity-medium-symbolic', - 1: 'microphone-sensitivity-low-symbolic', - 0: 'microphone-disabled-symbolic', -}; - -type IconVolumes = keyof typeof speakerIcons; - -const getIcon = (audioVol: number, isMuted: boolean): Record => { - const thresholds: IconVolumes[] = [101, 66, 34, 1, 0]; - const icon = isMuted ? 0 : thresholds.find((threshold) => threshold <= audioVol * 100) || 0; - - return { - spkr: speakerIcons[icon], - mic: inputIcons[icon], - }; -}; - -export { getIcon }; diff --git a/ags/HyprPanel/modules/menus/bluetooth/devices/connectedControls.ts b/ags/HyprPanel/modules/menus/bluetooth/devices/connectedControls.ts deleted file mode 100644 index 62e8345..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/devices/connectedControls.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { BluetoothDevice } from 'types/service/bluetooth'; - -const connectedControls = (dev: BluetoothDevice, connectedDevices: BluetoothDevice[]): BoxWidget => { - if (!connectedDevices.includes(dev.address)) { - return Widget.Box({}); - } - - return Widget.Box({ - vpack: 'start', - class_name: 'bluetooth-controls', - children: [ - Widget.Button({ - class_name: 'menu-icon-button unpair bluetooth', - child: Widget.Label({ - tooltip_text: dev.paired ? 'Unpair' : 'Pair', - class_name: 'menu-icon-button-label unpair bluetooth txt-icon', - label: dev.paired ? '' : '', - }), - on_primary_click: () => - Utils.execAsync([ - 'bash', - '-c', - `bluetoothctl ${dev.paired ? 'unpair' : 'pair'} ${dev.address}`, - ]).catch((err) => - console.error(`bluetoothctl ${dev.paired ? 'unpair' : 'pair'} ${dev.address}`, err), - ), - }), - Widget.Button({ - class_name: 'menu-icon-button disconnect bluetooth', - child: Widget.Label({ - tooltip_text: dev.connected ? 'Disconnect' : 'Connect', - class_name: 'menu-icon-button-label disconnect bluetooth txt-icon', - label: dev.connected ? '󱘖' : '', - }), - on_primary_click: () => dev.setConnection(!dev.connected), - }), - Widget.Button({ - class_name: 'menu-icon-button untrust bluetooth', - child: Widget.Label({ - tooltip_text: dev.trusted ? 'Untrust' : 'Trust', - class_name: 'menu-icon-button-label untrust bluetooth txt-icon', - label: dev.trusted ? '' : '󱖡', - }), - on_primary_click: () => - Utils.execAsync([ - 'bash', - '-c', - `bluetoothctl ${dev.trusted ? 'untrust' : 'trust'} ${dev.address}`, - ]).catch((err) => - console.error(`bluetoothctl ${dev.trusted ? 'untrust' : 'trust'} ${dev.address}`, err), - ), - }), - Widget.Button({ - class_name: 'menu-icon-button delete bluetooth', - child: Widget.Label({ - tooltip_text: 'Forget', - class_name: 'menu-icon-button-label delete bluetooth txt-icon', - label: '󰆴', - }), - on_primary_click: () => { - Utils.execAsync(['bash', '-c', `bluetoothctl remove ${dev.address}`]).catch((err) => - console.error('Bluetooth Remove', err), - ); - }, - }), - ], - }); -}; - -export { connectedControls }; diff --git a/ags/HyprPanel/modules/menus/bluetooth/devices/devicelist.ts b/ags/HyprPanel/modules/menus/bluetooth/devices/devicelist.ts deleted file mode 100644 index e1fdcc9..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/devices/devicelist.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { Bluetooth } from 'types/service/bluetooth.js'; -import Box from 'types/widgets/box.js'; -import { connectedControls } from './connectedControls.js'; -import { getBluetoothIcon } from '../utils.js'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const devices = (bluetooth: Bluetooth, self: Box): Box => { - return self.hook(bluetooth, () => { - if (!bluetooth.enabled) { - return (self.child = Widget.Box({ - class_name: 'bluetooth-items', - vertical: true, - expand: true, - vpack: 'center', - hpack: 'center', - children: [ - Widget.Label({ - class_name: 'bluetooth-disabled dim', - hexpand: true, - label: 'Bluetooth is disabled', - }), - ], - })); - } - - const availableDevices = bluetooth.devices - .filter((btDev) => btDev.name !== null) - .sort((a, b) => { - if (a.connected || a.paired) { - return -1; - } - - if (b.connected || b.paired) { - return 1; - } - - return b.name - a.name; - }); - - const conDevNames = availableDevices.filter((d) => d.connected || d.paired).map((d) => d.address); - - if (!availableDevices.length) { - return (self.child = Widget.Box({ - class_name: 'bluetooth-items', - vertical: true, - expand: true, - vpack: 'center', - hpack: 'center', - children: [ - Widget.Label({ - class_name: 'no-bluetooth-devices dim', - hexpand: true, - label: 'No devices currently found', - }), - Widget.Label({ - class_name: 'search-bluetooth-label dim', - hexpand: true, - label: "Press '󰑐' to search", - }), - ], - })); - } - - return (self.child = Widget.Box({ - vertical: true, - children: availableDevices.map((device) => { - return Widget.Box({ - children: [ - Widget.Button({ - hexpand: true, - class_name: `bluetooth-element-item ${device}`, - on_primary_click: () => { - if (!conDevNames.includes(device.address)) device.setConnection(true); - }, - child: Widget.Box({ - hexpand: true, - children: [ - Widget.Box({ - hexpand: true, - hpack: 'start', - class_name: 'menu-button-container', - children: [ - Widget.Label({ - vpack: 'start', - class_name: `menu-button-icon bluetooth ${conDevNames.includes(device.address) ? 'active' : ''} txt-icon`, - label: getBluetoothIcon(`${device['icon_name']}-symbolic`), - }), - Widget.Box({ - vertical: true, - vpack: 'center', - children: [ - Widget.Label({ - vpack: 'center', - hpack: 'start', - class_name: 'menu-button-name bluetooth', - truncate: 'end', - wrap: true, - label: device.alias, - }), - Widget.Revealer({ - hpack: 'start', - reveal_child: device.connected || device.paired, - child: Widget.Label({ - hpack: 'start', - class_name: 'connection-status dim', - label: device.connected ? 'Connected' : 'Paired', - }), - }), - ], - }), - ], - }), - Widget.Box({ - hpack: 'end', - children: device.connecting - ? [ - Widget.Spinner({ - vpack: 'start', - class_name: 'spinner bluetooth', - }), - ] - : [], - }), - ], - }), - }), - connectedControls(device, conDevNames), - ], - }); - }), - })); - }); -}; - -export { devices }; diff --git a/ags/HyprPanel/modules/menus/bluetooth/devices/index.ts b/ags/HyprPanel/modules/menus/bluetooth/devices/index.ts deleted file mode 100644 index 31315d5..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/devices/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -const bluetooth = await Service.import('bluetooth'); -import { label } from './label.js'; -import { devices } from './devicelist.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const Devices = (): BoxWidget => { - return Widget.Box({ - class_name: 'menu-section-container', - vertical: true, - children: [ - label(bluetooth), - Widget.Box({ - class_name: 'menu-items-section', - child: Widget.Box({ - class_name: 'menu-content', - vertical: true, - setup: (self) => { - devices(bluetooth, self); - }, - }), - }), - ], - }); -}; - -export { Devices }; diff --git a/ags/HyprPanel/modules/menus/bluetooth/devices/label.ts b/ags/HyprPanel/modules/menus/bluetooth/devices/label.ts deleted file mode 100644 index 45fabf6..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/devices/label.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { Bluetooth } from 'types/service/bluetooth'; - -const label = (bluetooth: Bluetooth): BoxWidget => { - const searchInProgress = Variable(false); - - const startRotation = (): void => { - searchInProgress.value = true; - setTimeout(() => { - searchInProgress.value = false; - }, 10 * 1000); - }; - - return Widget.Box({ - class_name: 'menu-label-container', - hpack: 'fill', - vpack: 'start', - children: [ - Widget.Label({ - class_name: 'menu-label', - vpack: 'center', - hpack: 'start', - label: 'Bluetooth', - }), - Widget.Box({ - class_name: 'controls-container', - vpack: 'start', - children: [ - Widget.Switch({ - class_name: 'menu-switch bluetooth', - hexpand: true, - hpack: 'end', - active: bluetooth.bind('enabled'), - on_activate: ({ active }) => { - searchInProgress.value = false; - Utils.execAsync(['bash', '-c', `bluetoothctl power ${active ? 'on' : 'off'}`]).catch( - (err) => console.error(`bluetoothctl power ${active ? 'on' : 'off'}`, err), - ); - }, - }), - Widget.Separator({ - class_name: 'menu-separator bluetooth', - }), - Widget.Button({ - vpack: 'center', - class_name: 'menu-icon-button search', - on_primary_click: () => { - startRotation(); - Utils.execAsync(['bash', '-c', 'bluetoothctl --timeout 120 scan on']).catch((err) => { - searchInProgress.value = false; - console.error('bluetoothctl --timeout 120 scan on', err); - }); - }, - child: Widget.Icon({ - class_name: searchInProgress.bind('value').as((v) => (v ? 'spinning' : '')), - icon: 'view-refresh-symbolic', - }), - }), - ], - }), - ], - }); -}; - -export { label }; diff --git a/ags/HyprPanel/modules/menus/bluetooth/index.ts b/ags/HyprPanel/modules/menus/bluetooth/index.ts deleted file mode 100644 index 54dfcad..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import Window from 'types/widgets/window.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -import { Devices } from './devices/index.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'bluetoothmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items bluetooth', - hpack: 'fill', - hexpand: true, - child: Widget.Box({ - vertical: true, - hpack: 'fill', - hexpand: true, - class_name: 'menu-items-container bluetooth', - child: Devices(), - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/bluetooth/utils.ts b/ags/HyprPanel/modules/menus/bluetooth/utils.ts deleted file mode 100644 index c305538..0000000 --- a/ags/HyprPanel/modules/menus/bluetooth/utils.ts +++ /dev/null @@ -1,29 +0,0 @@ -const getBluetoothIcon = (iconName: string): string => { - const deviceIconMap = [ - ['^audio-card*', '󰎄'], - ['^audio-headphones*', '󰋋'], - ['^audio-headset*', '󰋎'], - ['^audio-input*', '󰍬'], - ['^audio-speakers*', '󰓃'], - ['^bluetooth*', '󰂯'], - ['^camera*', '󰄀'], - ['^computer*', '󰟀'], - ['^input-gaming*', '󰍬'], - ['^input-keyboard*', '󰌌'], - ['^input-mouse*', '󰍽'], - ['^input-tablet*', '󰓶'], - ['^media*', '󱛟'], - ['^modem*', '󱂇'], - ['^network*', '󱂇'], - ['^phone*', '󰄞'], - ['^printer*', '󰐪'], - ['^scanner*', '󰚫'], - ['^video-camera*', '󰕧'], - ]; - - const foundMatch = deviceIconMap.find((icon) => RegExp(icon[0]).test(iconName.toLowerCase())); - - return foundMatch ? foundMatch[1] : '󰂯'; -}; - -export { getBluetoothIcon }; diff --git a/ags/HyprPanel/modules/menus/calendar/calendar.ts b/ags/HyprPanel/modules/menus/calendar/calendar.ts deleted file mode 100644 index d2af59e..0000000 --- a/ags/HyprPanel/modules/menus/calendar/calendar.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; - -const CalendarWidget = (): BoxWidget => { - return Widget.Box({ - class_name: 'calendar-menu-item-container calendar', - hpack: 'fill', - vpack: 'fill', - expand: true, - child: Widget.Box({ - class_name: 'calendar-container-box', - child: Widget.Calendar({ - expand: true, - hpack: 'fill', - vpack: 'fill', - class_name: 'calendar-menu-widget', - showDayNames: true, - showDetails: false, - showHeading: true, - }), - }), - }); -}; - -export { CalendarWidget }; diff --git a/ags/HyprPanel/modules/menus/calendar/index.ts b/ags/HyprPanel/modules/menus/calendar/index.ts deleted file mode 100644 index d3fecb8..0000000 --- a/ags/HyprPanel/modules/menus/calendar/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -import DropdownMenu from 'modules/menus/shared/dropdown/index'; -import { TimeWidget } from './time/index'; -import { CalendarWidget } from './calendar'; -import { WeatherWidget } from './weather/index'; -import options from 'options'; -import Window from 'types/widgets/window'; -import { Attribute, Child } from 'lib/types/widget'; - -const { enabled: weatherEnabled } = options.menus.clock.weather; - -export default (): Window => { - return DropdownMenu({ - name: 'calendarmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'calendar-menu-content', - css: 'padding: 1px; margin: -1px;', - vexpand: false, - children: [ - Widget.Box({ - class_name: 'calendar-content-container', - vertical: true, - children: [ - Widget.Box({ - class_name: 'calendar-content-items', - vertical: true, - children: weatherEnabled.bind('value').as((isWeatherEnabled) => { - return [TimeWidget(), CalendarWidget(), ...(isWeatherEnabled ? [WeatherWidget()] : [])]; - }), - }), - ], - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/time/index.ts b/ags/HyprPanel/modules/menus/calendar/time/index.ts deleted file mode 100644 index 2cbb279..0000000 --- a/ags/HyprPanel/modules/menus/calendar/time/index.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import options from 'options'; - -const { military, hideSeconds } = options.menus.clock.time; - -const time = Variable('', { - poll: [1000, 'date "+%I:%M:%S"'], -}); - -const period = Variable('', { - poll: [1000, 'date "+%p"'], -}); - -const militaryTime = Variable('', { - poll: [1000, 'date "+%H:%M:%S"'], -}); - -const TimeWidget = (): BoxWidget => { - return Widget.Box({ - class_name: 'calendar-menu-item-container clock', - hexpand: true, - vpack: 'center', - hpack: 'fill', - child: Widget.Box({ - hexpand: true, - vpack: 'center', - hpack: 'center', - class_name: 'clock-content-items', - children: Utils.merge( - [military.bind('value'), hideSeconds.bind('value')], - (is24hr: boolean, hideSeconds: boolean) => { - if (!is24hr) { - return [ - Widget.Box({ - hpack: 'center', - children: [ - Widget.Label({ - class_name: 'clock-content-time', - label: hideSeconds ? time.bind().as((str) => str.slice(0, -3)) : time.bind(), - }), - ], - }), - Widget.Box({ - hpack: 'center', - children: [ - Widget.Label({ - vpack: 'end', - class_name: 'clock-content-period', - label: period.bind(), - }), - ], - }), - ]; - } - - return [ - Widget.Box({ - hpack: 'center', - children: [ - Widget.Label({ - class_name: 'clock-content-time', - label: hideSeconds - ? militaryTime.bind().as((str) => str.slice(0, -3)) - : militaryTime.bind(), - }), - ], - }), - ]; - }, - ), - }), - }); -}; - -export { TimeWidget }; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/hourly/icon/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/hourly/icon/index.ts deleted file mode 100644 index 2c636c1..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/hourly/icon/index.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Weather, WeatherIconTitle } from 'lib/types/weather.js'; -import { Variable } from 'types/variable.js'; -import { weatherIcons } from 'modules/icons/weather.js'; -import { isValidWeatherIconTitle } from 'globals/weather'; -import { BoxWidget } from 'lib/types/widget'; -import { getNextEpoch } from '../utils'; - -export const HourlyIcon = (theWeather: Variable, hoursFromNow: number): BoxWidget => { - const getIconQuery = (wthr: Weather): WeatherIconTitle => { - const nextEpoch = getNextEpoch(wthr, hoursFromNow); - const weatherAtEpoch = wthr.forecast.forecastday[0].hour.find((h) => h.time_epoch === nextEpoch); - - if (weatherAtEpoch === undefined) { - return 'warning'; - } - - let iconQuery = weatherAtEpoch.condition.text.trim().toLowerCase().replaceAll(' ', '_'); - - if (!weatherAtEpoch?.is_day && iconQuery === 'partly_cloudy') { - iconQuery = 'partly_cloudy_night'; - } - - if (isValidWeatherIconTitle(iconQuery)) { - return iconQuery; - } else { - return 'warning'; - } - }; - - return Widget.Box({ - hpack: 'center', - child: theWeather.bind('value').as((w) => { - const iconQuery = getIconQuery(w); - const weatherIcn = weatherIcons[iconQuery] || weatherIcons['warning']; - - return Widget.Label({ - hpack: 'center', - class_name: 'hourly-weather-icon txt-icon', - label: weatherIcn, - }); - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/hourly/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/hourly/index.ts deleted file mode 100644 index 0eb1982..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/hourly/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Variable } from 'types/variable'; -import { HourlyIcon } from './icon/index.js'; -import { HourlyTemp } from './temperature/index.js'; -import { HourlyTime } from './time/index.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -export const Hourly = (theWeather: Variable): BoxWidget => { - return Widget.Box({ - vertical: false, - hexpand: true, - hpack: 'fill', - class_name: 'hourly-weather-container', - children: [1, 2, 3, 4].map((hoursFromNow) => { - return Widget.Box({ - class_name: 'hourly-weather-item', - hexpand: true, - vertical: true, - children: [ - HourlyTime(theWeather, hoursFromNow), - HourlyIcon(theWeather, hoursFromNow), - HourlyTemp(theWeather, hoursFromNow), - ], - }); - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/hourly/temperature/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/hourly/temperature/index.ts deleted file mode 100644 index 440c994..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/hourly/temperature/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Variable } from 'types/variable'; -import options from 'options'; -import Label from 'types/widgets/label'; -import { Child } from 'lib/types/widget'; -import { getNextEpoch } from '../utils'; - -const { unit } = options.menus.clock.weather; - -export const HourlyTemp = (theWeather: Variable, hoursFromNow: number): Label => { - return Widget.Label({ - class_name: 'hourly-weather-temp', - label: Utils.merge([theWeather.bind('value'), unit.bind('value')], (wthr, unt) => { - if (!Object.keys(wthr).length) { - return '-'; - } - - const nextEpoch = getNextEpoch(wthr, hoursFromNow); - const weatherAtEpoch = wthr.forecast.forecastday[0].hour.find((h) => h.time_epoch === nextEpoch); - - if (unt === 'imperial') { - return `${weatherAtEpoch ? Math.ceil(weatherAtEpoch.temp_f) : '-'}° F`; - } - return `${weatherAtEpoch ? Math.ceil(weatherAtEpoch.temp_c) : '-'}° C`; - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/hourly/time/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/hourly/time/index.ts deleted file mode 100644 index 717eac4..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/hourly/time/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Child } from 'lib/types/widget'; -import { Variable } from 'types/variable'; -import Label from 'types/widgets/label'; -import { getNextEpoch } from '../utils'; - -export const HourlyTime = (theWeather: Variable, hoursFromNow: number): Label => { - return Widget.Label({ - class_name: 'hourly-weather-time', - label: theWeather.bind('value').as((w) => { - if (!Object.keys(w).length) { - return '-'; - } - - const nextEpoch = getNextEpoch(w, hoursFromNow); - const dateAtEpoch = new Date(nextEpoch * 1000); - let hours = dateAtEpoch.getHours(); - const ampm = hours >= 12 ? 'PM' : 'AM'; - hours = hours % 12 || 12; - - return `${hours}${ampm}`; - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/hourly/utils.ts b/ags/HyprPanel/modules/menus/calendar/weather/hourly/utils.ts deleted file mode 100644 index 13f1d53..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/hourly/utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Weather } from 'lib/types/weather'; - -export const getNextEpoch = (wthr: Weather, hoursFromNow: number): number => { - const currentEpoch = wthr.location.localtime_epoch; - const epochAtHourStart = currentEpoch - (currentEpoch % 3600); - let nextEpoch = 3600 * hoursFromNow + epochAtHourStart; - - const curHour = new Date(currentEpoch * 1000).getHours(); - - /* - * NOTE: Since the API is only capable of showing the current day; if - * the hours left in the day are less than 4 (aka spilling into the next day), - * then rewind to contain the prediction within the current day. - */ - if (curHour > 19) { - const hoursToRewind = curHour - 19; - nextEpoch = 3600 * hoursFromNow + epochAtHourStart - hoursToRewind * 3600; - } - return nextEpoch; -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/icon/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/icon/index.ts deleted file mode 100644 index dff981a..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/icon/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Variable } from 'types/variable'; -import { getWeatherStatusTextIcon } from 'globals/weather.js'; -import { BoxWidget } from 'lib/types/widget'; - -export const TodayIcon = (theWeather: Variable): BoxWidget => { - return Widget.Box({ - vpack: 'center', - hpack: 'start', - class_name: 'calendar-menu-weather today icon container', - child: Widget.Label({ - class_name: 'calendar-menu-weather today icon txt-icon', - label: theWeather.bind('value').as((w) => { - return getWeatherStatusTextIcon(w); - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/index.ts deleted file mode 100644 index bf4a6bf..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { TodayIcon } from './icon/index.js'; -import { TodayStats } from './stats/index.js'; -import { TodayTemperature } from './temperature/index.js'; -import { Hourly } from './hourly/index.js'; -import { globalWeatherVar } from 'globals/weather.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const WeatherWidget = (): BoxWidget => { - return Widget.Box({ - class_name: 'calendar-menu-item-container weather', - child: Widget.Box({ - class_name: 'weather-container-box', - setup: (self) => { - return (self.child = Widget.Box({ - vertical: true, - hexpand: true, - children: [ - Widget.Box({ - class_name: 'calendar-menu-weather today', - hexpand: true, - children: [ - TodayIcon(globalWeatherVar), - TodayTemperature(globalWeatherVar), - TodayStats(globalWeatherVar), - ], - }), - Widget.Separator({ - class_name: 'menu-separator weather', - }), - Hourly(globalWeatherVar), - ], - })); - }, - }), - }); -}; - -export { WeatherWidget }; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/stats/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/stats/index.ts deleted file mode 100644 index 197032f..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/stats/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Variable } from 'types/variable'; -import options from 'options'; -import { Unit } from 'lib/types/options'; -import { getRainChance, getWindConditions } from 'globals/weather'; -import { BoxWidget } from 'lib/types/widget'; - -const { unit } = options.menus.clock.weather; - -export const TodayStats = (theWeather: Variable): BoxWidget => { - return Widget.Box({ - class_name: 'calendar-menu-weather today stats container', - hpack: 'end', - vpack: 'center', - vertical: true, - children: [ - Widget.Box({ - class_name: 'weather wind', - children: [ - Widget.Label({ - class_name: 'weather wind icon txt-icon', - label: '', - }), - Widget.Label({ - class_name: 'weather wind label', - label: Utils.merge( - [theWeather.bind('value'), unit.bind('value')], - (wthr: Weather, unt: Unit) => { - return getWindConditions(wthr, unt); - }, - ), - }), - ], - }), - Widget.Box({ - class_name: 'weather precip', - children: [ - Widget.Label({ - class_name: 'weather precip icon txt-icon', - label: '', - }), - Widget.Label({ - class_name: 'weather precip label', - label: theWeather.bind('value').as((v) => getRainChance(v)), - }), - ], - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/menus/calendar/weather/temperature/index.ts b/ags/HyprPanel/modules/menus/calendar/weather/temperature/index.ts deleted file mode 100644 index 597a75c..0000000 --- a/ags/HyprPanel/modules/menus/calendar/weather/temperature/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Weather } from 'lib/types/weather'; -import { Variable } from 'types/variable'; -import options from 'options'; -import { getTemperature, getWeatherIcon } from 'globals/weather'; -import { BoxWidget } from 'lib/types/widget'; -const { unit } = options.menus.clock.weather; - -export const TodayTemperature = (theWeather: Variable): BoxWidget => { - return Widget.Box({ - hpack: 'center', - vpack: 'center', - vertical: true, - children: [ - Widget.Box({ - hexpand: true, - vpack: 'center', - class_name: 'calendar-menu-weather today temp container', - vertical: false, - children: [ - Widget.Box({ - hexpand: true, - hpack: 'center', - children: [ - Widget.Label({ - class_name: 'calendar-menu-weather today temp label', - label: Utils.merge([theWeather.bind('value'), unit.bind('value')], (wthr, unt) => { - return getTemperature(wthr, unt); - }), - }), - Widget.Label({ - class_name: theWeather - .bind('value') - .as( - (v) => - `calendar-menu-weather today temp label icon txt-icon ${getWeatherIcon(Math.ceil(v.current.temp_f)).color}`, - ), - label: theWeather - .bind('value') - .as((v) => getWeatherIcon(Math.ceil(v.current.temp_f)).icon), - }), - ], - }), - ], - }), - Widget.Box({ - hpack: 'center', - child: Widget.Label({ - max_width_chars: 17, - truncate: 'end', - lines: 2, - class_name: theWeather - .bind('value') - .as( - (v) => - `calendar-menu-weather today condition label ${getWeatherIcon(Math.ceil(v.current.temp_f)).color}`, - ), - label: theWeather.bind('value').as((v) => v.current.condition.text), - }), - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/menus/dashboard/controls/index.ts b/ags/HyprPanel/modules/menus/dashboard/controls/index.ts deleted file mode 100644 index e158f96..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/controls/index.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; - -const network = await Service.import('network'); -const bluetooth = await Service.import('bluetooth'); -const notifications = await Service.import('notifications'); -const audio = await Service.import('audio'); - -const Controls = (): BoxWidget => { - return Widget.Box({ - class_name: 'dashboard-card controls-container', - hpack: 'fill', - vpack: 'fill', - expand: true, - children: [ - Widget.Button({ - tooltip_text: 'Toggle Wifi', - expand: true, - setup: (self) => { - self.hook(network, () => { - return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? 'disabled' : ''}`); - }); - }, - on_primary_click: () => network.toggleWifi(), - child: Widget.Label({ - class_name: 'txt-icon', - setup: (self) => { - self.hook(network, () => { - return (self.label = network.wifi.enabled ? '󰤨' : '󰤭'); - }); - }, - }), - }), - Widget.Button({ - tooltip_text: 'Toggle Bluetooth', - expand: true, - class_name: bluetooth - .bind('enabled') - .as((btOn) => `dashboard-button bluetooth ${!btOn ? 'disabled' : ''}`), - on_primary_click: () => bluetooth.toggle(), - child: Widget.Label({ - class_name: 'txt-icon', - label: bluetooth.bind('enabled').as((btOn) => (btOn ? '󰂯' : '󰂲')), - }), - }), - Widget.Button({ - tooltip_text: 'Toggle Notifications', - expand: true, - class_name: notifications - .bind('dnd') - .as((dnd) => `dashboard-button notifications ${dnd ? 'disabled' : ''}`), - on_primary_click: () => (notifications.dnd = !notifications.dnd), - child: Widget.Label({ - class_name: 'txt-icon', - label: notifications.bind('dnd').as((dnd) => (dnd ? '󰂛' : '󰂚')), - }), - }), - Widget.Button({ - tooltip_text: 'Toggle Mute (Playback)', - expand: true, - on_primary_click: () => (audio.speaker.is_muted = !audio.speaker.is_muted), - setup: (self) => { - self.hook( - audio.speaker, - () => { - return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? 'disabled' : ''}`); - }, - 'notify::is-muted', - ); - }, - child: Widget.Label({ - class_name: 'txt-icon', - setup: (self) => { - self.hook( - audio.speaker, - () => { - return (self.label = audio.speaker.is_muted ? '󰖁' : '󰕾'); - }, - 'notify::is-muted', - ); - }, - }), - }), - Widget.Button({ - tooltip_text: 'Toggle Mute (Microphone)', - expand: true, - on_primary_click: () => (audio.microphone.is_muted = !audio.microphone.is_muted), - setup: (self) => { - self.hook( - audio.microphone, - () => { - return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? 'disabled' : ''}`); - }, - 'notify::is-muted', - ); - }, - child: Widget.Label({ - class_name: 'txt-icon', - setup: (self) => { - self.hook( - audio.microphone, - () => { - return (self.label = audio.microphone.is_muted ? '󰍭' : '󰍬'); - }, - 'notify::is-muted', - ); - }, - }), - }), - ], - }); -}; - -export { Controls }; diff --git a/ags/HyprPanel/modules/menus/dashboard/directories/index.ts b/ags/HyprPanel/modules/menus/dashboard/directories/index.ts deleted file mode 100644 index 5b6aa11..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/directories/index.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import options from 'options'; - -const { left, right } = options.menus.dashboard.directories; - -const Directories = (): BoxWidget => { - return Widget.Box({ - class_name: 'dashboard-card directories-container', - vpack: 'fill', - hpack: 'fill', - expand: true, - children: [ - Widget.Box({ - vertical: true, - expand: true, - class_name: 'section right', - children: [ - Widget.Button({ - hpack: 'start', - expand: true, - class_name: 'directory-link left top', - on_primary_click: left.directory1.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: left.directory1.label.bind('value'), - }), - }), - Widget.Button({ - expand: true, - hpack: 'start', - class_name: 'directory-link left middle', - on_primary_click: left.directory2.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: left.directory2.label.bind('value'), - }), - }), - Widget.Button({ - expand: true, - hpack: 'start', - class_name: 'directory-link left bottom', - on_primary_click: left.directory3.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: left.directory3.label.bind('value'), - }), - }), - ], - }), - Widget.Box({ - vertical: true, - expand: true, - class_name: 'section left', - children: [ - Widget.Button({ - hpack: 'start', - expand: true, - class_name: 'directory-link right top', - on_primary_click: right.directory1.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: right.directory1.label.bind('value'), - }), - }), - Widget.Button({ - expand: true, - hpack: 'start', - class_name: 'directory-link right middle', - on_primary_click: right.directory2.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: right.directory2.label.bind('value'), - }), - }), - Widget.Button({ - expand: true, - hpack: 'start', - class_name: 'directory-link right bottom', - on_primary_click: right.directory3.command.bind('value').as((cmd) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(cmd); - }; - }), - child: Widget.Label({ - hpack: 'start', - label: right.directory3.label.bind('value'), - }), - }), - ], - }), - ], - }); -}; - -export { Directories }; diff --git a/ags/HyprPanel/modules/menus/dashboard/index.ts b/ags/HyprPanel/modules/menus/dashboard/index.ts deleted file mode 100644 index 9bac607..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/index.ts +++ /dev/null @@ -1,52 +0,0 @@ -import DropdownMenu from '../shared/dropdown/index.js'; -import { Profile } from './profile/index.js'; -import { Shortcuts } from './shortcuts/index.js'; -import { Controls } from './controls/index.js'; -import { Stats } from './stats/index.js'; -import { Directories } from './directories/index.js'; -import Window from 'types/widgets/window.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -const { controls, shortcuts, stats, directories } = options.menus.dashboard; - -export default (): Window => { - return DropdownMenu({ - name: 'dashboardmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'dashboard-menu-content', - css: 'padding: 1px; margin: -1px;', - vexpand: false, - children: [ - Widget.Box({ - class_name: 'dashboard-content-container', - vertical: true, - children: Utils.merge( - [ - controls.enabled.bind('value'), - shortcuts.enabled.bind('value'), - stats.enabled.bind('value'), - directories.enabled.bind('value'), - ], - (isControlsEnabled, isShortcutsEnabled, isStatsEnabled, isDirectoriesEnabled) => { - return [ - Widget.Box({ - class_name: 'dashboard-content-items', - vertical: true, - children: [ - Profile(), - ...(isShortcutsEnabled ? [Shortcuts()] : []), - ...(isControlsEnabled ? [Controls()] : []), - ...(isDirectoriesEnabled ? [Directories()] : []), - ...(isStatsEnabled ? [Stats()] : []), - ], - }), - ]; - }, - ), - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/dashboard/profile/index.ts b/ags/HyprPanel/modules/menus/dashboard/profile/index.ts deleted file mode 100644 index 9d2531a..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/profile/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -import powermenu from '../../power/helpers/actions.js'; -import { PowerOptions } from 'lib/types/options.js'; -import GdkPixbuf from 'gi://GdkPixbuf'; - -import options from 'options'; -import { BoxWidget, Child } from 'lib/types/widget.js'; -import Label from 'types/widgets/label.js'; -const { image, name } = options.menus.dashboard.powermenu.avatar; -const { confirmation, shutdown, logout, sleep, reboot } = options.menus.dashboard.powermenu; - -const Profile = (): BoxWidget => { - const handleClick = (action: PowerOptions): void => { - const actions = { - shutdown: shutdown.value, - reboot: reboot.value, - logout: logout.value, - sleep: sleep.value, - }; - App.closeWindow('dashboardmenu'); - - if (!confirmation.value) { - Utils.execAsync(actions[action]).catch((err) => - console.error(`Failed to execute ${action} command. Error: ${err}`), - ); - } else { - powermenu.action(action); - } - }; - - const getIconForButton = (txtIcon: string): Label => { - return Widget.Label({ - className: 'txt-icon', - label: txtIcon, - }); - }; - - return Widget.Box({ - class_name: 'profiles-container', - hpack: 'fill', - hexpand: true, - children: [ - Widget.Box({ - class_name: 'profile-picture-container dashboard-card', - hexpand: true, - vertical: true, - children: [ - Widget.Box({ - hpack: 'center', - class_name: 'profile-picture', - css: image.bind('value').as((i) => { - try { - GdkPixbuf.Pixbuf.new_from_file(i); - return `background-image: url("${i}")`; - } catch { - return `background-image: url("${App.configDir}/assets/hyprpanel.png")`; - } - }), - }), - Widget.Label({ - hpack: 'center', - class_name: 'profile-name', - label: name.bind('value').as((v) => { - if (v === 'system') { - return Utils.exec('bash -c whoami'); - } - return v; - }), - }), - ], - }), - Widget.Box({ - class_name: 'power-menu-container dashboard-card', - vertical: true, - vexpand: true, - children: [ - Widget.Button({ - class_name: 'dashboard-button shutdown', - on_clicked: () => handleClick('shutdown'), - tooltip_text: 'Shut Down', - vexpand: true, - child: getIconForButton('󰐥'), - }), - Widget.Button({ - class_name: 'dashboard-button restart', - on_clicked: () => handleClick('reboot'), - tooltip_text: 'Restart', - vexpand: true, - child: getIconForButton('󰜉'), - }), - Widget.Button({ - class_name: 'dashboard-button lock', - on_clicked: () => handleClick('logout'), - tooltip_text: 'Log Out', - vexpand: true, - child: getIconForButton('󰿅'), - }), - Widget.Button({ - class_name: 'dashboard-button sleep', - on_clicked: () => handleClick('sleep'), - tooltip_text: 'Sleep', - vexpand: true, - child: getIconForButton('󰤄'), - }), - ], - }), - ], - }); -}; - -export { Profile }; diff --git a/ags/HyprPanel/modules/menus/dashboard/shortcuts/index.ts b/ags/HyprPanel/modules/menus/dashboard/shortcuts/index.ts deleted file mode 100644 index 5b4f49c..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/shortcuts/index.ts +++ /dev/null @@ -1,317 +0,0 @@ -const hyprland = await Service.import('hyprland'); -import { Attribute, BoxWidget, Child } from 'lib/types/widget'; -import options from 'options'; -import { Variable as VarType } from 'types/variable'; -import Box from 'types/widgets/box'; -import Button from 'types/widgets/button'; -import Label from 'types/widgets/label'; - -const { left, right } = options.menus.dashboard.shortcuts; - -const Shortcuts = (): BoxWidget => { - const isRecording = Variable(false, { - poll: [ - 1000, - `${App.configDir}/services/screen_record.sh status`, - (out): boolean => { - if (out === 'recording') { - return true; - } - return false; - }, - ], - }); - const handleClick = (action: string, tOut: number = 250): void => { - App.closeWindow('dashboardmenu'); - - setTimeout(() => { - Utils.execAsync(action) - .then((res) => { - return res; - }) - .catch((err) => err); - }, tOut); - }; - - const recordingDropdown = Widget.Menu({ - class_name: 'dropdown recording', - hpack: 'fill', - hexpand: true, - setup: (self) => { - const renderMonitorList = (): void => { - const displays = hyprland.monitors.map((mon) => { - return Widget.MenuItem({ - label: `Display ${mon.name}`, - on_activate: () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`${App.configDir}/services/screen_record.sh start ${mon.name}`).catch( - (err) => console.error(err), - ); - }, - }); - }); - - // NOTE: This is disabled since window recording isn't available on wayland - // const apps = hyprland.clients.map((clt) => { - // return Widget.MenuItem({ - // label: `${clt.class.charAt(0).toUpperCase() + clt.class.slice(1)} (Workspace ${clt.workspace.name})`, - // on_activate: () => { - // App.closeWindow('dashboardmenu'); - // Utils.execAsync( - // `${App.configDir}/services/screen_record.sh start ${clt.focusHistoryID}`, - // ).catch((err) => console.error(err)); - // }, - // }); - // }); - - self.children = [ - ...displays, - // Disabled since window recording isn't available on wayland - // ...apps - ]; - }; - self.hook(hyprland, renderMonitorList, 'monitor-added'); - self.hook(hyprland, renderMonitorList, 'monitor-removed'); - }, - }); - - type ShortcutFixed = { - tooltip: string; - command: string; - icon: string; - configurable: false; - }; - - type ShortcutVariable = { - tooltip: VarType; - command: VarType; - icon: VarType; - configurable?: true; - }; - - type Shortcut = ShortcutFixed | ShortcutVariable; - - const cmdLn = (sCut: ShortcutVariable): boolean => { - return sCut.command.value.length > 0; - }; - - const leftCardHidden = Variable( - !(cmdLn(left.shortcut1) || cmdLn(left.shortcut2) || cmdLn(left.shortcut3) || cmdLn(left.shortcut4)), - ); - - const createButton = (shortcut: Shortcut, className: string): Button, Attribute> => { - if (shortcut.configurable !== false) { - return Widget.Button({ - vexpand: true, - tooltip_text: shortcut.tooltip.value, - class_name: className, - on_primary_click: () => handleClick(shortcut.command.value), - child: Widget.Label({ - class_name: 'button-label txt-icon', - label: shortcut.icon.value, - }), - }); - } else { - // handle non-configurable shortcut - return Widget.Button({ - vexpand: true, - tooltip_text: shortcut.tooltip, - class_name: className, - on_primary_click: (_, event) => { - if (shortcut.command === 'settings-dialog') { - App.closeWindow('dashboardmenu'); - App.toggleWindow('settings-dialog'); - } else if (shortcut.command === 'record') { - if (isRecording.value === true) { - App.closeWindow('dashboardmenu'); - return Utils.execAsync(`${App.configDir}/services/screen_record.sh stop`).catch((err) => - console.error(err), - ); - } else { - recordingDropdown.popup_at_pointer(event); - } - } - }, - child: Widget.Label({ - class_name: 'button-label txt-icon', - label: shortcut.icon, - }), - }); - } - }; - - const createButtonIfCommandExists = ( - shortcut: Shortcut, - className: string, - command: string, - ): Button, Attribute> | Box => { - if (command.length > 0) { - return createButton(shortcut, className); - } - return Widget.Box(); - }; - - return Widget.Box({ - class_name: 'shortcuts-container', - hpack: 'fill', - hexpand: true, - children: [ - Widget.Box({ - child: Utils.merge( - [ - left.shortcut1.command.bind('value'), - left.shortcut2.command.bind('value'), - left.shortcut1.tooltip.bind('value'), - left.shortcut2.tooltip.bind('value'), - left.shortcut1.icon.bind('value'), - left.shortcut2.icon.bind('value'), - left.shortcut3.command.bind('value'), - left.shortcut4.command.bind('value'), - left.shortcut3.tooltip.bind('value'), - left.shortcut4.tooltip.bind('value'), - left.shortcut3.icon.bind('value'), - left.shortcut4.icon.bind('value'), - ], - () => { - const isVisibleLeft = cmdLn(left.shortcut1) || cmdLn(left.shortcut2); - const isVisibleRight = cmdLn(left.shortcut3) || cmdLn(left.shortcut4); - - if (!isVisibleLeft && !isVisibleRight) { - leftCardHidden.value = true; - return Widget.Box(); - } - - leftCardHidden.value = false; - - return Widget.Box({ - class_name: 'container most-used dashboard-card', - children: [ - Widget.Box({ - className: `card-button-section-container ${isVisibleRight && isVisibleLeft ? 'visible' : ''}`, - child: isVisibleLeft - ? Widget.Box({ - vertical: true, - hexpand: true, - vexpand: true, - children: [ - createButtonIfCommandExists( - left.shortcut1, - `dashboard-button top-button ${cmdLn(left.shortcut2) ? 'paired' : ''}`, - left.shortcut1.command.value, - ), - createButtonIfCommandExists( - left.shortcut2, - 'dashboard-button', - left.shortcut2.command.value, - ), - ], - }) - : Widget.Box({ - children: [], - }), - }), - Widget.Box({ - className: 'card-button-section-container', - child: isVisibleRight - ? Widget.Box({ - vertical: true, - hexpand: true, - vexpand: true, - children: [ - createButtonIfCommandExists( - left.shortcut3, - `dashboard-button top-button ${cmdLn(left.shortcut4) ? 'paired' : ''}`, - left.shortcut3.command.value, - ), - createButtonIfCommandExists( - left.shortcut4, - 'dashboard-button', - left.shortcut4.command.value, - ), - ], - }) - : Widget.Box({ - children: [], - }), - }), - ], - }); - }, - ), - }), - Widget.Box({ - child: Utils.merge( - [ - right.shortcut1.command.bind('value'), - right.shortcut1.tooltip.bind('value'), - right.shortcut1.icon.bind('value'), - right.shortcut3.command.bind('value'), - right.shortcut3.tooltip.bind('value'), - right.shortcut3.icon.bind('value'), - leftCardHidden.bind('value'), - isRecording.bind('value'), - ], - () => { - return Widget.Box({ - class_name: `container utilities dashboard-card ${!leftCardHidden.value ? 'paired' : ''}`, - children: [ - Widget.Box({ - className: `card-button-section-container visible`, - child: Widget.Box({ - vertical: true, - hexpand: true, - vexpand: true, - children: [ - createButtonIfCommandExists( - right.shortcut1, - 'dashboard-button top-button paired', - right.shortcut1.command.value, - ), - createButtonIfCommandExists( - { - tooltip: 'HyprPanel Configuration', - command: 'settings-dialog', - icon: '󰒓', - configurable: false, - }, - 'dashboard-button', - 'settings-dialog', - ), - ], - }), - }), - Widget.Box({ - className: 'card-button-section-container', - child: Widget.Box({ - vertical: true, - hexpand: true, - vexpand: true, - children: [ - createButtonIfCommandExists( - right.shortcut3, - 'dashboard-button top-button paired', - right.shortcut3.command.value, - ), - createButtonIfCommandExists( - { - tooltip: 'Record Screen', - command: 'record', - icon: '󰑊', - configurable: false, - }, - `dashboard-button record ${isRecording.value ? 'active' : ''}`, - 'record', - ), - ], - }), - }), - ], - }); - }, - ), - }), - ], - }); -}; - -export { Shortcuts }; diff --git a/ags/HyprPanel/modules/menus/dashboard/stats/index.ts b/ags/HyprPanel/modules/menus/dashboard/stats/index.ts deleted file mode 100644 index 43e8457..0000000 --- a/ags/HyprPanel/modules/menus/dashboard/stats/index.ts +++ /dev/null @@ -1,362 +0,0 @@ -import options from 'options'; -import { GPU_Stat } from 'lib/types/gpustat'; -import { dependencies } from 'lib/utils'; -import { BoxWidget } from 'lib/types/widget'; -import { GenericResourceMetrics } from 'lib/types/customModules/generic'; - -const { terminal } = options; -const { enable_gpu } = options.menus.dashboard.stats; - -const Stats = (): BoxWidget => { - const divide = ([total, free]: number[]): number => free / total; - - const formatSizeInGB = (sizeInKB: number): number => Number((sizeInKB / 1024 ** 2).toFixed(2)); - - const cpu = Variable(0, { - poll: [ - 2000, - 'top -b -n 1', - (out): number => { - if (typeof out !== 'string') { - return 0; - } - - const cpuOut = out.split('\n').find((line) => line.includes('Cpu(s)')); - - if (cpuOut === undefined) { - return 0; - } - - const freeCpu = parseFloat(cpuOut.split(/\s+/)[1].replace(',', '.')); - return divide([100, freeCpu]); - }, - ], - }); - - const ram = Variable( - { total: 0, used: 0, percentage: 0 }, - { - poll: [ - 2000, - 'free', - (out): GenericResourceMetrics => { - if (typeof out !== 'string') { - return { total: 0, used: 0, percentage: 0 }; - } - - const ramOut = out.split('\n').find((line) => line.includes('Mem:')); - - if (ramOut === undefined) { - return { total: 0, used: 0, percentage: 0 }; - } - - const [totalRam, usedRam] = ramOut.split(/\s+/).splice(1, 2).map(Number); - - return { - percentage: divide([totalRam, usedRam]), - total: formatSizeInGB(totalRam), - used: formatSizeInGB(usedRam), - }; - }, - ], - }, - ); - - const gpu = Variable(0); - - const GPUStat = Widget.Box({ - child: enable_gpu.bind('value').as((gpStat) => { - if (!gpStat || !dependencies('gpustat')) { - return Widget.Box(); - } - - return Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - class_name: 'stat gpu', - hexpand: true, - vpack: 'center', - setup: (self) => { - const getGpuUsage = (): void => { - if (!enable_gpu.value) { - gpu.value = 0; - return; - } - - Utils.execAsync('gpustat --json') - .then((out) => { - if (typeof out !== 'string') { - return 0; - } - try { - const data = JSON.parse(out); - - const totalGpu = 100; - const usedGpu = - data.gpus.reduce((acc: number, gpu: GPU_Stat) => { - return acc + gpu['utilization.gpu']; - }, 0) / data.gpus.length; - - gpu.value = divide([totalGpu, usedGpu]); - } catch (e) { - console.error('Error getting GPU stats:', e); - gpu.value = 0; - } - }) - .catch((err) => { - console.error(`An error occurred while fetching GPU stats: ${err}`); - }); - }; - - self.poll(2000, getGpuUsage); - - Utils.merge([gpu.bind('value'), enable_gpu.bind('value')], (gpu, enableGpu) => { - if (!enableGpu) { - return (self.children = []); - } - - return (self.children = [ - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return (): void => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.Label({ - class_name: 'txt-icon', - label: '󰢮', - }), - }), - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return (): void => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.LevelBar({ - class_name: 'stats-bar', - hexpand: true, - vpack: 'center', - value: gpu, - }), - }), - ]); - }); - }, - }), - Widget.Box({ - hpack: 'end', - children: Utils.merge([gpu.bind('value'), enable_gpu.bind('value')], (gpuUsed, enableGpu) => { - if (!enableGpu) { - return []; - } - return [ - Widget.Label({ - class_name: 'stat-value gpu', - label: `${Math.floor(gpuUsed * 100)}%`, - }), - ]; - }), - }), - ], - }); - }), - }); - - const storage = Variable( - { total: 0, used: 0, percentage: 0 }, - { - poll: [ - 2000, - 'df -B1 /', - (out): GenericResourceMetrics => { - if (typeof out !== 'string') { - return { total: 0, used: 0, percentage: 0 }; - } - - const dfOut = out.split('\n').find((line) => line.startsWith('/')); - - if (dfOut === undefined) { - return { total: 0, used: 0, percentage: 0 }; - } - - const parts = dfOut.split(/\s+/); - const size = parseInt(parts[1], 10); - const used = parseInt(parts[2], 10); - - const sizeInGB = formatSizeInGB(size); - const usedInGB = formatSizeInGB(used); - - return { - total: Math.floor(sizeInGB / 1000), - used: Math.floor(usedInGB / 1000), - percentage: divide([size, used]), - }; - }, - ], - }, - ); - - return Widget.Box({ - class_name: 'dashboard-card stats-container', - vertical: true, - vpack: 'fill', - hpack: 'fill', - expand: true, - children: [ - Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - class_name: 'stat cpu', - hexpand: true, - vpack: 'center', - children: [ - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.Label({ - class_name: 'txt-icon', - label: '', - }), - }), - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.LevelBar({ - class_name: 'stats-bar', - hexpand: true, - vpack: 'center', - bar_mode: 'continuous', - max_value: 1, - value: cpu.bind('value'), - }), - }), - ], - }), - Widget.Label({ - hpack: 'end', - class_name: 'stat-value cpu', - label: cpu.bind('value').as((v) => `${Math.floor(v * 100)}%`), - }), - ], - }), - Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - class_name: 'stat ram', - vpack: 'center', - hexpand: true, - children: [ - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.Label({ - class_name: 'txt-icon', - label: '', - }), - }), - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.LevelBar({ - class_name: 'stats-bar', - hexpand: true, - vpack: 'center', - value: ram.bind('value').as((v) => v.percentage), - }), - }), - ], - }), - Widget.Label({ - hpack: 'end', - class_name: 'stat-value ram', - label: ram.bind('value').as((v) => `${v.used}/${v.total} GB`), - }), - ], - }), - GPUStat, - Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - class_name: 'stat storage', - hexpand: true, - vpack: 'center', - children: [ - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.Label({ - class_name: 'txt-icon', - label: '󰋊', - }), - }), - Widget.Button({ - on_primary_click: terminal.bind('value').as((term) => { - return () => { - App.closeWindow('dashboardmenu'); - Utils.execAsync(`bash -c "${term} -e btop"`).catch( - (err) => `Failed to open btop: ${err}`, - ); - }; - }), - child: Widget.LevelBar({ - class_name: 'stats-bar', - hexpand: true, - vpack: 'center', - value: storage.bind('value').as((v) => v.percentage), - }), - }), - ], - }), - Widget.Label({ - hpack: 'end', - class_name: 'stat-value storage', - label: storage.bind('value').as((v) => `${v.used}/${v.total} GB`), - }), - ], - }), - ], - }); -}; - -export { Stats }; diff --git a/ags/HyprPanel/modules/menus/energy/brightness/index.ts b/ags/HyprPanel/modules/menus/energy/brightness/index.ts deleted file mode 100644 index cdefd1a..0000000 --- a/ags/HyprPanel/modules/menus/energy/brightness/index.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { BoxWidget } from 'lib/types/widget.js'; -import brightness from '../../../../services/Brightness.js'; -import icons from '../../../icons/index.js'; - -const Brightness = (): BoxWidget => { - return Widget.Box({ - class_name: 'menu-section-container brightness', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container', - hpack: 'fill', - child: Widget.Label({ - class_name: 'menu-label', - hexpand: true, - hpack: 'start', - label: 'Brightness', - }), - }), - Widget.Box({ - class_name: 'menu-items-section', - vpack: 'fill', - vexpand: true, - vertical: true, - child: Widget.Box({ - class_name: 'brightness-container', - children: [ - Widget.Icon({ - vexpand: true, - vpack: 'center', - class_name: 'brightness-slider-icon', - icon: icons.brightness.screen, - }), - Widget.Slider({ - vpack: 'center', - vexpand: true, - value: brightness.bind('screen'), - class_name: 'menu-active-slider menu-slider brightness', - draw_value: false, - hexpand: true, - min: 0, - max: 1, - onChange: ({ value }) => (brightness.screen = value), - }), - Widget.Label({ - vpack: 'center', - vexpand: true, - class_name: 'brightness-slider-label', - label: brightness.bind('screen').as((b) => `${Math.round(b * 100)}%`), - }), - ], - }), - }), - ], - }); -}; - -export { Brightness }; diff --git a/ags/HyprPanel/modules/menus/energy/index.ts b/ags/HyprPanel/modules/menus/energy/index.ts deleted file mode 100644 index 134d2cc..0000000 --- a/ags/HyprPanel/modules/menus/energy/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import DropdownMenu from '../shared/dropdown/index.js'; -import { EnergyProfiles } from './profiles/index.js'; -import { Brightness } from './brightness/index.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import Window from 'types/widgets/window.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'energymenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items energy', - hpack: 'fill', - hexpand: true, - child: Widget.Box({ - vertical: true, - hpack: 'fill', - hexpand: true, - class_name: 'menu-items-container energy', - children: [Brightness(), EnergyProfiles()], - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/energy/profiles/index.ts b/ags/HyprPanel/modules/menus/energy/profiles/index.ts deleted file mode 100644 index 72b2824..0000000 --- a/ags/HyprPanel/modules/menus/energy/profiles/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -const powerProfiles = await Service.import('powerprofiles'); -import { PowerProfile, PowerProfileObject, PowerProfiles } from 'lib/types/powerprofiles.js'; -import { BoxWidget } from 'lib/types/widget.js'; -import icons from '../../../icons/index.js'; -import { uptime } from 'lib/variables.js'; - -const EnergyProfiles = (): BoxWidget => { - const isValidProfile = (profile: string): profile is PowerProfile => - profile === 'power-saver' || profile === 'balanced' || profile === 'performance'; - - function renderUptime(curUptime: number): string { - const days = Math.floor(curUptime / (60 * 24)); - const hours = Math.floor((curUptime % (60 * 24)) / 60); - const minutes = Math.floor(curUptime % 60); - return ` : ${days}d ${hours}h ${minutes}m`; - } - - return Widget.Box({ - class_name: 'menu-section-container energy', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container', - hpack: 'fill', - children: [ - Widget.Label({ - class_name: 'menu-label', - hexpand: true, - hpack: 'start', - label: 'Power Profile', - }), - Widget.Label({ - class_name: 'menu-label uptime', - label: uptime.bind().as(renderUptime), - tooltipText: 'Uptime', - }), - ], - }), - Widget.Box({ - class_name: 'menu-items-section', - vpack: 'fill', - vexpand: true, - vertical: true, - children: powerProfiles.bind('profiles').as((profiles: PowerProfiles) => { - return profiles.map((prof: PowerProfileObject) => { - const profileLabels = { - 'power-saver': 'Power Saver', - balanced: 'Balanced', - performance: 'Performance', - }; - - const profileType = prof.Profile; - - if (!isValidProfile(profileType)) { - return profileLabels.balanced; - } - - return Widget.Button({ - on_primary_click: () => { - powerProfiles.active_profile = prof.Profile; - }, - class_name: powerProfiles.bind('active_profile').as((active) => { - return `power-profile-item ${active === prof.Profile ? 'active' : ''}`; - }), - child: Widget.Box({ - children: [ - Widget.Icon({ - class_name: 'power-profile-icon', - icon: icons.powerprofile[profileType], - }), - Widget.Label({ - class_name: 'power-profile-label', - label: profileLabels[profileType], - }), - ], - }), - }); - }); - }), - }), - ], - }); -}; - -export { EnergyProfiles }; diff --git a/ags/HyprPanel/modules/menus/main.ts b/ags/HyprPanel/modules/menus/main.ts deleted file mode 100644 index 274579f..0000000 --- a/ags/HyprPanel/modules/menus/main.ts +++ /dev/null @@ -1,25 +0,0 @@ -import PowerMenu from './power/index.js'; -import Verification from './power/verification.js'; -import AudioMenu from './audio/index.js'; -import NetworkMenu from './network/index.js'; -import BluetoothMenu from './bluetooth/index.js'; -import MediaMenu from './media/index.js'; -import NotificationsMenu from './notifications/index.js'; -import CalendarMenu from './calendar/index.js'; -import EnergyMenu from './energy/index.js'; -import DashboardMenu from './dashboard/index.js'; -import PowerDropdown from './powerDropdown/index.js'; - -export default [ - PowerMenu(), - Verification(), - AudioMenu(), - NetworkMenu(), - BluetoothMenu(), - MediaMenu(), - NotificationsMenu(), - CalendarMenu(), - EnergyMenu(), - DashboardMenu(), - PowerDropdown(), -]; diff --git a/ags/HyprPanel/modules/menus/media/components/bar.ts b/ags/HyprPanel/modules/menus/media/components/bar.ts deleted file mode 100644 index 81448db..0000000 --- a/ags/HyprPanel/modules/menus/media/components/bar.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { Mpris, MprisPlayer } from 'types/service/mpris'; - -const media = await Service.import('mpris'); - -const Bar = (getPlayerInfo: (media: Mpris) => MprisPlayer): BoxWidget => { - return Widget.Box({ - class_name: 'media-indicator-current-progress-bar', - hexpand: true, - children: [ - Widget.Box({ - hexpand: true, - child: Widget.Slider({ - hexpand: true, - tooltip_text: '--', - class_name: 'menu-slider media progress', - draw_value: false, - on_change: ({ value }) => { - const foundPlayer = getPlayerInfo(media); - if (foundPlayer === undefined) { - return; - } - return (foundPlayer.position = value * foundPlayer.length); - }, - setup: (self) => { - const update = (): void => { - const foundPlayer = getPlayerInfo(media); - if (foundPlayer !== undefined) { - const value = foundPlayer.length ? foundPlayer.position / foundPlayer.length : 0; - self.value = value > 0 ? value : 0; - } else { - self.value = 0; - } - }; - self.hook(media, update); - self.poll(1000, update); - - const updateTooltip = (): void => { - const foundPlayer = getPlayerInfo(media); - if (foundPlayer === undefined) { - self.tooltip_text = '00:00'; - return; - } - const curHour = Math.floor(foundPlayer.position / 3600); - const curMin = Math.floor((foundPlayer.position % 3600) / 60); - const curSec = Math.floor(foundPlayer.position % 60); - - if (typeof foundPlayer.position === 'number' && foundPlayer.position >= 0) { - const formatTime = (time: number): string => { - return time.toString().padStart(2, '0'); - }; - - const formatHour = (hour: number): string => { - return hour > 0 ? formatTime(hour) + ':' : ''; - }; - - self.tooltip_text = `${formatHour(curHour)}${formatTime(curMin)}:${formatTime(curSec)}`; - } else { - self.tooltip_text = `00:00`; - } - }; - self.poll(1000, updateTooltip); - self.hook(media, updateTooltip); - }, - }), - }), - ], - }); -}; - -export { Bar }; diff --git a/ags/HyprPanel/modules/menus/media/components/controls.ts b/ags/HyprPanel/modules/menus/media/components/controls.ts deleted file mode 100644 index 5cbce21..0000000 --- a/ags/HyprPanel/modules/menus/media/components/controls.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { MprisPlayer } from 'types/service/mpris.js'; -import icons from '../../../icons/index.js'; -import { LoopStatus, PlaybackStatus } from 'lib/types/mpris.js'; -import { BoxWidget } from 'lib/types/widget.js'; -const media = await Service.import('mpris'); - -const Controls = (getPlayerInfo: () => MprisPlayer): BoxWidget => { - const isValidLoopStatus = (status: string): status is LoopStatus => ['none', 'track', 'playlist'].includes(status); - - const isValidPlaybackStatus = (status: string): status is PlaybackStatus => - ['playing', 'paused', 'stopped'].includes(status); - - const isLoopActive = (player: MprisPlayer): string => { - return player['loop_status'] !== null && ['track', 'playlist'].includes(player['loop_status'].toLowerCase()) - ? 'active' - : ''; - }; - - const isShuffleActive = (player: MprisPlayer): string => { - return player['shuffle_status'] !== null && player['shuffle_status'] ? 'active' : ''; - }; - - return Widget.Box({ - class_name: 'media-indicator-current-player-controls', - vertical: true, - children: [ - Widget.Box({ - class_name: 'media-indicator-current-controls', - hpack: 'center', - children: [ - Widget.Box({ - class_name: 'media-indicator-control shuffle', - children: [ - Widget.Button({ - hpack: 'center', - hasTooltip: true, - setup: (self) => { - self.hook(media, () => { - const foundPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - self.tooltip_text = 'Unavailable'; - self.class_name = 'media-indicator-control-button shuffle disabled'; - return; - } - - self.tooltip_text = - foundPlayer.shuffle_status !== null - ? foundPlayer.shuffle_status - ? 'Shuffling' - : 'Not Shuffling' - : null; - self.on_primary_click = (): void => { - foundPlayer.shuffle(); - }; - self.class_name = `media-indicator-control-button shuffle ${isShuffleActive(foundPlayer)} ${foundPlayer.shuffle_status !== null ? 'enabled' : 'disabled'}`; - }); - }, - child: Widget.Icon(icons.mpris.shuffle['enabled']), - }), - ], - }), - Widget.Box({ - children: [ - Widget.Button({ - hpack: 'center', - child: Widget.Icon(icons.mpris.prev), - setup: (self) => { - self.hook(media, () => { - const foundPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - self.class_name = 'media-indicator-control-button prev disabled'; - return; - } - - self.on_primary_click = (): void => { - foundPlayer.previous(); - }; - self.class_name = `media-indicator-control-button prev ${foundPlayer.can_go_prev !== null && foundPlayer.can_go_prev ? 'enabled' : 'disabled'}`; - }); - }, - }), - ], - }), - Widget.Box({ - children: [ - Widget.Button({ - hpack: 'center', - setup: (self) => { - self.hook(media, () => { - const foundPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - self.class_name = 'media-indicator-control-button play disabled'; - return; - } - - self.on_primary_click = (): void => { - foundPlayer.playPause(); - }; - self.class_name = `media-indicator-control-button play ${foundPlayer.can_play !== null ? 'enabled' : 'disabled'}`; - }); - }, - child: Widget.Icon({ - icon: Utils.watch(icons.mpris.paused, media, 'changed', () => { - const foundPlayer: MprisPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - return icons.mpris['paused']; - } - const playbackStatus = foundPlayer.play_back_status?.toLowerCase(); - - if (playbackStatus && isValidPlaybackStatus(playbackStatus)) { - return icons.mpris[playbackStatus]; - } else { - return icons.mpris['paused']; - } - }), - }), - }), - ], - }), - Widget.Box({ - class_name: `media-indicator-control next`, - children: [ - Widget.Button({ - hpack: 'center', - child: Widget.Icon(icons.mpris.next), - setup: (self) => { - self.hook(media, () => { - const foundPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - self.class_name = 'media-indicator-control-button next disabled'; - return; - } - - self.on_primary_click = (): void => { - foundPlayer.next(); - }; - self.class_name = `media-indicator-control-button next ${foundPlayer.can_go_next !== null && foundPlayer.can_go_next ? 'enabled' : 'disabled'}`; - }); - }, - }), - ], - }), - Widget.Box({ - class_name: 'media-indicator-control loop', - children: [ - Widget.Button({ - hpack: 'center', - setup: (self) => { - self.hook(media, () => { - const foundPlayer = getPlayerInfo(); - if (foundPlayer === undefined) { - self.tooltip_text = 'Unavailable'; - self.class_name = 'media-indicator-control-button shuffle disabled'; - return; - } - - self.tooltip_text = - foundPlayer.loop_status !== null - ? foundPlayer.loop_status - ? 'Shuffling' - : 'Not Shuffling' - : null; - self.on_primary_click = (): void => { - foundPlayer.loop(); - }; - self.class_name = `media-indicator-control-button loop ${isLoopActive(foundPlayer)} ${foundPlayer.loop_status !== null ? 'enabled' : 'disabled'}`; - }); - }, - child: Widget.Icon({ - setup: (self) => { - self.hook(media, () => { - const foundPlayer: MprisPlayer = getPlayerInfo(); - - if (foundPlayer === undefined) { - self.icon = icons.mpris.loop['none']; - return; - } - - const loopStatus = foundPlayer.loop_status?.toLowerCase(); - - if (loopStatus && isValidLoopStatus(loopStatus)) { - self.icon = icons.mpris.loop[loopStatus]; - } else { - self.icon = icons.mpris.loop['none']; - } - }); - }, - }), - }), - ], - }), - ], - }), - ], - }); -}; - -export { Controls }; diff --git a/ags/HyprPanel/modules/menus/media/components/mediainfo.ts b/ags/HyprPanel/modules/menus/media/components/mediainfo.ts deleted file mode 100644 index ea6cb76..0000000 --- a/ags/HyprPanel/modules/menus/media/components/mediainfo.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { MprisPlayer } from 'types/service/mpris'; - -const media = await Service.import('mpris'); - -const MediaInfo = (getPlayerInfo: () => MprisPlayer): BoxWidget => { - return Widget.Box({ - class_name: 'media-indicator-current-media-info', - hpack: 'center', - hexpand: true, - vertical: true, - children: [ - Widget.Box({ - class_name: 'media-indicator-current-song-name', - hpack: 'center', - children: [ - Widget.Label({ - truncate: 'end', - max_width_chars: 31, - wrap: true, - class_name: 'media-indicator-current-song-name-label', - setup: (self) => { - self.hook(media, () => { - const curPlayer = getPlayerInfo(); - return (self.label = - curPlayer !== undefined && curPlayer['track_title'].length - ? curPlayer['track_title'] - : 'No Media Currently Playing'); - }); - }, - }), - ], - }), - Widget.Box({ - class_name: 'media-indicator-current-song-author', - hpack: 'center', - children: [ - Widget.Label({ - truncate: 'end', - wrap: true, - max_width_chars: 35, - class_name: 'media-indicator-current-song-author-label', - setup: (self) => { - self.hook(media, () => { - const curPlayer = getPlayerInfo(); - - const makeArtistList = (trackArtists: string[]): string => { - if (trackArtists.length === 1 && !trackArtists[0].length) { - return '-----'; - } - - return trackArtists.join(', '); - }; - - return (self.label = - curPlayer !== undefined && curPlayer['track_artists'].length - ? makeArtistList(curPlayer['track_artists']) - : '-----'); - }); - }, - }), - ], - }), - Widget.Box({ - class_name: 'media-indicator-current-song-album', - hpack: 'center', - children: [ - Widget.Label({ - truncate: 'end', - wrap: true, - max_width_chars: 40, - class_name: 'media-indicator-current-song-album-label', - setup: (self) => { - self.hook(media, () => { - const curPlayer = getPlayerInfo(); - return (self.label = - curPlayer !== undefined && curPlayer['track_album'].length - ? curPlayer['track_album'] - : '---'); - }); - }, - }), - ], - }), - ], - }); -}; - -export { MediaInfo }; diff --git a/ags/HyprPanel/modules/menus/media/index.ts b/ags/HyprPanel/modules/menus/media/index.ts deleted file mode 100644 index 489034d..0000000 --- a/ags/HyprPanel/modules/menus/media/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Window from 'types/widgets/window.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -import { Media } from './media.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'mediamenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items media', - hpack: 'fill', - hexpand: true, - child: Widget.Box({ - class_name: 'menu-items-container media', - hpack: 'fill', - hexpand: true, - child: Media(), - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/media/media.ts b/ags/HyprPanel/modules/menus/media/media.ts deleted file mode 100644 index 2035516..0000000 --- a/ags/HyprPanel/modules/menus/media/media.ts +++ /dev/null @@ -1,97 +0,0 @@ -const media = await Service.import('mpris'); -import { MediaInfo } from './components/mediainfo.js'; -import { Controls } from './components/controls.js'; -import { Bar } from './components/bar.js'; -import { MprisPlayer } from 'types/service/mpris.js'; -import options from 'options.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const { tint, color } = options.theme.bar.menus.menu.media.card; - -const generateAlbumArt = (imageUrl: string): string => { - const userTint = tint.value; - const userHexColor = color.value; - - const r = parseInt(userHexColor.slice(1, 3), 16); - const g = parseInt(userHexColor.slice(3, 5), 16); - const b = parseInt(userHexColor.slice(5, 7), 16); - - const alpha = userTint / 100; - - const css = `background-image: linear-gradient( - rgba(${r}, ${g}, ${b}, ${alpha}), - rgba(${r}, ${g}, ${b}, ${alpha}), - ${userHexColor} 65em - ), url("${imageUrl}");`; - - return css; -}; -const Media = (): BoxWidget => { - const curPlayer = Variable(''); - - media.connect('changed', () => { - const statusOrder = { - Playing: 1, - Paused: 2, - Stopped: 3, - }; - - const isPlaying = media.players.find((p) => p['play_back_status'] === 'Playing'); - - const playerStillExists = media.players.some((p) => curPlayer.value === p['bus_name']); - - const nextPlayerUp = media.players.sort( - (a, b) => statusOrder[a['play_back_status']] - statusOrder[b['play_back_status']], - )[0].bus_name; - - if (isPlaying || !playerStillExists) { - curPlayer.value = nextPlayerUp; - } - }); - - const getPlayerInfo = (): MprisPlayer => { - return media.players.find((p) => p.bus_name === curPlayer.value) || media.players[0]; - }; - - return Widget.Box({ - class_name: 'menu-section-container', - children: [ - Widget.Box({ - class_name: 'menu-items-section', - vertical: false, - child: Widget.Box({ - class_name: 'menu-content', - children: [ - Widget.Box({ - class_name: 'media-content', - child: Widget.Box({ - class_name: 'media-indicator-right-section', - hpack: 'fill', - hexpand: true, - vertical: true, - children: [MediaInfo(getPlayerInfo), Controls(getPlayerInfo), Bar(getPlayerInfo)], - }), - }), - ], - setup: (self) => { - self.hook(media, () => { - const curPlayer = getPlayerInfo(); - if (curPlayer !== undefined) { - self.css = generateAlbumArt(curPlayer.track_cover_url); - } - }); - - Utils.merge([color.bind('value'), tint.bind('value')], () => { - const curPlayer = getPlayerInfo(); - if (curPlayer !== undefined) { - self.css = generateAlbumArt(curPlayer.track_cover_url); - } - }); - }, - }), - }), - ], - }); -}; - -export { Media }; diff --git a/ags/HyprPanel/modules/menus/network/ethernet/index.ts b/ags/HyprPanel/modules/menus/network/ethernet/index.ts deleted file mode 100644 index e1bf0d0..0000000 --- a/ags/HyprPanel/modules/menus/network/ethernet/index.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; - -const network = await Service.import('network'); - -const Ethernet = (): BoxWidget => { - return Widget.Box({ - class_name: 'menu-section-container ethernet', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container', - hpack: 'fill', - child: Widget.Label({ - class_name: 'menu-label', - hexpand: true, - hpack: 'start', - label: 'Ethernet', - }), - }), - Widget.Box({ - class_name: 'menu-items-section', - vertical: true, - child: Widget.Box({ - class_name: 'menu-content', - vertical: true, - setup: (self) => { - self.hook(network, () => { - return (self.child = Widget.Box({ - class_name: 'network-element-item', - child: Widget.Box({ - hpack: 'start', - children: [ - Widget.Icon({ - class_name: `network-icon ethernet ${network.wired.state === 'activated' ? 'active' : ''}`, - tooltip_text: network.wired.internet, - icon: `${network.wired['icon_name']}`, - }), - Widget.Box({ - class_name: 'connection-container', - vertical: true, - children: [ - Widget.Label({ - class_name: 'active-connection', - hpack: 'start', - truncate: 'end', - wrap: true, - label: `Ethernet Connection ${network.wired.state !== 'unknown' && typeof network.wired?.speed === 'number' ? `(${network.wired?.speed / 1000} Gbps)` : ''}`, - }), - Widget.Label({ - hpack: 'start', - class_name: 'connection-status dim', - label: - network.wired.internet.charAt(0).toUpperCase() + - network.wired.internet.slice(1), - }), - ], - }), - ], - }), - })); - }); - }, - }), - }), - ], - }); -}; - -export { Ethernet }; diff --git a/ags/HyprPanel/modules/menus/network/index.ts b/ags/HyprPanel/modules/menus/network/index.ts deleted file mode 100644 index f3e88dc..0000000 --- a/ags/HyprPanel/modules/menus/network/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import Window from 'types/widgets/window.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -import { Ethernet } from './ethernet/index.js'; -import { Wifi } from './wifi/index.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'networkmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items network', - child: Widget.Box({ - vertical: true, - hexpand: true, - class_name: 'menu-items-container network', - children: [Ethernet(), Wifi()], - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/network/utils.ts b/ags/HyprPanel/modules/menus/network/utils.ts deleted file mode 100644 index 229189a..0000000 --- a/ags/HyprPanel/modules/menus/network/utils.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WifiIcon } from 'lib/types/network'; - -const getWifiIcon = (iconName: string): WifiIcon => { - const deviceIconMap: [string, WifiIcon][] = [ - ['network-wireless-acquiring', '󰤩'], - ['network-wireless-connected', '󰤨'], - ['network-wireless-encrypted', '󰤪'], - ['network-wireless-hotspot', '󰤨'], - ['network-wireless-no-route', '󰤩'], - ['network-wireless-offline', '󰤮'], - ['network-wireless-signal-excellent', '󰤨'], - ['network-wireless-signal-good', '󰤥'], - ['network-wireless-signal-ok', '󰤢'], - ['network-wireless-signal-weak', '󰤟'], - ['network-wireless-signal-none', '󰤯'], - ]; - - const foundMatch = deviceIconMap.find((icon) => RegExp(icon[0]).test(iconName.toLowerCase())); - - return foundMatch ? foundMatch[1] : '󰤨'; -}; - -export { getWifiIcon }; diff --git a/ags/HyprPanel/modules/menus/network/wifi/APStaging.ts b/ags/HyprPanel/modules/menus/network/wifi/APStaging.ts deleted file mode 100644 index 29b2798..0000000 --- a/ags/HyprPanel/modules/menus/network/wifi/APStaging.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Network } from 'types/service/network'; -import { Variable } from 'types/variable'; -import { AccessPoint } from 'lib/types/network'; -import Box from 'types/widgets/box'; -import { Attribute, Child } from 'lib/types/widget'; - -const renderWapStaging = ( - self: Box, - network: Network, - staging: Variable, - connecting: Variable, -): void => { - Utils.merge([network.bind('wifi'), staging.bind('value')], () => { - if (!Object.keys(staging.value).length) { - return (self.child = Widget.Box()); - } - - return (self.child = Widget.Box({ - class_name: 'network-element-item staging', - vertical: true, - children: [ - Widget.Box({ - hpack: 'fill', - hexpand: true, - children: [ - Widget.Icon({ - class_name: `network-icon wifi`, - icon: `${staging.value.iconName}`, - }), - Widget.Box({ - class_name: 'connection-container', - hexpand: true, - vertical: true, - children: [ - Widget.Label({ - class_name: 'active-connection', - hpack: 'start', - truncate: 'end', - wrap: true, - label: staging.value.ssid, - }), - ], - }), - Widget.Revealer({ - hpack: 'end', - reveal_child: connecting.bind('value').as((c) => staging.value.bssid === c), - child: Widget.Spinner({ - class_name: 'spinner wap', - }), - }), - ], - }), - Widget.Box({ - class_name: 'network-password-input-container', - hpack: 'fill', - hexpand: true, - children: [ - Widget.Entry({ - hpack: 'start', - hexpand: true, - visibility: false, - class_name: 'network-password-input', - placeholder_text: 'enter password', - onAccept: (selfInp) => { - connecting.value = staging.value.bssid || ''; - Utils.execAsync( - `nmcli dev wifi connect ${staging.value.bssid} password ${selfInp.text}`, - ) - .catch((err) => { - connecting.value = ''; - console.error(`Failed to connect to wifi: ${staging.value.ssid}... ${err}`); - Utils.notify({ - summary: 'Network', - body: err, - timeout: 5000, - }); - }) - .then(() => { - connecting.value = ''; - staging.value = {} as AccessPoint; - }); - selfInp.text = ''; - }, - }), - Widget.Button({ - hpack: 'end', - class_name: 'close-network-password-input-button', - on_primary_click: () => { - connecting.value = ''; - staging.value = {} as AccessPoint; - }, - child: Widget.Icon({ - class_name: 'close-network-password-input-icon', - icon: 'window-close-symbolic', - }), - }), - ], - }), - ], - })); - }); -}; - -export { renderWapStaging }; diff --git a/ags/HyprPanel/modules/menus/network/wifi/WirelessAPs.ts b/ags/HyprPanel/modules/menus/network/wifi/WirelessAPs.ts deleted file mode 100644 index fac891d..0000000 --- a/ags/HyprPanel/modules/menus/network/wifi/WirelessAPs.ts +++ /dev/null @@ -1,219 +0,0 @@ -import { Network } from 'types/service/network.js'; -import { AccessPoint, WifiStatus } from 'lib/types/network.js'; -import { Variable } from 'types/variable.js'; -import { getWifiIcon } from '../utils.js'; -import { WIFI_STATUS_MAP } from 'globals/network.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import Box from 'types/widgets/box.js'; -const renderWAPs = ( - self: Box, - network: Network, - staging: Variable, - connecting: Variable, -): void => { - const getIdBySsid = (ssid: string, nmcliOutput: string): string | undefined => { - const lines = nmcliOutput.trim().split('\n'); - for (const line of lines) { - const columns = line.trim().split(/\s{2,}/); - if (columns[0].includes(ssid)) { - return columns[1]; - } - } - }; - - const isValidWifiStatus = (status: string): status is WifiStatus => { - return status in WIFI_STATUS_MAP; - }; - - const getWifiStatus = (): string => { - const wifiState = network.wifi.state?.toLowerCase(); - - if (wifiState && isValidWifiStatus(wifiState)) { - return WIFI_STATUS_MAP[wifiState]; - } - return WIFI_STATUS_MAP['unknown']; - }; - - self.hook(network, () => { - Utils.merge([staging.bind('value'), connecting.bind('value')], () => { - // NOTE: Sometimes the network service will yield a "this._device is undefined" when - // trying to access the "access_points" property. So we must validate that - // it's not 'undefined' - // -- - // Also this is an AGS bug that needs to be fixed - - // TODO: Remove @ts-ignore once AGS bug is fixed - // @ts-expect-error to fix AGS bug - let WAPs = network.wifi._device !== undefined ? network.wifi['access_points'] : []; - - const dedupeWAPs = (): AccessPoint[] => { - const dedupMap: Record = {}; - WAPs.forEach((item: AccessPoint) => { - if (item.ssid !== null && !Object.hasOwnProperty.call(dedupMap, item.ssid)) { - dedupMap[item.ssid] = item; - } - }); - - return Object.keys(dedupMap).map((itm) => dedupMap[itm]); - }; - - WAPs = dedupeWAPs(); - - const isInStaging = (wap: AccessPoint): boolean => { - if (Object.keys(staging.value).length === 0) { - return false; - } - - return wap.bssid === staging.value.bssid; - }; - - const isDisconnecting = (wap: AccessPoint): boolean => { - if (wap.ssid === network.wifi.ssid) { - return network.wifi.state.toLowerCase() === 'deactivating'; - } - return false; - }; - - const filteredWAPs = WAPs.filter((ap: AccessPoint) => { - return ap.ssid !== 'Unknown' && !isInStaging(ap); - }).sort((a: AccessPoint, b: AccessPoint) => { - if (network.wifi.ssid === a.ssid) { - return -1; - } - - if (network.wifi.ssid === b.ssid) { - return 1; - } - - return b.strength - a.strength; - }); - - if (filteredWAPs.length <= 0 && Object.keys(staging.value).length === 0) { - return (self.child = Widget.Label({ - class_name: 'waps-not-found dim', - expand: true, - hpack: 'center', - vpack: 'center', - label: 'No Wi-Fi Networks Found', - })); - } - return (self.children = filteredWAPs.map((ap: AccessPoint) => { - return Widget.Box({ - children: [ - Widget.Button({ - on_primary_click: () => { - if (ap.bssid === connecting.value || ap.active) { - return; - } - - connecting.value = ap.bssid || ''; - Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`) - .then(() => { - connecting.value = ''; - staging.value = {} as AccessPoint; - }) - .catch((err) => { - if (err.toLowerCase().includes('secrets were required, but not provided')) { - staging.value = ap; - } else { - Utils.notify({ - summary: 'Network', - body: err, - timeout: 5000, - }); - } - connecting.value = ''; - }); - }, - class_name: 'network-element-item', - child: Widget.Box({ - hexpand: true, - children: [ - Widget.Box({ - hpack: 'start', - hexpand: true, - children: [ - Widget.Label({ - vpack: 'start', - class_name: `network-icon wifi ${ap.ssid === network.wifi.ssid ? 'active' : ''} txt-icon`, - label: getWifiIcon(`${ap['iconName']}`), - }), - Widget.Box({ - class_name: 'connection-container', - vpack: 'center', - vertical: true, - children: [ - Widget.Label({ - vpack: 'center', - class_name: 'active-connection', - hpack: 'start', - truncate: 'end', - wrap: true, - label: ap.ssid, - }), - Widget.Revealer({ - revealChild: ap.ssid === network.wifi.ssid, - child: Widget.Label({ - hpack: 'start', - class_name: 'connection-status dim', - label: getWifiStatus(), - }), - }), - ], - }), - ], - }), - Widget.Revealer({ - hpack: 'end', - vpack: 'start', - reveal_child: ap.bssid === connecting.value || isDisconnecting(ap), - child: Widget.Spinner({ - vpack: 'start', - class_name: 'spinner wap', - }), - }), - ], - }), - }), - Widget.Revealer({ - vpack: 'start', - reveal_child: ap.bssid !== connecting.value && ap.active, - child: Widget.Button({ - tooltip_text: 'Delete/Forget Network', - class_name: 'menu-icon-button network disconnect', - on_primary_click: () => { - connecting.value = ap.bssid || ''; - Utils.execAsync('nmcli connection show --active').then(() => { - Utils.execAsync('nmcli connection show --active').then((res) => { - const connectionId = getIdBySsid(ap.ssid || '', res); - - if (connectionId === undefined) { - console.error( - `Error while forgetting "${ap.ssid}": Connection ID not found`, - ); - return; - } - - Utils.execAsync(`nmcli connection delete ${connectionId} "${ap.ssid}"`) - .then(() => (connecting.value = '')) - .catch((err) => { - connecting.value = ''; - console.error(`Error while forgetting "${ap.ssid}": ${err}`); - }); - }); - }); - }, - child: Widget.Label({ - class_name: 'txt-icon delete-network', - label: '󰚃', - }), - }), - }), - ], - }); - })); - }); - }); -}; - -export { renderWAPs }; diff --git a/ags/HyprPanel/modules/menus/network/wifi/index.ts b/ags/HyprPanel/modules/menus/network/wifi/index.ts deleted file mode 100644 index 57948f6..0000000 --- a/ags/HyprPanel/modules/menus/network/wifi/index.ts +++ /dev/null @@ -1,81 +0,0 @@ -const network = await Service.import('network'); -import { renderWAPs } from './WirelessAPs.js'; -import { renderWapStaging } from './APStaging.js'; -import { AccessPoint } from 'lib/types/network.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const Staging = Variable({} as AccessPoint); -const Connecting = Variable(''); - -const searchInProgress = Variable(false); - -const startRotation = (): void => { - searchInProgress.value = true; - setTimeout(() => { - searchInProgress.value = false; - }, 5 * 1000); -}; - -const Wifi = (): BoxWidget => { - return Widget.Box({ - class_name: 'menu-section-container wifi', - vertical: true, - children: [ - Widget.Box({ - class_name: 'menu-label-container', - hpack: 'fill', - children: [ - Widget.Label({ - class_name: 'menu-label', - hexpand: true, - hpack: 'start', - label: 'Wi-Fi', - }), - Widget.Switch({ - class_name: 'menu-switch network', - vpack: 'center', - tooltip_text: 'Toggle Wifi', - active: network.wifi.enabled, - on_activate: () => { - network.toggleWifi(); - }, - }), - Widget.Button({ - vpack: 'center', - hpack: 'end', - class_name: 'menu-icon-button search network', - on_primary_click: () => { - startRotation(); - network.wifi.scan(); - }, - child: Widget.Icon({ - class_name: searchInProgress.bind('value').as((v) => (v ? 'spinning' : '')), - icon: 'view-refresh-symbolic', - }), - }), - ], - }), - Widget.Box({ - class_name: 'menu-items-section', - vertical: true, - children: [ - Widget.Box({ - class_name: 'wap-staging', - setup: (self) => { - renderWapStaging(self, network, Staging, Connecting); - }, - }), - Widget.Box({ - class_name: 'available-waps', - vertical: true, - setup: (self) => { - renderWAPs(self, network, Staging, Connecting); - }, - }), - ], - }), - ], - }); -}; - -export { Wifi }; diff --git a/ags/HyprPanel/modules/menus/notifications/controls/index.ts b/ags/HyprPanel/modules/menus/notifications/controls/index.ts deleted file mode 100644 index a2964fd..0000000 --- a/ags/HyprPanel/modules/menus/notifications/controls/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { closeNotifications } from 'globals/notification'; -import { BoxWidget } from 'lib/types/widget'; -import { Notifications } from 'types/service/notifications'; -import options from 'options'; - -const { clearDelay } = options.notifications; - -const Controls = (notifs: Notifications): BoxWidget => { - return Widget.Box({ - class_name: 'notification-menu-controls', - expand: false, - vertical: false, - children: [ - Widget.Box({ - class_name: 'menu-label-container notifications', - hpack: 'start', - vpack: 'center', - expand: true, - children: [ - Widget.Label({ - class_name: 'menu-label notifications', - label: 'Notifications', - }), - ], - }), - Widget.Box({ - hpack: 'end', - vpack: 'center', - expand: false, - children: [ - Widget.Switch({ - class_name: 'menu-switch notifications', - vpack: 'center', - active: notifs.bind('dnd').as((dnd: boolean) => !dnd), - on_activate: ({ active }) => { - notifs.dnd = !active; - }, - }), - Widget.Box({ - children: [ - Widget.Separator({ - hpack: 'center', - vexpand: true, - vertical: true, - class_name: 'menu-separator notification-controls', - }), - Widget.Button({ - className: 'clear-notifications-button', - tooltip_text: 'Clear Notifications', - on_primary_click: clearDelay.bind('value').as((delay) => { - return () => { - if (removingNotifications.value) { - return; - } - - return closeNotifications(notifs.notifications, delay); - }; - }), - child: Widget.Label({ - class_name: removingNotifications.bind('value').as((removing: boolean) => { - return removing - ? 'clear-notifications-label txt-icon removing' - : 'clear-notifications-label txt-icon'; - }), - label: '', - }), - }), - ], - }), - ], - }), - ], - }); -}; - -export { Controls }; diff --git a/ags/HyprPanel/modules/menus/notifications/index.ts b/ags/HyprPanel/modules/menus/notifications/index.ts deleted file mode 100644 index bbdbce2..0000000 --- a/ags/HyprPanel/modules/menus/notifications/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Notification } from 'types/service/notifications.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -const notifs = await Service.import('notifications'); -import { Controls } from './controls/index.js'; -import { NotificationCard } from './notification/index.js'; -import { NotificationPager } from './pager/index.js'; - -import options from 'options'; -import Window from 'types/widgets/window.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const { displayedTotal } = options.notifications; - -export default (): Window => { - const curPage = Variable(1); - - Utils.merge( - [curPage.bind('value'), displayedTotal.bind('value'), notifs.bind('notifications')], - (currentPage: number, dispTotal: number, notifications: Notification[]) => { - // If the page doesn't have enough notifications to display, go back - // to the previous page. - if (notifications.length <= (currentPage - 1) * dispTotal) { - curPage.value = currentPage <= 1 ? 1 : currentPage - 1; - } - }, - ); - - return DropdownMenu({ - name: 'notificationsmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'notification-menu-content', - css: 'padding: 1px; margin: -1px;', - hexpand: true, - vexpand: false, - children: [ - Widget.Box({ - class_name: 'notification-card-container menu', - vertical: true, - hexpand: false, - vexpand: false, - children: [Controls(notifs), NotificationCard(notifs, curPage), NotificationPager(curPage)], - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/actions/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/actions/index.ts deleted file mode 100644 index bf68dad..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/actions/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { Notification, Notifications } from 'types/service/notifications'; -const Actions = (notif: Notification, notifs: Notifications): BoxWidget => { - if (notif.actions !== undefined && notif.actions.length > 0) { - return Widget.Box({ - class_name: 'notification-card-actions menu', - hexpand: true, - vpack: 'end', - children: notif.actions.map((action) => { - return Widget.Button({ - hexpand: true, - class_name: 'notification-action-buttons menu', - on_primary_click: () => { - if (action.id.includes('scriptAction:-')) { - App.closeWindow('notificationsmenu'); - Utils.execAsync(`${action.id.replace('scriptAction:-', '')}`).catch((err) => - console.error(err), - ); - notifs.CloseNotification(notif.id); - } else { - App.closeWindow('notificationsmenu'); - notif.invoke(action.id); - } - }, - child: Widget.Box({ - hpack: 'center', - hexpand: true, - children: [ - Widget.Label({ - class_name: 'notification-action-buttons-label menu', - hexpand: true, - max_width_chars: 15, - truncate: 'end', - wrap: true, - label: action.label, - }), - ], - }), - }); - }), - }); - } - - return Widget.Box({ - class_name: 'spacer', - }); -}; - -export { Actions }; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/body/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/body/index.ts deleted file mode 100644 index 62aac7a..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/body/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { BoxWidget } from 'lib/types/widget.js'; -import { notifHasImg } from '../../utils.js'; -import { Notification } from 'types/service/notifications'; - -export const Body = (notif: Notification): BoxWidget => { - return Widget.Box({ - vpack: 'start', - hexpand: true, - class_name: 'notification-card-body menu', - children: [ - Widget.Label({ - hexpand: true, - use_markup: true, - xalign: 0, - justification: 'left', - truncate: 'end', - lines: 2, - max_width_chars: !notifHasImg(notif) ? 35 : 28, - wrap: true, - class_name: 'notification-card-body-label menu', - label: notif['body'], - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/close/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/close/index.ts deleted file mode 100644 index 261f949..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/close/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Attribute } from 'lib/types/widget'; -import { Notification, Notifications } from 'types/service/notifications'; -import Button from 'types/widgets/button'; -import Label from 'types/widgets/label'; -export const CloseButton = (notif: Notification, notifs: Notifications): Button, Attribute> => { - return Widget.Button({ - class_name: 'close-notification-button menu', - on_primary_click: () => { - notifs.CloseNotification(notif.id); - }, - child: Widget.Label({ - class_name: 'txt-icon notif-close', - label: '󰅜', - hpack: 'center', - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/header/icon.ts b/ags/HyprPanel/modules/menus/notifications/notification/header/icon.ts deleted file mode 100644 index c51bc01..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/header/icon.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Notification } from 'types/service/notifications.js'; -import { NotificationIcon } from 'lib/types/notification.js'; -import { getNotificationIcon } from 'globals/notification'; -import { BoxWidget } from 'lib/types/widget'; - -const NotificationIcon = ({ app_entry = '', app_icon = '', app_name = '' }: Partial): BoxWidget => { - return Widget.Box({ - css: ` - min-width: 2rem; - min-height: 2rem; - `, - child: Widget.Icon({ - class_name: 'notification-icon menu', - icon: getNotificationIcon(app_name, app_icon, app_entry), - }), - }); -}; - -export { NotificationIcon }; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/header/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/header/index.ts deleted file mode 100644 index 1373ae3..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/header/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import GLib from 'gi://GLib'; -import { Notification } from 'types/service/notifications'; -import { NotificationIcon } from './icon.js'; -import { notifHasImg } from '../../utils.js'; -import options from 'options.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const { military } = options.menus.clock.time; - -export const Header = (notif: Notification): BoxWidget => { - const time = (time: number, format = '%I:%M %p'): string => { - return GLib.DateTime.new_from_unix_local(time).format(military.value ? '%H:%M' : format) || '--:--'; - }; - - return Widget.Box({ - vertical: false, - hexpand: true, - children: [ - Widget.Box({ - class_name: 'notification-card-header menu', - hpack: 'start', - children: [NotificationIcon(notif)], - }), - Widget.Box({ - class_name: 'notification-card-header menu', - hexpand: true, - vpack: 'start', - children: [ - Widget.Label({ - class_name: 'notification-card-header-label menu', - hpack: 'start', - hexpand: true, - vexpand: true, - max_width_chars: !notifHasImg(notif) ? 34 : 22, - truncate: 'end', - wrap: true, - label: notif['summary'], - }), - ], - }), - Widget.Box({ - class_name: 'notification-card-header menu', - hpack: 'end', - vpack: 'start', - hexpand: true, - child: Widget.Label({ - vexpand: true, - class_name: 'notification-time', - label: time(notif.time), - }), - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/image/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/image/index.ts deleted file mode 100644 index 6b01768..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/image/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Notification } from 'types/service/notifications'; -import { notifHasImg } from '../../utils.js'; -import { BoxWidget } from 'lib/types/widget.js'; - -const Image = (notif: Notification): BoxWidget => { - if (notifHasImg(notif)) { - return Widget.Box({ - class_name: 'notification-card-image-container menu', - hpack: 'center', - vpack: 'center', - vexpand: false, - child: Widget.Box({ - hpack: 'center', - vexpand: false, - class_name: 'notification-card-image menu', - css: `background-image: url("${notif.image}")`, - }), - }); - } - - return Widget.Box(); -}; - -export { Image }; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/index.ts deleted file mode 100644 index 9254327..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/index.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Notifications, Notification } from 'types/service/notifications'; -import { notifHasImg } from '../utils.js'; -import { Header } from './header/index.js'; -import { Actions } from './actions/index.js'; -import { Image } from './image/index.js'; -import { Placeholder } from './placeholder/index.js'; -import { Body } from './body/index.js'; -import { CloseButton } from './close/index.js'; -import options from 'options.js'; -import { Variable } from 'types/variable.js'; -import { filterNotifications } from 'lib/shared/notifications.js'; -import Scrollable from 'types/widgets/scrollable.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const { displayedTotal, ignore } = options.notifications; - -const NotificationCard = (notifs: Notifications, curPage: Variable): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - child: Widget.Box({ - class_name: 'menu-content-container notifications', - hpack: 'center', - vexpand: true, - spacing: 0, - vertical: true, - setup: (self) => { - Utils.merge( - [ - notifs.bind('notifications'), - curPage.bind('value'), - displayedTotal.bind('value'), - ignore.bind('value'), - ], - (notifications, currentPage, dispTotal, ignoredNotifs) => { - const filteredNotifications = filterNotifications(notifications, ignoredNotifs); - - const sortedNotifications = filteredNotifications.sort((a, b) => b.time - a.time); - - if (filteredNotifications.length <= 0) { - return (self.children = [Placeholder(notifs)]); - } - - const pageStart = (currentPage - 1) * dispTotal; - const pageEnd = currentPage * dispTotal; - return (self.children = sortedNotifications - .slice(pageStart, pageEnd) - .map((notif: Notification) => { - return Widget.Box({ - class_name: 'notification-card-content-container', - children: [ - Widget.Box({ - class_name: 'notification-card menu', - vpack: 'start', - hexpand: true, - vexpand: false, - children: [ - Image(notif), - Widget.Box({ - vpack: 'center', - vertical: true, - hexpand: true, - class_name: `notification-card-content ${!notifHasImg(notif) ? 'noimg' : ' menu'}`, - children: [Header(notif), Body(notif), Actions(notif, notifs)], - }), - ], - }), - CloseButton(notif, notifs), - ], - }); - })); - }, - ); - }, - }), - }); -}; - -export { NotificationCard }; diff --git a/ags/HyprPanel/modules/menus/notifications/notification/placeholder/index.ts b/ags/HyprPanel/modules/menus/notifications/notification/placeholder/index.ts deleted file mode 100644 index e22df55..0000000 --- a/ags/HyprPanel/modules/menus/notifications/notification/placeholder/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { BoxWidget } from 'lib/types/widget'; -import { Notifications } from 'types/service/notifications'; - -const Placeholder = (notifs: Notifications): BoxWidget => { - return Widget.Box({ - class_name: 'notification-label-container', - vpack: 'fill', - hpack: 'center', - expand: true, - child: Widget.Box({ - vpack: 'center', - vertical: true, - expand: true, - children: [ - Widget.Label({ - vpack: 'center', - class_name: 'placeholder-label dim bell txt-icon', - label: notifs.bind('dnd').as((dnd) => (dnd ? '󰂛' : '󰂚')), - }), - Widget.Label({ - vpack: 'start', - class_name: 'placehold-label dim message', - label: "You're all caught up :)", - }), - ], - }), - }); -}; - -export { Placeholder }; diff --git a/ags/HyprPanel/modules/menus/notifications/pager/index.ts b/ags/HyprPanel/modules/menus/notifications/pager/index.ts deleted file mode 100644 index 1a4571b..0000000 --- a/ags/HyprPanel/modules/menus/notifications/pager/index.ts +++ /dev/null @@ -1,88 +0,0 @@ -const notifs = await Service.import('notifications'); - -import { BoxWidget } from 'lib/types/widget'; -import options from 'options'; -import { Notification } from 'types/service/notifications'; -import { Variable } from 'types/variable'; - -const { displayedTotal } = options.notifications; -const { show: showPager } = options.theme.bar.menus.menu.notifications.pager; - -export const NotificationPager = (curPage: Variable): BoxWidget => { - return Widget.Box({ - class_name: 'notification-menu-pager', - hexpand: true, - vexpand: false, - children: Utils.merge( - [ - curPage.bind('value'), - displayedTotal.bind('value'), - notifs.bind('notifications'), - showPager.bind('value'), - ], - (currentPage: number, dispTotal: number, _: Notification[], showPgr: boolean) => { - if (showPgr === false || (currentPage === 1 && notifs.notifications.length <= dispTotal)) { - return []; - } - return [ - Widget.Button({ - hexpand: true, - hpack: 'start', - class_name: `pager-button left ${currentPage <= 1 ? 'disabled' : ''}`, - onPrimaryClick: () => { - curPage.value = 1; - }, - child: Widget.Label({ - className: 'pager-button-label', - label: '', - }), - }), - Widget.Button({ - hexpand: true, - hpack: 'start', - class_name: `pager-button left ${currentPage <= 1 ? 'disabled' : ''}`, - onPrimaryClick: () => { - curPage.value = currentPage <= 1 ? 1 : currentPage - 1; - }, - child: Widget.Label({ - className: 'pager-button-label', - label: '', - }), - }), - Widget.Label({ - hexpand: true, - hpack: 'center', - class_name: 'pager-label', - label: `${currentPage} / ${Math.ceil(notifs.notifications.length / dispTotal) || 1}`, - }), - Widget.Button({ - hexpand: true, - hpack: 'end', - class_name: `pager-button right ${currentPage >= Math.ceil(notifs.notifications.length / dispTotal) ? 'disabled' : ''}`, - onPrimaryClick: () => { - const maxPage = Math.ceil(notifs.notifications.length / displayedTotal.value); - curPage.value = currentPage >= maxPage ? currentPage : currentPage + 1; - }, - child: Widget.Label({ - className: 'pager-button-label', - label: '', - }), - }), - Widget.Button({ - hexpand: true, - hpack: 'end', - class_name: `pager-button right ${currentPage >= Math.ceil(notifs.notifications.length / dispTotal) ? 'disabled' : ''}`, - onPrimaryClick: () => { - const maxPage = Math.ceil(notifs.notifications.length / displayedTotal.value); - curPage.value = maxPage; - }, - child: Widget.Label({ - className: 'pager-button-label', - label: '󰄾', - }), - }), - ]; - }, - ), - }); -}; diff --git a/ags/HyprPanel/modules/menus/notifications/utils.ts b/ags/HyprPanel/modules/menus/notifications/utils.ts deleted file mode 100644 index dcf2c7d..0000000 --- a/ags/HyprPanel/modules/menus/notifications/utils.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Notification } from 'types/service/notifications'; - -const notifHasImg = (notif: Notification): boolean => { - return notif.image !== undefined && notif.image.length ? true : false; -}; - -export { notifHasImg }; diff --git a/ags/HyprPanel/modules/menus/power/helpers/actions.ts b/ags/HyprPanel/modules/menus/power/helpers/actions.ts deleted file mode 100644 index fee7dfa..0000000 --- a/ags/HyprPanel/modules/menus/power/helpers/actions.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Action } from 'lib/types/power'; -import options from 'options'; -const { sleep, reboot, logout, shutdown } = options.menus.dashboard.powermenu; - -class PowerMenu extends Service { - static { - Service.register( - this, - {}, - { - title: ['string'], - cmd: ['string'], - }, - ); - } - - #title = ''; - #cmd = ''; - - get title(): string { - return this.#title; - } - - action(action: Action): void { - [this.#cmd, this.#title] = { - sleep: [sleep.value, 'Sleep'], - reboot: [reboot.value, 'Reboot'], - logout: [logout.value, 'Log Out'], - shutdown: [shutdown.value, 'Shutdown'], - }[action]; - - this.notify('cmd'); - this.notify('title'); - this.emit('changed'); - App.closeWindow('powermenu'); - App.openWindow('verification'); - } - - customAction(action: Action, cmnd: string): void { - [this.#cmd, this.#title] = [cmnd, action]; - - this.notify('cmd'); - this.notify('title'); - this.emit('changed'); - App.closeWindow('powermenu'); - App.openWindow('verification'); - } - - shutdown = (): void => { - this.action('shutdown'); - }; - - exec = (): void => { - App.closeWindow('verification'); - Utils.execAsync(this.#cmd); - }; -} - -const powermenu = new PowerMenu(); -Object.assign(globalThis, { powermenu }); -export default powermenu; diff --git a/ags/HyprPanel/modules/menus/power/index.ts b/ags/HyprPanel/modules/menus/power/index.ts deleted file mode 100644 index bb8505d..0000000 --- a/ags/HyprPanel/modules/menus/power/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Action } from 'lib/types/power.js'; -import PopupWindow from '../shared/popup/index.js'; -import powermenu from './helpers/actions.js'; -import icons from '../../icons/index.js'; -import Window from 'types/widgets/window.js'; -import { Attribute, Child, GButton } from 'lib/types/widget.js'; -import options from 'options.js'; - -const SysButton = (action: Action, label: string): GButton => - Widget.Button({ - class_name: `widget-button powermenu-button-${action}`, - on_clicked: () => powermenu.action(action), - child: Widget.Box({ - vertical: true, - class_name: 'system-button widget-box', - children: [ - Widget.Icon({ - class_name: `system-button_icon ${action}`, - icon: icons.powermenu[action], - }), - Widget.Label({ - class_name: `system-button_label ${action}`, - label, - }), - ], - }), - }); -export default (): Window => - PopupWindow({ - name: 'powermenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'powermenu horizontal', - children: [ - SysButton('shutdown', 'SHUTDOWN'), - SysButton('logout', 'LOG OUT'), - SysButton('reboot', 'REBOOT'), - SysButton('sleep', 'SLEEP'), - ], - }), - }); diff --git a/ags/HyprPanel/modules/menus/power/verification.ts b/ags/HyprPanel/modules/menus/power/verification.ts deleted file mode 100644 index a71f46b..0000000 --- a/ags/HyprPanel/modules/menus/power/verification.ts +++ /dev/null @@ -1,54 +0,0 @@ -import Window from 'types/widgets/window.js'; -import PopupWindow from '../shared/popup/index.js'; -import powermenu from './helpers/actions.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -export default (): Window => - PopupWindow({ - name: 'verification', - transition: 'crossfade', - child: Widget.Box({ - class_name: 'verification', - child: Widget.Box({ - class_name: 'verification-content', - expand: true, - vertical: true, - children: [ - Widget.Box({ - class_name: 'text-box', - vertical: true, - children: [ - Widget.Label({ - class_name: 'title', - label: powermenu.bind('title').as((t) => t.toUpperCase()), - }), - Widget.Label({ - class_name: 'desc', - label: powermenu - .bind('title') - .as((p) => `Are you sure you want to ${p.toLowerCase()}?`), - }), - ], - }), - Widget.Box({ - class_name: 'buttons horizontal', - vexpand: true, - vpack: 'end', - homogeneous: true, - children: [ - Widget.Button({ - class_name: 'verification-button bar-verification_yes', - child: Widget.Label('Yes'), - on_clicked: powermenu.exec, - }), - Widget.Button({ - class_name: 'verification-button bar-verification_no', - child: Widget.Label('No'), - on_clicked: () => App.toggleWindow('verification'), - }), - ], - }), - ], - }), - }), - }); diff --git a/ags/HyprPanel/modules/menus/powerDropdown/button.ts b/ags/HyprPanel/modules/menus/powerDropdown/button.ts deleted file mode 100644 index f2ae20f..0000000 --- a/ags/HyprPanel/modules/menus/powerDropdown/button.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { PowerOptions } from 'lib/types/options'; -import options from 'options'; -import powermenu from '../power/helpers/actions'; -import { GButton } from 'lib/types/widget'; - -const { confirmation, shutdown, logout, sleep, reboot, showLabel } = options.menus.power; - -export const PowerButton = (action: PowerOptions): GButton => { - const handleClick = (action: PowerOptions): void => { - const actions = { - shutdown: shutdown.value, - reboot: reboot.value, - logout: logout.value, - sleep: sleep.value, - }; - App.closeWindow('powerdropdownmenu'); - - if (!confirmation.value) { - Utils.execAsync(actions[action]).catch((err) => - console.error(`Failed to execute ${action} command. Error: ${err}`), - ); - } else { - powermenu.customAction(action, actions[action]); - } - }; - - const powerIconMap = { - shutdown: '󰐥', - reboot: '󰜉', - logout: '󰿅', - sleep: '󰤄', - }; - - return Widget.Button({ - className: showLabel.bind('value').as((shwLbl) => { - return `power-menu-button ${action} ${!shwLbl ? 'no-label' : ''}`; - }), - on_clicked: () => handleClick(action), - child: Widget.Box({ - vertical: false, - children: showLabel.bind('value').as((shwLbl) => { - if (shwLbl) { - return [ - Widget.Label({ - label: powerIconMap[action], - className: `power-button-icon ${action}-icon txt-icon`, - }), - Widget.Label({ - hpack: 'center', - hexpand: true, - label: action.charAt(0).toUpperCase() + action.slice(1), - className: `power-button-label ${action}-label show-label`, - }), - ]; - } - return [ - Widget.Label({ - label: powerIconMap[action], - className: `power-button-icon ${action}-icon no-label txt-icon`, - }), - ]; - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/powerDropdown/index.ts b/ags/HyprPanel/modules/menus/powerDropdown/index.ts deleted file mode 100644 index 1562d8b..0000000 --- a/ags/HyprPanel/modules/menus/powerDropdown/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import Window from 'types/widgets/window.js'; -import DropdownMenu from '../shared/dropdown/index.js'; -import { PowerButton } from './button.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -import options from 'options.js'; - -export default (): Window => { - return DropdownMenu({ - name: 'powerdropdownmenu', - transition: options.menus.transition.bind('value'), - child: Widget.Box({ - class_name: 'menu-items power-dropdown', - child: Widget.Box({ - vertical: true, - hexpand: true, - class_name: 'menu-items-container power-dropdown', - children: [PowerButton('shutdown'), PowerButton('reboot'), PowerButton('logout'), PowerButton('sleep')], - }), - }), - }); -}; diff --git a/ags/HyprPanel/modules/menus/shared/dropdown/eventBoxes/index.ts b/ags/HyprPanel/modules/menus/shared/dropdown/eventBoxes/index.ts deleted file mode 100644 index 727610d..0000000 --- a/ags/HyprPanel/modules/menus/shared/dropdown/eventBoxes/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Attribute, BoxWidget } from 'lib/types/widget'; -import EventBox from 'types/widgets/eventbox'; -import { BarLocation } from 'lib/types/options'; - -const createEventBox = (className: string, windowName: string): EventBox => { - return Widget.EventBox({ - class_name: className, - hexpand: true, - vexpand: false, - can_focus: false, - child: Widget.Box(), - setup: (w) => { - w.on('button-press-event', () => App.toggleWindow(windowName)); - }, - }); -}; - -export const barEventMargins = ( - windowName: string, - location: BarLocation = 'top', -): [EventBox, EventBox] => { - if (location === 'top') { - return [ - createEventBox('mid-eb event-top-padding-static', windowName), - createEventBox('mid-eb event-top-padding', windowName), - ]; - } else { - return [ - createEventBox('mid-eb event-bottom-padding', windowName), - createEventBox('mid-eb event-bottom-padding-static', windowName), - ]; - } -}; diff --git a/ags/HyprPanel/modules/menus/shared/dropdown/index.ts b/ags/HyprPanel/modules/menus/shared/dropdown/index.ts deleted file mode 100644 index d9496e7..0000000 --- a/ags/HyprPanel/modules/menus/shared/dropdown/index.ts +++ /dev/null @@ -1,98 +0,0 @@ -import options from 'options'; -import { DropdownMenuProps } from 'lib/types/dropdownmenu'; -import { Attribute, Child, Exclusivity } from 'lib/types/widget'; -import Window from 'types/widgets/window'; -import { barEventMargins } from './eventBoxes/index'; -import { globalEventBoxes } from 'globals/dropdown'; - -const { location } = options.theme.bar; - -// NOTE: We make the window visible for 2 seconds (on startup) so the child -// elements can allocat their proper dimensions. -// Otherwise the width that we rely on for menu positioning is set improperly -// for the first time we open a menu of each type. -const initRender = Variable(true); - -setTimeout(() => { - initRender.value = false; -}, 2000); - -export default ({ - name, - child, - transition, - exclusivity = 'ignore' as Exclusivity, - ...props -}: DropdownMenuProps): Window => - Widget.Window({ - name, - class_names: [name, 'dropdown-menu'], - setup: (w) => w.keybind('Escape', () => App.closeWindow(name)), - visible: initRender.bind('value'), - keymode: 'on-demand', - exclusivity, - layer: 'top', - anchor: location.bind('value').as((ln) => [ln, 'left']), - child: Widget.EventBox({ - class_name: 'parent-event', - on_primary_click: () => App.closeWindow(name), - on_secondary_click: () => App.closeWindow(name), - child: Widget.Box({ - class_name: 'top-eb', - vertical: true, - children: [ - Widget.Box({ - className: 'event-box-container', - children: location.bind('value').as((lcn) => { - if (lcn === 'top') { - return barEventMargins(name); - } else { - return []; - } - }), - }), - Widget.EventBox({ - class_name: 'in-eb menu-event-box', - on_primary_click: () => { - return true; - }, - on_secondary_click: () => { - return true; - }, - setup: (self) => { - globalEventBoxes.value[name] = self; - }, - child: Widget.Box({ - class_name: 'dropdown-menu-container', - css: 'padding: 1px; margin: -1px;', - child: Widget.Revealer({ - revealChild: false, - setup: (self) => - self.hook(App, (_, wname, visible) => { - if (wname === name) self.reveal_child = visible; - }), - transition, - transitionDuration: options.menus.transitionTime.bind('value'), - child: Widget.Box({ - class_name: 'dropdown-menu-container', - can_focus: true, - children: [child], - }), - }), - }), - }), - Widget.Box({ - className: 'event-box-container', - children: location.bind('value').as((lcn) => { - if (lcn === 'bottom') { - return barEventMargins(name); - } else { - return []; - } - }), - }), - ], - }), - }), - ...props, - }); diff --git a/ags/HyprPanel/modules/menus/shared/dropdown/locationHandler/index.ts b/ags/HyprPanel/modules/menus/shared/dropdown/locationHandler/index.ts deleted file mode 100644 index 28ce7c7..0000000 --- a/ags/HyprPanel/modules/menus/shared/dropdown/locationHandler/index.ts +++ /dev/null @@ -1,98 +0,0 @@ -const hyprland = await Service.import('hyprland'); - -import options from 'options'; -import { bash } from 'lib/utils'; -import { Widget as TWidget } from 'types/@girs/gtk-3.0/gtk-3.0.cjs'; -import { Monitor } from 'types/service/hyprland'; -import Box from 'types/widgets/box'; -import EventBox from 'types/widgets/eventbox'; -import Revealer from 'types/widgets/revealer'; -import { globalEventBoxes } from 'globals/dropdown'; - -type NestedRevealer = Revealer, unknown>; -type NestedBox = Box; -type NestedEventBox = EventBox; - -const { location } = options.theme.bar; -const { scalingPriority } = options; - -export const calculateMenuPosition = async (pos: number[], windowName: string): Promise => { - const self = globalEventBoxes.value[windowName] as NestedEventBox; - const curHyprlandMonitor = hyprland.monitors.find((m) => m.id === hyprland.active.monitor.id); - const dropdownWidth = self.child.get_allocation().width; - const dropdownHeight = self.child.get_allocation().height; - - let hyprScaling = 1; - try { - const monitorInfo = await bash('hyprctl monitors -j'); - const parsedMonitorInfo = JSON.parse(monitorInfo); - - const foundMonitor = parsedMonitorInfo.find((monitor: Monitor) => monitor.id === hyprland.active.monitor.id); - hyprScaling = foundMonitor?.scale || 1; - } catch (error) { - console.error(`Error parsing hyprland monitors: ${error}`); - } - - let monWidth = curHyprlandMonitor?.width; - let monHeight = curHyprlandMonitor?.height; - - if (monWidth === undefined || monHeight === undefined || hyprScaling === undefined) { - return; - } - - // If GDK Scaling is applied, then get divide width by scaling - // to get the proper coordinates. - // Ex: On a 2860px wide monitor... if scaling is set to 2, then the right - // end of the monitor is the 1430th pixel. - const gdkScale = Utils.exec('bash -c "echo $GDK_SCALE"'); - - if (scalingPriority.value === 'both') { - const scale = parseFloat(gdkScale); - monWidth = monWidth / scale; - monHeight = monHeight / scale; - - monWidth = monWidth / hyprScaling; - monHeight = monHeight / hyprScaling; - } else if (/^\d+(.\d+)?$/.test(gdkScale) && scalingPriority.value === 'gdk') { - const scale = parseFloat(gdkScale); - monWidth = monWidth / scale; - monHeight = monHeight / scale; - } else { - monWidth = monWidth / hyprScaling; - monHeight = monHeight / hyprScaling; - } - - // If monitor is vertical (transform = 1 || 3) swap height and width - const isVertical = curHyprlandMonitor?.transform !== undefined ? curHyprlandMonitor.transform % 2 !== 0 : false; - - if (isVertical) { - [monWidth, monHeight] = [monHeight, monWidth]; - } - - let marginRight = monWidth - dropdownWidth / 2; - marginRight = marginRight - pos[0]; - let marginLeft = monWidth - dropdownWidth - marginRight; - - const minimumMargin = 0; - - if (marginRight < minimumMargin) { - marginRight = minimumMargin; - marginLeft = monWidth - dropdownWidth - minimumMargin; - } - - if (marginLeft < minimumMargin) { - marginLeft = minimumMargin; - marginRight = monWidth - dropdownWidth - minimumMargin; - } - - self.set_margin_left(marginLeft); - self.set_margin_right(marginRight); - - if (location.value === 'top') { - self.set_margin_top(0); - self.set_margin_bottom(monHeight); - } else { - self.set_margin_bottom(0); - self.set_margin_top(monHeight - dropdownHeight); - } -}; diff --git a/ags/HyprPanel/modules/menus/shared/popup/index.ts b/ags/HyprPanel/modules/menus/shared/popup/index.ts deleted file mode 100644 index 3738030..0000000 --- a/ags/HyprPanel/modules/menus/shared/popup/index.ts +++ /dev/null @@ -1,186 +0,0 @@ -import { WINDOW_LAYOUTS } from 'globals/window'; -import { LayoutFunction, Layouts, PopupWindowProps } from 'lib/types/popupwindow'; -import { Attribute, Child, Exclusivity, GtkWidget, Transition } from 'lib/types/widget'; -import Box from 'types/widgets/box'; -import EventBox from 'types/widgets/eventbox'; -import Window from 'types/widgets/window'; - -type Opts = { - className: string; - vexpand: boolean; -}; - -export const Padding = (name: string, opts: Opts): EventBox, unknown> => - Widget.EventBox({ - class_name: opts?.className || '', - hexpand: true, - vexpand: typeof opts?.vexpand === 'boolean' ? opts.vexpand : true, - can_focus: false, - child: Widget.Box(), - setup: (w) => w.on('button-press-event', () => App.toggleWindow(name)), - }); - -const PopupRevealer = ( - name: string, - child: GtkWidget, - transition = 'slide_down' as Transition, -): Box => - Widget.Box( - { css: 'padding: 1px;' }, - Widget.Revealer({ - transition, - child: Widget.Box({ - class_name: `window-content ${name}-window`, - child, - }), - transitionDuration: 200, - setup: (self) => - self.hook(App, (_, wname, visible) => { - if (wname === name) self.reveal_child = visible; - }), - }), - ); - -const Layout: LayoutFunction = (name: string, child: GtkWidget, transition: Transition) => ({ - center: () => - Widget.CenterBox( - {}, - Padding(name, {} as Opts), - Widget.CenterBox( - { vertical: true }, - Padding(name, {} as Opts), - PopupRevealer(name, child, transition), - Padding(name, {} as Opts), - ), - Padding(name, {} as Opts), - ), - top: () => - Widget.CenterBox( - {}, - Padding(name, {} as Opts), - Widget.Box({ vertical: true }, PopupRevealer(name, child, transition), Padding(name, {} as Opts)), - Padding(name, {} as Opts), - ), - 'top-right': () => - Widget.Box( - {}, - Padding(name, {} as Opts), - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, { - vexpand: false, - className: 'event-top-padding', - }), - PopupRevealer(name, child, transition), - Padding(name, {} as Opts), - ), - ), - 'top-center': () => - Widget.Box( - {}, - Padding(name, {} as Opts), - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, { - vexpand: false, - className: 'event-top-padding', - }), - PopupRevealer(name, child, transition), - Padding(name, {} as Opts), - ), - Padding(name, {} as Opts), - ), - 'top-left': () => - Widget.Box( - {}, - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, { - vexpand: false, - className: 'event-top-padding', - }), - PopupRevealer(name, child, transition), - Padding(name, {} as Opts), - ), - Padding(name, {} as Opts), - ), - 'bottom-left': () => - Widget.Box( - {}, - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, {} as Opts), - PopupRevealer(name, child, transition), - ), - Padding(name, {} as Opts), - ), - 'bottom-center': () => - Widget.Box( - {}, - Padding(name, {} as Opts), - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, {} as Opts), - PopupRevealer(name, child, transition), - ), - Padding(name, {} as Opts), - ), - 'bottom-right': () => - Widget.Box( - {}, - Padding(name, {} as Opts), - Widget.Box( - { - hexpand: false, - vertical: true, - }, - Padding(name, {} as Opts), - PopupRevealer(name, child, transition), - ), - ), -}); - -const isValidLayout = (layout: string): layout is Layouts => { - return WINDOW_LAYOUTS.includes(layout); -}; - -export default ({ - name, - child, - layout = 'center', - transition = 'none', - exclusivity = 'ignore' as Exclusivity, - ...props -}: PopupWindowProps): Window => { - const layoutFn = isValidLayout(layout) ? layout : 'center'; - - const layoutWidget = Layout(name, child, transition)[layoutFn](); - - return Widget.Window({ - name, - class_names: [name, 'popup-window'], - setup: (w) => w.keybind('Escape', () => App.closeWindow(name)), - visible: false, - keymode: 'on-demand', - exclusivity, - layer: 'top', - anchor: ['top', 'bottom', 'right', 'left'], - child: layoutWidget, - ...props, - }); -}; diff --git a/ags/HyprPanel/modules/notifications/actions/index.ts b/ags/HyprPanel/modules/notifications/actions/index.ts deleted file mode 100644 index 402f1d9..0000000 --- a/ags/HyprPanel/modules/notifications/actions/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Attribute, Child } from 'lib/types/widget'; -import { Notification, Notifications } from 'types/service/notifications'; -import Box from 'types/widgets/box'; - -const Action = (notif: Notification, notifs: Notifications): Box => { - if (notif.actions !== undefined && notif.actions.length > 0) { - return Widget.Box({ - class_name: 'notification-card-actions', - hexpand: true, - vpack: 'end', - children: notif.actions.map((action) => { - return Widget.Button({ - hexpand: true, - class_name: 'notification-action-buttons', - on_primary_click: () => { - if (action.id.includes('scriptAction:-')) { - Utils.execAsync(`${action.id.replace('scriptAction:-', '')}`).catch((err) => - console.error(err), - ); - notifs.CloseNotification(notif.id); - } else { - notif.invoke(action.id); - } - }, - child: Widget.Box({ - hpack: 'center', - hexpand: true, - children: [ - Widget.Label({ - class_name: 'notification-action-buttons-label', - hexpand: true, - label: action.label, - max_width_chars: 15, - truncate: 'end', - wrap: true, - }), - ], - }), - }); - }), - }); - } - - return Widget.Box(); -}; - -export { Action }; diff --git a/ags/HyprPanel/modules/notifications/body/index.ts b/ags/HyprPanel/modules/notifications/body/index.ts deleted file mode 100644 index 92fa7a7..0000000 --- a/ags/HyprPanel/modules/notifications/body/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Notification } from 'types/service/notifications'; -import { notifHasImg } from '../../menus/notifications/utils.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -export const Body = (notif: Notification): Box => { - return Widget.Box({ - vpack: 'start', - hexpand: true, - class_name: 'notification-card-body', - children: [ - Widget.Label({ - hexpand: true, - use_markup: true, - xalign: 0, - justification: 'left', - truncate: 'end', - lines: 2, - max_width_chars: !notifHasImg(notif) ? 35 : 28, - wrap: true, - class_name: 'notification-card-body-label', - label: notif['body'], - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/notifications/close/index.ts b/ags/HyprPanel/modules/notifications/close/index.ts deleted file mode 100644 index d7a0d6e..0000000 --- a/ags/HyprPanel/modules/notifications/close/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Attribute, Child } from 'lib/types/widget'; -import { Notification, Notifications } from 'types/service/notifications'; -import Button from 'types/widgets/button'; -import Label from 'types/widgets/label'; - -export const CloseButton = (notif: Notification, notifs: Notifications): Button, Attribute> => { - return Widget.Button({ - class_name: 'close-notification-button', - on_primary_click: () => { - notifs.CloseNotification(notif.id); - }, - child: Widget.Label({ - class_name: 'txt-icon notif-close', - label: '󰅜', - hpack: 'center', - }), - }); -}; diff --git a/ags/HyprPanel/modules/notifications/header/icon.ts b/ags/HyprPanel/modules/notifications/header/icon.ts deleted file mode 100644 index 5a02ca2..0000000 --- a/ags/HyprPanel/modules/notifications/header/icon.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Notification } from 'types/service/notifications.js'; -import { getNotificationIcon } from 'globals/notification.js'; -import Box from 'types/widgets/box'; -import { Attribute, Child } from 'lib/types/widget'; - -const NotificationIcon = ({ - app_entry = '', - app_icon = '', - app_name = '', -}: Partial): Box => { - return Widget.Box({ - css: ` - min-width: 2rem; - min-height: 2rem; - `, - child: Widget.Icon({ - class_name: 'notification-icon', - icon: getNotificationIcon(app_name, app_icon, app_entry), - }), - }); -}; - -export { NotificationIcon }; diff --git a/ags/HyprPanel/modules/notifications/header/index.ts b/ags/HyprPanel/modules/notifications/header/index.ts deleted file mode 100644 index 71d038d..0000000 --- a/ags/HyprPanel/modules/notifications/header/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import GLib from 'gi://GLib'; -import { notifHasImg } from '../../menus/notifications/utils.js'; -import { NotificationIcon } from './icon.js'; -import { Notification } from 'types/service/notifications'; -import options from 'options.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const { military } = options.menus.clock.time; - -export const Header = (notif: Notification): Box => { - const time = (time: number, format = '%I:%M %p'): string => { - return GLib.DateTime.new_from_unix_local(time).format(military.value ? '%H:%M' : format) || '--'; - }; - - return Widget.Box({ - vertical: false, - hexpand: true, - children: [ - Widget.Box({ - class_name: 'notification-card-header', - hpack: 'start', - children: [NotificationIcon(notif)], - }), - Widget.Box({ - class_name: 'notification-card-header', - hexpand: true, - hpack: 'start', - vpack: 'start', - children: [ - Widget.Label({ - class_name: 'notification-card-header-label', - hpack: 'start', - hexpand: true, - vexpand: true, - max_width_chars: !notifHasImg(notif) ? 30 : 19, - truncate: 'end', - wrap: true, - label: notif['summary'], - }), - ], - }), - Widget.Box({ - class_name: 'notification-card-header menu', - hpack: 'end', - vpack: 'start', - hexpand: true, - child: Widget.Label({ - vexpand: true, - class_name: 'notification-time', - label: time(notif.time), - }), - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/notifications/image/index.ts b/ags/HyprPanel/modules/notifications/image/index.ts deleted file mode 100644 index df1fded..0000000 --- a/ags/HyprPanel/modules/notifications/image/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Notification } from 'types/service/notifications'; -import { notifHasImg } from '../../menus/notifications/utils.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; - -const Image = (notif: Notification): Box => { - if (notifHasImg(notif)) { - return Widget.Box({ - class_name: 'notification-card-image-container', - hpack: 'center', - vpack: 'center', - vexpand: false, - child: Widget.Box({ - hpack: 'center', - vexpand: false, - class_name: 'notification-card-image', - css: `background-image: url("${notif.image}")`, - }), - }); - } - - return Widget.Box(); -}; - -export { Image }; diff --git a/ags/HyprPanel/modules/notifications/index.ts b/ags/HyprPanel/modules/notifications/index.ts deleted file mode 100644 index 7e86589..0000000 --- a/ags/HyprPanel/modules/notifications/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -const notifs = await Service.import('notifications'); -import options from 'options'; -import { notifHasImg } from '../menus/notifications/utils.js'; -import { Image } from './image/index.js'; -import { Action } from './actions/index.js'; -import { Header } from './header/index.js'; -import { Body } from './body/index.js'; -import { CloseButton } from './close/index.js'; -import { getPosition } from 'lib/utils.js'; -import { filterNotifications } from 'lib/shared/notifications.js'; -import { Notification } from 'types/service/notifications.js'; -import Window from 'types/widgets/window.js'; -import Box from 'types/widgets/box.js'; -import { Attribute, Child } from 'lib/types/widget.js'; -const hyprland = await Service.import('hyprland'); - -const { position, timeout, cache_actions, monitor, active_monitor, displayedTotal, ignore } = options.notifications; - -const curMonitor = Variable(monitor.value); - -hyprland.active.connect('changed', () => { - curMonitor.value = hyprland.active.monitor.id; -}); - -export default (): Window, unknown> => { - Utils.merge([timeout.bind('value'), cache_actions.bind('value')], (timeout, doCaching) => { - notifs.popupTimeout = timeout; - notifs.cacheActions = doCaching; - }); - - return Widget.Window({ - name: 'notifications-window', - class_name: 'notifications-window', - monitor: Utils.merge( - [curMonitor.bind('value'), monitor.bind('value'), active_monitor.bind('value')], - (curMon, mon, activeMonitor) => { - if (activeMonitor === true) { - return curMon; - } - - return mon; - }, - ), - layer: options.tear.bind('value').as((tear) => (tear ? 'top' : 'overlay')), - anchor: position.bind('value').as((v) => getPosition(v)), - exclusivity: 'normal', - child: Widget.Box({ - class_name: 'notification-card-container', - vertical: true, - hexpand: true, - setup: (self) => { - Utils.merge( - [notifs.bind('popups'), ignore.bind('value')], - (notifications: Notification[], ignoredNotifs: string[]) => { - const filteredNotifications = filterNotifications(notifications, ignoredNotifs); - - return (self.children = filteredNotifications.slice(0, displayedTotal.value).map((notif) => { - return Widget.Box({ - class_name: 'notification-card', - vpack: 'start', - hexpand: true, - children: [ - Image(notif), - Widget.Box({ - vpack: 'start', - vertical: true, - hexpand: true, - class_name: `notification-card-content ${!notifHasImg(notif) ? 'noimg' : ''}`, - children: [Header(notif), Body(notif), Action(notif, notifs)], - }), - CloseButton(notif, notifs), - ], - }); - })); - }, - ); - }, - }), - }); -}; diff --git a/ags/HyprPanel/modules/osd/bar/index.ts b/ags/HyprPanel/modules/osd/bar/index.ts deleted file mode 100644 index b73cda1..0000000 --- a/ags/HyprPanel/modules/osd/bar/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { OSDOrientation } from 'lib/types/options'; -import brightness from 'services/Brightness'; -import options from 'options'; -import Box from 'types/widgets/box'; -import { Attribute, Child } from 'lib/types/widget'; -const audio = await Service.import('audio'); - -export const OSDBar = (ort: OSDOrientation): Box => { - return Widget.Box({ - class_name: 'osd-bar-container', - children: [ - Widget.LevelBar({ - class_name: 'osd-bar', - vertical: ort === 'vertical', - inverted: ort === 'vertical', - bar_mode: 'continuous', - setup: (self) => { - self.hook( - brightness, - () => { - self.class_names = self.class_names.filter((c) => c !== 'overflow'); - self.value = brightness.screen; - }, - 'notify::screen', - ); - self.hook( - brightness, - () => { - self.class_names = self.class_names.filter((c) => c !== 'overflow'); - self.value = brightness.kbd; - }, - 'notify::kbd', - ); - self.hook( - audio.microphone, - () => { - self.toggleClassName('overflow', audio.microphone.volume > 1); - self.value = - audio.microphone.volume <= 1 ? audio.microphone.volume : audio.microphone.volume - 1; - }, - 'notify::volume', - ); - self.hook( - audio.microphone, - () => { - self.toggleClassName( - 'overflow', - audio.microphone.volume > 1 && - (!options.theme.osd.muted_zero.value || audio.microphone.is_muted === false), - ); - self.value = - options.theme.osd.muted_zero.value && audio.microphone.is_muted !== false - ? 0 - : audio.microphone.volume <= 1 - ? audio.microphone.volume - : audio.microphone.volume - 1; - }, - 'notify::is-muted', - ); - self.hook( - audio.speaker, - () => { - self.toggleClassName('overflow', audio.speaker.volume > 1); - self.value = audio.speaker.volume <= 1 ? audio.speaker.volume : audio.speaker.volume - 1; - }, - 'notify::volume', - ); - self.hook( - audio.speaker, - () => { - self.toggleClassName( - 'overflow', - audio.speaker.volume > 1 && - (!options.theme.osd.muted_zero.value || audio.speaker.is_muted === false), - ); - self.value = - options.theme.osd.muted_zero.value && audio.speaker.is_muted !== false - ? 0 - : audio.speaker.volume <= 1 - ? audio.speaker.volume - : audio.speaker.volume - 1; - }, - 'notify::is-muted', - ); - }, - }), - ], - }); -}; diff --git a/ags/HyprPanel/modules/osd/icon/index.ts b/ags/HyprPanel/modules/osd/icon/index.ts deleted file mode 100644 index 1682c91..0000000 --- a/ags/HyprPanel/modules/osd/icon/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Attribute, Child } from 'lib/types/widget'; -import brightness from 'services/Brightness'; -import Box from 'types/widgets/box'; -const audio = await Service.import('audio'); - -export const OSDIcon = (): Box => { - return Widget.Box({ - class_name: 'osd-icon-container', - hexpand: true, - child: Widget.Label({ - class_name: 'osd-icon txt-icon', - hexpand: true, - vexpand: true, - hpack: 'center', - vpack: 'center', - setup: (self) => { - self.hook( - brightness, - () => { - self.label = '󱍖'; - }, - 'notify::screen', - ); - self.hook( - brightness, - () => { - self.label = '󰥻'; - }, - 'notify::kbd', - ); - self.hook( - audio.microphone, - () => { - self.label = audio.microphone.is_muted ? '󰍭' : '󰍬'; - }, - 'notify::volume', - ); - self.hook( - audio.microphone, - () => { - self.label = audio.microphone.is_muted ? '󰍭' : '󰍬'; - }, - 'notify::is-muted', - ); - self.hook( - audio.speaker, - () => { - self.label = audio.speaker.is_muted ? '󰝟' : '󰕾'; - }, - 'notify::volume', - ); - self.hook( - audio.speaker, - () => { - self.label = audio.speaker.is_muted ? '󰝟' : '󰕾'; - }, - 'notify::is-muted', - ); - }, - }), - }); -}; diff --git a/ags/HyprPanel/modules/osd/index.ts b/ags/HyprPanel/modules/osd/index.ts deleted file mode 100644 index 8e3dbd6..0000000 --- a/ags/HyprPanel/modules/osd/index.ts +++ /dev/null @@ -1,199 +0,0 @@ -import options from 'options'; -import brightness from 'services/Brightness'; -import { OSDLabel } from './label/index'; -import { OSDBar } from './bar/index'; -import { OSDIcon } from './icon/index'; -import { getPosition } from 'lib/utils'; -import { Attribute, Child } from 'lib/types/widget'; -import { Revealer } from 'resource:///com/github/Aylur/ags/widgets/revealer.js'; -import { Window } from 'resource:///com/github/Aylur/ags/widgets/window.js'; -const hyprland = await Service.import('hyprland'); -const audio = await Service.import('audio'); - -const { enable, duration, orientation, location, active_monitor, monitor } = options.theme.osd; - -const curMonitor = Variable(monitor.value); - -hyprland.active.connect('changed', () => { - curMonitor.value = hyprland.active.monitor.id; -}); - -let count = 0; - -const handleRevealRevealer = (self: Revealer, property: 'reveal_child' | 'visible'): void => { - if (!enable.value || property !== 'reveal_child') { - return; - } - - self.reveal_child = true; - - count++; - Utils.timeout(duration.value, () => { - count--; - - if (count === 0) { - self.reveal_child = false; - } - }); -}; - -const handleRevealWindow = (self: Window, property: 'reveal_child' | 'visible'): void => { - if (!enable.value || property !== 'visible') { - return; - } - - self.visible = true; - - count++; - Utils.timeout(duration.value, () => { - count--; - - if (count === 0) { - self.visible = false; - } - }); -}; - -const handleReveal = ( - self: Revealer | Window, - property: 'reveal_child' | 'visible', -): void => { - if (self instanceof Revealer) { - handleRevealRevealer(self, property); - } else if (self instanceof Window) { - handleRevealWindow(self, property); - } -}; - -const renderOSD = (): Revealer => { - return Widget.Revealer({ - transition: 'crossfade', - reveal_child: false, - setup: (self) => { - self.hook( - brightness, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::screen', - ); - self.hook( - brightness, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::kbd', - ); - self.hook( - audio.microphone, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::volume', - ); - self.hook( - audio.microphone, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::is-muted', - ); - self.hook( - audio.speaker, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::volume', - ); - self.hook( - audio.speaker, - () => { - handleReveal(self, 'reveal_child'); - }, - 'notify::is-muted', - ); - }, - child: Widget.Box({ - class_name: 'osd-container', - vertical: orientation.bind('value').as((ort) => ort === 'vertical'), - children: orientation.bind('value').as((ort) => { - if (ort === 'vertical') { - return [OSDLabel(), OSDBar(ort), OSDIcon()]; - } - - return [OSDIcon(), OSDBar(ort), OSDLabel()]; - }), - }), - }); -}; - -export default (): Window => - Widget.Window({ - monitor: Utils.merge( - [curMonitor.bind('value'), monitor.bind('value'), active_monitor.bind('value')], - (curMon, mon, activeMonitor) => { - if (activeMonitor === true) { - return curMon; - } - - return mon; - }, - ), - name: `indicator`, - class_name: 'indicator', - layer: options.tear.bind('value').as((tear) => (tear ? 'top' : 'overlay')), - anchor: location.bind('value').as((v) => getPosition(v)), - click_through: true, - child: Widget.Box({ - css: 'padding: 1px;', - expand: true, - child: renderOSD(), - }), - setup: (self) => { - self.hook(enable, () => { - handleReveal(self, 'visible'); - }); - self.hook( - brightness, - () => { - handleReveal(self, 'visible'); - }, - 'notify::screen', - ); - self.hook( - brightness, - () => { - handleReveal(self, 'visible'); - }, - 'notify::kbd', - ); - self.hook( - audio.microphone, - () => { - handleReveal(self, 'visible'); - }, - 'notify::volume', - ); - self.hook( - audio.microphone, - () => { - handleReveal(self, 'visible'); - }, - 'notify::is-muted', - ); - self.hook( - audio.speaker, - () => { - handleReveal(self, 'visible'); - }, - 'notify::volume', - ); - self.hook( - audio.speaker, - () => { - handleReveal(self, 'visible'); - }, - 'notify::is-muted', - ); - }, - }); diff --git a/ags/HyprPanel/modules/osd/label/index.ts b/ags/HyprPanel/modules/osd/label/index.ts deleted file mode 100644 index 9e61636..0000000 --- a/ags/HyprPanel/modules/osd/label/index.ts +++ /dev/null @@ -1,86 +0,0 @@ -import brightness from 'services/Brightness'; -import options from 'options'; -import Box from 'types/widgets/box'; -import { Attribute, Child } from 'lib/types/widget'; -const audio = await Service.import('audio'); - -export const OSDLabel = (): Box => { - return Widget.Box({ - class_name: 'osd-label-container', - hexpand: true, - vexpand: true, - child: Widget.Label({ - class_name: 'osd-label', - hexpand: true, - vexpand: true, - hpack: 'center', - vpack: 'center', - setup: (self) => { - self.hook( - brightness, - () => { - self.class_names = self.class_names.filter((c) => c !== 'overflow'); - self.label = `${Math.round(brightness.screen * 100)}`; - }, - 'notify::screen', - ); - self.hook( - brightness, - () => { - self.class_names = self.class_names.filter((c) => c !== 'overflow'); - self.label = `${Math.round(brightness.kbd * 100)}`; - }, - 'notify::kbd', - ); - self.hook( - audio.microphone, - () => { - self.toggleClassName('overflow', audio.microphone.volume > 1); - self.label = `${Math.round(audio.microphone.volume * 100)}`; - }, - 'notify::volume', - ); - self.hook( - audio.microphone, - () => { - self.toggleClassName( - 'overflow', - audio.microphone.volume > 1 && - (!options.theme.osd.muted_zero.value || audio.microphone.is_muted === false), - ); - const inputVolume = - options.theme.osd.muted_zero.value && audio.microphone.is_muted !== false - ? 0 - : Math.round(audio.microphone.volume * 100); - self.label = `${inputVolume}`; - }, - 'notify::is-muted', - ); - self.hook( - audio.speaker, - () => { - self.toggleClassName('overflow', audio.speaker.volume > 1); - self.label = `${Math.round(audio.speaker.volume * 100)}`; - }, - 'notify::volume', - ); - self.hook( - audio.speaker, - () => { - self.toggleClassName( - 'overflow', - audio.speaker.volume > 1 && - (!options.theme.osd.muted_zero.value || audio.speaker.is_muted === false), - ); - const speakerVolume = - options.theme.osd.muted_zero.value && audio.speaker.is_muted !== false - ? 0 - : Math.round(audio.speaker.volume * 100); - self.label = `${speakerVolume}`; - }, - 'notify::is-muted', - ); - }, - }), - }); -}; diff --git a/ags/HyprPanel/modules/shared/barItemBox.ts b/ags/HyprPanel/modules/shared/barItemBox.ts deleted file mode 100644 index 0f84c41..0000000 --- a/ags/HyprPanel/modules/shared/barItemBox.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BarBoxChild } from 'lib/types/bar'; -import { Bind } from 'lib/types/variable'; -import { Attribute, GtkWidget } from 'lib/types/widget'; -import options from 'options'; -import Button from 'types/widgets/button'; - -export const BarItemBox = (child: BarBoxChild): Button => { - const computeVisible = (): Bind | boolean => { - if (child.isVis !== undefined) { - return child.isVis.bind('value'); - } - return child.isVisible; - }; - - return Widget.Button({ - class_name: options.theme.bar.buttons.style.bind('value').as((style) => { - const styleMap = { - default: 'style1', - split: 'style2', - wave: 'style3', - wave2: 'style4', - }; - - const boxClassName = Object.hasOwnProperty.call(child, 'boxClass') ? child.boxClass : ''; - - return `bar_item_box_visible ${styleMap[style]} ${boxClassName}`; - }), - child: child.component, - visible: computeVisible(), - ...child.props, - }); -}; diff --git a/ags/HyprPanel/nix/default.nix b/ags/HyprPanel/nix/default.nix deleted file mode 100644 index f3a946d..0000000 --- a/ags/HyprPanel/nix/default.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - inputs, - pkgs, - system, - stdenv, - lib, - writeShellScriptBin, - bun, - dart-sass, - fd, - accountsservice, - btop, - pipewire, - bluez, - bluez-tools, - grimblast, - gpu-screen-recorder, - networkmanager, - brightnessctl, - matugen, - swww, - python3, - libgtop, - gnome-bluetooth, - gobject-introspection, - glib, -}: let - ags = inputs.ags.packages.${system}.default.override { - extraPackages = [accountsservice]; - }; - - pname = "hyprpanel"; - config = stdenv.mkDerivation { - inherit pname; - version = "latest"; - src = ../.; - - buildPhase = '' - ${bun}/bin/bun build ./main.ts \ - --outfile main.js \ - --external "resource://*" \ - --external "gi://*" - ''; - - installPhase = '' - mkdir $out - cp -r assets $out - cp -r scss $out - cp -r widget $out - cp -r services $out - cp -f main.js $out/config.js - ''; - }; -in { - desktop = { - inherit config; - script = writeShellScriptBin pname '' - export PATH=$PATH:${lib.makeBinPath [dart-sass fd btop pipewire bluez bluez-tools networkmanager matugen swww grimblast gpu-screen-recorder brightnessctl gnome-bluetooth python3]} - export GI_TYPELIB_PATH=${libgtop}/lib/girepository-1.0:${glib}/lib/girepository-1.0:$GI_TYPELIB_PATH - ${ags}/bin/ags -b hyprpanel -c ${config}/config.js $@ - ''; - }; -} - diff --git a/ags/HyprPanel/options.ts b/ags/HyprPanel/options.ts deleted file mode 100644 index 24c854c..0000000 --- a/ags/HyprPanel/options.ts +++ /dev/null @@ -1,1187 +0,0 @@ -import { opt, mkOptions } from 'lib/option'; -import { NetstatLabelType, RateUnit, ResourceLabelType } from 'lib/types/bar'; -import { KbLabelType } from 'lib/types/customModules/kbLayout'; -import { - ActiveWsIndicator, - BarButtonStyles, - BarLocation, - NotificationAnchor, - OSDAnchor, - OSDOrientation, - ScalingPriority, - WindowLayer, -} from 'lib/types/options'; -import { MatugenScheme, MatugenTheme, MatugenVariations } from 'lib/types/options'; -import { UnitType } from 'lib/types/weather'; -import { Transition } from 'lib/types/widget'; -import { WorkspaceIcons, WorkspaceIconsColored } from 'lib/types/workspace'; - -// WARN: CHANGING THESE VALUES WILL PREVENT MATUGEN COLOR GENERATION FOR THE CHANGED VALUE -export const colors = { - rosewater: '#f5e0dc', - flamingo: '#f2cdcd', - pink: '#f5c2e7', - mauve: '#cba6f7', - red: '#f38ba8', - maroon: '#eba0ac', - peach: '#fab387', - yellow: '#f9e2af', - green: '#a6e3a1', - teal: '#94e2d5', - sky: '#89dceb', - sapphire: '#74c7ec', - blue: '#89b4fa', - lavender: '#b4befe', - text: '#cdd6f4', - subtext1: '#bac2de', - subtext2: '#a6adc8', - overlay2: '#9399b2', - overlay1: '#7f849c', - overlay0: '#6c7086', - surface2: '#585b70', - surface1: '#45475a', - surface0: '#313244', - base2: '#242438', - base: '#1e1e2e', - mantle: '#181825', - crust: '#11111b', -}; - -// WARN: CHANGING THESE VALUES WILL PREVENT MATUGEN COLOR GENERATION FOR THE CHANGED VALUE -const secondary_colors = { - text: '#cdd6f3', - pink: '#f5c2e6', - red: '#f38ba7', - peach: '#fab386', - mantle: '#181824', - surface1: '#454759', - surface0: '#313243', - overlay1: '#7f849b', - lavender: '#b4befd', - mauve: '#cba6f6', - green: '#a6e3a0', - sky: '#89dcea', - teal: '#94e2d4', - yellow: '#f9e2ad', - maroon: '#eba0ab', - crust: '#11111a', - surface2: '#585b69', -}; - -const tertiary_colors = { - pink: '#f5c2e8', - red: '#f38ba9', - mantle: '#181826', - surface0: '#313245', - overlay1: '#7f849d', - lavender: '#b4beff', - mauve: '#cba6f8', - green: '#a6e3a2', - sky: '#89dcec', - teal: '#94e2d6', - yellow: '#f9e2ae', - maroon: '#eba0ad', - crust: '#11111c', - surface2: '#585b71', -}; - -const options = mkOptions(OPTIONS, { - theme: { - matugen: opt(false), - matugen_settings: { - mode: opt('dark'), - scheme_type: opt('tonal-spot'), - variation: opt('standard_1'), - contrast: opt(0.0), - }, - font: { - size: opt('1.2rem'), - name: opt('Ubuntu Nerd Font'), - weight: opt(600), - }, - notification: { - scaling: opt(100), - background: opt(tertiary_colors.mantle), - opacity: opt(100), - actions: { - background: opt(secondary_colors.lavender), - text: opt(colors.mantle), - }, - label: opt(colors.lavender), - border: opt(secondary_colors.surface0), - border_radius: opt('0.6em'), - time: opt(secondary_colors.overlay1), - text: opt(colors.text), - labelicon: opt(colors.lavender), - close_button: { - background: opt(secondary_colors.red), - label: opt(colors.crust), - }, - }, - osd: { - scaling: opt(100), - duration: opt(2500), - enable: opt(true), - orientation: opt('vertical'), - opacity: opt(100), - bar_container: opt(colors.crust), - icon_container: opt(tertiary_colors.lavender), - bar_color: opt(tertiary_colors.lavender), - bar_empty_color: opt(colors.surface0), - bar_overflow_color: opt(secondary_colors.red), - icon: opt(colors.crust), - label: opt(tertiary_colors.lavender), - monitor: opt(0), - active_monitor: opt(true), - radius: opt('0.4em'), - margins: opt('0px 5px 0px 0px'), - location: opt('right'), - muted_zero: opt(false), - }, - bar: { - scaling: opt(100), - floating: opt(false), - location: opt('top'), - layer: opt('top'), - margin_top: opt('0.5em'), - opacity: opt(100), - margin_bottom: opt('0em'), - margin_sides: opt('0.5em'), - border_radius: opt('0.4em'), - outer_spacing: opt('1.6em'), - label_spacing: opt('0.5em'), - transparent: opt(false), - dropdownGap: opt('2.9em'), - background: opt(colors.crust), - buttons: { - style: opt('default'), - enableBorders: opt(false), - borderSize: opt('0.1em'), - monochrome: opt(false), - spacing: opt('0.25em'), - padding_x: opt('0.7rem'), - padding_y: opt('0.2rem'), - y_margins: opt('0.4em'), - radius: opt('0.3em'), - opacity: opt(100), - background_opacity: opt(100), - background_hover_opacity: opt(100), - background: opt(colors.base2), - icon_background: opt(colors.base2), - hover: opt(colors.surface1), - text: opt(colors.lavender), - icon: opt(colors.lavender), - dashboard: { - background: opt(colors.base2), - enableBorder: opt(false), - border: opt(colors.yellow), - icon: opt(colors.yellow), - spacing: opt('0.5em'), - }, - workspaces: { - background: opt(colors.base2), - enableBorder: opt(false), - smartHighlight: opt(true), - border: opt(colors.pink), - available: opt(colors.sky), - occupied: opt(colors.flamingo), - active: opt(colors.pink), - hover: opt(colors.pink), - numbered_active_highlight_border: opt('0.2em'), - numbered_active_highlight_padding: opt('0.2em'), - numbered_active_highlighted_text_color: opt(colors.mantle), - numbered_active_underline_color: opt(colors.pink), - spacing: opt('0.5em'), - fontSize: opt('1.2em'), - }, - windowtitle: { - background: opt(colors.base2), - enableBorder: opt(false), - border: opt(colors.pink), - text: opt(colors.pink), - icon: opt(colors.pink), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - media: { - enableBorder: opt(false), - border: opt(colors.lavender), - background: opt(colors.base2), - text: opt(colors.lavender), - icon: opt(colors.lavender), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - volume: { - enableBorder: opt(false), - border: opt(colors.maroon), - background: opt(colors.base2), - text: opt(colors.maroon), - icon: opt(colors.maroon), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - network: { - enableBorder: opt(false), - border: opt(colors.mauve), - background: opt(colors.base2), - text: opt(colors.mauve), - icon: opt(colors.mauve), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - bluetooth: { - enableBorder: opt(false), - border: opt(colors.sky), - background: opt(colors.base2), - text: opt(colors.sky), - icon: opt(colors.sky), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - systray: { - enableBorder: opt(false), - border: opt(colors.lavender), - background: opt(colors.base2), - spacing: opt('0.5em'), - }, - battery: { - enableBorder: opt(false), - border: opt(colors.yellow), - background: opt(colors.base2), - text: opt(colors.yellow), - icon: opt(colors.yellow), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - clock: { - enableBorder: opt(false), - border: opt(colors.pink), - background: opt(colors.base2), - text: opt(colors.pink), - icon: opt(colors.pink), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - notifications: { - enableBorder: opt(false), - border: opt(colors.lavender), - background: opt(colors.base2), - icon: opt(colors.lavender), - icon_background: opt(colors.base2), - total: opt(colors.lavender), - spacing: opt('0.5em'), - }, - modules: { - ram: { - enableBorder: opt(false), - border: opt(colors.yellow), - background: opt(colors.base2), - text: opt(colors.yellow), - icon: opt(colors.yellow), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - cpu: { - enableBorder: opt(false), - border: opt(colors.red), - background: opt(colors.base2), - text: opt(colors.red), - icon: opt(colors.red), - icon_background: opt(colors.base2), - spacing: opt('0.5em'), - }, - storage: { - enableBorder: opt(false), - border: opt(colors.pink), - background: opt(colors.base2), - text: opt(colors.pink), - icon: opt(colors.pink), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - netstat: { - enableBorder: opt(false), - border: opt(colors.green), - background: opt(colors.base2), - text: opt(colors.green), - icon: opt(colors.green), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - kbLayout: { - enableBorder: opt(false), - border: opt(colors.sky), - background: opt(colors.base2), - text: opt(colors.sky), - icon: opt(colors.sky), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - updates: { - enableBorder: opt(false), - border: opt(colors.mauve), - background: opt(colors.base2), - text: opt(colors.mauve), - icon: opt(colors.mauve), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - weather: { - enableBorder: opt(false), - border: opt(colors.lavender), - background: opt(colors.base2), - text: opt(colors.lavender), - icon: opt(colors.lavender), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - power: { - enableBorder: opt(false), - border: opt(colors.red), - background: opt(colors.base2), - icon: opt(colors.red), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - submap: { - enableBorder: opt(false), - border: opt(colors.teal), - background: opt(colors.base2), - text: opt(colors.teal), - icon: opt(colors.teal), - icon_background: opt(colors.base2), - spacing: opt('0.45em'), - }, - }, - }, - menus: { - monochrome: opt(false), - background: opt(colors.crust), - opacity: opt(100), - cards: opt(colors.base), - card_radius: opt('0.4em'), - border: { - size: opt('0.13em'), - radius: opt('0.7em'), - color: opt(colors.surface0), - }, - text: opt(colors.text), - dimtext: opt(colors.surface2), - feinttext: opt(colors.surface0), - label: opt(colors.lavender), - popover: { - text: opt(colors.lavender), - background: opt(secondary_colors.mantle), - border: opt(secondary_colors.mantle), - }, - listitems: { - passive: opt(colors.text), - active: opt(secondary_colors.lavender), - }, - icons: { - passive: opt(colors.surface2), - active: opt(colors.lavender), - }, - switch: { - enabled: opt(colors.lavender), - disabled: opt(tertiary_colors.surface0), - puck: opt(secondary_colors.surface1), - }, - check_radio_button: { - background: opt(colors.surface1), - active: opt(tertiary_colors.lavender), - }, - buttons: { - default: opt(colors.lavender), - active: opt(secondary_colors.pink), - disabled: opt(tertiary_colors.surface2), - text: opt(secondary_colors.mantle), - }, - iconbuttons: { - passive: opt(secondary_colors.text), - active: opt(tertiary_colors.lavender), - }, - progressbar: { - foreground: opt(colors.lavender), - background: opt(colors.surface1), - }, - slider: { - primary: opt(colors.lavender), - background: opt(tertiary_colors.surface2), - backgroundhover: opt(colors.surface1), - puck: opt(colors.overlay0), - }, - dropdownmenu: { - background: opt(colors.crust), - text: opt(colors.text), - divider: opt(colors.base), - }, - tooltip: { - background: opt(colors.crust), - text: opt(tertiary_colors.lavender), - }, - menu: { - media: { - scaling: opt(100), - song: opt(tertiary_colors.lavender), - artist: opt(tertiary_colors.teal), - album: opt(tertiary_colors.pink), - background: { - color: opt(colors.crust), - }, - card: { - color: opt(colors.base), - tint: opt(85), - }, - border: { - color: opt(colors.surface0), - }, - buttons: { - inactive: opt(colors.surface2), - enabled: opt(secondary_colors.teal), - background: opt(tertiary_colors.lavender), - text: opt(colors.crust), - }, - slider: { - primary: opt(colors.pink), - background: opt(tertiary_colors.surface2), - backgroundhover: opt(colors.surface1), - puck: opt(colors.overlay0), - }, - }, - volume: { - scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - label: { - color: opt(colors.maroon), - }, - text: opt(colors.text), - listitems: { - passive: opt(colors.text), - active: opt(secondary_colors.maroon), - }, - iconbutton: { - passive: opt(colors.text), - active: opt(colors.maroon), - }, - icons: { - passive: opt(colors.overlay2), - active: opt(colors.maroon), - }, - audio_slider: { - primary: opt(colors.maroon), - background: opt(tertiary_colors.surface2), - backgroundhover: opt(colors.surface1), - puck: opt(colors.surface2), - }, - input_slider: { - primary: opt(colors.maroon), - background: opt(tertiary_colors.surface2), - backgroundhover: opt(colors.surface1), - puck: opt(colors.surface2), - }, - }, - network: { - scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - label: { - color: opt(colors.mauve), - }, - text: opt(colors.text), - status: { - color: opt(colors.overlay0), - }, - listitems: { - passive: opt(colors.text), - active: opt(secondary_colors.mauve), - }, - icons: { - passive: opt(colors.overlay2), - active: opt(colors.mauve), - }, - iconbuttons: { - passive: opt(colors.text), - active: opt(colors.mauve), - }, - switch: { - enabled: opt(colors.mauve), - disabled: opt(tertiary_colors.surface0), - puck: opt(secondary_colors.surface1), - }, - }, - bluetooth: { - scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - label: { - color: opt(colors.sky), - }, - text: opt(colors.text), - status: opt(colors.overlay0), - switch_divider: opt(colors.surface1), - switch: { - enabled: opt(colors.sky), - disabled: opt(tertiary_colors.surface0), - puck: opt(secondary_colors.surface1), - }, - listitems: { - passive: opt(colors.text), - active: opt(secondary_colors.sky), - }, - icons: { - passive: opt(colors.overlay2), - active: opt(colors.sky), - }, - iconbutton: { - passive: opt(colors.text), - active: opt(colors.sky), - }, - }, - systray: { - dropdownmenu: { - background: opt(colors.crust), - text: opt(colors.text), - divider: opt(colors.base), - }, - }, - battery: { - scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - label: { - color: opt(colors.yellow), - }, - text: opt(colors.text), - listitems: { - passive: opt(secondary_colors.text), - active: opt(colors.yellow), - }, - icons: { - passive: opt(colors.overlay2), - active: opt(colors.yellow), - }, - slider: { - primary: opt(colors.yellow), - background: opt(tertiary_colors.surface2), - backgroundhover: opt(colors.surface1), - puck: opt(colors.overlay0), - }, - }, - clock: { - scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - text: opt(colors.text), - time: { - time: opt(colors.pink), - timeperiod: opt(colors.teal), - }, - calendar: { - yearmonth: opt(colors.teal), - weekdays: opt(colors.pink), - paginator: opt(secondary_colors.pink), - currentday: opt(colors.pink), - days: opt(colors.text), - contextdays: opt(colors.surface2), - }, - weather: { - icon: opt(colors.pink), - temperature: opt(colors.text), - status: opt(colors.teal), - stats: opt(colors.pink), - thermometer: { - extremelyhot: opt(colors.red), - hot: opt(colors.peach), - moderate: opt(colors.lavender), - cold: opt(colors.blue), - extremelycold: opt(colors.sky), - }, - hourly: { - time: opt(colors.pink), - icon: opt(colors.pink), - temperature: opt(colors.pink), - }, - }, - }, - dashboard: { - scaling: opt(100), - confirmation_scaling: opt(100), - card: { - color: opt(colors.base), - }, - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - profile: { - name: opt(colors.pink), - size: opt('8.5em'), - radius: opt('0.4em'), - }, - powermenu: { - shutdown: opt(colors.red), - restart: opt(colors.peach), - logout: opt(colors.green), - sleep: opt(colors.sky), - confirmation: { - card: opt(colors.base), - background: opt(colors.crust), - border: opt(colors.surface0), - label: opt(colors.lavender), - body: opt(colors.text), - confirm: opt(colors.green), - deny: opt(colors.red), - button_text: opt(secondary_colors.crust), - }, - }, - shortcuts: { - background: opt(colors.lavender), - text: opt(secondary_colors.mantle), - recording: opt(colors.green), - }, - controls: { - disabled: opt(colors.surface2), - wifi: { - background: opt(colors.mauve), - text: opt(secondary_colors.mantle), - }, - bluetooth: { - background: opt(colors.sky), - text: opt(secondary_colors.mantle), - }, - notifications: { - background: opt(colors.yellow), - text: opt(secondary_colors.mantle), - }, - volume: { - background: opt(colors.maroon), - text: opt(secondary_colors.mantle), - }, - input: { - background: opt(colors.pink), - text: opt(secondary_colors.mantle), - }, - }, - directories: { - left: { - top: { - color: opt(colors.pink), - }, - middle: { - color: opt(colors.yellow), - }, - bottom: { - color: opt(colors.maroon), - }, - }, - right: { - top: { - color: opt(colors.teal), - }, - middle: { - color: opt(colors.mauve), - }, - bottom: { - color: opt(colors.lavender), - }, - }, - }, - monitors: { - bar_background: opt(colors.surface1), - cpu: { - icon: opt(colors.maroon), - bar: opt(tertiary_colors.maroon), - label: opt(colors.maroon), - }, - ram: { - icon: opt(colors.yellow), - bar: opt(tertiary_colors.yellow), - label: opt(colors.yellow), - }, - gpu: { - icon: opt(colors.green), - bar: opt(tertiary_colors.green), - label: opt(colors.green), - }, - disk: { - icon: opt(colors.pink), - bar: opt(tertiary_colors.pink), - label: opt(colors.pink), - }, - }, - }, - power: { - scaling: opt(90), - radius: opt('0.4em'), - background: { - color: opt(colors.crust), - }, - border: { - color: opt(colors.surface0), - }, - buttons: { - shutdown: { - background: opt(colors.base), - icon_background: opt(secondary_colors.red), - text: opt(colors.red), - icon: opt(secondary_colors.mantle), - }, - restart: { - background: opt(colors.base), - icon_background: opt(secondary_colors.peach), - text: opt(colors.peach), - icon: opt(secondary_colors.mantle), - }, - logout: { - background: opt(colors.base), - icon_background: opt(secondary_colors.green), - text: opt(colors.green), - icon: opt(secondary_colors.mantle), - }, - sleep: { - background: opt(colors.base), - icon_background: opt(secondary_colors.sky), - text: opt(colors.sky), - icon: opt(secondary_colors.mantle), - }, - }, - }, - notifications: { - scaling: opt(100), - height: opt('58em'), - label: opt(colors.lavender), - no_notifications_label: opt(colors.surface0), - background: opt(colors.crust), - card: opt(colors.base), - border: opt(colors.surface0), - switch_divider: opt(colors.surface1), - clear: opt(colors.red), - switch: { - enabled: opt(colors.lavender), - disabled: opt(tertiary_colors.surface0), - puck: opt(secondary_colors.surface1), - }, - pager: { - show: opt(true), - background: opt(colors.crust), - button: opt(colors.lavender), - label: opt(colors.overlay2), - }, - scrollbar: { - color: opt(colors.lavender), - width: opt('0.35em'), - radius: opt('0.2em'), - }, - }, - }, - }, - }, - }, - - bar: { - scrollSpeed: opt(5), - layouts: opt({ - '1': { - left: ['dashboard', 'workspaces', 'windowtitle'], - middle: ['media'], - right: ['volume', 'clock', 'notifications'], - }, - '2': { - left: ['dashboard', 'workspaces', 'windowtitle'], - middle: ['media'], - right: ['volume', 'clock', 'notifications'], - }, - '0': { - left: ['dashboard', 'workspaces', 'windowtitle'], - middle: ['media'], - right: ['volume', 'network', 'bluetooth', 'battery', 'systray', 'clock', 'notifications'], - }, - }), - launcher: { - icon: opt('󰣇'), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - windowtitle: { - custom_title: opt(true), - title_map: opt([]), - class_name: opt(true), - label: opt(true), - icon: opt(true), - truncation: opt(true), - truncation_size: opt(50), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - workspaces: { - show_icons: opt(false), - showAllActive: opt(true), - ignored: opt(''), - show_numbered: opt(false), - showWsIcons: opt(false), - numbered_active_indicator: opt('underline'), - icons: { - available: opt(''), - active: opt(''), - occupied: opt(''), - }, - workspaceIconMap: opt({}), - workspaces: opt(10), - spacing: opt(1), - monitorSpecific: opt(true), - hideUnoccupied: opt(true), - workspaceMask: opt(false), - reverse_scroll: opt(false), - scroll_speed: opt(5), - }, - volume: { - label: opt(true), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt('pactl set-sink-volume @DEFAULT_SINK@ +5%'), - scrollDown: opt('pactl set-sink-volume @DEFAULT_SINK@ -5%'), - }, - network: { - truncation: opt(true), - truncation_size: opt(7), - label: opt(true), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - bluetooth: { - label: opt(true), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - battery: { - label: opt(true), - hideLabelWhenFull: opt(false), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - systray: { - ignore: opt([]), - }, - clock: { - icon: opt('󰸗'), - showIcon: opt(true), - showTime: opt(true), - format: opt('%a %b %d %I:%M:%S %p'), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - media: { - show_artist: opt(false), - truncation: opt(true), - show_label: opt(true), - truncation_size: opt(30), - show_active_only: opt(false), - rightClick: opt(''), - middleClick: opt(''), - }, - notifications: { - show_total: opt(false), - hideCountWhenZero: opt(false), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - customModules: { - scrollSpeed: opt(5), - ram: { - icon: opt(''), - label: opt(true), - labelType: opt('percentage'), - round: opt(true), - pollingInterval: opt(2000), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - }, - cpu: { - icon: opt(''), - label: opt(true), - round: opt(true), - pollingInterval: opt(2000), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - storage: { - label: opt(true), - icon: opt('󰋊'), - round: opt(false), - labelType: opt('percentage'), - pollingInterval: opt(2000), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - }, - netstat: { - label: opt(true), - networkInterface: opt(''), - icon: opt('󰖟'), - round: opt(true), - labelType: opt('full'), - rateUnit: opt('auto'), - pollingInterval: opt(2000), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - }, - kbLayout: { - label: opt(true), - labelType: opt('code'), - icon: opt('󰌌'), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - updates: { - updateCommand: opt('$HOME/.config/ags/scripts/checkUpdates.sh -arch'), - label: opt(true), - padZero: opt(true), - icon: opt('󰏖'), - pollingInterval: opt(1000 * 60 * 60 * 6), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - submap: { - label: opt(true), - showSubmapName: opt(true), - enabledIcon: opt('󰌐'), - disabledIcon: opt('󰌌'), - enabledText: opt('Submap On'), - disabledText: opt('Submap off'), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - weather: { - label: opt(true), - unit: opt('imperial'), - leftClick: opt(''), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - power: { - icon: opt(''), - showLabel: opt(true), - leftClick: opt('menu:powerdropdown'), - rightClick: opt(''), - middleClick: opt(''), - scrollUp: opt(''), - scrollDown: opt(''), - }, - }, - }, - - menus: { - transition: opt('crossfade'), - transitionTime: opt(200), - power: { - showLabel: opt(true), - confirmation: opt(true), - sleep: opt('systemctl suspend'), - reboot: opt('systemctl reboot'), - logout: opt('hyprctl dispatch exit'), - shutdown: opt('systemctl poweroff'), - }, - dashboard: { - powermenu: { - confirmation: opt(true), - sleep: opt('systemctl suspend'), - reboot: opt('systemctl reboot'), - logout: opt('hyprctl dispatch exit'), - shutdown: opt('systemctl poweroff'), - avatar: { - image: opt('avatar-default-symbolic'), - name: opt<'system' | string>('system'), - }, - }, - stats: { - enabled: opt(true), - enable_gpu: opt(false), - }, - controls: { - enabled: opt(true), - }, - shortcuts: { - enabled: opt(true), - left: { - shortcut1: { - icon: opt('󰇩'), - tooltip: opt('Microsoft Edge'), - command: opt('microsoft-edge-stable'), - }, - shortcut2: { - icon: opt(''), - tooltip: opt('Spotify'), - command: opt('spotify-launcher'), - }, - shortcut3: { - icon: opt(''), - tooltip: opt('Discord'), - command: opt('discord'), - }, - shortcut4: { - icon: opt(''), - tooltip: opt('Search Apps'), - command: opt('rofi -show drun'), - }, - }, - right: { - shortcut1: { - icon: opt(''), - tooltip: opt('Color Picker'), - command: opt('hyprpicker -a'), - }, - shortcut3: { - icon: opt('󰄀'), - tooltip: opt('Screenshot'), - command: opt('bash -c "$HOME/.config/ags/services/snapshot.sh"'), - }, - }, - }, - directories: { - enabled: opt(true), - left: { - directory1: { - label: opt('󰉍 Downloads'), - command: opt('bash -c "dolphin $HOME/Downloads/"'), - }, - directory2: { - label: opt('󰉏 Videos'), - command: opt('bash -c "dolphin $HOME/Videos/"'), - }, - directory3: { - label: opt('󰚝 Projects'), - command: opt('bash -c "dolphin $HOME/Projects/"'), - }, - }, - right: { - directory1: { - label: opt('󱧶 Documents'), - command: opt('bash -c "dolphin $HOME/Documents/"'), - }, - directory2: { - label: opt('󰉏 Pictures'), - command: opt('bash -c "dolphin $HOME/Pictures/"'), - }, - directory3: { - label: opt('󱂵 Home'), - command: opt('bash -c "dolphin $HOME/"'), - }, - }, - }, - }, - clock: { - time: { - military: opt(false), - hideSeconds: opt(false), - }, - weather: { - enabled: opt(true), - interval: opt(60000), - unit: opt('imperial'), - location: opt('Los Angeles'), - key: opt( - JSON.parse(Utils.readFile(`${App.configDir}/.weather.json`) || '{}')?.weather_api_key || '', - ), - }, - }, - }, - - scalingPriority: opt('gdk'), - - terminal: opt('kitty'), - - tear: opt(false), - - wallpaper: { - enable: opt(true), - image: opt(''), - pywal: opt(false), - }, - - notifications: { - position: opt('top right'), - ignore: opt([]), - displayedTotal: opt(10), - monitor: opt(0), - active_monitor: opt(true), - timeout: opt(7000), - cache_actions: opt(true), - clearDelay: opt(100), - }, - - dummy: opt(true), -}); - -globalThis['options'] = options; -export default options; diff --git a/ags/HyprPanel/package-lock.json b/ags/HyprPanel/package-lock.json deleted file mode 100644 index d15b8fb..0000000 --- a/ags/HyprPanel/package-lock.json +++ /dev/null @@ -1,3089 +0,0 @@ -{ - "name": "hyprpanel", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "hyprpanel", - "version": "1.0.0", - "license": "MIT", - "devDependencies": { - "@types/node": "^22.5.4", - "@typescript-eslint/eslint-plugin": "^8.5.0", - "@typescript-eslint/parser": "^8.5.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.30.0", - "eslint-plugin-prettier": "^5.2.1", - "prettier": "^3.3.3", - "tsconfig-paths": "^4.2.0", - "typescript": "^5.6.2" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "deprecated": "Use @eslint/config-array instead", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@pkgr/core": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", - "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "22.5.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", - "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", - "dev": true, - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.5.0.tgz", - "integrity": "sha512-lHS5hvz33iUFQKuPFGheAB84LwcJ60G8vKnEhnfcK1l8kGVLro2SFYW6K0/tj8FUhRJ0VHyg1oAfg50QGbPPHw==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.5.0", - "@typescript-eslint/type-utils": "8.5.0", - "@typescript-eslint/utils": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.5.0.tgz", - "integrity": "sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "8.5.0", - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/typescript-estree": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", - "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.5.0.tgz", - "integrity": "sha512-N1K8Ix+lUM+cIDhL2uekVn/ZD7TZW+9/rwz8DclQpcQ9rk4sIL5CAlBC0CugWKREmDjBzI/kQqU4wkg46jWLYA==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "8.5.0", - "@typescript-eslint/utils": "8.5.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", - "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", - "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/visitor-keys": "8.5.0", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.5.0.tgz", - "integrity": "sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.5.0", - "@typescript-eslint/types": "8.5.0", - "@typescript-eslint/typescript-estree": "8.5.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", - "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.5.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-includes": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", - "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", - "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", - "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", - "dev": true, - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.11.0.tgz", - "integrity": "sha512-gbBE5Hitek/oG6MUVj6sFuzEjA/ClzNflVrLovHi/JgLdC7fiN5gLAY1WIPW1a0V5I999MnsrvVrCOGmmVqDBQ==", - "dev": true, - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz", - "integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==", - "dev": true, - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.8", - "array.prototype.findlastindex": "^1.2.5", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.9.0", - "hasown": "^2.0.2", - "is-core-module": "^2.15.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.0", - "semver": "^6.3.1", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-import/node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/eslint-plugin-prettier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", - "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", - "dev": true, - "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.9.1" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-plugin-prettier" - }, - "peerDependencies": { - "@types/eslint": ">=8.0.0", - "eslint": ">=8.0.0", - "eslint-config-prettier": "*", - "prettier": ">=3.0.0" - }, - "peerDependenciesMeta": { - "@types/eslint": { - "optional": true - }, - "eslint-config-prettier": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "dev": true, - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "dev": true, - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", - "dev": true, - "dependencies": { - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", - "dev": true, - "dependencies": { - "which-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-regex": "^1.1.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/synckit": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", - "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", - "dev": true, - "dependencies": { - "@pkgr/core": "^0.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", - "dev": true, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" - } - }, - "node_modules/tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", - "dev": true, - "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/ags/HyprPanel/package.json b/ags/HyprPanel/package.json deleted file mode 100644 index a617f97..0000000 --- a/ags/HyprPanel/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "hyprpanel", - "version": "1.0.0", - "description": "A customizble panel built for Hyprland.", - "main": "config.js", - "directories": { - "lib": "lib" - }, - "scripts": { - "lint": "eslint --config .eslintrc.js .", - "lint:fix": "eslint --config .eslintrc.js .", - "format": "prettier --write 'modules/**/*.ts'" - }, - "keywords": [], - "author": "", - "license": "MIT", - "devDependencies": { - "@types/node": "^22.5.4", - "@typescript-eslint/eslint-plugin": "^8.5.0", - "@typescript-eslint/parser": "^8.5.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.30.0", - "eslint-plugin-prettier": "^5.2.1", - "prettier": "^3.3.3", - "tsconfig-paths": "^4.2.0", - "typescript": "^5.6.2" - } -} diff --git a/ags/HyprPanel/scripts/checkUpdates.sh b/ags/HyprPanel/scripts/checkUpdates.sh deleted file mode 100755 index 39bf6ec..0000000 --- a/ags/HyprPanel/scripts/checkUpdates.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -check_arch_updates() { - official_updates=0 - aur_updates=0 - - if [ "$1" = "-y" ]; then - aur_updates=$(yay -Qum 2>/dev/null | wc -l) - elif [ "$1" = "-p" ]; then - official_updates=$(checkupdates 2>/dev/null | wc -l) - else - official_updates=$(checkupdates 2>/dev/null | wc -l) - aur_updates=$(yay -Qum 2>/dev/null | wc -l) - fi - - total_updates=$((official_updates + aur_updates)) - - echo $total_updates -} - -check_ubuntu_updates() { - result=$(apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst) - echo "$result" -} - -check_fedora_updates() { - result=$(dnf check-update -q | grep -v '^Loaded plugins' | grep -v '^No match for' | wc -l) - echo "$result" -} - -case "$1" in --arch) - check_arch_updates "$2" - ;; --ubuntu) - check_ubuntu_updates - ;; --fedora) - check_fedora_updates - ;; -*) - echo "0" - ;; -esac diff --git a/ags/HyprPanel/scripts/fillThemes.js b/ags/HyprPanel/scripts/fillThemes.js deleted file mode 100644 index 085d05f..0000000 --- a/ags/HyprPanel/scripts/fillThemes.js +++ /dev/null @@ -1,388 +0,0 @@ -#!/usr/bin/env node - -/** - * compare_themes.js - * - * A Node.js script to compare theme JSON files against base themes and add missing keys, - * as well as remove any properties that don't exist in the corresponding base theme. - * It assigns values based on matching colors or randomly selects from border colors. - * - * Usage: - * node compare_themes.js [--dry-run] [themes_directory] - * - * If no themes_directory is provided, it defaults to '~/.config/ags/themes'. - */ - -const fs = require('fs'); -const path = require('path'); -const os = require('os'); - -/** - * ANSI color codes for formatting console output. - */ -const COLORS = { - RESET: '\x1b[0m', - FG_RED: '\x1b[31m', - FG_GREEN: '\x1b[32m', - FG_YELLOW: '\x1b[33m', - FG_BLUE: '\x1b[34m', - FG_MAGENTA: '\x1b[35m', - FG_CYAN: '\x1b[36m', - FG_WHITE: '\x1b[37m', - BG_RED: '\x1b[41m', - BG_GREEN: '\x1b[42m', - BG_YELLOW: '\x1b[43m', - BG_BLUE: '\x1b[44m', - BG_MAGENTA: '\x1b[45m', - BG_CYAN: '\x1b[46m', - BG_WHITE: '\x1b[47m', -}; - -/** - * Formats a message with the given color. - * - * @param {string} color - The ANSI color code. - * @param {string} message - The message to format. - * @returns {string} The formatted message. - */ -const formatMessage = (color, message) => `${color}${message}${COLORS.RESET}`; - -/** - * Loads and parses a JSON file. - * - * @param {string} filePath - The path to the JSON file. - * @returns {Object} The parsed JSON object. - */ -const loadJSON = (filePath) => { - try { - const data = fs.readFileSync(filePath, 'utf8'); - return JSON.parse(data); - } catch (error) { - console.error(formatMessage(COLORS.FG_RED, `Error reading or parsing '${filePath}': ${error.message}`)); - process.exit(1); - } -}; - -/** - * Saves a JSON object to a file with indentation. - * - * @param {string} filePath - The path to the JSON file. - * @param {Object} data - The JSON data to save. - */ -const saveJSON = (filePath, data) => { - try { - const jsonString = JSON.stringify(data, null, 2); - fs.writeFileSync(filePath, jsonString, 'utf8'); - } catch (error) { - console.error(formatMessage(COLORS.FG_RED, `Error writing to '${filePath}': ${error.message}`)); - process.exit(1); - } -}; - -/** - * Finds the most common value in an array. - * - * @param {Array} arr - The array to analyze. - * @returns {*} The most common value in the array. - */ -const getMostCommonValue = (arr) => { - const frequency = {}; - let maxFreq = 0; - let mostCommon = arr[0] || null; - - arr.forEach((value) => { - frequency[value] = (frequency[value] || 0) + 1; - if (frequency[value] > maxFreq) { - maxFreq = frequency[value]; - mostCommon = value; - } - }); - - return mostCommon; -}; - -/** - * Compares two JSON objects and finds missing keys in the target. - * - * @param {Object} baseJSON - The base JSON object. - * @param {Object} targetJSON - The target JSON object to compare. - * @returns {Array} An array of missing keys. - */ -const findMissingKeys = (baseJSON, targetJSON) => { - const baseKeys = new Set(Object.keys(baseJSON)); - const targetKeys = new Set(Object.keys(targetJSON)); - - const missingKeys = [...baseKeys].filter((key) => !targetKeys.has(key)); - return missingKeys; -}; - -/** - * Determines if a key should be excluded based on predefined patterns. - * - * @param {string} key - The key to check. - * @returns {boolean} True if the key is excluded, otherwise false. - */ -const isExcludedKey = (key) => { - const excludedPatterns = []; - - return excludedPatterns.some((pattern) => pattern.test(key)); -}; - -/** - * Builds a mapping from values to their corresponding keys in the base theme. - * - * @param {Object} baseJSON - The base JSON object. - * @returns {Object} A map where keys are values and values are arrays of keys. - */ -const buildValueToKeysMap = (baseJSON) => { - const valueToKeysMap = {}; - - Object.entries(baseJSON).forEach(([key, value]) => { - if (!valueToKeysMap[value]) { - valueToKeysMap[value] = []; - } - valueToKeysMap[value].push(key); - }); - - return valueToKeysMap; -}; - -/** - * Collects all border colors from the base theme. - * - * @param {Object} baseJSON - The base JSON object. - * @returns {Array} An array of border color values. - */ -const collectBorderColors = (baseJSON) => { - const borderColors = new Set(); - - Object.entries(baseJSON).forEach(([key, value]) => { - if (/^theme\.bar\.buttons\..*\.border$/.test(key)) { - borderColors.add(value); - } - }); - - return Array.from(borderColors); -}; - -/** - * Determines the best match value for a missing key based on related keys. - * - * @param {string} baseValue - The value of the missing key in the base theme. - * @param {Object} valueToKeysMap - A map from values to keys in the base theme. - * @param {Object} targetJSON - The target JSON object. - * @returns {*} The best matching value or null if a random selection is needed. - */ -const determineBestMatchValue = (baseValue, valueToKeysMap, targetJSON) => { - const relatedBaseKeys = valueToKeysMap[baseValue] || []; - - const correspondingTargetValues = relatedBaseKeys - .map((baseKey) => targetJSON[baseKey]) - .filter((value) => value !== undefined); - - if (correspondingTargetValues.length > 0) { - return getMostCommonValue(correspondingTargetValues); - } - - return null; -}; - -/** - * Finds extra keys in the target JSON that are not present in the base theme. - * - * @param {Object} baseTheme - The base JSON object. - * @param {Object} targetJSON - The target JSON object. - * @returns {Array} An array of extra keys. - */ -const findExtraKeys = (baseTheme, targetJSON) => { - const validKeys = new Set(Object.keys(baseTheme)); - - const targetKeys = Object.keys(targetJSON); - - const extraKeys = targetKeys.filter((key) => !validKeys.has(key) && !isExcludedKey(key)); - - return extraKeys; -}; - -/** - * Creates a backup of a theme file. - * - * @param {string} themePath - The path to the theme file. - */ -const backupTheme = (themePath) => { - const backupDir = path.join(path.dirname(themePath), 'backup'); - if (!fs.existsSync(backupDir)) { - fs.mkdirSync(backupDir); - } - const backupPath = path.join(backupDir, path.basename(themePath)); - fs.copyFileSync(themePath, backupPath); - console.log(formatMessage(COLORS.FG_CYAN, `Backup created at '${backupPath}'.`)); -}; - -/** - * Processes a single theme by adding missing keys and removing extra keys. - * - * @param {string} themePath - The path to the theme file. - * @param {Object} baseTheme - The base JSON object. - * @param {boolean} dryRun - If true, no changes will be written to files. - */ -const processTheme = (themePath, baseTheme, dryRun) => { - const themeJSON = loadJSON(themePath); - const missingKeys = findMissingKeys(baseTheme, themeJSON); - - let hasChanges = false; - - if (missingKeys.length === 0) { - console.log(formatMessage(COLORS.FG_GREEN, `✅ No missing keys in '${path.basename(themePath)}'.`)); - } else { - console.log( - formatMessage( - COLORS.FG_YELLOW, - `\n🔍 Processing '${path.basename(themePath)}': Found ${missingKeys.length} missing key(s).`, - ), - ); - - const valueToKeysMap = buildValueToKeysMap(baseTheme); - const borderColors = collectBorderColors(baseTheme); - - missingKeys.forEach((key) => { - if (isExcludedKey(key)) { - console.log(formatMessage(COLORS.FG_MAGENTA, `❗ Excluded key from addition: "${key}"`)); - return; - } - - const baseValue = baseTheme[key]; - const bestValue = determineBestMatchValue(baseValue, valueToKeysMap, themeJSON); - - if (bestValue !== null) { - themeJSON[key] = bestValue; - console.log(formatMessage(COLORS.FG_GREEN, `➕ Added key: "${key}": "${bestValue}"`)); - } else { - if (borderColors.length === 0) { - console.error(formatMessage(COLORS.FG_RED, '❌ Error: No border colors available to assign.')); - return; - } - const randomColor = borderColors[Math.floor(Math.random() * borderColors.length)]; - themeJSON[key] = randomColor; - console.log( - formatMessage( - COLORS.FG_YELLOW, - `➕ Added key with random border color: "${key}": "${randomColor}"`, - ), - ); - } - - hasChanges = true; - }); - } - - const extraKeys = findExtraKeys(baseTheme, themeJSON); - - if (extraKeys.length === 0) { - console.log(formatMessage(COLORS.FG_GREEN, `✅ No extra keys to remove in '${path.basename(themePath)}'.`)); - } else { - console.log( - formatMessage( - COLORS.FG_YELLOW, - `\n🗑️ Processing '${path.basename(themePath)}': Found ${extraKeys.length} extra key(s) to remove.`, - ), - ); - - extraKeys.forEach((key) => { - delete themeJSON[key]; - console.log(formatMessage(COLORS.FG_RED, `➖ Removed key: "${key}"`)); - hasChanges = true; - }); - } - - if (hasChanges) { - if (dryRun) { - console.log( - formatMessage( - COLORS.FG_CYAN, - `(Dry-Run) 📝 Would update '${path.basename(themePath)}' with missing and extra keys.`, - ), - ); - } else { - backupTheme(themePath); - saveJSON(themePath, themeJSON); - console.log( - formatMessage(COLORS.FG_GREEN, `✅ Updated '${path.basename(themePath)}' with missing and extra keys.`), - ); - } - } else { - console.log(formatMessage(COLORS.FG_BLUE, `ℹ️ No changes made to '${path.basename(themePath)}'.`)); - } -}; - -/** - * The main function that orchestrates the theme comparison and updating. - */ -const main = () => { - const args = process.argv.slice(2); - const dryRunIndex = args.indexOf('--dry-run'); - const dryRun = dryRunIndex !== -1; - if (dryRun) { - args.splice(dryRunIndex, 1); - console.log(formatMessage(COLORS.FG_CYAN, '🔍 Running in Dry-Run mode. No files will be modified.')); - } - - const themesDir = args[0] || path.join(os.homedir(), '.config', 'ags', 'themes'); - - if (!fs.existsSync(themesDir)) { - console.error(formatMessage(COLORS.FG_RED, `❌ Error: Themes directory '${themesDir}' does not exist.`)); - process.exit(1); - } - - const baseThemeFile = 'catppuccin_mocha.json'; - const baseThemeSplitFile = 'catppuccin_mocha_split.json'; - const baseThemePath = path.join(themesDir, baseThemeFile); - const baseThemeSplitPath = path.join(themesDir, baseThemeSplitFile); - - if (!fs.existsSync(baseThemePath)) { - console.error( - formatMessage(COLORS.FG_RED, `❌ Error: Base theme '${baseThemeFile}' does not exist in '${themesDir}'.`), - ); - process.exit(1); - } - - if (!fs.existsSync(baseThemeSplitPath)) { - console.error( - formatMessage( - COLORS.FG_RED, - `❌ Error: Base split theme '${baseThemeSplitFile}' does not exist in '${themesDir}'.`, - ), - ); - process.exit(1); - } - - const baseTheme = loadJSON(baseThemePath); - const baseThemeSplit = loadJSON(baseThemeSplitPath); - - const themeFiles = fs.readdirSync(themesDir).filter((file) => file.endsWith('.json')); - - themeFiles.forEach((file) => { - if (file === baseThemeFile || file === baseThemeSplitFile) { - return; - } - - const themePath = path.join(themesDir, file); - let correspondingBaseTheme; - - if (file.endsWith('_split.json')) { - correspondingBaseTheme = baseThemeSplit; - } else { - correspondingBaseTheme = baseTheme; - } - - try { - processTheme(themePath, correspondingBaseTheme, dryRun); - } catch (error) { - console.error(formatMessage(COLORS.FG_RED, `❌ Error processing '${file}': ${error.message}`)); - } - }); - - console.log(formatMessage(COLORS.FG_GREEN, '\n🎉 All themes have been processed.')); -}; - -main(); diff --git a/ags/HyprPanel/scripts/fillThemes.sh b/ags/HyprPanel/scripts/fillThemes.sh deleted file mode 100755 index 8684653..0000000 --- a/ags/HyprPanel/scripts/fillThemes.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# Generated by our good friend Chat Jippity -# Might be inefficient but it works - -# Define directories and theme files -THEMES_DIR="$(dirname "$(realpath "$0")")/../themes" -COMPLETE_THEME_FILE="catppuccin_mocha.json" -COMPLETE_SPLIT_THEME_FILE="catppuccin_mocha_split.json" - -# Check if jq is installed -if ! command -v jq &>/dev/null; then - echo "jq is required but not installed. Please install jq and try again." - exit 1 -fi - -# Function to fill missing values -fill_missing_values() { - local complete_theme_file="$1" - local target_theme_file="$2" - - # Load complete theme and target theme into variables - complete_theme=$(jq '.' "$complete_theme_file") - target_theme=$(jq '.' "$target_theme_file") - - # Create associative arrays to map colors to properties for fast lookup - declare -A color_to_props - declare -A prop_to_color - - # Populate color_to_props and prop_to_color arrays from complete theme - while IFS= read -r line; do - key=$(echo "$line" | awk '{print $1}') - value=$(echo "$line" | awk '{print $2}') - color_to_props["$value"]+="$key " - prop_to_color["$key"]="$value" - done < <(echo "$complete_theme" | jq -r 'to_entries[] | "\(.key) \(.value)"') - - # Generate filled theme by iterating over complete theme keys - filled_theme="$target_theme" - for key in "${!prop_to_color[@]}"; do - if ! echo "$target_theme" | jq -e ".\"$key\"" &>/dev/null; then - # Find corresponding color if missing in target theme - value="${prop_to_color[$key]}" - corresponding_color="" - - # Check if other properties with the same color exist in the target theme - for prop in ${color_to_props["$value"]}; do - if echo "$target_theme" | jq -e ".\"$prop\"" &>/dev/null; then - corresponding_color=$(echo "$target_theme" | jq -r ".\"$prop\"") - break - fi - done - - # Add missing property with the corresponding color - if [ -n "$corresponding_color" ]; then - filled_theme=$(echo "$filled_theme" | jq --arg key "$key" --arg value "$corresponding_color" '.[$key] = $value') - echo "Added missing property: $key with value: $corresponding_color to $target_theme_file" - else - # Default action if no corresponding color is found - echo "No corresponding color found for $key; using value from complete theme." - filled_theme=$(echo "$filled_theme" | jq --arg key "$key" --arg value "$value" '.[$key] = $value') - fi - fi - done - - # Write the filled theme back to the target file - echo "$filled_theme" >"$target_theme_file" - echo "Filled missing values in $target_theme_file" -} - -# Process all theme files in the directory -for file in "$THEMES_DIR"/*.json; do - filename=$(basename "$file") - - # Skip the complete theme files - if [[ "$filename" == "$COMPLETE_THEME_FILE" ]] || [[ "$filename" == "$COMPLETE_SPLIT_THEME_FILE" ]]; then - continue - fi - - # Determine whether to use split or non-split complete theme - if [[ "$filename" == *"_split"* ]]; then - fill_missing_values "$THEMES_DIR/$COMPLETE_SPLIT_THEME_FILE" "$file" - else - fill_missing_values "$THEMES_DIR/$COMPLETE_THEME_FILE" "$file" - fi -done diff --git a/ags/HyprPanel/scss/main.scss b/ags/HyprPanel/scss/main.scss deleted file mode 100644 index 49328f9..0000000 --- a/ags/HyprPanel/scss/main.scss +++ /dev/null @@ -1,54 +0,0 @@ -* { - all: unset; - font-family: $font-name; - font-size: $font-size; - font-weight: $font-weight; -} - -//general -@import "style/colors"; -@import "style/common/common.scss"; -@import "style/common/floating-widget.scss"; -@import "style/common/widget-button.scss"; - -//general styles -@import "style/common/general"; - -//modules - bar -@import "style/bar/bar"; -@import "style/bar/menu"; -@import "style/bar/audio"; -@import "style/bar/media"; -@import "style/bar/network"; -@import "style/bar/bluetooth"; -@import "style/bar/clock"; -@import "style/bar/workspace"; -@import "style/bar/window_title"; -@import "style/bar/systray"; -@import "style/bar/notifications"; -@import "style/bar/power"; -@import "style/bar/battery"; - -//modules - menus -@import "style/menus/menu"; -@import "style/menus/power"; -@import "style/menus/powerdropdown"; -@import "style/menus/audiomenu"; -@import "style/menus/network"; -@import "style/menus/bluetooth"; -@import "style/menus/media"; -@import "style/menus/notifications"; -@import "style/menus/calendar"; -@import "style/menus/energy"; -@import "style/menus/dashboard"; - -//notifications -@import "style/notifications/popups"; - -//osd -@import "style/osd/index"; - -//settings dialog -@import "style/settings/dialog"; - -@import "style/customModules/style"; diff --git a/ags/HyprPanel/scss/optionsTrackers.ts b/ags/HyprPanel/scss/optionsTrackers.ts deleted file mode 100644 index ef360de..0000000 --- a/ags/HyprPanel/scss/optionsTrackers.ts +++ /dev/null @@ -1,58 +0,0 @@ -import icons from 'lib/icons'; -import { bash, dependencies, Notify, isAnImage } from 'lib/utils'; -import options from 'options'; -import Wallpaper from 'services/Wallpaper'; - -const { matugen } = options.theme; -const { mode, scheme_type, contrast } = options.theme.matugen_settings; - -const ensureMatugenWallpaper = (): void => { - const wallpaperPath = options.wallpaper.image.value; - - if (matugen.value && (!options.wallpaper.image.value.length || !isAnImage(wallpaperPath))) { - Notify({ - summary: 'Matugen Failed', - body: "Please select a wallpaper in 'Theming > General' first.", - iconName: icons.ui.warning, - timeout: 7000, - }); - matugen.value = false; - } -}; - -export const initializeTrackers = (resetCssFunc: () => void): void => { - matugen.connect('changed', () => { - ensureMatugenWallpaper(); - options.resetTheme(); - }); - - mode.connect('changed', () => { - options.resetTheme(); - }); - scheme_type.connect('changed', () => { - options.resetTheme(); - }); - contrast.connect('changed', () => { - options.resetTheme(); - }); - - Wallpaper.connect('changed', () => { - console.info('Wallpaper changed, regenerating Matugen colors...'); - if (options.theme.matugen.value) { - options.resetTheme(); - resetCssFunc(); - } - }); - - options.wallpaper.image.connect('changed', () => { - if ((!Wallpaper.isRunning() && options.theme.matugen.value) || !options.wallpaper.enable.value) { - console.info('Wallpaper path changed, regenerating Matugen colors...'); - options.resetTheme(); - resetCssFunc(); - } - if (options.wallpaper.pywal.value && dependencies('wal')) { - const wallpaperPath = options.wallpaper.image.value; - bash(`wal -i ${wallpaperPath}`); - } - }); -}; diff --git a/ags/HyprPanel/scss/style.ts b/ags/HyprPanel/scss/style.ts deleted file mode 100644 index 0679506..0000000 --- a/ags/HyprPanel/scss/style.ts +++ /dev/null @@ -1,79 +0,0 @@ -import options from 'options'; -import { bash, dependencies } from 'lib/utils'; -import { MatugenColors, RecursiveOptionsObject } from 'lib/types/options'; -import { initializeTrackers } from './optionsTrackers'; -import { generateMatugenColors, replaceHexValues } from '../services/matugen/index'; -import { isHexColor } from 'globals/variables'; - -const deps = ['font', 'theme', 'bar.flatButtons', 'bar.position', 'bar.battery.charging', 'bar.battery.blocks']; - -function extractVariables(theme: RecursiveOptionsObject, prefix = '', matugenColors?: MatugenColors): string[] { - let result = [] as string[]; - for (const key in theme) { - if (!theme.hasOwnProperty(key)) { - continue; - } - - const themeValue = theme[key]; - - const newPrefix = prefix ? `${prefix}-${key}` : key; - - const replacedValue = - isHexColor(themeValue.value) && matugenColors !== undefined - ? replaceHexValues(themeValue.value, matugenColors) - : themeValue.value; - - if (typeof themeValue === 'function') { - result.push(`$${newPrefix}: ${replacedValue};`); - continue; - } - if (typeof themeValue !== 'object' || themeValue === null || Array.isArray(themeValue)) continue; - - if (typeof themeValue.value !== 'undefined') { - result.push(`$${newPrefix}: ${replacedValue};`); - } else { - result = result.concat(extractVariables(themeValue, newPrefix, matugenColors)); - } - } - - return result; -} - -const resetCss = async (): Promise => { - if (!dependencies('sass')) return; - - try { - const matugenColors = await generateMatugenColors(); - - const variables = extractVariables(options.theme as RecursiveOptionsObject, '', matugenColors); - - const vars = `${TMP}/variables.scss`; - const css = `${TMP}/main.css`; - const scss = `${TMP}/entry.scss`; - const localScss = `${App.configDir}/scss/main.scss`; - - const themeVariables = variables; - const integratedVariables = themeVariables; - - const imports = [vars].map((f) => `@import '${f}';`); - - await Utils.writeFile(integratedVariables.join('\n'), vars); - - let mainScss = Utils.readFile(localScss); - mainScss = `${imports}\n${mainScss}`; - - await Utils.writeFile(mainScss, scss); - - await bash(`sass --load-path=${App.configDir}/scss/ ${scss} ${css}`); - - App.applyCss(css, true); - } catch (error) { - console.error(error); - } -}; - -initializeTrackers(resetCss); - -Utils.monitorFile(`${App.configDir}/scss/style`, resetCss); -options.handler(deps, resetCss); -await resetCss(); diff --git a/ags/HyprPanel/scss/style/bar/audio.scss b/ags/HyprPanel/scss/style/bar/audio.scss deleted file mode 100644 index 10e1a9d..0000000 --- a/ags/HyprPanel/scss/style/bar/audio.scss +++ /dev/null @@ -1,59 +0,0 @@ -.bar-button-icon.volume { - font-size: 1.3em; - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-volume-icon); -} - -.bar-button-label.volume { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-volume-text); - min-width: 2.2em; - margin-left: $bar-buttons-volume-spacing; -} - -.style2 { - .bar-button-icon.volume { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-volume-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-volume-spacing; - border-top-left-radius: if( - $bar-buttons-volume-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-volume-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.volume { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-volume-spacing; - margin-left: 0em; - } - &.no-label.volume-container { - .bar-button-icon.volume { - border-top-right-radius: if( - $bar-buttons-volume-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-volume-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} -.bar_item_box_visible.volume { - border: if( - $bar-buttons-volume-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-volume-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/bar.scss b/ags/HyprPanel/scss/style/bar/bar.scss deleted file mode 100644 index 74bc27c..0000000 --- a/ags/HyprPanel/scss/style/bar/bar.scss +++ /dev/null @@ -1,156 +0,0 @@ -.bar { - * { - font-size: $font-size * $bar-scaling * 0.01; - } - - .bar-panel-container { - margin-top: if($bar-floating, $bar-margin_top, 0em); - margin-bottom: if($bar-floating, $bar-margin_bottom, 0em); - margin-left: if($bar-floating, $bar-margin_sides, 0em); - margin-right: if($bar-floating, $bar-margin_sides, 0em); - } - - .bar-panel { - $bar-opacity-ratio: $bar-opacity * 0.01; - $transparency-value: 1 - $bar-opacity-ratio; - background: if($bar-transparent, transparent, transparentize($bar-background, $transparency-value)); - border-radius: if($bar-floating, $bar-border_radius, 0em); - } -} - -$bar-button-background-opacity-ratio: $bar-buttons-background_opacity * 0.01; -$transparency-value: 1 - $bar-button-background-opacity-ratio; - -$bar-button-background-hover-opacity-ratio: $bar-buttons-background_hover_opacity * 0.01; -$transparency-value-hover: 1 - $bar-button-background-hover-opacity-ratio; - -.bar_item_box_visible { - background-color: transparentize($bar-buttons-background, $transparency-value); - border-radius: $bar-buttons-radius; - margin: $bar-buttons-y_margins $bar-buttons-spacing; - opacity: $bar-buttons-opacity * 0.01; - padding: $bar-buttons-padding_y $bar-buttons-padding_x; - - &.style3 { - border-bottom-left-radius: 1.3em; - border-top-right-radius: 1.3em; - } - - &.style4 { - border-bottom-right-radius: 1.3em; - border-top-left-radius: 1.3em; - } - - &:hover { - opacity: $bar-buttons-background_hover_opacity * 0.01; - } - - &.battery { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-battery-background), - $transparency-value - ); - } - - &.bluetooth { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-bluetooth-background), - $transparency-value - ); - } - - &.clock { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-clock-background), - $transparency-value - ); - } - - &.media { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-media-background), - $transparency-value - ); - } - - &.dashboard { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-dashboard-background), - $transparency-value - ); - } - - &.network { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-network-background), - $transparency-value - ); - } - - &.notifications { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-notifications-background), - $transparency-value - ); - } - - &.systray { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-systray-background), - $transparency-value - ); - &:hover { - opacity: 1; - } - } - - &.volume { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-volume-background), - $transparency-value - ); - } - - &.windowtitle { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-windowtitle-background), - $transparency-value - ); - } - - &.workspaces { - background-color: transparentize( - if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-workspaces-background), - $transparency-value - ); - &:hover { - opacity: 1; - } - } - - &.style2 { - padding: 0em; - } -} - -.no-label.style2 { - .bar-button-icon { - border-top-right-radius: $bar-buttons-radius; - border-bottom-right-radius: $bar-buttons-radius; - } -} - -.bar_item_box_hidden { - background: none; - border-radius: 0rem; - padding: 0rem 0rem 0rem 0rem; - margin: 0rem 0rem 0rem 0rem; -} - -.box-left { - margin-left: $bar-outer_spacing; -} - -.box-right { - margin-right: $bar-outer_spacing; -} diff --git a/ags/HyprPanel/scss/style/bar/battery.scss b/ags/HyprPanel/scss/style/bar/battery.scss deleted file mode 100644 index f1b449a..0000000 --- a/ags/HyprPanel/scss/style/bar/battery.scss +++ /dev/null @@ -1,63 +0,0 @@ -.bar-button-label.battery { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-battery-text); - margin-left: $bar-buttons-battery-spacing; -} - -.bar-button-icon.battery { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-battery-icon); -} - -.style2 { - .bar-button-icon.battery { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-battery-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-battery-spacing; - border-top-left-radius: if( - $bar-buttons-battery-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-battery-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - - &:last-child { - border-radius: $bar-buttons-radius; - } - } - - .bar-button-label.battery { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-battery-spacing; - margin-left: 0em; - } - &.no-label.battery-container { - .bar-button-icon.battery { - border-top-right-radius: if( - $bar-buttons-battery-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-battery-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.battery { - border: if( - $bar-buttons-battery-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-battery-border), - 0em - ); -} - diff --git a/ags/HyprPanel/scss/style/bar/bluetooth.scss b/ags/HyprPanel/scss/style/bar/bluetooth.scss deleted file mode 100644 index f641765..0000000 --- a/ags/HyprPanel/scss/style/bar/bluetooth.scss +++ /dev/null @@ -1,70 +0,0 @@ -.bar-button-icon.bluetooth { - font-size: 1.15em; - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-bluetooth-icon); -} - -.bar-button-label.bluetooth { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-bluetooth-text); - margin-left: $bar-buttons-bluetooth-spacing; -} - -.bluetooth-disabled-menu { - font-weight: bold; - font-size: 1.1rem; - color: $surface2; - margin: 6rem 0rem; -} - -.menu-button-isactive { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-bluetooth-text); -} - -.style2 { - .bar-button-icon.bluetooth { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-bluetooth-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-bluetooth-spacing; - border-top-left-radius: if( - $bar-buttons-bluetooth-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-bluetooth-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.bluetooth { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-bluetooth-spacing; - margin-left: 0em; - } - &.no-label.bluetooth-container { - .bar-button-icon.bluetooth { - border-top-right-radius: if( - $bar-buttons-bluetooth-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-bluetooth-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.bluetooth { - border: if( - $bar-buttons-bluetooth-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-bluetooth-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/clock.scss b/ags/HyprPanel/scss/style/bar/clock.scss deleted file mode 100644 index c861ce7..0000000 --- a/ags/HyprPanel/scss/style/bar/clock.scss +++ /dev/null @@ -1,59 +0,0 @@ -.bar-button-label.clock { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-clock-text); - margin-left: $bar-buttons-clock-spacing; -} - -.bar-button-icon.clock { - font-size: 1.2em; - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-clock-icon); -} - -.style2 { - .bar-button-icon.clock { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-clock-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-clock-spacing; - border-top-left-radius: if( - $bar-buttons-clock-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-clock-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.clock { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-clock-spacing; - margin-left: 0em; - } - &.no-label.clock-container { - .bar-button-icon.clock { - border-top-right-radius: if( - $bar-buttons-clock-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-clock-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.clock { - border: if( - $bar-buttons-clock-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-clock-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/media.scss b/ags/HyprPanel/scss/style/bar/media.scss deleted file mode 100644 index 95e8b49..0000000 --- a/ags/HyprPanel/scss/style/bar/media.scss +++ /dev/null @@ -1,43 +0,0 @@ -.bar-button-label.media { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-media-text); - margin-left: $bar-buttons-media-spacing; -} - -.bar-button-icon.media { - font-size: 1.2em; - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-media-icon); -} - -.style2 { - .bar-button-icon.media { - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-media-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-media-spacing; - border-top-left-radius: if( - $bar-buttons-media-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-media-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.media { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-media-spacing; - margin-left: 0em; - } -} - -.bar_item_box_visible.media { - border: if( - $bar-buttons-media-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-media-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/menu.scss b/ags/HyprPanel/scss/style/bar/menu.scss deleted file mode 100644 index 224956e..0000000 --- a/ags/HyprPanel/scss/style/bar/menu.scss +++ /dev/null @@ -1,25 +0,0 @@ -.bar-menu_label { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-dashboard-icon); - font-size: 1.3em; - border-radius: $bar-buttons-radius; -} - -.bar_item_box_visible.style2.dashboard { - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-dashboard-background); - - .bar-menu_label { - color: if($bar-buttons-monochrome, $bar-buttons-background, $bar-buttons-dashboard-icon); - } -} - -.style2 .bar-menu_label { - padding: $bar-buttons-padding_y $bar-buttons-padding_x; -} - -.bar_item_box_visible.dashboard { - border: if( - $bar-buttons-dashboard-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-dashboard-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/network.scss b/ags/HyprPanel/scss/style/bar/network.scss deleted file mode 100644 index a2b02c4..0000000 --- a/ags/HyprPanel/scss/style/bar/network.scss +++ /dev/null @@ -1,58 +0,0 @@ -.bar-button-label.network-label { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-network-text); - margin-left: $bar-buttons-network-spacing; -} - -.bar-button-icon.network-icon { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-network-icon); -} - -.style2 { - .bar-button-icon.network-icon { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-network-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-network-spacing; - border-top-left-radius: if( - $bar-buttons-network-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-network-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.network-label { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-network-spacing; - margin-left: 0em; - } - &.no-label.network-container { - .bar-button-icon.network-icon { - border-top-right-radius: if( - $bar-buttons-network-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-network-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.network { - border: if( - $bar-buttons-network-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-network-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/notifications.scss b/ags/HyprPanel/scss/style/bar/notifications.scss deleted file mode 100644 index 5818a26..0000000 --- a/ags/HyprPanel/scss/style/bar/notifications.scss +++ /dev/null @@ -1,66 +0,0 @@ -.bar-button-icon.notifications { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-notifications-icon); - font-size: 1.3em; -} - -.bar-button-label.notifications { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-notifications-total); - margin-left: $bar-buttons-notifications-spacing; - min-width: 1em; -} - -.style2 { - .bar-button-icon.notifications { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-notifications-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-notifications-spacing; - border-top-left-radius: if( - $bar-buttons-notifications-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-notifications-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-notifications-icon); - - &:last-child { - border-radius: $bar-buttons-radius; - } - } - - .bar-button-label.notifications { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-notifications-spacing; - margin-left: 0em; - } - - &.no-label.notifications-container { - .bar-button-icon.notifications { - border-top-right-radius: if( - $bar-buttons-notifications-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-notifications-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.notifications { - border: if( - $bar-buttons-notifications-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-notifications-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/power.scss b/ags/HyprPanel/scss/style/bar/power.scss deleted file mode 100644 index e872b0f..0000000 --- a/ags/HyprPanel/scss/style/bar/power.scss +++ /dev/null @@ -1,4 +0,0 @@ -.bar-power_label { - color: $red; - margin-top: 0.2rem; -} diff --git a/ags/HyprPanel/scss/style/bar/systray.scss b/ags/HyprPanel/scss/style/bar/systray.scss deleted file mode 100644 index f135d24..0000000 --- a/ags/HyprPanel/scss/style/bar/systray.scss +++ /dev/null @@ -1,19 +0,0 @@ -.systray button:not(:first-child) { - margin-left: $bar-buttons-systray-spacing; -} - -.systray-icon { - font-size: 1.3em; -} - -.style2.systray { - padding: $bar-buttons-padding_y $bar-buttons-padding_x; -} - -.bar_item_box_visible.systray { - border: if( - $bar-buttons-systray-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-systray-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/window_title.scss b/ags/HyprPanel/scss/style/bar/window_title.scss deleted file mode 100644 index 0fd422c..0000000 --- a/ags/HyprPanel/scss/style/bar/window_title.scss +++ /dev/null @@ -1,66 +0,0 @@ -.bar-button-icon.windowtitle { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-windowtitle-icon); -} - -.bar-button-label.windowtitle { - color: if($bar-buttons-monochrome, $bar-buttons-text, $bar-buttons-windowtitle-text); - margin-left: $bar-buttons-windowtitle-spacing; - - &.no-icon { - margin-left: 0; - } -} - -.style2 { - .bar-button-icon.windowtitle { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - background: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-windowtitle-icon_background); - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: $bar-buttons-windowtitle-spacing; - border-top-left-radius: if( - $bar-buttons-windowtitle-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $bar-buttons-windowtitle-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .bar-button-label.windowtitle { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: $bar-buttons-windowtitle-spacing; - margin-left: 0em; - - &.no-icon { - padding-left: $bar-buttons-padding_x; - } - } - &.no-label.windowtitle-container { - .bar-button-icon.windowtitle { - border-top-right-radius: if( - $bar-buttons-windowtitle-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $bar-buttons-windowtitle-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } -} - -.bar_item_box_visible.windowtitle { - border: if( - $bar-buttons-windowtitle-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-windowtitle-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/bar/workspace.scss b/ags/HyprPanel/scss/style/bar/workspace.scss deleted file mode 100644 index 967cc74..0000000 --- a/ags/HyprPanel/scss/style/bar/workspace.scss +++ /dev/null @@ -1,92 +0,0 @@ -.workspaces { - label { - font-size: 0.2em; - min-width: 4em; - min-height: 4em; - border-radius: 1.9rem * 0.6; - transition: 300ms * 0.5; - background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available); - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-available); - - &.occupied { - background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied); - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-occupied); - min-width: 4em; - min-height: 4em; - } - - &.active { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-active); - background-color: if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-active); - min-width: 12em; - min-height: 4em; - } - - &.workspace-icon { - background-color: transparent; - min-width: 0em; - min-height: 0em; - border-radius: 0em; - transition: 300ms * 0.5; - font-size: 1em; - } - - &.workspace-number { - background-color: transparent; - min-width: 0em; - min-height: 0em; - border-radius: 0em; - transition: 0ms; - padding: 0em 0.2em; - font-size: $bar-buttons-workspaces-fontSize; - } - - &.underline { - border-top: 0.1em solid transparent; - border-bottom: 0.1em solid $bar-buttons-workspaces-numbered_active_underline_color; - transition: 0ms; - } - - &.highlight { - transition: 0ms; - color: $bar-buttons-workspaces-numbered_active_highlighted_text_color; - border-radius: $bar-buttons-workspaces-numbered_active_highlight_border; - background-color: $bar-buttons-workspaces-active; - padding: 0em $bar-buttons-workspaces-numbered_active_highlight_padding; - } - } -} - -.workspace-button { - &:hover label { - color: $bar-buttons-workspaces-hover; - - &.default { - background-color: $bar-buttons-workspaces-hover; - } - } - - &:hover .can_underline { - border-top: 0.1em solid transparent; - border-bottom: 0.1em solid - if($bar-buttons-monochrome, $bar-buttons-workspaces-hover, $bar-buttons-workspaces-hover); - } - - &:hover .can_highlight { - background-color: $bar-buttons-workspaces-hover; - color: $bar-buttons-workspaces-numbered_active_highlighted_text_color; - border-radius: $bar-buttons-workspaces-numbered_active_highlight_border; - } -} - -.style2.workspaces { - padding: $bar-buttons-padding_y $bar-buttons-padding_x; -} - -.bar_item_box_visible.workspaces { - border: if( - $bar-buttons-workspaces-enableBorder or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $bar-buttons-workspaces-border), - 0em - ); -} diff --git a/ags/HyprPanel/scss/style/colors.scss b/ags/HyprPanel/scss/style/colors.scss deleted file mode 100644 index a117726..0000000 --- a/ags/HyprPanel/scss/style/colors.scss +++ /dev/null @@ -1,52 +0,0 @@ -$primary-color: #CDD6F4; -$dark-background: #0e0e1e; -$light-background: #1e1e2e; -$mauve: #cba6f7; -$red: #f38ba8; -$yellow: #f9e2af; -$orange: #fab387; -$teal: #94e2d5; -$lightteal: #bac2de; -$pink: #f5c2e7; -$green: #a6e3a1; -$grey: #585b70; -$blue: #89b4fa; -$lightgrey: #a6adc8; -$lightblue: #74c7ec; - -$rosewater: #f5e0dc; -$flamingo: #f2cdcd; -$pink: #f5c2e7; -$mauve: #cba6f7; -$red: #f38ba8; -$maroon: #eba0ac; -$peach: #fab387; -$yellow: #f9e2af; -$green: #a6e3a1; -$teal: #94e2d5; -$sky: #89dceb; -$sapphire: #74c7ec; -$blue: #89b4fa; -$lavender: #b4befe; -$text: #cdd6f4; -$subtext1: #bac2de; -$subtext2: #a6adc8; -$overlay2: #9399b2; -$overlay1: #7f849c; -$overlay0: #6c7086; -$surface2: #585b70; -$surface1: #45475a; -$surface0: #313244; -$base: #1e1e2e; -$base2: #242438; -$mantle: #181825; -$crust: #11111b; - -$default_fg: $primary-color; -$default_bg: #000000; -$primary_bg: $dark-background; -// $primary_fg: mix($mauve, $primary_bg, 70%); -$primary_fg: mix($mauve, $primary_bg, 70%); -$secondary_fg: $green; -$secondary_bg: $light-background; -$shadow-color: #1e1e2e; diff --git a/ags/HyprPanel/scss/style/common/common.scss b/ags/HyprPanel/scss/style/common/common.scss deleted file mode 100644 index 38180fb..0000000 --- a/ags/HyprPanel/scss/style/common/common.scss +++ /dev/null @@ -1,234 +0,0 @@ -@import "../colors"; - -menu { - margin: 6px; - padding: 6px; - background-color: $primary_bg; - background-clip: border-box; - border-radius: 12px; - border: 1px solid $secondary_bg; - - menuitem { - transition: background-color 75ms cubic-bezier(0, 0, 0.2, 1); - min-height: 20px; - min-width: 40px; - padding: 4px 8px; - color: #FFFFFF; - font: initial; - text-shadow: none; - border-radius: 6px; - - &:hover, - &:active { - background-color: $secondary_bg; - } - - &:disabled { - color: $secondary_bg; - } - - arrow { - min-height: 16px; - min-width: 16px; - -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); - margin-left: 8px; - } - } - - separator { - min-height: 1px; - margin: 4px 0; - background-color: $secondary_bg - } -} - -menu>arrow { - min-height: 16px; - min-width: 16px; - padding: 4px; - color: $secondary_bg; -} - -menu>arrow.top { - margin-top: 0; - border-radius: 6px; - -gtk-icon-source: -gtk-icontheme("pan-up-symbolic"); -} - -menu>arrow.bottom { - margin-top: 8px; - margin-bottom: -12px; - border-radius: 6px; - -gtk-icon-source: -gtk-icontheme("pan-down-symbolic"); -} - -check, -radio { - min-height: 15px; - min-width: 15px; - margin: 4px; - padding: 0; - color: transparent; - background-color: $secondary_bg; - transition: all 75ms cubic-bezier(0, 0, 0.2, 1), box-shadow 150ms cubic-bezier(0, 0, 0.2, 1); -} - -radio { - border-radius: 9999px; -} - -check { - border-radius: 4px; -} - -check:hover, -radio:hover { - box-shadow: 0 0 0 4px transparentize($primary_bg, 0.8); - background-color: $primary_bg; -} - -check:active, -radio:active { - box-shadow: 0 0 0 4px transparentize($primary_bg, 0.8); - background-color: $primary_bg; -} - -check:checked, -check:indeterminate, -radio:checked, -radio:indeterminate { - color: $primary_bg; - background-color: $primary_fg; -} - -check:checked:hover, -check:indeterminate:hover, -radio:checked:hover, -radio:indeterminate:hover { - box-shadow: 0 0 0 4px transparentize($primary_fg, 0.8); - background-color: $primary_fg; -} - -check:checked:active, -check:indeterminate:active, -radio:checked:active, -radio:indeterminate:active { - box-shadow: 0 0 0 4px transparentize($primary_fg, 0.8); - background-color: $primary_fg; -} - -switch { - transition: all 75ms cubic-bezier(0, 0, 0.2, 1); - margin: 4px 0; - border: none; - border-radius: 9999px; - background-color: $secondary_bg; - background-clip: padding-box; - font-size: 0; - color: transparent; -} - -switch:checked { - background-color: $primary_fg; -} - -switch:disabled { - opacity: 0.5; -} - -switch slider { - transition: all 75ms cubic-bezier(0, 0, 0.2, 1); - min-width: 18px; - min-height: 18px; - margin: 3px; - border-radius: 9999px; - outline: none; - background-color: $default_fg; - border: none; - color: transparent; -} - -scale { - min-height: 2px; - min-width: 2px; -} - -scale.horizontal { - padding: 17px 12px; -} - -scale.vertical { - padding: 12px 17px; -} - -scale slider { - min-height: 18px; - min-width: 18px; - margin: -8px; -} - -scale trough { - transition: background-color 75ms cubic-bezier(0, 0, 0.2, 1); - outline: none; - background-color: $secondary_bg; -} - -scale highlight { - transition: background-color 75ms cubic-bezier(0, 0, 0.2, 1); - background-color: $primary_fg; -} - -scale highlight:disabled { - background-color: #1e1e2e; -} - -scale fill { - transition: background-color 75ms cubic-bezier(0, 0, 0.2, 1); -} - -scale fill:disabled { - background-color: transparent; -} - -scale slider { - transition: all 75ms cubic-bezier(0, 0, 0.2, 1); - border-radius: 9999px; - color: $primary_fg; - background-color: $primary_bg; - box-shadow: inset 0 0 0 2px $primary_fg; -} - -scale slider:hover { - box-shadow: inset 0 0 0 2px $primary_fg, 0 0 0 8px transparentize($primary_fg, 0.9); -} - -scale slider:active { - box-shadow: inset 0 0 0 4px $primary_fg, 0 0 0 8px transparentize($primary_fg, 0.9); -} - -tooltip { - box-shadow: none; -} - -separator { - min-width: 1px; - min-height: 1px; - background-color: $secondary_bg; -} - -@keyframes spin { - to { - -gtk-icon-transform: rotate(1turn); - } -} - -spinner { - background: none; - opacity: 0; - -gtk-icon-source: -gtk-icontheme("process-working-symbolic"); -} - -spinner:checked { - opacity: 1; - animation: spin 1s linear infinite; -} diff --git a/ags/HyprPanel/scss/style/common/floating-widget.scss b/ags/HyprPanel/scss/style/common/floating-widget.scss deleted file mode 100644 index e1a9da4..0000000 --- a/ags/HyprPanel/scss/style/common/floating-widget.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "../colors"; - -@mixin floating-widget { - margin: max($spacing, 8px); - border: 0.2rem solid $surface0; - background-color: $base; - color: $primary_fg; - border-radius: 0.5rem; - padding: 1.5rem; -} diff --git a/ags/HyprPanel/scss/style/common/general.scss b/ags/HyprPanel/scss/style/common/general.scss deleted file mode 100644 index da7ee41..0000000 --- a/ags/HyprPanel/scss/style/common/general.scss +++ /dev/null @@ -1,79 +0,0 @@ -@import '../colors.scss'; - -.txt-icon { - font-family: "JetBrainsMono Nerd Font Propo", monospace; - font-size: 1.5em; - - &.bluetooth { - font-size: 1em; - } - - &.playback { - font-size: 1.3em; - } - - &.input { - font-size: 1.3em; - } -} - -.bar.txt-icon { - font-family: "JetBrainsMono Nerd Font Propo", monospace; - font-size: 1.2em; -} - -window.popup { - opacity: $bar-menus-opacity * 0.01; - - menuitem { - label { - color: $bar-menus-popover-text; - } - - &:hover { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-text, $bar-menus-popover-text), 0.6); - } - } - - menu { - border-color: $bar-menus-popover-border; - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-popover-background); - } - - separator { - - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-text, $bar-menus-popover-text), 0.7); - min-height: 0.075em; - } - - arrow { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-popover-text); - } -} - -tooltip { - * { - all: unset; - } - - opacity: $bar-menus-opacity * 0.01; - - font-size: 1.1em; - - >*>* { - padding: 0.6em; - border-radius: $bar-menus-border-radius * 0.5; - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-tooltip-text); - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-tooltip-background); - } -} - -check:not(:checked) { - background-color: $bar-menus-check_radio_button-background; - border: 1px solid $bar-menus-check_radio_button-active; -} - -check:checked { - background-color: $bar-menus-check_radio_button-active; - border: 1px solid $bar-menus-check_radio_button-background; -} diff --git a/ags/HyprPanel/scss/style/common/widget-button.scss b/ags/HyprPanel/scss/style/common/widget-button.scss deleted file mode 100644 index 657db61..0000000 --- a/ags/HyprPanel/scss/style/common/widget-button.scss +++ /dev/null @@ -1,52 +0,0 @@ -$popover-padding: 7px * 1.6; -$padding: 7px; -$spacing: 12px; -$radius: 11px; - -.widget-button { - background: $crust; - opacity: 1; - font-size: 1.6rem; - font-weight: bold; - margin: 10px; - padding: 15px 20px; - border-radius: 10px; - border: 3px solid; - border-color: $crust; - transition: border-color .3s ease-in-out; - transition: opacity .3s ease-in-out; - - &:hover { - border: 3px solid; - border-color: $lavender; - transition: border-color .3s ease-in-out; - } - - &:focus, - &:active { - border: 3px solid; - border-color: $lavender; - } - - image { - border-radius: $radius + ($popover-padding * 1.4); - min-width: 1.2em; - min-height: 1.2em; - font-size: 4em; - } - - label { - margin-top: $spacing; - } - - &:active { - image { - opacity: .3; - transition: opacity .3s ease-in-out; - } - label { - opacity: .3; - transition: opacity .3s ease-in-out; - } - } -} diff --git a/ags/HyprPanel/scss/style/customModules/style.scss b/ags/HyprPanel/scss/style/customModules/style.scss deleted file mode 100644 index 1522e8a..0000000 --- a/ags/HyprPanel/scss/style/customModules/style.scss +++ /dev/null @@ -1,366 +0,0 @@ -/* - * ################################# - * # Default Styling # - * ################################# - */ -.bar-button-label { - margin-left: 0.5em; - color: $text; -} - -.module-icon { - font-size: 1em; -} - -.style2 { - .bar-button-icon { - border-top-left-radius: $bar-buttons-radius; - border-bottom-left-radius: $bar-buttons-radius; - padding: $bar-buttons-padding_y 0em; - padding-left: $bar-buttons-padding_x; - padding-right: 0.5em; - background: $text; - color: $bar-background; - } - - .bar-button-label { - padding: $bar-buttons-padding_y 0em; - padding-right: $bar-buttons-padding_x; - padding-left: 0.5em; - margin-left: 0em; - } -} - -/* - * ################################# - * # Styling Function # - * ################################# - */ -@mixin styleModule( - $class, - $textColor, - $iconColor, - $iconBackground, - $labelBackground, - $spacing, - $borderEnabled, - $borderColor, - $fontSize: 1em -) { - $bar-button-background-opacity-ratio: $bar-buttons-background_opacity * 0.01; - $transparency-value: 1 - $bar-button-background-opacity-ratio; - - $bar-button-background-hover-opacity-ratio: $bar-buttons-background_hover_opacity * 0.01; - $transparency-value-hover: 1 - $bar-button-background-hover-opacity-ratio; - .bar_item_box_visible { - &.#{$class} { - background: transparentize($labelBackground, $transparency-value); - border: if( - $borderEnabled or $bar-buttons-enableBorders, - $bar-buttons-borderSize solid if($bar-buttons-monochrome, $bar-buttons-icon, $borderColor), - 0em - ); - - &.style2 { - background: transparent; - } - - &:hover { - opacity: $bar-buttons-background_hover_opacity * 0.01; - } - } - } - - .module-label.#{$class} { - color: if($bar-buttons-monochrome, $bar-buttons-text, $textColor); - margin-left: $spacing; - border-radius: $bar-buttons-radius; - } - - .module-icon.#{$class} { - color: if($bar-buttons-monochrome, $bar-buttons-icon, $iconColor); - font-size: if($fontSize, $fontSize, 1em); - } - - .style2 { - .module-icon.#{$class} { - background: if($bar-buttons-monochrome, $bar-buttons-icon, $iconBackground); - padding-right: $spacing; - color: if($bar-buttons-monochrome, $bar-buttons-background, $iconColor); - border-top-left-radius: if( - $borderEnabled or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-left-radius: if( - $borderEnabled or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - - .module-label.#{$class} { - background: transparentize($labelBackground, $transparency-value); - padding-left: $spacing * 1.5; - margin-left: 0em; - border-top-left-radius: 0em; - border-bottom-left-radius: 0em; - } - &.no-label.#{$class} { - .module-icon { - border-top-right-radius: if( - $borderEnabled or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - border-bottom-right-radius: if( - $borderEnabled or $bar-buttons-enableBorders, - $bar-buttons-radius * 0.4, - $bar-buttons-radius - ); - } - } - } -} - -/* - * ################################# - * # Ram Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'ram', - // label color - $bar-buttons-modules-ram-text, - // icon color - $bar-buttons-modules-ram-icon, - // icon background if split style is used - $bar-buttons-modules-ram-icon_background, - // label background - $bar-buttons-modules-ram-background, - // inner spacing - $bar-buttons-modules-ram-spacing, - // - // if border enabled - $bar-buttons-modules-ram-enableBorder, - // border color - $bar-buttons-modules-ram-border -); - -/* - * ################################# - * # Cpu Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'cpu', - // label color - $bar-buttons-modules-cpu-text, - // icon color - $bar-buttons-modules-cpu-icon, - // icon background if split style is used - $bar-buttons-modules-cpu-icon_background, - // label background - $bar-buttons-modules-cpu-background, - // inner spacing - $bar-buttons-modules-cpu-spacing, - // if border enabled - $bar-buttons-modules-cpu-enableBorder, - // border color - $bar-buttons-modules-cpu-border, - // custom font size - 1.05em // -); - -/* - * ################################# - * # Storage Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'storage', - // label color - $bar-buttons-modules-storage-text, - // icon color - $bar-buttons-modules-storage-icon, - // icon background if split style is used - $bar-buttons-modules-storage-icon_background, - // label background - $bar-buttons-modules-storage-background, - // inner spacing - $bar-buttons-modules-storage-spacing, - // if border enabled - $bar-buttons-modules-storage-enableBorder, - // border color - $bar-buttons-modules-storage-border, - // custom font size - 1.3em // -); - -/* - * ################################# - * # Netstat Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'netstat', - // label color - $bar-buttons-modules-netstat-text, - // icon color - $bar-buttons-modules-netstat-icon, - // icon background if split style is used - $bar-buttons-modules-netstat-icon_background, - // label background - $bar-buttons-modules-netstat-background, - // inner spacing - $bar-buttons-modules-netstat-spacing, - // if border enabled - $bar-buttons-modules-netstat-enableBorder, - // border color - $bar-buttons-modules-netstat-border, - // custom font size - 1.2em // -); - -/* - * ################################# - * # KB Layout Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'kblayout', - // label color - $bar-buttons-modules-kbLayout-text, - // icon color - $bar-buttons-modules-kbLayout-icon, - // icon background if split style is used - $bar-buttons-modules-kbLayout-icon_background, - // label background - $bar-buttons-modules-kbLayout-background, - // inner spacing - $bar-buttons-modules-kbLayout-spacing, - // if border enabled - $bar-buttons-modules-kbLayout-enableBorder, - // border color - $bar-buttons-modules-kbLayout-border, - // custom font size - 1.2em // -); - -/* - * ################################# - * # Updates Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'updates', - // label color - $bar-buttons-modules-updates-text, - // icon color - $bar-buttons-modules-updates-icon, - // icon background if split style is used - $bar-buttons-modules-updates-icon_background, - // label background - $bar-buttons-modules-updates-background, - // inner spacing - $bar-buttons-modules-updates-spacing, - // if border enabled - $bar-buttons-modules-updates-enableBorder, - // border color - $bar-buttons-modules-updates-border, - // custom font size - 1.2em // -); - -/* - * ################################# - * # Submap Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'submap', - // label color - $bar-buttons-modules-submap-text, - // icon color - $bar-buttons-modules-submap-icon, - // icon background if split style is used - $bar-buttons-modules-submap-icon_background, - // label background - $bar-buttons-modules-submap-background, - // inner spacing - $bar-buttons-modules-submap-spacing, - // if border enabled - $bar-buttons-modules-submap-enableBorder, - // border color - $bar-buttons-modules-submap-border, - // custom font size - 1.2em // -); - -/* - * ################################# - * # Weather Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'weather-custom', - // label color - $bar-buttons-modules-weather-text, - // icon color - $bar-buttons-modules-weather-icon, - // icon background if split style is used - $bar-buttons-modules-weather-icon_background, - // label background - $bar-buttons-modules-weather-background, - // inner spacing - $bar-buttons-modules-weather-spacing, - // if border enabled - $bar-buttons-modules-weather-enableBorder, - // border color - $bar-buttons-modules-weather-border, - // custom font size - 1.2em // -); - -/* - * ################################# - * # Power Module Styling # - * ################################# - */ -@include styleModule( - // - // class name - 'powermodule', - // label color - $red, - // icon color - $bar-buttons-modules-power-icon, - // icon background if split style is used - $bar-buttons-modules-power-icon_background, - // label background - $bar-buttons-modules-power-background, - // inner spacing - $bar-buttons-modules-power-spacing, - // if border enabled - $bar-buttons-modules-power-enableBorder, - // border color - $bar-buttons-modules-power-border, - // custom font size - 1.3em // -); diff --git a/ags/HyprPanel/scss/style/highlights.scss b/ags/HyprPanel/scss/style/highlights.scss deleted file mode 100644 index 0cdd921..0000000 --- a/ags/HyprPanel/scss/style/highlights.scss +++ /dev/null @@ -1,222 +0,0 @@ -@import "colors"; - -* { - color: $default_fg; - font-family: "JetBrainsMono NF"; - font-size: 0.9rem; -} - -html, body { - padding: 0; - margin: 0; - background-color: $primary_bg; -} - -// scrollbar { -// background-color: red; -// min-width: 5em; -// } - -.code { - background: $light-background; - border-radius: 0.5rem; - - .code-header { - background: $light-background; - border-top-left-radius: 0.5rem; - border-top-right-radius: 0.5rem; - border-bottom: 1px solid $primary_fg; - padding: 5px; - - > button { - color: $default_fg; - background: transparent; - float: right; - border: none; - - &:before { - content: '󰆏'; - display: inline-block; - padding-right: 0.5rem; - } - } - } -} - -$languages-map: ( - arduino: "", - armasm: "", - avrasm: "", - bash: "", - c: "", - clojure: "", - coffeescript: "", - cpp: "", - csharp: "󰌛", - css: "", - dockerfile: "󰡨", - go: "", - gradle: "", - haskell: "", - html: "", - java: "", - javascript: "󰌞", - json: "", - latex: "", - lua: "󰢱", - makefile: "", - markdown: "", - mipsasm: "", - nginx: "", - nix: "󱄅", - php: "", - prolog: "", - python: "", - r: "󰟔", - ruby: "", - rust: "", - scss: "", - shell: "", - typescript: "󰛦", - wasm: "", - x86asm: "", - xml: "󰗀", -); - -@each $lang, $content in $languages-map { - [data-language="#{$lang}"]:before { - content: $content; - font-size: 1.1rem; - color: $primary_fg; - padding-right: 0.5rem; - } -} - -pre { - padding: 5px; - overflow-x: scroll; - - code.hljs { - color: $default_fg; - background: transparent; - } -} - -code { - & .hljs-keyword { - color: $mauve; - } - - & .hljs-built_in { - color: $red; - } - - & .hljs-type { - color: $yellow; - } - - & .hljs-literal, - & .hljs-number { - color: $orange; - } - - & .hljs-operator { - color: $teal; - } - - & .hljs-punctuation { - color: $lightteal; - } - - & .hljs-property, - & .hljs-variable.language_, - & .hljs-symbol { - color: $teal; - } - - & .hljs-regexp { - color: $pink; - } - - & .hljs-string, - & .hljs-char.escape_, - & .hljs-subst { - color: $green; - } - - & .hljs-comment { - color: $grey; - } - - & .hljs-doctag { - color: $red; - } - - & .hljs-meta, - & .hljs-title.function_, - & .hljs-section { - color: $orange; - } - - & .hljs-tag, - & .hljs-attribute { - color: $lightgrey; - } - - & .hljs-name, - & .hljs-selector-attr { - color: $mauve; - } - - & .hljs-params, - & .hljs-selector-class, - & .hljs-template-variable { - color: $default_fg; - } - - & .hljs-selector-tag { - color: $yellow; - } - - & .hljs-selector-id { - color: $blue; - } - - & .hljs-bullet, - & .hljs-code, - & .hljs-formula { - color: $teal; - } - - & .hljs-emphasis { - color: $red; - font-style: italic; - } - - & .hljs-strong { - color: $red; - font-weight: bold; - } - - & .hljs-link { - color: $lightblue; - font-style: italic; - } - - & .hljs-quote { - color: $green; - font-style: italic; - } - - & .hljs-addition { - color: $green; - background: rgba(166, 227, 161, 0.15); - } - - & .hljs-deletion { - color: $red; - background: rgba(243, 139, 168, 0.15); - } -} - - diff --git a/ags/HyprPanel/scss/style/menus/audiomenu.scss b/ags/HyprPanel/scss/style/menus/audiomenu.scss deleted file mode 100644 index 767b30a..0000000 --- a/ags/HyprPanel/scss/style/menus/audiomenu.scss +++ /dev/null @@ -1,185 +0,0 @@ -.menu-items-container.audio { - min-width: 18em * $bar-menus-menu-volume-scaling * 0.01; - - @import "./menu.scss"; - - * { - font-size: $font-size * $bar-menus-menu-volume-scaling * 0.01; - } - - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-volume-background-color); - - .menu-items { - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-volume-border-color); - opacity: $bar-menus-opacity * 0.01; - } - - .menu-dropdown-label.audio { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color); - } - - .menu-label.audio { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-volume-label-color); - } - - .menu-active.playback, - .menu-active.input { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-volume-text); - } - - .menu-button-isactive.audio { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-volume-icons-active); - } - - .menu-slider.playback { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-background, $bar-menus-menu-volume-audio_slider-background); - - highlight, - progress { - background: if($bar-menus-monochrome, $bar-menus-slider-primary, $bar-menus-menu-volume-audio_slider-primary); - } - } - - &:hover { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-backgroundhover, $bar-menus-menu-volume-audio_slider-backgroundhover); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-slider-puck, $bar-menus-menu-volume-audio_slider-puck); - } - } - } - - .menu-slider.inputs { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-background, $bar-menus-menu-volume-input_slider-background); - - highlight, - progress { - background: if($bar-menus-monochrome, $bar-menus-slider-primary, $bar-menus-menu-volume-input_slider-primary); - } - } - - &:hover { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-backgroundhover, $bar-menus-menu-volume-input_slider-backgroundhover); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-slider-puck, $bar-menus-menu-volume-input_slider-puck); - } - } - } - - .menu-active-percentage.playback, - .menu-active-percentage.input { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-volume-text); - } - - .menu-active-button { - - .menu-active-icon.playback, - .menu-active-icon.input { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-volume-iconbutton-active); - opacity: 1; - } - - &.muted { - - .menu-active-icon.playback, - .menu-active-icon.input { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-volume-iconbutton-passive); - opacity: 1; - } - } - - &:hover { - - .menu-active-icon.playback, - .menu-active-icon.input { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-volume-iconbutton-passive); - opacity: 0.3; - } - } - - &.muted:hover { - - .menu-active-icon.playback, - .menu-active-icon.input { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-volume-iconbutton-active); - opacity: 1; - } - } - } - - .menu-button-icon.playback, - .menu-button-icon.input { - color: if($bar-menus-monochrome, $bar-menus-icons-passive, $bar-menus-menu-volume-icons-passive); - - &.active { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-volume-icons-active); - } - } - - .menu-button.audio { - color: if($bar-menus-monochrome, $bar-menus-icons-passive, $bar-menus-menu-volume-icons-passive); - - .menu-button-name.playback, - .menu-button-name.input { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-volume-text); - } - - - &:hover { - - .menu-button-name.playback, - .menu-button-name.input { - color: if($bar-menus-monochrome, $bar-menus-listitems-active, $bar-menus-menu-volume-listitems-active); - } - } - } - - .menu-section-container.volume { - margin-bottom: 0.65em; - } - - .menu-section-container.playback { - margin-top: 0em; - margin-bottom: 1em; - } - - .menu-section-container.input { - margin-top: 0em; - } - - .menu-label-container.input { - border-radius: 0em; - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-label-container.playback { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-items-section.input { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-items-section.playback { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-label-container.selected { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-items-section.selected { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-volume-card-color); - } - - .menu-items-section.playback { - border-radius: 0em; - } -} diff --git a/ags/HyprPanel/scss/style/menus/bluetooth.scss b/ags/HyprPanel/scss/style/menus/bluetooth.scss deleted file mode 100644 index 19dd17c..0000000 --- a/ags/HyprPanel/scss/style/menus/bluetooth.scss +++ /dev/null @@ -1,162 +0,0 @@ -.menu-items-container.bluetooth * { - font-size: $font-size * $bar-menus-menu-bluetooth-scaling * 0.01; -} - -@import "./menu.scss"; - -.menu-items.bluetooth { - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-bluetooth-background-color); - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-bluetooth-border-color); - opacity: $bar-menus-opacity * 0.01; - font-size: $font-size * $bar-menus-menu-bluetooth-scaling * 0.01; -} - -.menu-items-container.bluetooth { - - min-width: 18em * $bar-menus-menu-bluetooth-scaling * 0.01; - - font-size: 1.3em; - - .menu-section-container { - margin: 1em 0em; - } - - .menu-label-container { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-bluetooth-card-color); - - .menu-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-bluetooth-label-color); - } - - .controls-container { - margin: 0.5em 1em; - } - } - - - .menu-items-section { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-bluetooth-card-color); - min-height: 20em * $bar-menus-menu-bluetooth-scaling * 0.01; - font-size: 1em; - } - - button { - margin-right: 0.5em; - - &.search { - image { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-bluetooth-iconbutton-passive); - } - - &:hover image { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-bluetooth-iconbutton-active); - } - - font-size: 0.8em; - margin-bottom: 0em; - } - - &:hover { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-bluetooth-iconbutton-active); - } - } - - .menu-icon-button.bluetooth { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-bluetooth-iconbutton-passive); - - &:hover { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-bluetooth-iconbutton-active); - } - } - - .bluetooth-element-item { - margin-bottom: 0.4em; - - &:hover { - - .menu-button-icon, - .menu-button-name { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-bluetooth-iconbutton-active); - } - } - - image { - margin-right: 0em; - margin-top: 0.0em; - min-height: 1em; - min-width: 1em; - - &.active { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-bluetooth-icons-active); - } - } - - label { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-bluetooth-text); - font-size: 1em; - } - - .menu-button-icon { - font-size: 1.5em; - color: if($bar-menus-monochrome, $bar-menus-icons-passive, $bar-menus-menu-bluetooth-icons-passive); - - &.active { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-bluetooth-icons-active); - } - } - - .connection-status { - font-size: 0.9em; - margin-left: 0.6rem; - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-bluetooth-text); - opacity: 0.4; - } - } - - spinner { - min-height: 1.3em; - min-width: 1.3em; - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-bluetooth-iconbutton-active); - } - - .menu-separator { - margin: 0em 1em; - } - - .menu-switch.bluetooth { - background-color: if($bar-menus-monochrome, $bar-menus-switch-disabled, $bar-menus-menu-bluetooth-switch-disabled); - - &:checked { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-bluetooth-switch-enabled); - } - - slider { - background-color: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-bluetooth-switch-puck); - } - - &:hover { - trough { - background: if($bar-menus-monochrome, $bar-menus-switch-disabled, $bar-menus-menu-bluetooth-switch-disabled); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-bluetooth-switch-puck); - } - } - - &:active { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-bluetooth-switch-enabled); - } - } - - .no-bluetooth-devices.dim, - .search-bluetooth-label.dim, - .bluetooth-disabled.dim { - &:last-child { - margin-bottom: 2em; - } - - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-bluetooth-text); - opacity: 0.5; - } -} diff --git a/ags/HyprPanel/scss/style/menus/calendar.scss b/ags/HyprPanel/scss/style/menus/calendar.scss deleted file mode 100644 index 2552ddb..0000000 --- a/ags/HyprPanel/scss/style/menus/calendar.scss +++ /dev/null @@ -1,285 +0,0 @@ -.calendar-menu-content * { - font-size: $font-size * $bar-menus-menu-clock-scaling * 0.01; -} - -.calendar-content-container { - margin-top: 0em; - min-width: 27em; - min-height: 6em; - background: if( - $bar-menus-monochrome, - $bar-menus-background, - $bar-menus-menu-clock-background-color - ); - border: $bar-menus-border-size solid - if( - $bar-menus-monochrome, - $bar-menus-border-color, - $bar-menus-menu-clock-border-color - ); - border-radius: $bar-menus-border-radius; - margin-right: 0.5em; - opacity: $bar-menus-opacity * 0.01; -} - -.calendar-menu-item-container { - border-radius: $bar-menus-card_radius; - margin-bottom: 1.35em; - background: if( - $bar-menus-monochrome, - $bar-menus-cards, - $bar-menus-menu-clock-card-color - ); -} - -.calendar-content-items { - margin: 1.35em; -} - -.calendar-container-box { - margin: 0.75em; - margin-bottom: 0em; -} - -.calendar-menu-widget { - border-radius: 0.4em; - color: if( - $bar-menus-monochrome, - $bar-menus-text, - $bar-menus-menu-clock-calendar-days - ); - - &:selected { - box-shadow: - inset 0 -0.5em 0 0 if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-clock-calendar-currentday), - inset -0.4em -0.3em 0 0 - if( - $bar-menus-monochrome, - $bar-menus-cards, - $bar-menus-menu-clock-card-color - ), - inset 0.4em 0 0 0.01em - if( - $bar-menus-monochrome, - $bar-menus-cards, - $bar-menus-menu-clock-card-color - ); - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-calendar-currentday - ); - border-radius: 0em; - } - - &.header { - background-color: transparent; - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-calendar-yearmonth - ); - } - - &.button { - color: $text; - font-weight: 900; - font-size: 900em; - } - - &:hover { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-calendar-paginator - ); - } - - &.highlight { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-calendar-weekdays - ); - } - - &:indeterminate { - color: transparentize( - if( - $bar-menus-monochrome, - $bar-menus-text, - $bar-menus-menu-clock-calendar-days - ), - 0.65 - ); - } - - font-size: 1.1em; - padding: 0.35em; -} - -.clock-content-items { - min-height: 8em; - - .clock-content-time { - font-size: 4em; - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-time-time - ); - } - - .clock-content-period { - font-size: 1.75em; - margin-bottom: 1.35em; - margin-right: -0.875em; - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-time-timeperiod - ); - } -} - -.calendar-menu-item-container { - margin-bottom: 0.65em; - &:last-child { - margin-bottom: 0em; - } -} - -.weather-container-box { - margin: 1.5em; - margin-top: 2.5em; - min-width: 3em; - - .calendar-menu-weather.today.icon { - label { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-icon - ); - font-size: 5em; - } - } - - .calendar-menu-weather.today.temp.label { - color: if( - $bar-menus-monochrome, - $bar-menus-text, - $bar-menus-menu-clock-weather-temperature - ); - margin-left: 0.2em; - font-size: 2.5em; - - &.icon { - font-size: 2.5em; - } - } - - .calendar-menu-weather.today.condition.label { - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-weather-status - ); - font-size: 1.5em; - margin-bottom: 0.4em; - } - - .calendar-menu-weather.today.temp.label.icon.weather-color.red { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-thermometer-extremelyhot - ); - } - - .calendar-menu-weather.today.temp.label.icon.weather-color.orange { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-thermometer-hot - ); - } - - .calendar-menu-weather.today.temp.label.icon.weather-color.lavender { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-thermometer-moderate - ); - } - - .calendar-menu-weather.today.temp.label.icon.weather-color.blue { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-thermometer-cold - ); - } - - .calendar-menu-weather.today.temp.label.icon.weather-color.sky { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-thermometer-extremelycold - ); - } -} - -.calendar-menu-weather.today.stats.container { - margin-bottom: 0.75em; - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-weather-stats - ); - - .weather.label { - margin-left: 0.35em; - } -} - -.menu-separator.weather { - margin: 1.5em 0em; -} - -.hourly-weather-time { - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-weather-hourly-time - ); - margin-bottom: 0.5em; -} - -.hourly-weather-icon { - color: if( - $bar-menus-monochrome, - $bar-menus-icons-active, - $bar-menus-menu-clock-weather-hourly-icon - ); - margin-bottom: 0.25em; - font-size: 1.8em; -} - -.hourly-weather-temp { - color: if( - $bar-menus-monochrome, - $bar-menus-label, - $bar-menus-menu-clock-weather-hourly-temperature - ); -} - -.weather.precip.icon { - min-width: 1em; - font-size: 1em; -} - -.weather.wind.icon { - min-width: 1em; - font-size: 1em; -} diff --git a/ags/HyprPanel/scss/style/menus/dashboard.scss b/ags/HyprPanel/scss/style/menus/dashboard.scss deleted file mode 100644 index d292038..0000000 --- a/ags/HyprPanel/scss/style/menus/dashboard.scss +++ /dev/null @@ -1,386 +0,0 @@ -.dashboard-menu-content * { - font-size: $font-size * $bar-menus-menu-dashboard-scaling * 0.01; -} - -.dashboard-content-items { - margin-left: 0.50em; - min-width: 28.5em; - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-dashboard-background-color); - border: $bar-menus-border-size solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-dashboard-border-color); - border-radius: $bar-menus-border-radius; - opacity: $bar-menus-opacity * 0.01; - - button { - border-radius: 0.4em; - } - - .dashboard-card { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-dashboard-card-color); - margin: 1.3em; - border-radius: $bar-menus-card_radius; - padding: 1.5em; - } - - .profile-picture-container { - margin-right: 0.65em; - margin-bottom: 0.65em; - - .profile-picture { - min-width: $bar-menus-menu-dashboard-profile-size; - min-height: $bar-menus-menu-dashboard-profile-size; - border-radius: $bar-menus-menu-dashboard-profile-radius; - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .profile-name { - font-size: 1.5em; - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-profile-name); - margin-top: 0.75em; - } - } - - .power-menu-container { - margin-left: 0em; - margin-bottom: 0.65em; - - .dashboard-button { - min-width: 3em; - min-height: 2.5em; - - &:not(:last-child) { - margin-bottom: 0.75em; - } - - label { - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-shortcuts-text); - font-size: 1.7em; - } - - &.shutdown { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-shutdown); - - label { - font-size: 1.9em; - } - } - - &.restart { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-restart); - - label { - font-size: 1.9em; - } - } - - &.lock { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-logout); - } - - &.sleep { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-sleep); - } - - &:hover { - &.shutdown { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-shutdown), 0.5); - } - - &.restart { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-restart), 0.5); - } - - &.lock { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-logout), 0.5); - } - - &.sleep { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-sleep), 0.5); - } - } - - - } - } - - .shortcuts-container { - font-size: 1em; - - .dashboard-card { - padding: 1.5em; - - button { - min-height: 2.5em; - min-width: 2.5em; - } - } - - .card-button-section-container.visible { - margin-right: 1.5em; - } - - .top-button.paired { - margin-bottom: 1.5em; - } - - .container { - margin-top: 0em; - margin-bottom: 0.65em; - - &.most-used { - margin-right: 0.65em; - } - - &.utilities.paired { - margin-left: 0em; - } - - button { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-shortcuts-background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-shortcuts-text); - min-height: 3em; - - label { - font-size: 1.5em; - } - - &.record.active { - background: $red; - - &:hover { - background: transparentize($red, 0.5); - } - } - - &:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-shortcuts-background), 0.5); - } - } - } - } - - .controls-container { - margin-bottom: 0.65em; - - &.dashboard-card { - margin-top: 0em; - } - - button { - padding: 0em; - min-height: 3em; - min-width: 3.8em; - - label { - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-controls-wifi-text); - font-size: 1.6em; - } - - &:not(:last-child) { - margin-right: 1em; - } - - &.wifi { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-wifi-background); - } - - &.bluetooth { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-bluetooth-background); - } - - &.notifications { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-notifications-background); - } - - &.playback { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-volume-background); - } - - &.input { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-input-background); - } - - &.wifi:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-wifi-background), 0.5); - } - - &.bluetooth:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-bluetooth-background), 0.5); - } - - &.notifications:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-notifications-background), 0.5); - } - - &.playback:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-volume-background), 0.5); - } - - &.input:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-input-background), 0.5); - } - - &.disabled { - background: if($bar-menus-monochrome, $bar-menus-buttons-disabled, $bar-menus-menu-dashboard-controls-disabled); - - &.wifi:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-wifi-background), 0.5); - } - - &.bluetooth:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-bluetooth-background), 0.5); - } - - &.notifications:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-notifications-background), 0.5); - } - - &.playback:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-volume-background), 0.5); - } - - &.input:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-controls-input-background), 0.5); - } - } - } - } - - .directories-container { - &.dashboard-card { - margin-top: 0em; - margin-bottom: 0.65em; - padding-left: 1.5em; - padding-right: 0em; - } - - .directory-link { - padding: 0.5em 0em; - min-width: 9em; - - &:last-child { - margin-bottom: 0em; - } - - label { - font-size: 1.3em; - } - - &.right.top { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-right-top-color); - } - - &.right.middle { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-right-middle-color); - } - - &.right.bottom { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-right-bottom-color); - } - - &.left.top { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-left-top-color); - } - - &.left.middle { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-left-middle-color); - } - - &.left.bottom { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-directories-left-bottom-color); - } - - &:hover { - opacity: 0.5; - } - } - } - - .stats-container { - margin-top: 0em; - - .stat { - label { - margin-right: 0.75em; - font-size: 1.3em; - min-width: 1.65em; - } - - &.cpu label { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-dashboard-monitors-cpu-icon); - } - - &.ram label { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-dashboard-monitors-ram-icon); - } - - &.gpu label { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-dashboard-monitors-gpu-icon); - } - - &.storage label { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-dashboard-monitors-disk-icon); - } - - .stats-bar { - levelbar * { - transition: 200ms; - } - - trough { - min-height: 1.05em; - } - - block { - border-radius: 0.4em; - - &.empty { - background: if($bar-menus-monochrome, $bar-menus-progressbar-background, $bar-menus-menu-dashboard-monitors-bar_background); - } - - &.filled { - padding-left: 0.85em; - } - } - } - - &.cpu .stats-bar block.filled { - background: if($bar-menus-monochrome, $bar-menus-progressbar-foreground, $bar-menus-menu-dashboard-monitors-cpu-bar); - } - - &.ram .stats-bar block.filled { - background: if($bar-menus-monochrome, $bar-menus-progressbar-foreground, $bar-menus-menu-dashboard-monitors-ram-bar); - } - - &.gpu .stats-bar block.filled { - background: if($bar-menus-monochrome, $bar-menus-progressbar-foreground, $bar-menus-menu-dashboard-monitors-gpu-bar); - } - - &.storage .stats-bar block.filled { - background: if($bar-menus-monochrome, $bar-menus-progressbar-foreground, $bar-menus-menu-dashboard-monitors-disk-bar); - } - } - - .stat-value { - margin-bottom: 0.75em; - font-size: 0.9em; - - &.cpu { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-monitors-cpu-label); - } - - &.ram { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-monitors-ram-label); - } - - &.gpu { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-monitors-gpu-label); - } - - &.storage { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-monitors-disk-label); - } - } - } -} diff --git a/ags/HyprPanel/scss/style/menus/energy.scss b/ags/HyprPanel/scss/style/menus/energy.scss deleted file mode 100644 index 45648f3..0000000 --- a/ags/HyprPanel/scss/style/menus/energy.scss +++ /dev/null @@ -1,108 +0,0 @@ -.menu-items-container.energy * { - font-size: $font-size * $bar-menus-menu-battery-scaling * 0.01; -} - -.menu-items.energy { - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-battery-background-color); - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-battery-border-color); - opacity: $bar-menus-opacity * 0.01; - font-size: $font-size * $bar-menus-menu-battery-scaling * 0.01; -} - -@import "./menu.scss"; - -.menu-items-container.energy { - min-width: 18em * $bar-menus-menu-battery-scaling * 0.01; - - .menu-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-battery-label-color); - } - - .menu-label-container { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-battery-card-color); - } - - .uptime { - font-size: 0.92em; - } - - .menu-items-section { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-battery-card-color); - } - - .power-profile-item { - color: if($bar-menus-monochrome, $bar-menus-listitems-passive, $bar-menus-menu-battery-listitems-passive); - margin-bottom: 0.5em; - - label { - margin-left: 1em; - } - - image { - font-size: 1.3em; - min-width: 1em; - min-height: 1em; - color: if($bar-menus-monochrome, $bar-menus-icons-passive, $bar-menus-menu-battery-icons-passive); - } - - &:hover { - color: if($bar-menus-monochrome, $bar-menus-listitems-active, $bar-menus-menu-battery-listitems-active); - - label { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-battery-icons-active); - } - - image { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-battery-icons-active); - } - } - - &.active { - color: if($bar-menus-monochrome, $bar-menus-listitems-active, $bar-menus-menu-battery-listitems-active); - - image { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-battery-icons-active); - } - } - } - - .brightness-container { - padding-bottom: 1em; - } - - .brightness-slider-icon { - font-size: 1.4em; - min-width: 1em; - min-height: 1em; - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-battery-icons-active); - } - - .brightness-slider-label { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-battery-text); - font-size: 0.9em; - min-width: 2.5em; - font-weight: bold; - margin-bottom: 0.2em; - } - - .menu-slider.brightness { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-background, $bar-menus-menu-battery-slider-background); - - highlight, - progress { - background: if($bar-menus-monochrome, $bar-menus-slider-primary, $bar-menus-menu-battery-slider-primary); - } - } - - &:hover { - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-backgroundhover, $bar-menus-menu-battery-slider-backgroundhover); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-slider-puck, $bar-menus-menu-battery-slider-puck); - } - } - } -} diff --git a/ags/HyprPanel/scss/style/menus/media.scss b/ags/HyprPanel/scss/style/menus/media.scss deleted file mode 100644 index 7c6205c..0000000 --- a/ags/HyprPanel/scss/style/menus/media.scss +++ /dev/null @@ -1,126 +0,0 @@ -.menu-items.media { - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-media-background-color); - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-media-border-color); - opacity: $bar-menus-opacity * 0.01; - -} - -.menu-items-container.media { - * { - font-size: $font-size * $bar-menus-menu-media-scaling * 0.01; - } - - min-width: 23em * $bar-menus-menu-media-scaling * 0.01; - min-height: 10em * $bar-menus-menu-media-scaling * 0.01; - - .menu-section-container { - margin: 1em 0em; - } - - .menu-items-section { - border-radius: $bar-menus-card_radius; - padding: 0em; - } - - .menu-content { - border-radius: 0.4em; - background-size: cover; - background-position: center; - } - - .media-content { - margin: 1em; - } - - .media-indicator-current-song-name { - margin-bottom: 0.75rem; - } - - .media-indicator-current-song-author { - margin-bottom: 0.75rem; - } - - .media-indicator-current-song-name-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-media-song); - font-size: 1.35em; - } - - .media-indicator-current-song-author-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-media-artist); - font-size: 1em; - } - - .media-indicator-current-song-album-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-media-album); - font-size: 1em; - } - - .media-indicator-current-controls { - margin-top: 1.5rem; - margin-bottom: 0.5rem; - } - - .media-indicator-control-button { - margin: 0rem 0.5rem; - } - - .media-indicator-control-button { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-media-buttons-background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-media-buttons-text); - min-height: 1.8em; - min-width: 2.5em; - border-radius: 0.2rem; - - &.disabled { - background: if($bar-menus-monochrome, $bar-menus-buttons-disabled, $bar-menus-menu-media-buttons-inactive); - } - - &.enabled { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-media-buttons-background); - - &:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-media-buttons-background), 0.5); - } - - &.active { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-media-buttons-enabled); - - &:hover { - background: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-media-buttons-enabled), 0.5); - } - } - } - - } - - image { - font-size: 1.1em; - } - - .menu-slider.media.progress { - margin-top: 1em; - margin-bottom: 1em; - - trough { - background: if($bar-menus-monochrome, $bar-menus-slider-background, $bar-menus-menu-media-slider-background); - border-radius: 0.2em; - - highlight, - progress { - border-radius: 0.2em; - min-height: .85em; - background: if($bar-menus-monochrome, $bar-menus-slider-primary, $bar-menus-menu-media-slider-primary); - } - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-slider-puck, $bar-menus-menu-media-slider-puck); - } - - &:hover { - trough { - background: transparentize(if($bar-menus-monochrome, $bar-menus-slider-backgroundhover, $bar-menus-menu-media-slider-backgroundhover), 0.3); - } - } - } -} diff --git a/ags/HyprPanel/scss/style/menus/menu.scss b/ags/HyprPanel/scss/style/menus/menu.scss deleted file mode 100644 index 349169a..0000000 --- a/ags/HyprPanel/scss/style/menus/menu.scss +++ /dev/null @@ -1,256 +0,0 @@ -.menu-slider { - trough { - border-radius: 0.3rem; - background: $surface0; - - highlight, - progress { - background: $peach; - border-radius: 0.3rem; - } - } - - slider { - box-shadow: none; - background-color: transparent; - min-height: 0.6rem; - min-width: 0.6rem; - border: 0rem solid transparent; - border-radius: 0.3rem; - } - - &:hover { - trough { - background: $surface0; - } - - slider { - background: $overlay0; - box-shadow: none; - } - } -} - -.menu-switch { - font-size: 1.3em; - background-color: $surface0; - border-radius: 0.2em; - - &:checked { - background: $sky; - } - - trough { - highlight, - progress { - background-color: $peach; - border-radius: 0.3em; - } - } - - slider { - box-shadow: none; - background-color: $overlay0; - min-height: 1em; - min-width: 1em; - border: 0em solid transparent; - border-radius: 0.2em; - margin: 0.1em 0.15em; - } - - &:hover { - trough { - background: $surface0; - } - - slider { - background: $overlay0; - box-shadow: none; - } - } - - &:active { - background-color: $sky; - } -} - -.menu-separator { - min-height: 0.1rem; - margin: 0.6rem 0rem; - background: $surface1; -} - -.menu-items { - background: $crust; - border: $bar-menus-border-size solid $bar-menus-border-color; - border-radius: $bar-menus-border-radius; - color: $text; -} - -.menu-items-container { - border-radius: 0.4em; - font-size: 1.3em; -} - -.menu-section-container { - margin: 1em 0em; - - .menu-label { - color: $text; - font-size: 1.1em; - font-weight: bold; - } - - .menu-label-container { - background: $base; - border-radius: $bar-menus-card_radius; - border-bottom-left-radius: 0em; - border-bottom-right-radius: 0em; - margin: 0em 1em; - min-height: 2em; - } - - &:first-child { - margin-bottom: 0em; - } - - &:last-child { - margin-top: 0em; - } - - &:nth-child(2) { - margin-top: 1em; - } - - .menu-items-section { - background: $base; - border-radius: $bar-menus-card_radius; - border-top-left-radius: 0em; - border-top-right-radius: 0em; - padding: 0.9em; - margin: 0em 1em; - } -} - -.menu-active { - font-size: 0.9em; - font-weight: bold; - margin: 0rem 1em; - margin-bottom: 0.9em; -} - -.menu-active-container { - &:first-child { - margin-bottom: 0.5em; - } -} - -.menu-active-button { - padding: 0.1em; - margin-bottom: -0.2em; - - .menu-active-icon { - font-size: 1.4em; - font-weight: bold; - } - - &.muted image { - color: $maroon; - } - - &:hover image { - color: $maroon; - } -} - -.menu-active-percentage { - font-size: 0.9em; - min-width: 2.5em; - font-weight: bold; -} - -.menu-active-slider { - margin-left: 1rem; - margin-right: 1.5rem; -} - -.menu-active-slider * { - min-height: 0.85em; - border-radius: 0.2em; -} - -.menu-slider-container { - margin-bottom: 0.7rem; -} - -.menu-label-dim { - color: $overlay0; - margin-right: 1rem; - font-size: 1em; - font-weight: bold; -} - -.menu-icon-button { - &:hover { - color: $surface2; - } -} - -.menu-dropdown-label-container { - background: $base; - border-radius: 0.4em; -} - -.menu-button { - margin-bottom: 0.4em; -} - -.menu-button-name { - font-size: 0.95em; - font-weight: bold; - margin-left: 0.5em; - margin-right: 1.2rem; -} - -.menu-button-icon { - font-size: 1.3em; - font-weight: bold; - margin-right: 0.5rem; -} - -.menu-item-box { - margin-bottom: 0.5rem; -} - -.dropdown-menu-container { - min-height: 10em; -} - -.menu-label { - margin: 0.5em 1em; - color: $sky; -} - -.event-box-container { - min-height: 0em; - margin-top: $bar-dropdownGap; -} - -.event-top-padding * { - min-height: 0em; - margin-top: if($bar-floating and $bar-location == 'top', $bar-margin_top, 0); - margin-bottom: if($bar-floating and $bar-location == 'bottom', $bar-margin_bottom, 0); -} - -@keyframes spin { - to { - -gtk-icon-transform: rotate(1turn); - } -} - -image.spinning { - animation-name: spin; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; -} diff --git a/ags/HyprPanel/scss/style/menus/network.scss b/ags/HyprPanel/scss/style/menus/network.scss deleted file mode 100644 index b76bee1..0000000 --- a/ags/HyprPanel/scss/style/menus/network.scss +++ /dev/null @@ -1,184 +0,0 @@ -.menu-items-container.network * { - font-size: $font-size * $bar-menus-menu-network-scaling * 0.01; -} - -@import './menu.scss'; - -.menu-items.network { - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-network-background-color); - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-network-border-color); - opacity: $bar-menus-opacity * 0.01; - font-size: $font-size * $bar-menus-menu-network-scaling * 0.01; -} - -.menu-items-container.network { - min-width: 18em * $bar-menus-menu-network-scaling * 0.01; - font-size: 1.3em; - - .menu-items-section { - padding-bottom: 1.5em; - } - - .menu-label { - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-network-label-color); - } - - .network-icon { - font-size: 1.3em; - min-width: 1em; - min-height: 1em; - color: if($bar-menus-monochrome, $bar-menus-icons-passive, $bar-menus-menu-network-icons-passive); - - &.active { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-network-icons-active); - } - } - - .menu-icon-button.network { - margin: 1em; - } - - .connection-container { - margin-left: 1em; - } - - .connection-status.dim { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - opacity: 0.5; - font-size: 0.9em; - } - - .menu-section-container.wifi { - margin-top: 0.65em; - - .menu-items-section { - min-height: 12em; - } - } - - .network-element-item { - &:not(:last-child) { - margin-bottom: 0.5em; - } - - &.staging { - margin-bottom: 0.5em; - } - - &:hover { - .network-icon { - color: if($bar-menus-monochrome, $bar-menus-icons-active, $bar-menus-menu-network-icons-active); - opacity: 1; - } - - .active-connection { - color: if( - $bar-menus-monochrome, - $bar-menus-iconbuttons-active, - $bar-menus-menu-network-iconbuttons-active - ); - } - } - - .active-connection { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - } - - .active-connection.dim { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - opacity: 0.5; - } - } - - .spinner.wap { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-network-iconbuttons-active); - } - - .network-password-input-container { - background: darken(if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-network-card-color), 5%); - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - border-radius: 0.4em; - margin: 0em 2em; - margin-top: 0.75em; - padding: 0.5em; - } - - .close-network-password-input-button { - padding: 0em 0.5em; - - &:hover image { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - opacity: 0.5; - } - } - - .menu-icon-button.network.search { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-network-iconbuttons-passive); - - &:hover { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-network-iconbuttons-active); - } - } - - .menu-icon-button.network.disconnect { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-passive, $bar-menus-menu-network-iconbuttons-passive); - margin: 0em; - margin-top: -0.2em; - margin-left: 1em; - - label { - font-size: 1.4em; - } - - &:hover { - color: if($bar-menus-monochrome, $bar-menus-iconbuttons-active, $bar-menus-menu-network-iconbuttons-active); - } - } - - .waps-not-found.dim { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-network-text); - opacity: 0.5; - } - - .menu-label-container { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-network-card-color); - } - - .menu-items-section { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-network-card-color); - } - - .menu-switch.network { - background-color: if( - $bar-menus-monochrome, - $bar-menus-switch-disabled, - $bar-menus-menu-network-switch-disabled - ); - - &:checked { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-network-switch-enabled); - } - - slider { - background-color: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-network-switch-puck); - } - - &:hover { - trough { - background: if( - $bar-menus-monochrome, - $bar-menus-switch-disabled, - $bar-menus-menu-network-switch-disabled - ); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-network-switch-puck); - } - } - - &:active { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-network-switch-enabled); - } - } -} diff --git a/ags/HyprPanel/scss/style/menus/notifications.scss b/ags/HyprPanel/scss/style/menus/notifications.scss deleted file mode 100644 index 5f2d735..0000000 --- a/ags/HyprPanel/scss/style/menus/notifications.scss +++ /dev/null @@ -1,192 +0,0 @@ -.notification-menu-content * { - font-size: $font-size * $bar-menus-menu-notifications-scaling * 0.01; -} - -.notification-card-container.menu { - margin: 0em; - min-width: 30.6em * $bar-menus-menu-notifications-scaling * 0.01; - min-height: $bar-menus-menu-notifications-height * $bar-menus-menu-notifications-scaling * 0.01; - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-notifications-background); - border: $bar-menus-border-size solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-notifications-border); - border-radius: $bar-menus-border-radius; - margin-right: 0.45em; - opacity: $bar-menus-opacity * 0.01; - - .window-content.notificationsmenu-window { - margin-right: 0.50em; - } - - .menu-content-container.notifications { - margin: 1em; - margin-bottom: 0em; - min-height: 4em; - } - - .notification-menu-controls { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-notifications-card); - margin: 1em 1em; - margin-bottom: 0.5em; - border-radius: $bar-menus-card_radius; - padding: 0.4em 0.75em; - } - - .notification-card.menu { - background: $notification-background; - min-width: 26.2em * $bar-menus-menu-notifications-scaling * 0.01; - font-size: $font-size * $bar-menus-menu-notifications-scaling * 0.01; - border: 0.15em solid $notification-border; - border-radius: 0em; - border-bottom-left-radius: $notification-border_radius; - border-top-left-radius: $notification-border_radius; - margin: 0em; - } - - .notification-card-content-container { - margin-bottom: 0.65em; - - &:last-child { - margin-bottom: 1em; - } - } - - .notification-card-content { - margin-bottom: 0.25em; - } - - .menu-label.notifications { - margin: 0em; - font-size: $font-size * $bar-menus-menu-notifications-scaling * 0.01; - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-notifications-label); - } - - .menu-separator.notification-controls { - min-width: 0.1em; - background-color: if($bar-menus-monochrome, $bar-menus-dropdownmenu-divider, $bar-menus-menu-notifications-switch_divider); - margin: 0em 1em; - } - - .menu-switch.notifications { - background-color: if($bar-menus-monochrome, $bar-menus-switch-disabled, $bar-menus-menu-notifications-switch-disabled); - - &:checked { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-notifications-switch-enabled); - } - - slider { - background-color: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-notifications-switch-puck); - } - - &:hover { - trough { - background: if($bar-menus-monochrome, $bar-menus-switch-disabled, $bar-menus-menu-notifications-switch-disabled); - } - - slider { - background: if($bar-menus-monochrome, $bar-menus-switch-puck, $bar-menus-menu-notifications-switch-puck); - } - } - - &:active { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-notifications-switch-enabled); - } - } - - .clear-notifications-button { - margin-right: 0.3em; - - &:hover label:not(.removing) { - color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-notifications-clear), 0.5); - } - } - - .clear-notifications-label { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-notifications-clear); - font-size: 1.5em; - - &.removing { - color: $bar-menus-buttons-disabled; - } - } - - scrollbar { - margin-right: 0.2em; - min-width: $bar-menus-menu-notifications-scrollbar-width; - border-radius: $bar-menus-menu-notifications-scrollbar-radius; - background: transparent; - - slider { - min-width: $bar-menus-menu-notifications-scrollbar-width; - border-radius: $bar-menus-menu-notifications-scrollbar-radius; - background: $bar-menus-menu-notifications-scrollbar-color; - } - } -} - -.notification-label-container { - margin-bottom: 8em; - - label { - color: if($bar-menus-monochrome, $bar-menus-feinttext, $bar-menus-menu-notifications-no_notifications_label); - } - - .bell { - font-size: 10em * $bar-menus-menu-notifications-scaling * 0.01; - } - - .message { - font-size: 1.5em * $bar-menus-menu-notifications-scaling * 0.01; - } -} - -.close-notification-button.menu { - background: $notification-close_button-background; - color: $notification-close_button-label; - min-width: 2.1em; - border-radius: 0rem $notification-border_radius $notification-border_radius 0em; - - label { - font-size: 1.5em; - } - - &:hover { - background: transparentize($notification-close_button-background , 0.5); - } -} - -.notification-menu-pager { - background: $bar-menus-menu-notifications-pager-background; - border-radius: $bar-menus-border-radius; - border-top-left-radius: 0em; - border-top-right-radius: 0em; - - .pager-button { - margin: 0em; - padding: 0.25em 1em; - color: $bar-menus-menu-notifications-pager-button; - - .pager-button-label { - font-size: 2em; - } - - &:hover { - .pager-button-label { - color: transparentize($bar-menus-menu-notifications-pager-button, 0.4); - text-decoration: none; - } - } - } - - .pager-label { - color: $bar-menus-menu-notifications-pager-label; - } - - .disabled { - color: transparentize($bar-menus-menu-notifications-pager-button, 0.8); - - &:hover { - .pager-button-label { - color: transparentize($bar-menus-menu-notifications-pager-button, 0.8); - } - } - } -} diff --git a/ags/HyprPanel/scss/style/menus/power.scss b/ags/HyprPanel/scss/style/menus/power.scss deleted file mode 100644 index 43c1c03..0000000 --- a/ags/HyprPanel/scss/style/menus/power.scss +++ /dev/null @@ -1,227 +0,0 @@ -window#powermenu, -window#verification { - // the fraction has to be more than hyprland ignorealpha - background-color: rgba(0, 0, 0, .4); -} - -$popover-padding: 0.6rem * 1.6; - -window#verification .verification { - * { - font-size: $font-size * $bar-menus-menu-dashboard-confirmation_scaling * 0.01; - } - - @include floating-widget; - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-dashboard-powermenu-confirmation-background); - border: $bar-menus-border-size solid if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-dashboard-powermenu-confirmation-border); - padding: 0.35em * 1.6 * 1.5; - min-width: 20em; - min-height: 6em; - opacity: $bar-menus-opacity * 0.01; - - .verification-content { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-dashboard-powermenu-confirmation-card); - border-radius: $bar-menus-border-radius * 0.5; - padding: 1em; - } - - .text-box { - margin-bottom: 0.3em; - - .title { - font-size: 1.5em; - color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-dashboard-powermenu-confirmation-label); - margin-bottom: 0.5em; - } - - .desc { - color: if($bar-menus-monochrome, $bar-menus-text, $bar-menus-menu-dashboard-powermenu-confirmation-body); - font-size: 1em; - margin-bottom: 0.55em; - padding: 1em 3em; - } - } - - .verification-button { - background: $bar-menus-buttons-default; - padding: 0.7em 0em; - margin: 0.4em 1.7em; - border-radius: $bar-menus-border-radius * 0.5; - opacity: 1; - transition: border-color 0.2s ease-in-out; - transition: opacity .3s ease-in-out; - - &.bar-verification_yes { - background-color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-confirm); - } - - &.bar-verification_no { - background-color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-deny); - } - - &:hover { - &.bar-verification_yes { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-confirm), 0.6); - transition: background-color 0.2s ease-in-out; - } - - &.bar-verification_no { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-deny), 0.6); - transition: background-color 0.2s ease-in-out; - } - } - - &:focus { - &.bar-verification_yes { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-confirm), 0.6); - transition: background 0.2s ease-in-out; - } - - &.bar-verification_no { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-deny), 0.6); - transition: background 0.2s ease-in-out; - } - } - - &:active { - &.bar-verification_yes { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-confirm), 0.6); - transition: background 0.2s ease-in-out; - } - - &.bar-verification_no { - background-color: transparentize(if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-powermenu-confirmation-deny), 0.6); - transition: background 0.2s ease-in-out; - } - - image { - opacity: .3; - transition: opacity .3s ease-in-out; - } - - label { - opacity: .3; - transition: opacity .3s ease-in-out; - } - } - } - - .bar-verification_no label { - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-powermenu-confirmation-button_text); - } - - .bar-verification_yes label { - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-powermenu-confirmation-button_text); - } -} - -window#powermenu .powermenu { - @include floating-widget; - - &.line { - padding: $popover-padding * 1.5; - } - - &.box { - padding: $popover-padding * 2; - } -} - -.widget-button { - border-color: $crust; - min-width: 4.5em; - min-height: 4.5em; - opacity: 1; - transition: border-color 0.2s ease-in-out; - transition: opacity .3s ease-in-out; - - &:hover { - &.powermenu-button-shutdown { - border-color: $red; - } - - &.powermenu-button-logout { - border-color: $green; - } - - &.powermenu-button-sleep { - border-color: $sky; - } - - &.powermenu-button-reboot { - border-color: $peach; - } - } - - &:focus { - &.powermenu-button-shutdown { - border-color: $red; - } - - &.powermenu-button-logout { - border-color: $green; - } - - &.powermenu-button-sleep { - border-color: $sky; - } - - &.powermenu-button-reboot { - border-color: $peach; - } - } - - &:active { - &.powermenu-button-shutdown { - border-color: rgba($red, .5); - } - - &.powermenu-button-logout { - border-color: rgba($green, .5); - } - - &.powermenu-button-sleep { - border-color: rgba($sky, .5); - } - - &.powermenu-button-reboot { - border-color: rgba($peach, .5); - } - } -} - -.system-button_icon { - &.shutdown { - color: $red; - } - - &.logout { - color: $green; - } - - &.reboot { - color: $peach; - } - - &.sleep { - color: $sky; - } -} - -.system-button_label { - &.shutdown { - color: $red; - } - - &.logout { - color: $green; - } - - &.reboot { - color: $peach; - } - - &.sleep { - color: $sky; - } -} diff --git a/ags/HyprPanel/scss/style/menus/powerdropdown.scss b/ags/HyprPanel/scss/style/menus/powerdropdown.scss deleted file mode 100644 index 853835c..0000000 --- a/ags/HyprPanel/scss/style/menus/powerdropdown.scss +++ /dev/null @@ -1,136 +0,0 @@ -.menu-items-container.power-dropdown * { - font-size: $font-size * $bar-menus-menu-power-scaling * 0.01; -} - -@import "./menu.scss"; - -.menu-items.power-dropdown { - background: if($bar-menus-monochrome, $bar-menus-background, $bar-menus-menu-power-background-color); - border-color: if($bar-menus-monochrome, $bar-menus-border-color, $bar-menus-menu-power-border-color); - opacity: $bar-menus-opacity * 0.01; - font-size: $font-size * $bar-menus-menu-power-scaling * 0.01; -} - -.menu-items-container.power-dropdown { - &.reboot { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-restart-background); - } - - &.logout { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-logout-background); - } - - &.sleep { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-sleep-background); - } - - min-height: 3.5em * $bar-menus-menu-power-scaling * 0.01; - font-size: 1.3em; - margin: 1em; - - .menu-items-section { - padding-bottom: 1.5em; - } - - .power-menu-button { - border-radius: $bar-menus-border-radius * 0.6; - - // This doubles the border-radius so it doesn't show up as - // an artifact behind the button as that has a radius as well - border-top-left-radius: $bar-menus-border-radius * 2; - border-bottom-left-radius: $bar-menus-border-radius * 2; - - &.no-label { - // This doubles the border-radius so it doesn't show up as - // an artifact behind the button as that has a radius as well - border-top-right-radius: $bar-menus-border-radius * 2; - border-bottom-right-radius: $bar-menus-border-radius * 2; - } - - &:hover { - opacity: 0.4; - } - - &:not(:last-child) { - margin-bottom: 1.5em; - } - - .power-button-label { - font-size: 1.1em; - } - - &.shutdown { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-shutdown-background); - } - - &.reboot { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-restart-background); - } - - &.logout { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-logout-background); - } - - &.sleep { - background: if($bar-menus-monochrome, $bar-menus-cards, $bar-menus-menu-power-buttons-sleep-background); - } - - .show-label { - padding-right: 1em; - } - - .no-label { - border-top-right-radius: $bar-menus-border-radius * 0.35; - border-bottom-right-radius: $bar-menus-border-radius * 0.35; - } - - .shutdown-label { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-shutdown-text); - } - - .reboot-label { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-restart-text); - } - - .logout-label { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-logout-text); - } - - .sleep-label { - color: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-sleep-text); - } - } - - label:not(.txt-icon) { - margin-left: 1em; - } - - label.txt-icon { - min-width: 3.75rem * $bar-menus-menu-power-scaling * 0.01; - min-height: 3.75rem * $bar-menus-menu-power-scaling * 0.01; - background: $red; - border-top-left-radius: $bar-menus-border-radius * 0.35; - border-bottom-left-radius: $bar-menus-border-radius * 0.35; - font-size: 1.75em; - - &.shutdown-icon { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-shutdown-icon_background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-power-buttons-shutdown-icon); - } - - &.reboot-icon { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-restart-icon_background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-power-buttons-restart-icon); - } - - &.logout-icon { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-logout-icon_background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-power-buttons-logout-icon); - } - - &.sleep-icon { - background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-power-buttons-sleep-icon_background); - color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-power-buttons-sleep-icon); - } - } -} diff --git a/ags/HyprPanel/scss/style/notifications/popups.scss b/ags/HyprPanel/scss/style/notifications/popups.scss deleted file mode 100644 index c371c3a..0000000 --- a/ags/HyprPanel/scss/style/notifications/popups.scss +++ /dev/null @@ -1,107 +0,0 @@ -.notification-card { - color: $notification-text; - background: $notification-background; - margin: 0.45em; - border: 0.15em solid transparentize($notification-border, 0.5); - min-width: 26em; - min-height: 6rem; - border-radius: $notification-border_radius; - opacity: $notification-opacity * 0.01; -} - -.notification-card-container { - * { - font-size: $font-size * $notification-scaling * 0.01; - } - - padding: 1px; -} - -.notification-card-image-container { - margin: 0.65em 0.65em; - border-radius: 0.4em; -} - -.notification-card-image { - border-radius: 0.4em; - min-width: 2.5em; - min-height: 2.5em; - padding: 0.85em 0.85em; - background-size: contain; - background-repeat: no-repeat; - background-position: center; -} - -.notification-card-content { - min-width: 2.9em; - min-height: 2.9em; - padding: 0.5em 0.5em; - margin-right: 0.5rem; - margin-bottom: 0.5rem; -} - -.notification-card-content.noimg { - margin-left: 0.5em; - margin-top: .15em; -} - -.notification-card-header-label { - font-size: 0.95em; - margin-bottom: 0.5em; - color: $notification-label; -} - -.notification-card-body-label { - font-size: 0.84em; - margin-bottom: 1em; - font-weight: 600; -} - -.notification-card-actions { - margin-top: 0.25em; - margin-bottom: 0.4em; -} - -.notification-action-buttons { - color: $notification-actions-text; - background: $notification-actions-background; - min-width: 4em; - min-height: 1.65em; - border-radius: 0.2em; - - &:not(:last-child) { - margin-right: 2rem; - } - - &:hover { - background: transparentize($notification-actions-background, 0.6); - } -} - -.notification-icon { - color: $notification-labelicon; - margin-bottom: 0.4em; - min-width: 1em; - min-height: 1em; - font-size: 1.3em; -} - -.notification-time { - font-size: 0.85em; - color: $notification-time; -} - -.close-notification-button { - background: $notification-close_button-background; - color: $notification-close_button-label; - min-width: 2.1em; - border-radius: 0rem $notification-border_radius*0.7 $notification-border_radius*0.7 0em; - - label { - font-size: 1.5em; - } - - &:hover { - background: transparentize($notification-close_button-background, 0.5); - } -} diff --git a/ags/HyprPanel/scss/style/osd/index.scss b/ags/HyprPanel/scss/style/osd/index.scss deleted file mode 100644 index 8b60d26..0000000 --- a/ags/HyprPanel/scss/style/osd/index.scss +++ /dev/null @@ -1,81 +0,0 @@ -.indicator { - * { - font-size: $font-size * $osd-scaling * 0.01; - } - - .osd-container { - margin: $osd-margins; - opacity: $osd-opacity * 0.01; - } - - .osd-label-container { - background: $osd-bar_container; - - border-radius: if($osd-orientation =="vertical", $osd-radius $osd-radius 0em 0em, 0em $osd-radius $osd-radius 0em); - - .osd-label { - font-size: 1em; - padding-top: if($osd-orientation =="vertical", 1em, 0em); - padding-right: if($osd-orientation =="horizontal", 1em, 0em); - color: $osd-label; - - &.overflow { - color: $osd-bar_overflow_color; - } - } - } - - .osd-icon-container { - background: $osd-icon_container; - - border-radius: if($osd-orientation =="vertical", 0em 0em $osd-radius $osd-radius, $osd-radius 0em 0em $osd-radius ); - - .osd-icon { - font-size: 2.1em; - padding: if($osd-orientation =="vertical", 0.2em 0em, 0em 0.4em); - color: $osd-icon; - } - } - - .osd-bar-container { - padding: 1.25em; - background: $osd-bar_container; - - .osd-bar { - levelbar * { - transition: 200ms; - } - - trough { - min-height: if($osd-orientation =="vertical", 10em, 0); - min-width: if($osd-orientation =="horizontal", 10em, 0); - } - - block { - border-radius: $osd-radius * 0.5; - - &.empty { - background: $osd-bar_empty_color; - - } - - &.filled { - background: $osd-bar_color; - padding: 0.45em; - } - } - - &.overflow { - block { - &.empty { - background: $osd-bar_color; - } - - &.filled { - background: $osd-bar_overflow_color; - } - } - } - } - } -} diff --git a/ags/HyprPanel/scss/style/settings/dialog.scss b/ags/HyprPanel/scss/style/settings/dialog.scss deleted file mode 100644 index 27ac3df..0000000 --- a/ags/HyprPanel/scss/style/settings/dialog.scss +++ /dev/null @@ -1,407 +0,0 @@ -window.settings-dialog { - opacity: $bar-menus-opacity * 0.01; - background-color: $bar-menus-cards; - color: $bar-menus-text; - - $widget-bg: $bar-menus-cards; - $border: none; - $fg: $bar-menus-text; - - .settings-dialog-box { - min-width: 75em; - } - - .header { - background-color: transparentize($bar-menus-background, 0.1); - border-bottom-left-radius: $bar-menus-border-radius * 0.5; - border-bottom-right-radius: $bar-menus-border-radius * 0.5; - padding: $padding; - - button { - font-weight: bold; - - } - - button.close { - color: $bar-menus-iconbuttons-passive; - - image { - font-size: 2em; - } - - &:hover { - color: $bar-menus-buttons-active; - } - } - - button.reset { - color: $bar-menus-iconbuttons-passive; - padding: $padding*.5; - - image { - font-size: 1.25em; - } - - &:hover { - color: $bar-menus-buttons-active; - } - } - } - - .page { - - .page-content { - padding: $padding*2; - padding-top: 0; - } - } - - .group { - .group-title { - color: $bar-menus-text; - margin-bottom: $spacing*.5; - } - - .group-reset { - margin: $spacing * .5; - padding: $padding * .5; - - &:disabled { - color: transparent; - } - } - - &:not(:first-child) { - margin-top: $spacing; - } - } - - .row { - background-color: $widget-bg; - padding: $padding; - border: $border; - border-top: none; - - &:first-child { - border-radius: $radius $radius 0em 0em; - border: $border; - } - - &:last-child { - border-radius: 0em 0em $radius $radius; - } - - &:first-child:last-child { - border-radius: $radius; - border: $border; - } - - button.reset { - margin-left: $spacing; - } - - label.id, - label.note { - color: transparentize($fg, .4) - } - - entry, - button { - padding: $padding; - } - - spinbutton { - entry { - border-radius: $radius 0em 0em $radius; - } - - button { - border-radius: 0em; - } - - button:last-child { - border-radius: 0em $radius $radius 0em; - } - } - - .enum-setter { - label { - background-color: $widget-bg; - border: $border; - padding: 0em $padding; - border-radius: $radius 0em 0em $radius; - } - - button { - border-radius: 0em; - } - - button:last-child { - border-radius: 0em $radius $radius 0em; - } - } - - &.wallpaper { - button { - margin-top: $spacing * .5; - } - - .preview { - border-radius: $radius; - } - } - } -} - -.option-item { - margin: 0em 2em; - margin-bottom: 1em; - - .reset { - color: $bar-menus-iconbuttons-passive; - } - - .options-label { - color: $bar-menus-text; - } - - .options-sublabel { - font-size: 0.75em; - margin-top: 0.2em; - color: $bar-menus-dimtext; - } - - .options-sublabel-link { - - label { - font-size: 0.75em; - margin-top: 0.2em; - color: $bar-menus-dimtext; - } - - &:hover label { - color: $bar-menus-listitems-active; - } - } - - .inputter-container { - border-radius: $bar-menus-border-radius * 0.5; - - :first-child { - border-radius: $bar-menus-border-radius * 0.5; - } - - padding: 0.35em 0.35em; - background: transparentize($bar-menus-background, 0.6); - margin-right: 1em; - } -} - -.options-header { - margin: 1em 1em; - - .label-name { - color: $bar-menus-label; - font-size: 0.9em; - margin-right: 0.5em; - } -} - -.pager-button { - color: transparentize($bar-menus-text, 0.4); - margin: 0.5em 0.75em; - - &.category label { - font-size: 1.4em; - } - - &:hover { - label { - text-decoration: underline; - color: $bar-menus-text; - } - } - - &.active { - label { - text-decoration: underline; - color: $bar-menus-text; - } - } -} - -.bar-theme-page { - min-height: 40em; -} - -.settings-menu-stack { - background: $red; -} - -.paged-container { - .reset-options { - color: $bar-menus-text; - - image:disabled { - color: $bar-menus-buttons-disabled; - } - - &:hover { - image { - color: transparentize($bar-menus-text, 0.5); - } - } - } - - scrollbar { - margin-right: 0.2em; - min-width: 0.6em; - border-radius: $bar-menus-border-radius; - background: $bar-menus-background; - - slider { - min-width: 0.6em; - border-radius: $bar-menus-border-radius; - background: $bar-menus-buttons-default; - } - } - - selection { - background: $bar-menus-label; - color: $bar-menus-cards; - } - - switch { - font-size: 10px; - - &:checked { - background: $bar-menus-switch-enabled; - } - - slider { - background-color: $bar-menus-switch-puck; - } - - &:active { - background: if($bar-menus-monochrome, $bar-menus-switch-enabled, $bar-menus-menu-bluetooth-switch-enabled); - } - } - - entry { - min-width: 15em; - } -} - -dialog { - background: $bar-menus-cards; - color: $bar-menus-text; - - :selected { - background: transparentize($bar-menus-label, 0.2); - color: transparentize($bar-menus-cards, 0.2); - } - - headerbar { - border-bottom: 0.075em solid $bar-menus-border-color; - background: $bar-menus-cards; - padding: 0.5em; - font-size: 1.5em; - - button { - color: $bar-menus-buttons-text; - min-width: 4.5em; - min-height: 2.5em; - border-radius: $bar-menus-border-radius; - background: $bar-menus-buttons-default; - - &:hover { - background: transparentize($bar-menus-buttons-default, 0.5); - } - } - } - - viewport { - border-right: .25em solid $bar-menus-border-color; - - list { - row { - padding: 0em 1.5em; - - &:hover { - background: $bar-menus-buttons-default; - color: $bar-menus-buttons-text; - } - - label { - margin: 0.5em 0.5em; - font-size: 0.85em; - } - } - } - - } - - stack { - .horizontal .path-bar { - button { - background: $bar-menus-iconbuttons-active; - min-width: 3em; - min-height: 2em; - border-radius: $bar-menus-border-radius * 0.5; - - &:disabled { - background: $bar-menus-buttons-disabled; - } - - &:hover { - background: transparentize($bar-menus-buttons-active, 0.5); - } - - label { - margin: 0em 0.25em; - color: $bar-menus-buttons-text - } - - image { - margin: 0em 0.5em; - color: $bar-menus-buttons-text - } - - margin: 0.25em; - } - } - } - - treeview header button { - padding: 0.25em; - border: .15em solid $bar-menus-border-color; - } - - headerbar { - color: $bar-menus-label; - } -} - -.unsaved-icon { - margin-right: 1em; - font-size: 1em; - color: $yellow; -} - -.options-import, -.options-export { - border-radius: $bar-menus-border-radius * 0.5; - color: $bar-menus-buttons-text; - padding: 0.35em 0.35em; - background: $bar-menus-buttons-default; - margin-right: 1em; - margin-left: 0.5em; - - &:hover { - background: transparentize($bar-menus-buttons-default, 0.8); - } -} - -.options-import { - margin-right: 0em; -} diff --git a/ags/HyprPanel/services/Brightness.ts b/ags/HyprPanel/services/Brightness.ts deleted file mode 100644 index 4ac8d49..0000000 --- a/ags/HyprPanel/services/Brightness.ts +++ /dev/null @@ -1,74 +0,0 @@ -// <3 Aylur for this brightness service -import { bash, dependencies, sh } from 'lib/utils'; - -if (!dependencies('brightnessctl')) App.quit(); - -const get = (args: string): number => Number(Utils.exec(`brightnessctl ${args}`)); -const screen = await bash`ls -w1 /sys/class/backlight | head -1`; -const kbd = await bash`ls -w1 /sys/class/leds | grep '::kbd_backlight$' | head -1`; - -class Brightness extends Service { - static { - Service.register( - this, - {}, - { - screen: ['float', 'rw'], - kbd: ['int', 'rw'], - }, - ); - } - - #kbdMax = get(`--device ${kbd} max`); - #kbd = get(`--device ${kbd} get`); - #screenMax = get(`--device ${screen} max`); - #screen = get(`--device ${screen} get`) / (get(`--device ${screen} max`) || 1); - - get kbd(): number { - return this.#kbd; - } - get screen(): number { - return this.#screen; - } - - set kbd(value) { - if (value < 0 || value > this.#kbdMax) return; - - sh(`brightnessctl -d ${kbd} s ${value} -q`).then(() => { - this.#kbd = value; - this.changed('kbd'); - }); - } - - set screen(percent) { - if (percent < 0) percent = 0; - - if (percent > 1) percent = 1; - - sh(`brightnessctl set ${Math.round(percent * 100)}% -d ${screen} -q`).then(() => { - this.#screen = percent; - this.changed('screen'); - }); - } - - constructor() { - super(); - - const screenPath = `/sys/class/backlight/${screen}/brightness`; - const kbdPath = `/sys/class/leds/${kbd}/brightness`; - - Utils.monitorFile(screenPath, async (f) => { - const v = await Utils.readFileAsync(f); - this.#screen = Number(v) / this.#screenMax; - this.changed('screen'); - }); - - Utils.monitorFile(kbdPath, async (f) => { - const v = await Utils.readFileAsync(f); - this.#kbd = Number(v) / this.#kbdMax; - this.changed('kbd'); - }); - } -} - -export default new Brightness(); diff --git a/ags/HyprPanel/services/Wallpaper.ts b/ags/HyprPanel/services/Wallpaper.ts deleted file mode 100644 index a27947c..0000000 --- a/ags/HyprPanel/services/Wallpaper.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { dependencies, sh } from 'lib/utils'; -import options from 'options'; -const hyprland = await Service.import('hyprland'); - -const WP = `${Utils.HOME}/.config/background`; - -class Wallpaper extends Service { - static { - Service.register( - this, - {}, - { - wallpaper: ['string'], - }, - ); - } - - #blockMonitor = false; - #isRunning = false; - - #wallpaper(): void { - if (!dependencies('swww')) return; - - hyprland.monitors.map((m) => m.name); - sh('hyprctl cursorpos').then((pos) => { - sh([ - 'swww', - 'img', - '--invert-y', - '--transition-type', - 'grow', - '--transition-duration', - '1.5', - '--transition-fps', - '30', - '--transition-pos', - pos.replace(' ', ''), - WP, - ]).then(() => { - this.changed('wallpaper'); - }); - }); - } - - async #setWallpaper(path: string): Promise { - this.#blockMonitor = true; - - await sh(`cp ${path} ${WP}`); - this.#wallpaper(); - - this.#blockMonitor = false; - } - - readonly set = (path: string): void => { - this.#setWallpaper(path); - }; - readonly isRunning = (): boolean => { - return this.#isRunning; - }; - - get wallpaper(): string { - return WP; - } - - constructor() { - super(); - - options.wallpaper.enable.connect('changed', () => { - if (options.wallpaper.enable.value) { - this.#isRunning = true; - Utils.execAsync('swww-daemon') - .then(() => { - this.#wallpaper(); - }) - .catch(() => null); - } else { - this.#isRunning = false; - Utils.execAsync('pkill swww-daemon').catch(() => null); - } - }); - - if (!dependencies('swww') || !options.wallpaper.enable.value) return this; - - this.#isRunning = true; - Utils.monitorFile(WP, () => { - if (!this.#blockMonitor) this.#wallpaper(); - }); - - Utils.execAsync('swww-daemon') - .then(() => { - this.#wallpaper(); - }) - .catch(() => null); - } -} - -export default new Wallpaper(); diff --git a/ags/HyprPanel/services/bluetooth.py b/ags/HyprPanel/services/bluetooth.py deleted file mode 100755 index bc26f77..0000000 --- a/ags/HyprPanel/services/bluetooth.py +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/env python3 - -import dbus -import dbus.service -import dbus.mainloop.glib -from gi.repository import GLib -import subprocess -import logging - -logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') - -AGENT_PATH = "/test/agent" -CAPABILITY = "NoInputNoOutput" - -def send_notification_with_actions(title, message, actions, action_handler): - bus = dbus.SessionBus() - notification_object = bus.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") - notify_interface = dbus.Interface(notification_object, "org.freedesktop.Notifications") - bus.add_signal_receiver(action_handler, - dbus_interface="org.freedesktop.Notifications", - signal_name="ActionInvoked") - notify_interface.Notify("bluetooth_agent", 0, "", title, message, actions, {}, -1) - -class Agent(dbus.service.Object): - def __init__(self, bus): - dbus.service.Object.__init__(self, bus, AGENT_PATH) - - @dbus.service.method("org.bluez.Agent1", in_signature="", out_signature="") - def Release(self): - logging.info("Release") - - def get_device_name(self, device): - bus = dbus.SystemBus() - device_proxy = bus.get_object("org.bluez", device) - device_properties = dbus.Interface(device_proxy, "org.freedesktop.DBus.Properties") - return device_properties.Get("org.bluez.Device1", "Name") - - @dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="") - def RequestPinCode(self, device): - device_name = self.get_device_name(device) - logging.info(f"RequestPinCode {device_name} ({device})") - self.request_input("Enter PIN code", f"Enter PIN code for device {device_name}", device, "pin") - - @dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="u") - def RequestPasskey(self, device): - device_name = self.get_device_name(device) - logging.info(f"RequestPasskey {device_name} ({device})") - self.request_input("Enter Passkey", f"Enter passkey for device {device_name}", device, "passkey") - - @dbus.service.method("org.bluez.Agent1", in_signature="ou", out_signature="") - def DisplayPasskey(self, device, passkey): - device_name = self.get_device_name(device) - logging.info(f"DisplayPasskey {device_name} passkey {passkey}") - send_notification_with_actions("Bluetooth Pairing Request", f"Passkey for device {device_name} is {passkey}", [], lambda *args: None) - - @dbus.service.method("org.bluez.Agent1", in_signature="ou", out_signature="") - def RequestConfirmation(self, device, passkey): - device_name = self.get_device_name(device) - logging.info(f"RequestConfirmation {device_name} passkey {passkey}") - actions = ["confirm", "Confirm", "deny", "Deny"] - - def action_handler(notification_id, action_key): - if action_key == "confirm": - logging.info(f"Confirmed pairing for {device_name}") - self.send_reply(device) - elif action_key == "deny": - logging.info(f"Denied pairing for {device_name}") - self.send_error(device, "org.bluez.Error.Rejected") - - send_notification_with_actions("Bluetooth Pairing Request", - f"Confirm passkey {passkey} for device {device_name}", - actions, action_handler) - return - - @dbus.service.method("org.bluez.Agent1", in_signature="o", out_signature="") - def RequestAuthorization(self, device): - device_name = self.get_device_name(device) - logging.info(f"RequestAuthorization {device_name}") - actions = ["confirm", "Confirm", "deny", "Deny"] - - def action_handler(notification_id, action_key): - if action_key == "confirm": - logging.info(f"Authorized device {device_name}") - self.send_reply(device) - elif action_key == "deny": - logging.info(f"Denied authorization for {device_name}") - self.send_error(device, "org.bluez.Error.Rejected") - - send_notification_with_actions("Bluetooth Service Authorization", - f"Authorize device {device_name}", - actions, action_handler) - return - - @dbus.service.method("org.bluez.Agent1", in_signature="os", out_signature="") - def AuthorizeService(self, device, uuid): - device_name = self.get_device_name(device) - logging.info(f"AuthorizeService {device_name} uuid {uuid}") - actions = ["confirm", "Confirm", "deny", "Deny"] - - def action_handler(notification_id, action_key): - if action_key == "confirm": - logging.info(f"Authorized service {uuid} for device {device_name}") - self.send_reply(device) - elif action_key == "deny": - logging.info(f"Denied authorization for service {uuid} on device {device_name}") - self.send_error(device, "org.bluez.Error.Rejected") - - send_notification_with_actions("Bluetooth Service Authorization", - f"Authorize service {uuid} for device {device_name}", - actions, action_handler) - return - - @dbus.service.method("org.bluez.Agent1", in_signature="", out_signature="") - def Cancel(self): - logging.info("Cancel") - - def request_input(self, title, message, device, input_type): - def action_handler(notification_id, action_key): - if action_key == "input": - result = subprocess.run(["zenity", "--entry", "--title", title, "--text", message], capture_output=True, text=True) - user_input = result.stdout.strip() - if input_type == "pin": - self.handle_pin_input(device, user_input) - elif input_type == "passkey": - self.handle_passkey_input(device, user_input) - elif action_key == "cancel": - self.send_error(device, "org.bluez.Error.Rejected") - - actions = ["input", "Enter", "cancel", "Cancel"] - send_notification_with_actions(title, message, actions, action_handler) - - def handle_pin_input(self, device, pin_code): - logging.info(f"PIN code entered for {device}: {pin_code}") - self.send_reply(device) - - def handle_passkey_input(self, device, passkey): - logging.info(f"Passkey entered for {device}: {passkey}") - self.send_reply(device) - - def send_reply(self, device): - logging.info(f"Sending reply for {device}") - bus = dbus.SystemBus() - agent = bus.get_object("org.bluez", device) - agent_interface = dbus.Interface(agent, "org.bluez.Device1") - agent_interface.Pair(reply_handler=self.success_callback, error_handler=self.error_callback) - - def send_error(self, device, error): - logging.info(f"Sending error for {device}") - bus = dbus.SystemBus() - agent = bus.get_object("org.bluez", device) - agent_interface = dbus.Interface(agent, "org.bluez.Device1") - agent_interface.CancelPairing(reply_handler=self.success_callback, error_handler=self.error_callback) - - def success_callback(self): - logging.info("Operation succeeded") - - def error_callback(self, error): - logging.error(f"Operation failed: {error}") - -def register_agent(): - bus = dbus.SystemBus() - manager = dbus.Interface(bus.get_object("org.bluez", "/org/bluez"), "org.bluez.AgentManager1") - path = AGENT_PATH - agent = Agent(bus) - manager.RegisterAgent(path, CAPABILITY) - manager.RequestDefaultAgent(path) - logging.info("Agent registered") - -if __name__ == "__main__": - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - register_agent() - loop = GLib.MainLoop() - loop.run() diff --git a/ags/HyprPanel/services/matugen/index.ts b/ags/HyprPanel/services/matugen/index.ts deleted file mode 100644 index e39c3cb..0000000 --- a/ags/HyprPanel/services/matugen/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { defaultColorMap } from 'lib/types/defaults/options'; -import { ColorMapValue, ColorMapKey, HexColor, MatugenColors } from 'lib/types/options'; -import { getMatugenVariations } from './variations'; -import { bash, dependencies, Notify, isAnImage } from 'lib/utils'; -import options from 'options'; -import icons from 'lib/icons'; -import { Variable } from 'types/variable'; -const { scheme_type, contrast } = options.theme.matugen_settings; -const { matugen } = options.theme; - -const updateOptColor = (color: HexColor, opt: Variable): void => { - opt.value = color; -}; - -export async function generateMatugenColors(): Promise { - if (!matugen.value || !dependencies('matugen')) { - return; - } - const wallpaperPath = options.wallpaper.image.value; - - try { - if (!wallpaperPath.length || !isAnImage(wallpaperPath)) { - Notify({ - summary: 'Matugen Failed', - body: "Please select a wallpaper in 'Theming > General' first.", - iconName: icons.ui.warning, - timeout: 7000, - }); - return; - } - - const normalizedContrast = contrast.value > 1 ? 1 : contrast.value < -1 ? -1 : contrast.value; - const contents = await bash( - `matugen image ${wallpaperPath} -t scheme-${scheme_type.value} --contrast ${normalizedContrast} --json hex`, - ); - - return JSON.parse(contents).colors[options.theme.matugen_settings.mode.value]; - } catch (error) { - const errMsg = `An error occurred while generating matugen colors: ${error}`; - console.error(errMsg); - return; - } -} - -const isColorValid = (color: string): color is ColorMapKey => { - return defaultColorMap.hasOwnProperty(color); -}; - -export const replaceHexValues = (incomingHex: HexColor, matugenColors: MatugenColors): HexColor => { - if (!options.theme.matugen.value) { - return incomingHex; - } - - const matugenVariation = getMatugenVariations(matugenColors, options.theme.matugen_settings.variation.value); - updateOptColor(matugenVariation.base, options.theme.bar.menus.menu.media.card.color as Variable); - - for (const curColor of Object.keys(defaultColorMap)) { - const currentColor: string = curColor; - if (!isColorValid(currentColor)) { - continue; - } - - const curColorValue: ColorMapValue = defaultColorMap[currentColor]; - if (curColorValue === incomingHex) { - return matugenVariation[currentColor]; - } - } - - return incomingHex; -}; diff --git a/ags/HyprPanel/services/matugen/variations.ts b/ags/HyprPanel/services/matugen/variations.ts deleted file mode 100644 index 7daba85..0000000 --- a/ags/HyprPanel/services/matugen/variations.ts +++ /dev/null @@ -1,570 +0,0 @@ -import { MatugenColors, MatugenVariation, MatugenVariations } from 'lib/types/options'; - -/* - * NOTE: This maps the values of the default colors to the values generated by Matugen. - * Each of the variations are carefully tested and curated to make sure that colors don't - * have weird luminocity overlaps (light on light, dark on dark). - */ -export const getMatugenVariations = (matugenColors: MatugenColors, variation: MatugenVariations): MatugenVariation => { - const matVtns = { - standard_1: { - rosewater: matugenColors.secondary, - flamingo: matugenColors.secondary, - pink: matugenColors.tertiary, - mauve: matugenColors.primary, - red: matugenColors.tertiary, - maroon: matugenColors.primary, - peach: matugenColors.tertiary, - yellow: matugenColors.secondary, - green: matugenColors.primary, - teal: matugenColors.secondary, - sky: matugenColors.secondary, - sapphire: matugenColors.primary, - blue: matugenColors.primary, - lavender: matugenColors.primary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.primary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.tertiary, - peach2: matugenColors.tertiary, - pink2: matugenColors.tertiary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - overlay1_2: matugenColors.outline, - text2: matugenColors.on_background, - lavender2: matugenColors.primary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.primary, - mauve2: matugenColors.primary, - green2: matugenColors.primary, - surface2_2: matugenColors.surface, - sky2: matugenColors.secondary, - teal2: matugenColors.secondary, - yellow2: matugenColors.secondary, - pink3: matugenColors.tertiary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.primary, - mauve3: matugenColors.primary, - green3: matugenColors.primary, - sky3: matugenColors.secondary, - teal3: matugenColors.secondary, - yellow3: matugenColors.secondary, - maroon3: matugenColors.primary, - crust3: matugenColors.surface_dim, - }, - standard_2: { - rosewater: matugenColors.primary, - flamingo: matugenColors.primary, - pink: matugenColors.tertiary, - mauve: matugenColors.secondary, - red: matugenColors.tertiary, - maroon: matugenColors.secondary, - peach: matugenColors.tertiary, - yellow: matugenColors.primary, - green: matugenColors.secondary, - teal: matugenColors.primary, - sky: matugenColors.primary, - sapphire: matugenColors.secondary, - blue: matugenColors.secondary, - lavender: matugenColors.secondary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.tertiary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.tertiary, - peach2: matugenColors.tertiary, - pink2: matugenColors.tertiary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - overlay1_2: matugenColors.outline, - text2: matugenColors.on_background, - lavender2: matugenColors.secondary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.secondary, - surface2_2: matugenColors.surface, - mauve2: matugenColors.secondary, - green2: matugenColors.secondary, - sky2: matugenColors.primary, - teal2: matugenColors.primary, - yellow2: matugenColors.primary, - pink3: matugenColors.tertiary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.secondary, - mauve3: matugenColors.secondary, - green3: matugenColors.secondary, - sky3: matugenColors.primary, - teal3: matugenColors.primary, - yellow3: matugenColors.primary, - maroon3: matugenColors.secondary, - crust3: matugenColors.surface_dim, - }, - standard_3: { - rosewater: matugenColors.secondary, - flamingo: matugenColors.secondary, - pink: matugenColors.secondary, - mauve: matugenColors.primary, - red: matugenColors.secondary, - maroon: matugenColors.primary, - peach: matugenColors.secondary, - yellow: matugenColors.secondary, - green: matugenColors.primary, - teal: matugenColors.secondary, - sky: matugenColors.secondary, - sapphire: matugenColors.primary, - blue: matugenColors.primary, - lavender: matugenColors.primary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.secondary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.secondary, - peach2: matugenColors.secondary, - pink2: matugenColors.secondary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - surface2_2: matugenColors.surface, - overlay1_2: matugenColors.outline, - text2: matugenColors.on_background, - lavender2: matugenColors.primary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.primary, - mauve2: matugenColors.primary, - green2: matugenColors.primary, - sky2: matugenColors.secondary, - teal2: matugenColors.secondary, - yellow2: matugenColors.secondary, - pink3: matugenColors.secondary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.primary, - mauve3: matugenColors.primary, - green3: matugenColors.primary, - sky3: matugenColors.secondary, - teal3: matugenColors.secondary, - yellow3: matugenColors.secondary, - maroon3: matugenColors.primary, - crust3: matugenColors.surface_dim, - }, - vivid_1: { - rosewater: matugenColors.surface, - flamingo: matugenColors.surface, - pink: matugenColors.surface, - mauve: matugenColors.surface, - red: matugenColors.surface, - maroon: matugenColors.surface, - peach: matugenColors.surface, - yellow: matugenColors.surface, - green: matugenColors.surface, - teal: matugenColors.surface, - sky: matugenColors.surface, - sapphire: matugenColors.surface, - blue: matugenColors.surface, - lavender: matugenColors.surface, - text: matugenColors.surface, - subtext1: matugenColors.primary_container, - subtext2: matugenColors.primary_container, - overlay2: matugenColors.primary_container, - overlay1: matugenColors.primary_container, - overlay0: matugenColors.primary_container, - surface2: matugenColors.surface_container_high, - surface1: matugenColors.surface_container_high, - surface0: matugenColors.surface_container_high, - base2: matugenColors.primary, - base: matugenColors.primary, - mantle: matugenColors.surface_container_low, - crust: matugenColors.surface_container_lowest, - red2: matugenColors.primary_container, - peach2: matugenColors.primary_container, - pink2: matugenColors.primary_container, - mantle2: matugenColors.primary, - surface1_2: matugenColors.primary, - surface0_2: matugenColors.primary, - overlay1_2: matugenColors.surface_container_high, - text2: matugenColors.outline, - lavender2: matugenColors.primary_container, - crust2: matugenColors.primary, - maroon2: matugenColors.primary_container, - mauve2: matugenColors.primary_container, - surface2_2: matugenColors.primary_container, - green2: matugenColors.primary_container, - sky2: matugenColors.primary_container, - teal2: matugenColors.primary_container, - yellow2: matugenColors.primary_container, - pink3: matugenColors.primary_fixed, - red3: matugenColors.secondary, - mantle3: matugenColors.primary, - surface0_3: matugenColors.primary, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.primary, - lavender3: matugenColors.primary, - mauve3: matugenColors.primary, - green3: matugenColors.primary_fixed, - sky3: matugenColors.primary, - teal3: matugenColors.primary, - yellow3: matugenColors.primary_fixed, - maroon3: matugenColors.primary_fixed, - crust3: matugenColors.primary, - }, - vivid_2: { - rosewater: matugenColors.surface, - flamingo: matugenColors.surface, - pink: matugenColors.surface, - mauve: matugenColors.surface, - red: matugenColors.surface, - maroon: matugenColors.surface, - peach: matugenColors.surface, - yellow: matugenColors.surface, - green: matugenColors.surface, - teal: matugenColors.surface, - sky: matugenColors.surface, - sapphire: matugenColors.surface, - blue: matugenColors.surface, - lavender: matugenColors.surface, - text: matugenColors.surface, - subtext1: matugenColors.secondary_container, - subtext2: matugenColors.secondary_container, - overlay2: matugenColors.secondary_container, - overlay1: matugenColors.secondary_container, - overlay0: matugenColors.secondary_container, - surface2: matugenColors.surface_container_high, - surface1: matugenColors.surface_container_high, - surface0: matugenColors.surface_container_high, - base2: matugenColors.secondary, - base: matugenColors.secondary, - mantle: matugenColors.surface_container_low, - crust: matugenColors.surface_container_lowest, - red2: matugenColors.secondary_container, - peach2: matugenColors.secondary_container, - pink2: matugenColors.secondary_container, - surface2_2: matugenColors.primary_container, - mantle2: matugenColors.secondary, - surface1_2: matugenColors.secondary, - surface0_2: matugenColors.secondary, - overlay1_2: matugenColors.surface_container_high, - text2: matugenColors.outline, - lavender2: matugenColors.secondary_container, - crust2: matugenColors.secondary, - maroon2: matugenColors.secondary_container, - mauve2: matugenColors.secondary_container, - green2: matugenColors.secondary_container, - sky2: matugenColors.secondary_container, - teal2: matugenColors.secondary_container, - yellow2: matugenColors.secondary_container, - pink3: matugenColors.secondary_fixed, - red3: matugenColors.secondary, - mantle3: matugenColors.secondary, - surface0_3: matugenColors.secondary, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.secondary, - lavender3: matugenColors.secondary, - mauve3: matugenColors.secondary, - green3: matugenColors.secondary_fixed, - sky3: matugenColors.secondary, - teal3: matugenColors.secondary, - yellow3: matugenColors.secondary_fixed, - maroon3: matugenColors.secondary_fixed, - crust3: matugenColors.secondary, - }, - vivid_3: { - rosewater: matugenColors.surface, - flamingo: matugenColors.surface, - pink: matugenColors.surface, - mauve: matugenColors.surface, - red: matugenColors.surface, - maroon: matugenColors.surface, - peach: matugenColors.surface, - yellow: matugenColors.surface, - green: matugenColors.surface, - teal: matugenColors.surface, - sky: matugenColors.surface, - sapphire: matugenColors.surface, - blue: matugenColors.surface, - lavender: matugenColors.surface, - text: matugenColors.surface, - subtext1: matugenColors.tertiary_container, - subtext2: matugenColors.tertiary_container, - overlay2: matugenColors.tertiary_container, - overlay1: matugenColors.tertiary_container, - overlay0: matugenColors.tertiary_container, - surface2: matugenColors.surface_container_high, - surface1: matugenColors.surface_container_high, - surface0: matugenColors.surface_container_high, - base2: matugenColors.tertiary, - base: matugenColors.tertiary, - mantle: matugenColors.surface_container_low, - crust: matugenColors.surface_container_lowest, - red2: matugenColors.tertiary_container, - peach2: matugenColors.tertiary_container, - pink2: matugenColors.tertiary_container, - mantle2: matugenColors.tertiary, - surface1_2: matugenColors.tertiary, - surface0_2: matugenColors.tertiary, - overlay1_2: matugenColors.surface_container_high, - text2: matugenColors.outline, - lavender2: matugenColors.tertiary_container, - surface2_2: matugenColors.primary_container, - crust2: matugenColors.tertiary, - maroon2: matugenColors.tertiary_container, - mauve2: matugenColors.tertiary_container, - green2: matugenColors.tertiary_container, - sky2: matugenColors.tertiary_container, - teal2: matugenColors.tertiary_container, - yellow2: matugenColors.tertiary_container, - pink3: matugenColors.tertiary_fixed, - red3: matugenColors.secondary, - mantle3: matugenColors.tertiary, - surface0_3: matugenColors.tertiary, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.tertiary, - lavender3: matugenColors.tertiary, - mauve3: matugenColors.tertiary, - green3: matugenColors.tertiary_fixed, - sky3: matugenColors.tertiary, - teal3: matugenColors.tertiary, - yellow3: matugenColors.tertiary_fixed, - maroon3: matugenColors.tertiary_fixed, - crust3: matugenColors.tertiary, - }, - monochrome_1: { - rosewater: matugenColors.primary, - flamingo: matugenColors.primary, - pink: matugenColors.primary, - mauve: matugenColors.primary, - red: matugenColors.primary, - maroon: matugenColors.primary, - peach: matugenColors.primary, - yellow: matugenColors.primary, - green: matugenColors.primary, - teal: matugenColors.primary, - sky: matugenColors.primary, - sapphire: matugenColors.primary, - blue: matugenColors.primary, - lavender: matugenColors.primary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.primary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.primary, - peach2: matugenColors.primary, - pink2: matugenColors.primary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - surface2_2: matugenColors.surface, - overlay1_2: matugenColors.outline, - text2: matugenColors.on_background, - lavender2: matugenColors.primary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.primary, - mauve2: matugenColors.primary, - green2: matugenColors.primary, - sky2: matugenColors.primary, - teal2: matugenColors.primary, - yellow2: matugenColors.primary, - pink3: matugenColors.primary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.primary, - mauve3: matugenColors.primary, - green3: matugenColors.primary, - sky3: matugenColors.primary, - teal3: matugenColors.primary, - yellow3: matugenColors.primary, - maroon3: matugenColors.primary, - crust3: matugenColors.surface_dim, - }, - monochrome_2: { - rosewater: matugenColors.secondary, - flamingo: matugenColors.secondary, - pink: matugenColors.secondary, - mauve: matugenColors.secondary, - red: matugenColors.secondary, - maroon: matugenColors.secondary, - peach: matugenColors.secondary, - yellow: matugenColors.secondary, - green: matugenColors.secondary, - teal: matugenColors.secondary, - sky: matugenColors.secondary, - sapphire: matugenColors.secondary, - blue: matugenColors.secondary, - lavender: matugenColors.secondary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.secondary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.secondary, - peach2: matugenColors.secondary, - pink2: matugenColors.secondary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - overlay1_2: matugenColors.outline, - surface2_2: matugenColors.surface, - text2: matugenColors.on_background, - lavender2: matugenColors.secondary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.secondary, - mauve2: matugenColors.secondary, - green2: matugenColors.secondary, - sky2: matugenColors.secondary, - teal2: matugenColors.secondary, - yellow2: matugenColors.secondary, - pink3: matugenColors.secondary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.secondary, - mauve3: matugenColors.secondary, - green3: matugenColors.secondary, - sky3: matugenColors.secondary, - teal3: matugenColors.secondary, - yellow3: matugenColors.secondary, - maroon3: matugenColors.secondary, - crust3: matugenColors.surface_dim, - }, - monochrome_3: { - rosewater: matugenColors.tertiary, - flamingo: matugenColors.tertiary, - pink: matugenColors.tertiary, - mauve: matugenColors.tertiary, - red: matugenColors.tertiary, - maroon: matugenColors.tertiary, - peach: matugenColors.tertiary, - yellow: matugenColors.tertiary, - green: matugenColors.tertiary, - teal: matugenColors.tertiary, - sky: matugenColors.tertiary, - sapphire: matugenColors.tertiary, - blue: matugenColors.tertiary, - lavender: matugenColors.tertiary, - text: matugenColors.on_background, - subtext1: matugenColors.outline, - subtext2: matugenColors.outline, - overlay2: matugenColors.outline, - overlay1: matugenColors.outline, - overlay0: matugenColors.outline, - surface2: matugenColors.outline, - surface1: matugenColors.surface_bright, - surface0: matugenColors.surface_bright, - base2: matugenColors.inverse_on_surface, - base: matugenColors.inverse_on_surface, - mantle: matugenColors.surface_dim, - crust: matugenColors.surface_dim, - notifications_closer: matugenColors.tertiary, - notifications_background: matugenColors.surface_dim, - dashboard_btn_text: matugenColors.surface_dim, - red2: matugenColors.tertiary, - peach2: matugenColors.tertiary, - pink2: matugenColors.tertiary, - mantle2: matugenColors.surface_dim, - surface1_2: matugenColors.inverse_on_surface, - surface0_2: matugenColors.surface_bright, - overlay1_2: matugenColors.outline, - text2: matugenColors.on_background, - lavender2: matugenColors.tertiary, - crust2: matugenColors.surface_dim, - maroon2: matugenColors.tertiary, - surface2_2: matugenColors.surface, - mauve2: matugenColors.tertiary, - green2: matugenColors.tertiary, - sky2: matugenColors.tertiary, - teal2: matugenColors.tertiary, - yellow2: matugenColors.tertiary, - pink3: matugenColors.tertiary, - red3: matugenColors.secondary, - mantle3: matugenColors.inverse_on_surface, - surface0_3: matugenColors.outline, - surface2_3: matugenColors.outline, - overlay1_3: matugenColors.outline, - lavender3: matugenColors.tertiary, - mauve3: matugenColors.tertiary, - green3: matugenColors.tertiary, - sky3: matugenColors.tertiary, - teal3: matugenColors.tertiary, - yellow3: matugenColors.tertiary, - maroon3: matugenColors.tertiary, - crust3: matugenColors.surface_dim, - }, - }; - return matVtns[variation]; -}; diff --git a/ags/HyprPanel/services/screen_record.sh b/ags/HyprPanel/services/screen_record.sh deleted file mode 100755 index d3aff6d..0000000 --- a/ags/HyprPanel/services/screen_record.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash - -outputDir="$HOME/Videos/Screencasts" - -checkRecording() { - if pgrep -f "gpu-screen-recorder" >/dev/null; then - return 0 - else - return 1 - fi -} - -startRecording() { - if checkRecording; then - echo "A recording is already in progress." - exit 1 - fi - - target="$2" - - outputFile="recording_$(date +%Y-%m-%d_%H-%M-%S).mp4" - outputPath="$outputDir/$outputFile" - mkdir -p "$outputDir" - - if [ -z "$target" ]; then - echo "Usage: $0 start screen [screen_name]" - exit 1 - fi - - GPU_TYPE=$(lspci | grep -E 'VGA|3D' | grep -Ev '00:02.0|Integrated' > /dev/null && echo "" || echo "-encoder cpu") - - gpu-screen-recorder -w "$target" -f 60 -a "$(pactl get-default-sink).monitor" -o "$outputPath" $GPU_TYPE & - - echo "Recording started. Output will be saved to $outputPath" -} - -stopRecording() { - if ! checkRecording; then - echo "No recording is in progress." - exit 1 - fi - - pkill -f gpu-screen-recorder - recentFile=$(ls -t "$outputDir"/recording_*.mp4 | head -n 1) - notify-send "Recording stopped" "Your recording has been saved." \ - -i video-x-generic \ - -a "Screen Recorder" \ - -t 10000 \ - -u normal \ - --action="scriptAction:-xdg-open $outputDir=Directory" \ - --action="scriptAction:-xdg-open $recentFile=Play" -} - -case "$1" in -start) - startRecording "$@" - ;; -stop) - stopRecording - ;; -status) - if checkRecording; then - echo "recording" - else - echo "not recording" - fi - ;; -*) - echo "Usage: $0 {start [screen_name|window_id]|stop|status}" - exit 1 - ;; -esac diff --git a/ags/HyprPanel/services/snapshot.sh b/ags/HyprPanel/services/snapshot.sh deleted file mode 100755 index 0aa0697..0000000 --- a/ags/HyprPanel/services/snapshot.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -outputDir="$HOME/Pictures/Screenshots/" -outputFile="snapshot_$(date +%Y-%m-%d_%H-%M-%S).png" -outputPath="$outputDir/$outputFile" -mkdir -p "$outputDir" - -mode=${1:-area} - -case "$mode" in -active) - command="grimblast copysave active $outputPath" - ;; -output) - command="grimblast copysave output $outputPath" - ;; -area) - command="grimblast copysave area $outputPath" - ;; -*) - echo "Invalid option: $mode" - echo "Usage: $0 {active|output|area}" - exit 1 - ;; -esac - -if eval "$command"; then - recentFile=$(find "$outputDir" -name 'snapshot_*.png' -printf '%T+ %p\n' | sort -r | head -n 1 | cut -d' ' -f2-) - notify-send "Grimblast" "Your snapshot has been saved." \ - -i video-x-generic \ - -a "Grimblast" \ - -t 7000 \ - -u normal \ - --action="scriptAction:-xdg-open $outputDir=Directory" \ - --action="scriptAction:-xdg-open $recentFile=View" -fi diff --git a/ags/HyprPanel/themes/catppuccin_frappe.json b/ags/HyprPanel/themes/catppuccin_frappe.json deleted file mode 100644 index a59a4a0..0000000 --- a/ags/HyprPanel/themes/catppuccin_frappe.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#232634", - "theme.bar.background": "#232634", - "theme.bar.buttons.media.icon": "#babbf1", - "theme.bar.buttons.media.text": "#babbf1", - "theme.bar.buttons.icon": "#babbf1", - "theme.bar.buttons.text": "#babbf1", - "theme.bar.buttons.hover": "#51576d", - "theme.bar.buttons.background": "#303446", - "theme.bar.menus.text": "#c6d0f5", - "theme.bar.menus.border.color": "#414559", - "theme.bar.buttons.media.background": "#303446", - "theme.bar.menus.menu.volume.text": "#c6d0f5", - "theme.bar.menus.menu.volume.card.color": "#292c3c", - "theme.bar.menus.menu.volume.label.color": "#ea999c", - "theme.bar.menus.popover.text": "#babbf1", - "theme.bar.menus.popover.background": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e78284", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e78284", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6d189", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#c6d0f5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#babbf1", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#414559", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#292c3c", - "theme.bar.menus.menu.notifications.switch.puck": "#51576d", - "theme.bar.menus.menu.notifications.switch.disabled": "#414559", - "theme.bar.menus.menu.notifications.switch.enabled": "#babbf1", - "theme.bar.menus.menu.notifications.clear": "#e78284", - "theme.bar.menus.menu.notifications.switch_divider": "#51576d", - "theme.bar.menus.menu.notifications.border": "#414559", - "theme.bar.menus.menu.notifications.card": "#292c3c", - "theme.bar.menus.menu.notifications.background": "#232634", - "theme.bar.menus.menu.notifications.no_notifications_label": "#414559", - "theme.bar.menus.menu.notifications.label": "#babbf1", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#51576d", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#babbf1", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#ca9ee6", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#81c8be", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ea999c", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e5c890", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f4b8e4", - "theme.bar.menus.menu.dashboard.controls.input.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f4b8e4", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ea999c", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e5c890", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#99d1db", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#ca9ee6", - "theme.bar.menus.menu.dashboard.controls.disabled": "#626880", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6d189", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#232634", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#babbf1", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#99d1db", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6d189", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ef9f76", - "theme.bar.menus.menu.dashboard.profile.name": "#f4b8e4", - "theme.bar.menus.menu.dashboard.border.color": "#414559", - "theme.bar.menus.menu.dashboard.background.color": "#232634", - "theme.bar.menus.menu.dashboard.card.color": "#292c3c", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#99d1db", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8caaee", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#babbf1", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ef9f76", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e78284", - "theme.bar.menus.menu.clock.weather.stats": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.status": "#81c8be", - "theme.bar.menus.menu.clock.weather.temperature": "#c6d0f5", - "theme.bar.menus.menu.clock.weather.icon": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.contextdays": "#626880", - "theme.bar.menus.menu.clock.calendar.days": "#c6d0f5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.paginator": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#81c8be", - "theme.bar.menus.menu.clock.time.timeperiod": "#81c8be", - "theme.bar.menus.menu.clock.time.time": "#f4b8e4", - "theme.bar.menus.menu.clock.text": "#c6d0f5", - "theme.bar.menus.menu.clock.border.color": "#414559", - "theme.bar.menus.menu.clock.background.color": "#232634", - "theme.bar.menus.menu.clock.card.color": "#292c3c", - "theme.bar.menus.menu.battery.slider.puck": "#737994", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.battery.slider.background": "#626880", - "theme.bar.menus.menu.battery.slider.primary": "#e5c890", - "theme.bar.menus.menu.battery.icons.active": "#e5c890", - "theme.bar.menus.menu.battery.icons.passive": "#949cbb", - "theme.bar.menus.menu.battery.listitems.active": "#e5c890", - "theme.bar.menus.menu.battery.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.battery.text": "#c6d0f5", - "theme.bar.menus.menu.battery.label.color": "#e5c890", - "theme.bar.menus.menu.battery.border.color": "#414559", - "theme.bar.menus.menu.battery.background.color": "#232634", - "theme.bar.menus.menu.battery.card.color": "#292c3c", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#292c3c", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#c6d0f5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#232634", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.icons.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.icons.passive": "#949cbb", - "theme.bar.menus.menu.bluetooth.listitems.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#51576d", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#414559", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#99d1db", - "theme.bar.menus.menu.bluetooth.switch_divider": "#51576d", - "theme.bar.menus.menu.bluetooth.status": "#737994", - "theme.bar.menus.menu.bluetooth.text": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.label.color": "#99d1db", - "theme.bar.menus.menu.bluetooth.border.color": "#414559", - "theme.bar.menus.menu.bluetooth.background.color": "#232634", - "theme.bar.menus.menu.bluetooth.card.color": "#292c3c", - "theme.bar.menus.menu.network.iconbuttons.active": "#ca9ee6", - "theme.bar.menus.menu.network.iconbuttons.passive": "#c6d0f5", - "theme.bar.menus.menu.network.icons.active": "#ca9ee6", - "theme.bar.menus.menu.network.icons.passive": "#949cbb", - "theme.bar.menus.menu.network.listitems.active": "#ca9ee6", - "theme.bar.menus.menu.network.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.network.status.color": "#737994", - "theme.bar.menus.menu.network.text": "#c6d0f5", - "theme.bar.menus.menu.network.label.color": "#ca9ee6", - "theme.bar.menus.menu.network.border.color": "#414559", - "theme.bar.menus.menu.network.background.color": "#232634", - "theme.bar.menus.menu.network.card.color": "#292c3c", - "theme.bar.menus.menu.volume.input_slider.puck": "#626880", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.volume.input_slider.background": "#626880", - "theme.bar.menus.menu.volume.input_slider.primary": "#ea999c", - "theme.bar.menus.menu.volume.audio_slider.puck": "#626880", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.volume.audio_slider.background": "#626880", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ea999c", - "theme.bar.menus.menu.volume.icons.active": "#ea999c", - "theme.bar.menus.menu.volume.icons.passive": "#949cbb", - "theme.bar.menus.menu.volume.iconbutton.active": "#ea999c", - "theme.bar.menus.menu.volume.iconbutton.passive": "#c6d0f5", - "theme.bar.menus.menu.volume.listitems.active": "#ea999c", - "theme.bar.menus.menu.volume.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.volume.border.color": "#414559", - "theme.bar.menus.menu.volume.background.color": "#232634", - "theme.bar.menus.menu.media.slider.puck": "#737994", - "theme.bar.menus.menu.media.slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.media.slider.background": "#626880", - "theme.bar.menus.menu.media.slider.primary": "#f4b8e4", - "theme.bar.menus.menu.media.buttons.text": "#232634", - "theme.bar.menus.menu.media.buttons.background": "#babbf1", - "theme.bar.menus.menu.media.buttons.enabled": "#81c8be", - "theme.bar.menus.menu.media.buttons.inactive": "#626880", - "theme.bar.menus.menu.media.border.color": "#414559", - "theme.bar.menus.menu.media.background.color": "#232634", - "theme.bar.menus.menu.media.album": "#f4b8e4", - "theme.bar.menus.menu.media.artist": "#81c8be", - "theme.bar.menus.menu.media.song": "#babbf1", - "theme.bar.menus.tooltip.text": "#c6d0f5", - "theme.bar.menus.tooltip.background": "#232634", - "theme.bar.menus.dropdownmenu.divider": "#292c3c", - "theme.bar.menus.dropdownmenu.text": "#c6d0f5", - "theme.bar.menus.dropdownmenu.background": "#232634", - "theme.bar.menus.slider.puck": "#737994", - "theme.bar.menus.slider.backgroundhover": "#51576d", - "theme.bar.menus.slider.background": "#626880", - "theme.bar.menus.slider.primary": "#babbf1", - "theme.bar.menus.progressbar.background": "#51576d", - "theme.bar.menus.progressbar.foreground": "#babbf1", - "theme.bar.menus.iconbuttons.active": "#babbf1", - "theme.bar.menus.iconbuttons.passive": "#c6d0f5", - "theme.bar.menus.buttons.text": "#232634", - "theme.bar.menus.buttons.disabled": "#626880", - "theme.bar.menus.buttons.active": "#f4b8e4", - "theme.bar.menus.buttons.default": "#babbf1", - "theme.bar.menus.switch.puck": "#51576d", - "theme.bar.menus.switch.disabled": "#414559", - "theme.bar.menus.switch.enabled": "#babbf1", - "theme.bar.menus.icons.active": "#babbf1", - "theme.bar.menus.icons.passive": "#626880", - "theme.bar.menus.listitems.active": "#babbf1", - "theme.bar.menus.listitems.passive": "#c6d0f5", - "theme.bar.menus.label": "#babbf1", - "theme.bar.menus.feinttext": "#414559", - "theme.bar.menus.dimtext": "#626880", - "theme.bar.menus.cards": "#292c3c", - "theme.bar.buttons.notifications.total": "#babbf1", - "theme.bar.buttons.notifications.icon": "#babbf1", - "theme.bar.buttons.notifications.background": "#303446", - "theme.bar.buttons.clock.icon": "#f4b8e4", - "theme.bar.buttons.clock.text": "#f4b8e4", - "theme.bar.buttons.clock.background": "#303446", - "theme.bar.buttons.battery.icon": "#e5c890", - "theme.bar.buttons.battery.text": "#e5c890", - "theme.bar.buttons.battery.background": "#303446", - "theme.bar.buttons.systray.background": "#303446", - "theme.bar.buttons.bluetooth.icon": "#99d1db", - "theme.bar.buttons.bluetooth.text": "#99d1db", - "theme.bar.buttons.bluetooth.background": "#303446", - "theme.bar.buttons.network.icon": "#ca9ee6", - "theme.bar.buttons.network.text": "#ca9ee6", - "theme.bar.buttons.network.background": "#303446", - "theme.bar.buttons.volume.icon": "#ea999c", - "theme.bar.buttons.volume.text": "#ea999c", - "theme.bar.buttons.volume.background": "#303446", - "theme.bar.buttons.windowtitle.icon": "#f4b8e4", - "theme.bar.buttons.windowtitle.text": "#f4b8e4", - "theme.bar.buttons.windowtitle.background": "#303446", - "theme.bar.buttons.workspaces.active": "#f4b8e4", - "theme.bar.buttons.workspaces.occupied": "#eebebe", - "theme.bar.buttons.workspaces.available": "#99d1db", - "theme.bar.buttons.workspaces.hover": "#51576d", - "theme.bar.buttons.workspaces.background": "#303446", - "theme.bar.buttons.dashboard.icon": "#e5c890", - "theme.bar.buttons.dashboard.background": "#303446", - "theme.osd.label": "#babbf1", - "theme.osd.icon": "#232634", - "theme.osd.bar_overflow_color": "#e78284", - "theme.osd.bar_empty_color": "#414559", - "theme.osd.bar_color": "#babbf1", - "theme.osd.icon_container": "#babbf1", - "theme.osd.bar_container": "#232634", - "theme.notification.close_button.label": "#232634", - "theme.notification.close_button.background": "#e78284", - "theme.notification.labelicon": "#babbf1", - "theme.notification.text": "#c6d0f5", - "theme.notification.time": "#838ba7", - "theme.notification.border": "#414559", - "theme.notification.label": "#babbf1", - "theme.notification.actions.text": "#232634", - "theme.notification.actions.background": "#babbf1", - "theme.notification.background": "#232634", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#292c3c", - "theme.bar.menus.check_radio_button.background": "#232534", - "theme.bar.menus.check_radio_button.active": "#b9baf1", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#babbf1", - "theme.bar.menus.menu.notifications.scrollbar.color": "#babbf1", - "theme.bar.menus.menu.notifications.pager.label": "#949cbb", - "theme.bar.menus.menu.notifications.pager.background": "#232634", - "theme.bar.buttons.clock.icon_background": "#f4b8e4", - "theme.bar.buttons.modules.ram.icon": "#e5c890", - "theme.bar.buttons.modules.storage.icon_background": "#e78284", - "theme.bar.menus.popover.border": "#232634", - "theme.bar.buttons.volume.icon_background": "#ea999c", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#99d1db", - "theme.bar.menus.menu.power.buttons.restart.text": "#ef9f76", - "theme.bar.buttons.modules.updates.background": "#303446", - "theme.bar.buttons.modules.storage.icon": "#e78284", - "theme.bar.buttons.modules.netstat.background": "#303446", - "theme.bar.buttons.modules.weather.icon": "#babbf1", - "theme.bar.buttons.modules.netstat.text": "#a6d189", - "theme.bar.buttons.modules.storage.background": "#303446", - "theme.bar.buttons.modules.power.icon": "#e78284", - "theme.bar.buttons.modules.storage.text": "#e78284", - "theme.bar.buttons.modules.cpu.background": "#303446", - "theme.bar.menus.menu.power.border.color": "#414559", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.logout.icon": "#232634", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ef9f76", - "theme.bar.menus.menu.power.buttons.restart.icon": "#232634", - "theme.bar.buttons.modules.cpu.icon": "#e78284", - "theme.bar.buttons.battery.icon_background": "#e5c890", - "theme.bar.buttons.modules.kbLayout.icon_background": "#99d1db", - "theme.bar.buttons.modules.weather.text": "#babbf1", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#232634", - "theme.bar.menus.menu.power.buttons.sleep.text": "#99d1db", - "theme.bar.buttons.modules.weather.icon_background": "#babbf1", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#292c3c", - "theme.bar.buttons.media.icon_background": "#babbf1", - "theme.bar.menus.menu.power.buttons.logout.background": "#292c3c", - "theme.bar.buttons.modules.kbLayout.icon": "#99d1db", - "theme.bar.buttons.modules.ram.icon_background": "#e5c890", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e78284", - "theme.bar.menus.menu.power.buttons.sleep.background": "#292c3c", - "theme.bar.buttons.modules.ram.text": "#e5c890", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6d189", - "theme.bar.buttons.modules.updates.icon_background": "#ca9ee6", - "theme.bar.buttons.modules.kbLayout.background": "#303446", - "theme.bar.buttons.modules.power.background": "#303446", - "theme.bar.buttons.modules.weather.background": "#303446", - "theme.bar.buttons.icon_background": "#303446", - "theme.bar.menus.menu.power.background.color": "#232634", - "theme.bar.buttons.modules.ram.background": "#303446", - "theme.bar.buttons.modules.netstat.icon": "#a6d189", - "theme.bar.buttons.windowtitle.icon_background": "#f4b8e4", - "theme.bar.buttons.modules.cpu.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6d189", - "theme.bar.buttons.modules.updates.text": "#ca9ee6", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#232634", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#292c3c", - "theme.bar.buttons.modules.updates.icon": "#ca9ee6", - "theme.bar.buttons.modules.cpu.text": "#e78284", - "theme.bar.buttons.modules.netstat.icon_background": "#a6d189", - "theme.bar.buttons.modules.kbLayout.text": "#99d1db", - "theme.bar.buttons.notifications.icon_background": "#babbf1", - "theme.bar.buttons.modules.power.border": "#e78284", - "theme.bar.buttons.modules.weather.border": "#babbf1", - "theme.bar.buttons.modules.updates.border": "#ca9ee6", - "theme.bar.buttons.modules.kbLayout.border": "#99d1db", - "theme.bar.buttons.modules.netstat.border": "#a6d189", - "theme.bar.buttons.modules.storage.border": "#e78284", - "theme.bar.buttons.modules.cpu.border": "#e78284", - "theme.bar.buttons.modules.ram.border": "#e5c890", - "theme.bar.buttons.notifications.border": "#babbf1", - "theme.bar.buttons.clock.border": "#f4b8e4", - "theme.bar.buttons.battery.border": "#e5c890", - "theme.bar.buttons.systray.border": "#51576d", - "theme.bar.buttons.bluetooth.border": "#99d1db", - "theme.bar.buttons.network.border": "#ca9ee6", - "theme.bar.buttons.volume.border": "#ea999c", - "theme.bar.buttons.media.border": "#babbf1", - "theme.bar.buttons.windowtitle.border": "#f4b8e4", - "theme.bar.buttons.workspaces.border": "#232634", - "theme.bar.buttons.dashboard.border": "#e5c890", - "theme.bar.buttons.modules.submap.background": "#303446", - "theme.bar.buttons.modules.submap.text": "#81c8be", - "theme.bar.buttons.modules.submap.border": "#81c8be", - "theme.bar.buttons.modules.submap.icon": "#81c8be", - "theme.bar.buttons.modules.submap.icon_background": "#303446" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_frappe_split.json b/ags/HyprPanel/themes/catppuccin_frappe_split.json deleted file mode 100644 index 2eefc00..0000000 --- a/ags/HyprPanel/themes/catppuccin_frappe_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#232634", - "theme.bar.background": "#232634", - "theme.bar.buttons.media.icon": "#303446", - "theme.bar.buttons.media.text": "#babbf1", - "theme.bar.buttons.icon": "#babbf1", - "theme.bar.buttons.text": "#babbf1", - "theme.bar.buttons.hover": "#51576d", - "theme.bar.buttons.background": "#303446", - "theme.bar.menus.text": "#c6d0f5", - "theme.bar.menus.border.color": "#414559", - "theme.bar.buttons.media.background": "#303446", - "theme.bar.menus.menu.volume.text": "#c6d0f5", - "theme.bar.menus.menu.volume.card.color": "#292c3c", - "theme.bar.menus.menu.volume.label.color": "#ea999c", - "theme.bar.menus.popover.text": "#babbf1", - "theme.bar.menus.popover.background": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e78284", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e78284", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6d189", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#c6d0f5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#babbf1", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#414559", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#232634", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#292c3c", - "theme.bar.menus.menu.notifications.switch.puck": "#51576d", - "theme.bar.menus.menu.notifications.switch.disabled": "#414559", - "theme.bar.menus.menu.notifications.switch.enabled": "#babbf1", - "theme.bar.menus.menu.notifications.clear": "#e78284", - "theme.bar.menus.menu.notifications.switch_divider": "#51576d", - "theme.bar.menus.menu.notifications.border": "#414559", - "theme.bar.menus.menu.notifications.card": "#292c3c", - "theme.bar.menus.menu.notifications.background": "#232634", - "theme.bar.menus.menu.notifications.no_notifications_label": "#414559", - "theme.bar.menus.menu.notifications.label": "#babbf1", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f4b8e4", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6d189", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e5c890", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ea999c", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#51576d", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#babbf1", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#ca9ee6", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#81c8be", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ea999c", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e5c890", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f4b8e4", - "theme.bar.menus.menu.dashboard.controls.input.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f4b8e4", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ea999c", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e5c890", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#99d1db", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#232634", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#ca9ee6", - "theme.bar.menus.menu.dashboard.controls.disabled": "#626880", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6d189", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#232634", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#babbf1", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#99d1db", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6d189", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ef9f76", - "theme.bar.menus.menu.dashboard.profile.name": "#f4b8e4", - "theme.bar.menus.menu.dashboard.border.color": "#414559", - "theme.bar.menus.menu.dashboard.background.color": "#232634", - "theme.bar.menus.menu.dashboard.card.color": "#292c3c", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#99d1db", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8caaee", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#babbf1", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ef9f76", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e78284", - "theme.bar.menus.menu.clock.weather.stats": "#f4b8e4", - "theme.bar.menus.menu.clock.weather.status": "#81c8be", - "theme.bar.menus.menu.clock.weather.temperature": "#c6d0f5", - "theme.bar.menus.menu.clock.weather.icon": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.contextdays": "#626880", - "theme.bar.menus.menu.clock.calendar.days": "#c6d0f5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.paginator": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f4b8e4", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#81c8be", - "theme.bar.menus.menu.clock.time.timeperiod": "#81c8be", - "theme.bar.menus.menu.clock.time.time": "#f4b8e4", - "theme.bar.menus.menu.clock.text": "#c6d0f5", - "theme.bar.menus.menu.clock.border.color": "#414559", - "theme.bar.menus.menu.clock.background.color": "#232634", - "theme.bar.menus.menu.clock.card.color": "#292c3c", - "theme.bar.menus.menu.battery.slider.puck": "#737994", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.battery.slider.background": "#626880", - "theme.bar.menus.menu.battery.slider.primary": "#e5c890", - "theme.bar.menus.menu.battery.icons.active": "#e5c890", - "theme.bar.menus.menu.battery.icons.passive": "#949cbb", - "theme.bar.menus.menu.battery.listitems.active": "#e5c890", - "theme.bar.menus.menu.battery.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.battery.text": "#c6d0f5", - "theme.bar.menus.menu.battery.label.color": "#e5c890", - "theme.bar.menus.menu.battery.border.color": "#414559", - "theme.bar.menus.menu.battery.background.color": "#232634", - "theme.bar.menus.menu.battery.card.color": "#292c3c", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#292c3c", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#c6d0f5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#232634", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.icons.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.icons.passive": "#949cbb", - "theme.bar.menus.menu.bluetooth.listitems.active": "#99d1db", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#51576d", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#414559", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#99d1db", - "theme.bar.menus.menu.bluetooth.switch_divider": "#51576d", - "theme.bar.menus.menu.bluetooth.status": "#737994", - "theme.bar.menus.menu.bluetooth.text": "#c6d0f5", - "theme.bar.menus.menu.bluetooth.label.color": "#99d1db", - "theme.bar.menus.menu.bluetooth.border.color": "#414559", - "theme.bar.menus.menu.bluetooth.background.color": "#232634", - "theme.bar.menus.menu.bluetooth.card.color": "#292c3c", - "theme.bar.menus.menu.network.iconbuttons.active": "#ca9ee6", - "theme.bar.menus.menu.network.iconbuttons.passive": "#c6d0f5", - "theme.bar.menus.menu.network.icons.active": "#ca9ee6", - "theme.bar.menus.menu.network.icons.passive": "#949cbb", - "theme.bar.menus.menu.network.listitems.active": "#ca9ee6", - "theme.bar.menus.menu.network.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.network.status.color": "#737994", - "theme.bar.menus.menu.network.text": "#c6d0f5", - "theme.bar.menus.menu.network.label.color": "#ca9ee6", - "theme.bar.menus.menu.network.border.color": "#414559", - "theme.bar.menus.menu.network.background.color": "#232634", - "theme.bar.menus.menu.network.card.color": "#292c3c", - "theme.bar.menus.menu.volume.input_slider.puck": "#626880", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.volume.input_slider.background": "#626880", - "theme.bar.menus.menu.volume.input_slider.primary": "#ea999c", - "theme.bar.menus.menu.volume.audio_slider.puck": "#626880", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.volume.audio_slider.background": "#626880", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ea999c", - "theme.bar.menus.menu.volume.icons.active": "#ea999c", - "theme.bar.menus.menu.volume.icons.passive": "#949cbb", - "theme.bar.menus.menu.volume.iconbutton.active": "#ea999c", - "theme.bar.menus.menu.volume.iconbutton.passive": "#c6d0f5", - "theme.bar.menus.menu.volume.listitems.active": "#ea999c", - "theme.bar.menus.menu.volume.listitems.passive": "#c6d0f5", - "theme.bar.menus.menu.volume.border.color": "#414559", - "theme.bar.menus.menu.volume.background.color": "#232634", - "theme.bar.menus.menu.media.slider.puck": "#737994", - "theme.bar.menus.menu.media.slider.backgroundhover": "#51576d", - "theme.bar.menus.menu.media.slider.background": "#626880", - "theme.bar.menus.menu.media.slider.primary": "#f4b8e4", - "theme.bar.menus.menu.media.buttons.text": "#232634", - "theme.bar.menus.menu.media.buttons.background": "#babbf1", - "theme.bar.menus.menu.media.buttons.enabled": "#81c8be", - "theme.bar.menus.menu.media.buttons.inactive": "#626880", - "theme.bar.menus.menu.media.border.color": "#414559", - "theme.bar.menus.menu.media.background.color": "#232634", - "theme.bar.menus.menu.media.album": "#f4b8e4", - "theme.bar.menus.menu.media.artist": "#81c8be", - "theme.bar.menus.menu.media.song": "#babbf1", - "theme.bar.menus.tooltip.text": "#c6d0f5", - "theme.bar.menus.tooltip.background": "#232634", - "theme.bar.menus.dropdownmenu.divider": "#292c3c", - "theme.bar.menus.dropdownmenu.text": "#c6d0f5", - "theme.bar.menus.dropdownmenu.background": "#232634", - "theme.bar.menus.slider.puck": "#737994", - "theme.bar.menus.slider.backgroundhover": "#51576d", - "theme.bar.menus.slider.background": "#626880", - "theme.bar.menus.slider.primary": "#babbf1", - "theme.bar.menus.progressbar.background": "#51576d", - "theme.bar.menus.progressbar.foreground": "#babbf1", - "theme.bar.menus.iconbuttons.active": "#babbf1", - "theme.bar.menus.iconbuttons.passive": "#c6d0f5", - "theme.bar.menus.buttons.text": "#232634", - "theme.bar.menus.buttons.disabled": "#626880", - "theme.bar.menus.buttons.active": "#f4b8e4", - "theme.bar.menus.buttons.default": "#babbf1", - "theme.bar.menus.switch.puck": "#51576d", - "theme.bar.menus.switch.disabled": "#414559", - "theme.bar.menus.switch.enabled": "#babbf1", - "theme.bar.menus.icons.active": "#babbf1", - "theme.bar.menus.icons.passive": "#626880", - "theme.bar.menus.listitems.active": "#babbf1", - "theme.bar.menus.listitems.passive": "#c6d0f5", - "theme.bar.menus.label": "#babbf1", - "theme.bar.menus.feinttext": "#414559", - "theme.bar.menus.dimtext": "#626880", - "theme.bar.menus.cards": "#292c3c", - "theme.bar.buttons.notifications.total": "#babbf1", - "theme.bar.buttons.notifications.icon": "#303446", - "theme.bar.buttons.notifications.background": "#303446", - "theme.bar.buttons.clock.icon": "#303446", - "theme.bar.buttons.clock.text": "#f4b8e4", - "theme.bar.buttons.clock.background": "#303446", - "theme.bar.buttons.battery.icon": "#303446", - "theme.bar.buttons.battery.text": "#e5c890", - "theme.bar.buttons.battery.background": "#303446", - "theme.bar.buttons.systray.background": "#303446", - "theme.bar.buttons.bluetooth.icon": "#303446", - "theme.bar.buttons.bluetooth.text": "#99d1db", - "theme.bar.buttons.bluetooth.background": "#303446", - "theme.bar.buttons.network.icon": "#303446", - "theme.bar.buttons.network.text": "#ca9ee6", - "theme.bar.buttons.network.background": "#303446", - "theme.bar.buttons.volume.icon": "#303446", - "theme.bar.buttons.volume.text": "#ea999c", - "theme.bar.buttons.volume.background": "#303446", - "theme.bar.buttons.windowtitle.icon": "#303446", - "theme.bar.buttons.windowtitle.text": "#f4b8e4", - "theme.bar.buttons.windowtitle.background": "#303446", - "theme.bar.buttons.workspaces.active": "#f4b8e4", - "theme.bar.buttons.workspaces.occupied": "#eebebe", - "theme.bar.buttons.workspaces.available": "#99d1db", - "theme.bar.buttons.workspaces.hover": "#51576d", - "theme.bar.buttons.workspaces.background": "#303446", - "theme.bar.buttons.dashboard.icon": "#303446", - "theme.bar.buttons.dashboard.background": "#e5c890", - "theme.osd.label": "#babbf1", - "theme.osd.icon": "#232634", - "theme.osd.bar_overflow_color": "#e78284", - "theme.osd.bar_empty_color": "#414559", - "theme.osd.bar_color": "#babbf1", - "theme.osd.icon_container": "#babbf1", - "theme.osd.bar_container": "#232634", - "theme.notification.close_button.label": "#232634", - "theme.notification.close_button.background": "#e78284", - "theme.notification.labelicon": "#babbf1", - "theme.notification.text": "#c6d0f5", - "theme.notification.time": "#838ba7", - "theme.notification.border": "#414559", - "theme.notification.label": "#babbf1", - "theme.notification.actions.text": "#232634", - "theme.notification.actions.background": "#babbf1", - "theme.notification.background": "#232634", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.menus.menu.media.card.color": "#292c3c", - "theme.bar.menus.check_radio_button.background": "#232534", - "theme.bar.menus.check_radio_button.active": "#b9baf1", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#ea999c", - "theme.bar.buttons.network.icon_background": "#ca9ee6", - "theme.bar.buttons.bluetooth.icon_background": "#99d1db", - "theme.bar.buttons.windowtitle.icon_background": "#f4b8e4", - "theme.bar.buttons.media.icon_background": "#babbf1", - "theme.bar.buttons.notifications.icon_background": "#b4befe", - "theme.bar.buttons.battery.icon_background": "#e5c890", - "theme.bar.buttons.clock.icon_background": "#f4b8e4", - "theme.bar.menus.menu.notifications.pager.button": "#babbf1", - "theme.bar.menus.menu.notifications.scrollbar.color": "#babbf1", - "theme.bar.menus.menu.notifications.pager.label": "#949cbb", - "theme.bar.menus.menu.notifications.pager.background": "#232634", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#e78284", - "theme.bar.menus.popover.border": "#232634", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#99d1db", - "theme.bar.menus.menu.power.buttons.restart.text": "#ef9f76", - "theme.bar.buttons.modules.updates.background": "#303446", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.netstat.background": "#303446", - "theme.bar.buttons.modules.weather.icon": "#303446", - "theme.bar.buttons.modules.netstat.text": "#a6d189", - "theme.bar.buttons.modules.storage.background": "#303446", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#e78284", - "theme.bar.buttons.modules.cpu.background": "#303446", - "theme.bar.menus.menu.power.border.color": "#414559", - "theme.bar.buttons.modules.power.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.logout.icon": "#232634", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ef9f76", - "theme.bar.menus.menu.power.buttons.restart.icon": "#232634", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.icon_background": "#99d1db", - "theme.bar.buttons.modules.weather.text": "#babbf1", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#232634", - "theme.bar.menus.menu.power.buttons.sleep.text": "#99d1db", - "theme.bar.buttons.modules.weather.icon_background": "#babbf1", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#292c3c", - "theme.bar.menus.menu.power.buttons.logout.background": "#292c3c", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.ram.icon_background": "#e5c890", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e78284", - "theme.bar.menus.menu.power.buttons.sleep.background": "#292c3c", - "theme.bar.buttons.modules.ram.text": "#e5c890", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6d189", - "theme.bar.buttons.modules.updates.icon_background": "#ca9ee6", - "theme.bar.buttons.modules.kbLayout.background": "#303446", - "theme.bar.buttons.modules.power.background": "#303446", - "theme.bar.buttons.modules.weather.background": "#303446", - "theme.bar.menus.menu.power.background.color": "#232634", - "theme.bar.buttons.modules.ram.background": "#303446", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#e78284", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6d189", - "theme.bar.buttons.modules.updates.text": "#ca9ee6", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#232634", - "theme.bar.menus.menu.power.buttons.restart.background": "#292c3c", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#e78284", - "theme.bar.buttons.modules.netstat.icon_background": "#a6d189", - "theme.bar.buttons.modules.kbLayout.text": "#99d1db", - "theme.bar.buttons.modules.power.border": "#e78284", - "theme.bar.buttons.modules.weather.border": "#babbf1", - "theme.bar.buttons.modules.updates.border": "#ca9ee6", - "theme.bar.buttons.modules.kbLayout.border": "#99d1db", - "theme.bar.buttons.modules.netstat.border": "#a6d189", - "theme.bar.buttons.modules.storage.border": "#e78284", - "theme.bar.buttons.modules.cpu.border": "#e78284", - "theme.bar.buttons.modules.ram.border": "#e5c890", - "theme.bar.buttons.notifications.border": "#babbf1", - "theme.bar.buttons.clock.border": "#f4b8e4", - "theme.bar.buttons.battery.border": "#e5c890", - "theme.bar.buttons.systray.border": "#51576d", - "theme.bar.buttons.bluetooth.border": "#99d1db", - "theme.bar.buttons.network.border": "#ca9ee6", - "theme.bar.buttons.volume.border": "#ea999c", - "theme.bar.buttons.media.border": "#babbf1", - "theme.bar.buttons.windowtitle.border": "#f4b8e4", - "theme.bar.buttons.workspaces.border": "#232634", - "theme.bar.buttons.dashboard.border": "#e5c890", - "theme.bar.buttons.modules.submap.background": "#303446", - "theme.bar.buttons.modules.submap.text": "#81c8be", - "theme.bar.buttons.modules.submap.border": "#81c8be", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#81c8be" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_latte.json b/ags/HyprPanel/themes/catppuccin_latte.json deleted file mode 100644 index 64559e2..0000000 --- a/ags/HyprPanel/themes/catppuccin_latte.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#eff1f5", - "theme.bar.background": "#eff1f5", - "theme.bar.buttons.media.icon": "#7287fd", - "theme.bar.buttons.media.text": "#7287fd", - "theme.bar.buttons.icon": "#7287fd", - "theme.bar.buttons.text": "#7287fd", - "theme.bar.buttons.hover": "#bcc0cc", - "theme.bar.buttons.background": "#e6e9ef", - "theme.bar.menus.text": "#4c4f69", - "theme.bar.menus.border.color": "#ccd0da", - "theme.bar.buttons.media.background": "#dcdfe8", - "theme.bar.menus.menu.volume.text": "#4c4f69", - "theme.bar.menus.menu.volume.card.color": "#dcdfe8", - "theme.bar.menus.menu.volume.label.color": "#e64553", - "theme.bar.menus.popover.text": "#7287fd", - "theme.bar.menus.popover.background": "#dce0e8", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#d20f39", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#d20f39", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#40a02b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#dce0e8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#4c4f69", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#7287fd", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#ccd0da", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#dce0e8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#eff1f5", - "theme.bar.menus.menu.notifications.switch.puck": "#bcc0cc", - "theme.bar.menus.menu.notifications.switch.disabled": "#ccd0da", - "theme.bar.menus.menu.notifications.switch.enabled": "#7287fd", - "theme.bar.menus.menu.notifications.clear": "#d20f39", - "theme.bar.menus.menu.notifications.switch_divider": "#bcc0cc", - "theme.bar.menus.menu.notifications.border": "#ccd0da", - "theme.bar.menus.menu.notifications.card": "#dcdfe8", - "theme.bar.menus.menu.notifications.background": "#eff1f5", - "theme.bar.menus.menu.notifications.no_notifications_label": "#ccd0da", - "theme.bar.menus.menu.notifications.label": "#7287fd", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#bcc0cc", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#7287fd", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#8839ef", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#179299", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e64553", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#df8e1d", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#ea76cb", - "theme.bar.menus.menu.dashboard.controls.input.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.input.background": "#ea76cb", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e64553", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#df8e1d", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#04a5e5", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#8839ef", - "theme.bar.menus.menu.dashboard.controls.disabled": "#acb0be", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#40a02b", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#7287fd", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#04a5e5", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#40a02b", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fe640b", - "theme.bar.menus.menu.dashboard.profile.name": "#ea76cb", - "theme.bar.menus.menu.dashboard.border.color": "#ccd0da", - "theme.bar.menus.menu.dashboard.background.color": "#eff1f5", - "theme.bar.menus.menu.dashboard.card.color": "#dcdfe8", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#ea76cb", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#ea76cb", - "theme.bar.menus.menu.clock.weather.hourly.time": "#ea76cb", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#04a5e5", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#1e66f5", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#7287fd", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fe640b", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#d20f39", - "theme.bar.menus.menu.clock.weather.stats": "#ea76cb", - "theme.bar.menus.menu.clock.weather.status": "#179299", - "theme.bar.menus.menu.clock.weather.temperature": "#4c4f69", - "theme.bar.menus.menu.clock.weather.icon": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.contextdays": "#acb0be", - "theme.bar.menus.menu.clock.calendar.days": "#4c4f69", - "theme.bar.menus.menu.clock.calendar.currentday": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.paginator": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.weekdays": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#179299", - "theme.bar.menus.menu.clock.time.timeperiod": "#179299", - "theme.bar.menus.menu.clock.time.time": "#ea76cb", - "theme.bar.menus.menu.clock.text": "#4c4f69", - "theme.bar.menus.menu.clock.border.color": "#ccd0da", - "theme.bar.menus.menu.clock.background.color": "#eff1f5", - "theme.bar.menus.menu.clock.card.color": "#dcdfe8", - "theme.bar.menus.menu.battery.slider.puck": "#9ca0b0", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.battery.slider.background": "#acb0be", - "theme.bar.menus.menu.battery.slider.primary": "#df8e1d", - "theme.bar.menus.menu.battery.icons.active": "#df8e1d", - "theme.bar.menus.menu.battery.icons.passive": "#7c7f93", - "theme.bar.menus.menu.battery.listitems.active": "#df8e1d", - "theme.bar.menus.menu.battery.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.battery.text": "#4c4f69", - "theme.bar.menus.menu.battery.label.color": "#df8e1d", - "theme.bar.menus.menu.battery.border.color": "#ccd0da", - "theme.bar.menus.menu.battery.background.color": "#eff1f5", - "theme.bar.menus.menu.battery.card.color": "#dcdfe8", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#eff1f5", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#4c4f69", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#dce0e8", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#4c4f69", - "theme.bar.menus.menu.bluetooth.icons.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.icons.passive": "#7c7f93", - "theme.bar.menus.menu.bluetooth.listitems.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.bluetooth.switch.puck": "#bcc0cc", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#ccd0da", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#04a5e5", - "theme.bar.menus.menu.bluetooth.switch_divider": "#bcc0cc", - "theme.bar.menus.menu.bluetooth.status": "#9ca0b0", - "theme.bar.menus.menu.bluetooth.text": "#4c4f69", - "theme.bar.menus.menu.bluetooth.label.color": "#04a5e5", - "theme.bar.menus.menu.bluetooth.border.color": "#ccd0da", - "theme.bar.menus.menu.bluetooth.background.color": "#eff1f5", - "theme.bar.menus.menu.bluetooth.card.color": "#dcdfe8", - "theme.bar.menus.menu.network.iconbuttons.active": "#8839ef", - "theme.bar.menus.menu.network.iconbuttons.passive": "#4c4f69", - "theme.bar.menus.menu.network.icons.active": "#8839ef", - "theme.bar.menus.menu.network.icons.passive": "#7c7f93", - "theme.bar.menus.menu.network.listitems.active": "#8839ef", - "theme.bar.menus.menu.network.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.network.status.color": "#9ca0b0", - "theme.bar.menus.menu.network.text": "#4c4f69", - "theme.bar.menus.menu.network.label.color": "#8839ef", - "theme.bar.menus.menu.network.border.color": "#ccd0da", - "theme.bar.menus.menu.network.background.color": "#eff1f5", - "theme.bar.menus.menu.network.card.color": "#dcdfe8", - "theme.bar.menus.menu.volume.input_slider.puck": "#acb0be", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.volume.input_slider.background": "#acb0be", - "theme.bar.menus.menu.volume.input_slider.primary": "#e64553", - "theme.bar.menus.menu.volume.audio_slider.puck": "#acb0be", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.volume.audio_slider.background": "#acb0be", - "theme.bar.menus.menu.volume.audio_slider.primary": "#e64553", - "theme.bar.menus.menu.volume.icons.active": "#e64553", - "theme.bar.menus.menu.volume.icons.passive": "#7c7f93", - "theme.bar.menus.menu.volume.iconbutton.active": "#e64553", - "theme.bar.menus.menu.volume.iconbutton.passive": "#4c4f69", - "theme.bar.menus.menu.volume.listitems.active": "#e64553", - "theme.bar.menus.menu.volume.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.volume.border.color": "#ccd0da", - "theme.bar.menus.menu.volume.background.color": "#e6e9ef", - "theme.bar.menus.menu.media.slider.puck": "#9ca0b0", - "theme.bar.menus.menu.media.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.media.slider.background": "#acb0be", - "theme.bar.menus.menu.media.slider.primary": "#ea76cb", - "theme.bar.menus.menu.media.buttons.text": "#dce0e8", - "theme.bar.menus.menu.media.buttons.background": "#7287fd", - "theme.bar.menus.menu.media.buttons.enabled": "#179299", - "theme.bar.menus.menu.media.buttons.inactive": "#acb0be", - "theme.bar.menus.menu.media.border.color": "#ccd0da", - "theme.bar.menus.menu.media.background.color": "#eff1f5", - "theme.bar.menus.menu.media.album": "#ea76cb", - "theme.bar.menus.menu.media.artist": "#179299", - "theme.bar.menus.menu.media.song": "#7287fd", - "theme.bar.menus.tooltip.text": "#4c4f69", - "theme.bar.menus.tooltip.background": "#dce0e8", - "theme.bar.menus.dropdownmenu.divider": "#eff1f5", - "theme.bar.menus.dropdownmenu.text": "#4c4f69", - "theme.bar.menus.dropdownmenu.background": "#dce0e8", - "theme.bar.menus.slider.puck": "#9ca0b0", - "theme.bar.menus.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.slider.background": "#acb0be", - "theme.bar.menus.slider.primary": "#7287fd", - "theme.bar.menus.progressbar.background": "#bcc0cc", - "theme.bar.menus.progressbar.foreground": "#7287fd", - "theme.bar.menus.iconbuttons.active": "#7287fd", - "theme.bar.menus.iconbuttons.passive": "#4c4f69", - "theme.bar.menus.buttons.text": "#dce0e8", - "theme.bar.menus.buttons.disabled": "#acb0be", - "theme.bar.menus.buttons.active": "#ea76cb", - "theme.bar.menus.buttons.default": "#7287fd", - "theme.bar.menus.switch.puck": "#bcc0cc", - "theme.bar.menus.switch.disabled": "#ccd0da", - "theme.bar.menus.switch.enabled": "#7287fd", - "theme.bar.menus.icons.active": "#7287fd", - "theme.bar.menus.icons.passive": "#acb0be", - "theme.bar.menus.listitems.active": "#7287fd", - "theme.bar.menus.listitems.passive": "#4c4f69", - "theme.bar.menus.label": "#7287fd", - "theme.bar.menus.feinttext": "#ccd0da", - "theme.bar.menus.dimtext": "#acb0be", - "theme.bar.menus.cards": "#dce0e8", - "theme.bar.buttons.notifications.total": "#7287fd", - "theme.bar.buttons.notifications.icon": "#7287fd", - "theme.bar.buttons.notifications.background": "#dcdfe8", - "theme.bar.buttons.clock.icon": "#ea76cb", - "theme.bar.buttons.clock.text": "#ea76cb", - "theme.bar.buttons.clock.background": "#dcdfe8", - "theme.bar.buttons.battery.icon": "#df8e1d", - "theme.bar.buttons.battery.text": "#df8e1d", - "theme.bar.buttons.battery.background": "#dcdfe8", - "theme.bar.buttons.systray.background": "#dcdfe8", - "theme.bar.buttons.bluetooth.icon": "#04a5e5", - "theme.bar.buttons.bluetooth.text": "#04a5e5", - "theme.bar.buttons.bluetooth.background": "#dcdfe8", - "theme.bar.buttons.network.icon": "#8839ef", - "theme.bar.buttons.network.text": "#8839ef", - "theme.bar.buttons.network.background": "#dcdfe8", - "theme.bar.buttons.volume.icon": "#e64553", - "theme.bar.buttons.volume.text": "#e64553", - "theme.bar.buttons.volume.background": "#dcdfe8", - "theme.bar.buttons.windowtitle.icon": "#ea76cb", - "theme.bar.buttons.windowtitle.text": "#ea76cb", - "theme.bar.buttons.windowtitle.background": "#dcdfe8", - "theme.bar.buttons.workspaces.active": "#ea76cb", - "theme.bar.buttons.workspaces.occupied": "#dd7878", - "theme.bar.buttons.workspaces.available": "#04a5e5", - "theme.bar.buttons.workspaces.hover": "#bcc0cc", - "theme.bar.buttons.workspaces.background": "#dcdfe8", - "theme.bar.buttons.dashboard.icon": "#df8e1d", - "theme.bar.buttons.dashboard.background": "#dcdfe8", - "theme.osd.label": "#7287fd", - "theme.osd.icon": "#ccd0da", - "theme.osd.bar_overflow_color": "#d20f39", - "theme.osd.bar_empty_color": "#acb0be", - "theme.osd.bar_color": "#7287fd", - "theme.osd.icon_container": "#7287fd", - "theme.osd.bar_container": "#ccd0da", - "theme.notification.close_button.label": "#dce0e8", - "theme.notification.close_button.background": "#d20f39", - "theme.notification.labelicon": "#7287fd", - "theme.notification.text": "#4c4f69", - "theme.notification.time": "#8c8fa1", - "theme.notification.border": "#ccd0da", - "theme.notification.label": "#7287fd", - "theme.notification.actions.text": "#dce0e8", - "theme.notification.actions.background": "#7287fd", - "theme.notification.background": "#ccd0da", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.menus.menu.media.card.color": "#dcdfe8", - "theme.bar.menus.check_radio_button.background": "#dcdfe8", - "theme.bar.menus.check_radio_button.active": "#7186fd", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#7287fd", - "theme.bar.menus.menu.notifications.scrollbar.color": "#7287fd", - "theme.bar.menus.menu.notifications.pager.label": "#7c7f93", - "theme.bar.menus.menu.notifications.pager.background": "#eff1f5", - "theme.bar.buttons.clock.icon_background": "#ea76cb", - "theme.bar.buttons.modules.ram.icon": "#df8e1d", - "theme.bar.buttons.modules.storage.icon_background": "#d20f39", - "theme.bar.menus.popover.border": "#dce0e8", - "theme.bar.buttons.volume.icon_background": "#e64553", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#04a5e5", - "theme.bar.menus.menu.power.buttons.restart.text": "#fe640b", - "theme.bar.buttons.modules.updates.background": "#dcdfe8", - "theme.bar.buttons.modules.storage.icon": "#d20f39", - "theme.bar.buttons.modules.netstat.background": "#dcdfe8", - "theme.bar.buttons.modules.weather.icon": "#7287fd", - "theme.bar.buttons.modules.netstat.text": "#40a02b", - "theme.bar.buttons.modules.storage.background": "#dcdfe8", - "theme.bar.buttons.modules.power.icon": "#d20f39", - "theme.bar.buttons.modules.storage.text": "#d20f39", - "theme.bar.buttons.modules.cpu.background": "#dcdfe8", - "theme.bar.menus.menu.power.border.color": "#ccd0da", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#d20f39", - "theme.bar.menus.menu.power.buttons.logout.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fe640b", - "theme.bar.menus.menu.power.buttons.restart.icon": "#dce0e8", - "theme.bar.buttons.modules.cpu.icon": "#d20f39", - "theme.bar.buttons.battery.icon_background": "#df8e1d", - "theme.bar.buttons.modules.kbLayout.icon_background": "#04a5e5", - "theme.bar.buttons.modules.weather.text": "#7287fd", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.sleep.text": "#04a5e5", - "theme.bar.buttons.modules.weather.icon_background": "#7287fd", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#dcdfe8", - "theme.bar.buttons.media.icon_background": "#7287fd", - "theme.bar.menus.menu.power.buttons.logout.background": "#dcdfe8", - "theme.bar.buttons.modules.kbLayout.icon": "#04a5e5", - "theme.bar.buttons.modules.ram.icon_background": "#df8e1d", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#d20f39", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#d20f39", - "theme.bar.menus.menu.power.buttons.sleep.background": "#dcdfe8", - "theme.bar.buttons.modules.ram.text": "#df8e1d", - "theme.bar.menus.menu.power.buttons.logout.text": "#40a02b", - "theme.bar.buttons.modules.updates.icon_background": "#8839ef", - "theme.bar.buttons.modules.kbLayout.background": "#dcdfe8", - "theme.bar.buttons.modules.power.background": "#dcdfe8", - "theme.bar.buttons.modules.weather.background": "#dcdfe8", - "theme.bar.buttons.icon_background": "#dcdfe8", - "theme.bar.menus.menu.power.background.color": "#eff1f5", - "theme.bar.buttons.modules.ram.background": "#dcdfe8", - "theme.bar.buttons.modules.netstat.icon": "#40a02b", - "theme.bar.buttons.windowtitle.icon_background": "#ea76cb", - "theme.bar.buttons.modules.cpu.icon_background": "#d20f39", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#40a02b", - "theme.bar.buttons.modules.updates.text": "#8839ef", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#dce0e8", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#dcdfe8", - "theme.bar.buttons.modules.updates.icon": "#8839ef", - "theme.bar.buttons.modules.cpu.text": "#d20f39", - "theme.bar.buttons.modules.netstat.icon_background": "#40a02b", - "theme.bar.buttons.modules.kbLayout.text": "#04a5e5", - "theme.bar.buttons.notifications.icon_background": "#7287fd", - "theme.bar.buttons.modules.power.border": "#d20f39", - "theme.bar.buttons.modules.weather.border": "#7287fd", - "theme.bar.buttons.modules.updates.border": "#8839ef", - "theme.bar.buttons.modules.kbLayout.border": "#04a5e5", - "theme.bar.buttons.modules.netstat.border": "#40a02b", - "theme.bar.buttons.modules.storage.border": "#d20f39", - "theme.bar.buttons.modules.cpu.border": "#d20f39", - "theme.bar.buttons.modules.ram.border": "#df8e1d", - "theme.bar.buttons.notifications.border": "#7287fd", - "theme.bar.buttons.clock.border": "#ea76cb", - "theme.bar.buttons.battery.border": "#df8e1d", - "theme.bar.buttons.systray.border": "#bcc0cc", - "theme.bar.buttons.bluetooth.border": "#04a5e5", - "theme.bar.buttons.network.border": "#8839ef", - "theme.bar.buttons.volume.border": "#e64553", - "theme.bar.buttons.media.border": "#7287fd", - "theme.bar.buttons.windowtitle.border": "#ea76cb", - "theme.bar.buttons.workspaces.border": "#dce0e8", - "theme.bar.buttons.dashboard.border": "#df8e1d", - "theme.bar.buttons.modules.submap.background": "#dcdfe8", - "theme.bar.buttons.modules.submap.text": "#179299", - "theme.bar.buttons.modules.submap.border": "#179299", - "theme.bar.buttons.modules.submap.icon": "#179299", - "theme.bar.buttons.modules.submap.icon_background": "#dcdfe8" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_latte_split.json b/ags/HyprPanel/themes/catppuccin_latte_split.json deleted file mode 100644 index 13aa39c..0000000 --- a/ags/HyprPanel/themes/catppuccin_latte_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#7287fd", - "theme.bar.menus.menu.notifications.pager.label": "#7c7f93", - "theme.bar.menus.menu.notifications.pager.button": "#7287fd", - "theme.bar.menus.menu.notifications.pager.background": "#eff1f5", - "theme.bar.menus.menu.notifications.switch.puck": "#bcc0cc", - "theme.bar.menus.menu.notifications.switch.disabled": "#ccd0da", - "theme.bar.menus.menu.notifications.switch.enabled": "#7287fd", - "theme.bar.menus.menu.notifications.clear": "#d20f39", - "theme.bar.menus.menu.notifications.switch_divider": "#bcc0cc", - "theme.bar.menus.menu.notifications.border": "#ccd0da", - "theme.bar.menus.menu.notifications.card": "#dcdfe8", - "theme.bar.menus.menu.notifications.background": "#eff1f5", - "theme.bar.menus.menu.notifications.no_notifications_label": "#ccd0da", - "theme.bar.menus.menu.notifications.label": "#7287fd", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.sleep.text": "#04a5e5", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#04a5e5", - "theme.bar.menus.menu.power.buttons.sleep.background": "#dcdfe8", - "theme.bar.menus.menu.power.buttons.logout.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.logout.text": "#40a02b", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#40a02b", - "theme.bar.menus.menu.power.buttons.logout.background": "#dcdfe8", - "theme.bar.menus.menu.power.buttons.restart.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.restart.text": "#fe640b", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fe640b", - "theme.bar.menus.menu.power.buttons.restart.background": "#dcdfe8", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#dce0e8", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#d20f39", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#d20f39", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#dcdfe8", - "theme.bar.menus.menu.power.border.color": "#ccd0da", - "theme.bar.menus.menu.power.background.color": "#eff1f5", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#ea76cb", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#40a02b", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#df8e1d", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e64553", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#bcc0cc", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#7287fd", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#8839ef", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#179299", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e64553", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#df8e1d", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#ea76cb", - "theme.bar.menus.menu.dashboard.controls.input.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.input.background": "#ea76cb", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e64553", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#df8e1d", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#04a5e5", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#8839ef", - "theme.bar.menus.menu.dashboard.controls.disabled": "#acb0be", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#40a02b", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#dce0e8", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#7287fd", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#dce0e8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#d20f39", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#40a02b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#4c4f69", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#7287fd", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#ccd0da", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#dce0e8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#eff1f5", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#04a5e5", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#40a02b", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fe640b", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#d20f39", - "theme.bar.menus.menu.dashboard.profile.name": "#ea76cb", - "theme.bar.menus.menu.dashboard.border.color": "#ccd0da", - "theme.bar.menus.menu.dashboard.background.color": "#eff1f5", - "theme.bar.menus.menu.dashboard.card.color": "#dcdfe8", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#ea76cb", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#ea76cb", - "theme.bar.menus.menu.clock.weather.hourly.time": "#ea76cb", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#04a5e5", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#1e66f5", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#7287fd", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fe640b", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#d20f39", - "theme.bar.menus.menu.clock.weather.stats": "#ea76cb", - "theme.bar.menus.menu.clock.weather.status": "#179299", - "theme.bar.menus.menu.clock.weather.temperature": "#4c4f69", - "theme.bar.menus.menu.clock.weather.icon": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.contextdays": "#acb0be", - "theme.bar.menus.menu.clock.calendar.days": "#4c4f69", - "theme.bar.menus.menu.clock.calendar.currentday": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.paginator": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.weekdays": "#ea76cb", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#179299", - "theme.bar.menus.menu.clock.time.timeperiod": "#179299", - "theme.bar.menus.menu.clock.time.time": "#ea76cb", - "theme.bar.menus.menu.clock.text": "#4c4f69", - "theme.bar.menus.menu.clock.border.color": "#ccd0da", - "theme.bar.menus.menu.clock.background.color": "#eff1f5", - "theme.bar.menus.menu.clock.card.color": "#dcdfe8", - "theme.bar.menus.menu.battery.slider.puck": "#9ca0b0", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.battery.slider.background": "#acb0be", - "theme.bar.menus.menu.battery.slider.primary": "#df8e1d", - "theme.bar.menus.menu.battery.icons.active": "#df8e1d", - "theme.bar.menus.menu.battery.icons.passive": "#7c7f93", - "theme.bar.menus.menu.battery.listitems.active": "#df8e1d", - "theme.bar.menus.menu.battery.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.battery.text": "#4c4f69", - "theme.bar.menus.menu.battery.label.color": "#df8e1d", - "theme.bar.menus.menu.battery.border.color": "#ccd0da", - "theme.bar.menus.menu.battery.background.color": "#eff1f5", - "theme.bar.menus.menu.battery.card.color": "#dcdfe8", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#eff1f5", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#4c4f69", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#dce0e8", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#4c4f69", - "theme.bar.menus.menu.bluetooth.icons.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.icons.passive": "#7c7f93", - "theme.bar.menus.menu.bluetooth.listitems.active": "#04a5e5", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.bluetooth.switch.puck": "#bcc0cc", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#ccd0da", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#04a5e5", - "theme.bar.menus.menu.bluetooth.switch_divider": "#bcc0cc", - "theme.bar.menus.menu.bluetooth.status": "#9ca0b0", - "theme.bar.menus.menu.bluetooth.text": "#4c4f69", - "theme.bar.menus.menu.bluetooth.label.color": "#04a5e5", - "theme.bar.menus.menu.bluetooth.border.color": "#ccd0da", - "theme.bar.menus.menu.bluetooth.background.color": "#eff1f5", - "theme.bar.menus.menu.bluetooth.card.color": "#dcdfe8", - "theme.bar.menus.menu.network.iconbuttons.active": "#8839ef", - "theme.bar.menus.menu.network.iconbuttons.passive": "#4c4f69", - "theme.bar.menus.menu.network.icons.active": "#8839ef", - "theme.bar.menus.menu.network.icons.passive": "#7c7f93", - "theme.bar.menus.menu.network.listitems.active": "#8839ef", - "theme.bar.menus.menu.network.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.network.status.color": "#9ca0b0", - "theme.bar.menus.menu.network.text": "#4c4f69", - "theme.bar.menus.menu.network.label.color": "#8839ef", - "theme.bar.menus.menu.network.border.color": "#ccd0da", - "theme.bar.menus.menu.network.background.color": "#eff1f5", - "theme.bar.menus.menu.network.card.color": "#dcdfe8", - "theme.bar.menus.menu.volume.input_slider.puck": "#acb0be", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.volume.input_slider.background": "#acb0be", - "theme.bar.menus.menu.volume.input_slider.primary": "#e64553", - "theme.bar.menus.menu.volume.audio_slider.puck": "#acb0be", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.volume.audio_slider.background": "#acb0be", - "theme.bar.menus.menu.volume.audio_slider.primary": "#e64553", - "theme.bar.menus.menu.volume.icons.active": "#e64553", - "theme.bar.menus.menu.volume.icons.passive": "#7c7f93", - "theme.bar.menus.menu.volume.iconbutton.active": "#e64553", - "theme.bar.menus.menu.volume.iconbutton.passive": "#4c4f69", - "theme.bar.menus.menu.volume.listitems.active": "#e64553", - "theme.bar.menus.menu.volume.listitems.passive": "#4c4f69", - "theme.bar.menus.menu.volume.text": "#4c4f69", - "theme.bar.menus.menu.volume.label.color": "#e64553", - "theme.bar.menus.menu.volume.border.color": "#ccd0da", - "theme.bar.menus.menu.volume.background.color": "#e6e9ef", - "theme.bar.menus.menu.volume.card.color": "#dcdfe8", - "theme.bar.menus.menu.media.slider.puck": "#9ca0b0", - "theme.bar.menus.menu.media.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.menu.media.slider.background": "#acb0be", - "theme.bar.menus.menu.media.slider.primary": "#ea76cb", - "theme.bar.menus.menu.media.buttons.text": "#dce0e8", - "theme.bar.menus.menu.media.buttons.background": "#7287fd", - "theme.bar.menus.menu.media.buttons.enabled": "#179299", - "theme.bar.menus.menu.media.buttons.inactive": "#acb0be", - "theme.bar.menus.menu.media.border.color": "#ccd0da", - "theme.bar.menus.menu.media.card.color": "#dcdfe8", - "theme.bar.menus.menu.media.background.color": "#eff1f5", - "theme.bar.menus.menu.media.album": "#ea76cb", - "theme.bar.menus.menu.media.artist": "#179299", - "theme.bar.menus.menu.media.song": "#7287fd", - "theme.bar.menus.tooltip.text": "#4c4f69", - "theme.bar.menus.tooltip.background": "#dce0e8", - "theme.bar.menus.dropdownmenu.divider": "#eff1f5", - "theme.bar.menus.dropdownmenu.text": "#4c4f69", - "theme.bar.menus.dropdownmenu.background": "#dce0e8", - "theme.bar.menus.slider.puck": "#9ca0b0", - "theme.bar.menus.slider.backgroundhover": "#bcc0cc", - "theme.bar.menus.slider.background": "#acb0be", - "theme.bar.menus.slider.primary": "#7287fd", - "theme.bar.menus.progressbar.background": "#bcc0cc", - "theme.bar.menus.progressbar.foreground": "#7287fd", - "theme.bar.menus.iconbuttons.active": "#7287fd", - "theme.bar.menus.iconbuttons.passive": "#4c4f69", - "theme.bar.menus.buttons.text": "#dce0e8", - "theme.bar.menus.buttons.disabled": "#acb0be", - "theme.bar.menus.buttons.active": "#ea76cb", - "theme.bar.menus.buttons.default": "#7287fd", - "theme.bar.menus.check_radio_button.active": "#7186fd", - "theme.bar.menus.check_radio_button.background": "#dcdfe8", - "theme.bar.menus.switch.puck": "#bcc0cc", - "theme.bar.menus.switch.disabled": "#ccd0da", - "theme.bar.menus.switch.enabled": "#7287fd", - "theme.bar.menus.icons.active": "#7287fd", - "theme.bar.menus.icons.passive": "#acb0be", - "theme.bar.menus.listitems.active": "#7287fd", - "theme.bar.menus.listitems.passive": "#4c4f69", - "theme.bar.menus.popover.border": "#dce0e8", - "theme.bar.menus.popover.background": "#dce0e8", - "theme.bar.menus.popover.text": "#7287fd", - "theme.bar.menus.label": "#7287fd", - "theme.bar.menus.feinttext": "#ccd0da", - "theme.bar.menus.dimtext": "#acb0be", - "theme.bar.menus.text": "#4c4f69", - "theme.bar.menus.border.color": "#ccd0da", - "theme.bar.menus.cards": "#dce0e8", - "theme.bar.menus.background": "#eff1f5", - "theme.bar.buttons.modules.power.icon_background": "#d20f39", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.power.background": "#dcdfe8", - "theme.bar.buttons.modules.power.border": "#d20f39", - "theme.bar.buttons.modules.weather.icon_background": "#7287fd", - "theme.bar.buttons.modules.weather.icon": "#dcdfe8", - "theme.bar.buttons.modules.weather.text": "#7287fd", - "theme.bar.buttons.modules.weather.background": "#dcdfe8", - "theme.bar.buttons.modules.weather.border": "#7287fd", - "theme.bar.buttons.modules.updates.icon_background": "#8839ef", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.updates.text": "#8839ef", - "theme.bar.buttons.modules.updates.background": "#dcdfe8", - "theme.bar.buttons.modules.updates.border": "#8839ef", - "theme.bar.buttons.modules.kbLayout.icon_background": "#04a5e5", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.text": "#04a5e5", - "theme.bar.buttons.modules.kbLayout.background": "#dcdfe8", - "theme.bar.buttons.modules.kbLayout.border": "#04a5e5", - "theme.bar.buttons.modules.netstat.icon_background": "#40a02b", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.netstat.text": "#40a02b", - "theme.bar.buttons.modules.netstat.background": "#dcdfe8", - "theme.bar.buttons.modules.netstat.border": "#40a02b", - "theme.bar.buttons.modules.storage.icon_background": "#d20f39", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#d20f39", - "theme.bar.buttons.modules.storage.background": "#dcdfe8", - "theme.bar.buttons.modules.storage.border": "#d20f39", - "theme.bar.buttons.modules.cpu.icon_background": "#d20f39", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#d20f39", - "theme.bar.buttons.modules.cpu.background": "#dcdfe8", - "theme.bar.buttons.modules.cpu.border": "#d20f39", - "theme.bar.buttons.modules.ram.icon_background": "#df8e1d", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.ram.text": "#df8e1d", - "theme.bar.buttons.modules.ram.background": "#dcdfe8", - "theme.bar.buttons.modules.ram.border": "#df8e1d", - "theme.bar.buttons.notifications.total": "#7287fd", - "theme.bar.buttons.notifications.icon_background": "#7287fd", - "theme.bar.buttons.notifications.icon": "#dcdee8", - "theme.bar.buttons.notifications.background": "#dcdfe8", - "theme.bar.buttons.notifications.border": "#7287fd", - "theme.bar.buttons.clock.icon_background": "#ea76cb", - "theme.bar.buttons.clock.icon": "#dcdee8", - "theme.bar.buttons.clock.text": "#ea76cb", - "theme.bar.buttons.clock.background": "#dcdfe8", - "theme.bar.buttons.clock.border": "#ea76cb", - "theme.bar.buttons.battery.icon_background": "#df8e1d", - "theme.bar.buttons.battery.icon": "#dcdee8", - "theme.bar.buttons.battery.text": "#df8e1d", - "theme.bar.buttons.battery.background": "#dcdfe8", - "theme.bar.buttons.battery.border": "#df8e1d", - "theme.bar.buttons.systray.background": "#dcdfe8", - "theme.bar.buttons.systray.border": "#bcc0cc", - "theme.bar.buttons.bluetooth.icon_background": "#04a5e5", - "theme.bar.buttons.bluetooth.icon": "#dcdee8", - "theme.bar.buttons.bluetooth.text": "#04a5e5", - "theme.bar.buttons.bluetooth.background": "#dcdfe8", - "theme.bar.buttons.bluetooth.border": "#04a5e5", - "theme.bar.buttons.network.icon_background": "#8839ef", - "theme.bar.buttons.network.icon": "#dcdee8", - "theme.bar.buttons.network.text": "#8839ef", - "theme.bar.buttons.network.background": "#dcdfe8", - "theme.bar.buttons.network.border": "#8839ef", - "theme.bar.buttons.volume.icon_background": "#e64553", - "theme.bar.buttons.volume.icon": "#dcdee8", - "theme.bar.buttons.volume.text": "#e64553", - "theme.bar.buttons.volume.background": "#dcdfe8", - "theme.bar.buttons.volume.border": "#e64553", - "theme.bar.buttons.media.icon_background": "#7287fd", - "theme.bar.buttons.media.icon": "#dcdee8", - "theme.bar.buttons.media.text": "#7287fd", - "theme.bar.buttons.media.background": "#dcdfe8", - "theme.bar.buttons.media.border": "#7287fd", - "theme.bar.buttons.windowtitle.icon_background": "#ea76cb", - "theme.bar.buttons.windowtitle.icon": "#dcdee8", - "theme.bar.buttons.windowtitle.text": "#ea76cb", - "theme.bar.buttons.windowtitle.border": "#ea76cb", - "theme.bar.buttons.windowtitle.background": "#dcdfe8", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.hover": "#bcc0cc", - "theme.bar.buttons.workspaces.active": "#ea76cb", - "theme.bar.buttons.workspaces.occupied": "#dd7878", - "theme.bar.buttons.workspaces.available": "#04a5e5", - "theme.bar.buttons.workspaces.border": "#dce0e8", - "theme.bar.buttons.workspaces.background": "#dcdfe8", - "theme.bar.buttons.dashboard.icon": "#dcdee8", - "theme.bar.buttons.dashboard.border": "#df8e1d", - "theme.bar.buttons.dashboard.background": "#df8e1d", - "theme.bar.buttons.icon": "#7287fd", - "theme.bar.buttons.text": "#7287fd", - "theme.bar.buttons.hover": "#bcc0cc", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#e6e9ef", - "theme.bar.buttons.style": "split", - "theme.bar.background": "#eff1f5", - "theme.osd.label": "#7287fd", - "theme.osd.icon": "#ccd0da", - "theme.osd.bar_overflow_color": "#d20f39", - "theme.osd.bar_empty_color": "#acb0be", - "theme.osd.bar_color": "#7287fd", - "theme.osd.icon_container": "#7287fd", - "theme.osd.bar_container": "#ccd0da", - "theme.notification.close_button.label": "#dce0e8", - "theme.notification.close_button.background": "#d20f39", - "theme.notification.labelicon": "#7287fd", - "theme.notification.text": "#4c4f69", - "theme.notification.time": "#8c8fa1", - "theme.notification.border": "#ccd0da", - "theme.notification.label": "#7287fd", - "theme.notification.actions.text": "#dce0e8", - "theme.notification.actions.background": "#7287fd", - "theme.notification.background": "#ccd0da", - "theme.bar.buttons.modules.submap.background": "#dcdfe8", - "theme.bar.buttons.modules.submap.text": "#179299", - "theme.bar.buttons.modules.submap.border": "#179299", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#179299" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_macchiato.json b/ags/HyprPanel/themes/catppuccin_macchiato.json deleted file mode 100644 index cf5ecc8..0000000 --- a/ags/HyprPanel/themes/catppuccin_macchiato.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#181926", - "theme.bar.background": "#181926", - "theme.bar.buttons.media.icon": "#b7bdf8", - "theme.bar.buttons.media.text": "#b7bdf8", - "theme.bar.buttons.icon": "#b7bdf8", - "theme.bar.buttons.text": "#b7bdf8", - "theme.bar.buttons.hover": "#494d64", - "theme.bar.buttons.background": "#24273a", - "theme.bar.menus.text": "#cad3f5", - "theme.bar.menus.border.color": "#363a4f", - "theme.bar.buttons.media.background": "#24273a", - "theme.bar.menus.menu.volume.text": "#cad3f5", - "theme.bar.menus.menu.volume.card.color": "#1e2030", - "theme.bar.menus.menu.volume.label.color": "#ee99a0", - "theme.bar.menus.popover.text": "#b7bdf8", - "theme.bar.menus.popover.background": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ed8796", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ed8796", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6da95", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#cad3f5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#b7bdf8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#363a4f", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1e2030", - "theme.bar.menus.menu.notifications.switch.puck": "#494d64", - "theme.bar.menus.menu.notifications.switch.disabled": "#363a4f", - "theme.bar.menus.menu.notifications.switch.enabled": "#b7bdf8", - "theme.bar.menus.menu.notifications.clear": "#ed8796", - "theme.bar.menus.menu.notifications.switch_divider": "#494d64", - "theme.bar.menus.menu.notifications.border": "#363a4f", - "theme.bar.menus.menu.notifications.card": "#1e2030", - "theme.bar.menus.menu.notifications.background": "#181926", - "theme.bar.menus.menu.notifications.no_notifications_label": "#363a4f", - "theme.bar.menus.menu.notifications.label": "#b7bdf8", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#494d64", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#b7bdf8", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#c6a0f6", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8bd5ca", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ee99a0", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#eed49f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f5bde6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f5bde6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ee99a0", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#eed49f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#91d7e3", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c6a0f6", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5b6078", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6da95", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#181926", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#b7bdf8", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#91d7e3", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6da95", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f5a97f", - "theme.bar.menus.menu.dashboard.profile.name": "#f5bde6", - "theme.bar.menus.menu.dashboard.border.color": "#363a4f", - "theme.bar.menus.menu.dashboard.background.color": "#181926", - "theme.bar.menus.menu.dashboard.card.color": "#1e2030", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f5bde6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f5bde6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f5bde6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#91d7e3", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8aadf4", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#b7bdf8", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f5a97f", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ed8796", - "theme.bar.menus.menu.clock.weather.stats": "#f5bde6", - "theme.bar.menus.menu.clock.weather.status": "#8bd5ca", - "theme.bar.menus.menu.clock.weather.temperature": "#cad3f5", - "theme.bar.menus.menu.clock.weather.icon": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5b6078", - "theme.bar.menus.menu.clock.calendar.days": "#cad3f5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.paginator": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8bd5ca", - "theme.bar.menus.menu.clock.time.timeperiod": "#8bd5ca", - "theme.bar.menus.menu.clock.time.time": "#f5bde6", - "theme.bar.menus.menu.clock.text": "#cad3f5", - "theme.bar.menus.menu.clock.border.color": "#363a4f", - "theme.bar.menus.menu.clock.background.color": "#181926", - "theme.bar.menus.menu.clock.card.color": "#1e2030", - "theme.bar.menus.menu.battery.slider.puck": "#6e738d", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.battery.slider.background": "#5b6078", - "theme.bar.menus.menu.battery.slider.primary": "#eed49f", - "theme.bar.menus.menu.battery.icons.active": "#eed49f", - "theme.bar.menus.menu.battery.icons.passive": "#939ab7", - "theme.bar.menus.menu.battery.listitems.active": "#eed49f", - "theme.bar.menus.menu.battery.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.battery.text": "#cad3f5", - "theme.bar.menus.menu.battery.label.color": "#eed49f", - "theme.bar.menus.menu.battery.border.color": "#363a4f", - "theme.bar.menus.menu.battery.background.color": "#181926", - "theme.bar.menus.menu.battery.card.color": "#1e2030", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1e2030", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#cad3f5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#181926", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#cad3f5", - "theme.bar.menus.menu.bluetooth.icons.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.icons.passive": "#939ab7", - "theme.bar.menus.menu.bluetooth.listitems.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#494d64", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#363a4f", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#91d7e3", - "theme.bar.menus.menu.bluetooth.switch_divider": "#494d64", - "theme.bar.menus.menu.bluetooth.status": "#6e738d", - "theme.bar.menus.menu.bluetooth.text": "#cad3f5", - "theme.bar.menus.menu.bluetooth.label.color": "#91d7e3", - "theme.bar.menus.menu.bluetooth.border.color": "#363a4f", - "theme.bar.menus.menu.bluetooth.background.color": "#181926", - "theme.bar.menus.menu.bluetooth.card.color": "#1e2030", - "theme.bar.menus.menu.network.iconbuttons.active": "#c6a0f6", - "theme.bar.menus.menu.network.iconbuttons.passive": "#cad3f5", - "theme.bar.menus.menu.network.icons.active": "#c6a0f6", - "theme.bar.menus.menu.network.icons.passive": "#939ab7", - "theme.bar.menus.menu.network.listitems.active": "#c6a0f6", - "theme.bar.menus.menu.network.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.network.status.color": "#6e738d", - "theme.bar.menus.menu.network.text": "#cad3f5", - "theme.bar.menus.menu.network.label.color": "#c6a0f6", - "theme.bar.menus.menu.network.border.color": "#363a4f", - "theme.bar.menus.menu.network.background.color": "#181926", - "theme.bar.menus.menu.network.card.color": "#1e2030", - "theme.bar.menus.menu.volume.input_slider.puck": "#5b6078", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.volume.input_slider.background": "#5b6078", - "theme.bar.menus.menu.volume.input_slider.primary": "#ee99a0", - "theme.bar.menus.menu.volume.audio_slider.puck": "#5b6078", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.volume.audio_slider.background": "#5b6078", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ee99a0", - "theme.bar.menus.menu.volume.icons.active": "#ee99a0", - "theme.bar.menus.menu.volume.icons.passive": "#939ab7", - "theme.bar.menus.menu.volume.iconbutton.active": "#ee99a0", - "theme.bar.menus.menu.volume.iconbutton.passive": "#cad3f5", - "theme.bar.menus.menu.volume.listitems.active": "#ee99a0", - "theme.bar.menus.menu.volume.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.volume.border.color": "#363a4f", - "theme.bar.menus.menu.volume.background.color": "#181926", - "theme.bar.menus.menu.media.slider.puck": "#6e738d", - "theme.bar.menus.menu.media.slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.media.slider.background": "#5b6078", - "theme.bar.menus.menu.media.slider.primary": "#f5bde6", - "theme.bar.menus.menu.media.buttons.text": "#181926", - "theme.bar.menus.menu.media.buttons.background": "#b7bdf8", - "theme.bar.menus.menu.media.buttons.enabled": "#8bd5ca", - "theme.bar.menus.menu.media.buttons.inactive": "#5b6078", - "theme.bar.menus.menu.media.border.color": "#363a4f", - "theme.bar.menus.menu.media.background.color": "#181926", - "theme.bar.menus.menu.media.album": "#f5bde6", - "theme.bar.menus.menu.media.artist": "#8bd5ca", - "theme.bar.menus.menu.media.song": "#b7bdf8", - "theme.bar.menus.tooltip.text": "#cad3f5", - "theme.bar.menus.tooltip.background": "#181926", - "theme.bar.menus.dropdownmenu.divider": "#1e2030", - "theme.bar.menus.dropdownmenu.text": "#cad3f5", - "theme.bar.menus.dropdownmenu.background": "#181926", - "theme.bar.menus.slider.puck": "#6e738d", - "theme.bar.menus.slider.backgroundhover": "#494d64", - "theme.bar.menus.slider.background": "#5b6078", - "theme.bar.menus.slider.primary": "#b7bdf8", - "theme.bar.menus.progressbar.background": "#494d64", - "theme.bar.menus.progressbar.foreground": "#b7bdf8", - "theme.bar.menus.iconbuttons.active": "#b7bdf8", - "theme.bar.menus.iconbuttons.passive": "#cad3f5", - "theme.bar.menus.buttons.text": "#181926", - "theme.bar.menus.buttons.disabled": "#5b6078", - "theme.bar.menus.buttons.active": "#f5bde6", - "theme.bar.menus.buttons.default": "#b7bdf8", - "theme.bar.menus.switch.puck": "#494d64", - "theme.bar.menus.switch.disabled": "#363a4f", - "theme.bar.menus.switch.enabled": "#b7bdf8", - "theme.bar.menus.icons.active": "#b7bdf8", - "theme.bar.menus.icons.passive": "#5b6078", - "theme.bar.menus.listitems.active": "#b7bdf8", - "theme.bar.menus.listitems.passive": "#cad3f5", - "theme.bar.menus.label": "#b7bdf8", - "theme.bar.menus.feinttext": "#363a4f", - "theme.bar.menus.dimtext": "#5b6078", - "theme.bar.menus.cards": "#1e2030", - "theme.bar.buttons.notifications.total": "#b7bdf8", - "theme.bar.buttons.notifications.icon": "#b7bdf8", - "theme.bar.buttons.notifications.background": "#24273a", - "theme.bar.buttons.clock.icon": "#f5bde6", - "theme.bar.buttons.clock.text": "#f5bde6", - "theme.bar.buttons.clock.background": "#24273a", - "theme.bar.buttons.battery.icon": "#eed49f", - "theme.bar.buttons.battery.text": "#eed49f", - "theme.bar.buttons.battery.background": "#24273a", - "theme.bar.buttons.systray.background": "#24273a", - "theme.bar.buttons.bluetooth.icon": "#91d7e3", - "theme.bar.buttons.bluetooth.text": "#91d7e3", - "theme.bar.buttons.bluetooth.background": "#24273a", - "theme.bar.buttons.network.icon": "#c6a0f6", - "theme.bar.buttons.network.text": "#c6a0f6", - "theme.bar.buttons.network.background": "#24273a", - "theme.bar.buttons.volume.icon": "#ee99a0", - "theme.bar.buttons.volume.text": "#ee99a0", - "theme.bar.buttons.volume.background": "#24273a", - "theme.bar.buttons.windowtitle.icon": "#f5bde6", - "theme.bar.buttons.windowtitle.text": "#f5bde6", - "theme.bar.buttons.windowtitle.background": "#24273a", - "theme.bar.buttons.workspaces.active": "#f5bde6", - "theme.bar.buttons.workspaces.occupied": "#f0c6c6", - "theme.bar.buttons.workspaces.available": "#91d7e3", - "theme.bar.buttons.workspaces.hover": "#494d64", - "theme.bar.buttons.workspaces.background": "#24273a", - "theme.bar.buttons.dashboard.icon": "#eed49f", - "theme.bar.buttons.dashboard.background": "#24273a", - "theme.osd.label": "#b7bdf8", - "theme.osd.icon": "#181926", - "theme.osd.bar_overflow_color": "#ed8796", - "theme.osd.bar_empty_color": "#363a4f", - "theme.osd.bar_color": "#b7bdf8", - "theme.osd.icon_container": "#b7bdf8", - "theme.osd.bar_container": "#181926", - "theme.notification.close_button.label": "#181926", - "theme.notification.close_button.background": "#ed8796", - "theme.notification.labelicon": "#b7bdf8", - "theme.notification.text": "#cad3f5", - "theme.notification.time": "#8087a2", - "theme.notification.border": "#363a4f", - "theme.notification.label": "#b7bdf8", - "theme.notification.actions.text": "#181926", - "theme.notification.actions.background": "#b7bdf8", - "theme.notification.background": "#181926", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.menus.menu.media.card.color": "#1e2030", - "theme.bar.menus.check_radio_button.background": "#181826", - "theme.bar.menus.check_radio_button.active": "#b7bcf8", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#b7bdf8", - "theme.bar.menus.menu.notifications.scrollbar.color": "#b7bdf8", - "theme.bar.menus.menu.notifications.pager.label": "#939ab7", - "theme.bar.menus.menu.notifications.pager.background": "#181926", - "theme.bar.buttons.clock.icon_background": "#f5bde6", - "theme.bar.buttons.modules.ram.icon": "#eed49f", - "theme.bar.buttons.modules.storage.icon_background": "#ed8796", - "theme.bar.menus.popover.border": "#181926", - "theme.bar.buttons.volume.icon_background": "#ee99a0", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#91d7e3", - "theme.bar.menus.menu.power.buttons.restart.text": "#f5a97f", - "theme.bar.buttons.modules.updates.background": "#24273a", - "theme.bar.buttons.modules.storage.icon": "#ed8796", - "theme.bar.buttons.modules.netstat.background": "#24273a", - "theme.bar.buttons.modules.weather.icon": "#b7bdf8", - "theme.bar.buttons.modules.netstat.text": "#a6da95", - "theme.bar.buttons.modules.storage.background": "#24273a", - "theme.bar.buttons.modules.power.icon": "#ed8796", - "theme.bar.buttons.modules.storage.text": "#ed8796", - "theme.bar.buttons.modules.cpu.background": "#24273a", - "theme.bar.menus.menu.power.border.color": "#363a4f", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.logout.icon": "#181926", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f5a97f", - "theme.bar.menus.menu.power.buttons.restart.icon": "#181926", - "theme.bar.buttons.modules.cpu.icon": "#ed8796", - "theme.bar.buttons.battery.icon_background": "#eed49f", - "theme.bar.buttons.modules.kbLayout.icon_background": "#91d7e3", - "theme.bar.buttons.modules.weather.text": "#b7bdf8", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#181926", - "theme.bar.menus.menu.power.buttons.sleep.text": "#91d7e3", - "theme.bar.buttons.modules.weather.icon_background": "#b7bdf8", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1e2030", - "theme.bar.buttons.media.icon_background": "#b7bdf8", - "theme.bar.menus.menu.power.buttons.logout.background": "#1e2030", - "theme.bar.buttons.modules.kbLayout.icon": "#91d7e3", - "theme.bar.buttons.modules.ram.icon_background": "#eed49f", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#ed8796", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1e2030", - "theme.bar.buttons.modules.ram.text": "#eed49f", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6da95", - "theme.bar.buttons.modules.updates.icon_background": "#c6a0f6", - "theme.bar.buttons.modules.kbLayout.background": "#24273a", - "theme.bar.buttons.modules.power.background": "#24273a", - "theme.bar.buttons.modules.weather.background": "#24273a", - "theme.bar.buttons.icon_background": "#24273a", - "theme.bar.menus.menu.power.background.color": "#181926", - "theme.bar.buttons.modules.ram.background": "#24273a", - "theme.bar.buttons.modules.netstat.icon": "#a6da95", - "theme.bar.buttons.windowtitle.icon_background": "#f5bde6", - "theme.bar.buttons.modules.cpu.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6da95", - "theme.bar.buttons.modules.updates.text": "#c6a0f6", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#181926", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#1e2030", - "theme.bar.buttons.modules.updates.icon": "#c6a0f6", - "theme.bar.buttons.modules.cpu.text": "#ed8796", - "theme.bar.buttons.modules.netstat.icon_background": "#a6da95", - "theme.bar.buttons.modules.kbLayout.text": "#91d7e3", - "theme.bar.buttons.notifications.icon_background": "#b7bdf8", - "theme.bar.buttons.modules.power.border": "#ed8796", - "theme.bar.buttons.modules.weather.border": "#b7bdf8", - "theme.bar.buttons.modules.updates.border": "#c6a0f6", - "theme.bar.buttons.modules.kbLayout.border": "#91d7e3", - "theme.bar.buttons.modules.netstat.border": "#a6da95", - "theme.bar.buttons.modules.storage.border": "#ed8796", - "theme.bar.buttons.modules.cpu.border": "#ed8796", - "theme.bar.buttons.modules.ram.border": "#eed49f", - "theme.bar.buttons.notifications.border": "#b7bdf8", - "theme.bar.buttons.clock.border": "#f5bde6", - "theme.bar.buttons.battery.border": "#eed49f", - "theme.bar.buttons.systray.border": "#494d64", - "theme.bar.buttons.bluetooth.border": "#91d7e3", - "theme.bar.buttons.network.border": "#c6a0f6", - "theme.bar.buttons.volume.border": "#ee99a0", - "theme.bar.buttons.media.border": "#b7bdf8", - "theme.bar.buttons.windowtitle.border": "#f5bde6", - "theme.bar.buttons.workspaces.border": "#181926", - "theme.bar.buttons.dashboard.border": "#eed49f", - "theme.bar.buttons.modules.submap.background": "#24273a", - "theme.bar.buttons.modules.submap.text": "#8bd5ca", - "theme.bar.buttons.modules.submap.border": "#8bd5ca", - "theme.bar.buttons.modules.submap.icon": "#8bd5ca", - "theme.bar.buttons.modules.submap.icon_background": "#24273a" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_macchiato_split.json b/ags/HyprPanel/themes/catppuccin_macchiato_split.json deleted file mode 100644 index d5602a8..0000000 --- a/ags/HyprPanel/themes/catppuccin_macchiato_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#181926", - "theme.bar.background": "#181926", - "theme.bar.buttons.media.icon": "#24273a", - "theme.bar.buttons.media.text": "#b7bdf8", - "theme.bar.buttons.icon": "#b7bdf8", - "theme.bar.buttons.text": "#b7bdf8", - "theme.bar.buttons.hover": "#494d64", - "theme.bar.buttons.background": "#24273a", - "theme.bar.menus.text": "#cad3f5", - "theme.bar.menus.border.color": "#363a4f", - "theme.bar.buttons.media.background": "#24273a", - "theme.bar.menus.menu.volume.text": "#cad3f5", - "theme.bar.menus.menu.volume.card.color": "#1e2030", - "theme.bar.menus.menu.volume.label.color": "#ee99a0", - "theme.bar.menus.popover.text": "#b7bdf8", - "theme.bar.menus.popover.background": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ed8796", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ed8796", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6da95", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#cad3f5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#b7bdf8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#363a4f", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#181926", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1e2030", - "theme.bar.menus.menu.notifications.switch.puck": "#494d64", - "theme.bar.menus.menu.notifications.switch.disabled": "#363a4f", - "theme.bar.menus.menu.notifications.switch.enabled": "#b7bdf8", - "theme.bar.menus.menu.notifications.clear": "#ed8796", - "theme.bar.menus.menu.notifications.switch_divider": "#494d64", - "theme.bar.menus.menu.notifications.border": "#363a4f", - "theme.bar.menus.menu.notifications.card": "#1e2030", - "theme.bar.menus.menu.notifications.background": "#181926", - "theme.bar.menus.menu.notifications.no_notifications_label": "#363a4f", - "theme.bar.menus.menu.notifications.label": "#b7bdf8", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f5bde6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6da95", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#eed49f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ee99a0", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#494d64", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#b7bdf8", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#c6a0f6", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8bd5ca", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ee99a0", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#eed49f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f5bde6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f5bde6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ee99a0", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#eed49f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#91d7e3", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#181926", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c6a0f6", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5b6078", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6da95", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#181926", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#b7bdf8", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#91d7e3", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6da95", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f5a97f", - "theme.bar.menus.menu.dashboard.profile.name": "#f5bde6", - "theme.bar.menus.menu.dashboard.border.color": "#363a4f", - "theme.bar.menus.menu.dashboard.background.color": "#181926", - "theme.bar.menus.menu.dashboard.card.color": "#1e2030", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f5bde6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f5bde6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f5bde6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#91d7e3", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8aadf4", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#b7bdf8", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f5a97f", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ed8796", - "theme.bar.menus.menu.clock.weather.stats": "#f5bde6", - "theme.bar.menus.menu.clock.weather.status": "#8bd5ca", - "theme.bar.menus.menu.clock.weather.temperature": "#cad3f5", - "theme.bar.menus.menu.clock.weather.icon": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5b6078", - "theme.bar.menus.menu.clock.calendar.days": "#cad3f5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.paginator": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f5bde6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8bd5ca", - "theme.bar.menus.menu.clock.time.timeperiod": "#8bd5ca", - "theme.bar.menus.menu.clock.time.time": "#f5bde6", - "theme.bar.menus.menu.clock.text": "#cad3f5", - "theme.bar.menus.menu.clock.border.color": "#363a4f", - "theme.bar.menus.menu.clock.background.color": "#181926", - "theme.bar.menus.menu.clock.card.color": "#1e2030", - "theme.bar.menus.menu.battery.slider.puck": "#6e738d", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.battery.slider.background": "#5b6078", - "theme.bar.menus.menu.battery.slider.primary": "#eed49f", - "theme.bar.menus.menu.battery.icons.active": "#eed49f", - "theme.bar.menus.menu.battery.icons.passive": "#939ab7", - "theme.bar.menus.menu.battery.listitems.active": "#eed49f", - "theme.bar.menus.menu.battery.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.battery.text": "#cad3f5", - "theme.bar.menus.menu.battery.label.color": "#eed49f", - "theme.bar.menus.menu.battery.border.color": "#363a4f", - "theme.bar.menus.menu.battery.background.color": "#181926", - "theme.bar.menus.menu.battery.card.color": "#1e2030", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1e2030", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#cad3f5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#181926", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#cad3f5", - "theme.bar.menus.menu.bluetooth.icons.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.icons.passive": "#939ab7", - "theme.bar.menus.menu.bluetooth.listitems.active": "#91d7e3", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#494d64", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#363a4f", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#91d7e3", - "theme.bar.menus.menu.bluetooth.switch_divider": "#494d64", - "theme.bar.menus.menu.bluetooth.status": "#6e738d", - "theme.bar.menus.menu.bluetooth.text": "#cad3f5", - "theme.bar.menus.menu.bluetooth.label.color": "#91d7e3", - "theme.bar.menus.menu.bluetooth.border.color": "#363a4f", - "theme.bar.menus.menu.bluetooth.background.color": "#181926", - "theme.bar.menus.menu.bluetooth.card.color": "#1e2030", - "theme.bar.menus.menu.network.iconbuttons.active": "#c6a0f6", - "theme.bar.menus.menu.network.iconbuttons.passive": "#cad3f5", - "theme.bar.menus.menu.network.icons.active": "#c6a0f6", - "theme.bar.menus.menu.network.icons.passive": "#939ab7", - "theme.bar.menus.menu.network.listitems.active": "#c6a0f6", - "theme.bar.menus.menu.network.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.network.status.color": "#6e738d", - "theme.bar.menus.menu.network.text": "#cad3f5", - "theme.bar.menus.menu.network.label.color": "#c6a0f6", - "theme.bar.menus.menu.network.border.color": "#363a4f", - "theme.bar.menus.menu.network.background.color": "#181926", - "theme.bar.menus.menu.network.card.color": "#1e2030", - "theme.bar.menus.menu.volume.input_slider.puck": "#5b6078", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.volume.input_slider.background": "#5b6078", - "theme.bar.menus.menu.volume.input_slider.primary": "#ee99a0", - "theme.bar.menus.menu.volume.audio_slider.puck": "#5b6078", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.volume.audio_slider.background": "#5b6078", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ee99a0", - "theme.bar.menus.menu.volume.icons.active": "#ee99a0", - "theme.bar.menus.menu.volume.icons.passive": "#939ab7", - "theme.bar.menus.menu.volume.iconbutton.active": "#ee99a0", - "theme.bar.menus.menu.volume.iconbutton.passive": "#cad3f5", - "theme.bar.menus.menu.volume.listitems.active": "#ee99a0", - "theme.bar.menus.menu.volume.listitems.passive": "#cad3f5", - "theme.bar.menus.menu.volume.border.color": "#363a4f", - "theme.bar.menus.menu.volume.background.color": "#181926", - "theme.bar.menus.menu.media.slider.puck": "#6e738d", - "theme.bar.menus.menu.media.slider.backgroundhover": "#494d64", - "theme.bar.menus.menu.media.slider.background": "#5b6078", - "theme.bar.menus.menu.media.slider.primary": "#f5bde6", - "theme.bar.menus.menu.media.buttons.text": "#181926", - "theme.bar.menus.menu.media.buttons.background": "#b7bdf8", - "theme.bar.menus.menu.media.buttons.enabled": "#8bd5ca", - "theme.bar.menus.menu.media.buttons.inactive": "#5b6078", - "theme.bar.menus.menu.media.border.color": "#363a4f", - "theme.bar.menus.menu.media.background.color": "#181926", - "theme.bar.menus.menu.media.album": "#f5bde6", - "theme.bar.menus.menu.media.artist": "#8bd5ca", - "theme.bar.menus.menu.media.song": "#b7bdf8", - "theme.bar.menus.tooltip.text": "#cad3f5", - "theme.bar.menus.tooltip.background": "#181926", - "theme.bar.menus.dropdownmenu.divider": "#1e2030", - "theme.bar.menus.dropdownmenu.text": "#cad3f5", - "theme.bar.menus.dropdownmenu.background": "#181926", - "theme.bar.menus.slider.puck": "#6e738d", - "theme.bar.menus.slider.backgroundhover": "#494d64", - "theme.bar.menus.slider.background": "#5b6078", - "theme.bar.menus.slider.primary": "#b7bdf8", - "theme.bar.menus.progressbar.background": "#494d64", - "theme.bar.menus.progressbar.foreground": "#b7bdf8", - "theme.bar.menus.iconbuttons.active": "#b7bdf8", - "theme.bar.menus.iconbuttons.passive": "#cad3f5", - "theme.bar.menus.buttons.text": "#181926", - "theme.bar.menus.buttons.disabled": "#5b6078", - "theme.bar.menus.buttons.active": "#f5bde6", - "theme.bar.menus.buttons.default": "#b7bdf8", - "theme.bar.menus.switch.puck": "#494d64", - "theme.bar.menus.switch.disabled": "#363a4f", - "theme.bar.menus.switch.enabled": "#b7bdf8", - "theme.bar.menus.icons.active": "#b7bdf8", - "theme.bar.menus.icons.passive": "#5b6078", - "theme.bar.menus.listitems.active": "#b7bdf8", - "theme.bar.menus.listitems.passive": "#cad3f5", - "theme.bar.menus.label": "#b7bdf8", - "theme.bar.menus.feinttext": "#363a4f", - "theme.bar.menus.dimtext": "#5b6078", - "theme.bar.menus.cards": "#1e2030", - "theme.bar.buttons.notifications.total": "#b7bdf8", - "theme.bar.buttons.notifications.icon": "#24273a", - "theme.bar.buttons.notifications.background": "#24273a", - "theme.bar.buttons.clock.icon": "#24273a", - "theme.bar.buttons.clock.text": "#f5bde6", - "theme.bar.buttons.clock.background": "#24273a", - "theme.bar.buttons.battery.icon": "#24273a", - "theme.bar.buttons.battery.text": "#eed49f", - "theme.bar.buttons.battery.background": "#24273a", - "theme.bar.buttons.systray.background": "#24273a", - "theme.bar.buttons.bluetooth.icon": "#24273a", - "theme.bar.buttons.bluetooth.text": "#91d7e3", - "theme.bar.buttons.bluetooth.background": "#24273a", - "theme.bar.buttons.network.icon": "#24273a", - "theme.bar.buttons.network.text": "#c6a0f6", - "theme.bar.buttons.network.background": "#24273a", - "theme.bar.buttons.volume.icon": "#24273a", - "theme.bar.buttons.volume.text": "#ee99a0", - "theme.bar.buttons.volume.background": "#24273a", - "theme.bar.buttons.windowtitle.icon": "#24273a", - "theme.bar.buttons.windowtitle.text": "#f5bde6", - "theme.bar.buttons.windowtitle.background": "#24273a", - "theme.bar.buttons.workspaces.active": "#f5bde6", - "theme.bar.buttons.workspaces.occupied": "#f0c6c6", - "theme.bar.buttons.workspaces.available": "#91d7e3", - "theme.bar.buttons.workspaces.hover": "#494d64", - "theme.bar.buttons.workspaces.background": "#24273a", - "theme.bar.buttons.dashboard.icon": "#24273a", - "theme.bar.buttons.dashboard.background": "#eed49f", - "theme.osd.label": "#b7bdf8", - "theme.osd.icon": "#181926", - "theme.osd.bar_overflow_color": "#ed8796", - "theme.osd.bar_empty_color": "#363a4f", - "theme.osd.bar_color": "#b7bdf8", - "theme.osd.icon_container": "#b7bdf8", - "theme.osd.bar_container": "#181926", - "theme.notification.close_button.label": "#181926", - "theme.notification.close_button.background": "#ed8796", - "theme.notification.labelicon": "#b7bdf8", - "theme.notification.text": "#cad3f5", - "theme.notification.time": "#8087a2", - "theme.notification.border": "#363a4f", - "theme.notification.label": "#b7bdf8", - "theme.notification.actions.text": "#181926", - "theme.notification.actions.background": "#b7bdf8", - "theme.notification.background": "#181926", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.menus.menu.media.card.color": "#1e2030", - "theme.bar.menus.check_radio_button.background": "#181826", - "theme.bar.menus.check_radio_button.active": "#b7bcf8", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#ee999f", - "theme.bar.buttons.network.icon_background": "#c5a0f6", - "theme.bar.buttons.bluetooth.icon_background": "#91d7e3", - "theme.bar.buttons.windowtitle.icon_background": "#f5bde6", - "theme.bar.buttons.media.icon_background": "#b7bcf8", - "theme.bar.buttons.notifications.icon_background": "#b7bcf8", - "theme.bar.buttons.battery.icon_background": "#eed49f", - "theme.bar.buttons.clock.icon_background": "#f5bde6", - "theme.bar.menus.menu.notifications.pager.button": "#b7bdf8", - "theme.bar.menus.menu.notifications.scrollbar.color": "#b7bdf8", - "theme.bar.menus.menu.notifications.pager.label": "#939ab7", - "theme.bar.menus.menu.notifications.pager.background": "#181926", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#ed8796", - "theme.bar.menus.popover.border": "#181926", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#91d7e3", - "theme.bar.menus.menu.power.buttons.restart.text": "#f5a97f", - "theme.bar.buttons.modules.updates.background": "#24273a", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.netstat.background": "#24273a", - "theme.bar.buttons.modules.weather.icon": "#24273a", - "theme.bar.buttons.modules.netstat.text": "#a6da95", - "theme.bar.buttons.modules.storage.background": "#24273a", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#ed8796", - "theme.bar.buttons.modules.cpu.background": "#24273a", - "theme.bar.menus.menu.power.border.color": "#363a4f", - "theme.bar.buttons.modules.power.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.logout.icon": "#181926", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f5a97f", - "theme.bar.menus.menu.power.buttons.restart.icon": "#181926", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.icon_background": "#91d7e3", - "theme.bar.buttons.modules.weather.text": "#b7bdf8", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#181926", - "theme.bar.menus.menu.power.buttons.sleep.text": "#91d7e3", - "theme.bar.buttons.modules.weather.icon_background": "#b7bdf8", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1e2030", - "theme.bar.menus.menu.power.buttons.logout.background": "#1e2030", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.ram.icon_background": "#eed49f", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#ed8796", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1e2030", - "theme.bar.buttons.modules.ram.text": "#eed49f", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6da95", - "theme.bar.buttons.modules.updates.icon_background": "#c6a0f6", - "theme.bar.buttons.modules.kbLayout.background": "#24273a", - "theme.bar.buttons.modules.power.background": "#24273a", - "theme.bar.buttons.modules.weather.background": "#24273a", - "theme.bar.menus.menu.power.background.color": "#181926", - "theme.bar.buttons.modules.ram.background": "#24273a", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#ed8796", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6da95", - "theme.bar.buttons.modules.updates.text": "#c6a0f6", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#181926", - "theme.bar.menus.menu.power.buttons.restart.background": "#1e2030", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#ed8796", - "theme.bar.buttons.modules.netstat.icon_background": "#a6da95", - "theme.bar.buttons.modules.kbLayout.text": "#91d7e3", - "theme.bar.buttons.modules.power.border": "#ed8796", - "theme.bar.buttons.modules.weather.border": "#b7bdf8", - "theme.bar.buttons.modules.updates.border": "#c6a0f6", - "theme.bar.buttons.modules.kbLayout.border": "#91d7e3", - "theme.bar.buttons.modules.netstat.border": "#a6da95", - "theme.bar.buttons.modules.storage.border": "#ed8796", - "theme.bar.buttons.modules.cpu.border": "#ed8796", - "theme.bar.buttons.modules.ram.border": "#eed49f", - "theme.bar.buttons.notifications.border": "#b7bdf8", - "theme.bar.buttons.clock.border": "#f5bde6", - "theme.bar.buttons.battery.border": "#eed49f", - "theme.bar.buttons.systray.border": "#494d64", - "theme.bar.buttons.bluetooth.border": "#91d7e3", - "theme.bar.buttons.network.border": "#c6a0f6", - "theme.bar.buttons.volume.border": "#ee99a0", - "theme.bar.buttons.media.border": "#b7bdf8", - "theme.bar.buttons.windowtitle.border": "#f5bde6", - "theme.bar.buttons.workspaces.border": "#181926", - "theme.bar.buttons.dashboard.border": "#eed49f", - "theme.bar.buttons.modules.submap.background": "#24273a", - "theme.bar.buttons.modules.submap.text": "#8bd5ca", - "theme.bar.buttons.modules.submap.border": "#8bd5ca", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#8bd5ca" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/catppuccin_mocha.json b/ags/HyprPanel/themes/catppuccin_mocha.json deleted file mode 100644 index 3290501..0000000 --- a/ags/HyprPanel/themes/catppuccin_mocha.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#b4befe", - "theme.bar.menus.menu.notifications.pager.label": "#9399b2", - "theme.bar.menus.menu.notifications.pager.button": "#b4befe", - "theme.bar.menus.menu.notifications.pager.background": "#11111b", - "theme.bar.menus.menu.notifications.switch.puck": "#454759", - "theme.bar.menus.menu.notifications.switch.disabled": "#313245", - "theme.bar.menus.menu.notifications.switch.enabled": "#b4befe", - "theme.bar.menus.menu.notifications.clear": "#f38ba8", - "theme.bar.menus.menu.notifications.switch_divider": "#45475a", - "theme.bar.menus.menu.notifications.border": "#313244", - "theme.bar.menus.menu.notifications.card": "#1e1e2e", - "theme.bar.menus.menu.notifications.background": "#11111b", - "theme.bar.menus.menu.notifications.no_notifications_label": "#313244", - "theme.bar.menus.menu.notifications.label": "#b4befe", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#181824", - "theme.bar.menus.menu.power.buttons.sleep.text": "#89dceb", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#89dceb", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1e1e2e", - "theme.bar.menus.menu.power.buttons.logout.icon": "#181824", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6e3a1", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6e3a1", - "theme.bar.menus.menu.power.buttons.logout.background": "#1e1e2e", - "theme.bar.menus.menu.power.buttons.restart.icon": "#181824", - "theme.bar.menus.menu.power.buttons.restart.text": "#fab387", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fab387", - "theme.bar.menus.menu.power.buttons.restart.background": "#1e1e2e", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#181824", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#f38ba8", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#f38ba7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1e1e2e", - "theme.bar.menus.menu.power.border.color": "#313244", - "theme.bar.menus.menu.power.background.color": "#11111b", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f5c2e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f5c2e8", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f5c2e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6e3a1", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6e3a2", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6e3a1", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f9e2af", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f9e2ae", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f9e2af", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eba0ac", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eba0ad", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eba0ac", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#45475a", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#b4befe", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#cba6f7", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#94e2d5", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eba0ac", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f9e2af", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f5c2e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f5c2e7", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eba0ac", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f9e2af", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#89dceb", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#cba6f7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#585b70", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6e3a1", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#181824", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#b4befe", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#11111a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#f38ba8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6e3a1", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#cdd6f4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#b4befe", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#313244", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#11111b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1e1e2e", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#89dceb", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6e3a1", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fab387", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#f38ba8", - "theme.bar.menus.menu.dashboard.profile.name": "#f5c2e7", - "theme.bar.menus.menu.dashboard.border.color": "#313244", - "theme.bar.menus.menu.dashboard.background.color": "#11111b", - "theme.bar.menus.menu.dashboard.card.color": "#1e1e2e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#89dceb", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#89b4fa", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#b4befe", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fab387", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#f38ba8", - "theme.bar.menus.menu.clock.weather.stats": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.status": "#94e2d5", - "theme.bar.menus.menu.clock.weather.temperature": "#cdd6f4", - "theme.bar.menus.menu.clock.weather.icon": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#585b70", - "theme.bar.menus.menu.clock.calendar.days": "#cdd6f4", - "theme.bar.menus.menu.clock.calendar.currentday": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#f5c2e6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#94e2d5", - "theme.bar.menus.menu.clock.time.timeperiod": "#94e2d5", - "theme.bar.menus.menu.clock.time.time": "#f5c2e7", - "theme.bar.menus.menu.clock.text": "#cdd6f4", - "theme.bar.menus.menu.clock.border.color": "#313244", - "theme.bar.menus.menu.clock.background.color": "#11111b", - "theme.bar.menus.menu.clock.card.color": "#1e1e2e", - "theme.bar.menus.menu.battery.slider.puck": "#6c7086", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.battery.slider.background": "#585b71", - "theme.bar.menus.menu.battery.slider.primary": "#f9e2af", - "theme.bar.menus.menu.battery.icons.active": "#f9e2af", - "theme.bar.menus.menu.battery.icons.passive": "#9399b2", - "theme.bar.menus.menu.battery.listitems.active": "#f9e2af", - "theme.bar.menus.menu.battery.listitems.passive": "#cdd6f3", - "theme.bar.menus.menu.battery.text": "#cdd6f4", - "theme.bar.menus.menu.battery.label.color": "#f9e2af", - "theme.bar.menus.menu.battery.border.color": "#313244", - "theme.bar.menus.menu.battery.background.color": "#11111b", - "theme.bar.menus.menu.battery.card.color": "#1e1e2e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1e1e2e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#cdd6f4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#11111b", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#89dceb", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.icons.active": "#89dceb", - "theme.bar.menus.menu.bluetooth.icons.passive": "#9399b2", - "theme.bar.menus.menu.bluetooth.listitems.active": "#89dcea", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#454759", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#313245", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#89dceb", - "theme.bar.menus.menu.bluetooth.switch_divider": "#45475a", - "theme.bar.menus.menu.bluetooth.status": "#6c7086", - "theme.bar.menus.menu.bluetooth.text": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.label.color": "#89dceb", - "theme.bar.menus.menu.bluetooth.border.color": "#313244", - "theme.bar.menus.menu.bluetooth.background.color": "#11111b", - "theme.bar.menus.menu.bluetooth.card.color": "#1e1e2e", - "theme.bar.menus.menu.network.iconbuttons.active": "#cba6f7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#cdd6f4", - "theme.bar.menus.menu.network.icons.active": "#cba6f7", - "theme.bar.menus.menu.network.icons.passive": "#9399b2", - "theme.bar.menus.menu.network.listitems.active": "#cba6f6", - "theme.bar.menus.menu.network.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.network.status.color": "#6c7086", - "theme.bar.menus.menu.network.text": "#cdd6f4", - "theme.bar.menus.menu.network.label.color": "#cba6f7", - "theme.bar.menus.menu.network.border.color": "#313244", - "theme.bar.menus.menu.network.background.color": "#11111b", - "theme.bar.menus.menu.network.card.color": "#1e1e2e", - "theme.bar.menus.menu.volume.input_slider.puck": "#585b70", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.volume.input_slider.background": "#585b71", - "theme.bar.menus.menu.volume.input_slider.primary": "#eba0ac", - "theme.bar.menus.menu.volume.audio_slider.puck": "#585b70", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.volume.audio_slider.background": "#585b71", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eba0ac", - "theme.bar.menus.menu.volume.icons.active": "#eba0ac", - "theme.bar.menus.menu.volume.icons.passive": "#9399b2", - "theme.bar.menus.menu.volume.iconbutton.active": "#eba0ac", - "theme.bar.menus.menu.volume.iconbutton.passive": "#cdd6f4", - "theme.bar.menus.menu.volume.listitems.active": "#eba0ab", - "theme.bar.menus.menu.volume.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.volume.text": "#cdd6f4", - "theme.bar.menus.menu.volume.label.color": "#eba0ac", - "theme.bar.menus.menu.volume.border.color": "#313244", - "theme.bar.menus.menu.volume.background.color": "#11111b", - "theme.bar.menus.menu.volume.card.color": "#1e1e2e", - "theme.bar.menus.menu.media.slider.puck": "#6c7086", - "theme.bar.menus.menu.media.slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.media.slider.background": "#585b71", - "theme.bar.menus.menu.media.slider.primary": "#f5c2e7", - "theme.bar.menus.menu.media.buttons.text": "#11111b", - "theme.bar.menus.menu.media.buttons.background": "#b4beff", - "theme.bar.menus.menu.media.buttons.enabled": "#94e2d4", - "theme.bar.menus.menu.media.buttons.inactive": "#585b70", - "theme.bar.menus.menu.media.border.color": "#313244", - "theme.bar.menus.menu.media.card.color": "#1e1e2e", - "theme.bar.menus.menu.media.background.color": "#11111b", - "theme.bar.menus.menu.media.album": "#f5c2e8", - "theme.bar.menus.menu.media.artist": "#94e2d6", - "theme.bar.menus.menu.media.song": "#b4beff", - "theme.bar.menus.tooltip.text": "#cdd6f4", - "theme.bar.menus.tooltip.background": "#11111b", - "theme.bar.menus.dropdownmenu.divider": "#1e1e2e", - "theme.bar.menus.dropdownmenu.text": "#cdd6f4", - "theme.bar.menus.dropdownmenu.background": "#11111b", - "theme.bar.menus.slider.puck": "#6c7086", - "theme.bar.menus.slider.backgroundhover": "#45475a", - "theme.bar.menus.slider.background": "#585b71", - "theme.bar.menus.slider.primary": "#b4befe", - "theme.bar.menus.progressbar.background": "#45475a", - "theme.bar.menus.progressbar.foreground": "#b4befe", - "theme.bar.menus.iconbuttons.active": "#b4beff", - "theme.bar.menus.iconbuttons.passive": "#cdd6f3", - "theme.bar.menus.buttons.text": "#181824", - "theme.bar.menus.buttons.disabled": "#585b71", - "theme.bar.menus.buttons.active": "#f5c2e6", - "theme.bar.menus.buttons.default": "#b4befe", - "theme.bar.menus.check_radio_button.active": "#b4beff", - "theme.bar.menus.check_radio_button.background": "#45475a", - "theme.bar.menus.switch.puck": "#454759", - "theme.bar.menus.switch.disabled": "#313245", - "theme.bar.menus.switch.enabled": "#b4befe", - "theme.bar.menus.icons.active": "#b4befe", - "theme.bar.menus.icons.passive": "#585b70", - "theme.bar.menus.listitems.active": "#b4befd", - "theme.bar.menus.listitems.passive": "#cdd6f4", - "theme.bar.menus.popover.border": "#181824", - "theme.bar.menus.popover.background": "#181824", - "theme.bar.menus.popover.text": "#b4befe", - "theme.bar.menus.label": "#b4befe", - "theme.bar.menus.feinttext": "#313244", - "theme.bar.menus.dimtext": "#585b70", - "theme.bar.menus.text": "#cdd6f4", - "theme.bar.menus.border.color": "#313244", - "theme.bar.menus.cards": "#1e1e2e", - "theme.bar.menus.background": "#11111b", - "theme.bar.buttons.modules.power.icon_background": "#f38ba8", - "theme.bar.buttons.modules.power.icon": "#f38ba8", - "theme.bar.buttons.modules.power.background": "#242438", - "theme.bar.buttons.modules.power.border": "#f38ba8", - "theme.bar.buttons.modules.weather.icon_background": "#b4befe", - "theme.bar.buttons.modules.weather.icon": "#b4befe", - "theme.bar.buttons.modules.weather.text": "#b4befe", - "theme.bar.buttons.modules.weather.background": "#242438", - "theme.bar.buttons.modules.weather.border": "#b4befe", - "theme.bar.buttons.modules.updates.icon_background": "#cba6f7", - "theme.bar.buttons.modules.updates.icon": "#cba6f7", - "theme.bar.buttons.modules.updates.text": "#cba6f7", - "theme.bar.buttons.modules.updates.background": "#242438", - "theme.bar.buttons.modules.updates.border": "#cba6f7", - "theme.bar.buttons.modules.kbLayout.icon_background": "#89dceb", - "theme.bar.buttons.modules.kbLayout.icon": "#89dceb", - "theme.bar.buttons.modules.kbLayout.text": "#89dceb", - "theme.bar.buttons.modules.kbLayout.background": "#242438", - "theme.bar.buttons.modules.kbLayout.border": "#89dceb", - "theme.bar.buttons.modules.netstat.icon_background": "#a6e3a1", - "theme.bar.buttons.modules.netstat.icon": "#a6e3a1", - "theme.bar.buttons.modules.netstat.text": "#a6e3a1", - "theme.bar.buttons.modules.netstat.background": "#242438", - "theme.bar.buttons.modules.netstat.border": "#a6e3a1", - "theme.bar.buttons.modules.storage.icon_background": "#f5c2e7", - "theme.bar.buttons.modules.storage.icon": "#f5c2e7", - "theme.bar.buttons.modules.storage.text": "#f5c2e7", - "theme.bar.buttons.modules.storage.background": "#242438", - "theme.bar.buttons.modules.storage.border": "#f5c2e7", - "theme.bar.buttons.modules.cpu.icon_background": "#f38ba8", - "theme.bar.buttons.modules.cpu.icon": "#f38ba8", - "theme.bar.buttons.modules.cpu.text": "#f38ba8", - "theme.bar.buttons.modules.cpu.background": "#242438", - "theme.bar.buttons.modules.cpu.border": "#f38ba8", - "theme.bar.buttons.modules.ram.icon_background": "#f9e2af", - "theme.bar.buttons.modules.ram.icon": "#f9e2af", - "theme.bar.buttons.modules.ram.text": "#f9e2af", - "theme.bar.buttons.modules.ram.background": "#242438", - "theme.bar.buttons.modules.ram.border": "#f9e2af", - "theme.bar.buttons.notifications.total": "#b4befe", - "theme.bar.buttons.notifications.icon_background": "#b4befe", - "theme.bar.buttons.notifications.icon": "#b4befe", - "theme.bar.buttons.notifications.background": "#242438", - "theme.bar.buttons.notifications.border": "#b4befe", - "theme.bar.buttons.clock.icon_background": "#f5c2e7", - "theme.bar.buttons.clock.icon": "#f5c2e7", - "theme.bar.buttons.clock.text": "#f5c2e7", - "theme.bar.buttons.clock.background": "#242438", - "theme.bar.buttons.clock.border": "#f5c2e7", - "theme.bar.buttons.battery.icon_background": "#f9e2af", - "theme.bar.buttons.battery.icon": "#f9e2af", - "theme.bar.buttons.battery.text": "#f9e2af", - "theme.bar.buttons.battery.background": "#242438", - "theme.bar.buttons.battery.border": "#f9e2af", - "theme.bar.buttons.systray.background": "#242438", - "theme.bar.buttons.systray.border": "#b4befe", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.buttons.bluetooth.icon": "#89dceb", - "theme.bar.buttons.bluetooth.text": "#89dceb", - "theme.bar.buttons.bluetooth.background": "#242438", - "theme.bar.buttons.bluetooth.border": "#89dceb", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.network.icon": "#cba6f7", - "theme.bar.buttons.network.text": "#cba6f7", - "theme.bar.buttons.network.background": "#242438", - "theme.bar.buttons.network.border": "#cba6f7", - "theme.bar.buttons.volume.icon_background": "#eba0ac", - "theme.bar.buttons.volume.icon": "#eba0ac", - "theme.bar.buttons.volume.text": "#eba0ac", - "theme.bar.buttons.volume.background": "#242438", - "theme.bar.buttons.volume.border": "#eba0ac", - "theme.bar.buttons.media.icon_background": "#b4befe", - "theme.bar.buttons.media.icon": "#b4befe", - "theme.bar.buttons.media.text": "#b4befe", - "theme.bar.buttons.media.background": "#242438", - "theme.bar.buttons.media.border": "#b4befe", - "theme.bar.buttons.windowtitle.icon_background": "#f5c2e7", - "theme.bar.buttons.windowtitle.icon": "#f5c2e7", - "theme.bar.buttons.windowtitle.text": "#f5c2e7", - "theme.bar.buttons.windowtitle.border": "#f5c2e7", - "theme.bar.buttons.windowtitle.background": "#242438", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.hover": "#f5c2e7", - "theme.bar.buttons.workspaces.active": "#f5c2e7", - "theme.bar.buttons.workspaces.occupied": "#f2cdcd", - "theme.bar.buttons.workspaces.available": "#89dceb", - "theme.bar.buttons.workspaces.border": "#f5c2e7", - "theme.bar.buttons.workspaces.background": "#242438", - "theme.bar.buttons.dashboard.icon": "#f9e2af", - "theme.bar.buttons.dashboard.border": "#f9e2af", - "theme.bar.buttons.dashboard.background": "#242438", - "theme.bar.buttons.icon": "#b4befe", - "theme.bar.buttons.text": "#b4befe", - "theme.bar.buttons.hover": "#45475a", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#242438", - "theme.bar.buttons.style": "default", - "theme.bar.background": "#11111b", - "theme.osd.label": "#b4beff", - "theme.osd.icon": "#11111b", - "theme.osd.bar_overflow_color": "#f38ba7", - "theme.osd.bar_empty_color": "#313244", - "theme.osd.bar_color": "#b4beff", - "theme.osd.icon_container": "#b4beff", - "theme.osd.bar_container": "#11111b", - "theme.notification.close_button.label": "#11111b", - "theme.notification.close_button.background": "#f38ba7", - "theme.notification.labelicon": "#b4befe", - "theme.notification.text": "#cdd6f4", - "theme.notification.time": "#7f849b", - "theme.notification.border": "#313243", - "theme.notification.label": "#b4befe", - "theme.notification.actions.text": "#181825", - "theme.notification.actions.background": "#b4befd", - "theme.notification.background": "#181826", - "theme.bar.buttons.modules.submap.icon": "#94e2d5", - "theme.bar.buttons.modules.submap.background": "#242438", - "theme.bar.buttons.modules.submap.icon_background": "#242438", - "theme.bar.buttons.modules.submap.text": "#94e2d5", - "theme.bar.buttons.modules.submap.border": "#94e2d5" -} - diff --git a/ags/HyprPanel/themes/catppuccin_mocha_split.json b/ags/HyprPanel/themes/catppuccin_mocha_split.json deleted file mode 100644 index 3211324..0000000 --- a/ags/HyprPanel/themes/catppuccin_mocha_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#11111b", - "theme.bar.background": "#11111b", - "theme.bar.buttons.media.icon": "#1e1e2e", - "theme.bar.buttons.media.text": "#b4befe", - "theme.bar.buttons.icon": "#b4befe", - "theme.bar.buttons.text": "#b4befe", - "theme.bar.buttons.hover": "#45475a", - "theme.bar.buttons.background": "#242438", - "theme.bar.menus.text": "#cdd6f4", - "theme.bar.menus.border.color": "#313244", - "theme.bar.buttons.media.background": "#242438", - "theme.bar.menus.menu.volume.text": "#cdd6f4", - "theme.bar.menus.menu.volume.card.color": "#1e1e2e", - "theme.bar.menus.menu.volume.label.color": "#eba0ac", - "theme.bar.menus.popover.text": "#b4befe", - "theme.bar.menus.popover.background": "#181824", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#f38ba8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#f38ba8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a6e3a1", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#11111a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#cdd6f4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#b4befe", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#313244", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#11111b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1e1e2e", - "theme.bar.menus.menu.notifications.switch.puck": "#454759", - "theme.bar.menus.menu.notifications.switch.disabled": "#313245", - "theme.bar.menus.menu.notifications.switch.enabled": "#b4befe", - "theme.bar.menus.menu.notifications.clear": "#f38ba8", - "theme.bar.menus.menu.notifications.switch_divider": "#45475a", - "theme.bar.menus.menu.notifications.border": "#313244", - "theme.bar.menus.menu.notifications.card": "#1e1e2e", - "theme.bar.menus.menu.notifications.background": "#11111b", - "theme.bar.menus.menu.notifications.no_notifications_label": "#313244", - "theme.bar.menus.menu.notifications.label": "#b4befe", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f5c2e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f5c2e8", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f5c2e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a6e3a1", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a6e3a2", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a6e3a1", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f9e2af", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f9e2ae", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f9e2af", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eba0ac", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eba0ad", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eba0ac", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#45475a", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#b4befe", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#cba6f7", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#94e2d5", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eba0ac", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f9e2af", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f5c2e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f5c2e7", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eba0ac", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f9e2af", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#89dceb", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#181824", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#cba6f7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#585b70", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a6e3a1", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#181824", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#b4befe", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#89dceb", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a6e3a1", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fab387", - "theme.bar.menus.menu.dashboard.profile.name": "#f5c2e7", - "theme.bar.menus.menu.dashboard.border.color": "#313244", - "theme.bar.menus.menu.dashboard.background.color": "#11111b", - "theme.bar.menus.menu.dashboard.card.color": "#1e1e2e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#89dceb", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#89b4fa", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#b4befe", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fab387", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#f38ba8", - "theme.bar.menus.menu.clock.weather.stats": "#f5c2e7", - "theme.bar.menus.menu.clock.weather.status": "#94e2d5", - "theme.bar.menus.menu.clock.weather.temperature": "#cdd6f4", - "theme.bar.menus.menu.clock.weather.icon": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#585b70", - "theme.bar.menus.menu.clock.calendar.days": "#cdd6f4", - "theme.bar.menus.menu.clock.calendar.currentday": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#f5c2e6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f5c2e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#94e2d5", - "theme.bar.menus.menu.clock.time.timeperiod": "#94e2d5", - "theme.bar.menus.menu.clock.time.time": "#f5c2e7", - "theme.bar.menus.menu.clock.text": "#cdd6f4", - "theme.bar.menus.menu.clock.border.color": "#313244", - "theme.bar.menus.menu.clock.background.color": "#11111b", - "theme.bar.menus.menu.clock.card.color": "#1e1e2e", - "theme.bar.menus.menu.battery.slider.puck": "#6c7086", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.battery.slider.background": "#585b71", - "theme.bar.menus.menu.battery.slider.primary": "#f9e2af", - "theme.bar.menus.menu.battery.icons.active": "#f9e2af", - "theme.bar.menus.menu.battery.icons.passive": "#9399b2", - "theme.bar.menus.menu.battery.listitems.active": "#f9e2af", - "theme.bar.menus.menu.battery.listitems.passive": "#cdd6f3", - "theme.bar.menus.menu.battery.text": "#cdd6f4", - "theme.bar.menus.menu.battery.label.color": "#f9e2af", - "theme.bar.menus.menu.battery.border.color": "#313244", - "theme.bar.menus.menu.battery.background.color": "#11111b", - "theme.bar.menus.menu.battery.card.color": "#1e1e2e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1e1e2e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#cdd6f4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#11111b", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#89dceb", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.icons.active": "#89dceb", - "theme.bar.menus.menu.bluetooth.icons.passive": "#9399b2", - "theme.bar.menus.menu.bluetooth.listitems.active": "#89dcea", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#454759", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#313245", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#89dceb", - "theme.bar.menus.menu.bluetooth.switch_divider": "#45475a", - "theme.bar.menus.menu.bluetooth.status": "#6c7086", - "theme.bar.menus.menu.bluetooth.text": "#cdd6f4", - "theme.bar.menus.menu.bluetooth.label.color": "#89dceb", - "theme.bar.menus.menu.bluetooth.border.color": "#313244", - "theme.bar.menus.menu.bluetooth.background.color": "#11111b", - "theme.bar.menus.menu.bluetooth.card.color": "#1e1e2e", - "theme.bar.menus.menu.network.iconbuttons.active": "#cba6f7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#cdd6f4", - "theme.bar.menus.menu.network.icons.active": "#cba6f7", - "theme.bar.menus.menu.network.icons.passive": "#9399b2", - "theme.bar.menus.menu.network.listitems.active": "#cba6f6", - "theme.bar.menus.menu.network.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.network.status.color": "#6c7086", - "theme.bar.menus.menu.network.text": "#cdd6f4", - "theme.bar.menus.menu.network.label.color": "#cba6f7", - "theme.bar.menus.menu.network.border.color": "#313244", - "theme.bar.menus.menu.network.background.color": "#11111b", - "theme.bar.menus.menu.network.card.color": "#1e1e2e", - "theme.bar.menus.menu.volume.input_slider.puck": "#585b70", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.volume.input_slider.background": "#585b71", - "theme.bar.menus.menu.volume.input_slider.primary": "#eba0ac", - "theme.bar.menus.menu.volume.audio_slider.puck": "#585b70", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.volume.audio_slider.background": "#585b71", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eba0ac", - "theme.bar.menus.menu.volume.icons.active": "#eba0ac", - "theme.bar.menus.menu.volume.icons.passive": "#9399b2", - "theme.bar.menus.menu.volume.iconbutton.active": "#eba0ac", - "theme.bar.menus.menu.volume.iconbutton.passive": "#cdd6f4", - "theme.bar.menus.menu.volume.listitems.active": "#eba0ab", - "theme.bar.menus.menu.volume.listitems.passive": "#cdd6f4", - "theme.bar.menus.menu.volume.border.color": "#313244", - "theme.bar.menus.menu.volume.background.color": "#11111b", - "theme.bar.menus.menu.media.slider.puck": "#6c7086", - "theme.bar.menus.menu.media.slider.backgroundhover": "#45475a", - "theme.bar.menus.menu.media.slider.background": "#585b71", - "theme.bar.menus.menu.media.slider.primary": "#f5c2e7", - "theme.bar.menus.menu.media.buttons.text": "#11111b", - "theme.bar.menus.menu.media.buttons.background": "#b4beff", - "theme.bar.menus.menu.media.buttons.enabled": "#94e2d4", - "theme.bar.menus.menu.media.buttons.inactive": "#585b70", - "theme.bar.menus.menu.media.border.color": "#313244", - "theme.bar.menus.menu.media.background.color": "#11111b", - "theme.bar.menus.menu.media.album": "#f5c2e8", - "theme.bar.menus.menu.media.artist": "#94e2d6", - "theme.bar.menus.menu.media.song": "#b4beff", - "theme.bar.menus.tooltip.text": "#cdd6f4", - "theme.bar.menus.tooltip.background": "#11111b", - "theme.bar.menus.dropdownmenu.divider": "#1e1e2e", - "theme.bar.menus.dropdownmenu.text": "#cdd6f4", - "theme.bar.menus.dropdownmenu.background": "#11111b", - "theme.bar.menus.slider.puck": "#6c7086", - "theme.bar.menus.slider.backgroundhover": "#45475a", - "theme.bar.menus.slider.background": "#585b71", - "theme.bar.menus.slider.primary": "#b4befe", - "theme.bar.menus.progressbar.background": "#45475a", - "theme.bar.menus.progressbar.foreground": "#b4befe", - "theme.bar.menus.iconbuttons.active": "#b4beff", - "theme.bar.menus.iconbuttons.passive": "#cdd6f3", - "theme.bar.menus.buttons.text": "#181824", - "theme.bar.menus.buttons.disabled": "#585b71", - "theme.bar.menus.buttons.active": "#f5c2e6", - "theme.bar.menus.buttons.default": "#b4befe", - "theme.bar.menus.switch.puck": "#454759", - "theme.bar.menus.switch.disabled": "#313245", - "theme.bar.menus.switch.enabled": "#b4befe", - "theme.bar.menus.icons.active": "#b4befe", - "theme.bar.menus.icons.passive": "#585b70", - "theme.bar.menus.listitems.active": "#b4befd", - "theme.bar.menus.listitems.passive": "#cdd6f4", - "theme.bar.menus.label": "#b4befe", - "theme.bar.menus.feinttext": "#313244", - "theme.bar.menus.dimtext": "#585b70", - "theme.bar.menus.cards": "#1e1e2e", - "theme.bar.buttons.notifications.total": "#b4befe", - "theme.bar.buttons.notifications.icon": "#1e1e2e", - "theme.bar.buttons.notifications.background": "#242438", - "theme.bar.buttons.clock.icon": "#232338", - "theme.bar.buttons.clock.text": "#f5c2e7", - "theme.bar.buttons.clock.background": "#242438", - "theme.bar.buttons.battery.icon": "#242438", - "theme.bar.buttons.battery.text": "#f9e2af", - "theme.bar.buttons.battery.background": "#242438", - "theme.bar.buttons.systray.background": "#242438", - "theme.bar.buttons.bluetooth.icon": "#1e1e2e", - "theme.bar.buttons.bluetooth.text": "#89dceb", - "theme.bar.buttons.bluetooth.background": "#242438", - "theme.bar.buttons.network.icon": "#242438", - "theme.bar.buttons.network.text": "#cba6f7", - "theme.bar.buttons.network.background": "#242438", - "theme.bar.buttons.volume.icon": "#242438", - "theme.bar.buttons.volume.text": "#eba0ac", - "theme.bar.buttons.volume.background": "#242438", - "theme.bar.buttons.windowtitle.icon": "#1e1e2e", - "theme.bar.buttons.windowtitle.text": "#f5c2e7", - "theme.bar.buttons.windowtitle.background": "#242438", - "theme.bar.buttons.workspaces.active": "#f5c2e7", - "theme.bar.buttons.workspaces.occupied": "#f2cdcd", - "theme.bar.buttons.workspaces.available": "#89dceb", - "theme.bar.buttons.workspaces.hover": "#f5c2e7", - "theme.bar.buttons.workspaces.background": "#242438", - "theme.bar.buttons.dashboard.icon": "#1e1e2e", - "theme.bar.buttons.dashboard.background": "#f9e2af", - "theme.osd.label": "#b4beff", - "theme.osd.icon": "#11111b", - "theme.osd.bar_overflow_color": "#f38ba7", - "theme.osd.bar_empty_color": "#313244", - "theme.osd.bar_color": "#b4beff", - "theme.osd.icon_container": "#b4beff", - "theme.osd.bar_container": "#11111b", - "theme.notification.close_button.label": "#11111b", - "theme.notification.close_button.background": "#f38ba7", - "theme.notification.labelicon": "#b4befe", - "theme.notification.text": "#cdd6f4", - "theme.notification.time": "#7f849b", - "theme.notification.border": "#313243", - "theme.notification.label": "#b4befe", - "theme.notification.actions.text": "#181825", - "theme.notification.actions.background": "#b4befd", - "theme.notification.background": "#181826", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#f5c2e7", - "theme.bar.menus.menu.media.card.color": "#1e1e2e", - "theme.bar.menus.check_radio_button.background": "#45475a", - "theme.bar.menus.check_radio_button.active": "#b4beff", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#eba0ac", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.buttons.windowtitle.icon_background": "#f5c2e7", - "theme.bar.buttons.media.icon_background": "#b4befe", - "theme.bar.buttons.notifications.icon_background": "#b4befe", - "theme.bar.buttons.battery.icon_background": "#f9e2af", - "theme.bar.buttons.clock.icon_background": "#f5c2e7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#b4befe", - "theme.bar.menus.menu.notifications.pager.button": "#b4befe", - "theme.bar.menus.menu.notifications.pager.label": "#9399b2", - "theme.bar.menus.menu.notifications.pager.background": "#11111b", - "theme.bar.buttons.modules.ram.icon_background": "#f9e2af", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#f38ba8", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#f5c2e7", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.netstat.icon_background": "#a6e3a1", - "theme.bar.buttons.modules.kbLayout.icon_background": "#89dceb", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.updates.icon_background": "#cba6f7", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.weather.icon_background": "#b4befe", - "theme.bar.buttons.modules.weather.text": "#b4befe", - "theme.bar.buttons.modules.weather.icon": "#242438", - "theme.bar.buttons.modules.power.icon_background": "#f38ba8", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.menus.menu.power.background.color": "#11111b", - "theme.bar.menus.menu.power.border.color": "#313244", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1e1e2e", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#f38ba7", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#f38ba8", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#181824", - "theme.bar.buttons.modules.netstat.background": "#242438", - "theme.bar.buttons.modules.cpu.background": "#242438", - "theme.bar.buttons.modules.cpu.text": "#f38ba8", - "theme.bar.buttons.modules.storage.text": "#f5c2e7", - "theme.bar.menus.popover.border": "#181824", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#89dceb", - "theme.bar.menus.menu.power.buttons.restart.text": "#fab387", - "theme.bar.buttons.modules.updates.background": "#242438", - "theme.bar.buttons.modules.netstat.text": "#a6e3a1", - "theme.bar.buttons.modules.storage.background": "#242438", - "theme.bar.menus.menu.power.buttons.logout.icon": "#181824", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fab387", - "theme.bar.menus.menu.power.buttons.restart.icon": "#181824", - "theme.bar.menus.menu.power.buttons.sleep.text": "#89dceb", - "theme.bar.menus.menu.power.buttons.logout.background": "#1e1e2e", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1e1e2e", - "theme.bar.buttons.modules.ram.text": "#f9e2af", - "theme.bar.menus.menu.power.buttons.logout.text": "#a6e3a1", - "theme.bar.buttons.modules.kbLayout.background": "#242438", - "theme.bar.buttons.modules.power.background": "#242438", - "theme.bar.buttons.modules.weather.background": "#242438", - "theme.bar.buttons.modules.ram.background": "#242438", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a6e3a1", - "theme.bar.buttons.modules.updates.text": "#cba6f7", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#181824", - "theme.bar.menus.menu.power.buttons.restart.background": "#1e1e2e", - "theme.bar.buttons.modules.kbLayout.text": "#89dceb", - "theme.bar.buttons.windowtitle.border": "#f5c2e7", - "theme.bar.buttons.modules.power.border": "#f38ba8", - "theme.bar.buttons.modules.weather.border": "#b4befe", - "theme.bar.buttons.modules.updates.border": "#cba6f7", - "theme.bar.buttons.modules.kbLayout.border": "#89dceb", - "theme.bar.buttons.modules.netstat.border": "#a6e3a1", - "theme.bar.buttons.modules.storage.border": "#f5c2e7", - "theme.bar.buttons.modules.cpu.border": "#f38ba8", - "theme.bar.buttons.modules.ram.border": "#f9e2af", - "theme.bar.buttons.notifications.border": "#b4befe", - "theme.bar.buttons.clock.border": "#f5c2e7", - "theme.bar.buttons.battery.border": "#f9e2af", - "theme.bar.buttons.systray.border": "#b4befe", - "theme.bar.buttons.bluetooth.border": "#89dceb", - "theme.bar.buttons.network.border": "#cba6f7", - "theme.bar.buttons.volume.border": "#eba0ac", - "theme.bar.buttons.media.border": "#b4befe", - "theme.bar.buttons.workspaces.border": "#f5c2e7", - "theme.bar.buttons.dashboard.border": "#f9e2af", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.background": "#242438", - "theme.bar.buttons.modules.submap.icon_background": "#94e2d5", - "theme.bar.buttons.modules.submap.text": "#94e2d5", - "theme.bar.buttons.modules.submap.border": "#94e2d5" -} diff --git a/ags/HyprPanel/themes/cyberpunk.json b/ags/HyprPanel/themes/cyberpunk.json deleted file mode 100644 index 50a6a09..0000000 --- a/ags/HyprPanel/themes/cyberpunk.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#FFD700", - "theme.bar.menus.menu.notifications.pager.label": "#9399B2", - "theme.bar.menus.menu.notifications.pager.button": "#FFD700", - "theme.bar.menus.menu.notifications.pager.background": "#0A0A0A", - "theme.bar.menus.menu.notifications.switch.puck": "#333333", - "theme.bar.menus.menu.notifications.switch.disabled": "#2A2A2A", - "theme.bar.menus.menu.notifications.switch.enabled": "#FFD700", - "theme.bar.menus.menu.notifications.clear": "#FF4500", - "theme.bar.menus.menu.notifications.switch_divider": "#333333", - "theme.bar.menus.menu.notifications.border": "#2A2A2A", - "theme.bar.menus.menu.notifications.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.background": "#0A0A0A", - "theme.bar.menus.menu.notifications.no_notifications_label": "#2A2A2A", - "theme.bar.menus.menu.notifications.label": "#FFD700", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.sleep.text": "#00FFFF", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#00FFFF", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.logout.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.logout.text": "#32CD32", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#32CD32", - "theme.bar.menus.menu.power.buttons.logout.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.restart.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.restart.text": "#FFD700", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#FFD700", - "theme.bar.menus.menu.power.buttons.restart.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#FF4500", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ff4400", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1A1A1A", - "theme.bar.menus.menu.power.border.color": "#2A2A2A", - "theme.bar.menus.menu.power.background.color": "#0A0A0A", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#333333", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#00FFFF", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#FFD700", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#32CD32", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#FF4500", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#FFD700", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.input.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.input.background": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#FF4500", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#FFD700", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#00FFFF", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.disabled": "#585858", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#32CD32", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#FF4500", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#32CD32", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#2A2A2A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#0A0A0A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1A1A1A", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#32CD32", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#FFD700", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#FF4500", - "theme.bar.menus.menu.dashboard.profile.name": "#FF69B4", - "theme.bar.menus.menu.dashboard.border.color": "#2A2A2A", - "theme.bar.menus.menu.dashboard.background.color": "#0A0A0A", - "theme.bar.menus.menu.dashboard.card.color": "#1A1A1A", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#FF69B4", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#FF69B4", - "theme.bar.menus.menu.clock.weather.hourly.time": "#FF69B4", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#00FFFF", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#00BFFF", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#00FFFF", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#FFD700", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#FFD700", - "theme.bar.menus.menu.clock.weather.stats": "#00FFFF", - "theme.bar.menus.menu.clock.weather.status": "#FF69B4", - "theme.bar.menus.menu.clock.weather.temperature": "#32CD32", - "theme.bar.menus.menu.clock.weather.icon": "#FFD700", - "theme.bar.menus.menu.clock.calendar.contextdays": "#585858", - "theme.bar.menus.menu.clock.calendar.days": "#FFD700", - "theme.bar.menus.menu.clock.calendar.currentday": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.paginator": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.weekdays": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#FF69B4", - "theme.bar.menus.menu.clock.time.timeperiod": "#32CD32", - "theme.bar.menus.menu.clock.time.time": "#FFD700", - "theme.bar.menus.menu.clock.text": "#00FFFF", - "theme.bar.menus.menu.clock.border.color": "#2A2A2A", - "theme.bar.menus.menu.clock.background.color": "#0A0A0A", - "theme.bar.menus.menu.clock.card.color": "#1A1A1A", - "theme.bar.menus.menu.battery.slider.puck": "#333333", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.battery.slider.background": "#2A2A2A", - "theme.bar.menus.menu.battery.slider.primary": "#FFD700", - "theme.bar.menus.menu.battery.icons.active": "#FFD700", - "theme.bar.menus.menu.battery.icons.passive": "#9399B2", - "theme.bar.menus.menu.battery.listitems.active": "#FFD700", - "theme.bar.menus.menu.battery.listitems.passive": "#00FFFF", - "theme.bar.menus.menu.battery.text": "#FFD700", - "theme.bar.menus.menu.battery.label.color": "#FFD700", - "theme.bar.menus.menu.battery.border.color": "#2A2A2A", - "theme.bar.menus.menu.battery.background.color": "#0A0A0A", - "theme.bar.menus.menu.battery.card.color": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#FFD700", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#0A0A0A", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#FFD700", - "theme.bar.menus.menu.bluetooth.icons.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.icons.passive": "#9399B2", - "theme.bar.menus.menu.bluetooth.listitems.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#FFD700", - "theme.bar.menus.menu.bluetooth.switch.puck": "#333333", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2A2A2A", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#00FFFF", - "theme.bar.menus.menu.bluetooth.switch_divider": "#333333", - "theme.bar.menus.menu.bluetooth.status": "#FF69B4", - "theme.bar.menus.menu.bluetooth.text": "#FFD700", - "theme.bar.menus.menu.bluetooth.label.color": "#00FFFF", - "theme.bar.menus.menu.bluetooth.border.color": "#2A2A2A", - "theme.bar.menus.menu.bluetooth.background.color": "#0A0A0A", - "theme.bar.menus.menu.bluetooth.card.color": "#1A1A1A", - "theme.bar.menus.menu.network.iconbuttons.active": "#FF69B4", - "theme.bar.menus.menu.network.iconbuttons.passive": "#FFD700", - "theme.bar.menus.menu.network.icons.active": "#FF69B4", - "theme.bar.menus.menu.network.icons.passive": "#9399B2", - "theme.bar.menus.menu.network.listitems.active": "#FF69B4", - "theme.bar.menus.menu.network.listitems.passive": "#FFD700", - "theme.bar.menus.menu.network.status.color": "#FF69B4", - "theme.bar.menus.menu.network.text": "#FFD700", - "theme.bar.menus.menu.network.label.color": "#FF69B4", - "theme.bar.menus.menu.network.border.color": "#2A2A2A", - "theme.bar.menus.menu.network.background.color": "#0A0A0A", - "theme.bar.menus.menu.network.card.color": "#1A1A1A", - "theme.bar.menus.menu.volume.input_slider.puck": "#333333", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.volume.input_slider.background": "#2A2A2A", - "theme.bar.menus.menu.volume.input_slider.primary": "#FF69B4", - "theme.bar.menus.menu.volume.audio_slider.puck": "#333333", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.volume.audio_slider.background": "#2A2A2A", - "theme.bar.menus.menu.volume.audio_slider.primary": "#FF69B4", - "theme.bar.menus.menu.volume.icons.active": "#FF69B4", - "theme.bar.menus.menu.volume.icons.passive": "#9399B2", - "theme.bar.menus.menu.volume.iconbutton.active": "#FF69B4", - "theme.bar.menus.menu.volume.iconbutton.passive": "#FFD700", - "theme.bar.menus.menu.volume.listitems.active": "#FF69B4", - "theme.bar.menus.menu.volume.listitems.passive": "#FFD700", - "theme.bar.menus.menu.volume.text": "#FFFFFF", - "theme.bar.menus.menu.volume.label.color": "#FF69B4", - "theme.bar.menus.menu.volume.border.color": "#2A2A2A", - "theme.bar.menus.menu.volume.background.color": "#0A0A0A", - "theme.bar.menus.menu.volume.card.color": "#1A1A1A", - "theme.bar.menus.menu.media.slider.puck": "#333333", - "theme.bar.menus.menu.media.slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.media.slider.background": "#2A2A2A", - "theme.bar.menus.menu.media.slider.primary": "#FFD700", - "theme.bar.menus.menu.media.buttons.text": "#0A0A0A", - "theme.bar.menus.menu.media.buttons.background": "#FF69B4", - "theme.bar.menus.menu.media.buttons.enabled": "#00FFFF", - "theme.bar.menus.menu.media.buttons.inactive": "#333333", - "theme.bar.menus.menu.media.border.color": "#2A2A2A", - "theme.bar.menus.menu.media.card.color": "#1A1A1A", - "theme.bar.menus.menu.media.background.color": "#0A0A0A", - "theme.bar.menus.menu.media.album": "#FF69B4", - "theme.bar.menus.menu.media.artist": "#00FFFF", - "theme.bar.menus.menu.media.song": "#FFD700", - "theme.bar.menus.tooltip.text": "#FFD700", - "theme.bar.menus.tooltip.background": "#0A0A0A", - "theme.bar.menus.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.dropdownmenu.text": "#FFD700", - "theme.bar.menus.dropdownmenu.background": "#0A0A0A", - "theme.bar.menus.slider.puck": "#333333", - "theme.bar.menus.slider.backgroundhover": "#45475A", - "theme.bar.menus.slider.background": "#2A2A2A", - "theme.bar.menus.slider.primary": "#00FFFF", - "theme.bar.menus.progressbar.background": "#45475A", - "theme.bar.menus.progressbar.foreground": "#00FFFF", - "theme.bar.menus.iconbuttons.active": "#00FFFF", - "theme.bar.menus.iconbuttons.passive": "#FFD700", - "theme.bar.menus.buttons.text": "#0A0A0A", - "theme.bar.menus.buttons.disabled": "#333333", - "theme.bar.menus.buttons.active": "#00FFFF", - "theme.bar.menus.buttons.default": "#FFD700", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.switch.puck": "#333333", - "theme.bar.menus.switch.disabled": "#2A2A2A", - "theme.bar.menus.switch.enabled": "#00FFFF", - "theme.bar.menus.icons.active": "#00FFFF", - "theme.bar.menus.icons.passive": "#333333", - "theme.bar.menus.listitems.active": "#00FFFF", - "theme.bar.menus.listitems.passive": "#FFD700", - "theme.bar.menus.popover.border": "#0A0A0A", - "theme.bar.menus.popover.background": "#0D0D0D", - "theme.bar.menus.popover.text": "#00FFFF", - "theme.bar.menus.label": "#00FFFF", - "theme.bar.menus.feinttext": "#1a1a1a", - "theme.bar.menus.dimtext": "#2b2b2b", - "theme.bar.menus.text": "#FFFFFF", - "theme.bar.menus.border.color": "#2A2A2A", - "theme.bar.menus.cards": "#0a0a0a", - "theme.bar.menus.background": "#0A0A0A", - "theme.bar.buttons.modules.power.icon_background": "#FF4500", - "theme.bar.buttons.modules.power.icon": "#FF4500", - "theme.bar.buttons.modules.power.background": "#121212", - "theme.bar.buttons.modules.weather.icon_background": "#FFD700", - "theme.bar.buttons.modules.weather.icon": "#FFD700", - "theme.bar.buttons.modules.weather.text": "#FFD700", - "theme.bar.buttons.modules.weather.background": "#121212", - "theme.bar.buttons.modules.updates.icon_background": "#FFD700", - "theme.bar.buttons.modules.updates.icon": "#FFD700", - "theme.bar.buttons.modules.updates.text": "#FFD700", - "theme.bar.buttons.modules.updates.background": "#121212", - "theme.bar.buttons.modules.kbLayout.icon_background": "#00FFFF", - "theme.bar.buttons.modules.kbLayout.icon": "#00FFFF", - "theme.bar.buttons.modules.kbLayout.text": "#00FFFF", - "theme.bar.buttons.modules.kbLayout.background": "#121212", - "theme.bar.buttons.modules.netstat.icon_background": "#32CD32", - "theme.bar.buttons.modules.netstat.icon": "#32CD32", - "theme.bar.buttons.modules.netstat.text": "#32CD32", - "theme.bar.buttons.modules.netstat.background": "#121212", - "theme.bar.buttons.modules.storage.icon_background": "#FF4500", - "theme.bar.buttons.modules.storage.icon": "#FF4500", - "theme.bar.buttons.modules.storage.text": "#FF4500", - "theme.bar.buttons.modules.storage.background": "#121212", - "theme.bar.buttons.modules.cpu.icon_background": "#FF4500", - "theme.bar.buttons.modules.cpu.icon": "#FF4500", - "theme.bar.buttons.modules.cpu.text": "#FF4500", - "theme.bar.buttons.modules.cpu.background": "#121212", - "theme.bar.buttons.modules.ram.icon_background": "#FFD700", - "theme.bar.buttons.modules.ram.icon": "#FFD700", - "theme.bar.buttons.modules.ram.text": "#FFD700", - "theme.bar.buttons.modules.ram.background": "#121212", - "theme.bar.buttons.notifications.total": "#f7d04b", - "theme.bar.buttons.notifications.icon_background": "#FFD700", - "theme.bar.buttons.notifications.icon": "#f7d04b", - "theme.bar.buttons.notifications.background": "#121212", - "theme.bar.buttons.clock.icon_background": "#FF69B4", - "theme.bar.buttons.clock.icon": "#5bafff", - "theme.bar.buttons.clock.text": "#5bafff", - "theme.bar.buttons.clock.background": "#121212", - "theme.bar.buttons.battery.icon_background": "#FFD700", - "theme.bar.buttons.battery.icon": "#f7d04b", - "theme.bar.buttons.battery.text": "#f7d04b", - "theme.bar.buttons.battery.background": "#121212", - "theme.bar.buttons.systray.background": "#121212", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.buttons.bluetooth.icon": "#5bafff", - "theme.bar.buttons.bluetooth.text": "#5bafff", - "theme.bar.buttons.bluetooth.background": "#121212", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.network.icon": "#e23fe2", - "theme.bar.buttons.network.text": "#e23fe2", - "theme.bar.buttons.network.background": "#121212", - "theme.bar.buttons.volume.icon_background": "#FF4500", - "theme.bar.buttons.volume.icon": "#ff3f3f", - "theme.bar.buttons.volume.text": "#ff3f3f", - "theme.bar.buttons.volume.background": "#121212", - "theme.bar.buttons.media.icon_background": "#FFD700", - "theme.bar.buttons.media.icon": "#FFD700", - "theme.bar.buttons.media.text": "#00FFFF", - "theme.bar.buttons.media.background": "#111111", - "theme.bar.buttons.windowtitle.icon_background": "#FF69B4", - "theme.bar.buttons.windowtitle.icon": "#5bafff", - "theme.bar.buttons.windowtitle.text": "#5bafff", - "theme.bar.buttons.windowtitle.background": "#121212", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#e23ee2", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.active": "#e23fe2", - "theme.bar.buttons.workspaces.occupied": "#ff3f3f", - "theme.bar.buttons.workspaces.available": "#5bafff", - "theme.bar.buttons.workspaces.hover": "#303030", - "theme.bar.buttons.workspaces.background": "#121212", - "theme.bar.buttons.dashboard.icon": "#f7d04b", - "theme.bar.buttons.dashboard.background": "#121212", - "theme.bar.buttons.icon": "#FFD700", - "theme.bar.buttons.text": "#00FFFF", - "theme.bar.buttons.hover": "#333333", - "theme.bar.buttons.icon_background": "#121212", - "theme.bar.buttons.background": "#111111", - "theme.bar.buttons.style": "default", - "theme.bar.background": "#0A0A0A", - "theme.osd.label": "#5bafff", - "theme.osd.icon": "#0a0a0a", - "theme.osd.bar_overflow_color": "#ff3f3f", - "theme.osd.bar_empty_color": "#1a1a1a", - "theme.osd.bar_color": "#5bafff", - "theme.osd.icon_container": "#5bafff", - "theme.osd.bar_container": "#0a0a0a", - "theme.notification.close_button.label": "#0a0a0a", - "theme.notification.close_button.background": "#ff3f3f", - "theme.notification.labelicon": "#5bafff", - "theme.notification.text": "#d1d1d1", - "theme.notification.time": "#797979", - "theme.notification.border": "#1a1a1a", - "theme.notification.label": "#5bafff", - "theme.notification.actions.text": "#0a0a0a", - "theme.notification.actions.background": "#5bafff", - "theme.notification.background": "#0a0a0a", - "theme.bar.buttons.modules.power.border": "#FF4500", - "theme.bar.buttons.modules.weather.border": "#FFD700", - "theme.bar.buttons.modules.updates.border": "#FFD700", - "theme.bar.buttons.modules.kbLayout.border": "#00FFFF", - "theme.bar.buttons.modules.netstat.border": "#32CD32", - "theme.bar.buttons.modules.storage.border": "#FF4500", - "theme.bar.buttons.modules.cpu.border": "#FF4500", - "theme.bar.buttons.modules.ram.border": "#FFD700", - "theme.bar.buttons.notifications.border": "#f7d04b", - "theme.bar.buttons.clock.border": "#5bafff", - "theme.bar.buttons.battery.border": "#f7d04b", - "theme.bar.buttons.systray.border": "#303030", - "theme.bar.buttons.bluetooth.border": "#5bafff", - "theme.bar.buttons.network.border": "#e23fe2", - "theme.bar.buttons.volume.border": "#ff3f3f", - "theme.bar.buttons.media.border": "#FFD700", - "theme.bar.buttons.windowtitle.border": "#5bafff", - "theme.bar.buttons.workspaces.border": "#e23ee2", - "theme.bar.buttons.dashboard.border": "#f7d04b", - "theme.bar.buttons.modules.submap.background": "#121212", - "theme.bar.buttons.modules.submap.text": "#FF69B4", - "theme.bar.buttons.modules.submap.border": "#FF69B4", - "theme.bar.buttons.modules.submap.icon": "#FF69B4", - "theme.bar.buttons.modules.submap.icon_background": "#121212" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/cyberpunk_split.json b/ags/HyprPanel/themes/cyberpunk_split.json deleted file mode 100644 index b7b183a..0000000 --- a/ags/HyprPanel/themes/cyberpunk_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#00ffff", - "theme.bar.menus.menu.notifications.pager.label": "#9399B2", - "theme.bar.menus.menu.notifications.pager.button": "#00ffff", - "theme.bar.menus.menu.notifications.pager.background": "#0A0A0A", - "theme.bar.menus.menu.notifications.switch.puck": "#333333", - "theme.bar.menus.menu.notifications.switch.disabled": "#2A2A2A", - "theme.bar.menus.menu.notifications.switch.enabled": "#FFD700", - "theme.bar.menus.menu.notifications.clear": "#FF4500", - "theme.bar.menus.menu.notifications.switch_divider": "#333333", - "theme.bar.menus.menu.notifications.border": "#2A2A2A", - "theme.bar.menus.menu.notifications.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.background": "#0A0A0A", - "theme.bar.menus.menu.notifications.no_notifications_label": "#2A2A2A", - "theme.bar.menus.menu.notifications.label": "#FFD700", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.sleep.text": "#00FFFF", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#00FFFF", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.logout.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.logout.text": "#32CD32", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#32CD32", - "theme.bar.menus.menu.power.buttons.logout.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.restart.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.restart.text": "#FFD700", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#FFD700", - "theme.bar.menus.menu.power.buttons.restart.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#0A0A0A", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#FF4500", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ff4400", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1A1A1A", - "theme.bar.menus.menu.power.border.color": "#2A2A2A", - "theme.bar.menus.menu.power.background.color": "#0A0A0A", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#FF69B4", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#32CD32", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#FFD700", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#FF4500", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#333333", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#00FFFF", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#FFD700", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#32CD32", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#FF4500", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#FFD700", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.input.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.input.background": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#FF4500", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#FFD700", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#00FFFF", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#FF69B4", - "theme.bar.menus.menu.dashboard.controls.disabled": "#585858", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#32CD32", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#0A0A0A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#FF4500", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#32CD32", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#2A2A2A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#0A0A0A", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1A1A1A", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#00FFFF", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#32CD32", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#FFD700", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#FF4500", - "theme.bar.menus.menu.dashboard.profile.name": "#FF69B4", - "theme.bar.menus.menu.dashboard.border.color": "#2A2A2A", - "theme.bar.menus.menu.dashboard.background.color": "#0A0A0A", - "theme.bar.menus.menu.dashboard.card.color": "#1A1A1A", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#FF69B4", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#FF69B4", - "theme.bar.menus.menu.clock.weather.hourly.time": "#FF69B4", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#00FFFF", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#00BFFF", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#00FFFF", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#FFD700", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#FFD700", - "theme.bar.menus.menu.clock.weather.stats": "#00FFFF", - "theme.bar.menus.menu.clock.weather.status": "#FF69B4", - "theme.bar.menus.menu.clock.weather.temperature": "#32CD32", - "theme.bar.menus.menu.clock.weather.icon": "#FFD700", - "theme.bar.menus.menu.clock.calendar.contextdays": "#585858", - "theme.bar.menus.menu.clock.calendar.days": "#FFD700", - "theme.bar.menus.menu.clock.calendar.currentday": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.paginator": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.weekdays": "#00FFFF", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#FF69B4", - "theme.bar.menus.menu.clock.time.timeperiod": "#32CD32", - "theme.bar.menus.menu.clock.time.time": "#FFD700", - "theme.bar.menus.menu.clock.text": "#00FFFF", - "theme.bar.menus.menu.clock.border.color": "#2A2A2A", - "theme.bar.menus.menu.clock.background.color": "#0A0A0A", - "theme.bar.menus.menu.clock.card.color": "#1A1A1A", - "theme.bar.menus.menu.battery.slider.puck": "#333333", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.battery.slider.background": "#2A2A2A", - "theme.bar.menus.menu.battery.slider.primary": "#FFD700", - "theme.bar.menus.menu.battery.icons.active": "#FFD700", - "theme.bar.menus.menu.battery.icons.passive": "#9399B2", - "theme.bar.menus.menu.battery.listitems.active": "#FFD700", - "theme.bar.menus.menu.battery.listitems.passive": "#00FFFF", - "theme.bar.menus.menu.battery.text": "#FFD700", - "theme.bar.menus.menu.battery.label.color": "#FFD700", - "theme.bar.menus.menu.battery.border.color": "#2A2A2A", - "theme.bar.menus.menu.battery.background.color": "#0A0A0A", - "theme.bar.menus.menu.battery.card.color": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#FFD700", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#0A0A0A", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#FFD700", - "theme.bar.menus.menu.bluetooth.icons.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.icons.passive": "#9399B2", - "theme.bar.menus.menu.bluetooth.listitems.active": "#00FFFF", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#FFD700", - "theme.bar.menus.menu.bluetooth.switch.puck": "#333333", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2A2A2A", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#00FFFF", - "theme.bar.menus.menu.bluetooth.switch_divider": "#333333", - "theme.bar.menus.menu.bluetooth.status": "#FF69B4", - "theme.bar.menus.menu.bluetooth.text": "#FFD700", - "theme.bar.menus.menu.bluetooth.label.color": "#00FFFF", - "theme.bar.menus.menu.bluetooth.border.color": "#2A2A2A", - "theme.bar.menus.menu.bluetooth.background.color": "#0A0A0A", - "theme.bar.menus.menu.bluetooth.card.color": "#1A1A1A", - "theme.bar.menus.menu.network.iconbuttons.active": "#FF69B4", - "theme.bar.menus.menu.network.iconbuttons.passive": "#FFD700", - "theme.bar.menus.menu.network.icons.active": "#FF69B4", - "theme.bar.menus.menu.network.icons.passive": "#9399B2", - "theme.bar.menus.menu.network.listitems.active": "#FF69B4", - "theme.bar.menus.menu.network.listitems.passive": "#FFD700", - "theme.bar.menus.menu.network.status.color": "#FF69B4", - "theme.bar.menus.menu.network.text": "#FFD700", - "theme.bar.menus.menu.network.label.color": "#FF69B4", - "theme.bar.menus.menu.network.border.color": "#2A2A2A", - "theme.bar.menus.menu.network.background.color": "#0A0A0A", - "theme.bar.menus.menu.network.card.color": "#1A1A1A", - "theme.bar.menus.menu.volume.input_slider.puck": "#333333", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.volume.input_slider.background": "#2A2A2A", - "theme.bar.menus.menu.volume.input_slider.primary": "#FF69B4", - "theme.bar.menus.menu.volume.audio_slider.puck": "#333333", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.volume.audio_slider.background": "#2A2A2A", - "theme.bar.menus.menu.volume.audio_slider.primary": "#FF69B4", - "theme.bar.menus.menu.volume.icons.active": "#FF69B4", - "theme.bar.menus.menu.volume.icons.passive": "#9399B2", - "theme.bar.menus.menu.volume.iconbutton.active": "#FF69B4", - "theme.bar.menus.menu.volume.iconbutton.passive": "#FFD700", - "theme.bar.menus.menu.volume.listitems.active": "#FF69B4", - "theme.bar.menus.menu.volume.listitems.passive": "#FFD700", - "theme.bar.menus.menu.volume.text": "#FFFFFF", - "theme.bar.menus.menu.volume.label.color": "#FF69B4", - "theme.bar.menus.menu.volume.border.color": "#2A2A2A", - "theme.bar.menus.menu.volume.background.color": "#0A0A0A", - "theme.bar.menus.menu.volume.card.color": "#1A1A1A", - "theme.bar.menus.menu.media.slider.puck": "#333333", - "theme.bar.menus.menu.media.slider.backgroundhover": "#45475A", - "theme.bar.menus.menu.media.slider.background": "#2A2A2A", - "theme.bar.menus.menu.media.slider.primary": "#FFD700", - "theme.bar.menus.menu.media.buttons.text": "#0A0A0A", - "theme.bar.menus.menu.media.buttons.background": "#FF69B4", - "theme.bar.menus.menu.media.buttons.enabled": "#00FFFF", - "theme.bar.menus.menu.media.buttons.inactive": "#333333", - "theme.bar.menus.menu.media.border.color": "#2A2A2A", - "theme.bar.menus.menu.media.card.color": "#1A1A1A", - "theme.bar.menus.menu.media.background.color": "#0A0A0A", - "theme.bar.menus.menu.media.album": "#FF69B4", - "theme.bar.menus.menu.media.artist": "#00FFFF", - "theme.bar.menus.menu.media.song": "#FFD700", - "theme.bar.menus.tooltip.text": "#FFD700", - "theme.bar.menus.tooltip.background": "#0A0A0A", - "theme.bar.menus.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.dropdownmenu.text": "#FFD700", - "theme.bar.menus.dropdownmenu.background": "#0A0A0A", - "theme.bar.menus.slider.puck": "#333333", - "theme.bar.menus.slider.backgroundhover": "#45475A", - "theme.bar.menus.slider.background": "#2A2A2A", - "theme.bar.menus.slider.primary": "#00FFFF", - "theme.bar.menus.progressbar.background": "#45475A", - "theme.bar.menus.progressbar.foreground": "#00FFFF", - "theme.bar.menus.iconbuttons.active": "#00FFFF", - "theme.bar.menus.iconbuttons.passive": "#FFD700", - "theme.bar.menus.buttons.text": "#0A0A0A", - "theme.bar.menus.buttons.disabled": "#333333", - "theme.bar.menus.buttons.active": "#00FFFF", - "theme.bar.menus.buttons.default": "#FFD700", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.switch.puck": "#333333", - "theme.bar.menus.switch.disabled": "#2A2A2A", - "theme.bar.menus.switch.enabled": "#00FFFF", - "theme.bar.menus.icons.active": "#00FFFF", - "theme.bar.menus.icons.passive": "#333333", - "theme.bar.menus.listitems.active": "#00FFFF", - "theme.bar.menus.listitems.passive": "#FFD700", - "theme.bar.menus.popover.border": "#0A0A0A", - "theme.bar.menus.popover.background": "#0D0D0D", - "theme.bar.menus.popover.text": "#00FFFF", - "theme.bar.menus.label": "#00FFFF", - "theme.bar.menus.feinttext": "#1a1a1a", - "theme.bar.menus.dimtext": "#2b2b2b", - "theme.bar.menus.text": "#FFFFFF", - "theme.bar.menus.border.color": "#2A2A2A", - "theme.bar.menus.cards": "#0a0a0a", - "theme.bar.menus.background": "#0A0A0A", - "theme.bar.buttons.modules.power.icon_background": "#FF4500", - "theme.bar.buttons.modules.power.icon": "#121212", - "theme.bar.buttons.modules.power.background": "#121212", - "theme.bar.buttons.modules.weather.icon_background": "#00ffff", - "theme.bar.buttons.modules.weather.icon": "#121212", - "theme.bar.buttons.modules.weather.text": "#00ffff", - "theme.bar.buttons.modules.weather.background": "#121212", - "theme.bar.buttons.modules.updates.icon_background": "#FFD700", - "theme.bar.buttons.modules.updates.icon": "#121212", - "theme.bar.buttons.modules.updates.text": "#FFD700", - "theme.bar.buttons.modules.updates.background": "#121212", - "theme.bar.buttons.modules.kbLayout.icon_background": "#00FFFF", - "theme.bar.buttons.modules.kbLayout.icon": "#121212", - "theme.bar.buttons.modules.kbLayout.text": "#00FFFF", - "theme.bar.buttons.modules.kbLayout.background": "#121212", - "theme.bar.buttons.modules.netstat.icon_background": "#32CD32", - "theme.bar.buttons.modules.netstat.icon": "#121212", - "theme.bar.buttons.modules.netstat.text": "#32CD32", - "theme.bar.buttons.modules.netstat.background": "#121212", - "theme.bar.buttons.modules.storage.icon_background": "#FF4500", - "theme.bar.buttons.modules.storage.icon": "#121212", - "theme.bar.buttons.modules.storage.text": "#FF4500", - "theme.bar.buttons.modules.storage.background": "#121212", - "theme.bar.buttons.modules.cpu.icon_background": "#FF4500", - "theme.bar.buttons.modules.cpu.icon": "#121212", - "theme.bar.buttons.modules.cpu.text": "#FF4500", - "theme.bar.buttons.modules.cpu.background": "#121212", - "theme.bar.buttons.modules.ram.icon_background": "#FFD700", - "theme.bar.buttons.modules.ram.icon": "#121212", - "theme.bar.buttons.modules.ram.text": "#FFD700", - "theme.bar.buttons.modules.ram.background": "#121212", - "theme.bar.buttons.notifications.total": "#f7d04b", - "theme.bar.buttons.notifications.icon_background": "#f7d04b", - "theme.bar.buttons.notifications.icon": "#121212", - "theme.bar.buttons.notifications.background": "#121212", - "theme.bar.buttons.clock.icon_background": "#5bafff", - "theme.bar.buttons.clock.icon": "#121212", - "theme.bar.buttons.clock.text": "#5bafff", - "theme.bar.buttons.clock.background": "#121212", - "theme.bar.buttons.battery.icon_background": "#f7d04b", - "theme.bar.buttons.battery.icon": "#121212", - "theme.bar.buttons.battery.text": "#f7d04b", - "theme.bar.buttons.battery.background": "#121212", - "theme.bar.buttons.systray.background": "#121212", - "theme.bar.buttons.bluetooth.icon_background": "#5bafff", - "theme.bar.buttons.bluetooth.icon": "#121212", - "theme.bar.buttons.bluetooth.text": "#5bafff", - "theme.bar.buttons.bluetooth.background": "#121212", - "theme.bar.buttons.network.icon_background": "#e23fe2", - "theme.bar.buttons.network.icon": "#121212", - "theme.bar.buttons.network.text": "#e23fe2", - "theme.bar.buttons.network.background": "#121212", - "theme.bar.buttons.volume.icon_background": "#ff3f3f", - "theme.bar.buttons.volume.icon": "#121212", - "theme.bar.buttons.volume.text": "#ff3f3f", - "theme.bar.buttons.volume.background": "#121212", - "theme.bar.buttons.media.icon_background": "#00ffff", - "theme.bar.buttons.media.icon": "#121212", - "theme.bar.buttons.media.text": "#00ffff", - "theme.bar.buttons.media.background": "#111111", - "theme.bar.buttons.windowtitle.icon_background": "#5bafff", - "theme.bar.buttons.windowtitle.icon": "#121212", - "theme.bar.buttons.windowtitle.text": "#5bafff", - "theme.bar.buttons.windowtitle.background": "#121212", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#e23ee2", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#e23fe2", - "theme.bar.buttons.workspaces.active": "#e23fe2", - "theme.bar.buttons.workspaces.occupied": "#ff3f3f", - "theme.bar.buttons.workspaces.available": "#5bafff", - "theme.bar.buttons.workspaces.hover": "#e23fe2", - "theme.bar.buttons.workspaces.background": "#121212", - "theme.bar.buttons.dashboard.icon": "#121212", - "theme.bar.buttons.dashboard.background": "#f7d04b", - "theme.bar.buttons.icon": "#FFD700", - "theme.bar.buttons.text": "#00FFFF", - "theme.bar.buttons.hover": "#333333", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#111111", - "theme.bar.buttons.style": "split", - "theme.bar.background": "#0A0A0A", - "theme.osd.label": "#5bafff", - "theme.osd.icon": "#0a0a0a", - "theme.osd.bar_overflow_color": "#ff3f3f", - "theme.osd.bar_empty_color": "#1a1a1a", - "theme.osd.bar_color": "#5bafff", - "theme.osd.icon_container": "#5bafff", - "theme.osd.bar_container": "#0a0a0a", - "theme.notification.close_button.label": "#0a0a0a", - "theme.notification.close_button.background": "#ff3f3f", - "theme.notification.labelicon": "#5bafff", - "theme.notification.text": "#d1d1d1", - "theme.notification.time": "#797979", - "theme.notification.border": "#1a1a1a", - "theme.notification.label": "#5bafff", - "theme.notification.actions.text": "#0a0a0a", - "theme.notification.actions.background": "#5bafff", - "theme.notification.background": "#0a0a0a", - "theme.bar.buttons.modules.power.border": "#FF4500", - "theme.bar.buttons.modules.weather.border": "#FFD700", - "theme.bar.buttons.modules.updates.border": "#FFD700", - "theme.bar.buttons.modules.kbLayout.border": "#00FFFF", - "theme.bar.buttons.modules.netstat.border": "#32CD32", - "theme.bar.buttons.modules.storage.border": "#FF4500", - "theme.bar.buttons.modules.cpu.border": "#FF4500", - "theme.bar.buttons.modules.ram.border": "#FFD700", - "theme.bar.buttons.notifications.border": "#f7d04b", - "theme.bar.buttons.clock.border": "#5bafff", - "theme.bar.buttons.battery.border": "#f7d04b", - "theme.bar.buttons.systray.border": "#303030", - "theme.bar.buttons.bluetooth.border": "#5bafff", - "theme.bar.buttons.network.border": "#e23fe2", - "theme.bar.buttons.volume.border": "#ff3f3f", - "theme.bar.buttons.media.border": "#FFD700", - "theme.bar.buttons.windowtitle.border": "#5bafff", - "theme.bar.buttons.workspaces.border": "#e23ee2", - "theme.bar.buttons.dashboard.border": "#f7d04b", - "theme.bar.buttons.modules.submap.background": "#121212", - "theme.bar.buttons.modules.submap.text": "#FF69B4", - "theme.bar.buttons.modules.submap.border": "#FF69B4", - "theme.bar.buttons.modules.submap.icon": "#121212", - "theme.bar.buttons.modules.submap.icon_background": "#FF69B4" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/dracula.json b/ags/HyprPanel/themes/dracula.json deleted file mode 100644 index 1bada5f..0000000 --- a/ags/HyprPanel/themes/dracula.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#bd93f9", - "theme.bar.menus.menu.notifications.pager.label": "#6272a4", - "theme.bar.menus.menu.notifications.pager.button": "#bd93f9", - "theme.bar.menus.menu.notifications.pager.background": "#282936", - "theme.bar.menus.menu.notifications.switch.puck": "#44475a", - "theme.bar.menus.menu.notifications.switch.disabled": "#44475a", - "theme.bar.menus.menu.notifications.switch.enabled": "#bd93f9", - "theme.bar.menus.menu.notifications.clear": "#bd93f9", - "theme.bar.menus.menu.notifications.switch_divider": "#44475a", - "theme.bar.menus.menu.notifications.border": "#44475a", - "theme.bar.menus.menu.notifications.card": "#44475a", - "theme.bar.menus.menu.notifications.background": "#282a36", - "theme.bar.menus.menu.notifications.no_notifications_label": "#44475a", - "theme.bar.menus.menu.notifications.label": "#bd93f9", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.sleep.text": "#8be9fd", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#8be9fd", - "theme.bar.menus.menu.power.buttons.sleep.background": "#44475a", - "theme.bar.menus.menu.power.buttons.logout.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.logout.text": "#50fa7b", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#50fa7b", - "theme.bar.menus.menu.power.buttons.logout.background": "#44475a", - "theme.bar.menus.menu.power.buttons.restart.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.restart.text": "#ffb86c", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ffb86c", - "theme.bar.menus.menu.power.buttons.restart.background": "#44475a", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#bd93f9", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ff5555", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#44475a", - "theme.bar.menus.menu.power.border.color": "#44475a", - "theme.bar.menus.menu.power.background.color": "#282936", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#6272a4", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#ffb86c", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#bd93f9", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8be9fd", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ff5555", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f1fa8c", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#ff79c6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.input.background": "#ff79c6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ffb86c", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f1fa8c", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#8be9fd", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#bd93f9", - "theme.bar.menus.menu.dashboard.controls.disabled": "#44475a", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#50fa7b", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#282a36", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#bd93f9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#282a36", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ff5555", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#50fa7b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#f8f8f2", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#bd93f9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#44475a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#282a36", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#44475a", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#8be9fd", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#50fa7b", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ffb86c", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ff5555", - "theme.bar.menus.menu.dashboard.profile.name": "#ff79c6", - "theme.bar.menus.menu.dashboard.border.color": "#44475a", - "theme.bar.menus.menu.dashboard.background.color": "#282a36", - "theme.bar.menus.menu.dashboard.card.color": "#44475a", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#ff79c6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#ff79c6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#ff79c6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#8be9fd", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8be9fd", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#bd93f9", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ffb86c", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ff5555", - "theme.bar.menus.menu.clock.weather.stats": "#ff79c6", - "theme.bar.menus.menu.clock.weather.status": "#8be9fd", - "theme.bar.menus.menu.clock.weather.temperature": "#f8f8f2", - "theme.bar.menus.menu.clock.weather.icon": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#44475a", - "theme.bar.menus.menu.clock.calendar.days": "#f8f8f2", - "theme.bar.menus.menu.clock.calendar.currentday": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.paginator": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8be9fd", - "theme.bar.menus.menu.clock.time.timeperiod": "#8be9fd", - "theme.bar.menus.menu.clock.time.time": "#ff79c6", - "theme.bar.menus.menu.clock.text": "#f8f8f2", - "theme.bar.menus.menu.clock.border.color": "#44475a", - "theme.bar.menus.menu.clock.background.color": "#282a36", - "theme.bar.menus.menu.clock.card.color": "#44475a", - "theme.bar.menus.menu.battery.slider.puck": "#282936", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.battery.slider.background": "#6272a4", - "theme.bar.menus.menu.battery.slider.primary": "#f1fa8c", - "theme.bar.menus.menu.battery.icons.active": "#f1fa8c", - "theme.bar.menus.menu.battery.icons.passive": "#6272a4", - "theme.bar.menus.menu.battery.listitems.active": "#f1fa8c", - "theme.bar.menus.menu.battery.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.battery.text": "#f8f8f2", - "theme.bar.menus.menu.battery.label.color": "#f1fa8c", - "theme.bar.menus.menu.battery.border.color": "#44475a", - "theme.bar.menus.menu.battery.background.color": "#282a36", - "theme.bar.menus.menu.battery.card.color": "#44475a", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#44475a", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#f8f8f2", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#282a36", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.icons.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.icons.passive": "#6272a4", - "theme.bar.menus.menu.bluetooth.listitems.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.switch.puck": "#44475a", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#44475a", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#8be9fd", - "theme.bar.menus.menu.bluetooth.switch_divider": "#44475a", - "theme.bar.menus.menu.bluetooth.status": "#44475a", - "theme.bar.menus.menu.bluetooth.text": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.label.color": "#8be9fd", - "theme.bar.menus.menu.bluetooth.border.color": "#44475a", - "theme.bar.menus.menu.bluetooth.background.color": "#282a36", - "theme.bar.menus.menu.bluetooth.card.color": "#44475a", - "theme.bar.menus.menu.network.iconbuttons.active": "#bd93f9", - "theme.bar.menus.menu.network.iconbuttons.passive": "#f8f8f2", - "theme.bar.menus.menu.network.icons.active": "#bd93f9", - "theme.bar.menus.menu.network.icons.passive": "#6272a4", - "theme.bar.menus.menu.network.listitems.active": "#bd93f9", - "theme.bar.menus.menu.network.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.network.status.color": "#44475a", - "theme.bar.menus.menu.network.text": "#f8f8f2", - "theme.bar.menus.menu.network.label.color": "#bd93f9", - "theme.bar.menus.menu.network.border.color": "#44475a", - "theme.bar.menus.menu.network.background.color": "#282a36", - "theme.bar.menus.menu.network.card.color": "#44475a", - "theme.bar.menus.menu.volume.input_slider.puck": "#282936", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.volume.input_slider.background": "#6272a4", - "theme.bar.menus.menu.volume.input_slider.primary": "#ffb86c", - "theme.bar.menus.menu.volume.audio_slider.puck": "#282936", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.volume.audio_slider.background": "#6272a4", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ffb86c", - "theme.bar.menus.menu.volume.icons.active": "#ffb86c", - "theme.bar.menus.menu.volume.icons.passive": "#6272a4", - "theme.bar.menus.menu.volume.iconbutton.active": "#ffb86c", - "theme.bar.menus.menu.volume.iconbutton.passive": "#f8f8f2", - "theme.bar.menus.menu.volume.listitems.active": "#ffb86c", - "theme.bar.menus.menu.volume.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.volume.text": "#f8f8f2", - "theme.bar.menus.menu.volume.label.color": "#ffb86c", - "theme.bar.menus.menu.volume.border.color": "#44475a", - "theme.bar.menus.menu.volume.background.color": "#282a36", - "theme.bar.menus.menu.volume.card.color": "#44475a", - "theme.bar.menus.menu.media.slider.puck": "#282936", - "theme.bar.menus.menu.media.slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.media.slider.background": "#6272a4", - "theme.bar.menus.menu.media.slider.primary": "#ff79c6", - "theme.bar.menus.menu.media.buttons.text": "#282a36", - "theme.bar.menus.menu.media.buttons.background": "#bd93f9", - "theme.bar.menus.menu.media.buttons.enabled": "#8be9fd", - "theme.bar.menus.menu.media.buttons.inactive": "#44475a", - "theme.bar.menus.menu.media.border.color": "#44475a", - "theme.bar.menus.menu.media.card.color": "#44475a", - "theme.bar.menus.menu.media.background.color": "#282a36", - "theme.bar.menus.menu.media.album": "#ff79c6", - "theme.bar.menus.menu.media.artist": "#8be9fd", - "theme.bar.menus.menu.media.song": "#bd93f9", - "theme.bar.menus.tooltip.text": "#f8f8f2", - "theme.bar.menus.tooltip.background": "#282a36", - "theme.bar.menus.dropdownmenu.divider": "#44475a", - "theme.bar.menus.dropdownmenu.text": "#f8f8f2", - "theme.bar.menus.dropdownmenu.background": "#282a36", - "theme.bar.menus.slider.puck": "#44475a", - "theme.bar.menus.slider.backgroundhover": "#44475a", - "theme.bar.menus.slider.background": "#44475a", - "theme.bar.menus.slider.primary": "#bd93f9", - "theme.bar.menus.progressbar.background": "#44475a", - "theme.bar.menus.progressbar.foreground": "#bd93f9", - "theme.bar.menus.iconbuttons.active": "#bd93f9", - "theme.bar.menus.iconbuttons.passive": "#f8f8f2", - "theme.bar.menus.buttons.text": "#282a36", - "theme.bar.menus.buttons.disabled": "#44475a", - "theme.bar.menus.buttons.active": "#ff79c6", - "theme.bar.menus.buttons.default": "#bd93f9", - "theme.bar.menus.check_radio_button.active": "#bd93f9", - "theme.bar.menus.check_radio_button.background": "#282936", - "theme.bar.menus.switch.puck": "#44475a", - "theme.bar.menus.switch.disabled": "#44475a", - "theme.bar.menus.switch.enabled": "#bd93f9", - "theme.bar.menus.icons.active": "#bd93f9", - "theme.bar.menus.icons.passive": "#44475a", - "theme.bar.menus.listitems.active": "#bd93f9", - "theme.bar.menus.listitems.passive": "#f8f8f2", - "theme.bar.menus.popover.border": "#282a36", - "theme.bar.menus.popover.background": "#282a36", - "theme.bar.menus.popover.text": "#bd93f9", - "theme.bar.menus.label": "#bd93f9", - "theme.bar.menus.feinttext": "#44475a", - "theme.bar.menus.dimtext": "#6272a4", - "theme.bar.menus.text": "#f8f8f2", - "theme.bar.menus.border.color": "#44475a", - "theme.bar.menus.cards": "#44475a", - "theme.bar.menus.background": "#6272a4", - "theme.bar.buttons.modules.power.icon_background": "#bd93f9", - "theme.bar.buttons.modules.power.icon": "#ff5454", - "theme.bar.buttons.modules.power.background": "#44475a", - "theme.bar.buttons.modules.power.border": "#bd93f9", - "theme.bar.buttons.modules.weather.icon_background": "#ffb86c", - "theme.bar.buttons.modules.weather.icon": "#ffb86c", - "theme.bar.buttons.modules.weather.text": "#ffb86c", - "theme.bar.buttons.modules.weather.background": "#44475a", - "theme.bar.buttons.modules.weather.border": "#ffb86c", - "theme.bar.buttons.modules.updates.icon_background": "#bd93f9", - "theme.bar.buttons.modules.updates.icon": "#bd93f9", - "theme.bar.buttons.modules.updates.text": "#bd93f9", - "theme.bar.buttons.modules.updates.background": "#44475a", - "theme.bar.buttons.modules.updates.border": "#bd93f9", - "theme.bar.buttons.modules.kbLayout.icon_background": "#8be9fd", - "theme.bar.buttons.modules.kbLayout.icon": "#8be9fd", - "theme.bar.buttons.modules.kbLayout.text": "#8be9fd", - "theme.bar.buttons.modules.kbLayout.background": "#44475a", - "theme.bar.buttons.modules.kbLayout.border": "#8be9fd", - "theme.bar.buttons.modules.netstat.icon_background": "#50fa7b", - "theme.bar.buttons.modules.netstat.icon": "#50fa7b", - "theme.bar.buttons.modules.netstat.text": "#50fa7b", - "theme.bar.buttons.modules.netstat.background": "#44475a", - "theme.bar.buttons.modules.netstat.border": "#50fa7b", - "theme.bar.buttons.modules.storage.icon_background": "#bd93f9", - "theme.bar.buttons.modules.storage.icon": "#bd93f9", - "theme.bar.buttons.modules.storage.text": "#bd93f9", - "theme.bar.buttons.modules.storage.background": "#44475a", - "theme.bar.buttons.modules.storage.border": "#bd93f9", - "theme.bar.buttons.modules.cpu.icon_background": "#ff79c6", - "theme.bar.buttons.modules.cpu.icon": "#ff79c6", - "theme.bar.buttons.modules.cpu.text": "#ff79c6", - "theme.bar.buttons.modules.cpu.background": "#44475a", - "theme.bar.buttons.modules.cpu.border": "#ff79c6", - "theme.bar.buttons.modules.ram.icon_background": "#f1fa8c", - "theme.bar.buttons.modules.ram.icon": "#f1fa8c", - "theme.bar.buttons.modules.ram.text": "#f1fa8c", - "theme.bar.buttons.modules.ram.background": "#44475a", - "theme.bar.buttons.modules.ram.border": "#f1fa8c", - "theme.bar.buttons.notifications.total": "#bd93f9", - "theme.bar.buttons.notifications.icon_background": "#bd93f9", - "theme.bar.buttons.notifications.icon": "#bd93f9", - "theme.bar.buttons.notifications.background": "#44475a", - "theme.bar.buttons.notifications.border": "#bd93f9", - "theme.bar.buttons.clock.icon_background": "#ff79c6", - "theme.bar.buttons.clock.icon": "#ff79c6", - "theme.bar.buttons.clock.text": "#ff79c6", - "theme.bar.buttons.clock.background": "#44475a", - "theme.bar.buttons.clock.border": "#ff79c6", - "theme.bar.buttons.battery.icon_background": "#f1fa8c", - "theme.bar.buttons.battery.icon": "#f1fa8c", - "theme.bar.buttons.battery.text": "#f1fa8c", - "theme.bar.buttons.battery.background": "#44475a", - "theme.bar.buttons.battery.border": "#f1fa8c", - "theme.bar.buttons.systray.background": "#44475a", - "theme.bar.buttons.systray.border": "#6272a4", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.buttons.bluetooth.icon": "#8be9fd", - "theme.bar.buttons.bluetooth.text": "#8be9fd", - "theme.bar.buttons.bluetooth.background": "#44475a", - "theme.bar.buttons.bluetooth.border": "#8be9fd", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.network.icon": "#bd93f9", - "theme.bar.buttons.network.text": "#bd93f9", - "theme.bar.buttons.network.background": "#44475a", - "theme.bar.buttons.network.border": "#bd93f9", - "theme.bar.buttons.volume.icon_background": "#ffb86c", - "theme.bar.buttons.volume.icon": "#ffb86c", - "theme.bar.buttons.volume.text": "#ffb86c", - "theme.bar.buttons.volume.background": "#44475a", - "theme.bar.buttons.volume.border": "#ffb86c", - "theme.bar.buttons.media.icon_background": "#bd93f9", - "theme.bar.buttons.media.icon": "#bd93f9", - "theme.bar.buttons.media.text": "#bd93f9", - "theme.bar.buttons.media.background": "#44475a", - "theme.bar.buttons.media.border": "#bd93f9", - "theme.bar.buttons.windowtitle.icon_background": "#ff79c6", - "theme.bar.buttons.windowtitle.icon": "#f1fa8c", - "theme.bar.buttons.windowtitle.text": "#f1fa8c", - "theme.bar.buttons.windowtitle.border": "#f1fa8c", - "theme.bar.buttons.windowtitle.background": "#44475a", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#e23ee2", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.hover": "#44475a", - "theme.bar.buttons.workspaces.active": "#ff79c6", - "theme.bar.buttons.workspaces.occupied": "#ffb86c", - "theme.bar.buttons.workspaces.available": "#8be9fd", - "theme.bar.buttons.workspaces.border": "#44475a", - "theme.bar.buttons.workspaces.background": "#44475a", - "theme.bar.buttons.dashboard.icon": "#8be8fd", - "theme.bar.buttons.dashboard.border": "#8be8fd", - "theme.bar.buttons.dashboard.background": "#44475a", - "theme.bar.buttons.icon": "#bd93f9", - "theme.bar.buttons.text": "#bd93f9", - "theme.bar.buttons.hover": "#44475a", - "theme.bar.buttons.icon_background": "#44475a", - "theme.bar.buttons.background": "#282936", - "theme.bar.buttons.style": "default", - "theme.bar.background": "#282a36", - "theme.osd.label": "#bd93f9", - "theme.osd.icon": "#282a36", - "theme.osd.bar_overflow_color": "#ff5555", - "theme.osd.bar_empty_color": "#44475a", - "theme.osd.bar_color": "#bd93f9", - "theme.osd.icon_container": "#bd93f9", - "theme.osd.bar_container": "#282a36", - "theme.notification.close_button.label": "#282a36", - "theme.notification.close_button.background": "#bd93f9", - "theme.notification.labelicon": "#bd93f9", - "theme.notification.text": "#f8f8f2", - "theme.notification.time": "#6272a4", - "theme.notification.border": "#44475a", - "theme.notification.label": "#bd93f9", - "theme.notification.actions.text": "#282a36", - "theme.notification.actions.background": "#bd93f9", - "theme.notification.background": "#282a36", - "theme.bar.buttons.modules.submap.background": "#44475a", - "theme.bar.buttons.modules.submap.text": "#8be9fd", - "theme.bar.buttons.modules.submap.border": "#8be9fd", - "theme.bar.buttons.modules.submap.icon": "#8be9fd", - "theme.bar.buttons.modules.submap.icon_background": "#44475a" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/dracula_split.json b/ags/HyprPanel/themes/dracula_split.json deleted file mode 100644 index 5c5263c..0000000 --- a/ags/HyprPanel/themes/dracula_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#bd93f9", - "theme.bar.menus.menu.notifications.pager.label": "#6272a4", - "theme.bar.menus.menu.notifications.pager.button": "#bd93f9", - "theme.bar.menus.menu.notifications.pager.background": "#282936", - "theme.bar.menus.menu.notifications.switch.puck": "#44475a", - "theme.bar.menus.menu.notifications.switch.disabled": "#44475a", - "theme.bar.menus.menu.notifications.switch.enabled": "#bd93f9", - "theme.bar.menus.menu.notifications.clear": "#bd93f9", - "theme.bar.menus.menu.notifications.switch_divider": "#44475a", - "theme.bar.menus.menu.notifications.border": "#44475a", - "theme.bar.menus.menu.notifications.card": "#44475a", - "theme.bar.menus.menu.notifications.background": "#282a36", - "theme.bar.menus.menu.notifications.no_notifications_label": "#44475a", - "theme.bar.menus.menu.notifications.label": "#bd93f9", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.sleep.text": "#8be9fd", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#8be9fd", - "theme.bar.menus.menu.power.buttons.sleep.background": "#44475a", - "theme.bar.menus.menu.power.buttons.logout.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.logout.text": "#50fa7b", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#50fa7b", - "theme.bar.menus.menu.power.buttons.logout.background": "#44475a", - "theme.bar.menus.menu.power.buttons.restart.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.restart.text": "#ffb86c", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ffb86c", - "theme.bar.menus.menu.power.buttons.restart.background": "#44475a", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#282a36", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#ff5454", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#ff5555", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#44475a", - "theme.bar.menus.menu.power.border.color": "#44475a", - "theme.bar.menus.menu.power.background.color": "#282936", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#ff79c6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#50fa7b", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f1fa8c", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ffb86c", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#6272a4", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#ffb86c", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#bd93f9", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8be9fd", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ff5555", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f1fa8c", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#ff79c6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.input.background": "#ff79c6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ffb86c", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f1fa8c", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#8be9fd", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#282a36", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#bd93f9", - "theme.bar.menus.menu.dashboard.controls.disabled": "#44475a", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#50fa7b", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#282a36", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#bd93f9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#282a36", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ff5555", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#50fa7b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#f8f8f2", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#bd93f9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#44475a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#282a36", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#44475a", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#8be9fd", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#50fa7b", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ffb86c", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ff5555", - "theme.bar.menus.menu.dashboard.profile.name": "#ff79c6", - "theme.bar.menus.menu.dashboard.border.color": "#44475a", - "theme.bar.menus.menu.dashboard.background.color": "#282a36", - "theme.bar.menus.menu.dashboard.card.color": "#44475a", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#ff79c6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#ff79c6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#ff79c6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#8be9fd", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#8be9fd", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#bd93f9", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ffb86c", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ff5555", - "theme.bar.menus.menu.clock.weather.stats": "#ff79c6", - "theme.bar.menus.menu.clock.weather.status": "#8be9fd", - "theme.bar.menus.menu.clock.weather.temperature": "#f8f8f2", - "theme.bar.menus.menu.clock.weather.icon": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#44475a", - "theme.bar.menus.menu.clock.calendar.days": "#f8f8f2", - "theme.bar.menus.menu.clock.calendar.currentday": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.paginator": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#ff79c6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8be9fd", - "theme.bar.menus.menu.clock.time.timeperiod": "#8be9fd", - "theme.bar.menus.menu.clock.time.time": "#ff79c6", - "theme.bar.menus.menu.clock.text": "#f8f8f2", - "theme.bar.menus.menu.clock.border.color": "#44475a", - "theme.bar.menus.menu.clock.background.color": "#282a36", - "theme.bar.menus.menu.clock.card.color": "#44475a", - "theme.bar.menus.menu.battery.slider.puck": "#282936", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.battery.slider.background": "#6272a4", - "theme.bar.menus.menu.battery.slider.primary": "#f1fa8c", - "theme.bar.menus.menu.battery.icons.active": "#f1fa8c", - "theme.bar.menus.menu.battery.icons.passive": "#6272a4", - "theme.bar.menus.menu.battery.listitems.active": "#f1fa8c", - "theme.bar.menus.menu.battery.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.battery.text": "#f8f8f2", - "theme.bar.menus.menu.battery.label.color": "#f1fa8c", - "theme.bar.menus.menu.battery.border.color": "#44475a", - "theme.bar.menus.menu.battery.background.color": "#282a36", - "theme.bar.menus.menu.battery.card.color": "#44475a", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#44475a", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#f8f8f2", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#282a36", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.icons.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.icons.passive": "#6272a4", - "theme.bar.menus.menu.bluetooth.listitems.active": "#8be9fd", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.switch.puck": "#44475a", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#44475a", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#8be9fd", - "theme.bar.menus.menu.bluetooth.switch_divider": "#44475a", - "theme.bar.menus.menu.bluetooth.status": "#44475a", - "theme.bar.menus.menu.bluetooth.text": "#f8f8f2", - "theme.bar.menus.menu.bluetooth.label.color": "#8be9fd", - "theme.bar.menus.menu.bluetooth.border.color": "#44475a", - "theme.bar.menus.menu.bluetooth.background.color": "#282a36", - "theme.bar.menus.menu.bluetooth.card.color": "#44475a", - "theme.bar.menus.menu.network.iconbuttons.active": "#bd93f9", - "theme.bar.menus.menu.network.iconbuttons.passive": "#f8f8f2", - "theme.bar.menus.menu.network.icons.active": "#bd93f9", - "theme.bar.menus.menu.network.icons.passive": "#6272a4", - "theme.bar.menus.menu.network.listitems.active": "#bd93f9", - "theme.bar.menus.menu.network.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.network.status.color": "#44475a", - "theme.bar.menus.menu.network.text": "#f8f8f2", - "theme.bar.menus.menu.network.label.color": "#bd93f9", - "theme.bar.menus.menu.network.border.color": "#44475a", - "theme.bar.menus.menu.network.background.color": "#282a36", - "theme.bar.menus.menu.network.card.color": "#44475a", - "theme.bar.menus.menu.volume.input_slider.puck": "#282936", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.volume.input_slider.background": "#6272a4", - "theme.bar.menus.menu.volume.input_slider.primary": "#ffb86c", - "theme.bar.menus.menu.volume.audio_slider.puck": "#282936", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.volume.audio_slider.background": "#6272a4", - "theme.bar.menus.menu.volume.audio_slider.primary": "#ffb86c", - "theme.bar.menus.menu.volume.icons.active": "#ffb86c", - "theme.bar.menus.menu.volume.icons.passive": "#6272a4", - "theme.bar.menus.menu.volume.iconbutton.active": "#ffb86c", - "theme.bar.menus.menu.volume.iconbutton.passive": "#f8f8f2", - "theme.bar.menus.menu.volume.listitems.active": "#ffb86c", - "theme.bar.menus.menu.volume.listitems.passive": "#f8f8f2", - "theme.bar.menus.menu.volume.text": "#f8f8f2", - "theme.bar.menus.menu.volume.label.color": "#ffb86c", - "theme.bar.menus.menu.volume.border.color": "#44475a", - "theme.bar.menus.menu.volume.background.color": "#282a36", - "theme.bar.menus.menu.volume.card.color": "#44475a", - "theme.bar.menus.menu.media.slider.puck": "#282936", - "theme.bar.menus.menu.media.slider.backgroundhover": "#6272a4", - "theme.bar.menus.menu.media.slider.background": "#6272a4", - "theme.bar.menus.menu.media.slider.primary": "#ff79c6", - "theme.bar.menus.menu.media.buttons.text": "#282a36", - "theme.bar.menus.menu.media.buttons.background": "#bd93f9", - "theme.bar.menus.menu.media.buttons.enabled": "#8be9fd", - "theme.bar.menus.menu.media.buttons.inactive": "#44475a", - "theme.bar.menus.menu.media.border.color": "#44475a", - "theme.bar.menus.menu.media.card.color": "#44475a", - "theme.bar.menus.menu.media.background.color": "#282a36", - "theme.bar.menus.menu.media.album": "#ff79c6", - "theme.bar.menus.menu.media.artist": "#8be9fd", - "theme.bar.menus.menu.media.song": "#bd93f9", - "theme.bar.menus.tooltip.text": "#f8f8f2", - "theme.bar.menus.tooltip.background": "#282a36", - "theme.bar.menus.dropdownmenu.divider": "#44475a", - "theme.bar.menus.dropdownmenu.text": "#f8f8f2", - "theme.bar.menus.dropdownmenu.background": "#282a36", - "theme.bar.menus.slider.puck": "#44475a", - "theme.bar.menus.slider.backgroundhover": "#44475a", - "theme.bar.menus.slider.background": "#44475a", - "theme.bar.menus.slider.primary": "#bd93f9", - "theme.bar.menus.progressbar.background": "#44475a", - "theme.bar.menus.progressbar.foreground": "#bd93f9", - "theme.bar.menus.iconbuttons.active": "#bd93f9", - "theme.bar.menus.iconbuttons.passive": "#f8f8f2", - "theme.bar.menus.buttons.text": "#282a36", - "theme.bar.menus.buttons.disabled": "#44475a", - "theme.bar.menus.buttons.active": "#ff79c6", - "theme.bar.menus.buttons.default": "#bd93f9", - "theme.bar.menus.check_radio_button.active": "#bd93f9", - "theme.bar.menus.check_radio_button.background": "#282936", - "theme.bar.menus.switch.puck": "#44475a", - "theme.bar.menus.switch.disabled": "#44475a", - "theme.bar.menus.switch.enabled": "#bd93f9", - "theme.bar.menus.icons.active": "#bd93f9", - "theme.bar.menus.icons.passive": "#44475a", - "theme.bar.menus.listitems.active": "#bd93f9", - "theme.bar.menus.listitems.passive": "#f8f8f2", - "theme.bar.menus.popover.border": "#282a36", - "theme.bar.menus.popover.background": "#282a36", - "theme.bar.menus.popover.text": "#bd93f9", - "theme.bar.menus.label": "#bd93f9", - "theme.bar.menus.feinttext": "#44475a", - "theme.bar.menus.dimtext": "#6272a4", - "theme.bar.menus.text": "#f8f8f2", - "theme.bar.menus.border.color": "#44475a", - "theme.bar.menus.cards": "#44475a", - "theme.bar.menus.background": "#6272a4", - "theme.bar.buttons.modules.power.icon_background": "#ff5454", - "theme.bar.buttons.modules.power.icon": "#282936", - "theme.bar.buttons.modules.power.background": "#44475a", - "theme.bar.buttons.modules.power.border": "#bd93f9", - "theme.bar.buttons.modules.weather.icon_background": "#ffb86c", - "theme.bar.buttons.modules.weather.icon": "#282936", - "theme.bar.buttons.modules.weather.text": "#ffb86c", - "theme.bar.buttons.modules.weather.background": "#44475a", - "theme.bar.buttons.modules.weather.border": "#ffb86c", - "theme.bar.buttons.modules.updates.icon_background": "#bd93f9", - "theme.bar.buttons.modules.updates.icon": "#282936", - "theme.bar.buttons.modules.updates.text": "#bd93f9", - "theme.bar.buttons.modules.updates.background": "#44475a", - "theme.bar.buttons.modules.updates.border": "#bd93f9", - "theme.bar.buttons.modules.kbLayout.icon_background": "#8be9fd", - "theme.bar.buttons.modules.kbLayout.icon": "#282936", - "theme.bar.buttons.modules.kbLayout.text": "#8be9fd", - "theme.bar.buttons.modules.kbLayout.background": "#44475a", - "theme.bar.buttons.modules.kbLayout.border": "#8be9fd", - "theme.bar.buttons.modules.netstat.icon_background": "#50fa7b", - "theme.bar.buttons.modules.netstat.icon": "#282936", - "theme.bar.buttons.modules.netstat.text": "#50fa7b", - "theme.bar.buttons.modules.netstat.background": "#44475a", - "theme.bar.buttons.modules.netstat.border": "#50fa7b", - "theme.bar.buttons.modules.storage.icon_background": "#bd93f9", - "theme.bar.buttons.modules.storage.icon": "#282936", - "theme.bar.buttons.modules.storage.text": "#bd93f9", - "theme.bar.buttons.modules.storage.background": "#44475a", - "theme.bar.buttons.modules.storage.border": "#bd93f9", - "theme.bar.buttons.modules.cpu.icon_background": "#ff79c6", - "theme.bar.buttons.modules.cpu.icon": "#282936", - "theme.bar.buttons.modules.cpu.text": "#ff79c6", - "theme.bar.buttons.modules.cpu.background": "#44475a", - "theme.bar.buttons.modules.cpu.border": "#ff79c6", - "theme.bar.buttons.modules.ram.icon_background": "#f1fa8c", - "theme.bar.buttons.modules.ram.icon": "#282936", - "theme.bar.buttons.modules.ram.text": "#f1fa8c", - "theme.bar.buttons.modules.ram.background": "#44475a", - "theme.bar.buttons.modules.ram.border": "#f1fa8c", - "theme.bar.buttons.notifications.total": "#bd93f9", - "theme.bar.buttons.notifications.icon_background": "#bd93f9", - "theme.bar.buttons.notifications.icon": "#44475a", - "theme.bar.buttons.notifications.background": "#44475a", - "theme.bar.buttons.notifications.border": "#bd93f9", - "theme.bar.buttons.clock.icon_background": "#ff79c6", - "theme.bar.buttons.clock.icon": "#44475a", - "theme.bar.buttons.clock.text": "#ff79c6", - "theme.bar.buttons.clock.background": "#44475a", - "theme.bar.buttons.clock.border": "#ff79c6", - "theme.bar.buttons.battery.icon_background": "#f1fa8c", - "theme.bar.buttons.battery.icon": "#44475a", - "theme.bar.buttons.battery.text": "#f1fa8c", - "theme.bar.buttons.battery.background": "#44475a", - "theme.bar.buttons.battery.border": "#f1fa8c", - "theme.bar.buttons.systray.background": "#44475a", - "theme.bar.buttons.systray.border": "#6272a4", - "theme.bar.buttons.bluetooth.icon_background": "#8be9fd", - "theme.bar.buttons.bluetooth.icon": "#44475a", - "theme.bar.buttons.bluetooth.text": "#8be9fd", - "theme.bar.buttons.bluetooth.background": "#44475a", - "theme.bar.buttons.bluetooth.border": "#8be9fd", - "theme.bar.buttons.network.icon_background": "#bd93f9", - "theme.bar.buttons.network.icon": "#44475a", - "theme.bar.buttons.network.text": "#bd93f9", - "theme.bar.buttons.network.background": "#44475a", - "theme.bar.buttons.network.border": "#bd93f9", - "theme.bar.buttons.volume.icon_background": "#ffb86c", - "theme.bar.buttons.volume.icon": "#44475a", - "theme.bar.buttons.volume.text": "#ffb86c", - "theme.bar.buttons.volume.background": "#44475a", - "theme.bar.buttons.volume.border": "#ffb86c", - "theme.bar.buttons.media.icon_background": "#bd93f9", - "theme.bar.buttons.media.icon": "#44475a", - "theme.bar.buttons.media.text": "#bd93f9", - "theme.bar.buttons.media.background": "#44475a", - "theme.bar.buttons.media.border": "#bd93f9", - "theme.bar.buttons.windowtitle.icon_background": "#f1fa8c", - "theme.bar.buttons.windowtitle.icon": "#44475a", - "theme.bar.buttons.windowtitle.text": "#f1fa8c", - "theme.bar.buttons.windowtitle.border": "#f1fa8c", - "theme.bar.buttons.windowtitle.background": "#44475a", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ff79c6", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#ff79c6", - "theme.bar.buttons.workspaces.hover": "#ff79c6", - "theme.bar.buttons.workspaces.active": "#ff79c6", - "theme.bar.buttons.workspaces.occupied": "#ffb86c", - "theme.bar.buttons.workspaces.available": "#8be9fd", - "theme.bar.buttons.workspaces.border": "#44475a", - "theme.bar.buttons.workspaces.background": "#44475a", - "theme.bar.buttons.dashboard.icon": "#44475a", - "theme.bar.buttons.dashboard.border": "#8be8fd", - "theme.bar.buttons.dashboard.background": "#8be8fd", - "theme.bar.buttons.icon": "#bd93f9", - "theme.bar.buttons.text": "#bd93f9", - "theme.bar.buttons.hover": "#44475a", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#282936", - "theme.bar.buttons.style": "split", - "theme.bar.background": "#282a36", - "theme.osd.label": "#bd93f9", - "theme.osd.icon": "#282a36", - "theme.osd.bar_overflow_color": "#ff5555", - "theme.osd.bar_empty_color": "#44475a", - "theme.osd.bar_color": "#bd93f9", - "theme.osd.icon_container": "#bd93f9", - "theme.osd.bar_container": "#282a36", - "theme.notification.close_button.label": "#282a36", - "theme.notification.close_button.background": "#bd93f9", - "theme.notification.labelicon": "#bd93f9", - "theme.notification.text": "#f8f8f2", - "theme.notification.time": "#6272a4", - "theme.notification.border": "#44475a", - "theme.notification.label": "#bd93f9", - "theme.notification.actions.text": "#282a36", - "theme.notification.actions.background": "#bd93f9", - "theme.notification.background": "#44475a", - "theme.bar.buttons.modules.submap.background": "#44475a", - "theme.bar.buttons.modules.submap.text": "#8be9fd", - "theme.bar.buttons.modules.submap.border": "#8be9fd", - "theme.bar.buttons.modules.submap.icon": "#282936", - "theme.bar.buttons.modules.submap.icon_background": "#8be9fd" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/everforest.json b/ags/HyprPanel/themes/everforest.json deleted file mode 100644 index 4789eb4..0000000 --- a/ags/HyprPanel/themes/everforest.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#2b3339", - "theme.bar.background": "#2b3339", - "theme.bar.buttons.media.icon": "#a7c080", - "theme.bar.buttons.media.text": "#a7c080", - "theme.bar.buttons.icon": "#a7c080", - "theme.bar.buttons.text": "#a7c080", - "theme.bar.buttons.hover": "#445055", - "theme.bar.buttons.background": "#323d43", - "theme.bar.menus.text": "#d3c6aa", - "theme.bar.menus.border.color": "#454b53", - "theme.bar.buttons.media.background": "#323d43", - "theme.bar.menus.menu.volume.text": "#d3c6aa", - "theme.bar.menus.menu.volume.card.color": "#2f383e", - "theme.bar.menus.menu.volume.label.color": "#e67e80", - "theme.bar.menus.popover.text": "#a7c080", - "theme.bar.menus.popover.background": "#3a4248", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e67e80", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e67e80", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#2b3339", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#d3c6aa", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#454b53", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#2b3339", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#2f383e", - "theme.bar.menus.menu.notifications.switch.puck": "#445055", - "theme.bar.menus.menu.notifications.switch.disabled": "#454b54", - "theme.bar.menus.menu.notifications.switch.enabled": "#a7c080", - "theme.bar.menus.menu.notifications.clear": "#e67e80", - "theme.bar.menus.menu.notifications.switch_divider": "#445055", - "theme.bar.menus.menu.notifications.border": "#454b53", - "theme.bar.menus.menu.notifications.card": "#2f383e", - "theme.bar.menus.menu.notifications.background": "#2b3339", - "theme.bar.menus.menu.notifications.no_notifications_label": "#454b53", - "theme.bar.menus.menu.notifications.label": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#445055", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#a7c080", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#83c092", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#a7c080", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e67e80", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#dbbc7f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#d699b6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.input.background": "#d699b6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e67e80", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#dbbc7f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#83c092", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#83c092", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5c6a72", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a7c080", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#3a4248", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#83c092", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#dbbc7f", - "theme.bar.menus.menu.dashboard.profile.name": "#d699b6", - "theme.bar.menus.menu.dashboard.border.color": "#454b53", - "theme.bar.menus.menu.dashboard.background.color": "#2b3339", - "theme.bar.menus.menu.dashboard.card.color": "#2f383e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#d699b6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#d699b6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#d699b6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#83c092", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#83c092", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#a7c080", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#dbbc7f", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e67e80", - "theme.bar.menus.menu.clock.weather.stats": "#d699b6", - "theme.bar.menus.menu.clock.weather.status": "#83c092", - "theme.bar.menus.menu.clock.weather.temperature": "#d3c6aa", - "theme.bar.menus.menu.clock.weather.icon": "#d699b6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5c6a72", - "theme.bar.menus.menu.clock.calendar.days": "#d3c6aa", - "theme.bar.menus.menu.clock.calendar.currentday": "#d699b6", - "theme.bar.menus.menu.clock.calendar.paginator": "#d699b6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#d699b6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#83c092", - "theme.bar.menus.menu.clock.time.timeperiod": "#83c092", - "theme.bar.menus.menu.clock.time.time": "#d699b6", - "theme.bar.menus.menu.clock.text": "#d3c6aa", - "theme.bar.menus.menu.clock.border.color": "#454b53", - "theme.bar.menus.menu.clock.background.color": "#2b3339", - "theme.bar.menus.menu.clock.card.color": "#2f383e", - "theme.bar.menus.menu.battery.slider.puck": "#445055", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#445055", - "theme.bar.menus.menu.battery.slider.background": "#5c6a72", - "theme.bar.menus.menu.battery.slider.primary": "#dbbc7f", - "theme.bar.menus.menu.battery.icons.active": "#dbbc7f", - "theme.bar.menus.menu.battery.icons.passive": "#7a8478", - "theme.bar.menus.menu.battery.listitems.active": "#dbbc7f", - "theme.bar.menus.menu.battery.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.battery.text": "#d3c6aa", - "theme.bar.menus.menu.battery.label.color": "#dbbc7f", - "theme.bar.menus.menu.battery.border.color": "#454b53", - "theme.bar.menus.menu.battery.background.color": "#2b3339", - "theme.bar.menus.menu.battery.card.color": "#2f383e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#2f383e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#d3c6aa", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#2b3339", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#a7c080", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.icons.active": "#a7c080", - "theme.bar.menus.menu.bluetooth.icons.passive": "#868d80", - "theme.bar.menus.menu.bluetooth.listitems.active": "#a7c07f", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.switch.puck": "#454b53", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2f383e", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#a7c080", - "theme.bar.menus.menu.bluetooth.switch_divider": "#454b53", - "theme.bar.menus.menu.bluetooth.status": "#868d80", - "theme.bar.menus.menu.bluetooth.text": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.label.color": "#a7c080", - "theme.bar.menus.menu.bluetooth.border.color": "#2f383e", - "theme.bar.menus.menu.bluetooth.background.color": "#2b3339", - "theme.bar.menus.menu.bluetooth.card.color": "#2f383e", - "theme.bar.menus.menu.network.iconbuttons.active": "#e69875", - "theme.bar.menus.menu.network.iconbuttons.passive": "#d3c6aa", - "theme.bar.menus.menu.network.icons.active": "#e69875", - "theme.bar.menus.menu.network.icons.passive": "#868d80", - "theme.bar.menus.menu.network.listitems.active": "#e69874", - "theme.bar.menus.menu.network.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.network.status.color": "#868d80", - "theme.bar.menus.menu.network.text": "#d3c6aa", - "theme.bar.menus.menu.network.label.color": "#e69875", - "theme.bar.menus.menu.network.border.color": "#2f383e", - "theme.bar.menus.menu.network.background.color": "#2b3339", - "theme.bar.menus.menu.network.card.color": "#2f383e", - "theme.bar.menus.menu.volume.input_slider.puck": "#83c092", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.volume.input_slider.background": "#83c093", - "theme.bar.menus.menu.volume.input_slider.primary": "#dbbc7f", - "theme.bar.menus.menu.volume.audio_slider.puck": "#83c092", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.volume.audio_slider.background": "#83c093", - "theme.bar.menus.menu.volume.audio_slider.primary": "#dbbc7f", - "theme.bar.menus.menu.volume.icons.active": "#dbbc7f", - "theme.bar.menus.menu.volume.icons.passive": "#868d80", - "theme.bar.menus.menu.volume.iconbutton.active": "#dbbc7f", - "theme.bar.menus.menu.volume.iconbutton.passive": "#d3c6aa", - "theme.bar.menus.menu.volume.listitems.active": "#dbbc7e", - "theme.bar.menus.menu.volume.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.volume.border.color": "#2f383e", - "theme.bar.menus.menu.volume.background.color": "#2b3339", - "theme.bar.menus.menu.media.slider.puck": "#868d80", - "theme.bar.menus.menu.media.slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.media.slider.background": "#83c093", - "theme.bar.menus.menu.media.slider.primary": "#a7c080", - "theme.bar.menus.menu.media.buttons.text": "#2b3339", - "theme.bar.menus.menu.media.buttons.background": "#83c092", - "theme.bar.menus.menu.media.buttons.enabled": "#a7c080", - "theme.bar.menus.menu.media.buttons.inactive": "#83c092", - "theme.bar.menus.menu.media.border.color": "#2f383e", - "theme.bar.menus.menu.media.background.color": "#2b3339", - "theme.bar.menus.menu.media.album": "#a7c080", - "theme.bar.menus.menu.media.artist": "#a7c080", - "theme.bar.menus.menu.media.song": "#83c092", - "theme.bar.menus.tooltip.text": "#d3c6aa", - "theme.bar.menus.tooltip.background": "#2b3339", - "theme.bar.menus.dropdownmenu.divider": "#2f383e", - "theme.bar.menus.dropdownmenu.text": "#d3c6aa", - "theme.bar.menus.dropdownmenu.background": "#2b3339", - "theme.bar.menus.slider.puck": "#868d80", - "theme.bar.menus.slider.backgroundhover": "#454b53", - "theme.bar.menus.slider.background": "#83c093", - "theme.bar.menus.slider.primary": "#83c092", - "theme.bar.menus.progressbar.background": "#454b53", - "theme.bar.menus.progressbar.foreground": "#83c092", - "theme.bar.menus.iconbuttons.active": "#83c092", - "theme.bar.menus.iconbuttons.passive": "#d3c6aa", - "theme.bar.menus.buttons.text": "#2b3339", - "theme.bar.menus.buttons.disabled": "#83c093", - "theme.bar.menus.buttons.active": "#a7c080", - "theme.bar.menus.buttons.default": "#83c092", - "theme.bar.menus.switch.puck": "#454b53", - "theme.bar.menus.switch.disabled": "#2f383e", - "theme.bar.menus.switch.enabled": "#83c092", - "theme.bar.menus.icons.active": "#83c092", - "theme.bar.menus.icons.passive": "#83c092", - "theme.bar.menus.listitems.active": "#83c091", - "theme.bar.menus.listitems.passive": "#d3c6aa", - "theme.bar.menus.label": "#83c092", - "theme.bar.menus.feinttext": "#2f383e", - "theme.bar.menus.dimtext": "#83c092", - "theme.bar.menus.cards": "#2f383e", - "theme.bar.buttons.notifications.total": "#83c092", - "theme.bar.buttons.notifications.icon": "#83c092", - "theme.bar.buttons.notifications.background": "#323d43", - "theme.bar.buttons.clock.icon": "#dbbc7f", - "theme.bar.buttons.clock.text": "#dbbc7f", - "theme.bar.buttons.clock.background": "#323d43", - "theme.bar.buttons.battery.icon": "#e69875", - "theme.bar.buttons.battery.text": "#e69875", - "theme.bar.buttons.battery.background": "#323d43", - "theme.bar.buttons.systray.background": "#323d43", - "theme.bar.buttons.bluetooth.icon": "#a7c080", - "theme.bar.buttons.bluetooth.text": "#a7c080", - "theme.bar.buttons.bluetooth.background": "#323d43", - "theme.bar.buttons.network.icon": "#e69875", - "theme.bar.buttons.network.text": "#e69875", - "theme.bar.buttons.network.background": "#323d43", - "theme.bar.buttons.volume.icon": "#dbbc7f", - "theme.bar.buttons.volume.text": "#dbbc7f", - "theme.bar.buttons.volume.background": "#323d43", - "theme.bar.buttons.windowtitle.icon": "#dbbc7f", - "theme.bar.buttons.windowtitle.text": "#dbbc7f", - "theme.bar.buttons.windowtitle.background": "#323d43", - "theme.bar.buttons.workspaces.active": "#dbbc7f", - "theme.bar.buttons.workspaces.occupied": "#e69875", - "theme.bar.buttons.workspaces.available": "#a7c080", - "theme.bar.buttons.workspaces.hover": "#454b53", - "theme.bar.buttons.workspaces.background": "#323d43", - "theme.bar.buttons.dashboard.icon": "#e69875", - "theme.bar.buttons.dashboard.background": "#323d43", - "theme.osd.label": "#d3c6aa", - "theme.osd.icon": "#2b3339", - "theme.osd.bar_overflow_color": "#e67e80", - "theme.osd.bar_empty_color": "#504945", - "theme.osd.bar_color": "#d3c6aa", - "theme.osd.icon_container": "#d3c6aa", - "theme.osd.bar_container": "#2b3339", - "theme.notification.close_button.label": "#2b3339", - "theme.notification.close_button.background": "#e67e80", - "theme.notification.labelicon": "#d3c6aa", - "theme.notification.text": "#d8caac", - "theme.notification.time": "#a89984", - "theme.notification.border": "#323d43", - "theme.notification.label": "#d3c6aa", - "theme.notification.actions.text": "#2b3339", - "theme.notification.actions.background": "#a7c080", - "theme.notification.background": "#2b3239", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#2f383e", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#a7c080", - "theme.bar.menus.menu.notifications.scrollbar.color": "#a7c080", - "theme.bar.menus.menu.notifications.pager.label": "#7a8478", - "theme.bar.menus.menu.notifications.pager.background": "#2b3339", - "theme.bar.buttons.clock.icon_background": "#d699b6", - "theme.bar.buttons.modules.ram.icon": "#dbbc7f", - "theme.bar.buttons.modules.storage.icon_background": "#e67e80", - "theme.bar.menus.popover.border": "#3a4248", - "theme.bar.buttons.volume.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#83c092", - "theme.bar.menus.menu.power.buttons.restart.text": "#dbbc7f", - "theme.bar.buttons.modules.updates.background": "#323d43", - "theme.bar.buttons.modules.storage.icon": "#e67e80", - "theme.bar.buttons.modules.netstat.background": "#323d43", - "theme.bar.buttons.modules.weather.icon": "#a7c080", - "theme.bar.buttons.modules.netstat.text": "#a7c080", - "theme.bar.buttons.modules.storage.background": "#323d43", - "theme.bar.buttons.modules.power.icon": "#e67e80", - "theme.bar.buttons.modules.storage.text": "#e67e80", - "theme.bar.buttons.modules.cpu.background": "#323d43", - "theme.bar.menus.menu.power.border.color": "#454b53", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.logout.icon": "#3a4248", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.restart.icon": "#3a4248", - "theme.bar.buttons.modules.cpu.icon": "#e67e80", - "theme.bar.buttons.battery.icon_background": "#dbbc7f", - "theme.bar.buttons.modules.kbLayout.icon_background": "#83c092", - "theme.bar.buttons.modules.weather.text": "#a7c080", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#3a4248", - "theme.bar.menus.menu.power.buttons.sleep.text": "#83c092", - "theme.bar.buttons.modules.weather.icon_background": "#a7c080", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#2f383e", - "theme.bar.buttons.media.icon_background": "#a7c080", - "theme.bar.menus.menu.power.buttons.logout.background": "#2f383e", - "theme.bar.buttons.modules.kbLayout.icon": "#83c092", - "theme.bar.buttons.modules.ram.icon_background": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e67e80", - "theme.bar.menus.menu.power.buttons.sleep.background": "#2f383e", - "theme.bar.buttons.modules.ram.text": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.logout.text": "#a7c080", - "theme.bar.buttons.modules.updates.icon_background": "#83c092", - "theme.bar.buttons.modules.kbLayout.background": "#323d43", - "theme.bar.buttons.modules.power.background": "#323d43", - "theme.bar.buttons.modules.weather.background": "#323d43", - "theme.bar.buttons.icon_background": "#323d43", - "theme.bar.menus.menu.power.background.color": "#2b3339", - "theme.bar.buttons.modules.ram.background": "#323d43", - "theme.bar.buttons.modules.netstat.icon": "#a7c080", - "theme.bar.buttons.windowtitle.icon_background": "#d699b6", - "theme.bar.buttons.modules.cpu.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a7c080", - "theme.bar.buttons.modules.updates.text": "#83c092", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#3a4248", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#2f383e", - "theme.bar.buttons.modules.updates.icon": "#83c092", - "theme.bar.buttons.modules.cpu.text": "#e67e80", - "theme.bar.buttons.modules.netstat.icon_background": "#a7c080", - "theme.bar.buttons.modules.kbLayout.text": "#83c092", - "theme.bar.buttons.notifications.icon_background": "#a7c080", - "theme.bar.buttons.modules.power.border": "#e67e80", - "theme.bar.buttons.modules.weather.border": "#a7c080", - "theme.bar.buttons.modules.updates.border": "#83c092", - "theme.bar.buttons.modules.kbLayout.border": "#83c092", - "theme.bar.buttons.modules.netstat.border": "#a7c080", - "theme.bar.buttons.modules.storage.border": "#e67e80", - "theme.bar.buttons.modules.cpu.border": "#e67e80", - "theme.bar.buttons.modules.ram.border": "#dbbc7f", - "theme.bar.buttons.notifications.border": "#83c092", - "theme.bar.buttons.clock.border": "#dbbc7f", - "theme.bar.buttons.battery.border": "#e69875", - "theme.bar.buttons.systray.border": "#454b53", - "theme.bar.buttons.bluetooth.border": "#a7c080", - "theme.bar.buttons.network.border": "#e69875", - "theme.bar.buttons.volume.border": "#dbbc7f", - "theme.bar.buttons.media.border": "#a7c080", - "theme.bar.buttons.windowtitle.border": "#dbbc7f", - "theme.bar.buttons.workspaces.border": "#2b3339", - "theme.bar.buttons.dashboard.border": "#e69875", - "theme.bar.buttons.modules.submap.background": "#323d43", - "theme.bar.buttons.modules.submap.text": "#83c092", - "theme.bar.buttons.modules.submap.border": "#83c092", - "theme.bar.buttons.modules.submap.icon": "#83c092", - "theme.bar.buttons.modules.submap.icon_background": "#323d43" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/everforest_split.json b/ags/HyprPanel/themes/everforest_split.json deleted file mode 100644 index 9f362f4..0000000 --- a/ags/HyprPanel/themes/everforest_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#2b3339", - "theme.bar.background": "#2b3339", - "theme.bar.buttons.media.icon": "#323d43", - "theme.bar.buttons.media.text": "#a7c080", - "theme.bar.buttons.icon": "#a7c080", - "theme.bar.buttons.text": "#a7c080", - "theme.bar.buttons.hover": "#445055", - "theme.bar.buttons.background": "#323d43", - "theme.bar.menus.text": "#d3c6aa", - "theme.bar.menus.border.color": "#454b53", - "theme.bar.buttons.media.background": "#323d43", - "theme.bar.menus.menu.volume.text": "#d3c6aa", - "theme.bar.menus.menu.volume.card.color": "#2f383e", - "theme.bar.menus.menu.volume.label.color": "#e67e80", - "theme.bar.menus.popover.text": "#a7c080", - "theme.bar.menus.popover.background": "#3a4248", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e67e80", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e67e80", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#2b3339", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#d3c6aa", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#454b53", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#2b3339", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#2f383e", - "theme.bar.menus.menu.notifications.switch.puck": "#445055", - "theme.bar.menus.menu.notifications.switch.disabled": "#454b54", - "theme.bar.menus.menu.notifications.switch.enabled": "#a7c080", - "theme.bar.menus.menu.notifications.clear": "#e67e80", - "theme.bar.menus.menu.notifications.switch_divider": "#445055", - "theme.bar.menus.menu.notifications.border": "#454b53", - "theme.bar.menus.menu.notifications.card": "#2f383e", - "theme.bar.menus.menu.notifications.background": "#2b3339", - "theme.bar.menus.menu.notifications.no_notifications_label": "#454b53", - "theme.bar.menus.menu.notifications.label": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#d699b6", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#a7c080", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#dbbc7f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e67e80", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#445055", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#a7c080", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#83c092", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#a7c080", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e67e80", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#dbbc7f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#d699b6", - "theme.bar.menus.menu.dashboard.controls.input.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.input.background": "#d699b6", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e67e80", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#dbbc7f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#83c092", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#3a4248", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#83c092", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5c6a72", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#a7c080", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#3a4248", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#83c092", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#a7c080", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#dbbc7f", - "theme.bar.menus.menu.dashboard.profile.name": "#d699b6", - "theme.bar.menus.menu.dashboard.border.color": "#454b53", - "theme.bar.menus.menu.dashboard.background.color": "#2b3339", - "theme.bar.menus.menu.dashboard.card.color": "#2f383e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#d699b6", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#d699b6", - "theme.bar.menus.menu.clock.weather.hourly.time": "#d699b6", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#83c092", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#83c092", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#a7c080", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#dbbc7f", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e67e80", - "theme.bar.menus.menu.clock.weather.stats": "#d699b6", - "theme.bar.menus.menu.clock.weather.status": "#83c092", - "theme.bar.menus.menu.clock.weather.temperature": "#d3c6aa", - "theme.bar.menus.menu.clock.weather.icon": "#d699b6", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5c6a72", - "theme.bar.menus.menu.clock.calendar.days": "#d3c6aa", - "theme.bar.menus.menu.clock.calendar.currentday": "#d699b6", - "theme.bar.menus.menu.clock.calendar.paginator": "#d699b6", - "theme.bar.menus.menu.clock.calendar.weekdays": "#d699b6", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#83c092", - "theme.bar.menus.menu.clock.time.timeperiod": "#83c092", - "theme.bar.menus.menu.clock.time.time": "#d699b6", - "theme.bar.menus.menu.clock.text": "#d3c6aa", - "theme.bar.menus.menu.clock.border.color": "#454b53", - "theme.bar.menus.menu.clock.background.color": "#2b3339", - "theme.bar.menus.menu.clock.card.color": "#2f383e", - "theme.bar.menus.menu.battery.slider.puck": "#445055", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#445055", - "theme.bar.menus.menu.battery.slider.background": "#5c6a72", - "theme.bar.menus.menu.battery.slider.primary": "#dbbc7f", - "theme.bar.menus.menu.battery.icons.active": "#dbbc7f", - "theme.bar.menus.menu.battery.icons.passive": "#7a8478", - "theme.bar.menus.menu.battery.listitems.active": "#dbbc7f", - "theme.bar.menus.menu.battery.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.battery.text": "#d3c6aa", - "theme.bar.menus.menu.battery.label.color": "#dbbc7f", - "theme.bar.menus.menu.battery.border.color": "#454b53", - "theme.bar.menus.menu.battery.background.color": "#2b3339", - "theme.bar.menus.menu.battery.card.color": "#2f383e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#2f383e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#d3c6aa", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#2b3339", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#a7c080", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.icons.active": "#a7c080", - "theme.bar.menus.menu.bluetooth.icons.passive": "#868d80", - "theme.bar.menus.menu.bluetooth.listitems.active": "#a7c07f", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.switch.puck": "#454b53", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2f383e", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#a7c080", - "theme.bar.menus.menu.bluetooth.switch_divider": "#454b53", - "theme.bar.menus.menu.bluetooth.status": "#868d80", - "theme.bar.menus.menu.bluetooth.text": "#d3c6aa", - "theme.bar.menus.menu.bluetooth.label.color": "#a7c080", - "theme.bar.menus.menu.bluetooth.border.color": "#2f383e", - "theme.bar.menus.menu.bluetooth.background.color": "#2b3339", - "theme.bar.menus.menu.bluetooth.card.color": "#2f383e", - "theme.bar.menus.menu.network.iconbuttons.active": "#e69875", - "theme.bar.menus.menu.network.iconbuttons.passive": "#d3c6aa", - "theme.bar.menus.menu.network.icons.active": "#e69875", - "theme.bar.menus.menu.network.icons.passive": "#868d80", - "theme.bar.menus.menu.network.listitems.active": "#e69874", - "theme.bar.menus.menu.network.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.network.status.color": "#868d80", - "theme.bar.menus.menu.network.text": "#d3c6aa", - "theme.bar.menus.menu.network.label.color": "#e69875", - "theme.bar.menus.menu.network.border.color": "#2f383e", - "theme.bar.menus.menu.network.background.color": "#2b3339", - "theme.bar.menus.menu.network.card.color": "#2f383e", - "theme.bar.menus.menu.volume.input_slider.puck": "#83c092", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.volume.input_slider.background": "#83c093", - "theme.bar.menus.menu.volume.input_slider.primary": "#dbbc7f", - "theme.bar.menus.menu.volume.audio_slider.puck": "#83c092", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.volume.audio_slider.background": "#83c093", - "theme.bar.menus.menu.volume.audio_slider.primary": "#dbbc7f", - "theme.bar.menus.menu.volume.icons.active": "#dbbc7f", - "theme.bar.menus.menu.volume.icons.passive": "#868d80", - "theme.bar.menus.menu.volume.iconbutton.active": "#dbbc7f", - "theme.bar.menus.menu.volume.iconbutton.passive": "#d3c6aa", - "theme.bar.menus.menu.volume.listitems.active": "#dbbc7e", - "theme.bar.menus.menu.volume.listitems.passive": "#d3c6aa", - "theme.bar.menus.menu.volume.border.color": "#2f383e", - "theme.bar.menus.menu.volume.background.color": "#2b3339", - "theme.bar.menus.menu.media.slider.puck": "#868d80", - "theme.bar.menus.menu.media.slider.backgroundhover": "#454b53", - "theme.bar.menus.menu.media.slider.background": "#83c093", - "theme.bar.menus.menu.media.slider.primary": "#a7c080", - "theme.bar.menus.menu.media.buttons.text": "#2b3339", - "theme.bar.menus.menu.media.buttons.background": "#83c092", - "theme.bar.menus.menu.media.buttons.enabled": "#a7c080", - "theme.bar.menus.menu.media.buttons.inactive": "#83c092", - "theme.bar.menus.menu.media.border.color": "#2f383e", - "theme.bar.menus.menu.media.background.color": "#2b3339", - "theme.bar.menus.menu.media.album": "#a7c080", - "theme.bar.menus.menu.media.artist": "#a7c080", - "theme.bar.menus.menu.media.song": "#83c092", - "theme.bar.menus.tooltip.text": "#d3c6aa", - "theme.bar.menus.tooltip.background": "#2b3339", - "theme.bar.menus.dropdownmenu.divider": "#2f383e", - "theme.bar.menus.dropdownmenu.text": "#d3c6aa", - "theme.bar.menus.dropdownmenu.background": "#2b3339", - "theme.bar.menus.slider.puck": "#868d80", - "theme.bar.menus.slider.backgroundhover": "#454b53", - "theme.bar.menus.slider.background": "#83c093", - "theme.bar.menus.slider.primary": "#83c092", - "theme.bar.menus.progressbar.background": "#454b53", - "theme.bar.menus.progressbar.foreground": "#83c092", - "theme.bar.menus.iconbuttons.active": "#83c092", - "theme.bar.menus.iconbuttons.passive": "#d3c6aa", - "theme.bar.menus.buttons.text": "#2b3339", - "theme.bar.menus.buttons.disabled": "#83c093", - "theme.bar.menus.buttons.active": "#a7c080", - "theme.bar.menus.buttons.default": "#83c092", - "theme.bar.menus.switch.puck": "#454b53", - "theme.bar.menus.switch.disabled": "#2f383e", - "theme.bar.menus.switch.enabled": "#83c092", - "theme.bar.menus.icons.active": "#83c092", - "theme.bar.menus.icons.passive": "#83c092", - "theme.bar.menus.listitems.active": "#83c091", - "theme.bar.menus.listitems.passive": "#d3c6aa", - "theme.bar.menus.label": "#83c092", - "theme.bar.menus.feinttext": "#2f383e", - "theme.bar.menus.dimtext": "#83c092", - "theme.bar.menus.cards": "#2f383e", - "theme.bar.buttons.notifications.total": "#83c092", - "theme.bar.buttons.notifications.icon": "#323d43", - "theme.bar.buttons.notifications.background": "#323d43", - "theme.bar.buttons.clock.icon": "#323d43", - "theme.bar.buttons.clock.text": "#dbbc7f", - "theme.bar.buttons.clock.background": "#323d43", - "theme.bar.buttons.battery.icon": "#323d43", - "theme.bar.buttons.battery.text": "#e69875", - "theme.bar.buttons.battery.background": "#323d43", - "theme.bar.buttons.systray.background": "#323d43", - "theme.bar.buttons.bluetooth.icon": "#323d43", - "theme.bar.buttons.bluetooth.text": "#a7c080", - "theme.bar.buttons.bluetooth.background": "#323d43", - "theme.bar.buttons.network.icon": "#323d43", - "theme.bar.buttons.network.text": "#e69875", - "theme.bar.buttons.network.background": "#323d43", - "theme.bar.buttons.volume.icon": "#323d43", - "theme.bar.buttons.volume.text": "#dbbc7f", - "theme.bar.buttons.volume.background": "#323d43", - "theme.bar.buttons.windowtitle.icon": "#323d43", - "theme.bar.buttons.windowtitle.text": "#dbbc7f", - "theme.bar.buttons.windowtitle.background": "#323d43", - "theme.bar.buttons.workspaces.active": "#dbbc7f", - "theme.bar.buttons.workspaces.occupied": "#e69875", - "theme.bar.buttons.workspaces.available": "#a7c080", - "theme.bar.buttons.workspaces.hover": "#dbbc7f", - "theme.bar.buttons.workspaces.background": "#323d43", - "theme.bar.buttons.dashboard.icon": "#323d43", - "theme.bar.buttons.dashboard.background": "#e69875", - "theme.osd.label": "#d3c6aa", - "theme.osd.icon": "#2b3339", - "theme.osd.bar_overflow_color": "#e67e80", - "theme.osd.bar_empty_color": "#504945", - "theme.osd.bar_color": "#d3c6aa", - "theme.osd.icon_container": "#d3c6aa", - "theme.osd.bar_container": "#2b3339", - "theme.notification.close_button.label": "#2b3339", - "theme.notification.close_button.background": "#e67e80", - "theme.notification.labelicon": "#d3c6aa", - "theme.notification.text": "#d8caac", - "theme.notification.time": "#a89984", - "theme.notification.border": "#323d43", - "theme.notification.label": "#d3c6aa", - "theme.notification.actions.text": "#2b3339", - "theme.notification.actions.background": "#a7c080", - "theme.notification.background": "#2b3239", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#2f383e", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#dbbc7f", - "theme.bar.buttons.network.icon_background": "#e69875", - "theme.bar.buttons.bluetooth.icon_background": "#a7c080", - "theme.bar.buttons.windowtitle.icon_background": "#dbbc7f", - "theme.bar.buttons.media.icon_background": "#a7c080", - "theme.bar.buttons.notifications.icon_background": "#83c092", - "theme.bar.buttons.battery.icon_background": "#e69875", - "theme.bar.buttons.clock.icon_background": "#dbbc7f", - "theme.bar.menus.menu.notifications.pager.button": "#a7c080", - "theme.bar.menus.menu.notifications.scrollbar.color": "#a7c080", - "theme.bar.menus.menu.notifications.pager.label": "#7a8478", - "theme.bar.menus.menu.notifications.pager.background": "#2b3339", - "theme.bar.buttons.modules.ram.icon": "#21252b", - "theme.bar.buttons.modules.storage.icon_background": "#e67e80", - "theme.bar.menus.popover.border": "#3a4248", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#83c092", - "theme.bar.menus.menu.power.buttons.restart.text": "#dbbc7f", - "theme.bar.buttons.modules.updates.background": "#323d43", - "theme.bar.buttons.modules.storage.icon": "#21252b", - "theme.bar.buttons.modules.netstat.background": "#323d43", - "theme.bar.buttons.modules.weather.icon": "#323d43", - "theme.bar.buttons.modules.netstat.text": "#a7c080", - "theme.bar.buttons.modules.storage.background": "#323d43", - "theme.bar.buttons.modules.power.icon": "#21252b", - "theme.bar.buttons.modules.storage.text": "#e67e80", - "theme.bar.buttons.modules.cpu.background": "#323d43", - "theme.bar.menus.menu.power.border.color": "#454b53", - "theme.bar.buttons.modules.power.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.logout.icon": "#3a4248", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.restart.icon": "#3a4248", - "theme.bar.buttons.modules.cpu.icon": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon_background": "#83c092", - "theme.bar.buttons.modules.weather.text": "#a7c080", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#3a4248", - "theme.bar.menus.menu.power.buttons.sleep.text": "#83c092", - "theme.bar.buttons.modules.weather.icon_background": "#a7c080", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#2f383e", - "theme.bar.menus.menu.power.buttons.logout.background": "#2f383e", - "theme.bar.buttons.modules.kbLayout.icon": "#21252b", - "theme.bar.buttons.modules.ram.icon_background": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e67e80", - "theme.bar.menus.menu.power.buttons.sleep.background": "#2f383e", - "theme.bar.buttons.modules.ram.text": "#dbbc7f", - "theme.bar.menus.menu.power.buttons.logout.text": "#a7c080", - "theme.bar.buttons.modules.updates.icon_background": "#83c092", - "theme.bar.buttons.modules.kbLayout.background": "#323d43", - "theme.bar.buttons.modules.power.background": "#323d43", - "theme.bar.buttons.modules.weather.background": "#323d43", - "theme.bar.menus.menu.power.background.color": "#2b3339", - "theme.bar.buttons.modules.ram.background": "#323d43", - "theme.bar.buttons.modules.netstat.icon": "#21252b", - "theme.bar.buttons.modules.cpu.icon_background": "#e67e80", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#a7c080", - "theme.bar.buttons.modules.updates.text": "#83c092", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#3a4248", - "theme.bar.menus.menu.power.buttons.restart.background": "#2f383e", - "theme.bar.buttons.modules.updates.icon": "#21252b", - "theme.bar.buttons.modules.cpu.text": "#e67e80", - "theme.bar.buttons.modules.netstat.icon_background": "#a7c080", - "theme.bar.buttons.modules.kbLayout.text": "#83c092", - "theme.bar.buttons.modules.power.border": "#e67e80", - "theme.bar.buttons.modules.weather.border": "#a7c080", - "theme.bar.buttons.modules.updates.border": "#83c092", - "theme.bar.buttons.modules.kbLayout.border": "#83c092", - "theme.bar.buttons.modules.netstat.border": "#a7c080", - "theme.bar.buttons.modules.storage.border": "#e67e80", - "theme.bar.buttons.modules.cpu.border": "#e67e80", - "theme.bar.buttons.modules.ram.border": "#dbbc7f", - "theme.bar.buttons.notifications.border": "#83c092", - "theme.bar.buttons.clock.border": "#dbbc7f", - "theme.bar.buttons.battery.border": "#e69875", - "theme.bar.buttons.systray.border": "#454b53", - "theme.bar.buttons.bluetooth.border": "#a7c080", - "theme.bar.buttons.network.border": "#e69875", - "theme.bar.buttons.volume.border": "#dbbc7f", - "theme.bar.buttons.media.border": "#a7c080", - "theme.bar.buttons.windowtitle.border": "#dbbc7f", - "theme.bar.buttons.workspaces.border": "#2b3339", - "theme.bar.buttons.dashboard.border": "#e69875", - "theme.bar.buttons.modules.submap.background": "#323d43", - "theme.bar.buttons.modules.submap.text": "#83c092", - "theme.bar.buttons.modules.submap.border": "#83c092", - "theme.bar.buttons.modules.submap.icon": "#21252b", - "theme.bar.buttons.modules.submap.icon_background": "#83c092" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/gruvbox.json b/ags/HyprPanel/themes/gruvbox.json deleted file mode 100644 index b6b4a9d..0000000 --- a/ags/HyprPanel/themes/gruvbox.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#83a598", - "theme.bar.menus.menu.notifications.pager.label": "#a89984", - "theme.bar.menus.menu.notifications.pager.button": "#83a598", - "theme.bar.menus.menu.notifications.pager.background": "#1d2021", - "theme.bar.menus.menu.notifications.switch.puck": "#504945", - "theme.bar.menus.menu.notifications.switch.disabled": "#3c3836", - "theme.bar.menus.menu.notifications.switch.enabled": "#83a598", - "theme.bar.menus.menu.notifications.clear": "#83a598", - "theme.bar.menus.menu.notifications.switch_divider": "#504945", - "theme.bar.menus.menu.notifications.border": "#3c3836", - "theme.bar.menus.menu.notifications.card": "#282828", - "theme.bar.menus.menu.notifications.background": "#1d2021", - "theme.bar.menus.menu.notifications.no_notifications_label": "#3c3836", - "theme.bar.menus.menu.notifications.label": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.sleep.text": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.background": "#282828", - "theme.bar.menus.menu.power.buttons.logout.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.logout.text": "#b8bb26", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#b8bb26", - "theme.bar.menus.menu.power.buttons.logout.background": "#282828", - "theme.bar.menus.menu.power.buttons.restart.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.restart.text": "#fe8019", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fe8019", - "theme.bar.menus.menu.power.buttons.restart.background": "#282828", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#cc241d", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#cc241d", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#282828", - "theme.bar.menus.menu.power.border.color": "#3c3836", - "theme.bar.menus.menu.power.background.color": "#1d2021", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#504945", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#83a598", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#b16286", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8ec07c", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#fb4934", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#fabd2f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#d3869b", - "theme.bar.menus.menu.dashboard.controls.input.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.input.background": "#d3869b", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#fb4934", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#fabd2f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#83a598", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#b16286", - "theme.bar.menus.menu.dashboard.controls.disabled": "#665c54", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#b8bb26", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#32302f", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#d3869b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#8ec07b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#ebdbb2", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#3c3836", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#b8bb26", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fe8019", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#cc241d", - "theme.bar.menus.menu.dashboard.profile.name": "#d3869b", - "theme.bar.menus.menu.dashboard.border.color": "#3c3836", - "theme.bar.menus.menu.dashboard.background.color": "#1d2021", - "theme.bar.menus.menu.dashboard.card.color": "#282828", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#d3869b", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#d3869b", - "theme.bar.menus.menu.clock.weather.hourly.time": "#d3869b", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#83a598", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#458588", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#83a598", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fe8019", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#cc241d", - "theme.bar.menus.menu.clock.weather.stats": "#d3869b", - "theme.bar.menus.menu.clock.weather.status": "#8ec07c", - "theme.bar.menus.menu.clock.weather.temperature": "#ebdbb2", - "theme.bar.menus.menu.clock.weather.icon": "#d3869b", - "theme.bar.menus.menu.clock.calendar.contextdays": "#665c54", - "theme.bar.menus.menu.clock.calendar.days": "#ebdbb2", - "theme.bar.menus.menu.clock.calendar.currentday": "#d3869b", - "theme.bar.menus.menu.clock.calendar.paginator": "#d3869b", - "theme.bar.menus.menu.clock.calendar.weekdays": "#d3869b", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8ec07c", - "theme.bar.menus.menu.clock.time.timeperiod": "#8ec07c", - "theme.bar.menus.menu.clock.time.time": "#d3869b", - "theme.bar.menus.menu.clock.text": "#ebdbb2", - "theme.bar.menus.menu.clock.border.color": "#3c3836", - "theme.bar.menus.menu.clock.background.color": "#1d2021", - "theme.bar.menus.menu.clock.card.color": "#282828", - "theme.bar.menus.menu.battery.slider.puck": "#7c6f64", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#504945", - "theme.bar.menus.menu.battery.slider.background": "#665c54", - "theme.bar.menus.menu.battery.slider.primary": "#fabd2f", - "theme.bar.menus.menu.battery.icons.active": "#fabd2f", - "theme.bar.menus.menu.battery.icons.passive": "#a89984", - "theme.bar.menus.menu.battery.listitems.active": "#fabd2f", - "theme.bar.menus.menu.battery.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.battery.text": "#ebdbb2", - "theme.bar.menus.menu.battery.label.color": "#fabd2f", - "theme.bar.menus.menu.battery.border.color": "#3c3836", - "theme.bar.menus.menu.battery.background.color": "#1d2021", - "theme.bar.menus.menu.battery.card.color": "#282828", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1d2021", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#ebdbb2", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#1d2021", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#83a598", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.icons.active": "#83a598", - "theme.bar.menus.menu.bluetooth.icons.passive": "#a89984", - "theme.bar.menus.menu.bluetooth.listitems.active": "#83a598", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.switch.puck": "#504945", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#3c3836", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#83a598", - "theme.bar.menus.menu.bluetooth.switch_divider": "#504945", - "theme.bar.menus.menu.bluetooth.status": "#7c6f64", - "theme.bar.menus.menu.bluetooth.text": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.label.color": "#83a598", - "theme.bar.menus.menu.bluetooth.border.color": "#3c3836", - "theme.bar.menus.menu.bluetooth.background.color": "#1d2021", - "theme.bar.menus.menu.bluetooth.card.color": "#282828", - "theme.bar.menus.menu.network.iconbuttons.active": "#b16286", - "theme.bar.menus.menu.network.iconbuttons.passive": "#ebdbb2", - "theme.bar.menus.menu.network.icons.active": "#b16286", - "theme.bar.menus.menu.network.icons.passive": "#a89984", - "theme.bar.menus.menu.network.listitems.active": "#b16286", - "theme.bar.menus.menu.network.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.network.status.color": "#7c6f64", - "theme.bar.menus.menu.network.text": "#ebdbb2", - "theme.bar.menus.menu.network.label.color": "#b16286", - "theme.bar.menus.menu.network.border.color": "#3c3836", - "theme.bar.menus.menu.network.background.color": "#1d2021", - "theme.bar.menus.menu.network.card.color": "#282828", - "theme.bar.menus.menu.volume.input_slider.puck": "#665c54", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#504945", - "theme.bar.menus.menu.volume.input_slider.background": "#665c54", - "theme.bar.menus.menu.volume.input_slider.primary": "#fe8018", - "theme.bar.menus.menu.volume.audio_slider.puck": "#665c54", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#504945", - "theme.bar.menus.menu.volume.audio_slider.background": "#665c54", - "theme.bar.menus.menu.volume.audio_slider.primary": "#fe8018", - "theme.bar.menus.menu.volume.icons.active": "#fe8018", - "theme.bar.menus.menu.volume.icons.passive": "#a89984", - "theme.bar.menus.menu.volume.iconbutton.active": "#fe8018", - "theme.bar.menus.menu.volume.iconbutton.passive": "#ebdbb2", - "theme.bar.menus.menu.volume.listitems.active": "#fe8018", - "theme.bar.menus.menu.volume.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.volume.text": "#ebdbb2", - "theme.bar.menus.menu.volume.label.color": "#fe8018", - "theme.bar.menus.menu.volume.border.color": "#3c3836", - "theme.bar.menus.menu.volume.background.color": "#1d2021", - "theme.bar.menus.menu.volume.card.color": "#282828", - "theme.bar.menus.menu.media.slider.puck": "#7c6f64", - "theme.bar.menus.menu.media.slider.backgroundhover": "#504945", - "theme.bar.menus.menu.media.slider.background": "#665c54", - "theme.bar.menus.menu.media.slider.primary": "#d3869b", - "theme.bar.menus.menu.media.buttons.text": "#1d2021", - "theme.bar.menus.menu.media.buttons.background": "#83a598", - "theme.bar.menus.menu.media.buttons.enabled": "#8ec07c", - "theme.bar.menus.menu.media.buttons.inactive": "#665c54", - "theme.bar.menus.menu.media.border.color": "#3c3836", - "theme.bar.menus.menu.media.card.color": "#282828", - "theme.bar.menus.menu.media.background.color": "#1d2021", - "theme.bar.menus.menu.media.album": "#d3869b", - "theme.bar.menus.menu.media.artist": "#8ec07c", - "theme.bar.menus.menu.media.song": "#83a598", - "theme.bar.menus.tooltip.text": "#ebdbb2", - "theme.bar.menus.tooltip.background": "#1d2021", - "theme.bar.menus.dropdownmenu.divider": "#1d2021", - "theme.bar.menus.dropdownmenu.text": "#ebdbb2", - "theme.bar.menus.dropdownmenu.background": "#1d2021", - "theme.bar.menus.slider.puck": "#7c6f64", - "theme.bar.menus.slider.backgroundhover": "#504945", - "theme.bar.menus.slider.background": "#665c54", - "theme.bar.menus.slider.primary": "#83a598", - "theme.bar.menus.progressbar.background": "#504945", - "theme.bar.menus.progressbar.foreground": "#83a598", - "theme.bar.menus.iconbuttons.active": "#83a598", - "theme.bar.menus.iconbuttons.passive": "#ebdbb2", - "theme.bar.menus.buttons.text": "#32302f", - "theme.bar.menus.buttons.disabled": "#665c54", - "theme.bar.menus.buttons.active": "#d3869b", - "theme.bar.menus.buttons.default": "#83a598", - "theme.bar.menus.check_radio_button.active": "#83a598", - "theme.bar.menus.check_radio_button.background": "#3c3836", - "theme.bar.menus.switch.puck": "#504945", - "theme.bar.menus.switch.disabled": "#3c3836", - "theme.bar.menus.switch.enabled": "#83a598", - "theme.bar.menus.icons.active": "#83a598", - "theme.bar.menus.icons.passive": "#665c54", - "theme.bar.menus.listitems.active": "#83a598", - "theme.bar.menus.listitems.passive": "#ebdbb2", - "theme.bar.menus.popover.border": "#32302f", - "theme.bar.menus.popover.background": "#32302f", - "theme.bar.menus.popover.text": "#83a598", - "theme.bar.menus.label": "#83a598", - "theme.bar.menus.feinttext": "#3c3836", - "theme.bar.menus.dimtext": "#665c54", - "theme.bar.menus.text": "#ebdbb2", - "theme.bar.menus.border.color": "#3c3836", - "theme.bar.menus.cards": "#1d2021", - "theme.bar.menus.background": "#1d2021", - "theme.bar.buttons.modules.power.icon_background": "#282828", - "theme.bar.buttons.modules.power.icon": "#cc241d", - "theme.bar.buttons.modules.power.background": "#282828", - "theme.bar.buttons.modules.weather.icon_background": "#282828", - "theme.bar.buttons.modules.weather.icon": "#fe8017", - "theme.bar.buttons.modules.weather.text": "#fe8017", - "theme.bar.buttons.modules.weather.background": "#282828", - "theme.bar.buttons.modules.updates.icon_background": "#282828", - "theme.bar.buttons.modules.updates.icon": "#b16286", - "theme.bar.buttons.modules.updates.text": "#b16286", - "theme.bar.buttons.modules.updates.background": "#282828", - "theme.bar.buttons.modules.kbLayout.icon_background": "#282828", - "theme.bar.buttons.modules.kbLayout.icon": "#83a598", - "theme.bar.buttons.modules.kbLayout.text": "#83a598", - "theme.bar.buttons.modules.kbLayout.background": "#282828", - "theme.bar.buttons.modules.netstat.icon_background": "#282828", - "theme.bar.buttons.modules.netstat.icon": "#b8bb26", - "theme.bar.buttons.modules.netstat.text": "#b8bb26", - "theme.bar.buttons.modules.netstat.background": "#282828", - "theme.bar.buttons.modules.storage.icon_background": "#282828", - "theme.bar.buttons.modules.storage.icon": "#83a598", - "theme.bar.buttons.modules.storage.text": "#83a598", - "theme.bar.buttons.modules.storage.background": "#282828", - "theme.bar.buttons.modules.cpu.icon_background": "#282828", - "theme.bar.buttons.modules.cpu.icon": "#d3869b", - "theme.bar.buttons.modules.cpu.text": "#d3869b", - "theme.bar.buttons.modules.cpu.background": "#282828", - "theme.bar.buttons.modules.ram.icon_background": "#282828", - "theme.bar.buttons.modules.ram.icon": "#fabd2f", - "theme.bar.buttons.modules.ram.text": "#fabd2f", - "theme.bar.buttons.modules.ram.background": "#282828", - "theme.bar.buttons.notifications.total": "#83a598", - "theme.bar.buttons.notifications.icon_background": "#83a598", - "theme.bar.buttons.notifications.icon": "#83a598", - "theme.bar.buttons.notifications.background": "#282828", - "theme.bar.buttons.clock.icon_background": "#d3869b", - "theme.bar.buttons.clock.icon": "#d3869b", - "theme.bar.buttons.clock.text": "#d3869b", - "theme.bar.buttons.clock.background": "#282828", - "theme.bar.buttons.battery.icon_background": "#fabd2f", - "theme.bar.buttons.battery.icon": "#fabd2f", - "theme.bar.buttons.battery.text": "#fabd2f", - "theme.bar.buttons.battery.background": "#282828", - "theme.bar.buttons.systray.background": "#282828", - "theme.bar.buttons.bluetooth.icon_background": "#83a598", - "theme.bar.buttons.bluetooth.icon": "#83a598", - "theme.bar.buttons.bluetooth.text": "#83a598", - "theme.bar.buttons.bluetooth.background": "#282828", - "theme.bar.buttons.network.icon_background": "#b16286", - "theme.bar.buttons.network.icon": "#b16286", - "theme.bar.buttons.network.text": "#b16286", - "theme.bar.buttons.network.background": "#282828", - "theme.bar.buttons.volume.icon_background": "#fe8018", - "theme.bar.buttons.volume.icon": "#fe8018", - "theme.bar.buttons.volume.text": "#fe8018", - "theme.bar.buttons.volume.background": "#282828", - "theme.bar.buttons.media.icon_background": "#83a598", - "theme.bar.buttons.media.icon": "#83a598", - "theme.bar.buttons.media.text": "#83a598", - "theme.bar.buttons.media.background": "#282828", - "theme.bar.buttons.windowtitle.icon_background": "#d3869b", - "theme.bar.buttons.windowtitle.icon": "#d3869b", - "theme.bar.buttons.windowtitle.text": "#d3869b", - "theme.bar.buttons.windowtitle.background": "#282828", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.active": "#d3869b", - "theme.bar.buttons.workspaces.occupied": "#fb4934", - "theme.bar.buttons.workspaces.available": "#83a598", - "theme.bar.buttons.workspaces.hover": "#504945", - "theme.bar.buttons.workspaces.background": "#282828", - "theme.bar.buttons.dashboard.icon": "#fabd2f", - "theme.bar.buttons.dashboard.background": "#282828", - "theme.bar.buttons.icon": "#83a598", - "theme.bar.buttons.text": "#83a598", - "theme.bar.buttons.hover": "#504945", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#282828", - "theme.bar.buttons.style": "default", - "theme.bar.background": "#1d2021", - "theme.osd.label": "#83a598", - "theme.osd.icon": "#1d2021", - "theme.osd.bar_overflow_color": "#cc241d", - "theme.osd.bar_empty_color": "#3c3836", - "theme.osd.bar_color": "#83a598", - "theme.osd.icon_container": "#83a598", - "theme.osd.bar_container": "#1d2021", - "theme.notification.close_button.label": "#1d2021", - "theme.notification.close_button.background": "#83a598", - "theme.notification.labelicon": "#83a598", - "theme.notification.text": "#ebdbb2", - "theme.notification.time": "#928374", - "theme.notification.border": "#3c3836", - "theme.notification.label": "#83a598", - "theme.notification.actions.text": "#32302f", - "theme.notification.actions.background": "#83a598", - "theme.notification.background": "#32302f", - "theme.bar.buttons.modules.power.border": "#282828", - "theme.bar.buttons.modules.weather.border": "#fe8017", - "theme.bar.buttons.modules.updates.border": "#b16286", - "theme.bar.buttons.modules.kbLayout.border": "#83a598", - "theme.bar.buttons.modules.netstat.border": "#b8bb26", - "theme.bar.buttons.modules.storage.border": "#83a598", - "theme.bar.buttons.modules.cpu.border": "#d3869b", - "theme.bar.buttons.modules.ram.border": "#fabd2f", - "theme.bar.buttons.notifications.border": "#83a598", - "theme.bar.buttons.clock.border": "#d3869b", - "theme.bar.buttons.battery.border": "#fabd2f", - "theme.bar.buttons.systray.border": "#504945", - "theme.bar.buttons.bluetooth.border": "#83a598", - "theme.bar.buttons.network.border": "#b16286", - "theme.bar.buttons.volume.border": "#fe8018", - "theme.bar.buttons.media.border": "#83a598", - "theme.bar.buttons.windowtitle.border": "#d3869b", - "theme.bar.buttons.workspaces.border": "#ffffff", - "theme.bar.buttons.dashboard.border": "#fabd2f", - "theme.bar.buttons.modules.submap.background": "#282828", - "theme.bar.buttons.modules.submap.text": "#8ec07c", - "theme.bar.buttons.modules.submap.border": "#8ec07c", - "theme.bar.buttons.modules.submap.icon": "#8ec07c", - "theme.bar.buttons.modules.submap.icon_background": "#282828" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/gruvbox_split.json b/ags/HyprPanel/themes/gruvbox_split.json deleted file mode 100644 index e41ab29..0000000 --- a/ags/HyprPanel/themes/gruvbox_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.menu.notifications.scrollbar.color": "#83a598", - "theme.bar.menus.menu.notifications.pager.label": "#a89984", - "theme.bar.menus.menu.notifications.pager.button": "#83a598", - "theme.bar.menus.menu.notifications.pager.background": "#1d2021", - "theme.bar.menus.menu.notifications.switch.puck": "#504945", - "theme.bar.menus.menu.notifications.switch.disabled": "#3c3836", - "theme.bar.menus.menu.notifications.switch.enabled": "#83a598", - "theme.bar.menus.menu.notifications.clear": "#83a598", - "theme.bar.menus.menu.notifications.switch_divider": "#504945", - "theme.bar.menus.menu.notifications.border": "#3c3836", - "theme.bar.menus.menu.notifications.card": "#282828", - "theme.bar.menus.menu.notifications.background": "#1d2021", - "theme.bar.menus.menu.notifications.no_notifications_label": "#3c3836", - "theme.bar.menus.menu.notifications.label": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.sleep.text": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#83a598", - "theme.bar.menus.menu.power.buttons.sleep.background": "#282828", - "theme.bar.menus.menu.power.buttons.logout.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.logout.text": "#b8bb26", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#b8bb26", - "theme.bar.menus.menu.power.buttons.logout.background": "#282828", - "theme.bar.menus.menu.power.buttons.restart.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.restart.text": "#fe8019", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#fe8019", - "theme.bar.menus.menu.power.buttons.restart.background": "#282828", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#32302f", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#cc241d", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#cc241d", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#282828", - "theme.bar.menus.menu.power.border.color": "#3c3836", - "theme.bar.menus.menu.power.background.color": "#1d2021", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#d3869b", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#b8bb26", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#fabd2f", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#fb4934", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#504945", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#83a598", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#b16286", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8ec07c", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#fb4934", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#fabd2f", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#d3869b", - "theme.bar.menus.menu.dashboard.controls.input.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.input.background": "#d3869b", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#fb4934", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#fabd2f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#83a598", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#32302f", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#b16286", - "theme.bar.menus.menu.dashboard.controls.disabled": "#665c54", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#b8bb26", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#32302f", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#d3869b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#8ec07b", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#ebdbb2", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#3c3836", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1d2021", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#83a598", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#b8bb26", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#fe8019", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#cc241d", - "theme.bar.menus.menu.dashboard.profile.name": "#d3869b", - "theme.bar.menus.menu.dashboard.border.color": "#3c3836", - "theme.bar.menus.menu.dashboard.background.color": "#1d2021", - "theme.bar.menus.menu.dashboard.card.color": "#282828", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#d3869b", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#d3869b", - "theme.bar.menus.menu.clock.weather.hourly.time": "#d3869b", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#83a598", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#458588", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#83a598", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#fe8019", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#cc241d", - "theme.bar.menus.menu.clock.weather.stats": "#d3869b", - "theme.bar.menus.menu.clock.weather.status": "#8ec07c", - "theme.bar.menus.menu.clock.weather.temperature": "#ebdbb2", - "theme.bar.menus.menu.clock.weather.icon": "#d3869b", - "theme.bar.menus.menu.clock.calendar.contextdays": "#665c54", - "theme.bar.menus.menu.clock.calendar.days": "#ebdbb2", - "theme.bar.menus.menu.clock.calendar.currentday": "#d3869b", - "theme.bar.menus.menu.clock.calendar.paginator": "#d3869b", - "theme.bar.menus.menu.clock.calendar.weekdays": "#d3869b", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8ec07c", - "theme.bar.menus.menu.clock.time.timeperiod": "#8ec07c", - "theme.bar.menus.menu.clock.time.time": "#d3869b", - "theme.bar.menus.menu.clock.text": "#ebdbb2", - "theme.bar.menus.menu.clock.border.color": "#3c3836", - "theme.bar.menus.menu.clock.background.color": "#1d2021", - "theme.bar.menus.menu.clock.card.color": "#282828", - "theme.bar.menus.menu.battery.slider.puck": "#7c6f64", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#504945", - "theme.bar.menus.menu.battery.slider.background": "#665c54", - "theme.bar.menus.menu.battery.slider.primary": "#fabd2f", - "theme.bar.menus.menu.battery.icons.active": "#fabd2f", - "theme.bar.menus.menu.battery.icons.passive": "#a89984", - "theme.bar.menus.menu.battery.listitems.active": "#fabd2f", - "theme.bar.menus.menu.battery.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.battery.text": "#ebdbb2", - "theme.bar.menus.menu.battery.label.color": "#fabd2f", - "theme.bar.menus.menu.battery.border.color": "#3c3836", - "theme.bar.menus.menu.battery.background.color": "#1d2021", - "theme.bar.menus.menu.battery.card.color": "#282828", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1d2021", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#ebdbb2", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#1d2021", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#83a598", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.icons.active": "#83a598", - "theme.bar.menus.menu.bluetooth.icons.passive": "#a89984", - "theme.bar.menus.menu.bluetooth.listitems.active": "#83a598", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.switch.puck": "#504945", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#3c3836", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#83a598", - "theme.bar.menus.menu.bluetooth.switch_divider": "#504945", - "theme.bar.menus.menu.bluetooth.status": "#7c6f64", - "theme.bar.menus.menu.bluetooth.text": "#ebdbb2", - "theme.bar.menus.menu.bluetooth.label.color": "#83a598", - "theme.bar.menus.menu.bluetooth.border.color": "#3c3836", - "theme.bar.menus.menu.bluetooth.background.color": "#1d2021", - "theme.bar.menus.menu.bluetooth.card.color": "#282828", - "theme.bar.menus.menu.network.iconbuttons.active": "#b16286", - "theme.bar.menus.menu.network.iconbuttons.passive": "#ebdbb2", - "theme.bar.menus.menu.network.icons.active": "#b16286", - "theme.bar.menus.menu.network.icons.passive": "#a89984", - "theme.bar.menus.menu.network.listitems.active": "#b16286", - "theme.bar.menus.menu.network.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.network.status.color": "#7c6f64", - "theme.bar.menus.menu.network.text": "#ebdbb2", - "theme.bar.menus.menu.network.label.color": "#b16286", - "theme.bar.menus.menu.network.border.color": "#3c3836", - "theme.bar.menus.menu.network.background.color": "#1d2021", - "theme.bar.menus.menu.network.card.color": "#282828", - "theme.bar.menus.menu.volume.input_slider.puck": "#665c54", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#504945", - "theme.bar.menus.menu.volume.input_slider.background": "#665c54", - "theme.bar.menus.menu.volume.input_slider.primary": "#fe8018", - "theme.bar.menus.menu.volume.audio_slider.puck": "#665c54", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#504945", - "theme.bar.menus.menu.volume.audio_slider.background": "#665c54", - "theme.bar.menus.menu.volume.audio_slider.primary": "#fe8018", - "theme.bar.menus.menu.volume.icons.active": "#fe8018", - "theme.bar.menus.menu.volume.icons.passive": "#a89984", - "theme.bar.menus.menu.volume.iconbutton.active": "#fe8018", - "theme.bar.menus.menu.volume.iconbutton.passive": "#ebdbb2", - "theme.bar.menus.menu.volume.listitems.active": "#fe8018", - "theme.bar.menus.menu.volume.listitems.passive": "#ebdbb2", - "theme.bar.menus.menu.volume.text": "#ebdbb2", - "theme.bar.menus.menu.volume.label.color": "#fe8018", - "theme.bar.menus.menu.volume.border.color": "#3c3836", - "theme.bar.menus.menu.volume.background.color": "#1d2021", - "theme.bar.menus.menu.volume.card.color": "#282828", - "theme.bar.menus.menu.media.slider.puck": "#7c6f64", - "theme.bar.menus.menu.media.slider.backgroundhover": "#504945", - "theme.bar.menus.menu.media.slider.background": "#665c54", - "theme.bar.menus.menu.media.slider.primary": "#d3869b", - "theme.bar.menus.menu.media.buttons.text": "#1d2021", - "theme.bar.menus.menu.media.buttons.background": "#83a598", - "theme.bar.menus.menu.media.buttons.enabled": "#8ec07c", - "theme.bar.menus.menu.media.buttons.inactive": "#665c54", - "theme.bar.menus.menu.media.border.color": "#3c3836", - "theme.bar.menus.menu.media.card.color": "#282828", - "theme.bar.menus.menu.media.background.color": "#1d2021", - "theme.bar.menus.menu.media.album": "#d3869b", - "theme.bar.menus.menu.media.artist": "#8ec07c", - "theme.bar.menus.menu.media.song": "#83a598", - "theme.bar.menus.tooltip.text": "#ebdbb2", - "theme.bar.menus.tooltip.background": "#1d2021", - "theme.bar.menus.dropdownmenu.divider": "#1d2021", - "theme.bar.menus.dropdownmenu.text": "#ebdbb2", - "theme.bar.menus.dropdownmenu.background": "#1d2021", - "theme.bar.menus.slider.puck": "#7c6f64", - "theme.bar.menus.slider.backgroundhover": "#504945", - "theme.bar.menus.slider.background": "#665c54", - "theme.bar.menus.slider.primary": "#83a598", - "theme.bar.menus.progressbar.background": "#504945", - "theme.bar.menus.progressbar.foreground": "#83a598", - "theme.bar.menus.iconbuttons.active": "#83a598", - "theme.bar.menus.iconbuttons.passive": "#ebdbb2", - "theme.bar.menus.buttons.text": "#32302f", - "theme.bar.menus.buttons.disabled": "#665c54", - "theme.bar.menus.buttons.active": "#d3869b", - "theme.bar.menus.buttons.default": "#83a598", - "theme.bar.menus.check_radio_button.active": "#83a598", - "theme.bar.menus.check_radio_button.background": "#3c3836", - "theme.bar.menus.switch.puck": "#504945", - "theme.bar.menus.switch.disabled": "#3c3836", - "theme.bar.menus.switch.enabled": "#83a598", - "theme.bar.menus.icons.active": "#83a598", - "theme.bar.menus.icons.passive": "#665c54", - "theme.bar.menus.listitems.active": "#83a598", - "theme.bar.menus.listitems.passive": "#ebdbb2", - "theme.bar.menus.popover.border": "#32302f", - "theme.bar.menus.popover.background": "#32302f", - "theme.bar.menus.popover.text": "#83a598", - "theme.bar.menus.label": "#83a598", - "theme.bar.menus.feinttext": "#3c3836", - "theme.bar.menus.dimtext": "#665c54", - "theme.bar.menus.text": "#ebdbb2", - "theme.bar.menus.border.color": "#3c3836", - "theme.bar.menus.cards": "#1d2021", - "theme.bar.menus.background": "#1d2021", - "theme.bar.buttons.modules.power.icon_background": "#fb4934", - "theme.bar.buttons.modules.power.icon": "#21252b", - "theme.bar.buttons.modules.power.background": "#282828", - "theme.bar.buttons.modules.weather.icon_background": "#fe8017", - "theme.bar.buttons.modules.weather.icon": "#282828", - "theme.bar.buttons.modules.weather.text": "#fe8017", - "theme.bar.buttons.modules.weather.background": "#282828", - "theme.bar.buttons.modules.updates.icon_background": "#b16286", - "theme.bar.buttons.modules.updates.icon": "#21252b", - "theme.bar.buttons.modules.updates.text": "#b16286", - "theme.bar.buttons.modules.updates.background": "#282828", - "theme.bar.buttons.modules.kbLayout.icon_background": "#83a598", - "theme.bar.buttons.modules.kbLayout.icon": "#21252b", - "theme.bar.buttons.modules.kbLayout.text": "#83a598", - "theme.bar.buttons.modules.kbLayout.background": "#282828", - "theme.bar.buttons.modules.netstat.icon_background": "#b8bb26", - "theme.bar.buttons.modules.netstat.icon": "#21252b", - "theme.bar.buttons.modules.netstat.text": "#b8bb26", - "theme.bar.buttons.modules.netstat.background": "#282828", - "theme.bar.buttons.modules.storage.icon_background": "#83a598", - "theme.bar.buttons.modules.storage.icon": "#21252b", - "theme.bar.buttons.modules.storage.text": "#83a598", - "theme.bar.buttons.modules.storage.background": "#282828", - "theme.bar.buttons.modules.cpu.icon_background": "#d3869b", - "theme.bar.buttons.modules.cpu.icon": "#21252b", - "theme.bar.buttons.modules.cpu.text": "#d3869b", - "theme.bar.buttons.modules.cpu.background": "#282828", - "theme.bar.buttons.modules.ram.icon_background": "#fabd2f", - "theme.bar.buttons.modules.ram.icon": "#21252b", - "theme.bar.buttons.modules.ram.text": "#fabd2f", - "theme.bar.buttons.modules.ram.background": "#282828", - "theme.bar.buttons.notifications.total": "#83a598", - "theme.bar.buttons.notifications.icon_background": "#83a598", - "theme.bar.buttons.notifications.icon": "#282828", - "theme.bar.buttons.notifications.background": "#282828", - "theme.bar.buttons.clock.icon_background": "#d3869b", - "theme.bar.buttons.clock.icon": "#282828", - "theme.bar.buttons.clock.text": "#d3869b", - "theme.bar.buttons.clock.background": "#282828", - "theme.bar.buttons.battery.icon_background": "#fabd2f", - "theme.bar.buttons.battery.icon": "#282828", - "theme.bar.buttons.battery.text": "#fabd2f", - "theme.bar.buttons.battery.background": "#282828", - "theme.bar.buttons.systray.background": "#282828", - "theme.bar.buttons.bluetooth.icon_background": "#83a598", - "theme.bar.buttons.bluetooth.icon": "#282828", - "theme.bar.buttons.bluetooth.text": "#83a598", - "theme.bar.buttons.bluetooth.background": "#282828", - "theme.bar.buttons.network.icon_background": "#b16286", - "theme.bar.buttons.network.icon": "#282828", - "theme.bar.buttons.network.text": "#b16286", - "theme.bar.buttons.network.background": "#282828", - "theme.bar.buttons.volume.icon_background": "#fe8018", - "theme.bar.buttons.volume.icon": "#282828", - "theme.bar.buttons.volume.text": "#fe8018", - "theme.bar.buttons.volume.background": "#282828", - "theme.bar.buttons.media.icon_background": "#83a598", - "theme.bar.buttons.media.icon": "#282828", - "theme.bar.buttons.media.text": "#83a598", - "theme.bar.buttons.media.background": "#282828", - "theme.bar.buttons.windowtitle.icon_background": "#d3869b", - "theme.bar.buttons.windowtitle.icon": "#282828", - "theme.bar.buttons.windowtitle.text": "#d3869b", - "theme.bar.buttons.windowtitle.background": "#282828", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.active": "#d3869b", - "theme.bar.buttons.workspaces.occupied": "#fb4934", - "theme.bar.buttons.workspaces.available": "#83a598", - "theme.bar.buttons.workspaces.hover": "#d3869b", - "theme.bar.buttons.workspaces.background": "#282828", - "theme.bar.buttons.dashboard.icon": "#282828", - "theme.bar.buttons.dashboard.background": "#fabc2f", - "theme.bar.buttons.icon": "#83a598", - "theme.bar.buttons.text": "#83a598", - "theme.bar.buttons.hover": "#504945", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.background": "#282828", - "theme.bar.buttons.style": "split", - "theme.bar.background": "#1d2021", - "theme.osd.label": "#83a598", - "theme.osd.icon": "#1d2021", - "theme.osd.bar_overflow_color": "#cc241d", - "theme.osd.bar_empty_color": "#3c3836", - "theme.osd.bar_color": "#83a598", - "theme.osd.icon_container": "#83a598", - "theme.osd.bar_container": "#1d2021", - "theme.notification.close_button.label": "#1d2021", - "theme.notification.close_button.background": "#83a598", - "theme.notification.labelicon": "#83a598", - "theme.notification.text": "#ebdbb2", - "theme.notification.time": "#928374", - "theme.notification.border": "#3c3836", - "theme.notification.label": "#83a598", - "theme.notification.actions.text": "#32302f", - "theme.notification.actions.background": "#83a598", - "theme.notification.background": "#32302f", - "theme.bar.buttons.modules.power.border": "#282828", - "theme.bar.buttons.modules.weather.border": "#fe8017", - "theme.bar.buttons.modules.updates.border": "#b16286", - "theme.bar.buttons.modules.kbLayout.border": "#83a598", - "theme.bar.buttons.modules.netstat.border": "#b8bb26", - "theme.bar.buttons.modules.storage.border": "#83a598", - "theme.bar.buttons.modules.cpu.border": "#d3869b", - "theme.bar.buttons.modules.ram.border": "#fabd2f", - "theme.bar.buttons.notifications.border": "#83a598", - "theme.bar.buttons.clock.border": "#d3869b", - "theme.bar.buttons.battery.border": "#fabd2f", - "theme.bar.buttons.systray.border": "#504945", - "theme.bar.buttons.bluetooth.border": "#83a598", - "theme.bar.buttons.network.border": "#b16286", - "theme.bar.buttons.volume.border": "#fe8018", - "theme.bar.buttons.media.border": "#83a598", - "theme.bar.buttons.windowtitle.border": "#d3869b", - "theme.bar.buttons.workspaces.border": "#ffffff", - "theme.bar.buttons.dashboard.border": "#fabd2f", - "theme.bar.buttons.modules.submap.background": "#282828", - "theme.bar.buttons.modules.submap.text": "#8ec07c", - "theme.bar.buttons.modules.submap.border": "#8ec07c", - "theme.bar.buttons.modules.submap.icon": "#21252b", - "theme.bar.buttons.modules.submap.icon_background": "#8ec07c" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/monochrome.json b/ags/HyprPanel/themes/monochrome.json deleted file mode 100644 index 86cb70b..0000000 --- a/ags/HyprPanel/themes/monochrome.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#000000", - "theme.bar.background": "#000000", - "theme.bar.buttons.media.icon": "#FFFFFF", - "theme.bar.buttons.media.text": "#FFFFFF", - "theme.bar.buttons.icon": "#FFFFFF", - "theme.bar.buttons.text": "#FFFFFF", - "theme.bar.buttons.hover": "#333333", - "theme.bar.buttons.background": "#1A1A1A", - "theme.bar.menus.text": "#CCCCCC", - "theme.bar.menus.border.color": "#333333", - "theme.bar.buttons.media.background": "#090909", - "theme.bar.menus.menu.volume.text": "#CCCCCC", - "theme.bar.menus.menu.volume.card.color": "#1A1A1A", - "theme.bar.menus.menu.volume.label.color": "#FFFFFF", - "theme.bar.menus.popover.text": "#FFFFFF", - "theme.bar.menus.popover.background": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#CCCCCC", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#333333", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.switch.puck": "#333333", - "theme.bar.menus.menu.notifications.switch.disabled": "#333333", - "theme.bar.menus.menu.notifications.switch.enabled": "#FFFFFF", - "theme.bar.menus.menu.notifications.clear": "#ffffff", - "theme.bar.menus.menu.notifications.switch_divider": "#333333", - "theme.bar.menus.menu.notifications.border": "#333333", - "theme.bar.menus.menu.notifications.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.background": "#000000", - "theme.bar.menus.menu.notifications.no_notifications_label": "#333333", - "theme.bar.menus.menu.notifications.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#333333", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ffffff", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#ffffff", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.input.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.input.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.disabled": "#333333", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#5CFF5C", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#000000", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ffffff", - "theme.bar.menus.menu.dashboard.profile.name": "#FFFFFF", - "theme.bar.menus.menu.dashboard.border.color": "#333333", - "theme.bar.menus.menu.dashboard.background.color": "#000000", - "theme.bar.menus.menu.dashboard.card.color": "#1A1A1A", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.hourly.time": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ffffff", - "theme.bar.menus.menu.clock.weather.stats": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.status": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.temperature": "#CCCCCC", - "theme.bar.menus.menu.clock.weather.icon": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.contextdays": "#333333", - "theme.bar.menus.menu.clock.calendar.days": "#CCCCCC", - "theme.bar.menus.menu.clock.calendar.currentday": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.paginator": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.weekdays": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#ffffff", - "theme.bar.menus.menu.clock.time.timeperiod": "#ffffff", - "theme.bar.menus.menu.clock.time.time": "#FFFFFF", - "theme.bar.menus.menu.clock.text": "#CCCCCC", - "theme.bar.menus.menu.clock.border.color": "#333333", - "theme.bar.menus.menu.clock.background.color": "#000000", - "theme.bar.menus.menu.clock.card.color": "#1A1A1A", - "theme.bar.menus.menu.battery.slider.puck": "#5e5c64", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#5e5c64", - "theme.bar.menus.menu.battery.slider.background": "#5e5c64", - "theme.bar.menus.menu.battery.slider.primary": "#cccccc", - "theme.bar.menus.menu.battery.icons.active": "#ffffff", - "theme.bar.menus.menu.battery.icons.passive": "#9a9996", - "theme.bar.menus.menu.battery.listitems.active": "#ffffff", - "theme.bar.menus.menu.battery.listitems.passive": "#9a9996", - "theme.bar.menus.menu.battery.text": "#CCCCCC", - "theme.bar.menus.menu.battery.label.color": "#ffffff", - "theme.bar.menus.menu.battery.border.color": "#333333", - "theme.bar.menus.menu.battery.background.color": "#000000", - "theme.bar.menus.menu.battery.card.color": "#111111", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#CCCCCC", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#000000", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#ffffff", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#9a9996", - "theme.bar.menus.menu.bluetooth.icons.active": "#ffffff", - "theme.bar.menus.menu.bluetooth.icons.passive": "#77767b", - "theme.bar.menus.menu.bluetooth.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#77767b", - "theme.bar.menus.menu.bluetooth.switch.puck": "#9a9996", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#444444", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.switch_divider": "#444444", - "theme.bar.menus.menu.bluetooth.status": "#CCCCCC", - "theme.bar.menus.menu.bluetooth.text": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.label.color": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.border.color": "#444444", - "theme.bar.menus.menu.bluetooth.background.color": "#000000", - "theme.bar.menus.menu.bluetooth.card.color": "#111111", - "theme.bar.menus.menu.network.iconbuttons.active": "#FFFFFF", - "theme.bar.menus.menu.network.iconbuttons.passive": "#77767b", - "theme.bar.menus.menu.network.icons.active": "#FFFFFF", - "theme.bar.menus.menu.network.icons.passive": "#77767b", - "theme.bar.menus.menu.network.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.network.listitems.passive": "#77767b", - "theme.bar.menus.menu.network.status.color": "#CCCCCC", - "theme.bar.menus.menu.network.text": "#FFFFFF", - "theme.bar.menus.menu.network.label.color": "#FFFFFF", - "theme.bar.menus.menu.network.border.color": "#444444", - "theme.bar.menus.menu.network.background.color": "#000000", - "theme.bar.menus.menu.network.card.color": "#111111", - "theme.bar.menus.menu.volume.input_slider.puck": "#CCCCCC", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#444444", - "theme.bar.menus.menu.volume.input_slider.background": "#77767b", - "theme.bar.menus.menu.volume.input_slider.primary": "#FFFFFF", - "theme.bar.menus.menu.volume.audio_slider.puck": "#CCCCCC", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#444444", - "theme.bar.menus.menu.volume.audio_slider.background": "#77767b", - "theme.bar.menus.menu.volume.audio_slider.primary": "#FFFFFF", - "theme.bar.menus.menu.volume.icons.active": "#FFFFFF", - "theme.bar.menus.menu.volume.icons.passive": "#77767b", - "theme.bar.menus.menu.volume.iconbutton.active": "#FFFFFF", - "theme.bar.menus.menu.volume.iconbutton.passive": "#77767b", - "theme.bar.menus.menu.volume.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.volume.listitems.passive": "#77767b", - "theme.bar.menus.menu.volume.border.color": "#444444", - "theme.bar.menus.menu.volume.background.color": "#000000", - "theme.bar.menus.menu.media.slider.puck": "#CCCCCC", - "theme.bar.menus.menu.media.slider.backgroundhover": "#444444", - "theme.bar.menus.menu.media.slider.background": "#77767b", - "theme.bar.menus.menu.media.slider.primary": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.text": "#000000", - "theme.bar.menus.menu.media.buttons.background": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.enabled": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.inactive": "#5e5c64", - "theme.bar.menus.menu.media.border.color": "#444444", - "theme.bar.menus.menu.media.background.color": "#000000", - "theme.bar.menus.menu.media.album": "#FFFFFF", - "theme.bar.menus.menu.media.artist": "#FFFFFF", - "theme.bar.menus.menu.media.song": "#FFFFFF", - "theme.bar.menus.tooltip.text": "#FFFFFF", - "theme.bar.menus.tooltip.background": "#000000", - "theme.bar.menus.dropdownmenu.divider": "#111111", - "theme.bar.menus.dropdownmenu.text": "#FFFFFF", - "theme.bar.menus.dropdownmenu.background": "#000000", - "theme.bar.menus.slider.puck": "#CCCCCC", - "theme.bar.menus.slider.backgroundhover": "#444444", - "theme.bar.menus.slider.background": "#CCCCCC", - "theme.bar.menus.slider.primary": "#FFFFFF", - "theme.bar.menus.progressbar.background": "#444444", - "theme.bar.menus.progressbar.foreground": "#FFFFFF", - "theme.bar.menus.iconbuttons.active": "#FFFFFF", - "theme.bar.menus.iconbuttons.passive": "#FFFFFF", - "theme.bar.menus.buttons.text": "#000000", - "theme.bar.menus.buttons.disabled": "#CCCCCC", - "theme.bar.menus.buttons.active": "#FFFFFF", - "theme.bar.menus.buttons.default": "#FFFFFF", - "theme.bar.menus.switch.puck": "#CCCCCC", - "theme.bar.menus.switch.disabled": "#444444", - "theme.bar.menus.switch.enabled": "#FFFFFF", - "theme.bar.menus.icons.active": "#FFFFFF", - "theme.bar.menus.icons.passive": "#CCCCCC", - "theme.bar.menus.listitems.active": "#FFFFFF", - "theme.bar.menus.listitems.passive": "#FFFFFF", - "theme.bar.menus.label": "#FFFFFF", - "theme.bar.menus.feinttext": "#444444", - "theme.bar.menus.dimtext": "#CCCCCC", - "theme.bar.menus.cards": "#111111", - "theme.bar.buttons.notifications.total": "#FFFFFF", - "theme.bar.buttons.notifications.icon": "#FFFFFF", - "theme.bar.buttons.notifications.background": "#090909", - "theme.bar.buttons.clock.icon": "#FFFFFF", - "theme.bar.buttons.clock.text": "#FFFFFF", - "theme.bar.buttons.clock.background": "#090909", - "theme.bar.buttons.battery.icon": "#FFFFFF", - "theme.bar.buttons.battery.text": "#FFFFFF", - "theme.bar.buttons.battery.background": "#090909", - "theme.bar.buttons.systray.background": "#090909", - "theme.bar.buttons.bluetooth.icon": "#FFFFFF", - "theme.bar.buttons.bluetooth.text": "#FFFFFF", - "theme.bar.buttons.bluetooth.background": "#090909", - "theme.bar.buttons.network.icon": "#FFFFFF", - "theme.bar.buttons.network.text": "#FFFFFF", - "theme.bar.buttons.network.background": "#090909", - "theme.bar.buttons.volume.icon": "#FFFFFF", - "theme.bar.buttons.volume.text": "#FFFFFF", - "theme.bar.buttons.volume.background": "#090909", - "theme.bar.buttons.windowtitle.icon": "#FFFFFF", - "theme.bar.buttons.windowtitle.text": "#FFFFFF", - "theme.bar.buttons.windowtitle.background": "#090909", - "theme.bar.buttons.workspaces.active": "#FFFFFF", - "theme.bar.buttons.workspaces.occupied": "#FFFFFF", - "theme.bar.buttons.workspaces.available": "#FFFFFF", - "theme.bar.buttons.workspaces.hover": "#444444", - "theme.bar.buttons.workspaces.background": "#090909", - "theme.bar.buttons.dashboard.icon": "#FFFFFF", - "theme.bar.buttons.dashboard.background": "#090909", - "theme.osd.label": "#FFFFFF", - "theme.osd.icon": "#000000", - "theme.osd.bar_overflow_color": "#FFFFFF", - "theme.osd.bar_empty_color": "#444444", - "theme.osd.bar_color": "#FFFFFF", - "theme.osd.icon_container": "#FFFFFF", - "theme.osd.bar_container": "#000000", - "theme.notification.close_button.label": "#000000", - "theme.notification.close_button.background": "#FFFFFF", - "theme.notification.labelicon": "#FFFFFF", - "theme.notification.text": "#FFFFFF", - "theme.notification.time": "#CCCCCC", - "theme.notification.border": "#444444", - "theme.notification.label": "#FFFFFF", - "theme.notification.actions.text": "#000000", - "theme.notification.actions.background": "#FFFFFF", - "theme.notification.background": "#1a1a1a", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#1A1A1A", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#FFFFFF", - "theme.bar.menus.menu.notifications.scrollbar.color": "#FFFFFF", - "theme.bar.menus.menu.notifications.pager.label": "#9a9996", - "theme.bar.menus.menu.notifications.pager.background": "#000000", - "theme.bar.buttons.clock.icon_background": "#FFFFFF", - "theme.bar.buttons.modules.ram.icon": "#ffffff", - "theme.bar.buttons.modules.storage.icon_background": "#ffffff", - "theme.bar.menus.popover.border": "#000000", - "theme.bar.buttons.volume.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.restart.text": "#ffffff", - "theme.bar.buttons.modules.updates.background": "#090909", - "theme.bar.buttons.modules.storage.icon": "#ffffff", - "theme.bar.buttons.modules.netstat.background": "#090909", - "theme.bar.buttons.modules.weather.icon": "#FFFFFF", - "theme.bar.buttons.modules.netstat.text": "#ffffff", - "theme.bar.buttons.modules.storage.background": "#090909", - "theme.bar.buttons.modules.power.icon": "#ffffff", - "theme.bar.buttons.modules.storage.text": "#ffffff", - "theme.bar.buttons.modules.cpu.background": "#090909", - "theme.bar.menus.menu.power.border.color": "#333333", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.icon": "#000000", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.restart.icon": "#000000", - "theme.bar.buttons.modules.cpu.icon": "#ffffff", - "theme.bar.buttons.battery.icon_background": "#ffffff", - "theme.bar.buttons.modules.kbLayout.icon_background": "#ffffff", - "theme.bar.buttons.modules.weather.text": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#000000", - "theme.bar.menus.menu.power.buttons.sleep.text": "#ffffff", - "theme.bar.buttons.modules.weather.icon_background": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1A1A1A", - "theme.bar.buttons.media.icon_background": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.logout.background": "#1A1A1A", - "theme.bar.buttons.modules.kbLayout.icon": "#ffffff", - "theme.bar.buttons.modules.ram.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#ffffff", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1A1A1A", - "theme.bar.buttons.modules.ram.text": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.text": "#ffffff", - "theme.bar.buttons.modules.updates.icon_background": "#FFFFFF", - "theme.bar.buttons.modules.kbLayout.background": "#090909", - "theme.bar.buttons.modules.power.background": "#090909", - "theme.bar.buttons.modules.weather.background": "#090909", - "theme.bar.buttons.icon_background": "#090909", - "theme.bar.menus.menu.power.background.color": "#000000", - "theme.bar.buttons.modules.ram.background": "#090909", - "theme.bar.buttons.modules.netstat.icon": "#ffffff", - "theme.bar.buttons.windowtitle.icon_background": "#FFFFFF", - "theme.bar.buttons.modules.cpu.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#ffffff", - "theme.bar.buttons.modules.updates.text": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#000000", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#1A1A1A", - "theme.bar.buttons.modules.updates.icon": "#FFFFFF", - "theme.bar.buttons.modules.cpu.text": "#ffffff", - "theme.bar.buttons.modules.netstat.icon_background": "#ffffff", - "theme.bar.buttons.modules.kbLayout.text": "#ffffff", - "theme.bar.buttons.notifications.icon_background": "#FFFFFF", - "theme.bar.buttons.modules.power.border": "#ffffff", - "theme.bar.buttons.modules.weather.border": "#FFFFFF", - "theme.bar.buttons.modules.updates.border": "#FFFFFF", - "theme.bar.buttons.modules.kbLayout.border": "#ffffff", - "theme.bar.buttons.modules.netstat.border": "#ffffff", - "theme.bar.buttons.modules.storage.border": "#ffffff", - "theme.bar.buttons.modules.cpu.border": "#ffffff", - "theme.bar.buttons.modules.ram.border": "#ffffff", - "theme.bar.buttons.notifications.border": "#FFFFFF", - "theme.bar.buttons.clock.border": "#FFFFFF", - "theme.bar.buttons.battery.border": "#FFFFFF", - "theme.bar.buttons.systray.border": "#444444", - "theme.bar.buttons.bluetooth.border": "#FFFFFF", - "theme.bar.buttons.network.border": "#FFFFFF", - "theme.bar.buttons.volume.border": "#FFFFFF", - "theme.bar.buttons.media.border": "#FFFFFF", - "theme.bar.buttons.windowtitle.border": "#FFFFFF", - "theme.bar.buttons.workspaces.border": "#FFFFFF", - "theme.bar.buttons.dashboard.border": "#FFFFFF", - "theme.bar.buttons.modules.submap.background": "#090909", - "theme.bar.buttons.modules.submap.text": "#FFFFFF", - "theme.bar.buttons.modules.submap.border": "#FFFFFF", - "theme.bar.buttons.modules.submap.icon": "#FFFFFF", - "theme.bar.buttons.modules.submap.icon_background": "#090909" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/monochrome_split.json b/ags/HyprPanel/themes/monochrome_split.json deleted file mode 100644 index 111c155..0000000 --- a/ags/HyprPanel/themes/monochrome_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#000000", - "theme.bar.background": "#000000", - "theme.bar.buttons.media.icon": "#090909", - "theme.bar.buttons.media.text": "#FFFFFF", - "theme.bar.buttons.icon": "#FFFFFF", - "theme.bar.buttons.text": "#FFFFFF", - "theme.bar.buttons.hover": "#333333", - "theme.bar.buttons.background": "#1A1A1A", - "theme.bar.menus.text": "#CCCCCC", - "theme.bar.menus.border.color": "#333333", - "theme.bar.buttons.media.background": "#090909", - "theme.bar.menus.menu.volume.text": "#CCCCCC", - "theme.bar.menus.menu.volume.card.color": "#1A1A1A", - "theme.bar.menus.menu.volume.label.color": "#FFFFFF", - "theme.bar.menus.popover.text": "#FFFFFF", - "theme.bar.menus.popover.background": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#CCCCCC", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#333333", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#000000", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.switch.puck": "#333333", - "theme.bar.menus.menu.notifications.switch.disabled": "#333333", - "theme.bar.menus.menu.notifications.switch.enabled": "#FFFFFF", - "theme.bar.menus.menu.notifications.clear": "#ffffff", - "theme.bar.menus.menu.notifications.switch_divider": "#333333", - "theme.bar.menus.menu.notifications.border": "#333333", - "theme.bar.menus.menu.notifications.card": "#1A1A1A", - "theme.bar.menus.menu.notifications.background": "#000000", - "theme.bar.menus.menu.notifications.no_notifications_label": "#333333", - "theme.bar.menus.menu.notifications.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#FFFFFF", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#ffffff", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#333333", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#ffffff", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#ffffff", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.input.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.input.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#ffffff", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#000000", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.controls.disabled": "#333333", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#5CFF5C", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#000000", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#FFFFFF", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#ffffff", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#ffffff", - "theme.bar.menus.menu.dashboard.profile.name": "#FFFFFF", - "theme.bar.menus.menu.dashboard.border.color": "#333333", - "theme.bar.menus.menu.dashboard.background.color": "#000000", - "theme.bar.menus.menu.dashboard.card.color": "#1A1A1A", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.hourly.time": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#ffffff", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#ffffff", - "theme.bar.menus.menu.clock.weather.stats": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.status": "#FFFFFF", - "theme.bar.menus.menu.clock.weather.temperature": "#CCCCCC", - "theme.bar.menus.menu.clock.weather.icon": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.contextdays": "#333333", - "theme.bar.menus.menu.clock.calendar.days": "#CCCCCC", - "theme.bar.menus.menu.clock.calendar.currentday": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.paginator": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.weekdays": "#FFFFFF", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#ffffff", - "theme.bar.menus.menu.clock.time.timeperiod": "#ffffff", - "theme.bar.menus.menu.clock.time.time": "#FFFFFF", - "theme.bar.menus.menu.clock.text": "#CCCCCC", - "theme.bar.menus.menu.clock.border.color": "#333333", - "theme.bar.menus.menu.clock.background.color": "#000000", - "theme.bar.menus.menu.clock.card.color": "#1A1A1A", - "theme.bar.menus.menu.battery.slider.puck": "#5e5c64", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#5e5c64", - "theme.bar.menus.menu.battery.slider.background": "#5e5c64", - "theme.bar.menus.menu.battery.slider.primary": "#cccccc", - "theme.bar.menus.menu.battery.icons.active": "#ffffff", - "theme.bar.menus.menu.battery.icons.passive": "#9a9996", - "theme.bar.menus.menu.battery.listitems.active": "#ffffff", - "theme.bar.menus.menu.battery.listitems.passive": "#9a9996", - "theme.bar.menus.menu.battery.text": "#CCCCCC", - "theme.bar.menus.menu.battery.label.color": "#ffffff", - "theme.bar.menus.menu.battery.border.color": "#333333", - "theme.bar.menus.menu.battery.background.color": "#000000", - "theme.bar.menus.menu.battery.card.color": "#111111", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#1A1A1A", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#CCCCCC", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#000000", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#ffffff", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#9a9996", - "theme.bar.menus.menu.bluetooth.icons.active": "#ffffff", - "theme.bar.menus.menu.bluetooth.icons.passive": "#77767b", - "theme.bar.menus.menu.bluetooth.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#77767b", - "theme.bar.menus.menu.bluetooth.switch.puck": "#9a9996", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#444444", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.switch_divider": "#444444", - "theme.bar.menus.menu.bluetooth.status": "#CCCCCC", - "theme.bar.menus.menu.bluetooth.text": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.label.color": "#FFFFFF", - "theme.bar.menus.menu.bluetooth.border.color": "#444444", - "theme.bar.menus.menu.bluetooth.background.color": "#000000", - "theme.bar.menus.menu.bluetooth.card.color": "#111111", - "theme.bar.menus.menu.network.iconbuttons.active": "#FFFFFF", - "theme.bar.menus.menu.network.iconbuttons.passive": "#77767b", - "theme.bar.menus.menu.network.icons.active": "#FFFFFF", - "theme.bar.menus.menu.network.icons.passive": "#77767b", - "theme.bar.menus.menu.network.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.network.listitems.passive": "#77767b", - "theme.bar.menus.menu.network.status.color": "#CCCCCC", - "theme.bar.menus.menu.network.text": "#FFFFFF", - "theme.bar.menus.menu.network.label.color": "#FFFFFF", - "theme.bar.menus.menu.network.border.color": "#444444", - "theme.bar.menus.menu.network.background.color": "#000000", - "theme.bar.menus.menu.network.card.color": "#111111", - "theme.bar.menus.menu.volume.input_slider.puck": "#CCCCCC", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#444444", - "theme.bar.menus.menu.volume.input_slider.background": "#77767b", - "theme.bar.menus.menu.volume.input_slider.primary": "#FFFFFF", - "theme.bar.menus.menu.volume.audio_slider.puck": "#CCCCCC", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#444444", - "theme.bar.menus.menu.volume.audio_slider.background": "#77767b", - "theme.bar.menus.menu.volume.audio_slider.primary": "#FFFFFF", - "theme.bar.menus.menu.volume.icons.active": "#FFFFFF", - "theme.bar.menus.menu.volume.icons.passive": "#77767b", - "theme.bar.menus.menu.volume.iconbutton.active": "#FFFFFF", - "theme.bar.menus.menu.volume.iconbutton.passive": "#77767b", - "theme.bar.menus.menu.volume.listitems.active": "#FFFFFF", - "theme.bar.menus.menu.volume.listitems.passive": "#77767b", - "theme.bar.menus.menu.volume.border.color": "#444444", - "theme.bar.menus.menu.volume.background.color": "#000000", - "theme.bar.menus.menu.media.slider.puck": "#CCCCCC", - "theme.bar.menus.menu.media.slider.backgroundhover": "#444444", - "theme.bar.menus.menu.media.slider.background": "#77767b", - "theme.bar.menus.menu.media.slider.primary": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.text": "#000000", - "theme.bar.menus.menu.media.buttons.background": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.enabled": "#FFFFFF", - "theme.bar.menus.menu.media.buttons.inactive": "#5e5c64", - "theme.bar.menus.menu.media.border.color": "#444444", - "theme.bar.menus.menu.media.background.color": "#000000", - "theme.bar.menus.menu.media.album": "#FFFFFF", - "theme.bar.menus.menu.media.artist": "#FFFFFF", - "theme.bar.menus.menu.media.song": "#FFFFFF", - "theme.bar.menus.tooltip.text": "#FFFFFF", - "theme.bar.menus.tooltip.background": "#000000", - "theme.bar.menus.dropdownmenu.divider": "#111111", - "theme.bar.menus.dropdownmenu.text": "#FFFFFF", - "theme.bar.menus.dropdownmenu.background": "#000000", - "theme.bar.menus.slider.puck": "#CCCCCC", - "theme.bar.menus.slider.backgroundhover": "#444444", - "theme.bar.menus.slider.background": "#CCCCCC", - "theme.bar.menus.slider.primary": "#FFFFFF", - "theme.bar.menus.progressbar.background": "#444444", - "theme.bar.menus.progressbar.foreground": "#FFFFFF", - "theme.bar.menus.iconbuttons.active": "#FFFFFF", - "theme.bar.menus.iconbuttons.passive": "#FFFFFF", - "theme.bar.menus.buttons.text": "#000000", - "theme.bar.menus.buttons.disabled": "#CCCCCC", - "theme.bar.menus.buttons.active": "#FFFFFF", - "theme.bar.menus.buttons.default": "#FFFFFF", - "theme.bar.menus.switch.puck": "#CCCCCC", - "theme.bar.menus.switch.disabled": "#444444", - "theme.bar.menus.switch.enabled": "#FFFFFF", - "theme.bar.menus.icons.active": "#FFFFFF", - "theme.bar.menus.icons.passive": "#CCCCCC", - "theme.bar.menus.listitems.active": "#ffffff", - "theme.bar.menus.listitems.passive": "#FFFFFF", - "theme.bar.menus.label": "#FFFFFF", - "theme.bar.menus.feinttext": "#444444", - "theme.bar.menus.dimtext": "#CCCCCC", - "theme.bar.menus.cards": "#111111", - "theme.bar.buttons.notifications.total": "#FFFFFF", - "theme.bar.buttons.notifications.icon": "#090909", - "theme.bar.buttons.notifications.background": "#090909", - "theme.bar.buttons.clock.icon": "#000000", - "theme.bar.buttons.clock.text": "#FFFFFF", - "theme.bar.buttons.clock.background": "#090909", - "theme.bar.buttons.battery.icon": "#090909", - "theme.bar.buttons.battery.text": "#FFFFFF", - "theme.bar.buttons.battery.background": "#090909", - "theme.bar.buttons.systray.background": "#090909", - "theme.bar.buttons.bluetooth.icon": "#090909", - "theme.bar.buttons.bluetooth.text": "#FFFFFF", - "theme.bar.buttons.bluetooth.background": "#090909", - "theme.bar.buttons.network.icon": "#090909", - "theme.bar.buttons.network.text": "#FFFFFF", - "theme.bar.buttons.network.background": "#090909", - "theme.bar.buttons.volume.icon": "#090909", - "theme.bar.buttons.volume.text": "#FFFFFF", - "theme.bar.buttons.volume.background": "#090909", - "theme.bar.buttons.windowtitle.icon": "#090909", - "theme.bar.buttons.windowtitle.text": "#FFFFFF", - "theme.bar.buttons.windowtitle.background": "#090909", - "theme.bar.buttons.workspaces.active": "#FFFFFF", - "theme.bar.buttons.workspaces.occupied": "#FFFFFF", - "theme.bar.buttons.workspaces.available": "#FFFFFF", - "theme.bar.buttons.workspaces.hover": "#444444", - "theme.bar.buttons.workspaces.background": "#090909", - "theme.bar.buttons.dashboard.icon": "#000000", - "theme.bar.buttons.dashboard.background": "#ffffff", - "theme.osd.label": "#FFFFFF", - "theme.osd.icon": "#000000", - "theme.osd.bar_overflow_color": "#FFFFFF", - "theme.osd.bar_empty_color": "#444444", - "theme.osd.bar_color": "#FFFFFF", - "theme.osd.icon_container": "#FFFFFF", - "theme.osd.bar_container": "#000000", - "theme.notification.close_button.label": "#000000", - "theme.notification.close_button.background": "#FFFFFF", - "theme.notification.labelicon": "#FFFFFF", - "theme.notification.text": "#FFFFFF", - "theme.notification.time": "#CCCCCC", - "theme.notification.border": "#444444", - "theme.notification.label": "#FFFFFF", - "theme.notification.actions.text": "#000000", - "theme.notification.actions.background": "#FFFFFF", - "theme.notification.background": "#1a1a1a", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#1A1A1A", - "theme.bar.menus.check_radio_button.background": "#000000", - "theme.bar.menus.check_radio_button.active": "#ffffff", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#ffffff", - "theme.bar.buttons.network.icon_background": "#ffffff", - "theme.bar.buttons.bluetooth.icon_background": "#ffffff", - "theme.bar.buttons.windowtitle.icon_background": "#ffffff", - "theme.bar.buttons.media.icon_background": "#ffffff", - "theme.bar.buttons.notifications.icon_background": "#ffffff", - "theme.bar.buttons.battery.icon_background": "#ffffff", - "theme.bar.buttons.clock.icon_background": "#ffffff", - "theme.bar.menus.menu.notifications.pager.button": "#FFFFFF", - "theme.bar.menus.menu.notifications.scrollbar.color": "#FFFFFF", - "theme.bar.menus.menu.notifications.pager.label": "#9a9996", - "theme.bar.menus.menu.notifications.pager.background": "#000000", - "theme.bar.buttons.modules.ram.icon": "#21252b", - "theme.bar.buttons.modules.storage.icon_background": "#ffffff", - "theme.bar.menus.popover.border": "#000000", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.restart.text": "#ffffff", - "theme.bar.buttons.modules.updates.background": "#090909", - "theme.bar.buttons.modules.storage.icon": "#21252b", - "theme.bar.buttons.modules.netstat.background": "#090909", - "theme.bar.buttons.modules.weather.icon": "#090909", - "theme.bar.buttons.modules.netstat.text": "#ffffff", - "theme.bar.buttons.modules.storage.background": "#090909", - "theme.bar.buttons.modules.power.icon": "#21252b", - "theme.bar.buttons.modules.storage.text": "#ffffff", - "theme.bar.buttons.modules.cpu.background": "#090909", - "theme.bar.menus.menu.power.border.color": "#333333", - "theme.bar.buttons.modules.power.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.icon": "#000000", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.restart.icon": "#000000", - "theme.bar.buttons.modules.cpu.icon": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon_background": "#ffffff", - "theme.bar.buttons.modules.weather.text": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#000000", - "theme.bar.menus.menu.power.buttons.sleep.text": "#ffffff", - "theme.bar.buttons.modules.weather.icon_background": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#1A1A1A", - "theme.bar.menus.menu.power.buttons.logout.background": "#1A1A1A", - "theme.bar.buttons.modules.kbLayout.icon": "#21252b", - "theme.bar.buttons.modules.ram.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#ffffff", - "theme.bar.menus.menu.power.buttons.sleep.background": "#1A1A1A", - "theme.bar.buttons.modules.ram.text": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.text": "#ffffff", - "theme.bar.buttons.modules.updates.icon_background": "#FFFFFF", - "theme.bar.buttons.modules.kbLayout.background": "#090909", - "theme.bar.buttons.modules.power.background": "#090909", - "theme.bar.buttons.modules.weather.background": "#090909", - "theme.bar.menus.menu.power.background.color": "#000000", - "theme.bar.buttons.modules.ram.background": "#090909", - "theme.bar.buttons.modules.netstat.icon": "#21252b", - "theme.bar.buttons.modules.cpu.icon_background": "#ffffff", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#ffffff", - "theme.bar.buttons.modules.updates.text": "#FFFFFF", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#000000", - "theme.bar.menus.menu.power.buttons.restart.background": "#1A1A1A", - "theme.bar.buttons.modules.updates.icon": "#21252b", - "theme.bar.buttons.modules.cpu.text": "#ffffff", - "theme.bar.buttons.modules.netstat.icon_background": "#ffffff", - "theme.bar.buttons.modules.kbLayout.text": "#ffffff", - "theme.bar.buttons.modules.power.border": "#ffffff", - "theme.bar.buttons.modules.weather.border": "#FFFFFF", - "theme.bar.buttons.modules.updates.border": "#FFFFFF", - "theme.bar.buttons.modules.kbLayout.border": "#ffffff", - "theme.bar.buttons.modules.netstat.border": "#ffffff", - "theme.bar.buttons.modules.storage.border": "#ffffff", - "theme.bar.buttons.modules.cpu.border": "#ffffff", - "theme.bar.buttons.modules.ram.border": "#ffffff", - "theme.bar.buttons.notifications.border": "#FFFFFF", - "theme.bar.buttons.clock.border": "#FFFFFF", - "theme.bar.buttons.battery.border": "#FFFFFF", - "theme.bar.buttons.systray.border": "#444444", - "theme.bar.buttons.bluetooth.border": "#FFFFFF", - "theme.bar.buttons.network.border": "#FFFFFF", - "theme.bar.buttons.volume.border": "#FFFFFF", - "theme.bar.buttons.media.border": "#FFFFFF", - "theme.bar.buttons.windowtitle.border": "#FFFFFF", - "theme.bar.buttons.workspaces.border": "#FFFFFF", - "theme.bar.buttons.dashboard.border": "#FFFFFF", - "theme.bar.buttons.modules.submap.background": "#090909", - "theme.bar.buttons.modules.submap.text": "#FFFFFF", - "theme.bar.buttons.modules.submap.border": "#FFFFFF", - "theme.bar.buttons.modules.submap.icon": "#21252b", - "theme.bar.buttons.modules.submap.icon_background": "#FFFFFF" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/nord.json b/ags/HyprPanel/themes/nord.json deleted file mode 100644 index 3f9159b..0000000 --- a/ags/HyprPanel/themes/nord.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#2e3440", - "theme.bar.background": "#2e3440", - "theme.bar.buttons.media.icon": "#88c0d0", - "theme.bar.buttons.media.text": "#88c0d0", - "theme.bar.buttons.icon": "#88c0d0", - "theme.bar.buttons.text": "#88c0d0", - "theme.bar.buttons.hover": "#434c53", - "theme.bar.buttons.background": "#3b4252", - "theme.bar.menus.text": "#d8dee9", - "theme.bar.menus.border.color": "#434c53", - "theme.bar.buttons.media.background": "#3b4252", - "theme.bar.menus.menu.volume.text": "#d8dee9", - "theme.bar.menus.menu.volume.card.color": "#3b4252", - "theme.bar.menus.menu.volume.label.color": "#81a1c1", - "theme.bar.menus.popover.text": "#88c0d0", - "theme.bar.menus.popover.background": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#d8dee9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#434c53", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#3b4252", - "theme.bar.menus.menu.notifications.switch.puck": "#434c53", - "theme.bar.menus.menu.notifications.switch.disabled": "#434c53", - "theme.bar.menus.menu.notifications.switch.enabled": "#88c0d0", - "theme.bar.menus.menu.notifications.clear": "#8fbcbb", - "theme.bar.menus.menu.notifications.switch_divider": "#434c53", - "theme.bar.menus.menu.notifications.border": "#434c53", - "theme.bar.menus.menu.notifications.card": "#3b4252", - "theme.bar.menus.menu.notifications.background": "#2e3440", - "theme.bar.menus.menu.notifications.no_notifications_label": "#434c53", - "theme.bar.menus.menu.notifications.label": "#88c0d0", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#434c53", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#88c0d0", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#88c0d0", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8fbcbb", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#81a1c1", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#81a1c1", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#8fbcbb", - "theme.bar.menus.menu.dashboard.controls.input.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.input.background": "#8fbcbb", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#81a1c1", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#81a1c1", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.controls.disabled": "#434c53", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#8fbcbb", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#2e3440", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#81a1c1", - "theme.bar.menus.menu.dashboard.profile.name": "#8fbcbb", - "theme.bar.menus.menu.dashboard.border.color": "#434c53", - "theme.bar.menus.menu.dashboard.background.color": "#2e3440", - "theme.bar.menus.menu.dashboard.card.color": "#3b4252", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.hourly.time": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#81a1c1", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.stats": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.status": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.temperature": "#d8dee9", - "theme.bar.menus.menu.clock.weather.icon": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.contextdays": "#434c53", - "theme.bar.menus.menu.clock.calendar.days": "#d8dee9", - "theme.bar.menus.menu.clock.calendar.currentday": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.paginator": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.weekdays": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8fbcbb", - "theme.bar.menus.menu.clock.time.timeperiod": "#8fbcbb", - "theme.bar.menus.menu.clock.time.time": "#8fbcbb", - "theme.bar.menus.menu.clock.text": "#d8dee9", - "theme.bar.menus.menu.clock.border.color": "#434c53", - "theme.bar.menus.menu.clock.background.color": "#2e3440", - "theme.bar.menus.menu.clock.card.color": "#3b4252", - "theme.bar.menus.menu.battery.slider.puck": "#4c566a", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.battery.slider.background": "#434c53", - "theme.bar.menus.menu.battery.slider.primary": "#81a1c1", - "theme.bar.menus.menu.battery.icons.active": "#81a1c1", - "theme.bar.menus.menu.battery.icons.passive": "#5e81ac", - "theme.bar.menus.menu.battery.listitems.active": "#81a1c1", - "theme.bar.menus.menu.battery.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.battery.text": "#d8dee9", - "theme.bar.menus.menu.battery.label.color": "#81a1c1", - "theme.bar.menus.menu.battery.border.color": "#434c53", - "theme.bar.menus.menu.battery.background.color": "#2e3440", - "theme.bar.menus.menu.battery.card.color": "#3b4252", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#3b4252", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#d8dee9", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#2e3440", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#d8dee9", - "theme.bar.menus.menu.bluetooth.icons.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.icons.passive": "#5e81ac", - "theme.bar.menus.menu.bluetooth.listitems.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.bluetooth.switch.puck": "#434c53", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#434c53", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#88c0d0", - "theme.bar.menus.menu.bluetooth.switch_divider": "#434c53", - "theme.bar.menus.menu.bluetooth.status": "#4c566a", - "theme.bar.menus.menu.bluetooth.text": "#d8dee9", - "theme.bar.menus.menu.bluetooth.label.color": "#88c0d0", - "theme.bar.menus.menu.bluetooth.border.color": "#434c53", - "theme.bar.menus.menu.bluetooth.background.color": "#2e3440", - "theme.bar.menus.menu.bluetooth.card.color": "#3b4252", - "theme.bar.menus.menu.network.iconbuttons.active": "#88c0d0", - "theme.bar.menus.menu.network.iconbuttons.passive": "#d8dee9", - "theme.bar.menus.menu.network.icons.active": "#88c0d0", - "theme.bar.menus.menu.network.icons.passive": "#5e81ac", - "theme.bar.menus.menu.network.listitems.active": "#88c0d0", - "theme.bar.menus.menu.network.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.network.status.color": "#4c566a", - "theme.bar.menus.menu.network.text": "#d8dee9", - "theme.bar.menus.menu.network.label.color": "#88c0d0", - "theme.bar.menus.menu.network.border.color": "#434c53", - "theme.bar.menus.menu.network.background.color": "#2e3440", - "theme.bar.menus.menu.network.card.color": "#3b4252", - "theme.bar.menus.menu.volume.input_slider.puck": "#434c53", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.volume.input_slider.background": "#434c53", - "theme.bar.menus.menu.volume.input_slider.primary": "#81a1c1", - "theme.bar.menus.menu.volume.audio_slider.puck": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.background": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.primary": "#81a1c1", - "theme.bar.menus.menu.volume.icons.active": "#81a1c1", - "theme.bar.menus.menu.volume.icons.passive": "#5e81ac", - "theme.bar.menus.menu.volume.iconbutton.active": "#81a1c1", - "theme.bar.menus.menu.volume.iconbutton.passive": "#d8dee9", - "theme.bar.menus.menu.volume.listitems.active": "#81a1c1", - "theme.bar.menus.menu.volume.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.volume.border.color": "#434c53", - "theme.bar.menus.menu.volume.background.color": "#2e3440", - "theme.bar.menus.menu.media.slider.puck": "#4c566a", - "theme.bar.menus.menu.media.slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.media.slider.background": "#434c53", - "theme.bar.menus.menu.media.slider.primary": "#8fbcbb", - "theme.bar.menus.menu.media.buttons.text": "#2e3440", - "theme.bar.menus.menu.media.buttons.background": "#88c0d0", - "theme.bar.menus.menu.media.buttons.enabled": "#8fbcbb", - "theme.bar.menus.menu.media.buttons.inactive": "#434c53", - "theme.bar.menus.menu.media.border.color": "#434c53", - "theme.bar.menus.menu.media.background.color": "#2e3440", - "theme.bar.menus.menu.media.album": "#8fbcbb", - "theme.bar.menus.menu.media.artist": "#8fbcbb", - "theme.bar.menus.menu.media.song": "#88c0d0", - "theme.bar.menus.tooltip.text": "#d8dee9", - "theme.bar.menus.tooltip.background": "#2e3440", - "theme.bar.menus.dropdownmenu.divider": "#3b4252", - "theme.bar.menus.dropdownmenu.text": "#d8dee9", - "theme.bar.menus.dropdownmenu.background": "#2e3440", - "theme.bar.menus.slider.puck": "#4c566a", - "theme.bar.menus.slider.backgroundhover": "#434c53", - "theme.bar.menus.slider.background": "#434c53", - "theme.bar.menus.slider.primary": "#88c0d0", - "theme.bar.menus.progressbar.background": "#434c53", - "theme.bar.menus.progressbar.foreground": "#88c0d0", - "theme.bar.menus.iconbuttons.active": "#88c0d0", - "theme.bar.menus.iconbuttons.passive": "#d8dee9", - "theme.bar.menus.buttons.text": "#2e3440", - "theme.bar.menus.buttons.disabled": "#434c53", - "theme.bar.menus.buttons.active": "#8fbcbb", - "theme.bar.menus.buttons.default": "#88c0d0", - "theme.bar.menus.switch.puck": "#434c53", - "theme.bar.menus.switch.disabled": "#434c53", - "theme.bar.menus.switch.enabled": "#88c0d0", - "theme.bar.menus.icons.active": "#88c0d0", - "theme.bar.menus.icons.passive": "#434c53", - "theme.bar.menus.listitems.active": "#88c0d0", - "theme.bar.menus.listitems.passive": "#d8dee9", - "theme.bar.menus.label": "#88c0d0", - "theme.bar.menus.feinttext": "#434c53", - "theme.bar.menus.dimtext": "#6272a4", - "theme.bar.menus.cards": "#3b4252", - "theme.bar.buttons.notifications.total": "#88c0d0", - "theme.bar.buttons.notifications.icon": "#88c0d0", - "theme.bar.buttons.notifications.background": "#3b4252", - "theme.bar.buttons.clock.icon": "#8fbcbb", - "theme.bar.buttons.clock.text": "#8fbcbb", - "theme.bar.buttons.clock.background": "#3b4252", - "theme.bar.buttons.battery.icon": "#81a1c1", - "theme.bar.buttons.battery.text": "#81a1c1", - "theme.bar.buttons.battery.background": "#3b4252", - "theme.bar.buttons.systray.background": "#3b4252", - "theme.bar.buttons.bluetooth.icon": "#88c0d0", - "theme.bar.buttons.bluetooth.text": "#88c0d0", - "theme.bar.buttons.bluetooth.background": "#3b4252", - "theme.bar.buttons.network.icon": "#88c0d0", - "theme.bar.buttons.network.text": "#88c0d0", - "theme.bar.buttons.network.background": "#3b4252", - "theme.bar.buttons.volume.icon": "#81a1c1", - "theme.bar.buttons.volume.text": "#81a1c1", - "theme.bar.buttons.volume.background": "#3b4252", - "theme.bar.buttons.windowtitle.icon": "#8fbcbb", - "theme.bar.buttons.windowtitle.text": "#8fbcbb", - "theme.bar.buttons.windowtitle.background": "#3b4252", - "theme.bar.buttons.workspaces.active": "#8fbcbb", - "theme.bar.buttons.workspaces.occupied": "#81a1c1", - "theme.bar.buttons.workspaces.available": "#88c0d0", - "theme.bar.buttons.workspaces.hover": "#434c53", - "theme.bar.buttons.workspaces.background": "#3b4252", - "theme.bar.buttons.dashboard.icon": "#81a1c1", - "theme.bar.buttons.dashboard.background": "#3b4252", - "theme.osd.label": "#88c0d0", - "theme.osd.icon": "#2e3440", - "theme.osd.bar_overflow_color": "#8fbcbb", - "theme.osd.bar_empty_color": "#434c53", - "theme.osd.bar_color": "#88c0d0", - "theme.osd.icon_container": "#88c0d0", - "theme.osd.bar_container": "#2e3440", - "theme.notification.close_button.label": "#2e3440", - "theme.notification.close_button.background": "#8fbcbb", - "theme.notification.labelicon": "#88c0d0", - "theme.notification.text": "#d8dee9", - "theme.notification.time": "#4c566a", - "theme.notification.border": "#434c53", - "theme.notification.label": "#88c0d0", - "theme.notification.actions.text": "#2e3440", - "theme.notification.actions.background": "#88c0d0", - "theme.notification.background": "#2e3440", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#3b4252", - "theme.bar.menus.check_radio_button.background": "#2e3440", - "theme.bar.menus.check_radio_button.active": "#88c0d0", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#88c0d0", - "theme.bar.menus.menu.notifications.scrollbar.color": "#88c0d0", - "theme.bar.menus.menu.notifications.pager.label": "#5e81ac", - "theme.bar.menus.menu.notifications.pager.background": "#2e3440", - "theme.bar.buttons.clock.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.ram.icon": "#81a1c1", - "theme.bar.buttons.modules.storage.icon_background": "#8fbcbb", - "theme.bar.menus.popover.border": "#2e3440", - "theme.bar.buttons.volume.icon_background": "#81a1c1", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#88c0d0", - "theme.bar.menus.menu.power.buttons.restart.text": "#81a1c1", - "theme.bar.buttons.modules.updates.background": "#3b4252", - "theme.bar.buttons.modules.storage.icon": "#8fbcbb", - "theme.bar.buttons.modules.netstat.background": "#3b4252", - "theme.bar.buttons.modules.weather.icon": "#88c0d0", - "theme.bar.buttons.modules.netstat.text": "#8fbcbb", - "theme.bar.buttons.modules.storage.background": "#3b4252", - "theme.bar.buttons.modules.power.icon": "#8fbcbb", - "theme.bar.buttons.modules.storage.text": "#8fbcbb", - "theme.bar.buttons.modules.cpu.background": "#3b4252", - "theme.bar.menus.menu.power.border.color": "#434c53", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.logout.icon": "#2e3440", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#81a1c1", - "theme.bar.menus.menu.power.buttons.restart.icon": "#2e3440", - "theme.bar.buttons.modules.cpu.icon": "#8fbcbb", - "theme.bar.buttons.battery.icon_background": "#81a1c1", - "theme.bar.buttons.modules.kbLayout.icon_background": "#88c0d0", - "theme.bar.buttons.modules.weather.text": "#88c0d0", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#2e3440", - "theme.bar.menus.menu.power.buttons.sleep.text": "#88c0d0", - "theme.bar.buttons.modules.weather.icon_background": "#88c0d0", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#3b4252", - "theme.bar.buttons.media.icon_background": "#88c0d0", - "theme.bar.menus.menu.power.buttons.logout.background": "#3b4252", - "theme.bar.buttons.modules.kbLayout.icon": "#88c0d0", - "theme.bar.buttons.modules.ram.icon_background": "#81a1c1", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.sleep.background": "#3b4252", - "theme.bar.buttons.modules.ram.text": "#81a1c1", - "theme.bar.menus.menu.power.buttons.logout.text": "#8fbcbb", - "theme.bar.buttons.modules.updates.icon_background": "#88c0d0", - "theme.bar.buttons.modules.kbLayout.background": "#3b4252", - "theme.bar.buttons.modules.power.background": "#3b4252", - "theme.bar.buttons.modules.weather.background": "#3b4252", - "theme.bar.buttons.icon_background": "#3b4252", - "theme.bar.menus.menu.power.background.color": "#2e3440", - "theme.bar.buttons.modules.ram.background": "#3b4252", - "theme.bar.buttons.modules.netstat.icon": "#8fbcbb", - "theme.bar.buttons.windowtitle.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.cpu.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.updates.text": "#88c0d0", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#2e3440", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#3b4252", - "theme.bar.buttons.modules.updates.icon": "#88c0d0", - "theme.bar.buttons.modules.cpu.text": "#8fbcbb", - "theme.bar.buttons.modules.netstat.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.kbLayout.text": "#88c0d0", - "theme.bar.buttons.notifications.icon_background": "#88c0d0", - "theme.bar.buttons.modules.power.border": "#8fbcbb", - "theme.bar.buttons.modules.weather.border": "#88c0d0", - "theme.bar.buttons.modules.updates.border": "#88c0d0", - "theme.bar.buttons.modules.kbLayout.border": "#88c0d0", - "theme.bar.buttons.modules.netstat.border": "#8fbcbb", - "theme.bar.buttons.modules.storage.border": "#8fbcbb", - "theme.bar.buttons.modules.cpu.border": "#8fbcbb", - "theme.bar.buttons.modules.ram.border": "#81a1c1", - "theme.bar.buttons.notifications.border": "#88c0d0", - "theme.bar.buttons.clock.border": "#8fbcbb", - "theme.bar.buttons.battery.border": "#81a1c1", - "theme.bar.buttons.systray.border": "#434c53", - "theme.bar.buttons.bluetooth.border": "#88c0d0", - "theme.bar.buttons.network.border": "#88c0d0", - "theme.bar.buttons.volume.border": "#81a1c1", - "theme.bar.buttons.media.border": "#88c0d0", - "theme.bar.buttons.windowtitle.border": "#8fbcbb", - "theme.bar.buttons.workspaces.border": "#2e3440", - "theme.bar.buttons.dashboard.border": "#81a1c1", - "theme.bar.buttons.modules.submap.background": "#3b4252", - "theme.bar.buttons.modules.submap.text": "#8fbcbb", - "theme.bar.buttons.modules.submap.border": "#8fbcbb", - "theme.bar.buttons.modules.submap.icon": "#8fbcbb", - "theme.bar.buttons.modules.submap.icon_background": "#3b4252" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/nord_split.json b/ags/HyprPanel/themes/nord_split.json deleted file mode 100644 index 9541e84..0000000 --- a/ags/HyprPanel/themes/nord_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#2e3440", - "theme.bar.background": "#2e3440", - "theme.bar.buttons.media.icon": "#3b4252", - "theme.bar.buttons.media.text": "#88c0d0", - "theme.bar.buttons.icon": "#88c0d0", - "theme.bar.buttons.text": "#88c0d0", - "theme.bar.buttons.hover": "#434c53", - "theme.bar.buttons.background": "#3b4252", - "theme.bar.menus.text": "#d8dee9", - "theme.bar.menus.border.color": "#434c53", - "theme.bar.buttons.media.background": "#3b4252", - "theme.bar.menus.menu.volume.text": "#d8dee9", - "theme.bar.menus.menu.volume.card.color": "#3b4252", - "theme.bar.menus.menu.volume.label.color": "#81a1c1", - "theme.bar.menus.popover.text": "#88c0d0", - "theme.bar.menus.popover.background": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#d8dee9", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#434c53", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#2e3440", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#3b4252", - "theme.bar.menus.menu.notifications.switch.puck": "#434c53", - "theme.bar.menus.menu.notifications.switch.disabled": "#434c53", - "theme.bar.menus.menu.notifications.switch.enabled": "#88c0d0", - "theme.bar.menus.menu.notifications.clear": "#8fbcbb", - "theme.bar.menus.menu.notifications.switch_divider": "#434c53", - "theme.bar.menus.menu.notifications.border": "#434c53", - "theme.bar.menus.menu.notifications.card": "#3b4252", - "theme.bar.menus.menu.notifications.background": "#2e3440", - "theme.bar.menus.menu.notifications.no_notifications_label": "#434c53", - "theme.bar.menus.menu.notifications.label": "#88c0d0", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#8fbcbb", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#81a1c1", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#434c53", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#88c0d0", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#88c0d0", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#8fbcbb", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#81a1c1", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#81a1c1", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#8fbcbb", - "theme.bar.menus.menu.dashboard.controls.input.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.input.background": "#8fbcbb", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#81a1c1", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#81a1c1", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#2e3440", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.controls.disabled": "#434c53", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#8fbcbb", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#2e3440", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#88c0d0", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#8fbcbb", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#81a1c1", - "theme.bar.menus.menu.dashboard.profile.name": "#8fbcbb", - "theme.bar.menus.menu.dashboard.border.color": "#434c53", - "theme.bar.menus.menu.dashboard.background.color": "#2e3440", - "theme.bar.menus.menu.dashboard.card.color": "#3b4252", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.hourly.time": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#88c0d0", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#81a1c1", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.stats": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.status": "#8fbcbb", - "theme.bar.menus.menu.clock.weather.temperature": "#d8dee9", - "theme.bar.menus.menu.clock.weather.icon": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.contextdays": "#434c53", - "theme.bar.menus.menu.clock.calendar.days": "#d8dee9", - "theme.bar.menus.menu.clock.calendar.currentday": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.paginator": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.weekdays": "#8fbcbb", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#8fbcbb", - "theme.bar.menus.menu.clock.time.timeperiod": "#8fbcbb", - "theme.bar.menus.menu.clock.time.time": "#8fbcbb", - "theme.bar.menus.menu.clock.text": "#d8dee9", - "theme.bar.menus.menu.clock.border.color": "#434c53", - "theme.bar.menus.menu.clock.background.color": "#2e3440", - "theme.bar.menus.menu.clock.card.color": "#3b4252", - "theme.bar.menus.menu.battery.slider.puck": "#4c566a", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.battery.slider.background": "#434c53", - "theme.bar.menus.menu.battery.slider.primary": "#81a1c1", - "theme.bar.menus.menu.battery.icons.active": "#81a1c1", - "theme.bar.menus.menu.battery.icons.passive": "#5e81ac", - "theme.bar.menus.menu.battery.listitems.active": "#81a1c1", - "theme.bar.menus.menu.battery.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.battery.text": "#d8dee9", - "theme.bar.menus.menu.battery.label.color": "#81a1c1", - "theme.bar.menus.menu.battery.border.color": "#434c53", - "theme.bar.menus.menu.battery.background.color": "#2e3440", - "theme.bar.menus.menu.battery.card.color": "#3b4252", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#3b4252", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#d8dee9", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#2e3440", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#d8dee9", - "theme.bar.menus.menu.bluetooth.icons.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.icons.passive": "#5e81ac", - "theme.bar.menus.menu.bluetooth.listitems.active": "#88c0d0", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.bluetooth.switch.puck": "#434c53", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#434c53", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#88c0d0", - "theme.bar.menus.menu.bluetooth.switch_divider": "#434c53", - "theme.bar.menus.menu.bluetooth.status": "#4c566a", - "theme.bar.menus.menu.bluetooth.text": "#d8dee9", - "theme.bar.menus.menu.bluetooth.label.color": "#88c0d0", - "theme.bar.menus.menu.bluetooth.border.color": "#434c53", - "theme.bar.menus.menu.bluetooth.background.color": "#2e3440", - "theme.bar.menus.menu.bluetooth.card.color": "#3b4252", - "theme.bar.menus.menu.network.iconbuttons.active": "#88c0d0", - "theme.bar.menus.menu.network.iconbuttons.passive": "#d8dee9", - "theme.bar.menus.menu.network.icons.active": "#88c0d0", - "theme.bar.menus.menu.network.icons.passive": "#5e81ac", - "theme.bar.menus.menu.network.listitems.active": "#88c0d0", - "theme.bar.menus.menu.network.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.network.status.color": "#4c566a", - "theme.bar.menus.menu.network.text": "#d8dee9", - "theme.bar.menus.menu.network.label.color": "#88c0d0", - "theme.bar.menus.menu.network.border.color": "#434c53", - "theme.bar.menus.menu.network.background.color": "#2e3440", - "theme.bar.menus.menu.network.card.color": "#3b4252", - "theme.bar.menus.menu.volume.input_slider.puck": "#434c53", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.volume.input_slider.background": "#434c53", - "theme.bar.menus.menu.volume.input_slider.primary": "#81a1c1", - "theme.bar.menus.menu.volume.audio_slider.puck": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.background": "#434c53", - "theme.bar.menus.menu.volume.audio_slider.primary": "#81a1c1", - "theme.bar.menus.menu.volume.icons.active": "#81a1c1", - "theme.bar.menus.menu.volume.icons.passive": "#5e81ac", - "theme.bar.menus.menu.volume.iconbutton.active": "#81a1c1", - "theme.bar.menus.menu.volume.iconbutton.passive": "#d8dee9", - "theme.bar.menus.menu.volume.listitems.active": "#81a1c1", - "theme.bar.menus.menu.volume.listitems.passive": "#d8dee9", - "theme.bar.menus.menu.volume.border.color": "#434c53", - "theme.bar.menus.menu.volume.background.color": "#2e3440", - "theme.bar.menus.menu.media.slider.puck": "#4c566a", - "theme.bar.menus.menu.media.slider.backgroundhover": "#434c53", - "theme.bar.menus.menu.media.slider.background": "#434c53", - "theme.bar.menus.menu.media.slider.primary": "#8fbcbb", - "theme.bar.menus.menu.media.buttons.text": "#2e3440", - "theme.bar.menus.menu.media.buttons.background": "#88c0d0", - "theme.bar.menus.menu.media.buttons.enabled": "#8fbcbb", - "theme.bar.menus.menu.media.buttons.inactive": "#434c53", - "theme.bar.menus.menu.media.border.color": "#434c53", - "theme.bar.menus.menu.media.background.color": "#2e3440", - "theme.bar.menus.menu.media.album": "#8fbcbb", - "theme.bar.menus.menu.media.artist": "#8fbcbb", - "theme.bar.menus.menu.media.song": "#88c0d0", - "theme.bar.menus.tooltip.text": "#d8dee9", - "theme.bar.menus.tooltip.background": "#2e3440", - "theme.bar.menus.dropdownmenu.divider": "#3b4252", - "theme.bar.menus.dropdownmenu.text": "#d8dee9", - "theme.bar.menus.dropdownmenu.background": "#2e3440", - "theme.bar.menus.slider.puck": "#4c566a", - "theme.bar.menus.slider.backgroundhover": "#434c53", - "theme.bar.menus.slider.background": "#434c53", - "theme.bar.menus.slider.primary": "#88c0d0", - "theme.bar.menus.progressbar.background": "#434c53", - "theme.bar.menus.progressbar.foreground": "#88c0d0", - "theme.bar.menus.iconbuttons.active": "#88c0d0", - "theme.bar.menus.iconbuttons.passive": "#d8dee9", - "theme.bar.menus.buttons.text": "#2e3440", - "theme.bar.menus.buttons.disabled": "#434c53", - "theme.bar.menus.buttons.active": "#8fbcbb", - "theme.bar.menus.buttons.default": "#88c0d0", - "theme.bar.menus.switch.puck": "#434c53", - "theme.bar.menus.switch.disabled": "#434c53", - "theme.bar.menus.switch.enabled": "#88c0d0", - "theme.bar.menus.icons.active": "#88c0d0", - "theme.bar.menus.icons.passive": "#434c53", - "theme.bar.menus.listitems.active": "#88c0d0", - "theme.bar.menus.listitems.passive": "#d8dee9", - "theme.bar.menus.label": "#88c0d0", - "theme.bar.menus.feinttext": "#434c53", - "theme.bar.menus.dimtext": "#6272a4", - "theme.bar.menus.cards": "#3b4252", - "theme.bar.buttons.notifications.total": "#88c0d0", - "theme.bar.buttons.notifications.icon": "#3b4252", - "theme.bar.buttons.notifications.background": "#3b4252", - "theme.bar.buttons.clock.icon": "#3b4252", - "theme.bar.buttons.clock.text": "#8fbcbb", - "theme.bar.buttons.clock.background": "#3b4252", - "theme.bar.buttons.battery.icon": "#3b4252", - "theme.bar.buttons.battery.text": "#81a1c1", - "theme.bar.buttons.battery.background": "#3b4252", - "theme.bar.buttons.systray.background": "#3b4252", - "theme.bar.buttons.bluetooth.icon": "#3b4252", - "theme.bar.buttons.bluetooth.text": "#88c0d0", - "theme.bar.buttons.bluetooth.background": "#3b4252", - "theme.bar.buttons.network.icon": "#3b4252", - "theme.bar.buttons.network.text": "#88c0d0", - "theme.bar.buttons.network.background": "#3b4252", - "theme.bar.buttons.volume.icon": "#3b4252", - "theme.bar.buttons.volume.text": "#81a1c1", - "theme.bar.buttons.volume.background": "#3b4252", - "theme.bar.buttons.windowtitle.icon": "#3b4252", - "theme.bar.buttons.windowtitle.text": "#8fbcbb", - "theme.bar.buttons.windowtitle.background": "#3b4252", - "theme.bar.buttons.workspaces.active": "#8fbcbb", - "theme.bar.buttons.workspaces.occupied": "#81a1c1", - "theme.bar.buttons.workspaces.available": "#88c0d0", - "theme.bar.buttons.workspaces.hover": "#8fbcbb", - "theme.bar.buttons.workspaces.background": "#3b4252", - "theme.bar.buttons.dashboard.icon": "#3b4252", - "theme.bar.buttons.dashboard.background": "#81a1c1", - "theme.osd.label": "#88c0d0", - "theme.osd.icon": "#2e3440", - "theme.osd.bar_overflow_color": "#8fbcbb", - "theme.osd.bar_empty_color": "#434c53", - "theme.osd.bar_color": "#88c0d0", - "theme.osd.icon_container": "#88c0d0", - "theme.osd.bar_container": "#2e3440", - "theme.notification.close_button.label": "#2e3440", - "theme.notification.close_button.background": "#8fbcbb", - "theme.notification.labelicon": "#88c0d0", - "theme.notification.text": "#d8dee9", - "theme.notification.time": "#4c566a", - "theme.notification.border": "#434c53", - "theme.notification.label": "#88c0d0", - "theme.notification.actions.text": "#2e3440", - "theme.notification.actions.background": "#88c0d0", - "theme.notification.background": "#2e3440", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#ffffff", - "theme.bar.menus.menu.media.card.color": "#3b4252", - "theme.bar.menus.check_radio_button.background": "#2e3440", - "theme.bar.menus.check_radio_button.active": "#88c0d0", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#81a1c1", - "theme.bar.buttons.network.icon_background": "#88c0d0", - "theme.bar.buttons.bluetooth.icon_background": "#88c0d0", - "theme.bar.buttons.windowtitle.icon_background": "#8fbcbb", - "theme.bar.buttons.media.icon_background": "#88c0d0", - "theme.bar.buttons.notifications.icon_background": "#88c0d0", - "theme.bar.buttons.battery.icon_background": "#81a1c1", - "theme.bar.buttons.clock.icon_background": "#8fbcbb", - "theme.bar.menus.menu.notifications.pager.button": "#88c0d0", - "theme.bar.menus.menu.notifications.scrollbar.color": "#88c0d0", - "theme.bar.menus.menu.notifications.pager.label": "#5e81ac", - "theme.bar.menus.menu.notifications.pager.background": "#2e3440", - "theme.bar.buttons.modules.ram.icon": "#21252b", - "theme.bar.buttons.modules.storage.icon_background": "#8fbcbb", - "theme.bar.menus.popover.border": "#2e3440", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#88c0d0", - "theme.bar.menus.menu.power.buttons.restart.text": "#81a1c1", - "theme.bar.buttons.modules.updates.background": "#3b4252", - "theme.bar.buttons.modules.storage.icon": "#21252b", - "theme.bar.buttons.modules.netstat.background": "#3b4252", - "theme.bar.buttons.modules.weather.icon": "#3b4252", - "theme.bar.buttons.modules.netstat.text": "#8fbcbb", - "theme.bar.buttons.modules.storage.background": "#3b4252", - "theme.bar.buttons.modules.power.icon": "#21252b", - "theme.bar.buttons.modules.storage.text": "#8fbcbb", - "theme.bar.buttons.modules.cpu.background": "#3b4252", - "theme.bar.menus.menu.power.border.color": "#434c53", - "theme.bar.buttons.modules.power.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.logout.icon": "#2e3440", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#81a1c1", - "theme.bar.menus.menu.power.buttons.restart.icon": "#2e3440", - "theme.bar.buttons.modules.cpu.icon": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon_background": "#88c0d0", - "theme.bar.buttons.modules.weather.text": "#88c0d0", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#2e3440", - "theme.bar.menus.menu.power.buttons.sleep.text": "#88c0d0", - "theme.bar.buttons.modules.weather.icon_background": "#88c0d0", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#3b4252", - "theme.bar.menus.menu.power.buttons.logout.background": "#3b4252", - "theme.bar.buttons.modules.kbLayout.icon": "#21252b", - "theme.bar.buttons.modules.ram.icon_background": "#81a1c1", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.sleep.background": "#3b4252", - "theme.bar.buttons.modules.ram.text": "#81a1c1", - "theme.bar.menus.menu.power.buttons.logout.text": "#8fbcbb", - "theme.bar.buttons.modules.updates.icon_background": "#88c0d0", - "theme.bar.buttons.modules.kbLayout.background": "#3b4252", - "theme.bar.buttons.modules.power.background": "#3b4252", - "theme.bar.buttons.modules.weather.background": "#3b4252", - "theme.bar.menus.menu.power.background.color": "#2e3440", - "theme.bar.buttons.modules.ram.background": "#3b4252", - "theme.bar.buttons.modules.netstat.icon": "#21252b", - "theme.bar.buttons.modules.cpu.icon_background": "#8fbcbb", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.updates.text": "#88c0d0", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#2e3440", - "theme.bar.menus.menu.power.buttons.restart.background": "#3b4252", - "theme.bar.buttons.modules.updates.icon": "#21252b", - "theme.bar.buttons.modules.cpu.text": "#8fbcbb", - "theme.bar.buttons.modules.netstat.icon_background": "#8fbcbb", - "theme.bar.buttons.modules.kbLayout.text": "#88c0d0", - "theme.bar.buttons.modules.power.border": "#8fbcbb", - "theme.bar.buttons.modules.weather.border": "#88c0d0", - "theme.bar.buttons.modules.updates.border": "#88c0d0", - "theme.bar.buttons.modules.kbLayout.border": "#88c0d0", - "theme.bar.buttons.modules.netstat.border": "#8fbcbb", - "theme.bar.buttons.modules.storage.border": "#8fbcbb", - "theme.bar.buttons.modules.cpu.border": "#8fbcbb", - "theme.bar.buttons.modules.ram.border": "#81a1c1", - "theme.bar.buttons.notifications.border": "#88c0d0", - "theme.bar.buttons.clock.border": "#8fbcbb", - "theme.bar.buttons.battery.border": "#81a1c1", - "theme.bar.buttons.systray.border": "#434c53", - "theme.bar.buttons.bluetooth.border": "#88c0d0", - "theme.bar.buttons.network.border": "#88c0d0", - "theme.bar.buttons.volume.border": "#81a1c1", - "theme.bar.buttons.media.border": "#88c0d0", - "theme.bar.buttons.windowtitle.border": "#8fbcbb", - "theme.bar.buttons.workspaces.border": "#2e3440", - "theme.bar.buttons.dashboard.border": "#81a1c1", - "theme.bar.buttons.modules.submap.background": "#3b4252", - "theme.bar.buttons.modules.submap.text": "#8fbcbb", - "theme.bar.buttons.modules.submap.border": "#8fbcbb", - "theme.bar.buttons.modules.submap.icon": "#21252b", - "theme.bar.buttons.modules.submap.icon_background": "#8fbcbb" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/one_dark.json b/ags/HyprPanel/themes/one_dark.json deleted file mode 100644 index 8c58b2a..0000000 --- a/ags/HyprPanel/themes/one_dark.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#282c34", - "theme.bar.background": "#282c34", - "theme.bar.buttons.media.icon": "#61afef", - "theme.bar.buttons.media.text": "#61afef", - "theme.bar.buttons.icon": "#61afef", - "theme.bar.buttons.text": "#61afef", - "theme.bar.buttons.hover": "#3e4451", - "theme.bar.buttons.background": "#3e4451", - "theme.bar.menus.text": "#abb2bf", - "theme.bar.menus.border.color": "#4b5263", - "theme.bar.buttons.media.background": "#21252b", - "theme.bar.menus.menu.volume.text": "#abb2bf", - "theme.bar.menus.menu.volume.card.color": "#21252b", - "theme.bar.menus.menu.volume.label.color": "#e06c75", - "theme.bar.menus.popover.text": "#61afef", - "theme.bar.menus.popover.background": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e06c75", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e06c75", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#98c379", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#abb2bf", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#61afef", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#4b5263", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#21252b", - "theme.bar.menus.menu.notifications.switch.puck": "#3e4451", - "theme.bar.menus.menu.notifications.switch.disabled": "#4b5263", - "theme.bar.menus.menu.notifications.switch.enabled": "#61afef", - "theme.bar.menus.menu.notifications.clear": "#e06c75", - "theme.bar.menus.menu.notifications.switch_divider": "#3e4451", - "theme.bar.menus.menu.notifications.border": "#4b5263", - "theme.bar.menus.menu.notifications.card": "#21252b", - "theme.bar.menus.menu.notifications.background": "#282c34", - "theme.bar.menus.menu.notifications.no_notifications_label": "#4b5263", - "theme.bar.menus.menu.notifications.label": "#61afef", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#3e4451", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#61afef", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#c678dd", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#56b6c2", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e06c75", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e5c07b", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.input.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.input.background": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e06c75", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e5c07b", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#56b6c2", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5c6370", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#98c379", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#282c34", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#61afef", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#56b6c2", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#98c379", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#d19a66", - "theme.bar.menus.menu.dashboard.profile.name": "#c678dd", - "theme.bar.menus.menu.dashboard.border.color": "#4b5263", - "theme.bar.menus.menu.dashboard.background.color": "#282c34", - "theme.bar.menus.menu.dashboard.card.color": "#21252b", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c678dd", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c678dd", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c678dd", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#56b6c2", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#61afef", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#61afef", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#d19a66", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e06c75", - "theme.bar.menus.menu.clock.weather.stats": "#c678dd", - "theme.bar.menus.menu.clock.weather.status": "#56b6c2", - "theme.bar.menus.menu.clock.weather.temperature": "#abb2bf", - "theme.bar.menus.menu.clock.weather.icon": "#c678dd", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5c6370", - "theme.bar.menus.menu.clock.calendar.days": "#abb2bf", - "theme.bar.menus.menu.clock.calendar.currentday": "#c678dd", - "theme.bar.menus.menu.clock.calendar.paginator": "#c678dd", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c678dd", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#56b6c2", - "theme.bar.menus.menu.clock.time.timeperiod": "#56b6c2", - "theme.bar.menus.menu.clock.time.time": "#c678dd", - "theme.bar.menus.menu.clock.text": "#abb2bf", - "theme.bar.menus.menu.clock.border.color": "#4b5263", - "theme.bar.menus.menu.clock.background.color": "#282c34", - "theme.bar.menus.menu.clock.card.color": "#21252b", - "theme.bar.menus.menu.battery.slider.puck": "#3e4451", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#3e4451", - "theme.bar.menus.menu.battery.slider.background": "#5c6370", - "theme.bar.menus.menu.battery.slider.primary": "#e5c07b", - "theme.bar.menus.menu.battery.icons.active": "#e5c07b", - "theme.bar.menus.menu.battery.icons.passive": "#828997", - "theme.bar.menus.menu.battery.listitems.active": "#e5c07b", - "theme.bar.menus.menu.battery.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.battery.text": "#abb2bf", - "theme.bar.menus.menu.battery.label.color": "#e5c07b", - "theme.bar.menus.menu.battery.border.color": "#4b5263", - "theme.bar.menus.menu.battery.background.color": "#282c34", - "theme.bar.menus.menu.battery.card.color": "#21252b", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#21252b", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#abb2bf", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#282c34", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#61afef", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#abb2bf", - "theme.bar.menus.menu.bluetooth.icons.active": "#61afef", - "theme.bar.menus.menu.bluetooth.icons.passive": "#5c6370", - "theme.bar.menus.menu.bluetooth.listitems.active": "#61afef", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.bluetooth.switch.puck": "#4b5263", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#3e4451", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#61afef", - "theme.bar.menus.menu.bluetooth.switch_divider": "#4b5263", - "theme.bar.menus.menu.bluetooth.status": "#5c6370", - "theme.bar.menus.menu.bluetooth.text": "#abb2bf", - "theme.bar.menus.menu.bluetooth.label.color": "#61afef", - "theme.bar.menus.menu.bluetooth.border.color": "#3e4451", - "theme.bar.menus.menu.bluetooth.background.color": "#282c34", - "theme.bar.menus.menu.bluetooth.card.color": "#21252b", - "theme.bar.menus.menu.network.iconbuttons.active": "#c678dd", - "theme.bar.menus.menu.network.iconbuttons.passive": "#abb2bf", - "theme.bar.menus.menu.network.icons.active": "#c678dd", - "theme.bar.menus.menu.network.icons.passive": "#5c6370", - "theme.bar.menus.menu.network.listitems.active": "#c678dd", - "theme.bar.menus.menu.network.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.network.status.color": "#5c6370", - "theme.bar.menus.menu.network.text": "#abb2bf", - "theme.bar.menus.menu.network.label.color": "#c678dd", - "theme.bar.menus.menu.network.border.color": "#3e4451", - "theme.bar.menus.menu.network.background.color": "#282c34", - "theme.bar.menus.menu.network.card.color": "#21252b", - "theme.bar.menus.menu.volume.input_slider.puck": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.background": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.primary": "#e06c75", - "theme.bar.menus.menu.volume.audio_slider.puck": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.background": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.primary": "#e06c75", - "theme.bar.menus.menu.volume.icons.active": "#e06c75", - "theme.bar.menus.menu.volume.icons.passive": "#5c6370", - "theme.bar.menus.menu.volume.iconbutton.active": "#e06c75", - "theme.bar.menus.menu.volume.iconbutton.passive": "#abb2bf", - "theme.bar.menus.menu.volume.listitems.active": "#e06c75", - "theme.bar.menus.menu.volume.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.volume.border.color": "#3e4451", - "theme.bar.menus.menu.volume.background.color": "#282c34", - "theme.bar.menus.menu.media.slider.puck": "#5c6370", - "theme.bar.menus.menu.media.slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.media.slider.background": "#4b5263", - "theme.bar.menus.menu.media.slider.primary": "#98c379", - "theme.bar.menus.menu.media.buttons.text": "#282c34", - "theme.bar.menus.menu.media.buttons.background": "#98c379", - "theme.bar.menus.menu.media.buttons.enabled": "#56b6c2", - "theme.bar.menus.menu.media.buttons.inactive": "#4b5263", - "theme.bar.menus.menu.media.border.color": "#3e4451", - "theme.bar.menus.menu.media.background.color": "#282c34", - "theme.bar.menus.menu.media.album": "#98c379", - "theme.bar.menus.menu.media.artist": "#56b6c2", - "theme.bar.menus.menu.media.song": "#98c379", - "theme.bar.menus.tooltip.text": "#abb2bf", - "theme.bar.menus.tooltip.background": "#282c34", - "theme.bar.menus.dropdownmenu.divider": "#21252b", - "theme.bar.menus.dropdownmenu.text": "#abb2bf", - "theme.bar.menus.dropdownmenu.background": "#282c34", - "theme.bar.menus.slider.puck": "#5c6370", - "theme.bar.menus.slider.backgroundhover": "#4b5263", - "theme.bar.menus.slider.background": "#4b5263", - "theme.bar.menus.slider.primary": "#61afef", - "theme.bar.menus.progressbar.background": "#4b5263", - "theme.bar.menus.progressbar.foreground": "#61afef", - "theme.bar.menus.iconbuttons.active": "#61afef", - "theme.bar.menus.iconbuttons.passive": "#abb2bf", - "theme.bar.menus.buttons.text": "#282c34", - "theme.bar.menus.buttons.disabled": "#4b5263", - "theme.bar.menus.buttons.active": "#98c379", - "theme.bar.menus.buttons.default": "#61afef", - "theme.bar.menus.switch.puck": "#4b5263", - "theme.bar.menus.switch.disabled": "#3e4451", - "theme.bar.menus.switch.enabled": "#61afef", - "theme.bar.menus.icons.active": "#61afef", - "theme.bar.menus.icons.passive": "#4b5263", - "theme.bar.menus.listitems.active": "#61afef", - "theme.bar.menus.listitems.passive": "#abb2bf", - "theme.bar.menus.label": "#61afef", - "theme.bar.menus.feinttext": "#3e4451", - "theme.bar.menus.dimtext": "#4b5263", - "theme.bar.menus.cards": "#21252b", - "theme.bar.buttons.notifications.total": "#61afef", - "theme.bar.buttons.notifications.icon": "#61afef", - "theme.bar.buttons.notifications.background": "#21252b", - "theme.bar.buttons.clock.icon": "#98c379", - "theme.bar.buttons.clock.text": "#98c379", - "theme.bar.buttons.clock.background": "#21252b", - "theme.bar.buttons.battery.icon": "#e5c07b", - "theme.bar.buttons.battery.text": "#e5c07b", - "theme.bar.buttons.battery.background": "#21252b", - "theme.bar.buttons.systray.background": "#21252b", - "theme.bar.buttons.bluetooth.icon": "#61afef", - "theme.bar.buttons.bluetooth.text": "#61afef", - "theme.bar.buttons.bluetooth.background": "#21252b", - "theme.bar.buttons.network.icon": "#c678dd", - "theme.bar.buttons.network.text": "#c678dd", - "theme.bar.buttons.network.background": "#21252b", - "theme.bar.buttons.volume.icon": "#e06c75", - "theme.bar.buttons.volume.text": "#e06c75", - "theme.bar.buttons.volume.background": "#21252b", - "theme.bar.buttons.windowtitle.icon": "#98c379", - "theme.bar.buttons.windowtitle.text": "#98c379", - "theme.bar.buttons.windowtitle.background": "#21252b", - "theme.bar.buttons.workspaces.active": "#c678dd", - "theme.bar.buttons.workspaces.occupied": "#e06c75", - "theme.bar.buttons.workspaces.available": "#61afef", - "theme.bar.buttons.workspaces.hover": "#3e4451", - "theme.bar.buttons.workspaces.background": "#21252b", - "theme.bar.buttons.dashboard.icon": "#e5c07b", - "theme.bar.buttons.dashboard.background": "#21252b", - "theme.osd.label": "#61afef", - "theme.osd.icon": "#282c34", - "theme.osd.bar_overflow_color": "#e06c75", - "theme.osd.bar_empty_color": "#4b5263", - "theme.osd.bar_color": "#61afef", - "theme.osd.icon_container": "#61afef", - "theme.osd.bar_container": "#282c34", - "theme.notification.close_button.label": "#282c34", - "theme.notification.close_button.background": "#e06c75", - "theme.notification.labelicon": "#61afef", - "theme.notification.text": "#abb2bf", - "theme.notification.time": "#5c6370", - "theme.notification.border": "#4b5263", - "theme.notification.label": "#61afef", - "theme.notification.actions.text": "#282c34", - "theme.notification.actions.background": "#61afef", - "theme.notification.background": "#282c34", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#21252b", - "theme.bar.menus.check_radio_button.background": "#2e3440", - "theme.bar.menus.check_radio_button.active": "#88c0d0", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#61afef", - "theme.bar.menus.menu.notifications.scrollbar.color": "#61afef", - "theme.bar.menus.menu.notifications.pager.label": "#828997", - "theme.bar.menus.menu.notifications.pager.background": "#282c34", - "theme.bar.buttons.clock.icon_background": "#c678dd", - "theme.bar.buttons.modules.ram.icon": "#e5c07b", - "theme.bar.buttons.modules.storage.icon_background": "#e06c75", - "theme.bar.menus.popover.border": "#282c34", - "theme.bar.buttons.volume.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#56b6c2", - "theme.bar.menus.menu.power.buttons.restart.text": "#d19a66", - "theme.bar.buttons.modules.updates.background": "#21252b", - "theme.bar.buttons.modules.storage.icon": "#e06c75", - "theme.bar.buttons.modules.netstat.background": "#21252b", - "theme.bar.buttons.modules.weather.icon": "#61afef", - "theme.bar.buttons.modules.netstat.text": "#98c379", - "theme.bar.buttons.modules.storage.background": "#21252b", - "theme.bar.buttons.modules.power.icon": "#e06c75", - "theme.bar.buttons.modules.storage.text": "#e06c75", - "theme.bar.buttons.modules.cpu.background": "#21252b", - "theme.bar.menus.menu.power.border.color": "#4b5263", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.logout.icon": "#282c34", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#d19a66", - "theme.bar.menus.menu.power.buttons.restart.icon": "#282c34", - "theme.bar.buttons.modules.cpu.icon": "#e06c75", - "theme.bar.buttons.battery.icon_background": "#e5c07b", - "theme.bar.buttons.modules.kbLayout.icon_background": "#56b6c2", - "theme.bar.buttons.modules.weather.text": "#61afef", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#282c34", - "theme.bar.menus.menu.power.buttons.sleep.text": "#56b6c2", - "theme.bar.buttons.modules.weather.icon_background": "#61afef", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#21252b", - "theme.bar.buttons.media.icon_background": "#61afef", - "theme.bar.menus.menu.power.buttons.logout.background": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon": "#56b6c2", - "theme.bar.buttons.modules.ram.icon_background": "#e5c07b", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e06c75", - "theme.bar.menus.menu.power.buttons.sleep.background": "#21252b", - "theme.bar.buttons.modules.ram.text": "#e5c07b", - "theme.bar.menus.menu.power.buttons.logout.text": "#98c379", - "theme.bar.buttons.modules.updates.icon_background": "#c678dd", - "theme.bar.buttons.modules.kbLayout.background": "#21252b", - "theme.bar.buttons.modules.power.background": "#21252b", - "theme.bar.buttons.modules.weather.background": "#21252b", - "theme.bar.buttons.icon_background": "#21252b", - "theme.bar.menus.menu.power.background.color": "#282c34", - "theme.bar.buttons.modules.ram.background": "#21252b", - "theme.bar.buttons.modules.netstat.icon": "#98c379", - "theme.bar.buttons.windowtitle.icon_background": "#c678dd", - "theme.bar.buttons.modules.cpu.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#98c379", - "theme.bar.buttons.modules.updates.text": "#c678dd", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#282c34", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#21252b", - "theme.bar.buttons.modules.updates.icon": "#c678dd", - "theme.bar.buttons.modules.cpu.text": "#e06c75", - "theme.bar.buttons.modules.netstat.icon_background": "#98c379", - "theme.bar.buttons.modules.kbLayout.text": "#56b6c2", - "theme.bar.buttons.notifications.icon_background": "#61afef", - "theme.bar.buttons.modules.power.border": "#e06c75", - "theme.bar.buttons.modules.weather.border": "#61afef", - "theme.bar.buttons.modules.updates.border": "#c678dd", - "theme.bar.buttons.modules.kbLayout.border": "#56b6c2", - "theme.bar.buttons.modules.netstat.border": "#98c379", - "theme.bar.buttons.modules.storage.border": "#e06c75", - "theme.bar.buttons.modules.cpu.border": "#e06c75", - "theme.bar.buttons.modules.ram.border": "#e5c07b", - "theme.bar.buttons.notifications.border": "#61afef", - "theme.bar.buttons.clock.border": "#98c379", - "theme.bar.buttons.battery.border": "#e5c07b", - "theme.bar.buttons.systray.border": "#4b5263", - "theme.bar.buttons.bluetooth.border": "#61afef", - "theme.bar.buttons.network.border": "#c678dd", - "theme.bar.buttons.volume.border": "#e06c75", - "theme.bar.buttons.media.border": "#61afef", - "theme.bar.buttons.windowtitle.border": "#98c379", - "theme.bar.buttons.workspaces.border": "#21252b", - "theme.bar.buttons.dashboard.border": "#e5c07b", - "theme.bar.buttons.modules.submap.background": "#21252b", - "theme.bar.buttons.modules.submap.text": "#56b6c2", - "theme.bar.buttons.modules.submap.border": "#56b6c2", - "theme.bar.buttons.modules.submap.icon": "#56b6c2", - "theme.bar.buttons.modules.submap.icon_background": "#21252b" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/one_dark_split.json b/ags/HyprPanel/themes/one_dark_split.json deleted file mode 100644 index 7222e05..0000000 --- a/ags/HyprPanel/themes/one_dark_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#282c34", - "theme.bar.background": "#282c34", - "theme.bar.buttons.media.icon": "#21252b", - "theme.bar.buttons.media.text": "#61afef", - "theme.bar.buttons.icon": "#61afef", - "theme.bar.buttons.text": "#61afef", - "theme.bar.buttons.hover": "#3e4451", - "theme.bar.buttons.background": "#3e4451", - "theme.bar.menus.text": "#abb2bf", - "theme.bar.menus.border.color": "#4b5263", - "theme.bar.buttons.media.background": "#21252b", - "theme.bar.menus.menu.volume.text": "#abb2bf", - "theme.bar.menus.menu.volume.card.color": "#21252b", - "theme.bar.menus.menu.volume.label.color": "#e06c75", - "theme.bar.menus.popover.text": "#61afef", - "theme.bar.menus.popover.background": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#e06c75", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#e06c75", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#98c379", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#abb2bf", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#61afef", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#4b5263", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#282c34", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#21252b", - "theme.bar.menus.menu.notifications.switch.puck": "#3e4451", - "theme.bar.menus.menu.notifications.switch.disabled": "#4b5263", - "theme.bar.menus.menu.notifications.switch.enabled": "#61afef", - "theme.bar.menus.menu.notifications.clear": "#e06c75", - "theme.bar.menus.menu.notifications.switch_divider": "#3e4451", - "theme.bar.menus.menu.notifications.border": "#4b5263", - "theme.bar.menus.menu.notifications.card": "#21252b", - "theme.bar.menus.menu.notifications.background": "#282c34", - "theme.bar.menus.menu.notifications.no_notifications_label": "#4b5263", - "theme.bar.menus.menu.notifications.label": "#61afef", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c678dd", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#98c379", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e5c07b", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#e06c75", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#3e4451", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#61afef", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#c678dd", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#56b6c2", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#e06c75", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e5c07b", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.input.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.input.background": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#e06c75", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e5c07b", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#56b6c2", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#282c34", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c678dd", - "theme.bar.menus.menu.dashboard.controls.disabled": "#5c6370", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#98c379", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#282c34", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#61afef", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#56b6c2", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#98c379", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#d19a66", - "theme.bar.menus.menu.dashboard.profile.name": "#c678dd", - "theme.bar.menus.menu.dashboard.border.color": "#4b5263", - "theme.bar.menus.menu.dashboard.background.color": "#282c34", - "theme.bar.menus.menu.dashboard.card.color": "#21252b", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c678dd", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c678dd", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c678dd", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#56b6c2", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#61afef", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#61afef", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#d19a66", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#e06c75", - "theme.bar.menus.menu.clock.weather.stats": "#c678dd", - "theme.bar.menus.menu.clock.weather.status": "#56b6c2", - "theme.bar.menus.menu.clock.weather.temperature": "#abb2bf", - "theme.bar.menus.menu.clock.weather.icon": "#c678dd", - "theme.bar.menus.menu.clock.calendar.contextdays": "#5c6370", - "theme.bar.menus.menu.clock.calendar.days": "#abb2bf", - "theme.bar.menus.menu.clock.calendar.currentday": "#c678dd", - "theme.bar.menus.menu.clock.calendar.paginator": "#c678dd", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c678dd", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#56b6c2", - "theme.bar.menus.menu.clock.time.timeperiod": "#56b6c2", - "theme.bar.menus.menu.clock.time.time": "#c678dd", - "theme.bar.menus.menu.clock.text": "#abb2bf", - "theme.bar.menus.menu.clock.border.color": "#4b5263", - "theme.bar.menus.menu.clock.background.color": "#282c34", - "theme.bar.menus.menu.clock.card.color": "#21252b", - "theme.bar.menus.menu.battery.slider.puck": "#3e4451", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#3e4451", - "theme.bar.menus.menu.battery.slider.background": "#5c6370", - "theme.bar.menus.menu.battery.slider.primary": "#e5c07b", - "theme.bar.menus.menu.battery.icons.active": "#e5c07b", - "theme.bar.menus.menu.battery.icons.passive": "#828997", - "theme.bar.menus.menu.battery.listitems.active": "#e5c07b", - "theme.bar.menus.menu.battery.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.battery.text": "#abb2bf", - "theme.bar.menus.menu.battery.label.color": "#e5c07b", - "theme.bar.menus.menu.battery.border.color": "#4b5263", - "theme.bar.menus.menu.battery.background.color": "#282c34", - "theme.bar.menus.menu.battery.card.color": "#21252b", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#21252b", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#abb2bf", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#282c34", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#61afef", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#abb2bf", - "theme.bar.menus.menu.bluetooth.icons.active": "#61afef", - "theme.bar.menus.menu.bluetooth.icons.passive": "#5c6370", - "theme.bar.menus.menu.bluetooth.listitems.active": "#61afef", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.bluetooth.switch.puck": "#4b5263", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#3e4451", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#61afef", - "theme.bar.menus.menu.bluetooth.switch_divider": "#4b5263", - "theme.bar.menus.menu.bluetooth.status": "#5c6370", - "theme.bar.menus.menu.bluetooth.text": "#abb2bf", - "theme.bar.menus.menu.bluetooth.label.color": "#61afef", - "theme.bar.menus.menu.bluetooth.border.color": "#3e4451", - "theme.bar.menus.menu.bluetooth.background.color": "#282c34", - "theme.bar.menus.menu.bluetooth.card.color": "#21252b", - "theme.bar.menus.menu.network.iconbuttons.active": "#c678dd", - "theme.bar.menus.menu.network.iconbuttons.passive": "#abb2bf", - "theme.bar.menus.menu.network.icons.active": "#c678dd", - "theme.bar.menus.menu.network.icons.passive": "#5c6370", - "theme.bar.menus.menu.network.listitems.active": "#c678dd", - "theme.bar.menus.menu.network.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.network.status.color": "#5c6370", - "theme.bar.menus.menu.network.text": "#abb2bf", - "theme.bar.menus.menu.network.label.color": "#c678dd", - "theme.bar.menus.menu.network.border.color": "#3e4451", - "theme.bar.menus.menu.network.background.color": "#282c34", - "theme.bar.menus.menu.network.card.color": "#21252b", - "theme.bar.menus.menu.volume.input_slider.puck": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.background": "#4b5263", - "theme.bar.menus.menu.volume.input_slider.primary": "#e06c75", - "theme.bar.menus.menu.volume.audio_slider.puck": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.background": "#4b5263", - "theme.bar.menus.menu.volume.audio_slider.primary": "#e06c75", - "theme.bar.menus.menu.volume.icons.active": "#e06c75", - "theme.bar.menus.menu.volume.icons.passive": "#5c6370", - "theme.bar.menus.menu.volume.iconbutton.active": "#e06c75", - "theme.bar.menus.menu.volume.iconbutton.passive": "#abb2bf", - "theme.bar.menus.menu.volume.listitems.active": "#e06c75", - "theme.bar.menus.menu.volume.listitems.passive": "#abb2bf", - "theme.bar.menus.menu.volume.border.color": "#3e4451", - "theme.bar.menus.menu.volume.background.color": "#282c34", - "theme.bar.menus.menu.media.slider.puck": "#5c6370", - "theme.bar.menus.menu.media.slider.backgroundhover": "#4b5263", - "theme.bar.menus.menu.media.slider.background": "#4b5263", - "theme.bar.menus.menu.media.slider.primary": "#98c379", - "theme.bar.menus.menu.media.buttons.text": "#282c34", - "theme.bar.menus.menu.media.buttons.background": "#98c379", - "theme.bar.menus.menu.media.buttons.enabled": "#56b6c2", - "theme.bar.menus.menu.media.buttons.inactive": "#4b5263", - "theme.bar.menus.menu.media.border.color": "#3e4451", - "theme.bar.menus.menu.media.background.color": "#282c34", - "theme.bar.menus.menu.media.album": "#98c379", - "theme.bar.menus.menu.media.artist": "#56b6c2", - "theme.bar.menus.menu.media.song": "#98c379", - "theme.bar.menus.tooltip.text": "#abb2bf", - "theme.bar.menus.tooltip.background": "#282c34", - "theme.bar.menus.dropdownmenu.divider": "#21252b", - "theme.bar.menus.dropdownmenu.text": "#abb2bf", - "theme.bar.menus.dropdownmenu.background": "#282c34", - "theme.bar.menus.slider.puck": "#5c6370", - "theme.bar.menus.slider.backgroundhover": "#4b5263", - "theme.bar.menus.slider.background": "#4b5263", - "theme.bar.menus.slider.primary": "#61afef", - "theme.bar.menus.progressbar.background": "#4b5263", - "theme.bar.menus.progressbar.foreground": "#61afef", - "theme.bar.menus.iconbuttons.active": "#61afef", - "theme.bar.menus.iconbuttons.passive": "#abb2bf", - "theme.bar.menus.buttons.text": "#282c34", - "theme.bar.menus.buttons.disabled": "#4b5263", - "theme.bar.menus.buttons.active": "#98c379", - "theme.bar.menus.buttons.default": "#61afef", - "theme.bar.menus.switch.puck": "#4b5263", - "theme.bar.menus.switch.disabled": "#3e4451", - "theme.bar.menus.switch.enabled": "#61afef", - "theme.bar.menus.icons.active": "#61afef", - "theme.bar.menus.icons.passive": "#4b5263", - "theme.bar.menus.listitems.active": "#61afef", - "theme.bar.menus.listitems.passive": "#abb2bf", - "theme.bar.menus.label": "#61afef", - "theme.bar.menus.feinttext": "#3e4451", - "theme.bar.menus.dimtext": "#4b5263", - "theme.bar.menus.cards": "#21252b", - "theme.bar.buttons.notifications.total": "#61afef", - "theme.bar.buttons.notifications.icon": "#21252b", - "theme.bar.buttons.notifications.background": "#21252b", - "theme.bar.buttons.clock.icon": "#21252b", - "theme.bar.buttons.clock.text": "#98c379", - "theme.bar.buttons.clock.background": "#21252b", - "theme.bar.buttons.battery.icon": "#21252b", - "theme.bar.buttons.battery.text": "#e5c07b", - "theme.bar.buttons.battery.background": "#21252b", - "theme.bar.buttons.systray.background": "#21252b", - "theme.bar.buttons.bluetooth.icon": "#21252b", - "theme.bar.buttons.bluetooth.text": "#61afef", - "theme.bar.buttons.bluetooth.background": "#21252b", - "theme.bar.buttons.network.icon": "#21252b", - "theme.bar.buttons.network.text": "#c678dd", - "theme.bar.buttons.network.background": "#21252b", - "theme.bar.buttons.volume.icon": "#21252b", - "theme.bar.buttons.volume.text": "#e06c75", - "theme.bar.buttons.volume.background": "#21252b", - "theme.bar.buttons.windowtitle.icon": "#21252b", - "theme.bar.buttons.windowtitle.text": "#98c379", - "theme.bar.buttons.windowtitle.background": "#21252b", - "theme.bar.buttons.workspaces.active": "#c678dd", - "theme.bar.buttons.workspaces.occupied": "#e06c75", - "theme.bar.buttons.workspaces.available": "#61afef", - "theme.bar.buttons.workspaces.hover": "#c678dd", - "theme.bar.buttons.workspaces.background": "#21252b", - "theme.bar.buttons.dashboard.icon": "#21252b", - "theme.bar.buttons.dashboard.background": "#e5c07b", - "theme.osd.label": "#61afef", - "theme.osd.icon": "#282c34", - "theme.osd.bar_overflow_color": "#e06c75", - "theme.osd.bar_empty_color": "#4b5263", - "theme.osd.bar_color": "#61afef", - "theme.osd.icon_container": "#61afef", - "theme.osd.bar_container": "#282c34", - "theme.notification.close_button.label": "#282c34", - "theme.notification.close_button.background": "#e06c75", - "theme.notification.labelicon": "#61afef", - "theme.notification.text": "#abb2bf", - "theme.notification.time": "#5c6370", - "theme.notification.border": "#4b5263", - "theme.notification.label": "#61afef", - "theme.notification.actions.text": "#282c34", - "theme.notification.actions.background": "#61afef", - "theme.notification.background": "#282c34", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#21252b", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#21252b", - "theme.bar.menus.check_radio_button.background": "#2e3440", - "theme.bar.menus.check_radio_button.active": "#88c0d0", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#e06c75", - "theme.bar.buttons.network.icon_background": "#c678dd", - "theme.bar.buttons.bluetooth.icon_background": "#61afef", - "theme.bar.buttons.windowtitle.icon_background": "#98c379", - "theme.bar.buttons.media.icon_background": "#61afef", - "theme.bar.buttons.notifications.icon_background": "#61afef", - "theme.bar.buttons.battery.icon_background": "#e5c07b", - "theme.bar.buttons.clock.icon_background": "#98c379", - "theme.bar.menus.menu.notifications.pager.button": "#61afef", - "theme.bar.menus.menu.notifications.scrollbar.color": "#61afef", - "theme.bar.menus.menu.notifications.pager.label": "#828997", - "theme.bar.menus.menu.notifications.pager.background": "#282c34", - "theme.bar.buttons.modules.ram.icon": "#21252b", - "theme.bar.buttons.modules.storage.icon_background": "#e06c75", - "theme.bar.menus.popover.border": "#282c34", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#56b6c2", - "theme.bar.menus.menu.power.buttons.restart.text": "#d19a66", - "theme.bar.buttons.modules.updates.background": "#21252b", - "theme.bar.buttons.modules.storage.icon": "#21252b", - "theme.bar.buttons.modules.netstat.background": "#21252b", - "theme.bar.buttons.modules.weather.icon": "#21252b", - "theme.bar.buttons.modules.netstat.text": "#98c379", - "theme.bar.buttons.modules.storage.background": "#21252b", - "theme.bar.buttons.modules.power.icon": "#21252b", - "theme.bar.buttons.modules.storage.text": "#e06c75", - "theme.bar.buttons.modules.cpu.background": "#21252b", - "theme.bar.menus.menu.power.border.color": "#4b5263", - "theme.bar.buttons.modules.power.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.logout.icon": "#282c34", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#d19a66", - "theme.bar.menus.menu.power.buttons.restart.icon": "#282c34", - "theme.bar.buttons.modules.cpu.icon": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon_background": "#56b6c2", - "theme.bar.buttons.modules.weather.text": "#61afef", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#282c34", - "theme.bar.menus.menu.power.buttons.sleep.text": "#56b6c2", - "theme.bar.buttons.modules.weather.icon_background": "#61afef", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#21252b", - "theme.bar.menus.menu.power.buttons.logout.background": "#21252b", - "theme.bar.buttons.modules.kbLayout.icon": "#21252b", - "theme.bar.buttons.modules.ram.icon_background": "#e5c07b", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#e06c75", - "theme.bar.menus.menu.power.buttons.sleep.background": "#21252b", - "theme.bar.buttons.modules.ram.text": "#e5c07b", - "theme.bar.menus.menu.power.buttons.logout.text": "#98c379", - "theme.bar.buttons.modules.updates.icon_background": "#c678dd", - "theme.bar.buttons.modules.kbLayout.background": "#21252b", - "theme.bar.buttons.modules.power.background": "#21252b", - "theme.bar.buttons.modules.weather.background": "#21252b", - "theme.bar.menus.menu.power.background.color": "#282c34", - "theme.bar.buttons.modules.ram.background": "#21252b", - "theme.bar.buttons.modules.netstat.icon": "#21252b", - "theme.bar.buttons.modules.cpu.icon_background": "#e06c75", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#98c379", - "theme.bar.buttons.modules.updates.text": "#c678dd", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#282c34", - "theme.bar.menus.menu.power.buttons.restart.background": "#21252b", - "theme.bar.buttons.modules.updates.icon": "#21252b", - "theme.bar.buttons.modules.cpu.text": "#e06c75", - "theme.bar.buttons.modules.netstat.icon_background": "#98c379", - "theme.bar.buttons.modules.kbLayout.text": "#56b6c2", - "theme.bar.buttons.modules.power.border": "#e06c75", - "theme.bar.buttons.modules.weather.border": "#61afef", - "theme.bar.buttons.modules.updates.border": "#c678dd", - "theme.bar.buttons.modules.kbLayout.border": "#56b6c2", - "theme.bar.buttons.modules.netstat.border": "#98c379", - "theme.bar.buttons.modules.storage.border": "#e06c75", - "theme.bar.buttons.modules.cpu.border": "#e06c75", - "theme.bar.buttons.modules.ram.border": "#e5c07b", - "theme.bar.buttons.notifications.border": "#61afef", - "theme.bar.buttons.clock.border": "#98c379", - "theme.bar.buttons.battery.border": "#e5c07b", - "theme.bar.buttons.systray.border": "#4b5263", - "theme.bar.buttons.bluetooth.border": "#61afef", - "theme.bar.buttons.network.border": "#c678dd", - "theme.bar.buttons.volume.border": "#e06c75", - "theme.bar.buttons.media.border": "#61afef", - "theme.bar.buttons.windowtitle.border": "#98c379", - "theme.bar.buttons.workspaces.border": "#21252b", - "theme.bar.buttons.dashboard.border": "#e5c07b", - "theme.bar.buttons.modules.submap.background": "#21252b", - "theme.bar.buttons.modules.submap.text": "#56b6c2", - "theme.bar.buttons.modules.submap.border": "#56b6c2", - "theme.bar.buttons.modules.submap.icon": "#21252b", - "theme.bar.buttons.modules.submap.icon_background": "#56b6c2" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/rose_pine.json b/ags/HyprPanel/themes/rose_pine.json deleted file mode 100644 index 9ccd0a0..0000000 --- a/ags/HyprPanel/themes/rose_pine.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#191724", - "theme.bar.background": "#191724", - "theme.bar.buttons.media.icon": "#c4a7e7", - "theme.bar.buttons.media.text": "#c4a7e7", - "theme.bar.buttons.icon": "#c4a7e7", - "theme.bar.buttons.text": "#c4a7e7", - "theme.bar.buttons.hover": "#26233a", - "theme.bar.buttons.background": "#21202e", - "theme.bar.menus.text": "#e0def4", - "theme.bar.menus.border.color": "#1f1d2e", - "theme.bar.buttons.media.background": "#21202e", - "theme.bar.menus.menu.volume.text": "#e0def4", - "theme.bar.menus.menu.volume.card.color": "#21202e", - "theme.bar.menus.menu.volume.label.color": "#eb6f92", - "theme.bar.menus.popover.text": "#c4a7e7", - "theme.bar.menus.popover.background": "#1f1d2e", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#191724", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#e0def4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#1f1d2e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#191724", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#21202e", - "theme.bar.menus.menu.notifications.switch.puck": "#26233a", - "theme.bar.menus.menu.notifications.switch.disabled": "#1f1d2e", - "theme.bar.menus.menu.notifications.switch.enabled": "#c4a7e7", - "theme.bar.menus.menu.notifications.clear": "#eb6f92", - "theme.bar.menus.menu.notifications.switch_divider": "#26233a", - "theme.bar.menus.menu.notifications.border": "#1f1d2e", - "theme.bar.menus.menu.notifications.card": "#21202e", - "theme.bar.menus.menu.notifications.background": "#191724", - "theme.bar.menus.menu.notifications.no_notifications_label": "#1f1d2e", - "theme.bar.menus.menu.notifications.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#26233a", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#30738f", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#9ccfd8", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eb6f92", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f6c177", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.input.background": "#30738f", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eb6f92", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f6c177", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#9ccfd8", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#403d52", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ccfd8", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f6c177", - "theme.bar.menus.menu.dashboard.profile.name": "#c4a7e7", - "theme.bar.menus.menu.dashboard.border.color": "#1f1d2e", - "theme.bar.menus.menu.dashboard.background.color": "#191724", - "theme.bar.menus.menu.dashboard.card.color": "#21202e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#31748f", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f6c177", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#eb6f92", - "theme.bar.menus.menu.clock.weather.stats": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.status": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.temperature": "#e0def4", - "theme.bar.menus.menu.clock.weather.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#403d52", - "theme.bar.menus.menu.clock.calendar.days": "#e0def4", - "theme.bar.menus.menu.clock.calendar.currentday": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#9ccfd8", - "theme.bar.menus.menu.clock.time.timeperiod": "#9ccfd8", - "theme.bar.menus.menu.clock.time.time": "#c4a7e7", - "theme.bar.menus.menu.clock.text": "#e0def4", - "theme.bar.menus.menu.clock.border.color": "#1f1d2e", - "theme.bar.menus.menu.clock.background.color": "#191724", - "theme.bar.menus.menu.clock.card.color": "#21202e", - "theme.bar.menus.menu.battery.slider.puck": "#26233a", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.battery.slider.background": "#403d52", - "theme.bar.menus.menu.battery.slider.primary": "#f6c177", - "theme.bar.menus.menu.battery.icons.active": "#f6c177", - "theme.bar.menus.menu.battery.icons.passive": "#524f67", - "theme.bar.menus.menu.battery.listitems.active": "#f6c177", - "theme.bar.menus.menu.battery.listitems.passive": "#e0def4", - "theme.bar.menus.menu.battery.text": "#e0def4", - "theme.bar.menus.menu.battery.label.color": "#f6c177", - "theme.bar.menus.menu.battery.border.color": "#1f1d2e", - "theme.bar.menus.menu.battery.background.color": "#191724", - "theme.bar.menus.menu.battery.card.color": "#21202e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#21202e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#e0def4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#191724", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.icons.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.icons.passive": "#524f67", - "theme.bar.menus.menu.bluetooth.listitems.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#26233a", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#1f1d2e", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.switch_divider": "#26233a", - "theme.bar.menus.menu.bluetooth.status": "#26233a", - "theme.bar.menus.menu.bluetooth.text": "#e0def4", - "theme.bar.menus.menu.bluetooth.label.color": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.border.color": "#1f1d2e", - "theme.bar.menus.menu.bluetooth.background.color": "#191724", - "theme.bar.menus.menu.bluetooth.card.color": "#21202e", - "theme.bar.menus.menu.network.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#e0def4", - "theme.bar.menus.menu.network.icons.active": "#c4a7e7", - "theme.bar.menus.menu.network.icons.passive": "#524f67", - "theme.bar.menus.menu.network.listitems.active": "#c4a7e7", - "theme.bar.menus.menu.network.listitems.passive": "#e0def4", - "theme.bar.menus.menu.network.status.color": "#26233a", - "theme.bar.menus.menu.network.text": "#e0def4", - "theme.bar.menus.menu.network.label.color": "#c4a7e7", - "theme.bar.menus.menu.network.border.color": "#1f1d2e", - "theme.bar.menus.menu.network.background.color": "#191724", - "theme.bar.menus.menu.network.card.color": "#21202e", - "theme.bar.menus.menu.volume.input_slider.puck": "#403d52", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.volume.input_slider.background": "#403d52", - "theme.bar.menus.menu.volume.input_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.audio_slider.puck": "#403d52", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.volume.audio_slider.background": "#403d52", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.icons.active": "#eb6f92", - "theme.bar.menus.menu.volume.icons.passive": "#524f67", - "theme.bar.menus.menu.volume.iconbutton.active": "#eb6f92", - "theme.bar.menus.menu.volume.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.volume.listitems.active": "#eb6f92", - "theme.bar.menus.menu.volume.listitems.passive": "#e0def4", - "theme.bar.menus.menu.volume.border.color": "#1f1d2e", - "theme.bar.menus.menu.volume.background.color": "#191724", - "theme.bar.menus.menu.media.slider.puck": "#26233a", - "theme.bar.menus.menu.media.slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.media.slider.background": "#403d52", - "theme.bar.menus.menu.media.slider.primary": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.text": "#191724", - "theme.bar.menus.menu.media.buttons.background": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.enabled": "#9ccfd8", - "theme.bar.menus.menu.media.buttons.inactive": "#403d52", - "theme.bar.menus.menu.media.border.color": "#1f1d2e", - "theme.bar.menus.menu.media.background.color": "#191724", - "theme.bar.menus.menu.media.album": "#c4a7e7", - "theme.bar.menus.menu.media.artist": "#9ccfd8", - "theme.bar.menus.menu.media.song": "#c4a7e7", - "theme.bar.menus.tooltip.text": "#e0def4", - "theme.bar.menus.tooltip.background": "#191724", - "theme.bar.menus.dropdownmenu.divider": "#21202e", - "theme.bar.menus.dropdownmenu.text": "#e0def4", - "theme.bar.menus.dropdownmenu.background": "#191724", - "theme.bar.menus.slider.puck": "#26233a", - "theme.bar.menus.slider.backgroundhover": "#26233a", - "theme.bar.menus.slider.background": "#403d52", - "theme.bar.menus.slider.primary": "#c4a7e7", - "theme.bar.menus.progressbar.background": "#26233a", - "theme.bar.menus.progressbar.foreground": "#c4a7e7", - "theme.bar.menus.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.iconbuttons.passive": "#e0def4", - "theme.bar.menus.buttons.text": "#1f1d2e", - "theme.bar.menus.buttons.disabled": "#403d52", - "theme.bar.menus.buttons.active": "#c4a7e7", - "theme.bar.menus.buttons.default": "#c4a7e7", - "theme.bar.menus.switch.puck": "#26233a", - "theme.bar.menus.switch.disabled": "#1f1d2e", - "theme.bar.menus.switch.enabled": "#c4a7e7", - "theme.bar.menus.icons.active": "#c4a7e7", - "theme.bar.menus.icons.passive": "#403d52", - "theme.bar.menus.listitems.active": "#c4a7e7", - "theme.bar.menus.listitems.passive": "#e0def4", - "theme.bar.menus.label": "#c4a7e7", - "theme.bar.menus.feinttext": "#1f1d2e", - "theme.bar.menus.dimtext": "#403d52", - "theme.bar.menus.cards": "#21202e", - "theme.bar.buttons.notifications.total": "#c4a7e7", - "theme.bar.buttons.notifications.icon": "#c4a7e7", - "theme.bar.buttons.notifications.background": "#21202e", - "theme.bar.buttons.clock.icon": "#c4a7e7", - "theme.bar.buttons.clock.text": "#c4a7e7", - "theme.bar.buttons.clock.background": "#21202e", - "theme.bar.buttons.battery.icon": "#f6c177", - "theme.bar.buttons.battery.text": "#f6c177", - "theme.bar.buttons.battery.background": "#21202e", - "theme.bar.buttons.systray.background": "#21202e", - "theme.bar.buttons.bluetooth.icon": "#9ccfd8", - "theme.bar.buttons.bluetooth.text": "#9ccfd8", - "theme.bar.buttons.bluetooth.background": "#21202e", - "theme.bar.buttons.network.icon": "#c4a7e7", - "theme.bar.buttons.network.text": "#c4a7e7", - "theme.bar.buttons.network.background": "#21202e", - "theme.bar.buttons.volume.icon": "#eb6f92", - "theme.bar.buttons.volume.text": "#eb6f92", - "theme.bar.buttons.volume.background": "#21202e", - "theme.bar.buttons.windowtitle.icon": "#c4a7e7", - "theme.bar.buttons.windowtitle.text": "#c4a7e7", - "theme.bar.buttons.windowtitle.background": "#21202e", - "theme.bar.buttons.workspaces.active": "#c4a7e7", - "theme.bar.buttons.workspaces.occupied": "#eb6f92", - "theme.bar.buttons.workspaces.available": "#9ccfd8", - "theme.bar.buttons.workspaces.hover": "#26233a", - "theme.bar.buttons.workspaces.background": "#21202e", - "theme.bar.buttons.dashboard.icon": "#f6c177", - "theme.bar.buttons.dashboard.background": "#21202e", - "theme.osd.label": "#c4a7e7", - "theme.osd.icon": "#191724", - "theme.osd.bar_overflow_color": "#eb6f92", - "theme.osd.bar_empty_color": "#1f1d2e", - "theme.osd.bar_color": "#c4a7e7", - "theme.osd.icon_container": "#c4a7e7", - "theme.osd.bar_container": "#191724", - "theme.notification.close_button.label": "#191724", - "theme.notification.close_button.background": "#eb6f92", - "theme.notification.labelicon": "#c4a7e7", - "theme.notification.text": "#e0def4", - "theme.notification.time": "#403d52", - "theme.notification.border": "#1f1d2e", - "theme.notification.label": "#c4a7e7", - "theme.notification.actions.text": "#1f1d2e", - "theme.notification.actions.background": "#c4a7e7", - "theme.notification.background": "#1f1d2e", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#21202e", - "theme.bar.menus.check_radio_button.background": "#393452", - "theme.bar.menus.check_radio_button.active": "#c4a7e7", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#c4a7e7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.label": "#524f67", - "theme.bar.menus.menu.notifications.pager.background": "#191724", - "theme.bar.buttons.clock.icon_background": "#c4a7e7", - "theme.bar.buttons.modules.ram.icon": "#f6c177", - "theme.bar.buttons.modules.storage.icon_background": "#eb6f92", - "theme.bar.menus.popover.border": "#1f1d2e", - "theme.bar.buttons.volume.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#9ccfd8", - "theme.bar.menus.menu.power.buttons.restart.text": "#f6c177", - "theme.bar.buttons.modules.updates.background": "#21202e", - "theme.bar.buttons.modules.storage.icon": "#eb6f92", - "theme.bar.buttons.modules.netstat.background": "#21202e", - "theme.bar.buttons.modules.weather.icon": "#c4a7e7", - "theme.bar.buttons.modules.netstat.text": "#9ccfd8", - "theme.bar.buttons.modules.storage.background": "#21202e", - "theme.bar.buttons.modules.power.icon": "#eb6f92", - "theme.bar.buttons.modules.storage.text": "#eb6f92", - "theme.bar.buttons.modules.cpu.background": "#21202e", - "theme.bar.menus.menu.power.border.color": "#1f1d2e", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.restart.icon": "#1f1d2e", - "theme.bar.buttons.modules.cpu.icon": "#eb6f92", - "theme.bar.buttons.battery.icon_background": "#f6c177", - "theme.bar.buttons.modules.kbLayout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.weather.text": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.sleep.text": "#9ccfd8", - "theme.bar.buttons.modules.weather.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#21202e", - "theme.bar.buttons.media.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.logout.background": "#21202e", - "theme.bar.buttons.modules.kbLayout.icon": "#9ccfd8", - "theme.bar.buttons.modules.ram.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#eb6f92", - "theme.bar.menus.menu.power.buttons.sleep.background": "#21202e", - "theme.bar.buttons.modules.ram.text": "#f6c177", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ccfd8", - "theme.bar.buttons.modules.updates.icon_background": "#30738f", - "theme.bar.buttons.modules.kbLayout.background": "#21202e", - "theme.bar.buttons.modules.power.background": "#21202e", - "theme.bar.buttons.modules.weather.background": "#21202e", - "theme.bar.buttons.icon_background": "#21202e", - "theme.bar.menus.menu.power.background.color": "#191724", - "theme.bar.buttons.modules.ram.background": "#21202e", - "theme.bar.buttons.modules.netstat.icon": "#9ccfd8", - "theme.bar.buttons.windowtitle.icon_background": "#c4a7e7", - "theme.bar.buttons.modules.cpu.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.updates.text": "#30738f", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#1f1d2e", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#21202e", - "theme.bar.buttons.modules.updates.icon": "#30738f", - "theme.bar.buttons.modules.cpu.text": "#eb6f92", - "theme.bar.buttons.modules.netstat.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.kbLayout.text": "#9ccfd8", - "theme.bar.buttons.notifications.icon_background": "#c4a7e7", - "theme.bar.buttons.modules.power.border": "#eb6f92", - "theme.bar.buttons.modules.weather.border": "#c4a7e7", - "theme.bar.buttons.modules.updates.border": "#30738f", - "theme.bar.buttons.modules.kbLayout.border": "#9ccfd8", - "theme.bar.buttons.modules.netstat.border": "#9ccfd8", - "theme.bar.buttons.modules.storage.border": "#eb6f92", - "theme.bar.buttons.modules.cpu.border": "#eb6f92", - "theme.bar.buttons.modules.ram.border": "#f6c177", - "theme.bar.buttons.notifications.border": "#c4a7e7", - "theme.bar.buttons.clock.border": "#c4a7e7", - "theme.bar.buttons.battery.border": "#f6c177", - "theme.bar.buttons.systray.border": "#26233a", - "theme.bar.buttons.bluetooth.border": "#9ccfd8", - "theme.bar.buttons.network.border": "#c4a7e7", - "theme.bar.buttons.volume.border": "#eb6f92", - "theme.bar.buttons.media.border": "#c4a7e7", - "theme.bar.buttons.windowtitle.border": "#c4a7e7", - "theme.bar.buttons.workspaces.border": "#1f1d2e", - "theme.bar.buttons.dashboard.border": "#f6c177", - "theme.bar.buttons.modules.submap.background": "#21202e", - "theme.bar.buttons.modules.submap.text": "#9ccfd8", - "theme.bar.buttons.modules.submap.border": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon_background": "#21202e" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/rose_pine_moon.json b/ags/HyprPanel/themes/rose_pine_moon.json deleted file mode 100644 index 1c0a5ca..0000000 --- a/ags/HyprPanel/themes/rose_pine_moon.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#232136", - "theme.bar.background": "#232136", - "theme.bar.buttons.media.icon": "#c4a7e7", - "theme.bar.buttons.media.text": "#c4a7e7", - "theme.bar.buttons.icon": "#c4a7e7", - "theme.bar.buttons.text": "#c4a7e7", - "theme.bar.buttons.hover": "#393552", - "theme.bar.buttons.background": "#2a283e", - "theme.bar.menus.text": "#e0def4", - "theme.bar.menus.border.color": "#2a273f", - "theme.bar.buttons.media.background": "#2a283e", - "theme.bar.menus.menu.volume.text": "#e0def4", - "theme.bar.menus.menu.volume.card.color": "#2a283e", - "theme.bar.menus.menu.volume.label.color": "#eb6f92", - "theme.bar.menus.popover.text": "#c4a7e7", - "theme.bar.menus.popover.background": "#2a273f", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#232136", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#e0def4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#2a273f", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#232136", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#2a283e", - "theme.bar.menus.menu.notifications.switch.puck": "#393552", - "theme.bar.menus.menu.notifications.switch.disabled": "#2a273f", - "theme.bar.menus.menu.notifications.switch.enabled": "#c4a7e7", - "theme.bar.menus.menu.notifications.clear": "#eb6f92", - "theme.bar.menus.menu.notifications.switch_divider": "#393552", - "theme.bar.menus.menu.notifications.border": "#2a273f", - "theme.bar.menus.menu.notifications.card": "#2a283e", - "theme.bar.menus.menu.notifications.background": "#232136", - "theme.bar.menus.menu.notifications.no_notifications_label": "#2a273f", - "theme.bar.menus.menu.notifications.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#393552", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#3e8eb0", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#9ccfd8", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eb6f92", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f6c177", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.input.background": "#3e8eb0", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eb6f92", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f6c177", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#9ccfd8", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#44415a", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ccfd8", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#2a273f", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f6c177", - "theme.bar.menus.menu.dashboard.profile.name": "#c4a7e7", - "theme.bar.menus.menu.dashboard.border.color": "#2a273f", - "theme.bar.menus.menu.dashboard.background.color": "#232136", - "theme.bar.menus.menu.dashboard.card.color": "#2a283e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#3e8fb0", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f6c177", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#eb6f92", - "theme.bar.menus.menu.clock.weather.stats": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.status": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.temperature": "#e0def4", - "theme.bar.menus.menu.clock.weather.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#44415a", - "theme.bar.menus.menu.clock.calendar.days": "#e0def4", - "theme.bar.menus.menu.clock.calendar.currentday": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#9ccfd8", - "theme.bar.menus.menu.clock.time.timeperiod": "#9ccfd8", - "theme.bar.menus.menu.clock.time.time": "#c4a7e7", - "theme.bar.menus.menu.clock.text": "#e0def4", - "theme.bar.menus.menu.clock.border.color": "#2a273f", - "theme.bar.menus.menu.clock.background.color": "#232136", - "theme.bar.menus.menu.clock.card.color": "#2a283e", - "theme.bar.menus.menu.battery.slider.puck": "#393552", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#393552", - "theme.bar.menus.menu.battery.slider.background": "#44415a", - "theme.bar.menus.menu.battery.slider.primary": "#f6c177", - "theme.bar.menus.menu.battery.icons.active": "#f6c177", - "theme.bar.menus.menu.battery.icons.passive": "#56526e", - "theme.bar.menus.menu.battery.listitems.active": "#f6c177", - "theme.bar.menus.menu.battery.listitems.passive": "#e0def4", - "theme.bar.menus.menu.battery.text": "#e0def4", - "theme.bar.menus.menu.battery.label.color": "#f6c177", - "theme.bar.menus.menu.battery.border.color": "#2a273f", - "theme.bar.menus.menu.battery.background.color": "#232136", - "theme.bar.menus.menu.battery.card.color": "#2a283e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#2a283e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#e0def4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#232136", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.icons.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.icons.passive": "#56526e", - "theme.bar.menus.menu.bluetooth.listitems.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#393552", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2a273f", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.switch_divider": "#393552", - "theme.bar.menus.menu.bluetooth.status": "#393552", - "theme.bar.menus.menu.bluetooth.text": "#e0def4", - "theme.bar.menus.menu.bluetooth.label.color": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.border.color": "#2a273f", - "theme.bar.menus.menu.bluetooth.background.color": "#232136", - "theme.bar.menus.menu.bluetooth.card.color": "#2a283e", - "theme.bar.menus.menu.network.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#e0def4", - "theme.bar.menus.menu.network.icons.active": "#c4a7e7", - "theme.bar.menus.menu.network.icons.passive": "#56526e", - "theme.bar.menus.menu.network.listitems.active": "#c4a7e7", - "theme.bar.menus.menu.network.listitems.passive": "#e0def4", - "theme.bar.menus.menu.network.status.color": "#393552", - "theme.bar.menus.menu.network.text": "#e0def4", - "theme.bar.menus.menu.network.label.color": "#c4a7e7", - "theme.bar.menus.menu.network.border.color": "#2a273f", - "theme.bar.menus.menu.network.background.color": "#232136", - "theme.bar.menus.menu.network.card.color": "#2a283e", - "theme.bar.menus.menu.volume.input_slider.puck": "#44415a", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#393552", - "theme.bar.menus.menu.volume.input_slider.background": "#44415a", - "theme.bar.menus.menu.volume.input_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.audio_slider.puck": "#44415a", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#393552", - "theme.bar.menus.menu.volume.audio_slider.background": "#44415a", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.icons.active": "#eb6f92", - "theme.bar.menus.menu.volume.icons.passive": "#56526e", - "theme.bar.menus.menu.volume.iconbutton.active": "#eb6f92", - "theme.bar.menus.menu.volume.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.volume.listitems.active": "#eb6f92", - "theme.bar.menus.menu.volume.listitems.passive": "#e0def4", - "theme.bar.menus.menu.volume.border.color": "#2a273f", - "theme.bar.menus.menu.volume.background.color": "#232136", - "theme.bar.menus.menu.media.slider.puck": "#393552", - "theme.bar.menus.menu.media.slider.backgroundhover": "#393552", - "theme.bar.menus.menu.media.slider.background": "#44415a", - "theme.bar.menus.menu.media.slider.primary": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.text": "#232136", - "theme.bar.menus.menu.media.buttons.background": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.enabled": "#9ccfd8", - "theme.bar.menus.menu.media.buttons.inactive": "#44415a", - "theme.bar.menus.menu.media.border.color": "#2a273f", - "theme.bar.menus.menu.media.background.color": "#232136", - "theme.bar.menus.menu.media.album": "#c4a7e7", - "theme.bar.menus.menu.media.artist": "#9ccfd8", - "theme.bar.menus.menu.media.song": "#c4a7e7", - "theme.bar.menus.tooltip.text": "#e0def4", - "theme.bar.menus.tooltip.background": "#232136", - "theme.bar.menus.dropdownmenu.divider": "#2a283e", - "theme.bar.menus.dropdownmenu.text": "#e0def4", - "theme.bar.menus.dropdownmenu.background": "#232136", - "theme.bar.menus.slider.puck": "#393552", - "theme.bar.menus.slider.backgroundhover": "#393552", - "theme.bar.menus.slider.background": "#44415a", - "theme.bar.menus.slider.primary": "#c4a7e7", - "theme.bar.menus.progressbar.background": "#393552", - "theme.bar.menus.progressbar.foreground": "#c4a7e7", - "theme.bar.menus.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.iconbuttons.passive": "#e0def4", - "theme.bar.menus.buttons.text": "#2a273f", - "theme.bar.menus.buttons.disabled": "#44415a", - "theme.bar.menus.buttons.active": "#c4a7e7", - "theme.bar.menus.buttons.default": "#c4a7e7", - "theme.bar.menus.switch.puck": "#393552", - "theme.bar.menus.switch.disabled": "#2a273f", - "theme.bar.menus.switch.enabled": "#c4a7e7", - "theme.bar.menus.icons.active": "#c4a7e7", - "theme.bar.menus.icons.passive": "#44415a", - "theme.bar.menus.listitems.active": "#c4a7e7", - "theme.bar.menus.listitems.passive": "#e0def4", - "theme.bar.menus.label": "#c4a7e7", - "theme.bar.menus.feinttext": "#2a273f", - "theme.bar.menus.dimtext": "#44415a", - "theme.bar.menus.cards": "#2a283e", - "theme.bar.buttons.notifications.total": "#c4a7e7", - "theme.bar.buttons.notifications.icon": "#c4a7e7", - "theme.bar.buttons.notifications.background": "#2a283e", - "theme.bar.buttons.clock.icon": "#c4a7e7", - "theme.bar.buttons.clock.text": "#c4a7e7", - "theme.bar.buttons.clock.background": "#2a283e", - "theme.bar.buttons.battery.icon": "#f6c177", - "theme.bar.buttons.battery.text": "#f6c177", - "theme.bar.buttons.battery.background": "#2a283e", - "theme.bar.buttons.systray.background": "#2a283e", - "theme.bar.buttons.bluetooth.icon": "#9ccfd8", - "theme.bar.buttons.bluetooth.text": "#9ccfd8", - "theme.bar.buttons.bluetooth.background": "#2a283e", - "theme.bar.buttons.network.icon": "#c4a7e7", - "theme.bar.buttons.network.text": "#c4a7e7", - "theme.bar.buttons.network.background": "#2a283e", - "theme.bar.buttons.volume.icon": "#eb6f92", - "theme.bar.buttons.volume.text": "#eb6f92", - "theme.bar.buttons.volume.background": "#2a283e", - "theme.bar.buttons.windowtitle.icon": "#c4a7e7", - "theme.bar.buttons.windowtitle.text": "#c4a7e7", - "theme.bar.buttons.windowtitle.background": "#2a283e", - "theme.bar.buttons.workspaces.active": "#c4a7e7", - "theme.bar.buttons.workspaces.occupied": "#eb6f92", - "theme.bar.buttons.workspaces.available": "#9ccfd8", - "theme.bar.buttons.workspaces.hover": "#393552", - "theme.bar.buttons.workspaces.background": "#2a283e", - "theme.bar.buttons.dashboard.icon": "#f6c177", - "theme.bar.buttons.dashboard.background": "#2a283e", - "theme.osd.label": "#c4a7e7", - "theme.osd.icon": "#232136", - "theme.osd.bar_overflow_color": "#eb6f92", - "theme.osd.bar_empty_color": "#2a273f", - "theme.osd.bar_color": "#c4a7e7", - "theme.osd.icon_container": "#c4a7e7", - "theme.osd.bar_container": "#232136", - "theme.notification.close_button.label": "#232136", - "theme.notification.close_button.background": "#eb6f92", - "theme.notification.labelicon": "#c4a7e7", - "theme.notification.text": "#e0def4", - "theme.notification.time": "#56526e", - "theme.notification.border": "#2a273f", - "theme.notification.label": "#c4a7e7", - "theme.notification.actions.text": "#2a273f", - "theme.notification.actions.background": "#c4a7e7", - "theme.notification.background": "#2a273f", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#2a283e", - "theme.bar.menus.check_radio_button.background": "#393452", - "theme.bar.menus.check_radio_button.active": "#c4a7e7", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#c4a7e7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.label": "#56526e", - "theme.bar.menus.menu.notifications.pager.background": "#232136", - "theme.bar.buttons.modules.ram.icon": "#f6c177", - "theme.bar.buttons.modules.storage.icon_background": "#2a283e", - "theme.bar.buttons.modules.storage.icon": "#c4a7e7", - "theme.bar.buttons.modules.weather.icon": "#c4a7e7", - "theme.bar.buttons.modules.power.icon": "#eb6f92", - "theme.bar.menus.menu.power.border.color": "#2a273f", - "theme.bar.buttons.modules.power.icon_background": "#2a283e", - "theme.bar.buttons.modules.cpu.icon": "#eb6f92", - "theme.bar.buttons.modules.kbLayout.icon_background": "#2a283e", - "theme.bar.buttons.modules.weather.text": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#2a273f", - "theme.bar.buttons.modules.weather.icon_background": "#2a283e", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#2a283e", - "theme.bar.buttons.modules.kbLayout.icon": "#9ccfd8", - "theme.bar.buttons.modules.ram.icon_background": "#2a283e", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#eb6f92", - "theme.bar.buttons.modules.updates.icon_background": "#2a283e", - "theme.bar.menus.menu.power.background.color": "#232136", - "theme.bar.buttons.modules.netstat.icon": "#9ccfd8", - "theme.bar.buttons.modules.cpu.icon_background": "#2a283e", - "theme.bar.buttons.modules.updates.icon": "#3e8eb0", - "theme.bar.buttons.modules.netstat.icon_background": "#2a283e", - "theme.bar.buttons.clock.icon_background": "#c4a7e7", - "theme.bar.menus.popover.border": "#2a273f", - "theme.bar.buttons.volume.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#9ccfd8", - "theme.bar.menus.menu.power.buttons.restart.text": "#f6c177", - "theme.bar.buttons.modules.updates.background": "#2a283e", - "theme.bar.buttons.modules.netstat.background": "#2a283e", - "theme.bar.buttons.modules.netstat.text": "#9ccfd8", - "theme.bar.buttons.modules.storage.background": "#2a283e", - "theme.bar.buttons.modules.storage.text": "#eb6f92", - "theme.bar.buttons.modules.cpu.background": "#2a283e", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.menus.menu.power.buttons.logout.icon": "#2a273f", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.restart.icon": "#2a273f", - "theme.bar.buttons.battery.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.sleep.text": "#9ccfd8", - "theme.bar.buttons.media.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.logout.background": "#2a283e", - "theme.bar.menus.menu.power.buttons.sleep.background": "#2a283e", - "theme.bar.buttons.modules.ram.text": "#f6c177", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ccfd8", - "theme.bar.buttons.modules.kbLayout.background": "#2a283e", - "theme.bar.buttons.modules.power.background": "#2a283e", - "theme.bar.buttons.modules.weather.background": "#2a283e", - "theme.bar.buttons.icon_background": "#2a283e", - "theme.bar.buttons.modules.ram.background": "#2a283e", - "theme.bar.buttons.windowtitle.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.updates.text": "#3e8eb0", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#2a273f", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#2a283e", - "theme.bar.buttons.modules.cpu.text": "#eb6f92", - "theme.bar.buttons.modules.kbLayout.text": "#9ccfd8", - "theme.bar.buttons.notifications.icon_background": "#c4a7e7", - "theme.bar.buttons.modules.power.border": "#eb6f92", - "theme.bar.buttons.modules.weather.border": "#c4a7e7", - "theme.bar.buttons.modules.updates.border": "#30738f", - "theme.bar.buttons.modules.kbLayout.border": "#9ccfd8", - "theme.bar.buttons.modules.netstat.border": "#9ccfd8", - "theme.bar.buttons.modules.storage.border": "#eb6f92", - "theme.bar.buttons.modules.cpu.border": "#eb6f92", - "theme.bar.buttons.modules.ram.border": "#f6c177", - "theme.bar.buttons.notifications.border": "#c4a7e7", - "theme.bar.buttons.clock.border": "#c4a7e7", - "theme.bar.buttons.battery.border": "#f6c177", - "theme.bar.buttons.systray.border": "#26233a", - "theme.bar.buttons.bluetooth.border": "#9ccfd8", - "theme.bar.buttons.network.border": "#c4a7e7", - "theme.bar.buttons.volume.border": "#eb6f92", - "theme.bar.buttons.media.border": "#c4a7e7", - "theme.bar.buttons.windowtitle.border": "#c4a7e7", - "theme.bar.buttons.workspaces.border": "#1f1d2e", - "theme.bar.buttons.dashboard.border": "#f6c177", - "theme.bar.buttons.modules.submap.background": "#2a283e", - "theme.bar.buttons.modules.submap.text": "#9ccfd8", - "theme.bar.buttons.modules.submap.border": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon_background": "#2a283e" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/rose_pine_moon_split.json b/ags/HyprPanel/themes/rose_pine_moon_split.json deleted file mode 100644 index bbf84e8..0000000 --- a/ags/HyprPanel/themes/rose_pine_moon_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#232136", - "theme.bar.background": "#232136", - "theme.bar.buttons.media.icon": "#2a283e", - "theme.bar.buttons.media.text": "#c4a7e7", - "theme.bar.buttons.icon": "#c4a7e7", - "theme.bar.buttons.text": "#c4a7e7", - "theme.bar.buttons.hover": "#393552", - "theme.bar.buttons.background": "#2a283e", - "theme.bar.menus.text": "#e0def4", - "theme.bar.menus.border.color": "#2a273f", - "theme.bar.buttons.media.background": "#2a283e", - "theme.bar.menus.menu.volume.text": "#e0def4", - "theme.bar.menus.menu.volume.card.color": "#2a283e", - "theme.bar.menus.menu.volume.label.color": "#eb6f92", - "theme.bar.menus.popover.text": "#c4a7e7", - "theme.bar.menus.popover.background": "#2a273f", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#232136", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#e0def4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#2a273f", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#232136", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#2a283e", - "theme.bar.menus.menu.notifications.switch.puck": "#393552", - "theme.bar.menus.menu.notifications.switch.disabled": "#2a273f", - "theme.bar.menus.menu.notifications.switch.enabled": "#c4a7e7", - "theme.bar.menus.menu.notifications.clear": "#eb6f92", - "theme.bar.menus.menu.notifications.switch_divider": "#393552", - "theme.bar.menus.menu.notifications.border": "#2a273f", - "theme.bar.menus.menu.notifications.card": "#2a283e", - "theme.bar.menus.menu.notifications.background": "#232136", - "theme.bar.menus.menu.notifications.no_notifications_label": "#2a273f", - "theme.bar.menus.menu.notifications.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#393552", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#3e8eb0", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#9ccfd8", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eb6f92", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f6c177", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.input.background": "#3e8eb0", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eb6f92", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f6c177", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#9ccfd8", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#2a273f", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#44415a", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ccfd8", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#2a273f", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f6c177", - "theme.bar.menus.menu.dashboard.profile.name": "#c4a7e7", - "theme.bar.menus.menu.dashboard.border.color": "#2a273f", - "theme.bar.menus.menu.dashboard.background.color": "#232136", - "theme.bar.menus.menu.dashboard.card.color": "#2a283e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#3e8fb0", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f6c177", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#eb6f92", - "theme.bar.menus.menu.clock.weather.stats": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.status": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.temperature": "#e0def4", - "theme.bar.menus.menu.clock.weather.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#44415a", - "theme.bar.menus.menu.clock.calendar.days": "#e0def4", - "theme.bar.menus.menu.clock.calendar.currentday": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#9ccfd8", - "theme.bar.menus.menu.clock.time.timeperiod": "#9ccfd8", - "theme.bar.menus.menu.clock.time.time": "#c4a7e7", - "theme.bar.menus.menu.clock.text": "#e0def4", - "theme.bar.menus.menu.clock.border.color": "#2a273f", - "theme.bar.menus.menu.clock.background.color": "#232136", - "theme.bar.menus.menu.clock.card.color": "#2a283e", - "theme.bar.menus.menu.battery.slider.puck": "#393552", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#393552", - "theme.bar.menus.menu.battery.slider.background": "#44415a", - "theme.bar.menus.menu.battery.slider.primary": "#f6c177", - "theme.bar.menus.menu.battery.icons.active": "#f6c177", - "theme.bar.menus.menu.battery.icons.passive": "#56526e", - "theme.bar.menus.menu.battery.listitems.active": "#f6c177", - "theme.bar.menus.menu.battery.listitems.passive": "#e0def4", - "theme.bar.menus.menu.battery.text": "#e0def4", - "theme.bar.menus.menu.battery.label.color": "#f6c177", - "theme.bar.menus.menu.battery.border.color": "#2a273f", - "theme.bar.menus.menu.battery.background.color": "#232136", - "theme.bar.menus.menu.battery.card.color": "#2a283e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#2a283e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#e0def4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#232136", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.icons.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.icons.passive": "#56526e", - "theme.bar.menus.menu.bluetooth.listitems.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#393552", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#2a273f", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.switch_divider": "#393552", - "theme.bar.menus.menu.bluetooth.status": "#393552", - "theme.bar.menus.menu.bluetooth.text": "#e0def4", - "theme.bar.menus.menu.bluetooth.label.color": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.border.color": "#2a273f", - "theme.bar.menus.menu.bluetooth.background.color": "#232136", - "theme.bar.menus.menu.bluetooth.card.color": "#2a283e", - "theme.bar.menus.menu.network.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#e0def4", - "theme.bar.menus.menu.network.icons.active": "#c4a7e7", - "theme.bar.menus.menu.network.icons.passive": "#56526e", - "theme.bar.menus.menu.network.listitems.active": "#c4a7e7", - "theme.bar.menus.menu.network.listitems.passive": "#e0def4", - "theme.bar.menus.menu.network.status.color": "#393552", - "theme.bar.menus.menu.network.text": "#e0def4", - "theme.bar.menus.menu.network.label.color": "#c4a7e7", - "theme.bar.menus.menu.network.border.color": "#2a273f", - "theme.bar.menus.menu.network.background.color": "#232136", - "theme.bar.menus.menu.network.card.color": "#2a283e", - "theme.bar.menus.menu.volume.input_slider.puck": "#44415a", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#393552", - "theme.bar.menus.menu.volume.input_slider.background": "#44415a", - "theme.bar.menus.menu.volume.input_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.audio_slider.puck": "#44415a", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#393552", - "theme.bar.menus.menu.volume.audio_slider.background": "#44415a", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.icons.active": "#eb6f92", - "theme.bar.menus.menu.volume.icons.passive": "#56526e", - "theme.bar.menus.menu.volume.iconbutton.active": "#eb6f92", - "theme.bar.menus.menu.volume.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.volume.listitems.active": "#eb6f92", - "theme.bar.menus.menu.volume.listitems.passive": "#e0def4", - "theme.bar.menus.menu.volume.border.color": "#2a273f", - "theme.bar.menus.menu.volume.background.color": "#232136", - "theme.bar.menus.menu.media.slider.puck": "#393552", - "theme.bar.menus.menu.media.slider.backgroundhover": "#393552", - "theme.bar.menus.menu.media.slider.background": "#44415a", - "theme.bar.menus.menu.media.slider.primary": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.text": "#232136", - "theme.bar.menus.menu.media.buttons.background": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.enabled": "#9ccfd8", - "theme.bar.menus.menu.media.buttons.inactive": "#44415a", - "theme.bar.menus.menu.media.border.color": "#2a273f", - "theme.bar.menus.menu.media.background.color": "#232136", - "theme.bar.menus.menu.media.album": "#c4a7e7", - "theme.bar.menus.menu.media.artist": "#9ccfd8", - "theme.bar.menus.menu.media.song": "#c4a7e7", - "theme.bar.menus.tooltip.text": "#e0def4", - "theme.bar.menus.tooltip.background": "#232136", - "theme.bar.menus.dropdownmenu.divider": "#2a283e", - "theme.bar.menus.dropdownmenu.text": "#e0def4", - "theme.bar.menus.dropdownmenu.background": "#232136", - "theme.bar.menus.slider.puck": "#393552", - "theme.bar.menus.slider.backgroundhover": "#393552", - "theme.bar.menus.slider.background": "#44415a", - "theme.bar.menus.slider.primary": "#c4a7e7", - "theme.bar.menus.progressbar.background": "#393552", - "theme.bar.menus.progressbar.foreground": "#c4a7e7", - "theme.bar.menus.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.iconbuttons.passive": "#e0def4", - "theme.bar.menus.buttons.text": "#2a273f", - "theme.bar.menus.buttons.disabled": "#44415a", - "theme.bar.menus.buttons.active": "#c4a7e7", - "theme.bar.menus.buttons.default": "#c4a7e7", - "theme.bar.menus.switch.puck": "#393552", - "theme.bar.menus.switch.disabled": "#2a273f", - "theme.bar.menus.switch.enabled": "#c4a7e7", - "theme.bar.menus.icons.active": "#c4a7e7", - "theme.bar.menus.icons.passive": "#44415a", - "theme.bar.menus.listitems.active": "#c4a7e7", - "theme.bar.menus.listitems.passive": "#e0def4", - "theme.bar.menus.label": "#c4a7e7", - "theme.bar.menus.feinttext": "#2a273f", - "theme.bar.menus.dimtext": "#44415a", - "theme.bar.menus.cards": "#2a283e", - "theme.bar.buttons.notifications.total": "#c4a7e7", - "theme.bar.buttons.notifications.icon": "#2a283e", - "theme.bar.buttons.notifications.background": "#2a283e", - "theme.bar.buttons.clock.icon": "#2a283e", - "theme.bar.buttons.clock.text": "#c4a7e7", - "theme.bar.buttons.clock.background": "#2a283e", - "theme.bar.buttons.battery.icon": "#2a283e", - "theme.bar.buttons.battery.text": "#f6c177", - "theme.bar.buttons.battery.background": "#2a283e", - "theme.bar.buttons.systray.background": "#2a283e", - "theme.bar.buttons.bluetooth.icon": "#2a283e", - "theme.bar.buttons.bluetooth.text": "#9ccfd8", - "theme.bar.buttons.bluetooth.background": "#2a283e", - "theme.bar.buttons.network.icon": "#2a283e", - "theme.bar.buttons.network.text": "#c4a7e7", - "theme.bar.buttons.network.background": "#2a283e", - "theme.bar.buttons.volume.icon": "#2a283e", - "theme.bar.buttons.volume.text": "#eb6f92", - "theme.bar.buttons.volume.background": "#2a283e", - "theme.bar.buttons.windowtitle.icon": "#2a283e", - "theme.bar.buttons.windowtitle.text": "#c4a7e7", - "theme.bar.buttons.windowtitle.background": "#2a283e", - "theme.bar.buttons.workspaces.active": "#c4a7e7", - "theme.bar.buttons.workspaces.occupied": "#eb6f92", - "theme.bar.buttons.workspaces.available": "#9ccfd8", - "theme.bar.buttons.workspaces.hover": "#c4a7e7", - "theme.bar.buttons.workspaces.background": "#2a283e", - "theme.bar.buttons.dashboard.icon": "#2a283e", - "theme.bar.buttons.dashboard.background": "#f6c177", - "theme.osd.label": "#c4a7e7", - "theme.osd.icon": "#232136", - "theme.osd.bar_overflow_color": "#eb6f92", - "theme.osd.bar_empty_color": "#2a273f", - "theme.osd.bar_color": "#c4a7e7", - "theme.osd.icon_container": "#c4a7e7", - "theme.osd.bar_container": "#232136", - "theme.notification.close_button.label": "#232136", - "theme.notification.close_button.background": "#eb6f92", - "theme.notification.labelicon": "#c4a7e7", - "theme.notification.text": "#e0def4", - "theme.notification.time": "#56526e", - "theme.notification.border": "#2a273f", - "theme.notification.label": "#c4a7e7", - "theme.notification.actions.text": "#2a273f", - "theme.notification.actions.background": "#c4a7e7", - "theme.notification.background": "#2a273f", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#2a283e", - "theme.bar.menus.check_radio_button.background": "#393452", - "theme.bar.menus.check_radio_button.active": "#c4a7e7", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#eb6f92", - "theme.bar.buttons.network.icon_background": "#c4a7e7", - "theme.bar.buttons.bluetooth.icon_background": "#9ccfd8", - "theme.bar.buttons.windowtitle.icon_background": "#c4a7e7", - "theme.bar.buttons.media.icon_background": "#c4a7e7", - "theme.bar.buttons.notifications.icon_background": "#c4a7e7", - "theme.bar.buttons.battery.icon_background": "#f6c177", - "theme.bar.buttons.clock.icon_background": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.button": "#c4a7e7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.label": "#56526e", - "theme.bar.menus.menu.notifications.pager.background": "#232136", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#eb6f92", - "theme.bar.menus.popover.border": "#2a273f", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#9ccfd8", - "theme.bar.menus.menu.power.buttons.restart.text": "#f6c177", - "theme.bar.buttons.modules.updates.background": "#2a283e", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.netstat.background": "#2a283e", - "theme.bar.buttons.modules.weather.icon": "#2a283e", - "theme.bar.buttons.modules.netstat.text": "#9ccfd8", - "theme.bar.buttons.modules.storage.background": "#2a283e", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#eb6f92", - "theme.bar.buttons.modules.cpu.background": "#2a283e", - "theme.bar.menus.menu.power.border.color": "#2a273f", - "theme.bar.buttons.modules.power.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon": "#2a273f", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.restart.icon": "#2a273f", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.weather.text": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#2a273f", - "theme.bar.menus.menu.power.buttons.sleep.text": "#9ccfd8", - "theme.bar.buttons.modules.weather.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#2a283e", - "theme.bar.menus.menu.power.buttons.logout.background": "#2a283e", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.ram.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#eb6f92", - "theme.bar.menus.menu.power.buttons.sleep.background": "#2a283e", - "theme.bar.buttons.modules.ram.text": "#f6c177", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ccfd8", - "theme.bar.buttons.modules.updates.icon_background": "#3e8eb0", - "theme.bar.buttons.modules.kbLayout.background": "#2a283e", - "theme.bar.buttons.modules.power.background": "#2a283e", - "theme.bar.buttons.modules.weather.background": "#2a283e", - "theme.bar.menus.menu.power.background.color": "#232136", - "theme.bar.buttons.modules.ram.background": "#2a283e", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.updates.text": "#3e8eb0", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#2a273f", - "theme.bar.menus.menu.power.buttons.restart.background": "#2a283e", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#eb6f92", - "theme.bar.buttons.modules.netstat.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.kbLayout.text": "#9ccfd8", - "theme.bar.buttons.modules.power.border": "#eb6f92", - "theme.bar.buttons.modules.weather.border": "#c4a7e7", - "theme.bar.buttons.modules.updates.border": "#30738f", - "theme.bar.buttons.modules.kbLayout.border": "#9ccfd8", - "theme.bar.buttons.modules.netstat.border": "#9ccfd8", - "theme.bar.buttons.modules.storage.border": "#eb6f92", - "theme.bar.buttons.modules.cpu.border": "#eb6f92", - "theme.bar.buttons.modules.ram.border": "#f6c177", - "theme.bar.buttons.notifications.border": "#c4a7e7", - "theme.bar.buttons.clock.border": "#c4a7e7", - "theme.bar.buttons.battery.border": "#f6c177", - "theme.bar.buttons.systray.border": "#26233a", - "theme.bar.buttons.bluetooth.border": "#9ccfd8", - "theme.bar.buttons.network.border": "#c4a7e7", - "theme.bar.buttons.volume.border": "#eb6f92", - "theme.bar.buttons.media.border": "#c4a7e7", - "theme.bar.buttons.windowtitle.border": "#c4a7e7", - "theme.bar.buttons.workspaces.border": "#1f1d2e", - "theme.bar.buttons.dashboard.border": "#f6c177", - "theme.bar.buttons.modules.submap.background": "#2a283e", - "theme.bar.buttons.modules.submap.text": "#9ccfd8", - "theme.bar.buttons.modules.submap.border": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#9ccfd8" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/rose_pine_split.json b/ags/HyprPanel/themes/rose_pine_split.json deleted file mode 100644 index 404693c..0000000 --- a/ags/HyprPanel/themes/rose_pine_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#191724", - "theme.bar.background": "#191724", - "theme.bar.buttons.media.icon": "#21202e", - "theme.bar.buttons.media.text": "#c4a7e7", - "theme.bar.buttons.icon": "#c4a7e7", - "theme.bar.buttons.text": "#c4a7e7", - "theme.bar.buttons.hover": "#26233a", - "theme.bar.buttons.background": "#21202e", - "theme.bar.menus.text": "#e0def4", - "theme.bar.menus.border.color": "#1f1d2e", - "theme.bar.buttons.media.background": "#21202e", - "theme.bar.menus.menu.volume.text": "#e0def4", - "theme.bar.menus.menu.volume.card.color": "#21202e", - "theme.bar.menus.menu.volume.label.color": "#eb6f92", - "theme.bar.menus.popover.text": "#c4a7e7", - "theme.bar.menus.popover.background": "#1f1d2e", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#eb6f92", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#191724", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#e0def4", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#1f1d2e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#191724", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#21202e", - "theme.bar.menus.menu.notifications.switch.puck": "#26233a", - "theme.bar.menus.menu.notifications.switch.disabled": "#1f1d2e", - "theme.bar.menus.menu.notifications.switch.enabled": "#c4a7e7", - "theme.bar.menus.menu.notifications.clear": "#eb6f92", - "theme.bar.menus.menu.notifications.switch_divider": "#26233a", - "theme.bar.menus.menu.notifications.border": "#1f1d2e", - "theme.bar.menus.menu.notifications.card": "#21202e", - "theme.bar.menus.menu.notifications.background": "#191724", - "theme.bar.menus.menu.notifications.no_notifications_label": "#1f1d2e", - "theme.bar.menus.menu.notifications.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#c4a7e7", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ccfd8", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#f6c177", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#eb6f92", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#26233a", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#30738f", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#9ccfd8", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#eb6f92", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#f6c177", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.input.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.input.background": "#30738f", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#eb6f92", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#f6c177", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#9ccfd8", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#403d52", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ccfd8", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#1f1d2e", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#c4a7e7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ccfd8", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#f6c177", - "theme.bar.menus.menu.dashboard.profile.name": "#c4a7e7", - "theme.bar.menus.menu.dashboard.border.color": "#1f1d2e", - "theme.bar.menus.menu.dashboard.background.color": "#191724", - "theme.bar.menus.menu.dashboard.card.color": "#21202e", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.hourly.time": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#31748f", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#f6c177", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#eb6f92", - "theme.bar.menus.menu.clock.weather.stats": "#c4a7e7", - "theme.bar.menus.menu.clock.weather.status": "#9ccfd8", - "theme.bar.menus.menu.clock.weather.temperature": "#e0def4", - "theme.bar.menus.menu.clock.weather.icon": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.contextdays": "#403d52", - "theme.bar.menus.menu.clock.calendar.days": "#e0def4", - "theme.bar.menus.menu.clock.calendar.currentday": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.paginator": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.weekdays": "#c4a7e7", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#9ccfd8", - "theme.bar.menus.menu.clock.time.timeperiod": "#9ccfd8", - "theme.bar.menus.menu.clock.time.time": "#c4a7e7", - "theme.bar.menus.menu.clock.text": "#e0def4", - "theme.bar.menus.menu.clock.border.color": "#1f1d2e", - "theme.bar.menus.menu.clock.background.color": "#191724", - "theme.bar.menus.menu.clock.card.color": "#21202e", - "theme.bar.menus.menu.battery.slider.puck": "#26233a", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.battery.slider.background": "#403d52", - "theme.bar.menus.menu.battery.slider.primary": "#f6c177", - "theme.bar.menus.menu.battery.icons.active": "#f6c177", - "theme.bar.menus.menu.battery.icons.passive": "#524f67", - "theme.bar.menus.menu.battery.listitems.active": "#f6c177", - "theme.bar.menus.menu.battery.listitems.passive": "#e0def4", - "theme.bar.menus.menu.battery.text": "#e0def4", - "theme.bar.menus.menu.battery.label.color": "#f6c177", - "theme.bar.menus.menu.battery.border.color": "#1f1d2e", - "theme.bar.menus.menu.battery.background.color": "#191724", - "theme.bar.menus.menu.battery.card.color": "#21202e", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#21202e", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#e0def4", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#191724", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.icons.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.icons.passive": "#524f67", - "theme.bar.menus.menu.bluetooth.listitems.active": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#e0def4", - "theme.bar.menus.menu.bluetooth.switch.puck": "#26233a", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#1f1d2e", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.switch_divider": "#26233a", - "theme.bar.menus.menu.bluetooth.status": "#26233a", - "theme.bar.menus.menu.bluetooth.text": "#e0def4", - "theme.bar.menus.menu.bluetooth.label.color": "#9ccfd8", - "theme.bar.menus.menu.bluetooth.border.color": "#1f1d2e", - "theme.bar.menus.menu.bluetooth.background.color": "#191724", - "theme.bar.menus.menu.bluetooth.card.color": "#21202e", - "theme.bar.menus.menu.network.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#e0def4", - "theme.bar.menus.menu.network.icons.active": "#c4a7e7", - "theme.bar.menus.menu.network.icons.passive": "#524f67", - "theme.bar.menus.menu.network.listitems.active": "#c4a7e7", - "theme.bar.menus.menu.network.listitems.passive": "#e0def4", - "theme.bar.menus.menu.network.status.color": "#26233a", - "theme.bar.menus.menu.network.text": "#e0def4", - "theme.bar.menus.menu.network.label.color": "#c4a7e7", - "theme.bar.menus.menu.network.border.color": "#1f1d2e", - "theme.bar.menus.menu.network.background.color": "#191724", - "theme.bar.menus.menu.network.card.color": "#21202e", - "theme.bar.menus.menu.volume.input_slider.puck": "#403d52", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.volume.input_slider.background": "#403d52", - "theme.bar.menus.menu.volume.input_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.audio_slider.puck": "#403d52", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.volume.audio_slider.background": "#403d52", - "theme.bar.menus.menu.volume.audio_slider.primary": "#eb6f92", - "theme.bar.menus.menu.volume.icons.active": "#eb6f92", - "theme.bar.menus.menu.volume.icons.passive": "#524f67", - "theme.bar.menus.menu.volume.iconbutton.active": "#eb6f92", - "theme.bar.menus.menu.volume.iconbutton.passive": "#e0def4", - "theme.bar.menus.menu.volume.listitems.active": "#eb6f92", - "theme.bar.menus.menu.volume.listitems.passive": "#e0def4", - "theme.bar.menus.menu.volume.border.color": "#1f1d2e", - "theme.bar.menus.menu.volume.background.color": "#191724", - "theme.bar.menus.menu.media.slider.puck": "#26233a", - "theme.bar.menus.menu.media.slider.backgroundhover": "#26233a", - "theme.bar.menus.menu.media.slider.background": "#403d52", - "theme.bar.menus.menu.media.slider.primary": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.text": "#191724", - "theme.bar.menus.menu.media.buttons.background": "#c4a7e7", - "theme.bar.menus.menu.media.buttons.enabled": "#9ccfd8", - "theme.bar.menus.menu.media.buttons.inactive": "#403d52", - "theme.bar.menus.menu.media.border.color": "#1f1d2e", - "theme.bar.menus.menu.media.background.color": "#191724", - "theme.bar.menus.menu.media.album": "#c4a7e7", - "theme.bar.menus.menu.media.artist": "#9ccfd8", - "theme.bar.menus.menu.media.song": "#c4a7e7", - "theme.bar.menus.tooltip.text": "#e0def4", - "theme.bar.menus.tooltip.background": "#191724", - "theme.bar.menus.dropdownmenu.divider": "#21202e", - "theme.bar.menus.dropdownmenu.text": "#e0def4", - "theme.bar.menus.dropdownmenu.background": "#191724", - "theme.bar.menus.slider.puck": "#26233a", - "theme.bar.menus.slider.backgroundhover": "#26233a", - "theme.bar.menus.slider.background": "#403d52", - "theme.bar.menus.slider.primary": "#c4a7e7", - "theme.bar.menus.progressbar.background": "#26233a", - "theme.bar.menus.progressbar.foreground": "#c4a7e7", - "theme.bar.menus.iconbuttons.active": "#c4a7e7", - "theme.bar.menus.iconbuttons.passive": "#e0def4", - "theme.bar.menus.buttons.text": "#1f1d2e", - "theme.bar.menus.buttons.disabled": "#403d52", - "theme.bar.menus.buttons.active": "#c4a7e7", - "theme.bar.menus.buttons.default": "#c4a7e7", - "theme.bar.menus.switch.puck": "#26233a", - "theme.bar.menus.switch.disabled": "#1f1d2e", - "theme.bar.menus.switch.enabled": "#c4a7e7", - "theme.bar.menus.icons.active": "#c4a7e7", - "theme.bar.menus.icons.passive": "#403d52", - "theme.bar.menus.listitems.active": "#c4a7e7", - "theme.bar.menus.listitems.passive": "#e0def4", - "theme.bar.menus.label": "#c4a7e7", - "theme.bar.menus.feinttext": "#1f1d2e", - "theme.bar.menus.dimtext": "#403d52", - "theme.bar.menus.cards": "#21202e", - "theme.bar.buttons.notifications.total": "#c4a7e7", - "theme.bar.buttons.notifications.icon": "#21202e", - "theme.bar.buttons.notifications.background": "#21202e", - "theme.bar.buttons.clock.icon": "#21202e", - "theme.bar.buttons.clock.text": "#c4a7e7", - "theme.bar.buttons.clock.background": "#21202e", - "theme.bar.buttons.battery.icon": "#21202e", - "theme.bar.buttons.battery.text": "#f6c177", - "theme.bar.buttons.battery.background": "#21202e", - "theme.bar.buttons.systray.background": "#21202e", - "theme.bar.buttons.bluetooth.icon": "#26233a", - "theme.bar.buttons.bluetooth.text": "#9ccfd8", - "theme.bar.buttons.bluetooth.background": "#21202e", - "theme.bar.buttons.network.icon": "#21202e", - "theme.bar.buttons.network.text": "#c4a7e7", - "theme.bar.buttons.network.background": "#21202e", - "theme.bar.buttons.volume.icon": "#21202e", - "theme.bar.buttons.volume.text": "#eb6f92", - "theme.bar.buttons.volume.background": "#21202e", - "theme.bar.buttons.windowtitle.icon": "#21202e", - "theme.bar.buttons.windowtitle.text": "#c4a7e7", - "theme.bar.buttons.windowtitle.background": "#21202e", - "theme.bar.buttons.workspaces.active": "#c4a7e7", - "theme.bar.buttons.workspaces.occupied": "#eb6f92", - "theme.bar.buttons.workspaces.available": "#9ccfd8", - "theme.bar.buttons.workspaces.hover": "#c4a7e7", - "theme.bar.buttons.workspaces.background": "#21202e", - "theme.bar.buttons.dashboard.icon": "#21202e", - "theme.bar.buttons.dashboard.background": "#f6c177", - "theme.osd.label": "#c4a7e7", - "theme.osd.icon": "#191724", - "theme.osd.bar_overflow_color": "#eb6f92", - "theme.osd.bar_empty_color": "#1f1d2e", - "theme.osd.bar_color": "#c4a7e7", - "theme.osd.icon_container": "#c4a7e7", - "theme.osd.bar_container": "#191724", - "theme.notification.close_button.label": "#191724", - "theme.notification.close_button.background": "#eb6f92", - "theme.notification.labelicon": "#c4a7e7", - "theme.notification.text": "#e0def4", - "theme.notification.time": "#403d52", - "theme.notification.border": "#1f1d2e", - "theme.notification.label": "#c4a7e7", - "theme.notification.actions.text": "#1f1d2e", - "theme.notification.actions.background": "#c4a7e7", - "theme.notification.background": "#1f1d2e", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#21202e", - "theme.bar.menus.check_radio_button.background": "#393452", - "theme.bar.menus.check_radio_button.active": "#c4a7e7", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#eb6f92", - "theme.bar.buttons.network.icon_background": "#c4a7e7", - "theme.bar.buttons.bluetooth.icon_background": "#9ccfd8", - "theme.bar.buttons.windowtitle.icon_background": "#c4a7e7", - "theme.bar.buttons.media.icon_background": "#c4a7e7", - "theme.bar.buttons.notifications.icon_background": "#c4a7e7", - "theme.bar.buttons.battery.icon_background": "#f6c177", - "theme.bar.buttons.clock.icon_background": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.button": "#c4a7e7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#c4a7e7", - "theme.bar.menus.menu.notifications.pager.label": "#524f67", - "theme.bar.menus.menu.notifications.pager.background": "#191724", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#eb6f92", - "theme.bar.menus.popover.border": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#9ccfd8", - "theme.bar.menus.menu.power.buttons.restart.text": "#f6c177", - "theme.bar.buttons.modules.updates.background": "#21202e", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.netstat.background": "#21202e", - "theme.bar.buttons.modules.weather.icon": "#21202e", - "theme.bar.buttons.modules.netstat.text": "#9ccfd8", - "theme.bar.buttons.modules.storage.background": "#21202e", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#eb6f92", - "theme.bar.buttons.modules.cpu.background": "#21202e", - "theme.bar.menus.menu.power.border.color": "#1f1d2e", - "theme.bar.buttons.modules.power.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.restart.icon": "#1f1d2e", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.weather.text": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.sleep.text": "#9ccfd8", - "theme.bar.buttons.modules.weather.icon_background": "#c4a7e7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#21202e", - "theme.bar.menus.menu.power.buttons.logout.background": "#21202e", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.ram.icon_background": "#f6c177", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#eb6f92", - "theme.bar.menus.menu.power.buttons.sleep.background": "#21202e", - "theme.bar.buttons.modules.ram.text": "#f6c177", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ccfd8", - "theme.bar.buttons.modules.updates.icon_background": "#30738f", - "theme.bar.buttons.modules.kbLayout.background": "#21202e", - "theme.bar.buttons.modules.power.background": "#21202e", - "theme.bar.buttons.modules.weather.background": "#21202e", - "theme.bar.menus.menu.power.background.color": "#191724", - "theme.bar.buttons.modules.ram.background": "#21202e", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#eb6f92", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.updates.text": "#30738f", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#1f1d2e", - "theme.bar.menus.menu.power.buttons.restart.background": "#21202e", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#eb6f92", - "theme.bar.buttons.modules.netstat.icon_background": "#9ccfd8", - "theme.bar.buttons.modules.kbLayout.text": "#9ccfd8", - "theme.bar.buttons.modules.power.border": "#eb6f92", - "theme.bar.buttons.modules.weather.border": "#c4a7e7", - "theme.bar.buttons.modules.updates.border": "#30738f", - "theme.bar.buttons.modules.kbLayout.border": "#9ccfd8", - "theme.bar.buttons.modules.netstat.border": "#9ccfd8", - "theme.bar.buttons.modules.storage.border": "#eb6f92", - "theme.bar.buttons.modules.cpu.border": "#eb6f92", - "theme.bar.buttons.modules.ram.border": "#f6c177", - "theme.bar.buttons.notifications.border": "#c4a7e7", - "theme.bar.buttons.clock.border": "#c4a7e7", - "theme.bar.buttons.battery.border": "#f6c177", - "theme.bar.buttons.systray.border": "#26233a", - "theme.bar.buttons.bluetooth.border": "#9ccfd8", - "theme.bar.buttons.network.border": "#c4a7e7", - "theme.bar.buttons.volume.border": "#eb6f92", - "theme.bar.buttons.media.border": "#c4a7e7", - "theme.bar.buttons.windowtitle.border": "#c4a7e7", - "theme.bar.buttons.workspaces.border": "#1f1d2e", - "theme.bar.buttons.dashboard.border": "#f6c177", - "theme.bar.buttons.modules.submap.background": "#21202e", - "theme.bar.buttons.modules.submap.text": "#9ccfd8", - "theme.bar.buttons.modules.submap.border": "#9ccfd8", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#9ccfd8" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/tokyo_night.json b/ags/HyprPanel/themes/tokyo_night.json deleted file mode 100644 index 01e63c8..0000000 --- a/ags/HyprPanel/themes/tokyo_night.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#1a1b26", - "theme.bar.background": "#1a1b26", - "theme.bar.buttons.media.icon": "#bb9af7", - "theme.bar.buttons.media.text": "#bb9af7", - "theme.bar.buttons.icon": "#bb9af7", - "theme.bar.buttons.text": "#bb9af7", - "theme.bar.buttons.hover": "#414868", - "theme.bar.buttons.background": "#272a3d", - "theme.bar.menus.text": "#c0caf5", - "theme.bar.menus.border.color": "#414868", - "theme.bar.buttons.media.background": "#272a3d", - "theme.bar.menus.menu.volume.text": "#c0caf5", - "theme.bar.menus.menu.volume.card.color": "#24283b", - "theme.bar.menus.menu.volume.label.color": "#f7768e", - "theme.bar.menus.popover.text": "#bb9af7", - "theme.bar.menus.popover.background": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#f7768e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#f7768e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ece6a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#c0caf5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#bb9af7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#414868", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#24283b", - "theme.bar.menus.menu.notifications.switch.puck": "#565f89", - "theme.bar.menus.menu.notifications.switch.disabled": "#565f89", - "theme.bar.menus.menu.notifications.switch.enabled": "#bb9af7", - "theme.bar.menus.menu.notifications.clear": "#f7768e", - "theme.bar.menus.menu.notifications.switch_divider": "#414868", - "theme.bar.menus.menu.notifications.border": "#414868", - "theme.bar.menus.menu.notifications.card": "#24283b", - "theme.bar.menus.menu.notifications.background": "#1a1b26", - "theme.bar.menus.menu.notifications.no_notifications_label": "#414868", - "theme.bar.menus.menu.notifications.label": "#bb9af7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#414868", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#bb9af7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#bb9af7", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#73daca", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#f7768e", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e0af68", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.input.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e0af68", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#7dcfff", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#bb9af7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#414868", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ece6a", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#bb9af7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#7dcfff", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ece6a", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#e0af68", - "theme.bar.menus.menu.dashboard.profile.name": "#f7768e", - "theme.bar.menus.menu.dashboard.border.color": "#414868", - "theme.bar.menus.menu.dashboard.background.color": "#1a1b26", - "theme.bar.menus.menu.dashboard.card.color": "#24283b", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f7768e", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f7768e", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f7768e", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#7dcfff", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#7aa2f7", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#bb9af7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#e0af68", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#f7768e", - "theme.bar.menus.menu.clock.weather.stats": "#f7768e", - "theme.bar.menus.menu.clock.weather.status": "#73daca", - "theme.bar.menus.menu.clock.weather.temperature": "#c0caf5", - "theme.bar.menus.menu.clock.weather.icon": "#f7768e", - "theme.bar.menus.menu.clock.calendar.contextdays": "#414868", - "theme.bar.menus.menu.clock.calendar.days": "#c0caf5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f7768e", - "theme.bar.menus.menu.clock.calendar.paginator": "#f7768e", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f7768e", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#73daca", - "theme.bar.menus.menu.clock.time.timeperiod": "#73daca", - "theme.bar.menus.menu.clock.time.time": "#f7768e", - "theme.bar.menus.menu.clock.text": "#c0caf5", - "theme.bar.menus.menu.clock.border.color": "#414868", - "theme.bar.menus.menu.clock.background.color": "#1a1b26", - "theme.bar.menus.menu.clock.card.color": "#24283b", - "theme.bar.menus.menu.battery.slider.puck": "#565f89", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#414868", - "theme.bar.menus.menu.battery.slider.background": "#565f89", - "theme.bar.menus.menu.battery.slider.primary": "#e0af68", - "theme.bar.menus.menu.battery.icons.active": "#e0af68", - "theme.bar.menus.menu.battery.icons.passive": "#565f89", - "theme.bar.menus.menu.battery.listitems.active": "#e0af68", - "theme.bar.menus.menu.battery.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.battery.text": "#c0caf5", - "theme.bar.menus.menu.battery.label.color": "#e0af68", - "theme.bar.menus.menu.battery.border.color": "#414868", - "theme.bar.menus.menu.battery.background.color": "#1a1b26", - "theme.bar.menus.menu.battery.card.color": "#24283b", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#24283b", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#c0caf5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#1a1b26", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#c0caf5", - "theme.bar.menus.menu.bluetooth.icons.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.icons.passive": "#565f89", - "theme.bar.menus.menu.bluetooth.listitems.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#565f89", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#565f89", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#7dcfff", - "theme.bar.menus.menu.bluetooth.switch_divider": "#414868", - "theme.bar.menus.menu.bluetooth.status": "#565f89", - "theme.bar.menus.menu.bluetooth.text": "#c0caf5", - "theme.bar.menus.menu.bluetooth.label.color": "#7dcfff", - "theme.bar.menus.menu.bluetooth.border.color": "#414868", - "theme.bar.menus.menu.bluetooth.background.color": "#1a1b26", - "theme.bar.menus.menu.bluetooth.card.color": "#24283b", - "theme.bar.menus.menu.network.iconbuttons.active": "#bb9af7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#c0caf5", - "theme.bar.menus.menu.network.icons.active": "#bb9af7", - "theme.bar.menus.menu.network.icons.passive": "#565f89", - "theme.bar.menus.menu.network.listitems.active": "#bb9af7", - "theme.bar.menus.menu.network.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.network.status.color": "#565f89", - "theme.bar.menus.menu.network.text": "#c0caf5", - "theme.bar.menus.menu.network.label.color": "#bb9af7", - "theme.bar.menus.menu.network.border.color": "#414868", - "theme.bar.menus.menu.network.background.color": "#1a1b26", - "theme.bar.menus.menu.network.card.color": "#24283b", - "theme.bar.menus.menu.volume.input_slider.puck": "#414868", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#414868", - "theme.bar.menus.menu.volume.input_slider.background": "#565f89", - "theme.bar.menus.menu.volume.input_slider.primary": "#f7768e", - "theme.bar.menus.menu.volume.audio_slider.puck": "#414868", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#414868", - "theme.bar.menus.menu.volume.audio_slider.background": "#565f89", - "theme.bar.menus.menu.volume.audio_slider.primary": "#f7768e", - "theme.bar.menus.menu.volume.icons.active": "#f7768e", - "theme.bar.menus.menu.volume.icons.passive": "#565f89", - "theme.bar.menus.menu.volume.iconbutton.active": "#f7768e", - "theme.bar.menus.menu.volume.iconbutton.passive": "#c0caf5", - "theme.bar.menus.menu.volume.listitems.active": "#f7768e", - "theme.bar.menus.menu.volume.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.volume.border.color": "#414868", - "theme.bar.menus.menu.volume.background.color": "#1a1b26", - "theme.bar.menus.menu.media.slider.puck": "#565f89", - "theme.bar.menus.menu.media.slider.backgroundhover": "#414868", - "theme.bar.menus.menu.media.slider.background": "#565f89", - "theme.bar.menus.menu.media.slider.primary": "#f7768e", - "theme.bar.menus.menu.media.buttons.text": "#1a1b26", - "theme.bar.menus.menu.media.buttons.background": "#bb9af7", - "theme.bar.menus.menu.media.buttons.enabled": "#73daca", - "theme.bar.menus.menu.media.buttons.inactive": "#414868", - "theme.bar.menus.menu.media.border.color": "#414868", - "theme.bar.menus.menu.media.background.color": "#1a1b26", - "theme.bar.menus.menu.media.album": "#f7768e", - "theme.bar.menus.menu.media.artist": "#73daca", - "theme.bar.menus.menu.media.song": "#bb9af7", - "theme.bar.menus.tooltip.text": "#c0caf5", - "theme.bar.menus.tooltip.background": "#1a1b26", - "theme.bar.menus.dropdownmenu.divider": "#24283b", - "theme.bar.menus.dropdownmenu.text": "#c0caf5", - "theme.bar.menus.dropdownmenu.background": "#1a1b26", - "theme.bar.menus.slider.puck": "#565f89", - "theme.bar.menus.slider.backgroundhover": "#414868", - "theme.bar.menus.slider.background": "#565f89", - "theme.bar.menus.slider.primary": "#bb9af7", - "theme.bar.menus.progressbar.background": "#414868", - "theme.bar.menus.progressbar.foreground": "#bb9af7", - "theme.bar.menus.iconbuttons.active": "#bb9af7", - "theme.bar.menus.iconbuttons.passive": "#c0caf5", - "theme.bar.menus.buttons.text": "#1a1b26", - "theme.bar.menus.buttons.disabled": "#565f89", - "theme.bar.menus.buttons.active": "#f7768e", - "theme.bar.menus.buttons.default": "#bb9af7", - "theme.bar.menus.switch.puck": "#565f89", - "theme.bar.menus.switch.disabled": "#565f89", - "theme.bar.menus.switch.enabled": "#bb9af7", - "theme.bar.menus.icons.active": "#bb9af7", - "theme.bar.menus.icons.passive": "#414868", - "theme.bar.menus.listitems.active": "#bb9af7", - "theme.bar.menus.listitems.passive": "#c0caf5", - "theme.bar.menus.label": "#bb9af7", - "theme.bar.menus.feinttext": "#414868", - "theme.bar.menus.dimtext": "#414868", - "theme.bar.menus.cards": "#24283b", - "theme.bar.buttons.notifications.total": "#bb9af7", - "theme.bar.buttons.notifications.icon": "#bb9af7", - "theme.bar.buttons.notifications.background": "#272a3d", - "theme.bar.buttons.clock.icon": "#f7768e", - "theme.bar.buttons.clock.text": "#f7768e", - "theme.bar.buttons.clock.background": "#272a3d", - "theme.bar.buttons.battery.icon": "#e0af68", - "theme.bar.buttons.battery.text": "#e0af68", - "theme.bar.buttons.battery.background": "#272a3d", - "theme.bar.buttons.systray.background": "#272a3d", - "theme.bar.buttons.bluetooth.icon": "#7dcfff", - "theme.bar.buttons.bluetooth.text": "#7dcfff", - "theme.bar.buttons.bluetooth.background": "#272a3d", - "theme.bar.buttons.network.icon": "#bb9af7", - "theme.bar.buttons.network.text": "#bb9af7", - "theme.bar.buttons.network.background": "#272a3d", - "theme.bar.buttons.volume.icon": "#f7768e", - "theme.bar.buttons.volume.text": "#f7768e", - "theme.bar.buttons.volume.background": "#272a3d", - "theme.bar.buttons.windowtitle.icon": "#f7768e", - "theme.bar.buttons.windowtitle.text": "#f7768e", - "theme.bar.buttons.windowtitle.background": "#272a3d", - "theme.bar.buttons.workspaces.active": "#f7768e", - "theme.bar.buttons.workspaces.occupied": "#f7768e", - "theme.bar.buttons.workspaces.available": "#7dcfff", - "theme.bar.buttons.workspaces.hover": "#414868", - "theme.bar.buttons.workspaces.background": "#272a3d", - "theme.bar.buttons.dashboard.icon": "#e0af68", - "theme.bar.buttons.dashboard.background": "#272a3d", - "theme.osd.label": "#bb9af7", - "theme.osd.icon": "#1a1b26", - "theme.osd.bar_overflow_color": "#f7768e", - "theme.osd.bar_empty_color": "#414868", - "theme.osd.bar_color": "#bb9af7", - "theme.osd.icon_container": "#bb9af7", - "theme.osd.bar_container": "#1a1b26", - "theme.notification.close_button.label": "#1a1b26", - "theme.notification.close_button.background": "#f7768e", - "theme.notification.labelicon": "#bb9af7", - "theme.notification.text": "#c0caf5", - "theme.notification.time": "#9aa5ce", - "theme.notification.border": "#565f89", - "theme.notification.label": "#bb9af7", - "theme.notification.actions.text": "#24283b", - "theme.notification.actions.background": "#bb9af7", - "theme.notification.background": "#1a1b26", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#24283b", - "theme.bar.menus.check_radio_button.background": "#3b4261", - "theme.bar.menus.check_radio_button.active": "#bb9af7", - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.notifications.pager.button": "#bb9af7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#bb9af7", - "theme.bar.menus.menu.notifications.pager.label": "#565f89", - "theme.bar.menus.menu.notifications.pager.background": "#1a1b26", - "theme.bar.buttons.clock.icon_background": "#f7768e", - "theme.bar.buttons.modules.ram.icon": "#e0af68", - "theme.bar.buttons.modules.storage.icon_background": "#f7768e", - "theme.bar.menus.popover.border": "#1a1b26", - "theme.bar.buttons.volume.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#7dcfff", - "theme.bar.menus.menu.power.buttons.restart.text": "#e0af68", - "theme.bar.buttons.modules.updates.background": "#272a3d", - "theme.bar.buttons.modules.storage.icon": "#f7768e", - "theme.bar.buttons.modules.netstat.background": "#272a3d", - "theme.bar.buttons.modules.weather.icon": "#bb9af7", - "theme.bar.buttons.modules.netstat.text": "#9ece6a", - "theme.bar.buttons.modules.storage.background": "#272a3d", - "theme.bar.buttons.modules.power.icon": "#f7768e", - "theme.bar.buttons.modules.storage.text": "#f7768e", - "theme.bar.buttons.modules.cpu.background": "#272a3d", - "theme.bar.menus.menu.power.border.color": "#414868", - "theme.bar.buttons.network.icon_background": "#caa6f7", - "theme.bar.buttons.modules.power.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.logout.icon": "#1a1b26", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#e0af68", - "theme.bar.menus.menu.power.buttons.restart.icon": "#1a1b26", - "theme.bar.buttons.modules.cpu.icon": "#f7768e", - "theme.bar.buttons.battery.icon_background": "#e0af68", - "theme.bar.buttons.modules.kbLayout.icon_background": "#7dcfff", - "theme.bar.buttons.modules.weather.text": "#bb9af7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#1a1b26", - "theme.bar.menus.menu.power.buttons.sleep.text": "#7dcfff", - "theme.bar.buttons.modules.weather.icon_background": "#bb9af7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#24283b", - "theme.bar.buttons.media.icon_background": "#bb9af7", - "theme.bar.menus.menu.power.buttons.logout.background": "#24283b", - "theme.bar.buttons.modules.kbLayout.icon": "#7dcfff", - "theme.bar.buttons.modules.ram.icon_background": "#e0af68", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#f7768e", - "theme.bar.menus.menu.power.buttons.sleep.background": "#24283b", - "theme.bar.buttons.modules.ram.text": "#e0af68", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ece6a", - "theme.bar.buttons.modules.updates.icon_background": "#bb9af7", - "theme.bar.buttons.modules.kbLayout.background": "#272a3d", - "theme.bar.buttons.modules.power.background": "#272a3d", - "theme.bar.buttons.modules.weather.background": "#272a3d", - "theme.bar.buttons.icon_background": "#272a3d", - "theme.bar.menus.menu.power.background.color": "#1a1b26", - "theme.bar.buttons.modules.ram.background": "#272a3d", - "theme.bar.buttons.modules.netstat.icon": "#9ece6a", - "theme.bar.buttons.windowtitle.icon_background": "#f7768e", - "theme.bar.buttons.modules.cpu.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ece6a", - "theme.bar.buttons.modules.updates.text": "#bb9af7", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#1a1b26", - "theme.bar.buttons.bluetooth.icon_background": "#89dbeb", - "theme.bar.menus.menu.power.buttons.restart.background": "#24283b", - "theme.bar.buttons.modules.updates.icon": "#bb9af7", - "theme.bar.buttons.modules.cpu.text": "#f7768e", - "theme.bar.buttons.modules.netstat.icon_background": "#9ece6a", - "theme.bar.buttons.modules.kbLayout.text": "#7dcfff", - "theme.bar.buttons.notifications.icon_background": "#bb9af7", - "theme.bar.buttons.modules.power.border": "#f7768e", - "theme.bar.buttons.modules.weather.border": "#bb9af7", - "theme.bar.buttons.modules.updates.border": "#bb9af7", - "theme.bar.buttons.modules.kbLayout.border": "#7dcfff", - "theme.bar.buttons.modules.netstat.border": "#9ece6a", - "theme.bar.buttons.modules.storage.border": "#f7768e", - "theme.bar.buttons.modules.cpu.border": "#f7768e", - "theme.bar.buttons.modules.ram.border": "#e0af68", - "theme.bar.buttons.notifications.border": "#bb9af7", - "theme.bar.buttons.clock.border": "#f7768e", - "theme.bar.buttons.battery.border": "#e0af68", - "theme.bar.buttons.systray.border": "#414868", - "theme.bar.buttons.bluetooth.border": "#7dcfff", - "theme.bar.buttons.network.border": "#bb9af7", - "theme.bar.buttons.volume.border": "#f7768e", - "theme.bar.buttons.media.border": "#bb9af7", - "theme.bar.buttons.windowtitle.border": "#f7768e", - "theme.bar.buttons.workspaces.border": "#f7768e", - "theme.bar.buttons.dashboard.border": "#e0af68", - "theme.bar.buttons.modules.submap.background": "#272a3d", - "theme.bar.buttons.modules.submap.text": "#73daca", - "theme.bar.buttons.modules.submap.border": "#73daca", - "theme.bar.buttons.modules.submap.icon": "#73daca", - "theme.bar.buttons.modules.submap.icon_background": "#272a3d" -} \ No newline at end of file diff --git a/ags/HyprPanel/themes/tokyo_night_split.json b/ags/HyprPanel/themes/tokyo_night_split.json deleted file mode 100644 index c4c51ca..0000000 --- a/ags/HyprPanel/themes/tokyo_night_split.json +++ /dev/null @@ -1,341 +0,0 @@ -{ - "theme.bar.menus.background": "#1a1b26", - "theme.bar.background": "#1a1b26", - "theme.bar.buttons.media.icon": "#272a3d", - "theme.bar.buttons.media.text": "#bb9af7", - "theme.bar.buttons.icon": "#bb9af7", - "theme.bar.buttons.text": "#bb9af7", - "theme.bar.buttons.hover": "#414868", - "theme.bar.buttons.background": "#272a3d", - "theme.bar.menus.text": "#c0caf5", - "theme.bar.menus.border.color": "#414868", - "theme.bar.buttons.media.background": "#272a3d", - "theme.bar.menus.menu.volume.text": "#c0caf5", - "theme.bar.menus.menu.volume.card.color": "#24283b", - "theme.bar.menus.menu.volume.label.color": "#f7768e", - "theme.bar.menus.popover.text": "#bb9af7", - "theme.bar.menus.popover.background": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.shutdown": "#f7768e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.deny": "#f7768e", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm": "#9ece6a", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.body": "#c0caf5", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.label": "#bb9af7", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.border": "#414868", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.background": "#1a1b26", - "theme.bar.menus.menu.dashboard.powermenu.confirmation.card": "#24283b", - "theme.bar.menus.menu.notifications.switch.puck": "#565f89", - "theme.bar.menus.menu.notifications.switch.disabled": "#565f89", - "theme.bar.menus.menu.notifications.switch.enabled": "#bb9af7", - "theme.bar.menus.menu.notifications.clear": "#f7768e", - "theme.bar.menus.menu.notifications.switch_divider": "#414868", - "theme.bar.menus.menu.notifications.border": "#414868", - "theme.bar.menus.menu.notifications.card": "#24283b", - "theme.bar.menus.menu.notifications.background": "#1a1b26", - "theme.bar.menus.menu.notifications.no_notifications_label": "#414868", - "theme.bar.menus.menu.notifications.label": "#bb9af7", - "theme.bar.menus.menu.dashboard.monitors.disk.label": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.disk.bar": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.disk.icon": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.gpu.label": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.gpu.bar": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.gpu.icon": "#9ece6a", - "theme.bar.menus.menu.dashboard.monitors.ram.label": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.ram.bar": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.ram.icon": "#e0af68", - "theme.bar.menus.menu.dashboard.monitors.cpu.label": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.cpu.bar": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.cpu.icon": "#f7768e", - "theme.bar.menus.menu.dashboard.monitors.bar_background": "#414868", - "theme.bar.menus.menu.dashboard.directories.right.bottom.color": "#bb9af7", - "theme.bar.menus.menu.dashboard.directories.right.middle.color": "#bb9af7", - "theme.bar.menus.menu.dashboard.directories.right.top.color": "#73daca", - "theme.bar.menus.menu.dashboard.directories.left.bottom.color": "#f7768e", - "theme.bar.menus.menu.dashboard.directories.left.middle.color": "#e0af68", - "theme.bar.menus.menu.dashboard.directories.left.top.color": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.input.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.input.background": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.volume.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.volume.background": "#f7768e", - "theme.bar.menus.menu.dashboard.controls.notifications.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.notifications.background": "#e0af68", - "theme.bar.menus.menu.dashboard.controls.bluetooth.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.bluetooth.background": "#7dcfff", - "theme.bar.menus.menu.dashboard.controls.wifi.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.controls.wifi.background": "#bb9af7", - "theme.bar.menus.menu.dashboard.controls.disabled": "#414868", - "theme.bar.menus.menu.dashboard.shortcuts.recording": "#9ece6a", - "theme.bar.menus.menu.dashboard.shortcuts.text": "#1a1b26", - "theme.bar.menus.menu.dashboard.shortcuts.background": "#bb9af7", - "theme.bar.menus.menu.dashboard.powermenu.sleep": "#7dcfff", - "theme.bar.menus.menu.dashboard.powermenu.logout": "#9ece6a", - "theme.bar.menus.menu.dashboard.powermenu.restart": "#e0af68", - "theme.bar.menus.menu.dashboard.profile.name": "#f7768e", - "theme.bar.menus.menu.dashboard.border.color": "#414868", - "theme.bar.menus.menu.dashboard.background.color": "#1a1b26", - "theme.bar.menus.menu.dashboard.card.color": "#24283b", - "theme.bar.menus.menu.clock.weather.hourly.temperature": "#f7768e", - "theme.bar.menus.menu.clock.weather.hourly.icon": "#f7768e", - "theme.bar.menus.menu.clock.weather.hourly.time": "#f7768e", - "theme.bar.menus.menu.clock.weather.thermometer.extremelycold": "#7dcfff", - "theme.bar.menus.menu.clock.weather.thermometer.cold": "#7aa2f7", - "theme.bar.menus.menu.clock.weather.thermometer.moderate": "#bb9af7", - "theme.bar.menus.menu.clock.weather.thermometer.hot": "#e0af68", - "theme.bar.menus.menu.clock.weather.thermometer.extremelyhot": "#f7768e", - "theme.bar.menus.menu.clock.weather.stats": "#f7768e", - "theme.bar.menus.menu.clock.weather.status": "#73daca", - "theme.bar.menus.menu.clock.weather.temperature": "#c0caf5", - "theme.bar.menus.menu.clock.weather.icon": "#f7768e", - "theme.bar.menus.menu.clock.calendar.contextdays": "#414868", - "theme.bar.menus.menu.clock.calendar.days": "#c0caf5", - "theme.bar.menus.menu.clock.calendar.currentday": "#f7768e", - "theme.bar.menus.menu.clock.calendar.paginator": "#f7768e", - "theme.bar.menus.menu.clock.calendar.weekdays": "#f7768e", - "theme.bar.menus.menu.clock.calendar.yearmonth": "#73daca", - "theme.bar.menus.menu.clock.time.timeperiod": "#73daca", - "theme.bar.menus.menu.clock.time.time": "#f7768e", - "theme.bar.menus.menu.clock.text": "#c0caf5", - "theme.bar.menus.menu.clock.border.color": "#414868", - "theme.bar.menus.menu.clock.background.color": "#1a1b26", - "theme.bar.menus.menu.clock.card.color": "#24283b", - "theme.bar.menus.menu.battery.slider.puck": "#565f89", - "theme.bar.menus.menu.battery.slider.backgroundhover": "#414868", - "theme.bar.menus.menu.battery.slider.background": "#565f89", - "theme.bar.menus.menu.battery.slider.primary": "#e0af68", - "theme.bar.menus.menu.battery.icons.active": "#e0af68", - "theme.bar.menus.menu.battery.icons.passive": "#565f89", - "theme.bar.menus.menu.battery.listitems.active": "#e0af68", - "theme.bar.menus.menu.battery.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.battery.text": "#c0caf5", - "theme.bar.menus.menu.battery.label.color": "#e0af68", - "theme.bar.menus.menu.battery.border.color": "#414868", - "theme.bar.menus.menu.battery.background.color": "#1a1b26", - "theme.bar.menus.menu.battery.card.color": "#24283b", - "theme.bar.menus.menu.systray.dropdownmenu.divider": "#24283b", - "theme.bar.menus.menu.systray.dropdownmenu.text": "#c0caf5", - "theme.bar.menus.menu.systray.dropdownmenu.background": "#1a1b26", - "theme.bar.menus.menu.bluetooth.iconbutton.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.iconbutton.passive": "#c0caf5", - "theme.bar.menus.menu.bluetooth.icons.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.icons.passive": "#565f89", - "theme.bar.menus.menu.bluetooth.listitems.active": "#7dcfff", - "theme.bar.menus.menu.bluetooth.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.bluetooth.switch.puck": "#565f89", - "theme.bar.menus.menu.bluetooth.switch.disabled": "#565f89", - "theme.bar.menus.menu.bluetooth.switch.enabled": "#7dcfff", - "theme.bar.menus.menu.bluetooth.switch_divider": "#414868", - "theme.bar.menus.menu.bluetooth.status": "#565f89", - "theme.bar.menus.menu.bluetooth.text": "#c0caf5", - "theme.bar.menus.menu.bluetooth.label.color": "#7dcfff", - "theme.bar.menus.menu.bluetooth.border.color": "#414868", - "theme.bar.menus.menu.bluetooth.background.color": "#1a1b26", - "theme.bar.menus.menu.bluetooth.card.color": "#24283b", - "theme.bar.menus.menu.network.iconbuttons.active": "#bb9af7", - "theme.bar.menus.menu.network.iconbuttons.passive": "#c0caf5", - "theme.bar.menus.menu.network.icons.active": "#bb9af7", - "theme.bar.menus.menu.network.icons.passive": "#565f89", - "theme.bar.menus.menu.network.listitems.active": "#bb9af7", - "theme.bar.menus.menu.network.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.network.status.color": "#565f89", - "theme.bar.menus.menu.network.text": "#c0caf5", - "theme.bar.menus.menu.network.label.color": "#bb9af7", - "theme.bar.menus.menu.network.border.color": "#414868", - "theme.bar.menus.menu.network.background.color": "#1a1b26", - "theme.bar.menus.menu.network.card.color": "#24283b", - "theme.bar.menus.menu.volume.input_slider.puck": "#414868", - "theme.bar.menus.menu.volume.input_slider.backgroundhover": "#414868", - "theme.bar.menus.menu.volume.input_slider.background": "#565f89", - "theme.bar.menus.menu.volume.input_slider.primary": "#f7768e", - "theme.bar.menus.menu.volume.audio_slider.puck": "#414868", - "theme.bar.menus.menu.volume.audio_slider.backgroundhover": "#414868", - "theme.bar.menus.menu.volume.audio_slider.background": "#565f89", - "theme.bar.menus.menu.volume.audio_slider.primary": "#f7768e", - "theme.bar.menus.menu.volume.icons.active": "#f7768e", - "theme.bar.menus.menu.volume.icons.passive": "#565f89", - "theme.bar.menus.menu.volume.iconbutton.active": "#f7768e", - "theme.bar.menus.menu.volume.iconbutton.passive": "#c0caf5", - "theme.bar.menus.menu.volume.listitems.active": "#f7768e", - "theme.bar.menus.menu.volume.listitems.passive": "#c0caf5", - "theme.bar.menus.menu.volume.border.color": "#414868", - "theme.bar.menus.menu.volume.background.color": "#1a1b26", - "theme.bar.menus.menu.media.slider.puck": "#565f89", - "theme.bar.menus.menu.media.slider.backgroundhover": "#414868", - "theme.bar.menus.menu.media.slider.background": "#565f89", - "theme.bar.menus.menu.media.slider.primary": "#f7768e", - "theme.bar.menus.menu.media.buttons.text": "#1a1b26", - "theme.bar.menus.menu.media.buttons.background": "#bb9af7", - "theme.bar.menus.menu.media.buttons.enabled": "#73daca", - "theme.bar.menus.menu.media.buttons.inactive": "#414868", - "theme.bar.menus.menu.media.border.color": "#414868", - "theme.bar.menus.menu.media.background.color": "#1a1b26", - "theme.bar.menus.menu.media.album": "#f7768e", - "theme.bar.menus.menu.media.artist": "#73daca", - "theme.bar.menus.menu.media.song": "#bb9af7", - "theme.bar.menus.tooltip.text": "#c0caf5", - "theme.bar.menus.tooltip.background": "#1a1b26", - "theme.bar.menus.dropdownmenu.divider": "#24283b", - "theme.bar.menus.dropdownmenu.text": "#c0caf5", - "theme.bar.menus.dropdownmenu.background": "#1a1b26", - "theme.bar.menus.slider.puck": "#565f89", - "theme.bar.menus.slider.backgroundhover": "#414868", - "theme.bar.menus.slider.background": "#565f89", - "theme.bar.menus.slider.primary": "#bb9af7", - "theme.bar.menus.progressbar.background": "#414868", - "theme.bar.menus.progressbar.foreground": "#bb9af7", - "theme.bar.menus.iconbuttons.active": "#bb9af7", - "theme.bar.menus.iconbuttons.passive": "#c0caf5", - "theme.bar.menus.buttons.text": "#1a1b26", - "theme.bar.menus.buttons.disabled": "#565f89", - "theme.bar.menus.buttons.active": "#f7768e", - "theme.bar.menus.buttons.default": "#bb9af7", - "theme.bar.menus.switch.puck": "#565f89", - "theme.bar.menus.switch.disabled": "#565f89", - "theme.bar.menus.switch.enabled": "#bb9af7", - "theme.bar.menus.icons.active": "#bb9af7", - "theme.bar.menus.icons.passive": "#414868", - "theme.bar.menus.listitems.active": "#bb9af7", - "theme.bar.menus.listitems.passive": "#c0caf5", - "theme.bar.menus.label": "#bb9af7", - "theme.bar.menus.feinttext": "#414868", - "theme.bar.menus.dimtext": "#414868", - "theme.bar.menus.cards": "#24283b", - "theme.bar.buttons.notifications.total": "#bb9af7", - "theme.bar.buttons.notifications.icon": "#272a3d", - "theme.bar.buttons.notifications.background": "#272a3d", - "theme.bar.buttons.clock.icon": "#272a3d", - "theme.bar.buttons.clock.text": "#f7768e", - "theme.bar.buttons.clock.background": "#272a3d", - "theme.bar.buttons.battery.icon": "#272a3d", - "theme.bar.buttons.battery.text": "#e0af68", - "theme.bar.buttons.battery.background": "#272a3d", - "theme.bar.buttons.systray.background": "#272a3d", - "theme.bar.buttons.bluetooth.icon": "#272a3d", - "theme.bar.buttons.bluetooth.text": "#7dcfff", - "theme.bar.buttons.bluetooth.background": "#272a3d", - "theme.bar.buttons.network.icon": "#272a3d", - "theme.bar.buttons.network.text": "#bb9af7", - "theme.bar.buttons.network.background": "#272a3d", - "theme.bar.buttons.volume.icon": "#272a3d", - "theme.bar.buttons.volume.text": "#f7768e", - "theme.bar.buttons.volume.background": "#272a3d", - "theme.bar.buttons.windowtitle.icon": "#272a3d", - "theme.bar.buttons.windowtitle.text": "#f7768e", - "theme.bar.buttons.windowtitle.background": "#272a3d", - "theme.bar.buttons.workspaces.active": "#f7768e", - "theme.bar.buttons.workspaces.occupied": "#f7768e", - "theme.bar.buttons.workspaces.available": "#7dcfff", - "theme.bar.buttons.workspaces.hover": "#f7768e", - "theme.bar.buttons.workspaces.background": "#272a3d", - "theme.bar.buttons.dashboard.icon": "#272a3d", - "theme.bar.buttons.dashboard.background": "#e0af68", - "theme.osd.label": "#bb9af7", - "theme.osd.icon": "#1a1b26", - "theme.osd.bar_overflow_color": "#f7768e", - "theme.osd.bar_empty_color": "#414868", - "theme.osd.bar_color": "#bb9af7", - "theme.osd.icon_container": "#bb9af7", - "theme.osd.bar_container": "#1a1b26", - "theme.notification.close_button.label": "#1a1b26", - "theme.notification.close_button.background": "#f7768e", - "theme.notification.labelicon": "#bb9af7", - "theme.notification.text": "#c0caf5", - "theme.notification.time": "#9aa5ce", - "theme.notification.border": "#565f89", - "theme.notification.label": "#bb9af7", - "theme.notification.actions.text": "#24283b", - "theme.notification.actions.background": "#bb9af7", - "theme.notification.background": "#1a1b26", - "theme.bar.buttons.workspaces.numbered_active_highlighted_text_color": "#181825", - "theme.bar.buttons.workspaces.numbered_active_underline_color": "#c678dd", - "theme.bar.menus.menu.media.card.color": "#24283b", - "theme.bar.menus.check_radio_button.background": "#3b4261", - "theme.bar.menus.check_radio_button.active": "#bb9af7", - "theme.bar.buttons.style": "split", - "theme.bar.buttons.icon_background": "#242438", - "theme.bar.buttons.volume.icon_background": "#f7768e", - "theme.bar.buttons.network.icon_background": "#bb9af7", - "theme.bar.buttons.bluetooth.icon_background": "#7dcfff", - "theme.bar.buttons.windowtitle.icon_background": "#f7768e", - "theme.bar.buttons.media.icon_background": "#bb9af7", - "theme.bar.buttons.notifications.icon_background": "#bb9af7", - "theme.bar.buttons.battery.icon_background": "#e0af68", - "theme.bar.buttons.clock.icon_background": "#f7768e", - "theme.bar.menus.menu.notifications.pager.button": "#bb9af7", - "theme.bar.menus.menu.notifications.scrollbar.color": "#bb9af7", - "theme.bar.menus.menu.notifications.pager.label": "#565f89", - "theme.bar.menus.menu.notifications.pager.background": "#1a1b26", - "theme.bar.buttons.modules.ram.icon": "#181825", - "theme.bar.buttons.modules.storage.icon_background": "#f7768e", - "theme.bar.menus.popover.border": "#1a1b26", - "theme.bar.menus.menu.power.buttons.sleep.icon_background": "#7dcfff", - "theme.bar.menus.menu.power.buttons.restart.text": "#e0af68", - "theme.bar.buttons.modules.updates.background": "#272a3d", - "theme.bar.buttons.modules.storage.icon": "#181825", - "theme.bar.buttons.modules.netstat.background": "#272a3d", - "theme.bar.buttons.modules.weather.icon": "#272a3d", - "theme.bar.buttons.modules.netstat.text": "#9ece6a", - "theme.bar.buttons.modules.storage.background": "#272a3d", - "theme.bar.buttons.modules.power.icon": "#181825", - "theme.bar.buttons.modules.storage.text": "#f7768e", - "theme.bar.buttons.modules.cpu.background": "#272a3d", - "theme.bar.menus.menu.power.border.color": "#414868", - "theme.bar.buttons.modules.power.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.logout.icon": "#1a1b26", - "theme.bar.menus.menu.power.buttons.restart.icon_background": "#e0af68", - "theme.bar.menus.menu.power.buttons.restart.icon": "#1a1b26", - "theme.bar.buttons.modules.cpu.icon": "#181825", - "theme.bar.buttons.modules.kbLayout.icon_background": "#7dcfff", - "theme.bar.buttons.modules.weather.text": "#bb9af7", - "theme.bar.menus.menu.power.buttons.shutdown.icon": "#1a1b26", - "theme.bar.menus.menu.power.buttons.sleep.text": "#7dcfff", - "theme.bar.buttons.modules.weather.icon_background": "#bb9af7", - "theme.bar.menus.menu.power.buttons.shutdown.background": "#24283b", - "theme.bar.menus.menu.power.buttons.logout.background": "#24283b", - "theme.bar.buttons.modules.kbLayout.icon": "#181825", - "theme.bar.buttons.modules.ram.icon_background": "#e0af68", - "theme.bar.menus.menu.power.buttons.shutdown.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.shutdown.text": "#f7768e", - "theme.bar.menus.menu.power.buttons.sleep.background": "#24283b", - "theme.bar.buttons.modules.ram.text": "#e0af68", - "theme.bar.menus.menu.power.buttons.logout.text": "#9ece6a", - "theme.bar.buttons.modules.updates.icon_background": "#bb9af7", - "theme.bar.buttons.modules.kbLayout.background": "#272a3d", - "theme.bar.buttons.modules.power.background": "#272a3d", - "theme.bar.buttons.modules.weather.background": "#272a3d", - "theme.bar.menus.menu.power.background.color": "#1a1b26", - "theme.bar.buttons.modules.ram.background": "#272a3d", - "theme.bar.buttons.modules.netstat.icon": "#181825", - "theme.bar.buttons.modules.cpu.icon_background": "#f7768e", - "theme.bar.menus.menu.power.buttons.logout.icon_background": "#9ece6a", - "theme.bar.buttons.modules.updates.text": "#bb9af7", - "theme.bar.menus.menu.power.buttons.sleep.icon": "#1a1b26", - "theme.bar.menus.menu.power.buttons.restart.background": "#24283b", - "theme.bar.buttons.modules.updates.icon": "#181825", - "theme.bar.buttons.modules.cpu.text": "#f7768e", - "theme.bar.buttons.modules.netstat.icon_background": "#9ece6a", - "theme.bar.buttons.modules.kbLayout.text": "#7dcfff", - "theme.bar.buttons.modules.power.border": "#f7768e", - "theme.bar.buttons.modules.weather.border": "#bb9af7", - "theme.bar.buttons.modules.updates.border": "#bb9af7", - "theme.bar.buttons.modules.kbLayout.border": "#7dcfff", - "theme.bar.buttons.modules.netstat.border": "#9ece6a", - "theme.bar.buttons.modules.storage.border": "#f7768e", - "theme.bar.buttons.modules.cpu.border": "#f7768e", - "theme.bar.buttons.modules.ram.border": "#e0af68", - "theme.bar.buttons.notifications.border": "#bb9af7", - "theme.bar.buttons.clock.border": "#f7768e", - "theme.bar.buttons.battery.border": "#e0af68", - "theme.bar.buttons.systray.border": "#414868", - "theme.bar.buttons.bluetooth.border": "#7dcfff", - "theme.bar.buttons.network.border": "#bb9af7", - "theme.bar.buttons.volume.border": "#f7768e", - "theme.bar.buttons.media.border": "#bb9af7", - "theme.bar.buttons.windowtitle.border": "#f7768e", - "theme.bar.buttons.workspaces.border": "#f7768e", - "theme.bar.buttons.dashboard.border": "#e0af68", - "theme.bar.buttons.modules.submap.background": "#272a3d", - "theme.bar.buttons.modules.submap.text": "#73daca", - "theme.bar.buttons.modules.submap.border": "#73daca", - "theme.bar.buttons.modules.submap.icon": "#181825", - "theme.bar.buttons.modules.submap.icon_background": "#73daca" -} \ No newline at end of file diff --git a/ags/HyprPanel/tsconfig.json b/ags/HyprPanel/tsconfig.json deleted file mode 100644 index f2567fd..0000000 --- a/ags/HyprPanel/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "allowImportingTsExtensions": true, - "target": "ES2022", - "module": "ES2022", - "lib": ["ES2022"], - "allowJs": true, - "checkJs": false, - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "alwaysStrict": true, - "noImplicitThis": true, - "baseUrl": ".", - "typeRoots": ["types", "lib/types/globals"], - "skipLibCheck": true, - "types": [] - }, - "exclude": ["types/@girs/**/*.js"] -} diff --git a/ags/HyprPanel/types b/ags/HyprPanel/types deleted file mode 120000 index a8e3f04..0000000 --- a/ags/HyprPanel/types +++ /dev/null @@ -1 +0,0 @@ -/usr/share/com.github.Aylur.ags/types \ No newline at end of file diff --git a/ags/HyprPanel/widget/RegularWindow.ts b/ags/HyprPanel/widget/RegularWindow.ts deleted file mode 100644 index 5c85baa..0000000 --- a/ags/HyprPanel/widget/RegularWindow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Gtk from 'gi://Gtk?version=3.0'; - -export default Widget.subclass(Gtk.Window); diff --git a/ags/HyprPanel/widget/settings/SettingsDialog.ts b/ags/HyprPanel/widget/settings/SettingsDialog.ts deleted file mode 100644 index 8d8cc23..0000000 --- a/ags/HyprPanel/widget/settings/SettingsDialog.ts +++ /dev/null @@ -1,89 +0,0 @@ -import RegularWindow from 'widget/RegularWindow'; -import icons from 'lib/icons'; -import options from 'options'; -import { ThemesMenu } from './pages/theme/index'; -import { SettingsMenu } from './pages/config/index'; -import './side_effects'; -import { GBox, GCenterBox } from 'lib/types/widget'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0'; - -type Page = 'Configuration' | 'Theming'; - -const CurrentPage = Variable('Configuration'); - -const pagerMap: Page[] = ['Configuration', 'Theming']; - -const Header = (): GCenterBox => - Widget.CenterBox({ - class_name: 'header', - start_widget: Widget.Button({ - class_name: 'reset', - on_clicked: options.reset, - hpack: 'start', - vpack: 'start', - child: Widget.Icon(icons.ui.refresh), - tooltip_text: 'Reset', - }), - center_widget: Widget.Box({}), - end_widget: Widget.Button({ - class_name: 'close', - hpack: 'end', - vpack: 'start', - child: Widget.Icon(icons.ui.close), - on_clicked: () => App.closeWindow('settings-dialog'), - }), - }); - -const PageContainer = (): GBox => { - return Widget.Box({ - hpack: 'fill', - hexpand: true, - vertical: true, - children: CurrentPage.bind('value').as((v) => { - return [ - Widget.Box({ - class_name: 'option-pages-container', - hpack: 'center', - hexpand: true, - children: pagerMap.map((page) => { - return Widget.Button({ - xalign: 0, - hpack: 'center', - class_name: `pager-button ${v === page ? 'active' : ''} category`, - label: page, - on_primary_click: () => (CurrentPage.value = page), - }); - }), - }), - Widget.Stack({ - vexpand: false, - class_name: 'themes-menu-stack', - children: { - Configuration: SettingsMenu(), - Theming: ThemesMenu(), - }, - shown: CurrentPage.bind('value'), - }), - ]; - }), - }); -}; - -export default (): Gtk.Window => - RegularWindow({ - name: 'settings-dialog', - class_name: 'settings-dialog', - title: 'Settings', - setup(win) { - win.on('delete-event', () => { - win.hide(); - return true; - }); - win.set_default_size(200, 300); - }, - child: Widget.Box({ - class_name: 'settings-dialog-box', - vertical: true, - children: [Header(), PageContainer()], - }), - }); diff --git a/ags/HyprPanel/widget/settings/pages/config/bar/index.ts b/ags/HyprPanel/widget/settings/pages/config/bar/index.ts deleted file mode 100644 index f713739..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/bar/index.ts +++ /dev/null @@ -1,781 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import Gtk from 'types/@girs/gtk-3.0/gtk-3.0'; - -export const BarSettings = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'always', - hscroll: 'automatic', - class_name: 'menu-theme-page paged-container', - child: Widget.Box({ - vertical: true, - children: [ - /* - ****************************** - * LAYOUTS * - ****************************** - */ - Header('Layouts'), - Option( - { - opt: options.bar.layouts, - title: 'Bar Layouts for Monitors', - subtitle: 'Wiki Link: https://hyprpanel.com/configuration/panel.html#layouts', - type: 'object', - subtitleLink: 'https://hyprpanel.com/configuration/panel.html#layouts', - }, - 'bar-layout-input', - ), - Option({ - opt: options.theme.bar.floating, - title: 'Floating Bar', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.location, - title: 'Location', - type: 'enum', - enums: ['top', 'bottom'], - }), - Option({ - opt: options.theme.bar.buttons.enableBorders, - title: 'Enable Button Borders', - subtitle: 'Enables button borders for all buttons in the bar.', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.borderSize, - title: 'Button Border Size', - subtitle: 'Button border for the individual modules must be enabled first', - type: 'string', - }), - /* - ****************************** - * SPACING * - ****************************** - */ - Header('Spacing'), - Option({ - opt: options.theme.bar.outer_spacing, - title: 'Outer Spacing', - subtitle: 'Spacing on the outer left and right edges of the bar.', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.y_margins, - title: 'Vertical Margins', - subtitle: 'Spacing above/below the buttons in the bar.', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.spacing, - title: 'Button Spacing', - subtitle: 'Spacing between the buttons in the bar.', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.padding_x, - title: 'Button Horizontal Padding', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.padding_y, - title: 'Button Vertical Padding', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.radius, - title: 'Button Radius', - type: 'string', - }), - Option({ - opt: options.theme.bar.layer, - title: 'Layer', - type: 'enum', - subtitle: 'Layer determines the Z index of your bar.', - enums: ['top', 'bottom', 'overlay', 'background'], - }), - Option({ - opt: options.theme.bar.dropdownGap, - title: 'Dropdown Gap', - subtitle: 'The gap between the dropdown and the bar', - type: 'string', - }), - Option({ - opt: options.theme.bar.margin_top, - title: 'Margin Top', - subtitle: 'Only applies if floating is enabled', - type: 'string', - }), - Option({ - opt: options.theme.bar.margin_bottom, - title: 'Margin Bottom', - subtitle: 'Only applies if floating is enabled', - type: 'string', - }), - Option({ - opt: options.theme.bar.margin_sides, - title: 'Margin Sides', - subtitle: 'Only applies if floating is enabled', - type: 'string', - }), - Option({ - opt: options.theme.bar.border_radius, - title: 'Border Radius', - subtitle: 'Only applies if floating is enabled', - type: 'string', - }), - - /* - ****************************** - * Actions * - ****************************** - */ - - Header('Actions'), - Option({ - opt: options.bar.scrollSpeed, - title: 'Scrolling Speed', - subtitle: 'The speed at which the commands assigned to the scroll event will trigger', - type: 'number', - }), - /* - ****************************** - * DASHBOARD * - ****************************** - */ - Header('Dashboard'), - Option({ - opt: options.bar.launcher.icon, - title: 'Dashboard Menu Icon', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.dashboard.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.launcher.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.launcher.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.launcher.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.launcher.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * WORKSPACES * - ****************************** - */ - Header('Workspaces'), - Option({ - opt: options.theme.bar.buttons.workspaces.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.showAllActive, - title: 'Mark Active Workspace On All Monitors', - subtitle: 'Marks the currently active workspace on each monitor.', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.fontSize, - title: 'Indicator Size', - subtitle: - 'Only applicable to numbered workspaces and mapped icons\n' + - 'Adjust with caution as it may cause the bar to expand', - type: 'string', - }), - Option({ - opt: options.bar.workspaces.show_icons, - title: 'Show Workspace Icons', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.icons.available, - title: 'Workspace Available', - type: 'string', - }), - Option({ - opt: options.bar.workspaces.icons.active, - title: 'Workspace Active', - type: 'string', - }), - Option({ - opt: options.bar.workspaces.icons.occupied, - title: 'Workspace Occupied', - type: 'string', - }), - Option({ - opt: options.bar.workspaces.show_numbered, - title: 'Show Workspace Numbers', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.numbered_active_indicator, - title: 'Numbered Workspace Identifier', - subtitle: 'Only applicable if Workspace Numbers are enabled', - type: 'enum', - enums: ['underline', 'highlight', 'color'], - }), - Option({ - opt: options.theme.bar.buttons.workspaces.smartHighlight, - title: 'Smart Highlight', - subtitle: - 'Automatically determines the highlight color of the workspace icon.\n' + - 'Only compatible with mapped icons.', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.numbered_active_highlight_border, - title: 'Highlight Radius', - subtitle: 'Only applicable if Workspace Numbers are enabled', - type: 'string', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.numbered_active_highlight_padding, - title: 'Highlight Padding', - subtitle: 'Only applicable if Workspace Numbers are enabled', - type: 'string', - }), - Option({ - opt: options.bar.workspaces.showWsIcons, - title: 'Map Workspaces to Icons', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.workspaceIconMap, - title: 'Workspace Icon Mappings', - type: 'object', - }), - Option({ - opt: options.bar.workspaces.spacing, - title: 'Spacing', - subtitle: 'Spacing between workspace icons', - type: 'float', - }), - Option({ - opt: options.bar.workspaces.workspaces, - title: 'Total Workspaces', - subtitle: 'The least amount of workspaces to always show.', - type: 'number', - }), - Option({ - opt: options.bar.workspaces.monitorSpecific, - title: 'Monitor Specific', - subtitle: - 'Only workspaces applicable to the monitor will be displayed.\n' + - "Works in conjuction with 'Total Workspaces'.", - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.hideUnoccupied, - title: 'Hide Unoccupied', - subtitle: 'Only show workspaces that are occupied or active', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.workspaceMask, - title: 'Mask Workspace Numbers On Monitors', - subtitle: - 'Only applicable if Workspace Numbers and Monitor Specific are enabled.\n' + - "Forces each Monitor's Workspace labels to start from 1.", - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.reverse_scroll, - title: 'Invert Scroll', - subtitle: 'Scrolling up will go to the previous workspace rather than the next.', - type: 'boolean', - }), - Option({ - opt: options.bar.workspaces.scroll_speed, - title: 'Scrolling Speed', - type: 'number', - }), - Option({ - opt: options.bar.workspaces.ignored, - title: 'Ignored Workspaces', - subtitle: 'A regex that defines workspaces to ignore', - type: 'string', - }), - - /* - ****************************** - * WINDOW TITLES * - ****************************** - */ - Header('Window Titles'), - Option({ - opt: options.theme.bar.buttons.windowtitle.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.custom_title, - title: 'Use Custom Title', - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.title_map, - title: 'Window Title Mappings', - subtitle: - 'Only applicable if Show Custom Title is enabled\nWiki Link: https://hyprpanel.com/configuration/panel.html#window-title-mappings', - type: 'object', - subtitleLink: 'https://hyprpanel.com/configuration/panel.html#window-title-mappings', - }), - Option({ - opt: options.bar.windowtitle.class_name, - title: 'Use Class Name', - subtitle: - "Only applicable if Show Custom Title is disabled\nDisplays the window's class name instead of its title.", - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.label, - title: 'Show Window Title Label', - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.icon, - title: 'Show Icon', - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.truncation, - title: 'Truncate Window Title', - subtitle: 'Will truncate the window title to the specified size below.', - type: 'boolean', - }), - Option({ - opt: options.bar.windowtitle.truncation_size, - title: 'Truncation Size', - type: 'number', - min: 10, - }), - Option({ - opt: options.theme.bar.buttons.windowtitle.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.windowtitle.leftClick, - title: 'Left Click', - type: 'string', - }), - Option({ - opt: options.bar.windowtitle.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.windowtitle.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.windowtitle.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.windowtitle.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * VOLUME * - ****************************** - */ - Header('Volume'), - Option({ - opt: options.theme.bar.buttons.volume.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.volume.label, - title: 'Show Volume Percentage', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.volume.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.volume.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.volume.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.volume.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.volume.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * NETWORK * - ****************************** - */ - Header('Network'), - Option({ - opt: options.theme.bar.buttons.network.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.network.label, - title: 'Show Network Name', - type: 'boolean', - }), - Option({ - opt: options.bar.network.truncation, - title: 'Truncate Network Name', - subtitle: 'Will truncate the network name to the specified size below.', - type: 'boolean', - }), - Option({ - opt: options.bar.network.truncation_size, - title: 'Truncation Size', - type: 'number', - }), - Option({ - opt: options.theme.bar.buttons.network.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.network.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.network.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.network.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.network.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * BLUETOOTH * - ****************************** - */ - Header('Bluetooth'), - Option({ - opt: options.theme.bar.buttons.bluetooth.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.bluetooth.label, - title: 'Show Bluetooth Label', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.bluetooth.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.bluetooth.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.bluetooth.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.bluetooth.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.bluetooth.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * BATTERY * - ****************************** - */ - Header('Battery'), - Option({ - opt: options.theme.bar.buttons.battery.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.battery.label, - title: 'Show Battery Percentage', - type: 'boolean', - }), - Option({ - opt: options.bar.battery.hideLabelWhenFull, - title: 'Hide Battery Percentage When Full', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.battery.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.battery.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.battery.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.battery.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.battery.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * SYSTEM TRAY * - ****************************** - */ - Header('System Tray'), - Option({ - opt: options.theme.bar.buttons.systray.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.systray.ignore, - title: 'Ignore List', - subtitle: - 'An array of applications to prevent from showing in the system tray.\n' + - 'Wiki: https://hyprpanel.com/configuration/panel.html#system-tray', - subtitleLink: 'https://hyprpanel.com/configuration/panel.html#system-tray', - type: 'object', - }), - - /* - ****************************** - * CLOCK * - ****************************** - */ - Header('Clock'), - Option({ - opt: options.theme.bar.buttons.clock.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.clock.format, - title: 'Clock Format', - type: 'string', - }), - Option({ - opt: options.bar.clock.icon, - title: 'Icon', - type: 'string', - }), - Option({ - opt: options.bar.clock.showIcon, - title: 'Show Icon', - type: 'boolean', - }), - Option({ - opt: options.bar.clock.showTime, - title: 'Show Time', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.clock.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.clock.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.clock.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.clock.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.clock.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - - /* - ****************************** - * MEDIA * - ****************************** - */ - Header('Media'), - Option({ - opt: options.theme.bar.buttons.media.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.media.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.media.show_artist, - title: 'Show Track Artist', - type: 'boolean', - }), - Option({ - opt: options.bar.media.show_label, - title: 'Toggle Media Label', - type: 'boolean', - }), - Option({ - opt: options.bar.media.truncation, - title: 'Truncate Media Label', - subtitle: 'Only applicable if Toggle Media Label is enabled', - type: 'boolean', - }), - Option({ - opt: options.bar.media.truncation_size, - title: 'Truncation Size', - subtitle: 'Only applicable if Toggle Media Label is enabled', - type: 'number', - min: 10, - }), - Option({ - opt: options.bar.media.show_active_only, - title: 'Auto Hide', - subtitle: 'Button will automatically hide if no media is detected.', - type: 'boolean', - }), - Option({ - opt: options.bar.media.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.media.middleClick, - title: 'Middle Click', - type: 'string', - }), - - /* - ****************************** - * NOTIFICATIONS * - ****************************** - */ - Header('Notifications'), - Option({ - opt: options.theme.bar.buttons.notifications.enableBorder, - title: 'Button Border', - type: 'boolean', - }), - Option({ - opt: options.bar.notifications.show_total, - title: 'Show Total # of notifications', - type: 'boolean', - }), - Option({ - opt: options.bar.notifications.hideCountWhenZero, - title: 'Auto Hide Label', - subtitle: 'Hide Total # of notifications when zero', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.buttons.notifications.spacing, - title: 'Inner Spacing', - subtitle: 'Spacing between the icon and the label inside the buttons.', - type: 'string', - }), - Option({ - opt: options.bar.notifications.rightClick, - title: 'Right Click', - type: 'string', - }), - Option({ - opt: options.bar.notifications.middleClick, - title: 'Middle Click', - type: 'string', - }), - Option({ - opt: options.bar.notifications.scrollUp, - title: 'Scroll Up', - type: 'string', - }), - Option({ - opt: options.bar.notifications.scrollDown, - title: 'Scroll Down', - type: 'string', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/general/index.ts b/ags/HyprPanel/widget/settings/pages/config/general/index.ts deleted file mode 100644 index 86f6748..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/general/index.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const BarGeneral = (): Scrollable => { - return Widget.Scrollable({ - class_name: 'bar-theme-page paged-container', - vscroll: 'automatic', - child: Widget.Box({ - vertical: true, - children: [ - Header('General Settings'), - Option({ opt: options.theme.font.name, title: 'Font', type: 'font' }), - Option({ opt: options.theme.font.size, title: 'Font Size', type: 'string' }), - Option({ - opt: options.theme.font.weight, - title: 'Font Weight', - subtitle: '100, 200, 300, etc.', - type: 'number', - increment: 100, - min: 100, - max: 900, - }), - Option({ - opt: options.dummy, - title: 'Config', - subtitle: 'WARNING: Importing a configuration will replace your current configuration settings.', - type: 'config_import', - exportData: { - filePath: OPTIONS, - themeOnly: false, - }, - }), - Option({ - opt: options.terminal, - title: 'Terminal', - subtitle: "Tools such as 'btop' will open in this terminal", - type: 'string', - }), - Option({ - opt: options.tear, - title: 'Tearing Compatible', - subtitle: - 'Makes HyprPanel compatible with Hyprland tearing.\n' + - "Enabling this will change all overlays (Notifications, OSDs, Bar) to the 'top' layer instead the 'overlay' layer.", - type: 'boolean', - }), - Option({ - opt: options.menus.transition, - title: 'Menu Transition', - type: 'enum', - enums: ['none', 'crossfade'], - }), - Option({ - opt: options.menus.transitionTime, - title: 'Menu Transition Duration', - type: 'number', - min: 100, - max: 10000, - increment: 100, - }), - - Header('Scaling'), - Option({ - opt: options.scalingPriority, - title: 'Scaling Priority', - type: 'enum', - enums: ['both', 'gdk', 'hyprland'], - }), - Option({ - opt: options.theme.bar.scaling, - title: 'Bar', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.notification.scaling, - title: 'Notifications', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.osd.scaling, - title: 'OSD', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.scaling, - title: 'Dashboard Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.confirmation_scaling, - title: 'Confirmation Dialog', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.media.scaling, - title: 'Media Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.volume.scaling, - title: 'Volume Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.network.scaling, - title: 'Network Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.scaling, - title: 'Bluetooth Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.battery.scaling, - title: 'Battery Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.clock.scaling, - title: 'Clock Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.scaling, - title: 'Notifications Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - Option({ - opt: options.theme.bar.menus.menu.power.scaling, - title: 'Power Menu', - type: 'number', - min: 1, - max: 100, - increment: 5, - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/index.ts b/ags/HyprPanel/widget/settings/pages/config/index.ts deleted file mode 100644 index 31f4fa3..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { BarGeneral } from './general/index'; -import { BarSettings } from './bar/index'; -import { ClockMenuSettings } from './menus/clock'; -import { DashboardMenuSettings } from './menus/dashboard'; -import { NotificationSettings } from './notifications/index'; -import { OSDSettings } from './osd/index'; -import { CustomModuleSettings } from 'customModules/config'; -import { PowerMenuSettings } from './menus/power'; -import { GBox } from 'lib/types/widget'; - -type Page = - | 'General' - | 'Bar' - | 'Clock Menu' - | 'Dashboard Menu' - | 'Power Menu' - | 'Notifications' - | 'OSD' - | 'Custom Modules'; - -const CurrentPage = Variable('General'); - -const pagerMap: Page[] = [ - 'General', - 'Bar', - 'Notifications', - 'OSD', - 'Power Menu', - 'Clock Menu', - 'Dashboard Menu', - 'Custom Modules', -]; - -export const SettingsMenu = (): GBox => { - return Widget.Box({ - vertical: true, - children: CurrentPage.bind('value').as((v) => { - return [ - Widget.Box({ - class_name: 'option-pages-container', - hpack: 'center', - hexpand: true, - children: pagerMap.map((page) => { - return Widget.Button({ - hpack: 'center', - class_name: `pager-button ${v === page ? 'active' : ''}`, - label: page, - on_primary_click: () => (CurrentPage.value = page), - }); - }), - }), - Widget.Stack({ - vexpand: true, - class_name: 'themes-menu-stack', - children: { - General: BarGeneral(), - Bar: BarSettings(), - Notifications: NotificationSettings(), - OSD: OSDSettings(), - 'Clock Menu': ClockMenuSettings(), - 'Dashboard Menu': DashboardMenuSettings(), - 'Custom Modules': CustomModuleSettings(), - 'Power Menu': PowerMenuSettings(), - }, - shown: CurrentPage.bind('value'), - }), - ]; - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/menus/clock.ts b/ags/HyprPanel/widget/settings/pages/config/menus/clock.ts deleted file mode 100644 index 71d8e18..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/menus/clock.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const ClockMenuSettings = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - child: Widget.Box({ - class_name: 'bar-theme-page paged-container', - vertical: true, - children: [ - Header('Time'), - Option({ opt: options.menus.clock.time.military, title: 'Use 24hr time', type: 'boolean' }), - Option({ opt: options.menus.clock.time.hideSeconds, title: 'Hide seconds', type: 'boolean' }), - - Header('Weather'), - Option({ opt: options.menus.clock.weather.enabled, title: 'Enabled', type: 'boolean' }), - Option({ - opt: options.menus.clock.weather.location, - title: 'Location', - subtitle: 'Zip Code, Postal Code, City, etc.', - type: 'string', - }), - Option({ - opt: options.menus.clock.weather.key, - title: 'Weather API Key', - subtitle: 'May require AGS restart. https://weatherapi.com/', - type: 'string', - }), - Option({ - opt: options.menus.clock.weather.unit, - title: 'Units', - type: 'enum', - enums: ['imperial', 'metric'], - }), - Option({ - opt: options.menus.clock.weather.interval, - title: 'Weather Fetching Interval (ms)', - subtitle: 'May require AGS restart.', - type: 'number', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/menus/dashboard.ts b/ags/HyprPanel/widget/settings/pages/config/menus/dashboard.ts deleted file mode 100644 index fbb7128..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/menus/dashboard.ts +++ /dev/null @@ -1,214 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const DashboardMenuSettings = (): Scrollable => { - return Widget.Scrollable({ - class_name: 'bar-theme-page paged-container', - vscroll: 'always', - hscroll: 'automatic', - vexpand: true, - overlayScrolling: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Power Menu'), - Option({ opt: options.menus.dashboard.powermenu.avatar.image, title: 'Profile Image', type: 'img' }), - Option({ - opt: options.menus.dashboard.powermenu.avatar.name, - title: 'Profile Name', - subtitle: "Use 'system' to automatically set system name", - type: 'string', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.profile.size, - title: 'Profile Image Size', - type: 'string', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.profile.radius, - title: 'Profile Image Radius', - type: 'string', - }), - - Option({ - opt: options.menus.dashboard.powermenu.confirmation, - title: 'Show Confirmation Dialogue', - type: 'boolean', - }), - Option({ opt: options.menus.dashboard.powermenu.shutdown, title: 'Shutdown Command', type: 'string' }), - Option({ opt: options.menus.dashboard.powermenu.reboot, title: 'Reboot Command', type: 'string' }), - Option({ opt: options.menus.dashboard.powermenu.logout, title: 'Logout Command', type: 'string' }), - Option({ opt: options.menus.dashboard.powermenu.sleep, title: 'Sleep Command', type: 'string' }), - Header('Controls'), - Option({ opt: options.menus.dashboard.controls.enabled, title: 'Enabled', type: 'boolean' }), - Header('Resource Usage Metrics'), - Option({ opt: options.menus.dashboard.stats.enabled, title: 'Enabled', type: 'boolean' }), - Option({ - opt: options.menus.dashboard.stats.enable_gpu, - title: 'Track GPU', - subtitle: "NOTE: This is currently only available for NVidia GPUs and requires 'python-gpustat'.", - type: 'boolean', - }), - Header('Shortcuts'), - Option({ opt: options.menus.dashboard.shortcuts.enabled, title: 'Enabled', type: 'boolean' }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut1.icon, - title: 'Left - Shortcut 1 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut1.command, - title: 'Left - Shortcut 1 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut1.tooltip, - title: 'Left - Shortcut 1 (Tooltip)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut2.icon, - title: 'Left - Shortcut 2 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut2.command, - title: 'Left - Shortcut 2 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut2.tooltip, - title: 'Left - Shortcut 2 (Tooltip)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut3.icon, - title: 'Left - Shortcut 3 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut3.command, - title: 'Left - Shortcut 3 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut3.tooltip, - title: 'Left - Shortcut 3 (Tooltip)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut4.icon, - title: 'Left - Shortcut 4 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut4.command, - title: 'Left - Shortcut 4 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.left.shortcut4.tooltip, - title: 'Left - Shortcut 4 (Tooltip)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut1.icon, - title: 'Right - Shortcut 1 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut1.command, - title: 'Right - Shortcut 1 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut1.tooltip, - title: 'Right - Shortcut 1 (Tooltip)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut3.icon, - title: 'Right - Shortcut 3 (Icon)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut3.command, - title: 'Right - Shortcut 3 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.shortcuts.right.shortcut3.tooltip, - title: 'Right - Shortcut 3 (Tooltip)', - type: 'string', - }), - - Header('Directories'), - Option({ opt: options.menus.dashboard.directories.enabled, title: 'Enabled', type: 'boolean' }), - Option({ - opt: options.menus.dashboard.directories.left.directory1.label, - title: 'Left - Directory 1 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.left.directory1.command, - title: 'Left - Directory 1 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.left.directory2.label, - title: 'Left - Directory 2 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.left.directory2.command, - title: 'Left - Directory 2 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.left.directory3.label, - title: 'Left - Directory 3 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.left.directory3.command, - title: 'Left - Directory 3 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory1.label, - title: 'Right - Directory 1 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory1.command, - title: 'Right - Directory 1 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory2.label, - title: 'Right - Directory 2 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory2.command, - title: 'Right - Directory 2 (Command)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory3.label, - title: 'Right - Directory 3 (Label)', - type: 'string', - }), - Option({ - opt: options.menus.dashboard.directories.right.directory3.command, - title: 'Right - Directory 3 (Command)', - type: 'string', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/menus/power.ts b/ags/HyprPanel/widget/settings/pages/config/menus/power.ts deleted file mode 100644 index e1ce949..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/menus/power.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import { Attribute, Child } from 'lib/types/widget'; -import Scrollable from 'types/widgets/scrollable'; - -export const PowerMenuSettings = (): Scrollable => { - return Widget.Scrollable({ - class_name: 'bar-theme-page paged-container', - vscroll: 'always', - hscroll: 'automatic', - vexpand: true, - overlayScrolling: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Power Menu'), - Option({ opt: options.menus.power.showLabel, title: 'Show Label', type: 'boolean' }), - Option({ opt: options.menus.power.confirmation, title: 'Confirmation Dialog', type: 'boolean' }), - Option({ opt: options.menus.power.shutdown, title: 'Shutdown Command', type: 'string' }), - Option({ opt: options.menus.power.reboot, title: 'Reboot Command', type: 'string' }), - Option({ opt: options.menus.power.logout, title: 'Logout Command', type: 'string' }), - Option({ opt: options.menus.power.sleep, title: 'Sleep Command', type: 'string' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/notifications/index.ts b/ags/HyprPanel/widget/settings/pages/config/notifications/index.ts deleted file mode 100644 index 4191d4f..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/notifications/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const NotificationSettings = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - child: Widget.Box({ - class_name: 'bar-theme-page paged-container', - vertical: true, - children: [ - Header('Notification Settings'), - Option({ - opt: options.notifications.ignore, - title: 'Ignored Applications', - subtitle: - 'Applications to ignore.\n' + - 'Wiki: https://hyprpanel.com/configuration/notifications.html#ignored-applications', - subtitleLink: 'https://hyprpanel.com/configuration/notifications.html#ignored-applications', - type: 'object', - }), - Option({ - opt: options.notifications.position, - title: 'Notification Location', - type: 'enum', - enums: ['top left', 'top', 'top right', 'right', 'bottom right', 'bottom', 'bottom left', 'left'], - }), - Option({ - opt: options.theme.notification.border_radius, - title: 'Border Radius', - type: 'string', - }), - Option({ - opt: options.notifications.monitor, - title: 'Monitor', - subtitle: 'The ID of the monitor on which to display the notification', - type: 'number', - }), - Option({ - opt: options.notifications.active_monitor, - title: 'Follow Cursor', - subtitle: 'The notification will follow the monitor of your cursor', - type: 'boolean', - }), - Option({ - opt: options.notifications.clearDelay, - title: 'Clear Delay', - subtitle: - 'The delay in milliseconds before a notification is cleared' + - '\nWARNING: Setting this value too low may crash AGS depending on your system.', - type: 'number', - increment: 20, - }), - Option({ - opt: options.notifications.timeout, - title: 'Notification Timeout', - subtitle: 'How long notification popups will last (in milliseconds).', - type: 'number', - }), - Option({ - opt: options.notifications.cache_actions, - title: 'Preserve Actions', - subtitle: 'This will persist the action buttons of a notification after rebooting.', - type: 'boolean', - }), - - Header('Notification Menu Settings'), - Option({ - opt: options.theme.bar.menus.menu.notifications.height, - title: 'Notification Menu Height', - type: 'string', - }), - Option({ - opt: options.notifications.displayedTotal, - title: 'Displayed Total', - subtitle: - 'How many notifications to show in the menu at once.\n' + - 'Newer notifications will display towards the top.', - type: 'number', - min: 1, - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.pager.show, - title: 'Show Pager', - subtitle: 'Shows the pagination footer at the bottom of the menu.', - type: 'boolean', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.scrollbar.width, - title: 'Scrollbar Width', - type: 'string', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.scrollbar.radius, - title: 'Scrollbar Radius', - type: 'string', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/config/osd/index.ts b/ags/HyprPanel/widget/settings/pages/config/osd/index.ts deleted file mode 100644 index f9fca0f..0000000 --- a/ags/HyprPanel/widget/settings/pages/config/osd/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const OSDSettings = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - child: Widget.Box({ - class_name: 'bar-theme-page paged-container', - vertical: true, - children: [ - Header('On Screen Display'), - Option({ opt: options.theme.osd.enable, title: 'Enabled', type: 'boolean' }), - Option({ - opt: options.theme.osd.duration, - title: 'Duration', - type: 'number', - min: 100, - max: 10000, - increment: 500, - }), - Option({ - opt: options.theme.osd.orientation, - title: 'Orientation', - type: 'enum', - enums: ['horizontal', 'vertical'], - }), - Option({ - opt: options.theme.osd.location, - title: 'Position', - subtitle: 'Position of the OSD on the screen', - type: 'enum', - enums: ['top left', 'top', 'top right', 'right', 'bottom right', 'bottom', 'bottom left', 'left'], - }), - Option({ - opt: options.theme.osd.monitor, - title: 'Monitor', - subtitle: 'The ID of the monitor on which to display the OSD', - type: 'number', - }), - Option({ - opt: options.theme.osd.active_monitor, - title: 'Follow Cursor', - subtitle: 'The OSD will follow the monitor of your cursor', - type: 'boolean', - }), - Option({ - opt: options.theme.osd.radius, - title: 'Radius', - subtitle: 'Radius of the on-screen-display that indicates volume/brightness change', - type: 'string', - }), - Option({ - opt: options.theme.osd.margins, - title: 'Margins', - subtitle: 'Margins in the following format: top right bottom left', - type: 'string', - }), - Option({ - opt: options.theme.osd.muted_zero, - title: 'Mute Volume as Zero', - subtitle: 'Display volume as 0 when muting, instead of previous device volume', - type: 'boolean', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/bar/index.ts b/ags/HyprPanel/widget/settings/pages/theme/bar/index.ts deleted file mode 100644 index 0fb513d..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/bar/index.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const BarTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'always', - hscroll: 'automatic', - class_name: 'bar-theme-page paged-container', - child: Widget.Box({ - vertical: true, - children: [ - Header('General'), - Option({ opt: options.theme.bar.transparent, title: 'Transparent', type: 'boolean' }), - Option({ opt: options.theme.bar.background, title: 'Background Color', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.style, - title: 'Button Style', - type: 'enum', - enums: ['default', 'split', 'wave', 'wave2'], - }), - Option({ - opt: options.theme.bar.opacity, - title: 'Background Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ - opt: options.theme.bar.buttons.opacity, - title: 'Button Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ - opt: options.theme.bar.buttons.background_opacity, - title: 'Button Background Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ - opt: options.theme.bar.buttons.background_hover_opacity, - title: 'Button Background Hover Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ - opt: options.theme.bar.buttons.monochrome, - title: 'Use Global Colors', - type: 'boolean', - disabledBinding: options.theme.matugen, - }), - Option({ opt: options.theme.bar.buttons.background, title: 'Button Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.hover, title: 'Button Hover', type: 'color' }), - Option({ opt: options.theme.bar.buttons.text, title: 'Button Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.icon, title: 'Button Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - - Header('Dashboard Button'), - Option({ opt: options.theme.bar.buttons.dashboard.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.dashboard.icon, title: 'Icon', type: 'color' }), - Option({ opt: options.theme.bar.buttons.dashboard.border, title: 'Border', type: 'color' }), - - Header('Workspaces'), - Option({ opt: options.theme.bar.buttons.workspaces.background, title: 'Background', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.workspaces.hover, - title: 'Workspace Hover Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.available, - title: 'Workspace Available Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.occupied, - title: 'Workspace Occupied Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.active, - title: 'Workspace Active Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.numbered_active_highlighted_text_color, - title: 'Highlighted Workspace Text Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.buttons.workspaces.numbered_active_underline_color, - title: 'Workspace Underline Color', - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.workspaces.border, title: 'Border', type: 'color' }), - - Header('Window Title'), - Option({ opt: options.theme.bar.buttons.windowtitle.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.windowtitle.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.windowtitle.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.windowtitle.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.windowtitle.border, title: 'Border', type: 'color' }), - - Header('Media'), - Option({ opt: options.theme.bar.buttons.media.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.media.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.media.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.media.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.media.border, title: 'Border', type: 'color' }), - - Header('Volume'), - Option({ opt: options.theme.bar.buttons.volume.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.volume.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.volume.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.volume.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.volume.border, title: 'Border', type: 'color' }), - - Header('Network'), - Option({ opt: options.theme.bar.buttons.network.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.network.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.network.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.network.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.network.border, title: 'Border', type: 'color' }), - - Header('Bluetooth'), - Option({ opt: options.theme.bar.buttons.bluetooth.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.bluetooth.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.bluetooth.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.bluetooth.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.bluetooth.border, title: 'Border', type: 'color' }), - - Header('System Tray'), - Option({ opt: options.theme.bar.buttons.systray.background, title: 'Background', type: 'color' }), - - Header('Battery'), - Option({ opt: options.theme.bar.buttons.battery.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.battery.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.battery.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.battery.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.battery.border, title: 'Border', type: 'color' }), - - Header('Clock'), - Option({ opt: options.theme.bar.buttons.clock.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.buttons.clock.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.buttons.clock.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.clock.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.clock.border, title: 'Border', type: 'color' }), - - Header('Notifications'), - Option({ opt: options.theme.bar.buttons.notifications.background, title: 'Background', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.notifications.total, - title: 'Notification Count', - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.notifications.icon, title: 'Icon', type: 'color' }), - Option({ - opt: options.theme.bar.buttons.notifications.icon_background, - title: 'Button Icon Background', - subtitle: - "Applies a background color to the icon section of the button.\nRequires 'split' button styling.", - type: 'color', - }), - Option({ opt: options.theme.bar.buttons.notifications.border, title: 'Border', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/index.ts b/ags/HyprPanel/widget/settings/pages/theme/index.ts deleted file mode 100644 index 0f09cc5..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/index.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { BarTheme } from './bar/index'; -import { NotificationsTheme } from './notifications/index'; -import { BatteryMenuTheme } from './menus/battery'; -import { BluetoothMenuTheme } from './menus/bluetooth'; -import { ClockMenuTheme } from './menus/clock'; -import { DashboardMenuTheme } from './menus/dashboard'; -import { MenuTheme } from './menus/index'; -import { MediaMenuTheme } from './menus/media'; -import { NetworkMenuTheme } from './menus/network'; -import { NotificationsMenuTheme } from './menus/notifications'; -import { SystrayMenuTheme } from './menus/systray'; -import { VolumeMenuTheme } from './menus/volume'; -import { OsdTheme } from './osd/index'; -import { Matugen } from './menus/matugen'; -import { CustomModuleTheme } from 'customModules/theme'; -import { PowerMenuTheme } from './menus/power'; -import { GBox } from 'lib/types/widget'; - -type Page = - | 'General Settings' - | 'Matugen Settings' - | 'Bar' - | 'Notifications' - | 'OSD' - | 'Battery Menu' - | 'Bluetooth Menu' - | 'Clock Menu' - | 'Dashboard Menu' - | 'Media Menu' - | 'Network Menu' - | 'Notifications Menu' - | 'System Tray' - | 'Volume Menu' - | 'Power Menu' - | 'Custom Modules'; - -const CurrentPage = Variable('General Settings'); - -const pagerMap: Page[] = [ - 'General Settings', - 'Matugen Settings', - 'Bar', - 'Notifications', - 'OSD', - 'Battery Menu', - 'Bluetooth Menu', - 'Clock Menu', - 'Dashboard Menu', - 'Media Menu', - 'Network Menu', - 'Notifications Menu', - 'System Tray', - 'Volume Menu', - 'Power Menu', - 'Custom Modules', -]; - -export const ThemesMenu = (): GBox => { - return Widget.Box({ - vertical: true, - children: CurrentPage.bind('value').as((v) => { - return [ - Widget.Box({ - class_name: 'option-pages-container', - hpack: 'center', - hexpand: true, - vertical: true, - children: [0, 1, 2].map((section) => { - return Widget.Box({ - children: pagerMap.map((page, index) => { - if (index >= section * 6 && index < section * 6 + 6) { - return Widget.Button({ - hpack: 'center', - xalign: 0, - class_name: `pager-button ${v === page ? 'active' : ''}`, - label: page, - on_primary_click: () => (CurrentPage.value = page), - }); - } - return Widget.Box(); - }), - }); - }), - }), - Widget.Stack({ - vexpand: true, - class_name: 'themes-menu-stack', - children: { - 'General Settings': MenuTheme(), - 'Matugen Settings': Matugen(), - Bar: BarTheme(), - Notifications: NotificationsTheme(), - OSD: OsdTheme(), - 'Battery Menu': BatteryMenuTheme(), - 'Bluetooth Menu': BluetoothMenuTheme(), - 'Clock Menu': ClockMenuTheme(), - 'Dashboard Menu': DashboardMenuTheme(), - 'Media Menu': MediaMenuTheme(), - 'Network Menu': NetworkMenuTheme(), - 'Notifications Menu': NotificationsMenuTheme(), - 'System Tray': SystrayMenuTheme(), - 'Volume Menu': VolumeMenuTheme(), - 'Power Menu': PowerMenuTheme(), - 'Custom Modules': CustomModuleTheme(), - }, - shown: CurrentPage.bind('value'), - }), - ]; - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/battery.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/battery.ts deleted file mode 100644 index 6955f80..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/battery.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const BatteryMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page battery paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Battery Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.battery.text, title: 'Text', type: 'color' }), - - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.battery.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.battery.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.battery.border.color, title: 'Border', type: 'color' }), - - Header('Label'), - Option({ opt: options.theme.bar.menus.menu.battery.label.color, title: 'Label', type: 'color' }), - - Header('List Items'), - Option({ - opt: options.theme.bar.menus.menu.battery.listitems.active, - title: 'Active/Hover', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.battery.listitems.passive, - title: 'Passive', - type: 'color', - }), - - Header('Icons'), - Option({ opt: options.theme.bar.menus.menu.battery.icons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.battery.icons.passive, title: 'Passive', type: 'color' }), - - Header('Slider'), - Option({ opt: options.theme.bar.menus.menu.battery.slider.primary, title: 'Primary', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.battery.slider.background, - title: 'Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.battery.slider.backgroundhover, - title: 'Background (Hover)', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.battery.slider.puck, title: 'Puck', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/bluetooth.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/bluetooth.ts deleted file mode 100644 index d3adb36..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/bluetooth.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const BluetoothMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page bluetooth paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Bluetooth Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.text, title: 'Text', type: 'color' }), - - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.border.color, title: 'Border', type: 'color' }), - - Header('Label'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.label.color, title: 'Label', type: 'color' }), - - Header('Status'), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.status, - title: 'Connection Status', - type: 'color', - }), - - Header('List Items'), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.listitems.active, - title: 'Active/Hover', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.listitems.passive, - title: 'Passive', - type: 'color', - }), - - Header('Icons'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.icons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.bluetooth.icons.passive, title: 'Passive', type: 'color' }), - - Header('Icon Buttons'), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.iconbutton.active, - title: 'Active', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.iconbutton.passive, - title: 'Passive', - type: 'color', - }), - - Header('Switch'), - Option({ opt: options.theme.bar.menus.menu.bluetooth.switch.enabled, title: 'Enabled', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.switch.disabled, - title: 'Disabled', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.bluetooth.switch.puck, title: 'Puck', type: 'color' }), - - Header('Switch Divider'), - Option({ - opt: options.theme.bar.menus.menu.bluetooth.switch_divider, - title: 'Switch Divider', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/clock.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/clock.ts deleted file mode 100644 index 2727939..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/clock.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const ClockMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page clock paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Clock Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.clock.text, title: 'Text', type: 'color' }), - - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.clock.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.clock.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.clock.border.color, title: 'Border', type: 'color' }), - - Header('Time'), - Option({ opt: options.theme.bar.menus.menu.clock.time.time, title: 'Time', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.clock.time.timeperiod, - title: 'Period', - subtitle: 'AM/PM', - type: 'color', - }), - - Header('Calendar'), - Option({ - opt: options.theme.bar.menus.menu.clock.calendar.yearmonth, - title: 'Year/Month', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.clock.calendar.weekdays, title: 'Weekdays', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.clock.calendar.paginator, - title: 'Navigation Arrows (Hover)', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.calendar.currentday, - title: 'Current Day', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.clock.calendar.days, title: 'Days', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.clock.calendar.contextdays, - title: 'Trailing/Leading Days', - type: 'color', - }), - - Header('Weather'), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.icon, - title: 'Current Weather Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.temperature, - title: 'Current Temperature', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.status, - title: 'Current Status', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.stats, - title: 'Current Stats', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.thermometer.extremelyhot, - title: 'Thermometer - Extremely Hot', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.thermometer.hot, - title: 'Thermometer - Hot', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.thermometer.moderate, - title: 'Thermometer - Moderate', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.thermometer.cold, - title: 'Thermometer - Cold', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.thermometer.extremelycold, - title: 'Thermometer - Extremely Cold', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.hourly.time, - title: 'Hourly Weather Time', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.hourly.icon, - title: 'Hourly Weather Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.clock.weather.hourly.temperature, - title: 'Hourly Weather Temperature', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/dashboard.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/dashboard.ts deleted file mode 100644 index 76bb88f..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/dashboard.ts +++ /dev/null @@ -1,268 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const DashboardMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'always', - hscroll: 'automatic', - class_name: 'menu-theme-page dashboard paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.dashboard.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.dashboard.border.color, title: 'Border', type: 'color' }), - - Header('Profile'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.profile.name, - title: 'Profile Name', - type: 'color', - }), - - Header('Power Menu'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.shutdown, - title: 'Shutdown', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.restart, - title: 'Restart', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.logout, - title: 'Log Out', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.dashboard.powermenu.sleep, title: 'Sleep', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.card, - title: 'Confirmation Dialog Card', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.background, - title: 'Confirmation Dialog Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.border, - title: 'Confirmation Dialog Border', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.label, - title: 'Confirmation Dialog Label', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.body, - title: 'Confirmation Dialog Description', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.confirm, - title: 'Confirmation Dialog Confirm Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.deny, - title: 'Confirmation Dialog Cancel Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.powermenu.confirmation.button_text, - title: 'Confirmation Dialog Button Text', - type: 'color', - }), - - Header('Shortcuts'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.shortcuts.background, - title: 'Primary', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.dashboard.shortcuts.text, title: 'Text', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.shortcuts.recording, - title: 'Recording', - subtitle: 'Color of the Record button when recording is in progress', - type: 'color', - }), - - Header('Controls'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.disabled, - title: 'Module Off', - subtitle: 'Button color when element is disabled', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.wifi.background, - title: 'Wifi Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.wifi.text, - title: 'Wifi Button Text', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.bluetooth.background, - title: 'Bluetooth Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.bluetooth.text, - title: 'Bluetooth Button Text', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.notifications.background, - title: 'Notifications Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.notifications.text, - title: 'Notifications Button Text', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.volume.background, - title: 'Volume Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.volume.text, - title: 'Volume Button Text', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.input.background, - title: 'Input Button', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.controls.input.text, - title: 'Input Button Text', - type: 'color', - }), - - Header('Directories'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.left.top.color, - title: 'Directory: Left - Top', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.left.middle.color, - title: 'Directory: Left - Middle', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.left.bottom.color, - title: 'Directory: Left - Bottom', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.right.top.color, - title: 'Directory: Right - Top', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.right.middle.color, - title: 'Directory: Right - Middle', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.directories.right.bottom.color, - title: 'Directory: Right - Bottom', - type: 'color', - }), - - Header('System Stats'), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.bar_background, - title: 'Bar Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.cpu.icon, - title: 'CPU Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.cpu.bar, - title: 'CPU Bar', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.cpu.label, - title: 'CPU Label', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.ram.icon, - title: 'RAM Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.ram.bar, - title: 'RAM Bar', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.ram.label, - title: 'RAM Label', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.gpu.icon, - title: 'GPU Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.gpu.bar, - title: 'GPU Bar', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.gpu.label, - title: 'GPU Label', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.disk.icon, - title: 'Disk Icon', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.disk.bar, - title: 'Disk Bar', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.dashboard.monitors.disk.label, - title: 'Disk Label', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/index.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/index.ts deleted file mode 100644 index 333fe96..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/index.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const MenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('General'), - Option({ - opt: options.dummy, - title: 'Theme', - subtitle: 'WARNING: Importing a theme will replace your current theme color settings.', - type: 'config_import', - exportData: { - filePath: OPTIONS, - themeOnly: true, - }, - }), - Option({ - opt: options.theme.bar.menus.monochrome, - title: 'Use Global Colors', - type: 'boolean', - disabledBinding: options.theme.matugen, - }), - Option({ - opt: options.wallpaper.pywal, - title: 'Generate Pywal Colors', - subtitle: 'Whether to also generate pywal colors with chosen wallpaper', - type: 'boolean', - }), - Option({ - opt: options.wallpaper.enable, - title: 'Apply Wallpapers', - subtitle: 'Whether to apply the wallpaper or to only use it for Matugen color generation.', - type: 'boolean', - }), - Option({ - opt: options.wallpaper.image, - title: 'Wallpaper', - subtitle: options.wallpaper.image.bind('value'), - type: 'wallpaper', - }), - Option({ opt: options.theme.bar.menus.background, title: 'Background Color', type: 'color' }), - Option({ - opt: options.theme.bar.menus.opacity, - title: 'Menu Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ opt: options.theme.bar.menus.cards, title: 'Cards', type: 'color' }), - Option({ opt: options.theme.bar.menus.card_radius, title: 'Card Radius', type: 'string' }), - Option({ opt: options.theme.bar.menus.text, title: 'Primary Text', type: 'color' }), - Option({ opt: options.theme.bar.menus.dimtext, title: 'Dim Text', type: 'color' }), - Option({ opt: options.theme.bar.menus.feinttext, title: 'Feint Text', type: 'color' }), - Option({ opt: options.theme.bar.menus.label, title: 'Label Color', type: 'color' }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.border.size, title: 'Border Width', type: 'string' }), - Option({ opt: options.theme.bar.menus.border.radius, title: 'Border Radius', type: 'string' }), - Option({ opt: options.theme.bar.menus.border.color, title: 'Border Color', type: 'color' }), - - Header('Popover'), - Option({ opt: options.theme.bar.menus.popover.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.menus.popover.background, title: 'Background', type: 'color' }), - - Header('List Items'), - Option({ - opt: options.theme.bar.menus.listitems.active, - title: 'Active', - subtitle: - 'Items of a list (network name, bluetooth device name, playback device, etc.) when active or hovered.', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.listitems.passive, title: 'Passive', type: 'color' }), - - Header('Icons'), - Option({ opt: options.theme.bar.menus.icons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.icons.passive, title: 'Passive', type: 'color' }), - - Header('Switch'), - Option({ opt: options.theme.bar.menus.switch.enabled, title: 'Enabled', type: 'color' }), - Option({ opt: options.theme.bar.menus.switch.disabled, title: 'Disabled', type: 'color' }), - Option({ opt: options.theme.bar.menus.switch.puck, title: 'Puck', type: 'color' }), - - Header('Check/Radio Buttons'), - Option({ - opt: options.theme.bar.menus.check_radio_button.background, - title: 'Background', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.check_radio_button.active, title: 'Active', type: 'color' }), - - Header('Buttons'), - Option({ opt: options.theme.bar.menus.buttons.default, title: 'Primary', type: 'color' }), - Option({ opt: options.theme.bar.menus.buttons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.buttons.disabled, title: 'Disabled', type: 'color' }), - Option({ opt: options.theme.bar.menus.buttons.text, title: 'Text', type: 'color' }), - - Header('Icon Buttons'), - Option({ opt: options.theme.bar.menus.iconbuttons.passive, title: 'Primary', type: 'color' }), - Option({ opt: options.theme.bar.menus.iconbuttons.active, title: 'Active/Hovered', type: 'color' }), - - Header('Progress Bar'), - Option({ opt: options.theme.bar.menus.progressbar.foreground, title: 'Primary', type: 'color' }), - Option({ opt: options.theme.bar.menus.progressbar.background, title: 'Background', type: 'color' }), - - Header('Slider'), - Option({ opt: options.theme.bar.menus.slider.primary, title: 'Primary', type: 'color' }), - Option({ opt: options.theme.bar.menus.slider.background, title: 'Background', type: 'color' }), - Option({ - opt: options.theme.bar.menus.slider.backgroundhover, - title: 'Background (Hover)', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.slider.puck, title: 'Puck', type: 'color' }), - - Header('Dropdown Menu'), - Option({ opt: options.theme.bar.menus.dropdownmenu.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.menus.dropdownmenu.text, title: 'Text', type: 'color' }), - Option({ opt: options.theme.bar.menus.dropdownmenu.divider, title: 'Divider', type: 'color' }), - - Header('Tooltips'), - Option({ opt: options.theme.bar.menus.tooltip.background, title: 'Background', type: 'color' }), - Option({ opt: options.theme.bar.menus.tooltip.text, title: 'Text', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/matugen.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/matugen.ts deleted file mode 100644 index 6f7a208..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/matugen.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const Matugen = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Matugen Settings'), - Option({ - opt: options.theme.matugen, - title: 'Enable Matugen', - subtitle: 'WARNING: THIS WILL REPLACE YOUR CURRENT COLOR SCHEME!!!', - type: 'boolean', - dependencies: ['matugen', 'swww'], - }), - Option({ - opt: options.theme.matugen_settings.mode, - title: 'Matugen Theme', - type: 'enum', - enums: ['light', 'dark'], - }), - Option({ - opt: options.theme.matugen_settings.scheme_type, - title: 'Matugen Scheme', - type: 'enum', - enums: [ - 'content', - 'expressive', - 'fidelity', - 'fruit-salad', - 'monochrome', - 'neutral', - 'rainbow', - 'tonal-spot', - ], - }), - Option({ - opt: options.theme.matugen_settings.variation, - title: 'Matugen Variation', - type: 'enum', - enums: [ - 'standard_1', - 'standard_2', - 'standard_3', - 'monochrome_1', - 'monochrome_2', - 'monochrome_3', - 'vivid_1', - 'vivid_2', - 'vivid_3', - ], - }), - Option({ - opt: options.theme.matugen_settings.contrast, - title: 'Contrast', - subtitle: 'Range: -1 to 1 (Default: 0)', - type: 'float', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/media.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/media.ts deleted file mode 100644 index 6058cd9..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/media.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const MediaMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page media paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Media Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.media.song, title: 'Song', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.media.artist, title: 'Artist', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.media.album, title: 'Album', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.media.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.media.border.color, title: 'Border', type: 'color' }), - - Header('Card/Album Art'), - Option({ opt: options.theme.bar.menus.menu.media.card.color, title: 'Color', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.media.card.tint, - title: 'Tint', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - - Header('Buttons'), - Option({ - opt: options.theme.bar.menus.menu.media.buttons.inactive, - title: 'Unavailable', - subtitle: "Disabled button when media control isn't available.", - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.media.buttons.enabled, - title: 'Enabled', - subtitle: 'Ex: Button color when shuffle/loop is enabled.', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.media.buttons.background, - title: 'Background', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.media.buttons.text, title: 'Text', type: 'color' }), - - Header('Slider'), - Option({ - opt: options.theme.bar.menus.menu.media.slider.primary, - title: 'Primary Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.media.slider.background, - title: 'Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.media.slider.backgroundhover, - title: 'Backround (Hover)', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.media.slider.puck, title: 'Puck', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/network.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/network.ts deleted file mode 100644 index b06dfc5..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/network.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const NetworkMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page network paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Network Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.network.text, title: 'Text', type: 'color' }), - - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.network.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.network.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.network.border.color, title: 'Border', type: 'color' }), - - Header('Label'), - Option({ opt: options.theme.bar.menus.menu.network.label.color, title: 'Label', type: 'color' }), - - Header('Status'), - Option({ - opt: options.theme.bar.menus.menu.network.status.color, - title: 'Connection Status', - type: 'color', - }), - - Header('Switch'), - Option({ - opt: options.theme.bar.menus.menu.network.switch.enabled, - title: 'Enabled', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.network.switch.disabled, - title: 'Disabled', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.network.switch.puck, title: 'Puck', type: 'color' }), - - Header('List Items'), - Option({ - opt: options.theme.bar.menus.menu.network.listitems.active, - title: 'Active/Hover', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.network.listitems.passive, - title: 'Passive', - type: 'color', - }), - - Header('Icons'), - Option({ opt: options.theme.bar.menus.menu.network.icons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.network.icons.passive, title: 'Passive', type: 'color' }), - - Header('Icon Buttons'), - Option({ - opt: options.theme.bar.menus.menu.network.iconbuttons.active, - title: 'Active', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.network.iconbuttons.passive, - title: 'Passive', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/notifications.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/notifications.ts deleted file mode 100644 index c313ac6..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/notifications.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const NotificationsMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page notifications paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Notifications Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.notifications.label, title: 'Menu Label', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.notifications.card, title: 'Card', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.notifications.background, - title: 'Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.no_notifications_label, - title: 'Empty Notifications Backdrop', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.notifications.border, title: 'Border', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.notifications.switch_divider, - title: 'Switch Divider', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.clear, - title: 'Clear Notifications Button', - type: 'color', - }), - - Header('Switch'), - Option({ - opt: options.theme.bar.menus.menu.notifications.switch.enabled, - title: 'Enabled', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.switch.disabled, - title: 'Disabled', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.notifications.switch.puck, title: 'Puck', type: 'color' }), - - Header('Scrollbar'), - Option({ - opt: options.theme.bar.menus.menu.notifications.scrollbar.color, - title: 'Scrollbar Color', - type: 'color', - }), - - Header('Pagination'), - Option({ - opt: options.theme.bar.menus.menu.notifications.pager.background, - title: 'Pager Footer Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.pager.button, - title: 'Pager Button Color', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.notifications.pager.label, - title: 'Pager Label Color', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/power.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/power.ts deleted file mode 100644 index 43e7398..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/power.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const PowerMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page power paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.power.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.power.border.color, title: 'Border', type: 'color' }), - - Header('Shutdown Button'), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.shutdown.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.shutdown.icon_background, - title: 'Icon Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.shutdown.text, - title: 'Label Text', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.power.buttons.shutdown.icon, title: 'Icon', type: 'color' }), - - Header('Reboot Button'), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.restart.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.restart.icon_background, - title: 'Icon Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.restart.text, - title: 'Label Text', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.power.buttons.restart.icon, title: 'Icon', type: 'color' }), - - Header('Logout Button'), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.logout.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.logout.icon_background, - title: 'Icon Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.logout.text, - title: 'Label Text', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.power.buttons.logout.icon, title: 'Icon', type: 'color' }), - - Header('Sleep Button'), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.sleep.background, - title: 'Label Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.sleep.icon_background, - title: 'Icon Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.power.buttons.sleep.text, - title: 'Label Text', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.power.buttons.sleep.icon, title: 'Icon', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/systray.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/systray.ts deleted file mode 100644 index 5276a03..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/systray.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const SystrayMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page systray paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Dropdown Menu'), - Option({ - opt: options.theme.bar.menus.menu.systray.dropdownmenu.background, - title: 'Background', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.systray.dropdownmenu.text, title: 'Text', type: 'color' }), - Option({ - opt: options.theme.bar.menus.menu.systray.dropdownmenu.divider, - title: 'Section Divider', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/menus/volume.ts b/ags/HyprPanel/widget/settings/pages/theme/menus/volume.ts deleted file mode 100644 index efad554..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/menus/volume.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const VolumeMenuTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'menu-theme-page volume paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Volume Menu Theme Settings'), - Option({ opt: options.theme.bar.menus.menu.volume.text, title: 'Text', type: 'color' }), - - Header('Card'), - Option({ opt: options.theme.bar.menus.menu.volume.card.color, title: 'Card', type: 'color' }), - - Header('Background'), - Option({ - opt: options.theme.bar.menus.menu.volume.background.color, - title: 'Background', - type: 'color', - }), - - Header('Border'), - Option({ opt: options.theme.bar.menus.menu.volume.border.color, title: 'Border', type: 'color' }), - - Header('Label'), - Option({ opt: options.theme.bar.menus.menu.volume.label.color, title: 'Label', type: 'color' }), - - Header('List Items'), - Option({ - opt: options.theme.bar.menus.menu.volume.listitems.active, - title: 'Active/Hover', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.volume.listitems.passive, title: 'Passive', type: 'color' }), - - Header('Icon Button'), - Option({ - opt: options.theme.bar.menus.menu.volume.iconbutton.active, - title: 'Active/Hover', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.volume.iconbutton.passive, - title: 'Passive', - type: 'color', - }), - - Header('Icons'), - Option({ opt: options.theme.bar.menus.menu.volume.icons.active, title: 'Active', type: 'color' }), - Option({ opt: options.theme.bar.menus.menu.volume.icons.passive, title: 'Passive', type: 'color' }), - - Header('Audio Slider'), - Option({ - opt: options.theme.bar.menus.menu.volume.audio_slider.primary, - title: 'Primary', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.volume.audio_slider.background, - title: 'Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.volume.audio_slider.backgroundhover, - title: 'Background (Hover)', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.volume.audio_slider.puck, title: 'Puck', type: 'color' }), - - Header('Input Slider'), - Option({ - opt: options.theme.bar.menus.menu.volume.input_slider.primary, - title: 'Primary', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.volume.input_slider.background, - title: 'Background', - type: 'color', - }), - Option({ - opt: options.theme.bar.menus.menu.volume.input_slider.backgroundhover, - title: 'Background (Hover)', - type: 'color', - }), - Option({ opt: options.theme.bar.menus.menu.volume.input_slider.puck, title: 'Puck', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/notifications/index.ts b/ags/HyprPanel/widget/settings/pages/theme/notifications/index.ts deleted file mode 100644 index 25adf1a..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/notifications/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const NotificationsTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'notifications-theme-page paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('Notifications Theme Settings'), - Option({ opt: options.theme.notification.background, title: 'Notification Background', type: 'color' }), - Option({ - opt: options.theme.notification.opacity, - title: 'Notification Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ - opt: options.theme.notification.actions.background, - title: 'Action Button Background', - subtitle: 'Buttons that perform actions within a notification', - type: 'color', - }), - Option({ - opt: options.theme.notification.actions.text, - title: 'Action Button Text Color', - type: 'color', - }), - Option({ opt: options.theme.notification.label, title: 'Label', type: 'color' }), - Option({ opt: options.theme.notification.border, title: 'Border', type: 'color' }), - Option({ opt: options.theme.notification.time, title: 'Time Stamp', type: 'color' }), - Option({ opt: options.theme.notification.text, title: 'Body Text', type: 'color' }), - Option({ - opt: options.theme.notification.labelicon, - title: 'Label Icon', - subtitle: "Icon that accompanies the label. Doesn't apply if icon is an app icon.", - type: 'color', - }), - Option({ - opt: options.theme.notification.close_button.background, - title: 'Dismiss Button', - type: 'color', - }), - Option({ - opt: options.theme.notification.close_button.label, - title: 'Dismiss Button Text', - type: 'color', - }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/pages/theme/osd/index.ts b/ags/HyprPanel/widget/settings/pages/theme/osd/index.ts deleted file mode 100644 index def8846..0000000 --- a/ags/HyprPanel/widget/settings/pages/theme/osd/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Option } from 'widget/settings/shared/Option'; -import { Header } from 'widget/settings/shared/Header'; - -import options from 'options'; -import Scrollable from 'types/widgets/scrollable'; -import { Attribute, Child } from 'lib/types/widget'; - -export const OsdTheme = (): Scrollable => { - return Widget.Scrollable({ - vscroll: 'automatic', - hscroll: 'automatic', - class_name: 'osd-theme-page paged-container', - vexpand: true, - child: Widget.Box({ - vertical: true, - children: [ - Header('On Screen Display Settings'), - Option({ - opt: options.theme.osd.opacity, - title: 'OSD Opacity', - type: 'number', - increment: 5, - min: 0, - max: 100, - }), - Option({ opt: options.theme.osd.bar_color, title: 'Bar', type: 'color' }), - Option({ - opt: options.theme.osd.bar_overflow_color, - title: 'Bar Overflow', - subtitle: 'Overflow color is for when the volume goes over a 100', - type: 'color', - }), - Option({ opt: options.theme.osd.bar_empty_color, title: 'Bar Background', type: 'color' }), - Option({ opt: options.theme.osd.bar_container, title: 'Bar Container', type: 'color' }), - Option({ opt: options.theme.osd.icon, title: 'Icon', type: 'color' }), - Option({ opt: options.theme.osd.icon_container, title: 'Icon Container', type: 'color' }), - Option({ opt: options.theme.osd.label, title: 'Value Text', type: 'color' }), - ], - }), - }); -}; diff --git a/ags/HyprPanel/widget/settings/shared/FileChooser.ts b/ags/HyprPanel/widget/settings/shared/FileChooser.ts deleted file mode 100644 index b7b5f32..0000000 --- a/ags/HyprPanel/widget/settings/shared/FileChooser.ts +++ /dev/null @@ -1,251 +0,0 @@ -import Gtk from 'gi://Gtk?version=3.0'; -import Gio from 'gi://Gio'; -import { bash, Notify } from 'lib/utils'; -import icons from 'lib/icons'; -import { Config } from 'lib/types/filechooser'; -import { hexColorPattern } from 'globals/useTheme'; -import { isHexColor } from 'globals/variables'; - -const whiteListedThemeProp = ['theme.bar.buttons.style']; - -export const loadJsonFile = (filePath: string): Config | null => { - const file = Gio.File.new_for_path(filePath as string); - const [success, content] = file.load_contents(null); - - if (!success) { - console.error(`Failed to import: ${filePath}`); - return null; - } - - const jsonString = new TextDecoder('utf-8').decode(content); - return JSON.parse(jsonString); -}; - -export const saveConfigToFile = (config: object, filePath: string): void => { - const file = Gio.File.new_for_path(filePath); - const outputStream = file.replace(null, false, Gio.FileCreateFlags.NONE, null); - const dataOutputStream = new Gio.DataOutputStream({ base_stream: outputStream }); - - const jsonString = JSON.stringify(config, null, 2); - dataOutputStream.put_string(jsonString, null); - dataOutputStream.close(null); -}; - -export const filterConfigForThemeOnly = (config: Config): Config => { - const filteredConfig: Config = {}; - - for (const key in config) { - const value = config[key]; - if (typeof value === 'string' && hexColorPattern.test(value)) { - filteredConfig[key] = config[key]; - } else if (whiteListedThemeProp.includes(key)) { - filteredConfig[key] = config[key]; - } - } - return filteredConfig; -}; - -export const filterConfigForNonTheme = (config: Config): Config => { - const filteredConfig: Config = {}; - for (const key in config) { - if (whiteListedThemeProp.includes(key)) { - continue; - } - - const value = config[key]; - if (!(typeof value === 'string' && hexColorPattern.test(value))) { - filteredConfig[key] = config[key]; - } - } - return filteredConfig; -}; - -export const saveFileDialog = (filePath: string, themeOnly: boolean): void => { - const original_file_path = filePath; - - const file = Gio.File.new_for_path(original_file_path); - const [success, content] = file.load_contents(null); - - if (!success) { - console.error(`Could not find 'config.json' at ${TMP}`); - return; - } - - const jsonString = new TextDecoder('utf-8').decode(content); - const jsonObject = JSON.parse(jsonString); - - // Function to filter hex color pairs - const filterHexColorPairs = (jsonObject: Config): Config => { - const filteredObject: Config = {}; - - for (const key in jsonObject) { - const value = jsonObject[key]; - if (typeof value === 'string' && isHexColor(value)) { - filteredObject[key] = jsonObject[key]; - } else if (whiteListedThemeProp.includes(key)) { - filteredObject[key] = jsonObject[key]; - } - } - - return filteredObject; - }; - - // Function to filter out hex color pairs (keep only non-hex color value) - const filterOutHexColorPairs = (jsonObject: Config): Config => { - const filteredObject: Config = {}; - - for (const key in jsonObject) { - // do not add key-value pair if its in whiteListedThemeProp - if (whiteListedThemeProp.includes(key)) { - continue; - } - - const value = jsonObject[key]; - if (!(typeof value === 'string' && isHexColor(value))) { - filteredObject[key] = jsonObject[key]; - } - } - - return filteredObject; - }; - - // Filter the JSON object based on the themeOnly flag - const filteredJsonObject = themeOnly ? filterHexColorPairs(jsonObject) : filterOutHexColorPairs(jsonObject); - const filteredContent = JSON.stringify(filteredJsonObject, null, 2); - - const dialog = new Gtk.FileChooserDialog({ - title: 'Save File As', - action: Gtk.FileChooserAction.SAVE, - }); - - dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); - dialog.add_button(Gtk.STOCK_SAVE, Gtk.ResponseType.ACCEPT); - dialog.set_current_name(themeOnly ? 'hyprpanel_theme.json' : 'hyprpanel_config.json'); - - const response = dialog.run(); - - if (response === Gtk.ResponseType.ACCEPT) { - const file_path = dialog.get_filename(); - console.info(`Original file path: ${file_path}`); - - const getIncrementedFilePath = (filePath: string): string => { - let increment = 1; - const baseName = filePath.replace(/(\.\w+)$/, ''); - const match = filePath.match(/(\.\w+)$/); - const extension = match ? match[0] : ''; - - let newFilePath = filePath; - let file = Gio.File.new_for_path(newFilePath); - - while (file.query_exists(null)) { - newFilePath = `${baseName}_${increment}${extension}`; - file = Gio.File.new_for_path(newFilePath); - increment++; - } - - return newFilePath; - }; - - const finalFilePath = getIncrementedFilePath(file_path as string); - console.info(`File will be saved at: ${finalFilePath}`); - - try { - const save_file = Gio.File.new_for_path(finalFilePath); - const outputStream = save_file.replace(null, false, Gio.FileCreateFlags.NONE, null); - const dataOutputStream = new Gio.DataOutputStream({ - base_stream: outputStream, - }); - - dataOutputStream.put_string(filteredContent, null); - - dataOutputStream.close(null); - - Notify({ - summary: 'File Saved Successfully', - body: `At ${finalFilePath}.`, - iconName: icons.ui.info, - timeout: 5000, - }); - } catch (e) { - if (e instanceof Error) { - console.error('Failed to write to file:', e.message); - } - } - } - - dialog.destroy(); -}; - -export const importFiles = (themeOnly: boolean = false): void => { - const dialog = new Gtk.FileChooserDialog({ - title: `Import ${themeOnly ? 'Theme' : 'Config'}`, - action: Gtk.FileChooserAction.OPEN, - }); - dialog.set_current_folder(`${App.configDir}/themes`); - dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL); - dialog.add_button(Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT); - - const response = dialog.run(); - - if (response === Gtk.ResponseType.CANCEL) { - dialog.destroy(); - return; - } - if (response === Gtk.ResponseType.ACCEPT) { - const filePath: string | null = dialog.get_filename(); - - if (filePath === null) { - Notify({ - summary: 'Failed to import', - body: 'No file selected.', - iconName: icons.ui.warning, - timeout: 5000, - }); - return; - } - - const importedConfig = loadJsonFile(filePath); - - if (!importedConfig) { - dialog.destroy(); - return; - } - - Notify({ - summary: `Importing ${themeOnly ? 'Theme' : 'Config'}`, - body: `Importing: ${filePath}`, - iconName: icons.ui.info, - timeout: 7000, - }); - - const tmpConfigFile = Gio.File.new_for_path(`${TMP}/config.json`); - const optionsConfigFile = Gio.File.new_for_path(OPTIONS); - - const [tmpSuccess, tmpContent] = tmpConfigFile.load_contents(null); - const [optionsSuccess, optionsContent] = optionsConfigFile.load_contents(null); - - if (!tmpSuccess || !optionsSuccess) { - console.error('Failed to read existing configuration files.'); - dialog.destroy(); - return; - } - - let tmpConfig = JSON.parse(new TextDecoder('utf-8').decode(tmpContent)); - let optionsConfig = JSON.parse(new TextDecoder('utf-8').decode(optionsContent)); - - if (themeOnly) { - const filteredConfig = filterConfigForThemeOnly(importedConfig); - tmpConfig = { ...tmpConfig, ...filteredConfig }; - optionsConfig = { ...optionsConfig, ...filteredConfig }; - } else { - const filteredConfig = filterConfigForNonTheme(importedConfig); - tmpConfig = { ...tmpConfig, ...filteredConfig }; - optionsConfig = { ...optionsConfig, ...filteredConfig }; - } - - saveConfigToFile(tmpConfig, `${TMP}/config.json`); - saveConfigToFile(optionsConfig, OPTIONS); - } - dialog.destroy(); - bash('pkill ags && ags'); -}; diff --git a/ags/HyprPanel/widget/settings/shared/Header.ts b/ags/HyprPanel/widget/settings/shared/Header.ts deleted file mode 100644 index ac25e01..0000000 --- a/ags/HyprPanel/widget/settings/shared/Header.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { GBox } from 'lib/types/widget'; - -export const Header = (headerName: string): GBox => { - return Widget.Box({ - class_name: 'options-header', - children: [ - Widget.Label({ - class_name: 'label-name', - label: headerName, - }), - Widget.Separator({ - vpack: 'center', - hexpand: true, - class_name: 'menu-separator', - }), - ], - }); -}; diff --git a/ags/HyprPanel/widget/settings/shared/Inputter.ts b/ags/HyprPanel/widget/settings/shared/Inputter.ts deleted file mode 100644 index ed52dc1..0000000 --- a/ags/HyprPanel/widget/settings/shared/Inputter.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { RowProps } from 'lib/types/options'; -import { Variable } from 'types/variable'; -import { BoxWidget } from 'lib/types/widget'; -import { numberInputter } from './components/number'; -import { objectInputter } from './components/object'; -import { stringInputter } from './components/string'; -import { booleanInputter } from './components/boolean'; -import { imageInputter } from './components/image'; -import { importInputter } from './components/import'; -import { wallpaperInputter } from './components/wallpaper'; -import { colorInputter } from './components/color'; -import { enumInputter } from './components/enum'; -import { fontInputter } from './components/font'; - -export const Inputter = ( - { - opt, - type = typeof opt.value as RowProps['type'], - enums, - disabledBinding, - dependencies, - exportData, - min = 0, - max = 1000000, - increment = 1, - }: RowProps, - className: string, - isUnsaved: Variable, -): BoxWidget => { - return Widget.Box({ - vpack: 'center', - class_name: /export|import/.test(type || '') ? '' : 'inputter-container', - setup: (self) => { - switch (type) { - case 'number': - return numberInputter(self, opt, min, max, increment, isUnsaved); - case 'float': - case 'object': - return objectInputter(self, opt, isUnsaved, className); - case 'string': - return stringInputter(self, opt, isUnsaved); - case 'enum': - return enumInputter(self, opt, enums!); - case 'boolean': - return booleanInputter(self, opt, disabledBinding, dependencies); - case 'img': - return imageInputter(self, opt); - case 'config_import': - return importInputter(self, exportData); - case 'wallpaper': - return wallpaperInputter(self, opt); - case 'font': - return fontInputter(self, opt); - case 'color': - return colorInputter(self, opt); - default: - return (self.child = Widget.Label({ - label: `No setter with type ${type}`, - })); - } - }, - }); -}; diff --git a/ags/HyprPanel/widget/settings/shared/Label.ts b/ags/HyprPanel/widget/settings/shared/Label.ts deleted file mode 100644 index 320ac57..0000000 --- a/ags/HyprPanel/widget/settings/shared/Label.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { GBox, GButton, GLabel } from 'lib/types/widget'; - -export const Label = (name: string, sub = '', subtitleLink = ''): GBox => { - const subTitle = (): GButton | GLabel => { - if (subtitleLink.length) { - return Widget.Button({ - hpack: 'start', - vpack: 'center', - class_name: 'options-sublabel-link', - label: sub, - on_primary_click: () => Utils.execAsync(`bash -c 'xdg-open ${subtitleLink}'`), - }); - } - return Widget.Label({ - hpack: 'start', - vpack: 'center', - class_name: 'options-sublabel', - label: sub, - }); - }; - return Widget.Box({ - vertical: true, - hpack: 'start', - children: [ - Widget.Label({ - hpack: 'start', - vpack: 'center', - class_name: 'options-label', - label: name, - }), - subTitle(), - ], - }); -}; diff --git a/ags/HyprPanel/widget/settings/shared/Option.ts b/ags/HyprPanel/widget/settings/shared/Option.ts deleted file mode 100644 index 1807469..0000000 --- a/ags/HyprPanel/widget/settings/shared/Option.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Label } from './Label'; -import { Inputter } from './Inputter'; -import icons from 'lib/icons'; -import { RowProps } from 'lib/types/options'; -import { GBox } from 'lib/types/widget'; - -export const Option = ( - props: RowProps, - className: string = '', -): GBox => { - const isUnsaved = Variable(false); - - return Widget.Box({ - class_name: 'option-item', - hexpand: true, - children: [ - Widget.Box({ - hpack: 'start', - vpack: 'center', - hexpand: true, - child: Label(props.title, props.subtitle || '', props.subtitleLink), - }), - Inputter(props, className, isUnsaved), - Widget.Button({ - vpack: 'center', - class_name: 'reset-options', - child: Widget.Icon(icons.ui.refresh), - on_clicked: () => props.opt.reset(), - sensitive: props.opt.bind().as((v) => v !== props.opt.initial), - }), - ], - }); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/boolean.ts b/ags/HyprPanel/widget/settings/shared/components/boolean.ts deleted file mode 100644 index cb8255a..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/boolean.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import { Variable } from 'types/variable'; - -import { dependencies as checkDependencies } from 'lib/utils'; - -export const booleanInputter = ( - self: BoxWidget, - opt: Opt, - disabledBinding: Variable | undefined, - dependencies: string[] | undefined, -): Attribute => { - return (self.child = Widget.Switch({ - sensitive: disabledBinding !== undefined ? disabledBinding.bind('value').as((disabled) => !disabled) : true, - }) - .on('notify::active', (self) => { - if (disabledBinding !== undefined && disabledBinding.value) { - return; - } - if (self.active && dependencies !== undefined && !dependencies.every((d) => checkDependencies(d))) { - self.active = false; - return; - } - opt.value = self.active as T; - }) - .hook(opt, (self) => { - self.active = opt.value as boolean; - })); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/color.ts b/ags/HyprPanel/widget/settings/shared/components/color.ts deleted file mode 100644 index 4212e7f..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/color.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Gdk from 'gi://Gdk'; -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; - -export const colorInputter = (self: BoxWidget, opt: Opt): Attribute => { - return (self.child = Widget.ColorButton() - .hook(opt, (self) => { - const rgba = new Gdk.RGBA(); - rgba.parse(opt.value as string); - self.rgba = rgba; - }) - .on('color-set', ({ rgba: { red, green, blue } }) => { - const hex = (n: number): string => { - const c = Math.floor(255 * n).toString(16); - return c.length === 1 ? `0${c}` : c; - }; - opt.value = `#${hex(red)}${hex(green)}${hex(blue)}` as T; - })); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/enum.ts b/ags/HyprPanel/widget/settings/shared/components/enum.ts deleted file mode 100644 index 423dba0..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/enum.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Opt } from 'lib/option'; -import { BoxWidget } from 'lib/types/widget'; -import icons from 'lib/icons'; -import { Box } from 'types/@girs/gtk-3.0/gtk-3.0.cjs'; - -export const enumInputter = ( - self: BoxWidget, - opt: Opt, - values: T[], -): Box => { - const lbl = Widget.Label({ label: opt.bind().as((v) => `${v}`) }); - const step = (dir: 1 | -1): void => { - const i = values.findIndex((i) => i === lbl.label); - opt.setValue( - dir > 0 - ? i + dir > values.length - 1 - ? values[0] - : values[i + dir] - : i + dir < 0 - ? values[values.length - 1] - : values[i + dir], - ); - }; - const next = Widget.Button({ - child: Widget.Icon(icons.ui.arrow.right), - on_clicked: () => step(+1), - }); - const prev = Widget.Button({ - child: Widget.Icon(icons.ui.arrow.left), - on_clicked: () => step(-1), - }); - return (self.child = Widget.Box({ - class_name: 'enum-setter', - children: [lbl, prev, next], - })); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/font.ts b/ags/HyprPanel/widget/settings/shared/components/font.ts deleted file mode 100644 index 4428888..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/font.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget, Child } from 'lib/types/widget'; -import FontButton from 'types/widgets/fontbutton'; - -export const fontInputter = (self: BoxWidget, opt: Opt): FontButton => { - return (self.child = Widget.FontButton({ - show_size: false, - use_size: false, - setup: (self) => - self - .hook(opt, () => (self.font = opt.value as string)) - .on('font-set', ({ font }) => (opt.value = font!.split(' ').slice(0, -1).join(' ') as T)), - })); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/image.ts b/ags/HyprPanel/widget/settings/shared/components/image.ts deleted file mode 100644 index 1906004..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/image.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget, Child } from 'lib/types/widget'; -import FileChooserButton from 'types/widgets/filechooserbutton'; - -export const imageInputter = (self: BoxWidget, opt: Opt): Attribute => { - self.child = createFileChooserButton(opt); - return self.child; -}; - -const createFileChooserButton = (opt: Opt): FileChooserButton => { - return Widget.FileChooserButton({ - class_name: 'image-chooser', - on_file_set: handleFileSet(opt), - }); -}; - -const handleFileSet = - (opt: Opt) => - ({ uri }: { uri: string | null }): void => { - if (!uri) { - console.warn('No URI selected'); - return; - } - - try { - const decodedPath = decodeURIComponent(uri.replace('file://', '')); - opt.value = decodedPath as T; - } catch (error) { - console.error('Failed to decode URI:', error); - } - }; diff --git a/ags/HyprPanel/widget/settings/shared/components/import.ts b/ags/HyprPanel/widget/settings/shared/components/import.ts deleted file mode 100644 index 7ab779a..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/import.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ThemeExportData } from 'lib/types/options'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import { importFiles, saveFileDialog } from '../FileChooser'; - -export const importInputter = (self: BoxWidget, exportData?: ThemeExportData): Attribute => { - return (self.child = Widget.Box({ - children: [ - Widget.Button({ - class_name: 'options-import', - label: 'import', - on_clicked: () => { - importFiles(exportData?.themeOnly as boolean); - }, - }), - Widget.Button({ - class_name: 'options-export', - label: 'export', - on_clicked: () => { - saveFileDialog(exportData?.filePath as string, exportData?.themeOnly as boolean); - }, - }), - ], - })); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/number.ts b/ags/HyprPanel/widget/settings/shared/components/number.ts deleted file mode 100644 index 893de70..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/number.ts +++ /dev/null @@ -1,45 +0,0 @@ -import icons from 'lib/icons'; -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import { Variable } from 'types/variable'; - -export const numberInputter = ( - self: BoxWidget, - opt: Opt, - min: number, - max: number, - increment = 1, - isUnsaved: Variable, -): Attribute => { - return (self.children = [ - Widget.Box({ - class_name: 'unsaved-icon-container', - child: isUnsaved.bind('value').as((unsvd) => { - if (unsvd) { - return Widget.Icon({ - class_name: 'unsaved-icon', - icon: icons.ui.warning, - tooltipText: "Press 'Enter' to apply your changes.", - }); - } - return Widget.Box(); - }), - }), - Widget.SpinButton({ - setup(self) { - self.set_range(min, max); - self.set_increments(1 * increment, 5 * increment); - self.on('value-changed', () => { - opt.value = self.value as T; - }); - self.hook(opt, () => { - self.value = opt.value as number; - isUnsaved.value = Number(self.text) !== (opt.value as number); - }); - self.connect('key-release-event', () => { - isUnsaved.value = Number(self.text) !== (opt.value as number); - }); - }, - }), - ]); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/object.ts b/ags/HyprPanel/widget/settings/shared/components/object.ts deleted file mode 100644 index b6efeec..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/object.ts +++ /dev/null @@ -1,37 +0,0 @@ -import icons from 'lib/icons'; -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import { Variable } from 'types/variable'; - -export const objectInputter = ( - self: BoxWidget, - opt: Opt, - isUnsaved: Variable, - className: string, -): Attribute => { - return (self.children = [ - Widget.Box({ - class_name: 'unsaved-icon-container', - child: isUnsaved.bind('value').as((unsvd) => { - if (unsvd) { - return Widget.Icon({ - class_name: 'unsaved-icon', - icon: icons.ui.warning, - tooltipText: "Press 'Enter' to apply your changes.", - }); - } - return Widget.Box(); - }), - }), - Widget.Entry({ - class_name: className, - on_change: (self) => (isUnsaved.value = self.text !== JSON.stringify(opt.value)), - on_accept: (self) => (opt.value = JSON.parse(self.text || '')), - setup: (self) => - self.hook(opt, () => { - self.text = JSON.stringify(opt.value); - isUnsaved.value = self.text !== JSON.stringify(opt.value); - }), - }), - ]); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/string.ts b/ags/HyprPanel/widget/settings/shared/components/string.ts deleted file mode 100644 index 56d18c2..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/string.ts +++ /dev/null @@ -1,34 +0,0 @@ -import icons from 'lib/icons'; -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import { Variable } from 'types/variable'; - -export const stringInputter = (self: BoxWidget, opt: Opt, isUnsaved: Variable): Attribute => { - return (self.children = [ - Widget.Box({ - class_name: 'unsaved-icon-container', - child: isUnsaved.bind('value').as((unsvd) => { - if (unsvd) { - return Widget.Icon({ - class_name: 'unsaved-icon', - icon: icons.ui.warning, - tooltipText: "Press 'Enter' to apply your changes.", - }); - } - return Widget.Box(); - }), - }), - Widget.Entry({ - class_name: isUnsaved.bind('value').as((unsaved) => (unsaved ? 'unsaved' : '')), - on_change: (self) => (isUnsaved.value = self.text !== opt.value), - on_accept: (self) => { - opt.value = self.text as T; - }, - setup: (self) => - self.hook(opt, () => { - isUnsaved.value = self.text !== opt.value; - self.text = opt.value as string; - }), - }), - ]); -}; diff --git a/ags/HyprPanel/widget/settings/shared/components/wallpaper.ts b/ags/HyprPanel/widget/settings/shared/components/wallpaper.ts deleted file mode 100644 index 5e11165..0000000 --- a/ags/HyprPanel/widget/settings/shared/components/wallpaper.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Opt } from 'lib/option'; -import { Attribute, BoxWidget } from 'lib/types/widget'; -import Wallpaper from 'services/Wallpaper'; - -export const wallpaperInputter = ( - self: BoxWidget, - opt: Opt, -): Attribute | void => { - if (typeof opt.value === 'string') { - return (self.child = Widget.FileChooserButton({ - on_file_set: ({ uri }) => { - const newValue: string = uri!.replace('file://', ''); - opt.value = newValue as T; - if (options.wallpaper.enable.value) { - Wallpaper.set(newValue); - } - }, - })); - } -}; diff --git a/ags/HyprPanel/widget/settings/side_effects/index.ts b/ags/HyprPanel/widget/settings/side_effects/index.ts deleted file mode 100644 index 6e268c1..0000000 --- a/ags/HyprPanel/widget/settings/side_effects/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import options from 'options'; - -const { show_numbered, show_icons, showWsIcons } = options.bar.workspaces; -const { monochrome: monoBar } = options.theme.bar.buttons; -const { monochrome: monoMenu } = options.theme.bar.menus; -const { matugen } = options.theme; - -show_numbered.connect('changed', ({ value }) => { - if (value === true) { - show_icons.value = false; - showWsIcons.value = false; - } -}); - -show_icons.connect('changed', ({ value }) => { - if (value === true) { - show_numbered.value = false; - showWsIcons.value = false; - } -}); - -showWsIcons.connect('changed', ({ value }) => { - if (value === true) { - show_numbered.value = false; - show_icons.value = false; - } -}); - -matugen.connect('changed', ({ value }) => { - if (value === true) { - monoBar.value = false; - monoMenu.value = false; - } -}); diff --git a/ags/bar/config.js b/ags/bar/config.js deleted file mode 100644 index ae44313..0000000 --- a/ags/bar/config.js +++ /dev/null @@ -1,219 +0,0 @@ -const hyprland = await Service.import("hyprland") -const notifications = await Service.import("notifications") -const mpris = await Service.import("mpris") -const audio = await Service.import("audio") -const battery = await Service.import("battery") -const systemtray = await Service.import("systemtray") - -const date = Variable("", { - poll: [1000, 'date "+%H:%M:%S %b %e."'], -}) - -// widgets can be only assigned as a child in one container -// so to make a reuseable widget, make it a function -// then you can simply instantiate one by calling it - -function Workspaces() { - const activeId = hyprland.active.workspace.bind("id") - const workspaces = hyprland.bind("workspaces") - .as(ws => ws.map(({ id }) => Widget.Button({ - on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), - child: Widget.Label(`${id}`), - class_name: activeId.as(i => `${i === id ? "focused" : ""}`), - }))) - - return Widget.Box({ - class_name: "workspaces", - children: workspaces, - }) -} - - -function ClientTitle() { - return Widget.Label({ - class_name: "client-title", - label: hyprland.active.client.bind("title"), - }) -} - - -function Clock() { - return Widget.Label({ - class_name: "clock", - label: date.bind(), - }) -} - - -// we don't need dunst or any other notification daemon -// because the Notifications module is a notification daemon itself -function Notification() { - const popups = notifications.bind("popups") - return Widget.Box({ - class_name: "notification", - visible: popups.as(p => p.length > 0), - children: [ - Widget.Icon({ - icon: "preferences-system-notifications-symbolic", - }), - Widget.Label({ - label: popups.as(p => p[0]?.summary || ""), - }), - ], - }) -} - - -function Media() { - const label = Utils.watch("", mpris, "player-changed", () => { - if (mpris.players[0]) { - const { track_artists, track_title } = mpris.players[0] - return `${track_artists.join(", ")} - ${track_title}` - } else { - return "Nothing is playing" - } - }) - - return Widget.Button({ - class_name: "media", - on_primary_click: () => mpris.getPlayer("")?.playPause(), - on_scroll_up: () => mpris.getPlayer("")?.next(), - on_scroll_down: () => mpris.getPlayer("")?.previous(), - child: Widget.Label({ label }), - }) -} - - -function Volume() { - const icons = { - 101: "overamplified", - 67: "high", - 34: "medium", - 1: "low", - 0: "muted", - } - - function getIcon() { - const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( - threshold => threshold <= audio.speaker.volume * 100) - - return `audio-volume-${icons[icon]}-symbolic` - } - - const icon = Widget.Icon({ - icon: Utils.watch(getIcon(), audio.speaker, getIcon), - }) - - const slider = Widget.Slider({ - hexpand: true, - draw_value: false, - on_change: ({ value }) => audio.speaker.volume = value, - setup: self => self.hook(audio.speaker, () => { - self.value = audio.speaker.volume || 0 - }), - }) - - return Widget.Box({ - class_name: "volume", - css: "min-width: 180px", - children: [icon, slider], - }) -} - - -function BatteryLabel() { - const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) - const icon = battery.bind("percent").as(p => - `battery-level-${Math.floor(p / 10) * 10}-symbolic`) - - return Widget.Box({ - class_name: "battery", - visible: battery.bind("available"), - children: [ - Widget.Icon({ icon }), - Widget.LevelBar({ - widthRequest: 140, - vpack: "center", - value, - }), - ], - }) -} - - -function SysTray() { - const items = systemtray.bind("items") - .as(items => items.map(item => Widget.Button({ - child: Widget.Icon({ icon: item.bind("icon") }), - on_primary_click: (_, event) => item.activate(event), - on_secondary_click: (_, event) => item.openMenu(event), - tooltip_markup: item.bind("tooltip_markup"), - }))) - - return Widget.Box({ - children: items, - }) -} - - -// layout of the bar -function Left() { - return Widget.Box({ - spacing: 8, - children: [ - Workspaces(), - ClientTitle(), - ], - }) -} - -function Center() { - return Widget.Box({ - spacing: 8, - children: [ - Media(), - Notification(), - ], - }) -} - -function Right() { - return Widget.Box({ - hpack: "end", - spacing: 8, - children: [ - Volume(), - BatteryLabel(), - Clock(), - SysTray(), - ], - }) -} - -function Bar(monitor = 0) { - return Widget.Window({ - name: `bar-${monitor}`, // name has to be unique - class_name: "bar", - monitor, - anchor: ["top", "left", "right"], - exclusivity: "exclusive", - child: Widget.CenterBox({ - start_widget: Left(), - center_widget: Center(), - end_widget: Right(), - }), - }) -} - -App.config({ - style: "./style.css", - windows: [ - Bar(), - - // you can call it, for each monitor - // Bar(0), - // Bar(1) - ], -}) - -export { } \ No newline at end of file diff --git a/ags/bar/style.css b/ags/bar/style.css deleted file mode 100644 index 222caab..0000000 --- a/ags/bar/style.css +++ /dev/null @@ -1,40 +0,0 @@ -window.bar { - background-color: black; - color: @theme_fg_color; -} - -button { - min-width: 0; - padding-top: 0; - padding-bottom: 0; - background-color: transparent; -} - -button:active { - background-color: @theme_selected_bg_color; -} - -button:hover { - border-bottom: 3px solid @theme_fg_color; -} - -label { - font-weight: bold; -} - -.workspaces button.focused { - border-bottom: 3px solid @theme_selected_bg_color; -} - -.client-title { - color: @theme_selected_bg_color; -} - -.notification { - color: yellow; -} - -levelbar block, -highlight { - min-height: 10px; -} \ No newline at end of file diff --git a/ags/launcher/README.md b/ags/launcher/README.md deleted file mode 100644 index 71563ed..0000000 --- a/ags/launcher/README.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Starter Config - -if suggestions don't work, first make sure -you have TypeScript LSP working in your editor - -if you do not want typechecking only suggestions - -```json -// tsconfig.json -"checkJs": false -``` - -types are symlinked to: -/usr/share/com.github.Aylur.ags/types diff --git a/ags/launcher/applauncher.js b/ags/launcher/applauncher.js deleted file mode 100644 index 4b97c7b..0000000 --- a/ags/launcher/applauncher.js +++ /dev/null @@ -1,107 +0,0 @@ -const { query } = await Service.import("applications") -const WINDOW_NAME = "applauncher" - -/** @param {import('resource:///com/github/Aylur/ags/service/applications.js').Application} app */ -const AppItem = app => Widget.Button({ - on_clicked: () => { - App.closeWindow(WINDOW_NAME) - app.launch() - }, - attribute: { app }, - child: Widget.Box({ - children: [ - Widget.Icon({ - icon: app.icon_name || "", - size: 42, - }), - Widget.Label({ - class_name: "title", - label: app.name, - xalign: 0, - vpack: "center", - truncate: "end", - }), - ], - }), -}) - -const Applauncher = ({ width = 500, height = 500, spacing = 12 }) => { - // list of application buttons - let applications = query("").map(AppItem) - - // container holding the buttons - const list = Widget.Box({ - vertical: true, - children: applications, - spacing, - }) - - // repopulate the box, so the most frequent apps are on top of the list - function repopulate() { - applications = query("").map(AppItem) - list.children = applications - } - - // search entry - const entry = Widget.Entry({ - hexpand: true, - css: `margin-bottom: ${spacing}px;`, - - // to launch the first item on Enter - on_accept: () => { - // make sure we only consider visible (searched for) applications - const results = applications.filter((item) => item.visible); - if (results[0]) { - App.toggleWindow(WINDOW_NAME) - results[0].attribute.app.launch() - } - }, - - // filter out the list - on_change: ({ text }) => applications.forEach(item => { - item.visible = item.attribute.app.match(text ?? "") - }), - }) - - return Widget.Box({ - vertical: true, - css: `margin: ${spacing * 2}px;`, - children: [ - entry, - - // wrap the list in a scrollable - Widget.Scrollable({ - hscroll: "never", - css: `min-width: ${width}px;` - + `min-height: ${height}px;`, - child: list, - }), - ], - setup: self => self.hook(App, (_, windowName, visible) => { - if (windowName !== WINDOW_NAME) - return - - // when the applauncher shows up - if (visible) { - repopulate() - entry.text = "" - entry.grab_focus() - } - }), - }) -} - -// there needs to be only one instance -export const applauncher = Widget.Window({ - name: WINDOW_NAME, - setup: self => self.keybind("Escape", () => { - App.closeWindow(WINDOW_NAME) - }), - visible: false, - keymode: "exclusive", - child: Applauncher({ - width: 500, - height: 500, - spacing: 12, - }), -}) \ No newline at end of file diff --git a/ags/launcher/config.js b/ags/launcher/config.js deleted file mode 100644 index 8c69726..0000000 --- a/ags/launcher/config.js +++ /dev/null @@ -1,5 +0,0 @@ -import { applauncher } from "./applauncher.js" - -App.config({ - windows: [applauncher], -}) \ No newline at end of file diff --git a/ags/launcher/tsconfig.json b/ags/launcher/tsconfig.json deleted file mode 100644 index f03f2d1..0000000 --- a/ags/launcher/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ES2022", - "lib": [ - "ES2022" - ], - "allowJs": true, - "checkJs": true, - "strict": true, - "noImplicitAny": false, - "baseUrl": ".", - "typeRoots": [ - "./types" - ], - "skipLibCheck": true - } -} \ No newline at end of file diff --git a/ags/launcher/types b/ags/launcher/types deleted file mode 120000 index a8e3f04..0000000 --- a/ags/launcher/types +++ /dev/null @@ -1 +0,0 @@ -/usr/share/com.github.Aylur.ags/types \ No newline at end of file diff --git a/ags/media/Media.js b/ags/media/Media.js deleted file mode 100644 index 337656d..0000000 --- a/ags/media/Media.js +++ /dev/null @@ -1,153 +0,0 @@ -const mpris = await Service.import("mpris") -const players = mpris.bind("players") - -const FALLBACK_ICON = "audio-x-generic-symbolic" -const PLAY_ICON = "media-playback-start-symbolic" -const PAUSE_ICON = "media-playback-pause-symbolic" -const PREV_ICON = "media-skip-backward-symbolic" -const NEXT_ICON = "media-skip-forward-symbolic" - -/** @param {number} length */ -function lengthStr(length) { - const min = Math.floor(length / 60) - const sec = Math.floor(length % 60) - const sec0 = sec < 10 ? "0" : "" - return `${min}:${sec0}${sec}` -} - -/** @param {import('types/service/mpris').MprisPlayer} player */ -function Player(player) { - const img = Widget.Box({ - class_name: "img", - vpack: "start", - css: player.bind("cover_path").transform(p => ` - background-image: url('${p}'); - `), - }) - - const title = Widget.Label({ - class_name: "title", - wrap: true, - hpack: "start", - label: player.bind("track_title"), - }) - - const artist = Widget.Label({ - class_name: "artist", - wrap: true, - hpack: "start", - label: player.bind("track_artists").transform(a => a.join(", ")), - }) - - const positionSlider = Widget.Slider({ - class_name: "position", - draw_value: false, - on_change: ({ value }) => player.position = value * player.length, - visible: player.bind("length").as(l => l > 0), - setup: self => { - function update() { - const value = player.position / player.length - self.value = value > 0 ? value : 0 - } - self.hook(player, update) - self.hook(player, update, "position") - self.poll(1000, update) - }, - }) - - const positionLabel = Widget.Label({ - class_name: "position", - hpack: "start", - setup: self => { - const update = (_, time) => { - self.label = lengthStr(time || player.position) - self.visible = player.length > 0 - } - - self.hook(player, update, "position") - self.poll(1000, update) - }, - }) - - const lengthLabel = Widget.Label({ - class_name: "length", - hpack: "end", - visible: player.bind("length").transform(l => l > 0), - label: player.bind("length").transform(lengthStr), - }) - - const icon = Widget.Icon({ - class_name: "icon", - hexpand: true, - hpack: "end", - vpack: "start", - tooltip_text: player.identity || "", - icon: player.bind("entry").transform(entry => { - const name = `${entry}-symbolic` - return Utils.lookUpIcon(name) ? name : FALLBACK_ICON - }), - }) - - const playPause = Widget.Button({ - class_name: "play-pause", - on_clicked: () => player.playPause(), - visible: player.bind("can_play"), - child: Widget.Icon({ - icon: player.bind("play_back_status").transform(s => { - switch (s) { - case "Playing": return PAUSE_ICON - case "Paused": - case "Stopped": return PLAY_ICON - } - }), - }), - }) - - const prev = Widget.Button({ - on_clicked: () => player.previous(), - visible: player.bind("can_go_prev"), - child: Widget.Icon(PREV_ICON), - }) - - const next = Widget.Button({ - on_clicked: () => player.next(), - visible: player.bind("can_go_next"), - child: Widget.Icon(NEXT_ICON), - }) - - return Widget.Box( - { class_name: "player" }, - img, - Widget.Box( - { - vertical: true, - hexpand: true, - }, - Widget.Box([ - title, - icon, - ]), - artist, - Widget.Box({ vexpand: true }), - positionSlider, - Widget.CenterBox({ - start_widget: positionLabel, - center_widget: Widget.Box([ - prev, - playPause, - next, - ]), - end_widget: lengthLabel, - }), - ), - ) -} - -export function Media() { - return Widget.Box({ - vertical: true, - css: "min-height: 2px; min-width: 2px;", // small hack to make it visible - visible: players.as(p => p.length > 0), - children: players.as(p => p.map(Player)), - }) -} diff --git a/ags/media/README.md b/ags/media/README.md deleted file mode 100644 index 0db707c..0000000 --- a/ags/media/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Media Widget - -setup - -```bash -mkdir -p ~/.config/ags -git clone https://github.com/Aylur/ags.git /tmp/ags -cp -r /tmp/ags/example/media-widget/* ~/.config/ags - -# optionally setup types -ags --init -c ~/.config/ags/config.js -``` - -running - -```bash -ags -c ~/.config/ags/config.js & -``` diff --git a/ags/media/config.js b/ags/media/config.js deleted file mode 100644 index 5f77f05..0000000 --- a/ags/media/config.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Media } from "./Media.js" - -const win = Widget.Window({ - name: "mpris", - css: "border-radius: 16px;", - anchor: ["top", "right"], - child: Media(), -}) - -App.config({ - style: "./style.css", - windows: [win], -}) diff --git a/ags/media/style.css b/ags/media/style.css deleted file mode 100644 index 12630a3..0000000 --- a/ags/media/style.css +++ /dev/null @@ -1,53 +0,0 @@ -.player { - padding: 10px; - min-width: 350px; -} - -.player .img { - min-width: 100px; - min-height: 100px; - background-size: cover; - background-position: center; - border-radius: 13px; - margin-right: 1em; -} - -.player .title { - font-size: 1.2em; -} - -.player .artist { - font-size: 1.1em; - color: @insensitive_fg_color; -} - -.player scale.position { - padding: 0; - margin-bottom: .3em; -} - -.player scale.position trough { - min-height: 10px; - border-radius: 10px; -} - -.player scale.position highlight { - background-color: @theme_fg_color; - border-radius: 10px; -} - -.player scale.position slider { - all: unset; -} - -.player button { - min-height: 2em; - min-width: 2em; - border-radius: 2em; - padding: .3em; - border: none; -} - -.player button.play-pause { - margin: 0 .3em; -} diff --git a/ags/media/toggle_media b/ags/media/toggle_media deleted file mode 100755 index b4bbcae..0000000 --- a/ags/media/toggle_media +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if [ ! -f ~/.ags_media ]; then - ags --bus-name media -c ~/dotfiles/ags/media/config.js & - echo $! > ~/.ags_media -else - ags --bus-name media -c ~/dotfiles/ags/media/config.js --quit - rm ~/.ags_media -fi diff --git a/ags/notification-popups/README.md b/ags/notification-popups/README.md deleted file mode 100644 index ea184d6..0000000 --- a/ags/notification-popups/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Notification Popups - -setup - -```bash -mkdir -p ~/.config/ags -git clone https://github.com/Aylur/ags.git /tmp/ags -cp -r /tmp/ags/example/notification-popups/* ~/.config/ags - -# optionally setup types -ags --init -c ~/.config/ags/config.js -``` - -running - -```bash -ags -c ~/.config/ags/config.js & -``` \ No newline at end of file diff --git a/ags/notification-popups/config.js b/ags/notification-popups/config.js deleted file mode 100644 index 34743a2..0000000 --- a/ags/notification-popups/config.js +++ /dev/null @@ -1,18 +0,0 @@ -import { NotificationPopups } from "./notificationPopups.js" - -Utils.timeout(100, () => Utils.notify({ - summary: "Notification Popup Example", - iconName: "info-symbolic", - body: "Lorem ipsum dolor sit amet, qui minim labore adipisicing " - + "minim sint cillum sint consectetur cupidatat.", - actions: { - "Cool": () => print("pressed Cool"), - }, -})) - -App.config({ - style: "./style.css", - windows: [ - NotificationPopups(), - ], -}) \ No newline at end of file diff --git a/ags/notification-popups/notificationPopups.js b/ags/notification-popups/notificationPopups.js deleted file mode 100644 index 4c63d74..0000000 --- a/ags/notification-popups/notificationPopups.js +++ /dev/null @@ -1,130 +0,0 @@ -const notifications = await Service.import("notifications") - -/** @param {import('resource:///com/github/Aylur/ags/service/notifications.js').Notification} n */ -function NotificationIcon({ app_entry, app_icon, image }) { - if (image) { - return Widget.Box({ - css: `background-image: url("${image}");` - + "background-size: contain;" - + "background-repeat: no-repeat;" - + "background-position: center;", - }) - } - - let icon = "dialog-information-symbolic" - if (Utils.lookUpIcon(app_icon)) - icon = app_icon - - if (app_entry && Utils.lookUpIcon(app_entry)) - icon = app_entry - - return Widget.Box({ - child: Widget.Icon(icon), - }) -} - -/** @param {import('resource:///com/github/Aylur/ags/service/notifications.js').Notification} n */ -function Notification(n) { - const icon = Widget.Box({ - vpack: "start", - class_name: "icon", - child: NotificationIcon(n), - }) - - const title = Widget.Label({ - class_name: "title", - xalign: 0, - justification: "left", - hexpand: true, - max_width_chars: 24, - truncate: "end", - wrap: true, - label: n.summary, - use_markup: true, - }) - - const body = Widget.Label({ - class_name: "body", - hexpand: true, - use_markup: true, - xalign: 0, - justification: "left", - label: n.body, - wrap: true, - }) - - const actions = Widget.Box({ - class_name: "actions", - children: n.actions.map(({ id, label }) => Widget.Button({ - class_name: "action-button", - on_clicked: () => { - n.invoke(id) - n.dismiss() - }, - hexpand: true, - child: Widget.Label(label), - })), - }) - - return Widget.EventBox( - { - attribute: { id: n.id }, - on_primary_click: n.dismiss, - }, - Widget.Box( - { - class_name: `notification ${n.urgency}`, - vertical: true, - }, - Widget.Box([ - icon, - Widget.Box( - { vertical: true }, - title, - body, - ), - ]), - actions, - ), - ) -} - -export function NotificationPopups(monitor = 0) { - const list = Widget.Box({ - vertical: true, - children: notifications.popups.map(Notification), - }) - - function onNotified(_, /** @type {number} */ id) { - const n = notifications.getNotification(id) - if (n) - list.children = [Notification(n), ...list.children] - } - - function onDismissed(_, /** @type {number} */ id) { - list.children.find(n => n.attribute.id === id)?.destroy() - } - - list.hook(notifications, onNotified, "notified") - .hook(notifications, onDismissed, "dismissed") - - return Widget.Window({ - monitor, - name: `notifications${monitor}`, - class_name: "notification-popups", - anchor: ["top", "right"], - child: Widget.Box({ - css: "min-width: 2px; min-height: 2px;", - class_name: "notifications", - vertical: true, - child: list, - - /** this is a simple one liner that could be used instead of - hooking into the 'notified' and 'dismissed' signals. - but its not very optimized becuase it will recreate - the whole list everytime a notification is added or dismissed */ - // children: notifications.bind('popups') - // .as(popups => popups.map(Notification)) - }), - }) -} \ No newline at end of file diff --git a/ags/notification-popups/start_notification_service b/ags/notification-popups/start_notification_service deleted file mode 100755 index 9f83402..0000000 --- a/ags/notification-popups/start_notification_service +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if [ ! -f ~/.ags_notification_service ]; then - ags --bus-name notification_service -c ~/dotfiles/ags/notification-popups/config.js & - echo $! > ~/.ags_notification_service -else - ags --bus-name notification_service -c ~/dotfiles/ags/notification-popups/config.js --quit - rm ~/.ags_notification_service -fi diff --git a/ags/notification-popups/style.css b/ags/notification-popups/style.css deleted file mode 100644 index 4e28e73..0000000 --- a/ags/notification-popups/style.css +++ /dev/null @@ -1,57 +0,0 @@ -window.notification-popups box.notifications { - padding: .5em; -} - -.icon { - min-width: 68px; - min-height: 68px; - margin-right: 1em; -} - -.icon image { - font-size: 58px; - /* to center the icon */ - margin: 5px; - color: @theme_fg_color; -} - -.icon box { - min-width: 68px; - min-height: 68px; - border-radius: 7px; -} - -.notification { - min-width: 350px; - border-radius: 16px; - padding: 1em; - margin: .5em; - border: 1px solid @wm_borders_edge; - background-color: @theme_bg_color; -} - -.notification.critical { - border: 2px solid lightcoral; -} - -.title { - color: @theme_fg_color; - font-size: 1.4em; -} - -.body { - color: @theme_unfocused_fg_color; -} - -.actions .action-button { - margin: 0 .4em; - margin-top: .8em; -} - -.actions .action-button:first-child { - margin-left: 0; -} - -.actions .action-button:last-child { - margin-right: 0; -} \ No newline at end of file diff --git a/ags/volume/config.js b/ags/volume/config.js deleted file mode 100644 index de16f31..0000000 --- a/ags/volume/config.js +++ /dev/null @@ -1,50 +0,0 @@ -const audio = await ServiceWorker.import('audio') - -/** @param {'speaker' | 'microphone'} type */ -const vol = () => { - const VolumeSlider = (type = 'speaker') => Widget.Slider({ - hexpand: true, - drawValue: false, - onChange: ({value}) => audio[type].volume = value, - value: audio[type].bind('volume') - }) - - const speakerSlider = VolumeSlider('speaker') - const micSlider = VolumeSlider('microphone') - return Widget.Window({ - child: [speakerSlider, micSlider] - }) -} - -// const audio = await Service.import('audio') - -// const vol = () => { -// const volumeIndicator = Widget.Button({ -// on_clicked: () => audio.speaker.is_muted = !audio.speaker.is_muted, -// child: Widget.Icon().hook(audio.speaker, self => { -// const vol = audio.speaker.volume * 100; -// const icon = [ -// [101, 'overamplified'], -// [67, 'high'], -// [34, 'medium'], -// [1, 'low'], -// [0, 'muted'], -// ].find(([threshold]) => threshold <= vol)?.[1]; - -// self.icon = `audio-volume-${icon}-symbolic`; -// self.tooltip_text = `Volume ${Math.floor(vol)}%`; -// }), -// }) -// return Widget.Window({ -// child: volumeIndicator -// }) -// } - -App.config({ - style: "./style.css", - windows: [ - vol() - // speakerSlider, - // micSlider - ], -}) diff --git a/ags/weather/Weather.js b/ags/weather/Weather.js deleted file mode 100644 index 156b71f..0000000 --- a/ags/weather/Weather.js +++ /dev/null @@ -1,550 +0,0 @@ -import Weather from "./weather_service.js" - -export default () => Widget.Box( - { - class_name: "weather", - css: "min-height: 2px; min-width: 2px;", - }, - Widget.Box( - { class_name: "list" }, - Widget.Box( - { - class_name: "weater-box-yesterday", - vertical: true - }, - Widget.Box( - { - class_name: "horizontal", - css: "padding: 0 10px 10px 10px;" - }, - Widget.Label({ - class_name: "title", - wrap: false, - label: "  0.77mm ↑ 10°C ↓ 4°C THU" - }) - ), - Widget.Box( - { class_name: "horizontal" }, - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - // label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - ) - ), - Widget.Box( - { - class_name: "weather-box-today", - vertical: true, - }, - Widget.Box( - { - class_name: "horizontal", - css: "color: black;margin-top: 0;", - // space_evenly: true - }, - Widget.Label({ - class_name: "title", - css: "color: black;font-size: 25px;", - wrap: true, - // label: "", - hpack: "start", - setup: self => self.hook(Weather, () => { - Weather.weatherData - self.label = `${Weather._temperatureWeather.current_condition[0].weatherCode}` - }) - }), - Widget.Box({hexpand: true}), - Widget.Label({ - class_name: "title", - css: "color: black;margin-right: 10px;font-size: 20px;", - wrap: true, - // label: "↑ 10 ↓ 4 FRI", - hpack: "end", - setup: self => self.hook(Weather, () => { - // self.label = "hello world" - print(Weather.weatherData) - self.label = `↑ ${Weather._temperatureWeather.weather[0].maxtempC} ↓ ${Weather._temperatureWeather.weather[0].mintempC} ${Weather._temperatureWeather.weather[0].date}` - }), - }) - ), - Widget.Box( - { - class_name: "horizontal", - css: "margin: 10px 0 10px 0;" - }, - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - Widget.Box( - { - class_name: "weather-box-hour", - vertical: true, - css: "color: black;" - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "18h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "6°C", - }), - Widget.Box({vexpand: true}), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: " 5 kph", - }), - ), - ) - ), - Widget.Box( - { - class_name: "weather-box", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "MON", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - // label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↑ 10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↓ 4°C", - }) - ), - Widget.Box( - { - class_name: "weather-box", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "TUE", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - // label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↑ 10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↓ 4°C", - }) - ), - Widget.Box( - { - class_name: "weather-box", - vertical: true, - }, - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "WED", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10h", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "⛅️", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - // label: " 0.26mm", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↑ 10°C", - }), - Widget.Label({ - class_name: "title", - wrap: true, - hpack: "center", - label: "↓ 4°C", - }) - ), - ) -) \ No newline at end of file diff --git a/ags/weather/config.js b/ags/weather/config.js deleted file mode 100644 index 8986d09..0000000 --- a/ags/weather/config.js +++ /dev/null @@ -1,13 +0,0 @@ -import Weather from "./Weather.js" - -const win = Widget.Window({ - name: "weather", - css: "background: transparent", - anchor: ["top", "left"], - child: Weather(), -}) - -App.config({ - style: "./style.css", - window: [win], -}) diff --git a/ags/weather/meteosource.sh b/ags/weather/meteosource.sh deleted file mode 100644 index e69de29..0000000 diff --git a/ags/weather/openweathermap.sh b/ags/weather/openweathermap.sh deleted file mode 100644 index a3664c4..0000000 --- a/ags/weather/openweathermap.sh +++ /dev/null @@ -1,433 +0,0 @@ -#!/bin/sh - -apiKey="" -defaultLocation="" -Ags=0 -Debug=0 -output="" -WindSpeedUnit="kph" -DegreeCharacter="°C" -HumidityUnit="%" -CloudCoverUnit="%" -RainUnit=" mm" - -function debug_break() { - echo "-----" -} - -function get_script_argument_options() { - if [[ $firstArgLetter == "a" ]]; then - Ags=1 - fi - - if [[ $firstArgLetter == "d" ]]; then - Debug=1 - fi -} - -function get_config_file_data() { - if [ -f "$ConfigFile" ]; then - readarray -t line < "$ConfigFile" - apiKey=${line[0]} - defaultLocation=${line[1]} - fi - - if [ "$Debug" = "1" ]; then - # echo "apiKey: $apiKey" - echo "defaultLocation: $defaultLocation" - debug_break - fi - - if [[ "$apiKey" == "" || "$defaultLocation" == "" ]]; then - echo "Wrong Config file." - exit 1 - fi -} - -function check_api_status() { - check=$(echo "$response" | grep -c -e '"cod":"40"' || true) - check2=$(echo "$response" | grep -c -e '"cod":"30"' || true) - sum=$(( check + check2 )) - - if [ $sum -gt 0 ];then - exit 99 - fi -} - -function get_api_response() { - if [ "$Debug" = "1" ]; then - echo "API REQUEST TO GET DATA. URL: $URL" - fi - - # Make the API request using curl - # Check if the request was successful - if ! response=$(curl -s "$URL"); then - echo "Error making API request" - exit 1 - fi - - # Save response to cache file - echo "$response" > "$CacheFile" - - if [ "$Debug" = "1" ]; then - echo "$response" - debug_break - fi - - check_api_status -} - -function get_api_response_from_cache_file() { - if [ "$Debug" = "1" ]; then - echo 'DATA FROM CACHE' - fi - - response=$(cat "$CacheFile") - - if [ "$Debug" = "1" ]; then - echo "$response" - debug_break - fi - - check_api_status -} - -function get_response() { - # Check if cache file exists and is less than 5 minutes old - if [ -f "$CacheFile" ] && [ $(($(date +%s) - $(date -r "$CacheFile" +%s))) -lt 300 ]; then - get_api_response_from_cache_file - else - get_api_response - fi -} - -function print_weather_output() { - if [ "$Debug" = "1" ]; then - echo "NOW: $nowTemperature" - fi - - if [ -z "$output" ]; then - echo "No weather data to output." - exit 1 - fi - - if [ "${output: -1}" = "," ]; then - output="${output%,}" - fi - - output="[$output]" - - if [ "$Ags" == "1" ]; then - ags -r "weather.setTooltip($output)" - ags -r "weather.setTemperatureWeather(\"$nowTemperature\")" - else - echo "$output" - fi -} - -function get_debug_info_sunset_and_sunrise_hours() { - if [ "$Debug" = "1" ]; then - echo "Now: $CurrentTime" - CurrentHour=$(date +"%-H" -d @"$CurrentTime") - echo "Current: $CurrentHour" - - echo "SunsetHour: $SunsetHour" - echo "Sunrise: $SunriseHour" - debug_break - fi -} - -#sunset information from the Current weather response -function get_current_sunset_and_sunrise_hours() { - SunsetTime=$(echo "$response" | jq -r .sys.sunset) - SunriseTime=$(echo "$response" | jq -r .sys.sunrise) - SunsetHour=$(date +"%-H" -d @"$SunsetTime") - SunriseHour=$(date +"%-H" -d @"$SunriseTime") - - #current time - CurrentTime=$(date +%s) - - get_debug_info_sunset_and_sunrise_hours -} - -#sunset information from the weather Forecast response -function get_forecast_sunset_and_sunrise_hours() { - SunsetTime=$(echo "$response" | jq -r .city.sunset) - SunriseTime=$(echo "$response" | jq -r .city.sunrise) - SunsetHour=$(date +"%-H" -d @"$SunsetTime") - SunriseHour=$(date +"%-H" -d @"$SunriseTime") - - #current time - CurrentTime=$(date +%s) - - get_debug_info_sunset_and_sunrise_hours -} - -#Updates provided weather icon with night icons and sunset/sunrise icons -function get_weather_icon() { - icon=$1 - - checkNewIcon="True" - - if [[ "$icon" == "☀️" || "$icon" == "🌤" || "$icon" == "⛅" ]]; then - if [[ $WeatherHour -eq $SunriseHour ]]; then - checkNewIcon="False" - icon="🌄" - fi - - if [[ $checkNewIcon == "True" && $WeatherHour -eq $SunsetHour ]]; then - checkNewIcon="False" - icon="🌇" - fi - fi - - if [[ $checkNewIcon == "True" && ($WeatherHour -ge $SunsetHour || $WeatherHour -le $SunriseHour) ]]; then - case $1 in - "☀️") icon="🌑" ;; - "🌤") icon="🌑" ;; - "⛅") icon="" ;; - "☁") icon="" ;; - "🌦") icon="" ;; - "🌧️") icon="" ;; - "🌨") icon="" ;; - "") icon="" ;; - esac - - if [[ "$icon" == "🌑" ]]; then - # Generate a random number between 1 and 5 - random_number=$(( RANDOM % 5 + 1 )) - - # Check the random number and provide different outputs - if [ $random_number -eq 1 ]; then - icon="🌕" - fi - fi - fi -} - -function get_min_and_max_weather() { - # MinTemperature=$(echo "$response" | jq -r .list["$i"].main.temp_min | tr '\n' ' ') - # MaxTemperature=$(echo "$response" | jq -r .list["$i"].main.temp_max | tr '\n' ' ') - - # Check if a new day has started - Day=$(date +"%Y-%m-%d" -d @"${WeatherDate}") - if [[ "$Day" != "$CurrentDay" ]]; then - # Reset variables for the new day - CurrentDay="$Day" - MinTemperature="$Temperature" - MaxTemperature="$Temperature" - fi - - # Update min and max temperatures - if (( $(echo "$Temperature < $MinTemperature" | bc -l) )); then - MinTemperature="$Temperature" - fi - - if (( $(echo "$Temperature > $MaxTemperature" | bc -l) )); then - MaxTemperature="$Temperature" - fi - - MinTemp=$(printf '%.*f\n' 0 "$MinTemperature") - MaxTemp=$(printf '%.*f\n' 0 "$MaxTemperature") -} - -function clear_defaults() { - WeatherDate="" - WeatherHour="" - FormattedDate="" - Temperature="" - Temperature="" - # ShortWeather="" - LongWeather="" - Humidity="" - CloudCover="" - WindSpeed="" - MinTemperature="" - MaxTemperature="" - MinTemp="" - MaxTemp="" - icons="" - Rain1h="null" - Rain3h="null" -} - -function weather_data() { - forecast=$1 - - if [ "$forecast" = "f" ]; then - FormattedDate=$(date -d @"${WeatherDate}" +"%A, %B %d, %Y") - # ShortWeather=$(echo "$response" | jq -r .list["$i"].weather[] | jq -r .main | tr '\n' ' '| awk '{$1=$1};1' ) - LongWeather=$(echo "$response" | jq -r .list["$i"].weather[] | jq -r .description | sed -E 's/\S+/\u&/g' | tr '\n' ' '| awk '{$1=$1};1' ) - Humidity=$(echo "$response" | jq -r .list["$i"].main.humidity | tr '\n' ' '| awk '{$1=$1};1' ) - CloudCover=$(echo "$response" | jq -r .list["$i"].clouds.all | tr '\n' ' '| awk '{$1=$1};1' ) - WindSpeed=$(echo "$response" | jq -r .list["$i"].wind.speed | tr '\n' ' ' | awk '{$1=$1};1' ) - WindSpeed=$(printf '%.*f\n' 1 "$WindSpeed") - - Rain1h=$(echo "$response" | jq -r .list["$i"] | jq -r '.rain."1h"') - Rain3h=$(echo "$response" | jq -r .list["$i"] | jq -r '.rain."3h"') - - icons=$(echo "$response" | jq -r .list["$i"].weather[] | jq -r .icon | tr '\n' ' ' ) - else - #current weather - WeatherDate=$(echo "$response" | jq -r .dt | tr '\n' ' ') - WeatherHour=$(date +"%-H" -d @"${WeatherDate}") - FormattedDate=$(date -d @"${WeatherDate}" +"%A, %B %d, %Y") - - # Extracting and formatting the temperature - Temperature=$(echo "$response" | jq -r .main.temp | tr '\n' ' ') - # Use bc to format the temperature to 0 decimal places - Temperature=$(echo "$Temperature" | bc -l | awk '{printf "%.0f", $1}') - - # ShortWeather=$(echo "$response" | jq -r .weather[0].main | tr '\n' ' '| awk '{$1=$1};1' ) - LongWeather=$(echo "$response" | jq -r .weather[0].description | sed -E 's/\S+/\u&/g' | tr '\n' ' '| awk '{$1=$1};1' ) - - Humidity=$(echo "$response" | jq -r .main.humidity | tr '\n' ' '| awk '{$1=$1};1' ) - CloudCover=$(echo "$response" | jq -r .clouds.all | tr '\n' ' '| awk '{$1=$1};1' ) - WindSpeed=$(echo "$response" | jq -r .wind.speed | tr '\n' ' ' | awk '{$1=$1};1' ) - WindSpeed=$(printf '%.*f\n' 1 "$WindSpeed") - - Rain1h=$(echo "$response" | jq -r '.rain."1h"') - Rain3h=$(echo "$response" | jq -r '.rain."3h"') - - MinTemperature=$(echo "$response" | jq -r .main.temp_min | tr '\n' ' ') - MaxTemperature=$(echo "$response" | jq -r .main.temp_max | tr '\n' ' ') - MinTemp=$(echo "$MinTemperature" | bc -l | awk '{printf "%.0f", $1}') - MaxTemp=$(echo "$MaxTemperature" | bc -l | awk '{printf "%.0f", $1}') - - icons=$(echo "$response" | jq -r .weather[0].icon | tr '\n' ' ') - fi - - Rain="0" - - if [[ "$Rain3h" != "null" ]]; then - Rain="$Rain3h" - fi - - if [[ "$Rain1h" != "null" ]]; then - Rain="$Rain1h" - fi - - iconval=${icons%?} - case $iconval in - 01*) get_weather_icon "☀️";; - 02*) get_weather_icon "🌤";; - 03*) get_weather_icon "⛅";; - 04*) get_weather_icon "☁";; - 09*) get_weather_icon "🌦";; - 10*) get_weather_icon "🌧️";; - 11*) get_weather_icon "🌩";; - 13*) get_weather_icon "🌨";; - 50*) get_weather_icon "";; - esac - - if [ "$Debug" = "1" ]; then - echo "WeatherDate: $FormattedDate, Hour: $WeatherHour" - # echo "ShortWeather: $ShortWeather" - echo "LongWeather: $LongWeather" - echo "Humidity: $Humidity$HumidityUnit" - echo "CloudCover: $CloudCover$CloudCoverUnit" - echo "WindSpeed: $WindSpeed $WindSpeedUnit" - echo "Temperature: $Temperature$DegreeCharacter" - echo "icon: $icon" - echo "MinTemp: $MinTemp$DegreeCharacter" - echo "MaxTemp: $MaxTemp$DegreeCharacter" - echo "rain_1h: $Rain1h" - echo "rain_3h: $Rain3h" - debug_break - fi - - if [ "$forecast" != "f" ]; then - nowTemperature="$icon $Temperature$DegreeCharacter" - fi - - output+="{\"date\":\"$FormattedDate\",\"hour\":\"$WeatherHour\",\"temperature\":\"${Temperature}°C\",\"icon\":\"$icon\",\"wind\":\"$WindSpeed$WindSpeedUnit\",\"rain\":\"$Rain$RainUnit\",\"humidity\":\"$Humidity$HumidityUnit\",\"minTemp\":\"$MinTemp$DegreeCharacter\",\"maxTemp\":\"$MaxTemp$DegreeCharacter\"}," -} - -function get_weather_forecast_data() { - CurrentDay="" - # PreviousDay="" - TomorrowDate=$(date -d '+1 day' +"%s") - - clear_defaults - - i=0 - # NumEntries=$(echo "$response" |jq -r .cnt) - # while [ $i -lt $NumEntries ]; do - while [ $i -lt 40 ]; do - WeatherDate=$(echo "$response" | jq -r .list[$i].dt | tr '\n' ' ') - WeatherHour=$(date +"%-H" -d @"${WeatherDate}") - CastDate=$(date +"%s" -d @"${WeatherDate}") - - Temperature=$(echo "$response" | jq -r .list[$i].main.temp | tr '\n' ' ') - Temperature=$(echo "$Temperature" | bc -l | awk '{printf "%.0f", $1}') - - get_min_and_max_weather - - #show the weather forecast hourly until it reaches tomorrow date, then only 1 hour - if [ "$CastDate" -le "$TomorrowDate" ]; then - weather_data "f" - else - if [ "$WeatherHour" -ge "17" ] && [ "$WeatherHour" -le "18" ] || - [ "$WeatherHour" -ge "18" ] && [ "$WeatherHour" -le "19" ]; then - - # if [[ "$CurrentDay" != "$PreviousDay" ]]; then - weather_data "f" - # fi - - # PreviousDay=$CurrentDay - fi - fi - - i=$((i + 1)) - done -} - -function call_weather_current_api() { - # API endpoint URL Current Weather - URL="http://api.openweathermap.org/data/2.5/weather?id=$defaultLocation&units=metric&appid=$apiKey" - - # Current Weather API cache file path based on defaultLocation - CacheFile="/tmp/weather_cache_${defaultLocation}_current.json" - - get_response - # get_api_response_from_cache_file - - get_current_sunset_and_sunrise_hours - weather_data "c" -} - -function call_weather_forecast_api() { - # API endpoint URL Forecast - URL="http://api.openweathermap.org/data/2.5/forecast?id=$defaultLocation&units=metric&appid=$apiKey" - - # Forecast API cache file path based on defaultLocation - CacheFile="/tmp/weather_cache_${defaultLocation}_forecast.json" - - get_response - # get_api_response_from_cache_file - - #used to retrieve forecast data - get_forecast_sunset_and_sunrise_hours - get_weather_forecast_data -} - -#get this scripts arguments => (ags, debug or none) -#checks the first letter of the argument provided to the script -if [[ $# -ge 1 ]]; then - firstArgLetter="$(echo "$1" | head -c 1)" -else - firstArgLetter= -fi - -get_script_argument_options - -#call to get config file data => (apiKey and defaultLocation) -ConfigFile="$HOME/.config/scripts/weather.rc" -get_config_file_data - -call_weather_current_api - -call_weather_forecast_api - -#prints out final output / sends over the data -print_weather_output \ No newline at end of file diff --git a/ags/weather/style.css b/ags/weather/style.css deleted file mode 100644 index 171b198..0000000 --- a/ags/weather/style.css +++ /dev/null @@ -1,42 +0,0 @@ -.weather { - min-width: 600px; - min-height: 160px; - background-color: #11120E; - border-radius: 16px; - padding: 0 0 0 10px; - margin: 10px; -} - -.weather-box { - min-width: 80px; - background: linear-gradient(to right bottom, black, #171e6e); - border-radius: 13px; - margin: 10px 10px 10px 0; - padding: 10px; -} - -.weater-box-yesterday { - min-width: 270px; - margin: 10px 10px 10px 0; - background: linear-gradient(to right bottom, black, #171e6e); - border-radius: 13px; - padding: 10px 0px 0px 10px; -} - -.horizontal { - margin: 5px 0 0 0; -} - -.weather-box-hour { - min-width: 80px; - margin: 0 10px 0 0; - background: transparent; -} - -.weather-box-today { - min-width: 400px; - background: linear-gradient(to right bottom, gray, white); - margin: 10px 10px 10px 0; - border-radius: 13px; - padding: 10px 0px 0px 10px; -} diff --git a/ags/weather/weather.json b/ags/weather/weather.json deleted file mode 100644 index 2c87999..0000000 --- a/ags/weather/weather.json +++ /dev/null @@ -1,1367 +0,0 @@ -{ - "current_condition": [ - { - "FeelsLikeC": "11", - "FeelsLikeF": "52", - "cloudcover": "100", - "humidity": "98", - "localObsDateTime": "2024-09-06 02:23 PM", - "observation_time": "07:23 AM", - "precipInches": "0.0", - "precipMM": "0.4", - "pressure": "1006", - "pressureInches": "30", - "temp_C": "12", - "temp_F": "53", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [ - { - "value": "Light rain shower" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "198", - "windspeedKmph": "7", - "windspeedMiles": "4" - } - ], - "nearest_area": [ - { - "areaName": [ - { - "value": "Томск" - } - ], - "country": [ - { - "value": "Russia" - } - ], - "latitude": "56.500", - "longitude": "84.967", - "population": "485519", - "region": [ - { - "value": "Tomsk" - } - ], - "weatherUrl": [ - { - "value": "" - } - ] - } - ], - "request": [ - { - "query": "Lat 56.49 and Lon 84.95", - "type": "LatLon" - } - ], - "weather": [ - { - "astronomy": [ - { - "moon_illumination": "7", - "moon_phase": "Waxing Crescent", - "moonrise": "10:06 AM", - "moonset": "08:33 PM", - "sunrise": "06:33 AM", - "sunset": "08:02 PM" - } - ], - "avgtempC": "11", - "avgtempF": "52", - "date": "2024-09-06", - "hourly": [ - { - "DewPointC": "7", - "DewPointF": "44", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "8", - "HeatIndexF": "47", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "28", - "WindGustMiles": "17", - "chanceoffog": "1", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "46", - "chanceofrain": "0", - "chanceofremdry": "93", - "chanceofsnow": "0", - "chanceofsunshine": "73", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "40", - "diffRad": "0.0", - "humidity": "88", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1008", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "8", - "tempF": "47", - "time": "0", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "116", - "weatherDesc": [ - { - "value": "Partly Cloudy " - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "ENE", - "winddirDegree": "60", - "windspeedKmph": "16", - "windspeedMiles": "10" - }, - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "7", - "FeelsLikeF": "45", - "HeatIndexC": "9", - "HeatIndexF": "49", - "WindChillC": "7", - "WindChillF": "45", - "WindGustKmph": "24", - "WindGustMiles": "15", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "47", - "chanceofrain": "0", - "chanceofremdry": "94", - "chanceofsnow": "0", - "chanceofsunshine": "72", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "48", - "diffRad": "28.3", - "humidity": "85", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1007", - "pressureInches": "30", - "shortRad": "57.8", - "tempC": "9", - "tempF": "49", - "time": "300", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "116", - "weatherDesc": [ - { - "value": "Partly Cloudy " - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "ENE", - "winddirDegree": "59", - "windspeedKmph": "16", - "windspeedMiles": "10" - }, - { - "DewPointC": "8", - "DewPointF": "47", - "FeelsLikeC": "13", - "FeelsLikeF": "55", - "HeatIndexC": "14", - "HeatIndexF": "57", - "WindChillC": "13", - "WindChillF": "55", - "WindGustKmph": "20", - "WindGustMiles": "13", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "38", - "chanceofrain": "0", - "chanceofremdry": "87", - "chanceofsnow": "0", - "chanceofsunshine": "73", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "37", - "diffRad": "98.1", - "humidity": "68", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1007", - "pressureInches": "30", - "shortRad": "206.4", - "tempC": "14", - "tempF": "57", - "time": "600", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "116", - "weatherDesc": [ - { - "value": "Partly Cloudy " - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "E", - "winddirDegree": "81", - "windspeedKmph": "17", - "windspeedMiles": "11" - }, - { - "DewPointC": "10", - "DewPointF": "50", - "FeelsLikeC": "17", - "FeelsLikeF": "63", - "HeatIndexC": "17", - "HeatIndexF": "63", - "WindChillC": "17", - "WindChillF": "63", - "WindGustKmph": "13", - "WindGustMiles": "8", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "94", - "chanceofrain": "80", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "218.7", - "humidity": "61", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "487.0", - "tempC": "17", - "tempF": "63", - "time": "900", - "uvIndex": "4", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [ - { - "value": "Patchy rain nearby" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "ESE", - "winddirDegree": "109", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "12", - "DewPointF": "54", - "FeelsLikeC": "13", - "FeelsLikeF": "55", - "HeatIndexC": "13", - "HeatIndexF": "55", - "WindChillC": "13", - "WindChillF": "55", - "WindGustKmph": "10", - "WindGustMiles": "6", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "80", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "95", - "diffRad": "115.2", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "1.0", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "229.3", - "tempC": "13", - "tempF": "55", - "time": "1200", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [ - { - "value": "Light rain shower" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSE", - "winddirDegree": "155", - "windspeedKmph": "7", - "windspeedMiles": "4" - }, - { - "DewPointC": "11", - "DewPointF": "52", - "FeelsLikeC": "10", - "FeelsLikeF": "50", - "HeatIndexC": "11", - "HeatIndexF": "52", - "WindChillC": "10", - "WindChillF": "50", - "WindGustKmph": "16", - "WindGustMiles": "10", - "chanceoffog": "2", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "86", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.8", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.2", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "1.1", - "tempC": "11", - "tempF": "52", - "time": "1500", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [ - { - "value": "Light rain shower" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "214", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "9", - "DewPointF": "49", - "FeelsLikeC": "8", - "FeelsLikeF": "47", - "HeatIndexC": "10", - "HeatIndexF": "49", - "WindChillC": "8", - "WindChillF": "47", - "WindGustKmph": "16", - "WindGustMiles": "10", - "chanceoffog": "91", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "87", - "chanceofrain": "62", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.2", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1007", - "pressureInches": "30", - "shortRad": "0.3", - "tempC": "10", - "tempF": "49", - "time": "1800", - "uvIndex": "2", - "visibility": "0", - "visibilityMiles": "0", - "weatherCode": "248", - "weatherDesc": [ - { - "value": "Fog" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "198", - "windspeedKmph": "9", - "windspeedMiles": "6" - }, - { - "DewPointC": "8", - "DewPointF": "46", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "8", - "HeatIndexF": "47", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "16", - "WindGustMiles": "10", - "chanceoffog": "36", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "80", - "chanceofrain": "0", - "chanceofremdry": "90", - "chanceofsnow": "0", - "chanceofsunshine": "7", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "72", - "diffRad": "0.0", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "8", - "tempF": "47", - "time": "2100", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [ - { - "value": "Mist" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "197", - "windspeedKmph": "9", - "windspeedMiles": "6" - } - ], - "maxtempC": "17", - "maxtempF": "63", - "mintempC": "7", - "mintempF": "45", - "sunHour": "11.3", - "totalSnow_cm": "0.0", - "uvIndex": "3" - }, - { - "astronomy": [ - { - "moon_illumination": "13", - "moon_phase": "Waxing Crescent", - "moonrise": "11:25 AM", - "moonset": "08:38 PM", - "sunrise": "06:35 AM", - "sunset": "07:59 PM" - } - ], - "avgtempC": "10", - "avgtempF": "49", - "date": "2024-09-07", - "hourly": [ - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "5", - "FeelsLikeF": "41", - "HeatIndexC": "7", - "HeatIndexF": "45", - "WindChillC": "5", - "WindChillF": "41", - "WindGustKmph": "19", - "WindGustMiles": "12", - "chanceoffog": "89", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "86", - "chanceofrain": "70", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.0", - "humidity": "99", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "7", - "tempF": "45", - "time": "0", - "uvIndex": "1", - "visibility": "0", - "visibilityMiles": "0", - "weatherCode": "248", - "weatherDesc": [ - { - "value": "Fog" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "S", - "winddirDegree": "188", - "windspeedKmph": "12", - "windspeedMiles": "7" - }, - { - "DewPointC": "8", - "DewPointF": "46", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "8", - "HeatIndexF": "47", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "19", - "WindGustMiles": "12", - "chanceoffog": "1", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "85", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "6.5", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.3", - "pressure": "1007", - "pressureInches": "30", - "shortRad": "11.1", - "tempC": "8", - "tempF": "47", - "time": "300", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [ - { - "value": "Light drizzle" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "193", - "windspeedKmph": "13", - "windspeedMiles": "8" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "8", - "FeelsLikeF": "46", - "HeatIndexC": "9", - "HeatIndexF": "49", - "WindChillC": "8", - "WindChillF": "46", - "WindGustKmph": "18", - "WindGustMiles": "11", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "87", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "11.6", - "humidity": "98", - "precipInches": "0.1", - "precipMM": "1.6", - "pressure": "1007", - "pressureInches": "30", - "shortRad": "17.2", - "tempC": "9", - "tempF": "49", - "time": "600", - "uvIndex": "1", - "visibility": "9", - "visibilityMiles": "5", - "weatherCode": "296", - "weatherDesc": [ - { - "value": "Light rain" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SSW", - "winddirDegree": "202", - "windspeedKmph": "13", - "windspeedMiles": "8" - }, - { - "DewPointC": "10", - "DewPointF": "49", - "FeelsLikeC": "9", - "FeelsLikeF": "47", - "HeatIndexC": "10", - "HeatIndexF": "50", - "WindChillC": "9", - "WindChillF": "47", - "WindGustKmph": "15", - "WindGustMiles": "9", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "92", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "21.6", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.6", - "pressure": "1008", - "pressureInches": "30", - "shortRad": "29.5", - "tempC": "10", - "tempF": "50", - "time": "900", - "uvIndex": "2", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [ - { - "value": "Light drizzle" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "WSW", - "winddirDegree": "243", - "windspeedKmph": "10", - "windspeedMiles": "6" - }, - { - "DewPointC": "10", - "DewPointF": "50", - "FeelsLikeC": "10", - "FeelsLikeF": "51", - "HeatIndexC": "11", - "HeatIndexF": "53", - "WindChillC": "10", - "WindChillF": "51", - "WindGustKmph": "18", - "WindGustMiles": "11", - "chanceoffog": "7", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "81", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "96", - "diffRad": "63.5", - "humidity": "91", - "precipInches": "0.0", - "precipMM": "0.5", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "111.9", - "tempC": "11", - "tempF": "53", - "time": "1200", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [ - { - "value": "Light rain shower" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "228", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "9", - "FeelsLikeF": "48", - "HeatIndexC": "10", - "HeatIndexF": "50", - "WindChillC": "9", - "WindChillF": "48", - "WindGustKmph": "18", - "WindGustMiles": "11", - "chanceoffog": "13", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "90", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "9.5", - "humidity": "93", - "precipInches": "0.0", - "precipMM": "0.2", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "19.7", - "tempC": "10", - "tempF": "50", - "time": "1500", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [ - { - "value": "Light rain shower" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "WSW", - "winddirDegree": "245", - "windspeedKmph": "9", - "windspeedMiles": "6" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "8", - "FeelsLikeF": "47", - "HeatIndexC": "10", - "HeatIndexF": "50", - "WindChillC": "8", - "WindChillF": "47", - "WindGustKmph": "21", - "WindGustMiles": "13", - "chanceoffog": "13", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "75", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "2.4", - "humidity": "93", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1013", - "pressureInches": "30", - "shortRad": "4.9", - "tempC": "10", - "tempF": "50", - "time": "1800", - "uvIndex": "2", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [ - { - "value": "Patchy rain nearby" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "228", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "8", - "DewPointF": "46", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "25", - "WindGustMiles": "16", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "87", - "chanceofrain": "0", - "chanceofremdry": "89", - "chanceofsnow": "0", - "chanceofsunshine": "6", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "97", - "diffRad": "0.0", - "humidity": "91", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1014", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "9", - "tempF": "48", - "time": "2100", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "122", - "weatherDesc": [ - { - "value": "Overcast " - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "231", - "windspeedKmph": "14", - "windspeedMiles": "9" - } - ], - "maxtempC": "12", - "maxtempF": "54", - "mintempC": "7", - "mintempF": "45", - "sunHour": "9.8", - "totalSnow_cm": "0.0", - "uvIndex": "1" - }, - { - "astronomy": [ - { - "moon_illumination": "20", - "moon_phase": "Waxing Crescent", - "moonrise": "12:45 PM", - "moonset": "08:44 PM", - "sunrise": "06:37 AM", - "sunset": "07:57 PM" - } - ], - "avgtempC": "9", - "avgtempF": "48", - "date": "2024-09-08", - "hourly": [ - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "23", - "WindGustMiles": "14", - "chanceoffog": "1", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "94", - "chanceofrain": "77", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.0", - "humidity": "92", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1015", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "9", - "tempF": "48", - "time": "0", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [ - { - "value": "Patchy rain nearby" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "230", - "windspeedKmph": "14", - "windspeedMiles": "9" - }, - { - "DewPointC": "8", - "DewPointF": "47", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "22", - "WindGustMiles": "14", - "chanceoffog": "1", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "7.7", - "humidity": "95", - "precipInches": "0.0", - "precipMM": "0.4", - "pressure": "1015", - "pressureInches": "30", - "shortRad": "13.5", - "tempC": "9", - "tempF": "48", - "time": "300", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [ - { - "value": "Light drizzle" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "228", - "windspeedKmph": "15", - "windspeedMiles": "9" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "6", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "6", - "WindChillF": "44", - "WindGustKmph": "25", - "WindGustMiles": "16", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "87", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "8.8", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.7", - "pressure": "1016", - "pressureInches": "30", - "shortRad": "12.9", - "tempC": "9", - "tempF": "48", - "time": "600", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [ - { - "value": "Light drizzle" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "228", - "windspeedKmph": "17", - "windspeedMiles": "11" - }, - { - "DewPointC": "9", - "DewPointF": "49", - "FeelsLikeC": "7", - "FeelsLikeF": "45", - "HeatIndexC": "10", - "HeatIndexF": "49", - "WindChillC": "7", - "WindChillF": "45", - "WindGustKmph": "23", - "WindGustMiles": "14", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "29.3", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.5", - "pressure": "1016", - "pressureInches": "30", - "shortRad": "44.1", - "tempC": "10", - "tempF": "49", - "time": "900", - "uvIndex": "2", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [ - { - "value": "Light drizzle" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "235", - "windspeedKmph": "16", - "windspeedMiles": "10" - }, - { - "DewPointC": "9", - "DewPointF": "49", - "FeelsLikeC": "8", - "FeelsLikeF": "46", - "HeatIndexC": "10", - "HeatIndexF": "49", - "WindChillC": "8", - "WindChillF": "46", - "WindGustKmph": "20", - "WindGustMiles": "12", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "92", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "18.9", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.1", - "pressure": "1016", - "pressureInches": "30", - "shortRad": "27.2", - "tempC": "10", - "tempF": "49", - "time": "1200", - "uvIndex": "2", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [ - { - "value": "Patchy rain nearby" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "234", - "windspeedKmph": "13", - "windspeedMiles": "8" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "8", - "FeelsLikeF": "46", - "HeatIndexC": "9", - "HeatIndexF": "49", - "WindChillC": "8", - "WindChillF": "46", - "WindGustKmph": "17", - "WindGustMiles": "10", - "chanceoffog": "77", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "90", - "chanceofrain": "72", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "2.7", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1016", - "pressureInches": "30", - "shortRad": "4.8", - "tempC": "9", - "tempF": "49", - "time": "1500", - "uvIndex": "2", - "visibility": "0", - "visibilityMiles": "0", - "weatherCode": "248", - "weatherDesc": [ - { - "value": "Fog" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "234", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "8", - "DewPointF": "47", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "19", - "WindGustMiles": "12", - "chanceoffog": "76", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "87", - "chanceofrain": "0", - "chanceofremdry": "85", - "chanceofsnow": "0", - "chanceofsunshine": "17", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.7", - "humidity": "98", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1016", - "pressureInches": "30", - "shortRad": "1.2", - "tempC": "9", - "tempF": "48", - "time": "1800", - "uvIndex": "2", - "visibility": "0", - "visibilityMiles": "0", - "weatherCode": "248", - "weatherDesc": [ - { - "value": "Fog" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "229", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "8", - "DewPointF": "46", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "8", - "HeatIndexF": "47", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "20", - "WindGustMiles": "12", - "chanceoffog": "25", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "93", - "chanceofrain": "62", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "83", - "diffRad": "0.0", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1015", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "8", - "tempF": "47", - "time": "2100", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [ - { - "value": "Mist" - } - ], - "weatherIconUrl": [ - { - "value": "" - } - ], - "winddir16Point": "SW", - "winddirDegree": "230", - "windspeedKmph": "12", - "windspeedMiles": "8" - } - ], - "maxtempC": "10", - "maxtempF": "49", - "mintempC": "8", - "mintempF": "47", - "sunHour": "9.8", - "totalSnow_cm": "0.0", - "uvIndex": "1" - } - ] -} diff --git a/ags/weather/weather_logic.js b/ags/weather/weather_logic.js deleted file mode 100644 index 9005eb7..0000000 --- a/ags/weather/weather_logic.js +++ /dev/null @@ -1,486 +0,0 @@ -import Weather from '../../services/weather.js'; -import Widget from 'resource:///com/github/Aylur/ags/widget.js'; -import App from 'resource:///com/github/Aylur/ags/app.js'; - -export const TemperatureIndicator = () => Widget.Stack({ - children: { - true: PannelButton(), - false: Widget.Label(), - }, - setup: self => self.hook(Weather, () => { - self.shown = Weather.temperatureWeather ? true : false; - }), -}); - -export const PannelButton = props => Widget.Button({ - ...props, - class_name: 'weather panel-button', - child: Temperature(), - on_clicked: () => App.toggleWindow('weather'), - on_secondary_click: () => Weather.weatherData, - setup: self => self - .hook(App, (_, win, visible) => { - self.toggleClassName('active', win === 'weather' && visible); - }), -}); - -export const Temperature = props => Widget.Label({ - ...props, - setup: self => self.hook(Weather, () => { - if (Weather.temperatureWeather && self.label !== Weather.temperatureWeather) { - self.label = Weather.temperatureWeather.toString() - } - }), -}); - -function weatherBackgroundStyle(icon, box) { - switch (icon) { - case "🌇": {//sunset - box.setCss(` - background: linear-gradient(to bottom, #ff6f61, #ffca58, #f0e68c); - color: #000000; - `); - break; - } - case "🌄": {//sunrise - box.setCss(` - background: linear-gradient(to bottom, #ffcc00, #ff6f61, #ff5e62, #d55f74); - color: #000000; - `); - break; - } - case "🌤": {//few clouds - box.setCss(` - background: linear-gradient(to bottom, #80b3ff, #ffffff, #ffdb4d); - color: #000000; - `); - break; - } - case "🌩": {//thunderstorm - box.setCss(` - background: linear-gradient(to bottom, #0c0e23, #1a1c38, #121320, #0c0e23); - color: #ffffff; - `); - break; - } - case "🌑": { - box.setCss(` - background: linear-gradient(to bottom, #2c3e50, #1a2533); - color: #ffffff; - `); - break; - } - case "🌕": { - box.setCss(` - background: linear-gradient(to bottom, #001f3f, #002f4f, #003f5f, #004f6f, #005f7f); - color: #ffffff; - `); - break; - } - case "☀️": { - box.setCss(` - background: linear-gradient(to bottom, #ffeb99, #ffe580, #ffd866, #ffcf4c, #ffc333); - color: #000000; - `); - break; - } - case "☁": - case "☁️": {//cloudy - box.setCss(` - background: linear-gradient(to bottom, #c4c4c4, #d1d1d1, #dedede, #ebebeb, #f8f8f8); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #1c2331, #212a38, #263141, #2b3749, #303d51); - color: #ffffff; - `); - break; - } - case "": {//fog - box.setCss(` - background: linear-gradient(to bottom, #d8d8d8, #e2e2e2, #ececec, #f6f6f6, #ffffff); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #1c2331, #1c2331, #1c2331, #293547, #38475f); - color: #ffffff; - `); - break; - } - case "⛈️": {//heavy rain - box.setCss(` - background: linear-gradient(to bottom, #2c3e50, #34495e, #2c3e50, #34495e, #2c3e50); - color: #000000; - `); - break; - } - case "󰙾": { - box.setCss(` - background: linear-gradient(to bottom, #050818, #070b1d, #0a0e22, #0d1126, #10152b); - color: #ffffff; - `); - break; - } - case "🌦️": {//light rain - box.setCss(` - background: linear-gradient(to bottom, #547aad, #6692b8, #78a9c3, #8abfd0, #9cd7dd); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #0e1620, #121c2a, #162133, #18273c, #1c2c46); - color: #ffffff; - `); - break; - } - case "⛅": {//partly cloudy - box.setCss(` - background: linear-gradient(to bottom, #a8c9f0, #c4dfea, #f0f0cc, #ffd700, #f0f0cc, #c4dfea, #a8c9f0); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #040d1c, #081427, #0c1a32, #101f3d, #142348); - color: #ffffff; - `); - break; - } - case "🌧️": {//rain showers - box.setCss(` - background: linear-gradient(to bottom, #5e7d99, #6a8ba6, #7698b3, #87a5bf, #97b3cb, #a6c0d8, #b4cedf); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #050818, #070b1d, #0a0e22, #0d1126, #10152b); - color: #ffffff; - `); - break; - } - case "🌨": {//snow - box.setCss(` - background: linear-gradient(to bottom, #d0e6ec, #e0f0f5, #f0f5f9, #f5fafd, #ffffff); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #0e1620, #162133, #1c263f, #232c4c, #293259); - color: #ffffff; - `); - break; - } - case "🌨️": {//sleet - box.setCss(` - background: linear-gradient(to bottom, #d0e6ec, #e0f0f5, #f0f5f9, #ffffff, #f0f5f9, #e0f0f5, #d0e6ec); - color: #000000; - `); - break; - } - case "": { - box.setCss(` - background: linear-gradient(to bottom, #050818, #08142a, #0c1d3b, #101f47, #142556); - color: #ffffff; - `); - break; - } - default: { - box.setCss(` - background: red; - color: blue; - `); - break; - } - } -} - -export const WeatherInfo = (weatherData) => Widget.Box({ - class_name: 'weather-info', - vertical: true, - children: [ - Widget.Label({ label: weatherData.date.substring(0, 3).toUpperCase(), }), - Widget.Label({ label: weatherData.hour + 'h', }), - Widget.Label({ label: weatherData.icon, class_name: 'weather-icon', }), - Widget.Label({ label: weatherData.temperature, class_name: 'weather-temperature' }), - Widget.Box({ vexpand: true }), - weatherData.rain !== '0 mm' ? Widget.Label({ label: weatherData.rain, }) : null, - // Widget.Label({ label: " " + weatherData.wind, }), - // Widget.Label({ label: weatherData.humidity, }), - Widget.Label({ label: '↑ ' + weatherData.maxTemp, class_name: 'weather-max', }), - Widget.Label({ label: '↓ ' + weatherData.minTemp, class_name: 'weather-min', }), - ], - setup: self => self.hook(Weather, () => { - weatherBackgroundStyle(weatherData.icon, self) - }), -}); - -function getMostCommon(arr){ - return arr.sort((a,b) => - arr.filter(v => v===a).length - - arr.filter(v => v===b).length - ).pop(); -} - -export const WeatherBoxChild = (w) => Widget.Box({ - class_name: 'qs-weather-box-child', - vertical: true, - hexpand: true, - children: [ - Widget.Label({ label: w.hour + 'h', class_name: 'weather-hour', }), - Widget.Label({ label: w.icon, class_name: 'weather-icon', }), - Widget.Label({ label: w.temperature, class_name: 'weather-temperature' }), - Widget.Box({ vexpand: true }), - w.rain !== '0 mm' ? Widget.Label({ label: w.rain, class_name: 'weather-rain', }) : null, - Widget.Label({ label: " " + Math.round(w.wind.replace(/kph$/, '')) + ' kph', class_name: 'weather-wind', }), - ], -}); - -export const WeatherBoxChildWrapper = (w, temperatureDataPerDay, totalWeatherForecastDataArray) => Widget.Box({ - class_name: 'qs-weather-box-child-wrapper', - hexpand: true, - setup: self => self.hook(Weather, () => { - let useTotalInstead = false; - - if (totalWeatherForecastDataArray.length) { - useTotalInstead = true; - - totalWeatherForecastDataArray.forEach(totalEl => { - self.add( - WeatherBoxChild(totalEl), - ) - }) - } - - if (false === useTotalInstead && w && temperatureDataPerDay && temperatureDataPerDay[w.date.substring(0, 3).toUpperCase()].data.length) { - temperatureDataPerDay[w.date.substring(0, 3).toUpperCase()].data.forEach(el => { - self.add( - WeatherBoxChild(el), - ) - }) - } - }), -}); - -export const WeatherMainWidget = (widgetIcon, widgetDate, rain, temperatureDataPerDay, w, totalWeatherForecastDataArray = []) => Widget.Box({ - class_name: 'qsweather-widget', - vertical: true, - hexpand: true, - children: [ - Widget.Box({ - class_name: 'qs-weather-box-main', - children: [ - Widget.Label({ label: widgetIcon, class_name: 'weather-icon', }), - rain != 0 ? Widget.Label({ label: rain + 'mm', class_name: 'weather-rain', }): null, - Widget.Box({ hexpand: true }), - Widget.Label({ label: '↑ ' + temperatureDataPerDay[widgetDate.substring(0, 3).toUpperCase()].maxTemp + ' ', class_name: 'weather-max', }), - Widget.Label({ label: '↓ ' + temperatureDataPerDay[widgetDate.substring(0, 3).toUpperCase()].minTemp + ' ', class_name: 'weather-min', }), - Widget.Label({ label: widgetDate.substring(0, 3).toUpperCase(), class_name: 'weather-hour', }), - ] - }), - WeatherBoxChildWrapper(w, temperatureDataPerDay, totalWeatherForecastDataArray) - - ], - setup: self => self.hook(Weather, () => { - weatherBackgroundStyle(widgetIcon, self); - }), -}); - -export const Tooltip = (total = null) => Widget.Box({ - setup: self => self.hook(Weather, () => { - let tooltip = Weather.tooltip; - - if (tooltip) { - self.get_children().forEach(ch => ch.destroy()); - - let prevDayName = null; - let temperatureDataPerDay = {}; - let weatherStatusIconArray = []; - let weatherForecastDataArray = []; - let totalWeatherForecastDataArray = []; - - let totalWeatherForecastsCounter = total; - let forecastWidgetsNumber = 0; - - tooltip.forEach(w => { - if (w.date !== prevDayName) { - weatherStatusIconArray = []; - prevDayName = w.date; - forecastWidgetsNumber = 0; - weatherForecastDataArray = []; - } - - // used to retrieve min/max temp per day - const date = w.date.substring(0, 3).toUpperCase(); - const temperature = parseInt(w.temperature); - - const rain = w.rain.replace(/ mm$/, ''); - forecastWidgetsNumber = forecastWidgetsNumber + 1; - - weatherForecastDataArray.push(w); - - if (total && totalWeatherForecastsCounter && totalWeatherForecastsCounter > 0) { - totalWeatherForecastDataArray.push(w); - totalWeatherForecastsCounter = totalWeatherForecastsCounter - 1; - } - - // If the date is not already in the object, initialize it - if (!temperatureDataPerDay[date]) { - temperatureDataPerDay[date] = { - minTemp: temperature, - maxTemp: temperature, - rain: rain, - icons: [], - widgetsNumber: forecastWidgetsNumber, - data: weatherForecastDataArray, - }; - } else { - // Update min and max temperatures if necessary - temperatureDataPerDay[date].minTemp = Math.min(temperatureDataPerDay[date].minTemp, temperature); - temperatureDataPerDay[date].maxTemp = Math.max(temperatureDataPerDay[date].maxTemp, temperature); - temperatureDataPerDay[date].rain = Math.max(temperatureDataPerDay[date].rain, rain); - temperatureDataPerDay[date].icons = weatherStatusIconArray; - temperatureDataPerDay[date].widgetsNumber = forecastWidgetsNumber; - temperatureDataPerDay[date].data = weatherForecastDataArray; - } - - // add icon to the array in between somewhat sunny hours, used to later get most common icon for main widget days - if (w.hour >= 7 && w.hour <= 19) { - weatherStatusIconArray.push(w.icon); - } - }); - - // clear for next loop - prevDayName = null; - - let widgetIcon = null; - let widgetDate = null; - - let w = null; - for (let i = 0; i < tooltip.length; i++) { - w = tooltip[i]; - - // console.log('loop ' + w.date + ' h ' + w.hour + ' i ' + w.icon ) - - // used to limit forecast to specified amount (if total variable is provided, it will display that amount of forecast widgets on a main one) - if (total && total >= 0) { - - if (!widgetIcon) { - widgetIcon = w.icon; - } - - if (!widgetDate) { - widgetDate = w.date; - } - - const rain = temperatureDataPerDay[widgetDate.substring(0, 3).toUpperCase()].rain; - - self.add( - WeatherMainWidget(widgetIcon, widgetDate, rain, temperatureDataPerDay, w, totalWeatherForecastDataArray) - ); - break; - } - - // if provided date differs to previous day name, by default prevDayName is null - if (w.date !== prevDayName && i > 0) { - // adds spacing to the widgets - self.add( - Widget.Box({ - children: [ - Widget.Label({ label: ' ', class_name: 'weather-spacing' }), - ], - }), - ); - } - - // logic that determines if the widget contains just 1 forecast widget, if so it will display it in a smaller widget - like the one for the forecast days - if (temperatureDataPerDay[w.date.substring(0, 3).toUpperCase()].widgetsNumber === 1) { - prevDayName = w.date; - - self.add(WeatherInfo(w)); - continue; - } - - // this one creates main one - wide weather widget that contains smaller forecast widgets - if (w.date !== prevDayName) { - const rain = temperatureDataPerDay[w.date.substring(0, 3).toUpperCase()].rain; - let icon = getMostCommon(temperatureDataPerDay[w.date.substring(0, 3).toUpperCase()].icons); - widgetDate = w.date; - - if (!icon) { - icon = w.icon; - } - - widgetIcon = icon; - - self.add( - WeatherMainWidget(widgetIcon, widgetDate, rain, temperatureDataPerDay, w) - ); - } - - prevDayName = w.date; - }; - } - }), -}); - -export const ResetTimer = props => Widget.Label({ - ...props, - setup: self => { - self.poll(600000, (self) => { - Weather.weatherData - }); - }, -}); - -export const Forecast = () => Widget.Box({ - class_name: 'datemenu', - vertical: true, - children: [ - Widget.Box({ - class_name: 'tooltip', - children: [ - ResetTimer(), - Tooltip(), - ] - }) - ] -}); - -export const PopupContent = () => Widget.Box({ - class_name: 'weather', - vexpand: false, - children: [ - Widget.Box({ - vertical: true, - children: [ - Forecast(), - // RefreshButton({ class_name: 'header panel-button', }), - ] - }) - ] -}); - -export const RefreshButton = props => Widget.Button({ - ...props, - class_name: 'weather-refresh', - child: Widget.Icon({ - icon: 'view-refresh-symbolic', - hpack: 'end', - }), - on_clicked: () => { - Weather.weatherData - }, -}); \ No newline at end of file diff --git a/ags/weather/weather_service.js b/ags/weather/weather_service.js deleted file mode 100644 index 66a38f9..0000000 --- a/ags/weather/weather_service.js +++ /dev/null @@ -1,32 +0,0 @@ -import Service from 'resource:///com/github/Aylur/ags/service.js'; -import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; - -class Weather extends Service { - static { Service.register(this); } - - constructor() { - super(); - this._temperatureWeather = null; - this._tooltip = null; - } - - get weatherData() { - this._temperatureWeather = JSON.parse(Utils.exec(['python', "/home/tola/dotfiles/ags/weather/wttr.py"])) // .then(temp => {console.log(temp)}).catch(print); - return this._temperatureWeather - } - - // get temperatureWeather() { - // return this._temperatureWeather; - // } - // setTemperatureWeather(temp) { - // this._temperatureWeather = temp; - // this.emit('changed'); - // } - - // get tooltip() { - // return this._tooltip; - // } - // setTooltip(text) { this._tooltip = text } -} - -export default new Weather(); \ No newline at end of file diff --git a/ags/weather/wttr.py b/ags/weather/wttr.py deleted file mode 100755 index 5fd2a23..0000000 --- a/ags/weather/wttr.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/python - -import json -import requests -from datetime import datetime - -WEATHER_CODES = { - '113': '☀️', - '116': '⛅️', - '119': '☁️', - '122': '☁️', - '143': '🌫', - '176': '🌦', - '179': '🌧', - '182': '🌧', - '185': '🌧', - '200': '⛈', - '227': '🌨', - '230': '❄️', - '248': '🌫', - '260': '🌫', - '263': '🌦', - '266': '🌦', - '281': '🌧', - '284': '🌧', - '293': '🌦', - '296': '🌦', - '299': '🌧', - '302': '🌧', - '305': '🌧', - '308': '🌧', - '311': '🌧', - '314': '🌧', - '317': '🌧', - '320': '🌨', - '323': '🌨', - '326': '🌨', - '329': '❄️', - '332': '❄️', - '335': '❄️', - '338': '❄️', - '350': '🌧', - '353': '🌦', - '356': '🌧', - '359': '🌧', - '362': '🌧', - '365': '🌧', - '368': '🌨', - '371': '❄️', - '374': '🌧', - '377': '🌧', - '386': '⛈', - '389': '🌩', - '392': '⛈', - '395': '❄️' -} - -weather: json = requests.get("https://wttr.in/tomsk?format=j1").json() - -# data = json.load(weather) - -weather['current_condition'][0]['weatherCode'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] - -print(json.dumps(weather)) diff --git a/ags/weather/wttr.sh b/ags/weather/wttr.sh deleted file mode 100755 index 89a0c44..0000000 --- a/ags/weather/wttr.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -weather=$(curl wttr.in/tomsk\?format\=j1) - -echo weather diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml deleted file mode 100644 index 7b21161..0000000 --- a/alacritty/alacritty.toml +++ /dev/null @@ -1,39 +0,0 @@ -[colors.cursor] -cursor = "CellForeground" -text = "CellBackground" - -[colors.primary] -background = "#000000" -foreground = "#ffffff" - -[cursor.style] -blinking = "Off" -shape = "Beam" - -[env] -TERM = "alacritty" - -[font] -size = 11.0 - -[font.bold] -family = "JetBrains Mono" - -[font.bold_italic] -family = "JetBrains Mono" - -[font.italic] -family = "JetBrains Mono" - -[font.normal] -family = "JetBrains Mono" - -[scrolling] -history = 10000 - -[window] -opacity = 0.7 - -[window.padding] -x = 5 -y = 5 diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml deleted file mode 100644 index dad0747..0000000 --- a/alacritty/alacritty.yml +++ /dev/null @@ -1,30 +0,0 @@ -env: - TERM: alacritty -window: - padding: - x: 5 - y: 5 - opacity: 0.7 -scrolling: - history: 10000 -font: - normal: - family: "JetBrains Mono" - bold: - family: JetBrains Mono - italic: - family: JetBrains Mono - bold_italic: - family: JetBrains Mono - size: 11.0 -colors: - primary: - background: '#000000' - foreground: '#ffffff' - cursor: - text: CellBackground - cursor: CellForeground -cursor: - style: - shape: Beam - blinking: Off diff --git a/bin/batperc b/bin/batperc deleted file mode 100755 index d1aa0b7..0000000 --- a/bin/batperc +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -Green='\033[0;32m' -Color_off='\033[0m' -Red='\033[0;31m' -Yellow='\033[1;33m' - -batteries=$(ls /sys/class/power_supply/ | grep BAT) - -case "$1" in - "-c") - if [[ "$batteries" == "" ]]; then - printf "$Yellow**$Red error:$Color_off no battery found\n" - exit 1; - fi - for i in $batteries; do - batfull=$(cat /sys/class/power_supply/$i/energy_full) - batnow=$(cat /sys/class/power_supply/$i/energy_now) - batperc=$((($batnow/($batfull/100)))) - - if [[ "$batperc" -le "20" ]]; then - printf "$Yellow**$Color_off $i: $Red$batperc$Color_off\n" - exit 0 - fi - - if [[ "$batperc" -le "70" ]]; then - printf "$Yellow**$Color_off $i: $Yellow$batperc$Color_off\n" - exit 0 - fi - - printf "$Yellow**$Color_off $i: $Green$batperc$Color_off\n" - done - ;; - "-j") - if [[ "$batteries" == "" ]]; then - echo no - exit 1; - fi - for i in $batteries; do - batfull=$(cat /sys/class/power_supply/$i/energy_full) - batnow=$(cat /sys/class/power_supply/$i/energy_now) - batperc=$((($batnow/($batfull/100)))) - - printf "$batperc \n" - done - ;; -esac - diff --git a/bin/batpercd b/bin/batpercd deleted file mode 100755 index 1d90705..0000000 --- a/bin/batpercd +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -batperc=$(~/dotfiles/bin/batperc -j) - -echo $batperc - -if [[ "$batperc" != "no" ]]; then - while true; do - for i in $batperc; do - if [[ "$i" -le "20" ]]; then - notify-send "Battery low: $i%" -u critical - sleep 60 - fi - done - done -fi diff --git a/bin/batpercd.sh b/bin/batpercd.sh deleted file mode 100644 index aed3a6a..0000000 --- a/bin/batpercd.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -while true; do - BAT=$(acpi -S | cut -d' ' -f4 | sed 's/.$//') - - if [ $BAT -le 9 ]; then - notify-send "Низкий заряд батареи!!!" -u critical - sleep 60s - fi - sleep 5s -done & \ No newline at end of file diff --git a/bin/checkUpdates.sh b/bin/checkUpdates.sh deleted file mode 100755 index 39bf6ec..0000000 --- a/bin/checkUpdates.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -check_arch_updates() { - official_updates=0 - aur_updates=0 - - if [ "$1" = "-y" ]; then - aur_updates=$(yay -Qum 2>/dev/null | wc -l) - elif [ "$1" = "-p" ]; then - official_updates=$(checkupdates 2>/dev/null | wc -l) - else - official_updates=$(checkupdates 2>/dev/null | wc -l) - aur_updates=$(yay -Qum 2>/dev/null | wc -l) - fi - - total_updates=$((official_updates + aur_updates)) - - echo $total_updates -} - -check_ubuntu_updates() { - result=$(apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst) - echo "$result" -} - -check_fedora_updates() { - result=$(dnf check-update -q | grep -v '^Loaded plugins' | grep -v '^No match for' | wc -l) - echo "$result" -} - -case "$1" in --arch) - check_arch_updates "$2" - ;; --ubuntu) - check_ubuntu_updates - ;; --fedora) - check_fedora_updates - ;; -*) - echo "0" - ;; -esac diff --git a/bin/checktraffic b/bin/checktraffic deleted file mode 100755 index 3f1efad..0000000 --- a/bin/checktraffic +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env sh - -# ---- colors ---- -RESET='\033[0m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -BLUE='\033[0;34m' -# ---------------- - -interface=$1 -bytes=$2 - -prev_tx_traffic=0 -prev_rx_traffic=0 - -while true; do - clear - tx_traffic=$(cat /sys/class/net/${interface}/statistics/tx_bytes) - rx_traffic=$(cat /sys/class/net/${interface}/statistics/rx_bytes) - tx_traffic_speed=$(($tx_traffic-$prev_tx_traffic)) - rx_traffic_speed=$(($rx_traffic-$prev_rx_traffic)) - # echo $tx_traffic_speed - # echo $rx_traffic_speed - prev_tx_traffic=$tx_traffic - prev_rx_traffic=$rx_traffic - - traffic_color=$GREEN - if [[ $(echo $(($rx_traffic/1024/1024/1024))) > 5 ]]; then - traffic_color=$YELLOW - elif [[ $(echo $(($rx_traffic/1024/1024/1024))) > 10 ]]; then - traffic_color=$RED - fi - - if [[ $bytes == 'k' ]] || [[ $bytes == 'K' ]]; then - printf "$BLUE tx traffic speed$RESET = $(($tx_traffic_speed/1024)) Kb/s\n" - printf "$BLUE tx traffic$RESET = $(($tx_traffic/1024)) Kb\n" - printf "$BLUE rx traffic speed$RESET = $(($rx_traffic_speed/1024)) Kb/s\n" - printf "$traffic_color rx traffic$RESET = $(($rx_traffic/1024)) Kb\n" - fi - - if [[ $bytes == 'm' ]] || [[ $bytes == 'M' ]]; then - printf "$BLUE tx traffic speed$RESET = $(($tx_traffic_speed/1024/1024)) Mb/s\n" - printf "$BLUE tx traffic$RESET = $(($tx_traffic/1024/1024)) Mb\n" - printf "$BLUE rx traffic speed$RESET = $(($rx_traffic_speed/1024/1024)) Mb/s\n" - printf "$traffic_color rx traffic$RESET = $(($rx_traffic/1024/1024)) Mb\n" - fi - - if [[ $bytes == 'g' ]] || [[ $bytes == 'G' ]]; then - if [[ $(echo $(($tx_traffic/1024/1024/1024))) == 0 ]]; then - printf "$BLUE tx traffic$RESET = $(($tx_traffic/1024/1024)) Mb\n" - else - printf "$BLUE tx traffic$RESET = $(($tx_traffic/1024/1024/1024)) Gb\n" - fi - if [[ $(echo $(($rx_traffic/1024/1024/1024))) == 0 ]]; then - printf "$traffic_color rx traffic$RESET = $(($rx_traffic/1024/1024)) Mb\n" - else - printf "$traffic_color rx traffic$RESET = $(($rx_traffic/1024/1024/1024)) Gb\n" - fi - fi - - if [[ $bytes == 'b' ]] || [[ $bytes == '' ]]; then - printf "$BLUE tx traffic$RESET = $(($tx_traffic)) b\n" - printf "$traffic_color rx traffic$RESET = $(($rx_traffic)) b\n" - fi - - sleep 1 -done - diff --git a/bin/diskspeedtest b/bin/diskspeedtest deleted file mode 100755 index ca86ec5..0000000 --- a/bin/diskspeedtest +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env sh - -HD=$1 - -if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then - echo "usage: $0 [HD]" - exit 0 -fi - -sudo hdparm -Tt $HD - diff --git a/bin/dpmsdisablexorg b/bin/dpmsdisablexorg deleted file mode 100755 index 5315c5c..0000000 --- a/bin/dpmsdisablexorg +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -xset -dpms -xset s off - diff --git a/bin/fet.sh b/bin/fet.sh deleted file mode 100755 index 1fb3c5a..0000000 --- a/bin/fet.sh +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/sh -# -# fet.sh -# a fetch in pure POSIX shell -# - -# supress errors -exec 2>/dev/null -set -- -eq() { # equals | [ a = b ] with globbing - case $1 in - $2) ;; - *) return 1;; - esac -} - -## DE -wm=$XDG_CURRENT_DESKTOP -[ "$wm" ] || wm=$DESKTOP_SESSION - -## Distro -# freedesktop.org/software/systemd/man/os-release.html -# a common file that has variables about the distro -for os in /etc/os-release /usr/lib/os-release; do - # some POSIX shells exit when trying to source a file that doesn't exist - [ -f $os ] && . $os && break -done - -if [ -e /proc/$$/comm ]; then - ## Terminal - while [ ! "$term" ]; do - # loop over lines in /proc/pid/status until it reaches PPid - # then save that to a variable and exit the file - while read -r line; do - eq "$line" 'PPid*' && ppid=${line##*:?} && break - done < "/proc/${ppid:-$PPID}/status" - - # Make sure not to do an infinite loop - [ "$pppid" = "$ppid" ] && break - pppid=$ppid - - # get name of binary - read -r name < "/proc/$ppid/comm" - - case $name in - *sh|"${0##*/}") ;; # skip shells - *[Ll]ogin*|*init|*systemd*) break;; # exit when the top is reached - # anything else can be assumed to be the terminal - # this has the side affect of catching tmux, but tmux - # detaches from the terminal and therefore ignoring that - # will just make the init the term - *) term=$name - esac - done - - ## WM/DE - [ "$wm" ] || - # loop over all processes and check the binary name - for i in /proc/*/comm; do - read -r c < "$i" - case $c in - *bar*|*rc) ;; - awesome|xmonad*|qtile|sway|i3|[bfo]*box|*wm*) wm=${c%%-*}; break;; - esac - done - - ## Memory - # loop over lines in /proc/meminfo until it reaches MemTotal, - # then convert the amount (second word) from KB to MB - while read -r line; do - eq "$line" 'MemTotal*' && set -- $line && break - done < /proc/meminfo - mem="$(( $2 / 1000 ))MB" - - ## Processor - while read -r line; do - case $line in - vendor_id*) vendor="${line##*: } ";; - model\ name*) cpu=${line##*: }; break;; - esac - done < /proc/cpuinfo - - ## Uptime - # the simple math is shamefully stolen from aosync - IFS=. read -r uptime _ < /proc/uptime - d=$((uptime / 60 / 60 / 24)) - up=$(printf %02d:%02d $((uptime / 60 / 60 % 24)) $((uptime / 60 % 60))) - [ "$d" -gt 0 ] && up="${d}d $up" - - ## Kernel - read -r _ _ version _ < /proc/version - kernel=${version%%-*} - eq "$version" '*Microsoft*' && ID="fake $ID" - - ## Motherboard // laptop - read -r model < /sys/devices/virtual/dmi/id/product_name - # invalid model handling - case $model in - # alternate file with slightly different info - # on my laptop it has the device model (instead of 'hp notebook') - # on my desktop it has the extended motherboard model - 'System '*|'Default '*|'To Be Filled'*) - read -r model < /sys/devices/virtual/dmi/id/board_name - esac - - ## Packages - # clean environment, then make every file in the dir an argument, - # then save the argument count to $pkgs - set -- - # kiss, arch, debian, void, gentoo - for i in '/var/db/kiss/installed/*' '/var/lib/pacman/local/[0-9a-z]*' \ - '/var/lib/dpkg/info/*.list' '/var/db/xbps/.*' '/var/db/pkg/*/*'; do - set -- $i - [ $# -gt 1 ] && pkgs=$# && break - done - - read -r host < /proc/sys/kernel/hostname -elif [ -f /var/run/dmesg.boot ]; then - # Both OpenBSD and FreeBSD use this file, however they're formatted differently - read -r bsd < /var/run/dmesg.boot - case $bsd in - Open*) - ## OpenBSD cpu/mem/name - while read -r line; do - case $line in - 'real mem'*) - # use the pre-formatted value which is in brackets - mem=${line##*\(} - mem=${mem%\)*} - ;; - # set $cpu to everything before a comma and after the field name - cpu0:*) - cpu=${line#cpu0: } - # Remove excess info after the actual CPU name - cpu=${cpu%%,*} - # Set the CPU Manufacturer to the first word of the cpu - # variable [separated by '(' or ' '] - vendor=${cpu%%[\( ]*} - # We got all the info we want, stop reading - break - ;; - # First 2 words in the file are OpenBSD - *) [ "$ID" ] || { set -- $line; ID="$1 $2"; } - esac - done < /var/run/dmesg.boot - [ -d /var/db/pkg ] && set -- /var/db/pkg/* && pkgs=$# - read -r host < /etc/myname - host=${host%.*} - ;; - # Everything else, assume FreeBSD (first line is ---<> or something) - *) - # shellcheck source=/dev/null - . /etc/rc.conf - # shut shellcheck up without disabling the warning - host=${hostname:-} - - while read -r line; do - case $line in - # os version - FreeBSD*) - # If the OS is already set, no need to set it again - [ "$ID" ] && continue - ID=${line%%-R*} - ;; - - CPU:*) - cpu=${cpu#CPU: } - # Remove excess info from after the actual CPU name - cpu=${line%\(*} - ;; - *Origin=*) - # CPU Manufacturer - vendor=${line#*Origin=\"} - vendor="${vendor%%\"*} " - ;; - - 'real memory'*) - # Get the pre-formatted amount which is inside brackets - mem=${line##*\(} - mem=${mem%\)*} - # This appears to be the final thing we need from the file, - # no need to read it more. - break - esac - done < /var/run/dmesg.boot - ;; - esac -elif v=/System/Library/CoreServices/SystemVersion.plist; [ -f "$v" ]; then - ## Macos - # make sure this variable is empty as to not break the following loop - temp= - while read -r line; do - case $line in - # set a variable so the script knows it's on the correct line - # (the line after this one is the important one) - *ProductVersion*) temp=.;; - *) - # check if the script is reading the derired line, if not - # don't do anything - [ "$temp" ] || continue - # Remove everything before and including the first '>' - ID=${line#*>} - # Remove the other side of the XML tag, and insert the actual OS name - ID="MacOS ${ID%<*}" - # We got the info we want, end the loop. - break - esac - done < "$v" -fi - -eq "$0" '*fetish' && printf 'Step on me daddy\n' && exit - -# help i dont know if it's a capital consistently -eq "$wm" '*[Gg][Nn][Oo][Mm][Ee]*' && wm='foot DE' - -## GTK -while read -r line; do - eq "$line" 'gtk-theme*' && gtk=${line##*=} && break -done < "${XDG_CONFIG_HOME:=$HOME/.config}/gtk-3.0/settings.ini" - -# Shorten $cpu and $vendor -# this is so messy due to so many inconsistencies in the model names -vendor=${vendor##*Authentic} -vendor=${vendor##*Genuine} -cpu=${cpu##*) } -cpu=${cpu%% @*} -cpu=${cpu%% CPU} -cpu=${cpu##CPU } -cpu=${cpu##*AMD } -cpu=${cpu%% with*} -cpu=${cpu% *-Core*} - -col() { - printf ' ' - for i in 1 2 3 4 5 6; do - printf '\033[9%sm%s' "$i" "${colourblocks:-▅▅}" - done - printf '\033[0m\n' -} - -print() { - [ "$2" ] && printf '\033[9%sm%6s\033[0m%b%s\n' \ - "${accent:-4}" "$1" "${separator:- ~ }" "$2" -} - -# default value -: "${info:=n user os sh wm up gtk cpu mem host kern pkgs term col n}" - -for i in $info; do - case $i in - n) echo;; - os) print os "$ID";; - sh) print sh "${SHELL##*/}";; - wm) print wm "${wm##*/}";; - up) print up "$up";; - gtk) print gtk "${gtk# }";; - cpu) print cpu "$vendor$cpu";; - mem) print mem "$mem";; - host) print host "$model";; - kern) print kern "$kernel";; - pkgs) print pkgs "$pkgs";; - term) print term "$term";; - user) printf '%7s@%s\n' "$USER" "$host";; - col) col;; - esac -done diff --git a/bin/fff b/bin/fff deleted file mode 100755 index 16766e3..0000000 --- a/bin/fff +++ /dev/null @@ -1,1145 +0,0 @@ -#!/usr/bin/env bash -# -# fff - fucking fast file-manager. - -get_os() { - # Figure out the current operating system to set some specific variables. - # '$OSTYPE' typically stores the name of the OS kernel. - case $OSTYPE in - # Mac OS X / macOS. - darwin*) - opener=open - file_flags=bIL - ;; - - haiku) - opener=open - - [[ -z $FFF_TRASH_CMD ]] && - FFF_TRASH_CMD=trash - - [[ $FFF_TRASH_CMD == trash ]] && { - FFF_TRASH=$(finddir -v "$PWD" B_TRASH_DIRECTORY) - mkdir -p "$FFF_TRASH" - } - ;; - esac -} - -setup_terminal() { - # Setup the terminal for the TUI. - # '\e[?1049h': Use alternative screen buffer. - # '\e[?7l': Disable line wrapping. - # '\e[?25l': Hide the cursor. - # '\e[2J': Clear the screen. - # '\e[1;Nr': Limit scrolling to scrolling area. - # Also sets cursor to (0,0). - printf '\e[?1049h\e[?7l\e[?25l\e[2J\e[1;%sr' "$max_items" - - # Hide echoing of user input - stty -echo -} - -reset_terminal() { - # Reset the terminal to a useable state (undo all changes). - # '\e[?7h': Re-enable line wrapping. - # '\e[?25h': Unhide the cursor. - # '\e[2J': Clear the terminal. - # '\e[;r': Set the scroll region to its default value. - # Also sets cursor to (0,0). - # '\e[?1049l: Restore main screen buffer. - printf '\e[?7h\e[?25h\e[2J\e[;r\e[?1049l' - - # Show user input. - stty echo -} - -clear_screen() { - # Only clear the scrolling window (dir item list). - # '\e[%sH': Move cursor to bottom of scroll area. - # '\e[9999C': Move cursor to right edge of the terminal. - # '\e[1J': Clear screen to top left corner (from cursor up). - # '\e[2J': Clear screen fully (if using tmux) (fixes clear issues). - # '\e[1;%sr': Clearing the screen resets the scroll region(?). Re-set it. - # Also sets cursor to (0,0). - printf '\e[%sH\e[9999C\e[1J%b\e[1;%sr' \ - "$((LINES-2))" "${TMUX:+\e[2J}" "$max_items" -} - -setup_options() { - # Some options require some setup. - # This function is called once on open to parse - # select options so the operation isn't repeated - # multiple times in the code. - - # Format for normal files. - [[ $FFF_FILE_FORMAT == *%f* ]] && { - file_pre=${FFF_FILE_FORMAT/'%f'*} - file_post=${FFF_FILE_FORMAT/*'%f'} - } - - # Format for marked files. - # Use affixes provided by the user or use defaults, if necessary. - if [[ $FFF_MARK_FORMAT == *%f* ]]; then - mark_pre=${FFF_MARK_FORMAT/'%f'*} - mark_post=${FFF_MARK_FORMAT/*'%f'} - else - mark_pre=" " - mark_post="*" - fi - - # Find supported 'file' arguments. - file -I &>/dev/null || : "${file_flags:=biL}" -} - -get_term_size() { - # Get terminal size ('stty' is POSIX and always available). - # This can't be done reliably across all bash versions in pure bash. - read -r LINES COLUMNS < <(stty size) - - # Max list items that fit in the scroll area. - ((max_items=LINES-3)) -} - -get_ls_colors() { - # Parse the LS_COLORS variable and declare each file type - # as a separate variable. - # Format: ':.ext=0;0:*.jpg=0;0;0:*png=0;0;0;0:' - [[ -z $LS_COLORS ]] && { - FFF_LS_COLORS=0 - return - } - - # Turn $LS_COLORS into an array. - IFS=: read -ra ls_cols <<< "$LS_COLORS" - - for ((i=0;i<${#ls_cols[@]};i++)); { - # Separate patterns from file types. - [[ ${ls_cols[i]} =~ ^\*[^\.] ]] && - ls_patterns+="${ls_cols[i]/=*}|" - - # Prepend 'ls_' to all LS_COLORS items - # if they aren't types of files (symbolic links, block files etc.) - [[ ${ls_cols[i]} =~ ^(\*|\.) ]] && { - ls_cols[i]=${ls_cols[i]#\*} - ls_cols[i]=ls_${ls_cols[i]#.} - } - } - - # Strip non-ascii characters from the string as they're - # used as a key to color the dir items and variable - # names in bash must be '[a-zA-z0-9_]'. - ls_cols=("${ls_cols[@]//[^a-zA-Z0-9=\\;]/_}") - - # Store the patterns in a '|' separated string - # for use in a REGEX match later. - ls_patterns=${ls_patterns//\*} - ls_patterns=${ls_patterns%?} - - # Define the ls_ variables. - # 'declare' can't be used here as variables are scoped - # locally. 'declare -g' is not available in 'bash 3'. - # 'export' is a viable alternative. - export "${ls_cols[@]}" &>/dev/null -} - -get_w3m_path() { - # Find the path to the w3m-img library. - w3m_paths=(/usr/{pkg/,}{local/,}{bin,lib,libexec,lib64,libexec64}/w3m/w3mi*) - read -r w3m _ < <(type -p "$FFF_W3M_PATH" w3mimgdisplay "${w3m_paths[@]}") -} - -get_mime_type() { - # Get a file's mime_type. - mime_type=$(file "-${file_flags:-biL}" "$1" 2>/dev/null) -} - -status_line() { - # Status_line to print when files are marked for operation. - local mark_ui="[${#marked_files[@]}] selected (${file_program[*]}) [p] ->" - - # Escape the directory string. - # Remove all non-printable characters. - PWD_escaped=${PWD//[^[:print:]]/^[} - - # '\e7': Save cursor position. - # This is more widely supported than '\e[s'. - # '\e[%sH': Move cursor to bottom of the terminal. - # '\e[30;41m': Set foreground and background colors. - # '%*s': Insert enough spaces to fill the screen width. - # This sets the background color to the whole line - # and fixes issues in 'screen' where '\e[K' doesn't work. - # '\r': Move cursor back to column 0 (was at EOL due to above). - # '\e[m': Reset text formatting. - # '\e[H\e[K': Clear line below status_line. - # '\e8': Restore cursor position. - # This is more widely supported than '\e[u'. - printf '\e7\e[%sH\e[3%s;4%sm%*s\r%s %s%s\e[m\e[%sH\e[K\e8' \ - "$((LINES-1))" \ - "${FFF_COL5:-0}" \ - "${FFF_COL2:-1}" \ - "$COLUMNS" "" \ - "($((scroll+1))/$((list_total+1)))" \ - "${marked_files[*]:+${mark_ui}}" \ - "${1:-${PWD_escaped:-/}}" \ - "$LINES" -} - -read_dir() { - # Read a directory to an array and sort it directories first. - local dirs - local files - local item_index - - # Set window name. - printf '\e]2;fff: %s\e'\\ "$PWD" - - # If '$PWD' is '/', unset it to avoid '//'. - [[ $PWD == / ]] && PWD= - - for item in "$PWD"/*; do - if [[ -d $item ]]; then - dirs+=("$item") - - # Find the position of the child directory in the - # parent directory list. - [[ $item == "$OLDPWD" ]] && - ((previous_index=item_index)) - ((item_index++)) - else - files+=("$item") - fi - done - - list=("${dirs[@]}" "${files[@]}") - - # Indicate that the directory is empty. - [[ -z ${list[0]} ]] && - list[0]=empty - - ((list_total=${#list[@]}-1)) - - # Save the original dir in a second list as a backup. - cur_list=("${list[@]}") -} - -print_line() { - # Format the list item and print it. - local file_name=${list[$1]##*/} - local file_ext=${file_name##*.} - local format - local suffix - - # If the dir item doesn't exist, end here. - if [[ -z ${list[$1]} ]]; then - return - - # Directory. - elif [[ -d ${list[$1]} ]]; then - format+=\\e[${di:-1;3${FFF_COL1:-2}}m - suffix+=/ - - # Block special file. - elif [[ -b ${list[$1]} ]]; then - format+=\\e[${bd:-40;33;01}m - - # Character special file. - elif [[ -c ${list[$1]} ]]; then - format+=\\e[${cd:-40;33;01}m - - # Executable file. - elif [[ -x ${list[$1]} ]]; then - format+=\\e[${ex:-01;32}m - - # Symbolic Link (broken). - elif [[ -h ${list[$1]} && ! -e ${list[$1]} ]]; then - format+=\\e[${mi:-01;31;7}m - - # Symbolic Link. - elif [[ -h ${list[$1]} ]]; then - format+=\\e[${ln:-01;36}m - - # Fifo file. - elif [[ -p ${list[$1]} ]]; then - format+=\\e[${pi:-40;33}m - - # Socket file. - elif [[ -S ${list[$1]} ]]; then - format+=\\e[${so:-01;35}m - - # Color files that end in a pattern as defined in LS_COLORS. - # 'BASH_REMATCH' is an array that stores each REGEX match. - elif [[ $FFF_LS_COLORS == 1 && - $ls_patterns && - $file_name =~ ($ls_patterns)$ ]]; then - match=${BASH_REMATCH[0]} - file_ext=ls_${match//[^a-zA-Z0-9=\\;]/_} - format+=\\e[${!file_ext:-${fi:-37}}m - - # Color files based on file extension and LS_COLORS. - # Check if file extension adheres to POSIX naming - # standard before checking if it's a variable. - elif [[ $FFF_LS_COLORS == 1 && - $file_ext != "$file_name" && - $file_ext =~ ^[a-zA-Z0-9_]*$ ]]; then - file_ext=ls_${file_ext} - format+=\\e[${!file_ext:-${fi:-37}}m - - else - format+=\\e[${fi:-37}m - fi - - # If the list item is under the cursor. - (($1 == scroll)) && - format+="\\e[1;3${FFF_COL4:-6};7m" - - # If the list item is marked for operation. - [[ ${marked_files[$1]} == "${list[$1]:-null}" ]] && { - format+=\\e[3${FFF_COL3:-1}m${mark_pre} - suffix+=${mark_post} - } - - # Escape the directory string. - # Remove all non-printable characters. - file_name=${file_name//[^[:print:]]/^[} - - printf '\r%b%s\e[m\r' \ - "${file_pre}${format}" \ - "${file_name}${suffix}${file_post}" -} - -draw_dir() { - # Print the max directory items that fit in the scroll area. - local scroll_start=$scroll - local scroll_new_pos - local scroll_end - - # When going up the directory tree, place the cursor on the position - # of the previous directory. - ((find_previous == 1)) && { - ((scroll_start=previous_index)) - ((scroll=scroll_start)) - - # Clear the directory history. We're here now. - find_previous= - } - - # If current dir is near the top of the list, keep scroll position. - if ((list_total < max_items || scroll < max_items/2)); then - ((scroll_start=0)) - ((scroll_end=max_items)) - ((scroll_new_pos=scroll+1)) - - # If current dir is near the end of the list, keep scroll position. - elif ((list_total - scroll < max_items/2)); then - ((scroll_start=list_total-max_items+1)) - ((scroll_new_pos=max_items-(list_total-scroll))) - ((scroll_end=list_total+1)) - - # If current dir is somewhere in the middle, center scroll position. - else - ((scroll_start=scroll-max_items/2)) - ((scroll_end=scroll_start+max_items)) - ((scroll_new_pos=max_items/2+1)) - fi - - # Reset cursor position. - printf '\e[H' - - for ((i=scroll_start;i scroll_start)) && - printf '\n' - - print_line "$i" - } - - # Move the cursor to its new position if it changed. - # If the variable 'scroll_new_pos' is empty, the cursor - # is moved to line '0'. - printf '\e[%sH' "$scroll_new_pos" - ((y=scroll_new_pos)) -} - -draw_img() { - # Draw an image file on the screen using w3m-img. - # We can use the framebuffer; set win_info_cmd as appropriate. - [[ $(tty) == /dev/tty[0-9]* && -w /dev/fb0 ]] && - win_info_cmd=fbset - - # X isn't running and we can't use the framebuffer, do nothing. - [[ -z $DISPLAY && $win_info_cmd != fbset ]] && - return - - # File isn't an image file, do nothing. - get_mime_type "${list[scroll]}" - [[ $mime_type != image/* ]] && - return - - # w3m-img isn't installed, do nothing. - type -p "$w3m" &>/dev/null || { - cmd_line "error: Couldn't find 'w3m-img', is it installed?" - return - } - - # $win_info_cmd isn't installed, do nothing. - type -p "${win_info_cmd:=xdotool}" &>/dev/null || { - cmd_line "error: Couldn't find '$win_info_cmd', is it installed?" - return - } - - # Get terminal window size in pixels and set it to WIDTH and HEIGHT. - if [[ $win_info_cmd == xdotool ]]; then - IFS=$'\n' read -d "" -ra win_info \ - < <(xdotool getactivewindow getwindowgeometry --shell) - - declare "${win_info[@]}" &>/dev/null || { - cmd_line "error: Failed to retrieve window size." - return - } - else - [[ $(fbset --show) =~ .*\"([0-9]+x[0-9]+)\".* ]] - IFS=x read -r WIDTH HEIGHT <<< "${BASH_REMATCH[1]}" - fi - - # Get the image size in pixels. - read -r img_width img_height < <("$w3m" <<< "5;${list[scroll]}") - - # Subtract the status_line area from the image size. - ((HEIGHT=HEIGHT-HEIGHT*5/LINES)) - - ((img_width > WIDTH)) && { - ((img_height=img_height*WIDTH/img_width)) - ((img_width=WIDTH)) - } - - ((img_height > HEIGHT)) && { - ((img_width=img_width*HEIGHT/img_height)) - ((img_height=HEIGHT)) - } - - clear_screen - status_line "${list[scroll]}" - - # Add a small delay to fix issues in VTE terminals. - ((BASH_VERSINFO[0] > 3)) && - read "${read_flags[@]}" -srn 1 - - # Display the image. - printf '0;1;%s;%s;%s;%s;;;;;%s\n3;\n4\n' \ - "${FFF_W3M_XOFFSET:-0}" \ - "${FFF_W3M_YOFFSET:-0}" \ - "$img_width" \ - "$img_height" \ - "${list[scroll]}" | "$w3m" &>/dev/null - - # Wait for user input. - read -ern 1 - - # Clear the image. - printf '6;%s;%s;%s;%s\n3;' \ - "${FFF_W3M_XOFFSET:-0}" \ - "${FFF_W3M_YOFFSET:-0}" \ - "$WIDTH" \ - "$HEIGHT" | "$w3m" &>/dev/null - - redraw -} - -redraw() { - # Redraw the current window. - # If 'full' is passed, re-fetch the directory list. - [[ $1 == full ]] && { - read_dir - scroll=0 - } - - clear_screen - draw_dir - status_line -} - -mark() { - # Mark file for operation. - # If an item is marked in a second directory, - # clear the marked files. - [[ $PWD != "$mark_dir" ]] && - marked_files=() - - # Don't allow the user to mark the empty directory list item. - [[ ${list[0]} == empty && -z ${list[1]} ]] && - return - - if [[ $1 == all ]]; then - if ((${#marked_files[@]} != ${#list[@]})); then - marked_files=("${list[@]}") - mark_dir=$PWD - else - marked_files=() - fi - - redraw - else - if [[ ${marked_files[$1]} == "${list[$1]}" ]]; then - unset 'marked_files[scroll]' - - else - marked_files[$1]="${list[$1]}" - mark_dir=$PWD - fi - - # Clear line before changing it. - printf '\e[K' - print_line "$1" - fi - - # Find the program to use. - case "$2" in - ${FFF_KEY_YANK:=y}|${FFF_KEY_YANK_ALL:=Y}) file_program=(cp -iR) ;; - ${FFF_KEY_MOVE:=m}|${FFF_KEY_MOVE_ALL:=M}) file_program=(mv -i) ;; - ${FFF_KEY_LINK:=s}|${FFF_KEY_LINK_ALL:=S}) file_program=(ln -s) ;; - - # These are 'fff' functions. - ${FFF_KEY_TRASH:=d}|${FFF_KEY_TRASH_ALL:=D}) - file_program=(trash) - ;; - - ${FFF_KEY_BULK_RENAME:=b}|${FFF_KEY_BULK_RENAME_ALL:=B}) - file_program=(bulk_rename) - ;; - esac - - status_line -} - -trash() { - # Trash a file. - cmd_line "trash [${#marked_files[@]}] items? [y/n]: " y n - - [[ $cmd_reply != y ]] && - return - - if [[ $FFF_TRASH_CMD ]]; then - # Pass all but the last argument to the user's - # custom script. command is used to prevent this function - # from conflicting with commands named "trash". - command "$FFF_TRASH_CMD" "${@:1:$#-1}" - - else - cd "$FFF_TRASH" || cmd_line "error: Can't cd to trash directory." - - if cp -alf "$@" &>/dev/null; then - rm -r "${@:1:$#-1}" - else - mv -f "$@" - fi - - # Go back to where we were. - cd "$OLDPWD" ||: - fi -} - -bulk_rename() { - # Bulk rename files using '$EDITOR'. - rename_file=${XDG_CACHE_HOME:=${HOME}/.cache}/fff/bulk_rename - marked_files=("${@:1:$#-1}") - - # Save marked files to a file and open them for editing. - printf '%s\n' "${marked_files[@]##*/}" > "$rename_file" - "${EDITOR:-vi}" "$rename_file" - - # Read the renamed files to an array. - IFS=$'\n' read -d "" -ra changed_files < "$rename_file" - - # If the user deleted a line, stop here. - ((${#marked_files[@]} != ${#changed_files[@]})) && { - rm "$rename_file" - cmd_line "error: Line mismatch in rename file. Doing nothing." - return - } - - printf '%s\n%s\n' \ - "# This file will be executed when the editor is closed." \ - "# Clear the file to abort." > "$rename_file" - - # Construct the rename commands. - for ((i=0;i<${#marked_files[@]};i++)); { - [[ ${marked_files[i]} != "${PWD}/${changed_files[i]}" ]] && { - printf 'mv -i -- %q %q\n' \ - "${marked_files[i]}" "${PWD}/${changed_files[i]}" - local renamed=1 - } - } >> "$rename_file" - - # Let the user double-check the commands and execute them. - ((renamed == 1)) && { - "${EDITOR:-vi}" "$rename_file" - - source "$rename_file" - rm "$rename_file" - } - - # Fix terminal settings after '$EDITOR'. - setup_terminal -} - -open() { - # Open directories and files. - if [[ -d $1/ ]]; then - search= - search_end_early= - cd "${1:-/}" ||: - redraw full - - elif [[ -f $1 ]]; then - # Figure out what kind of file we're working with. - get_mime_type "$1" - - # Open all text-based files in '$EDITOR'. - # Everything else goes through 'xdg-open'/'open'. - case "$mime_type" in - text/*|*x-empty*|*json*) - # If 'fff' was opened as a file picker, save the opened - # file in a file called 'opened_file'. - ((file_picker == 1)) && { - printf '%s\n' "$1" > \ - "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/opened_file" - exit - } - - clear_screen - reset_terminal - "${VISUAL:-${EDITOR:-vi}}" "$1" - setup_terminal - redraw - ;; - - *) - # 'nohup': Make the process immune to hangups. - # '&': Send it to the background. - # 'disown': Detach it from the shell. - nohup "${FFF_OPENER:-${opener:-xdg-open}}" "$1" &>/dev/null & - disown - ;; - esac - fi -} - -cmd_line() { - # Write to the command_line (under status_line). - cmd_reply= - - # '\e7': Save cursor position. - # '\e[?25h': Unhide the cursor. - # '\e[%sH': Move cursor to bottom (cmd_line). - printf '\e7\e[%sH\e[?25h' "$LINES" - - # '\r\e[K': Redraw the read prompt on every keypress. - # This is mimicking what happens normally. - while IFS= read -rsn 1 -p $'\r\e[K'"${1}${cmd_reply}" read_reply; do - case $read_reply in - # Backspace. - $'\177'|$'\b') - cmd_reply=${cmd_reply%?} - - # Clear tab-completion. - unset comp c - ;; - - # Tab. - $'\t') - comp_glob="$cmd_reply*" - - # Pass the argument dirs to limit completion to directories. - [[ $2 == dirs ]] && - comp_glob="$cmd_reply*/" - - # Generate a completion list once. - [[ -z ${comp[0]} ]] && - IFS=$'\n' read -d "" -ra comp < <(compgen -G "$comp_glob") - - # On each tab press, cycle through the completion list. - [[ -n ${comp[c]} ]] && { - cmd_reply=${comp[c]} - ((c=c >= ${#comp[@]}-1 ? 0 : ++c)) - } - ;; - - # Escape / Custom 'no' value (used as a replacement for '-n 1'). - $'\e'|${3:-null}) - read "${read_flags[@]}" -rsn 2 - cmd_reply= - break - ;; - - # Enter/Return. - "") - # If there's only one search result and its a directory, - # enter it on one enter keypress. - [[ $2 == search && -d ${list[0]} ]] && ((list_total == 0)) && { - # '\e[?25l': Hide the cursor. - printf '\e[?25l' - - open "${list[0]}" - search_end_early=1 - - # Unset tab completion variables since we're done. - unset comp c - return - } - - break - ;; - - # Custom 'yes' value (used as a replacement for '-n 1'). - ${2:-null}) - cmd_reply=$read_reply - break - ;; - - # Replace '~' with '$HOME'. - "~") - cmd_reply+=$HOME - ;; - - # Anything else, add it to read reply. - *) - cmd_reply+=$read_reply - - # Clear tab-completion. - unset comp c - ;; - esac - - # Search on keypress if search passed as an argument. - [[ $2 == search ]] && { - # '\e[?25l': Hide the cursor. - printf '\e[?25l' - - # Use a greedy glob to search. - list=("$PWD"/*"$cmd_reply"*) - ((list_total=${#list[@]}-1)) - - # Draw the search results on screen. - scroll=0 - redraw - - # '\e[%sH': Move cursor back to cmd-line. - # '\e[?25h': Unhide the cursor. - printf '\e[%sH\e[?25h' "$LINES" - } - done - - # Unset tab completion variables since we're done. - unset comp c - - # '\e[2K': Clear the entire cmd_line on finish. - # '\e[?25l': Hide the cursor. - # '\e8': Restore cursor position. - printf '\e[2K\e[?25l\e8' -} - -key() { - # Handle special key presses. - [[ $1 == $'\e' ]] && { - read "${read_flags[@]}" -rsn 2 - - # Handle a normal escape key press. - [[ ${1}${REPLY} == $'\e\e['* ]] && - read "${read_flags[@]}" -rsn 1 _ - - local special_key=${1}${REPLY} - } - - case ${special_key:-$1} in - # Open list item. - # 'C' is what bash sees when the right arrow is pressed - # ('\e[C' or '\eOC'). - # '' is what bash sees when the enter/return key is pressed. - ${FFF_KEY_CHILD1:=l}|\ - ${FFF_KEY_CHILD2:=$'\e[C'}|\ - ${FFF_KEY_CHILD3:=""}|\ - ${FFF_KEY_CHILD4:=$'\eOC'}) - open "${list[scroll]}" - ;; - - # Go to the parent directory. - # 'D' is what bash sees when the left arrow is pressed - # ('\e[D' or '\eOD'). - # '\177' and '\b' are what bash sometimes sees when the backspace - # key is pressed. - ${FFF_KEY_PARENT1:=h}|\ - ${FFF_KEY_PARENT2:=$'\e[D'}|\ - ${FFF_KEY_PARENT3:=$'\177'}|\ - ${FFF_KEY_PARENT4:=$'\b'}|\ - ${FFF_KEY_PARENT5:=$'\eOD'}) - # If a search was done, clear the results and open the current dir. - if ((search == 1 && search_end_early != 1)); then - open "$PWD" - - # If '$PWD' is '/', do nothing. - elif [[ $PWD && $PWD != / ]]; then - find_previous=1 - open "${PWD%/*}" - fi - ;; - - # Scroll down. - # 'B' is what bash sees when the down arrow is pressed - # ('\e[B' or '\eOB'). - ${FFF_KEY_SCROLL_DOWN1:=j}|\ - ${FFF_KEY_SCROLL_DOWN2:=$'\e[B'}|\ - ${FFF_KEY_SCROLL_DOWN3:=$'\eOB'}) - ((scroll < list_total)) && { - ((scroll++)) - ((y < max_items)) && ((y++)) - - print_line "$((scroll-1))" - printf '\n' - print_line "$scroll" - status_line - } - ;; - - # Scroll up. - # 'A' is what bash sees when the up arrow is pressed - # ('\e[A' or '\eOA'). - ${FFF_KEY_SCROLL_UP1:=k}|\ - ${FFF_KEY_SCROLL_UP2:=$'\e[A'}|\ - ${FFF_KEY_SCROLL_UP3:=$'\eOA'}) - # '\e[1L': Insert a line above the cursor. - # '\e[A': Move cursor up a line. - ((scroll > 0)) && { - ((scroll--)) - - print_line "$((scroll+1))" - - if ((y < 2)); then - printf '\e[L' - else - printf '\e[A' - ((y--)) - fi - - print_line "$scroll" - status_line - } - ;; - - # Go to top. - ${FFF_KEY_TO_TOP:=g}) - ((scroll != 0)) && { - scroll=0 - redraw - } - ;; - - # Go to bottom. - ${FFF_KEY_TO_BOTTOM:=G}) - ((scroll != list_total)) && { - ((scroll=list_total)) - redraw - } - ;; - - # Show hidden files. - ${FFF_KEY_HIDDEN:=.}) - # 'a=a>0?0:++a': Toggle between both values of 'shopt_flags'. - # This also works for '3' or more values with - # some modification. - shopt_flags=(u s) - shopt -"${shopt_flags[((a=${a:=$FFF_HIDDEN}>0?0:++a))]}" dotglob - redraw full - ;; - - # Search. - ${FFF_KEY_SEARCH:=/}) - cmd_line "/" "search" - - # If the search came up empty, redraw the current dir. - if [[ -z ${list[*]} ]]; then - list=("${cur_list[@]}") - ((list_total=${#list[@]}-1)) - redraw - search= - else - search=1 - fi - ;; - - # Spawn a shell. - ${FFF_KEY_SHELL:=!}) - reset_terminal - - # Make fff aware of how many times it is nested. - export FFF_LEVEL - ((FFF_LEVEL++)) - - cd "$PWD" && "$SHELL" - setup_terminal - redraw full - ;; - - # Mark files for operation. - ${FFF_KEY_YANK:=y}|\ - ${FFF_KEY_MOVE:=m}|\ - ${FFF_KEY_TRASH:=d}|\ - ${FFF_KEY_LINK:=s}|\ - ${FFF_KEY_BULK_RENAME:=b}) - mark "$scroll" "$1" - ;; - - # Mark all files for operation. - ${FFF_KEY_YANK_ALL:=Y}|\ - ${FFF_KEY_MOVE_ALL:=M}|\ - ${FFF_KEY_TRASH_ALL:=D}|\ - ${FFF_KEY_LINK_ALL:=S}|\ - ${FFF_KEY_BULK_RENAME_ALL:=B}) - mark all "$1" - ;; - - # Do the file operation. - ${FFF_KEY_PASTE:=p}) - [[ ${marked_files[*]} ]] && { - [[ ! -w $PWD ]] && { - cmd_line "warn: no write access to dir." - return - } - - # Clear the screen to make room for a prompt if needed. - clear_screen - reset_terminal - - stty echo - printf '\e[1mfff\e[m: %s\n' "Running ${file_program[0]}" - "${file_program[@]}" "${marked_files[@]}" . - stty -echo - - marked_files=() - setup_terminal - redraw full - } - ;; - - # Clear all marked files. - ${FFF_KEY_CLEAR:=c}) - [[ ${marked_files[*]} ]] && { - marked_files=() - redraw - } - ;; - - # Rename list item. - ${FFF_KEY_RENAME:=r}) - [[ ! -e ${list[scroll]} ]] && - return - - cmd_line "rename ${list[scroll]##*/}: " - - [[ $cmd_reply ]] && - if [[ -e $cmd_reply ]]; then - cmd_line "warn: '$cmd_reply' already exists." - - elif [[ -w ${list[scroll]} ]]; then - mv "${list[scroll]}" "${PWD}/${cmd_reply}" - redraw full - - else - cmd_line "warn: no write access to file." - fi - ;; - - # Create a directory. - ${FFF_KEY_MKDIR:=n}) - cmd_line "mkdir: " "dirs" - - [[ $cmd_reply ]] && - if [[ -e $cmd_reply ]]; then - cmd_line "warn: '$cmd_reply' already exists." - - elif [[ -w $PWD ]]; then - mkdir -p "${PWD}/${cmd_reply}" - redraw full - - else - cmd_line "warn: no write access to dir." - fi - ;; - - # Create a file. - ${FFF_KEY_MKFILE:=f}) - cmd_line "mkfile: " - - [[ $cmd_reply ]] && - if [[ -e $cmd_reply ]]; then - cmd_line "warn: '$cmd_reply' already exists." - - elif [[ -w $PWD ]]; then - : > "$cmd_reply" - redraw full - - else - cmd_line "warn: no write access to dir." - fi - ;; - - # Show file attributes. - ${FFF_KEY_ATTRIBUTES:=x}) - [[ -e "${list[scroll]}" ]] && { - clear_screen - status_line "${list[scroll]}" - "${FFF_STAT_CMD:-stat}" "${list[scroll]}" - read -ern 1 - redraw - } - ;; - - # Toggle executable flag. - ${FFF_KEY_EXECUTABLE:=X}) - [[ -f ${list[scroll]} && -w ${list[scroll]} ]] && { - if [[ -x ${list[scroll]} ]]; then - chmod -x "${list[scroll]}" - status_line "Unset executable." - else - chmod +x "${list[scroll]}" - status_line "Set executable." - fi - } - ;; - - # Show image in terminal. - ${FFF_KEY_IMAGE:=i}) - draw_img - ;; - - # Go to dir. - ${FFF_KEY_GO_DIR:=:}) - cmd_line "go to dir: " "dirs" - - # Let 'cd' know about the current directory. - cd "$PWD" &>/dev/null ||: - - [[ $cmd_reply ]] && - cd "${cmd_reply/\~/$HOME}" &>/dev/null && - open "$PWD" - ;; - - # Go to '$HOME'. - ${FFF_KEY_GO_HOME:='~'}) - open ~ - ;; - - # Go to trash. - ${FFF_KEY_GO_TRASH:=t}) - get_os - open "$FFF_TRASH" - ;; - - # Go to previous dir. - ${FFF_KEY_PREVIOUS:=-}) - open "$OLDPWD" - ;; - - # Refresh current dir. - ${FFF_KEY_REFRESH:=e}) - open "$PWD" - ;; - - # Directory favourites. - [1-9]) - favourite="FFF_FAV${1}" - favourite="${!favourite}" - - [[ $favourite ]] && - open "$favourite" - ;; - - # Quit and store current directory in a file for CD on exit. - # Don't allow user to redefine 'q' so a bad keybinding doesn't - # remove the option to quit. - q) - : "${FFF_CD_FILE:=${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d}" - - [[ -w $FFF_CD_FILE ]] && - rm "$FFF_CD_FILE" - - [[ ${FFF_CD_ON_EXIT:=1} == 1 ]] && - printf '%s\n' "$PWD" > "$FFF_CD_FILE" - - exit - ;; - esac -} - -main() { - # Handle a directory as the first argument. - # 'cd' is a cheap way of finding the full path to a directory. - # It updates the '$PWD' variable on successful execution. - # It handles relative paths as well as '../../../'. - # - # '||:': Do nothing if 'cd' fails. We don't care. - cd "${2:-$1}" &>/dev/null ||: - - [[ $1 == -v ]] && { - printf '%s\n' "fff 2.2" - exit - } - - [[ $1 == -h ]] && { - man fff - exit - } - - # Store file name in a file on open instead of using 'FFF_OPENER'. - # Used in 'fff.vim'. - [[ $1 == -p ]] && - file_picker=1 - - # bash 5 and some versions of bash 4 don't allow SIGWINCH to interrupt - # a 'read' command and instead wait for it to complete. In this case it - # causes the window to not redraw on resize until the user has pressed - # a key (causing the read to finish). This sets a read timeout on the - # affected versions of bash. - # NOTE: This shouldn't affect idle performance as the loop doesn't do - # anything until a key is pressed. - # SEE: https://github.com/dylanaraps/fff/issues/48 - ((BASH_VERSINFO[0] > 3)) && - read_flags=(-t 0.05) - - ((${FFF_LS_COLORS:=1} == 1)) && - get_ls_colors - - ((${FFF_HIDDEN:=0} == 1)) && - shopt -s dotglob - - # Create the trash and cache directory if they don't exist. - mkdir -p "${XDG_CACHE_HOME:=${HOME}/.cache}/fff" \ - "${FFF_TRASH:=${XDG_DATA_HOME:=${HOME}/.local/share}/fff/trash}" - - # 'nocaseglob': Glob case insensitively (Used for case insensitive search). - # 'nullglob': Don't expand non-matching globs to themselves. - shopt -s nocaseglob nullglob - - # Trap the exit signal (we need to reset the terminal to a useable state.) - trap 'reset_terminal' EXIT - - # Trap the window resize signal (handle window resize events). - trap 'get_term_size; redraw' WINCH - - get_os - get_term_size - get_w3m_path - setup_options - setup_terminal - redraw full - - # Vintage infinite loop. - for ((;;)); { - read "${read_flags[@]}" -srn 1 && key "$REPLY" - - # Exit if there is no longer a terminal attached. - [[ -t 1 ]] || exit 1 - } -} - -main "$@" diff --git a/bin/homeasussamsunglayout.sh b/bin/homeasussamsunglayout.sh deleted file mode 100755 index 0360685..0000000 --- a/bin/homeasussamsunglayout.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output eDP1 --primary --mode 1366x768 --pos 1440x0 --rotate normal --output DP1 --off --output DP2 --off --output HDMI1 --off --output HDMI2 --mode 1440x900 --pos 0x0 --rotate normal --output VIRTUAL1 --off diff --git a/bin/linux-chroot.sh b/bin/linux-chroot.sh deleted file mode 100755 index f11516d..0000000 --- a/bin/linux-chroot.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -PATH=$1 -SHELL=$2 - -#------- Check root func ------------------- -check_root() { - if [ $(/usr/bin/id -u) -ne 0 ]; then - printf "** You must be root\n" - exit 1 - fi -} -#------------------------------------------- - -#----------- checking or create dirs ------- -check_or_mkdir() { - [ ! -d $PATH/dev ] && mkdir -pv $PATH/dev - [ ! -d $PATH/proc ] && mkdir -pv $PATH/proc - [ ! -d $PATH/sys ] && mkdir -pv $PATH/sys - [ ! -d $PATH/run ] && mkdir -pv $PATH/run -} -#------------------------------------------- - -#-------- mount virtual filesystems -------- -mount_virtual() { - /usr/bin/mount -v --bind /dev $PATH/dev - /usr/bin/mount -vt devpts devpts -o gid=5,mode=0620 $PATH/dev/pts - /usr/bin/mount -vt proc proc $PATH/proc - /usr/bin/mount -vt sysfs sysfs $PATH/sys - /usr/bin/mount -vt tmpfs tmpfs $PATH/run - if [ -h $PATH/dev/shm ]; then - /usr/bin/install -v -d -m 1777 $PATH$(/usr/bin/realpath /dev/shm) - else - /usr/bin/mount -vt tmpfs -o nosuid,nodev tmpfs $PATH/dev/shm - fi - /usr/bin/cp -v /etc/resolv.conf $PATH/etc/resolv.conf -} -#------------------------------------------- - -#------ umount virtual filesystems --------- -umount_virtual() { - /usr/bin/mountpoint -q $PATH/dev/shm && /usr/bin/umount $PATH/dev/shm - /usr/bin/umount $PATH/dev/pts - /usr/bin/umount $PATH/{sys,proc,run,dev} -} -#------------------------------------------- - -#------ get shell path func ---------------- -get_shell() { - if [[ "$SHELL" != "" ]]; then - echo $SHELL - fi - echo "/bin/sh" -} -#------------------------------------------- - -check_root -check_or_mkdir -mount_virtual -/usr/bin/chroot \ - $PATH \ - /usr/bin/env -i \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin \ - $(get_shell) -umount_virtual diff --git a/bin/lisascreens b/bin/lisascreens deleted file mode 100755 index 90fefe7..0000000 --- a/bin/lisascreens +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -xrandr --output HDMI-0 --mode 1680x1050 - -cvt 1920 1200 60 -xrandr --newmode "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync - -xrandr --addmode DVI-0 1920x1200_60.00 -xrandr --output DVI-0 --mode 1920x1200_60.00 - -~/dotfiles/bin/lisascreenslayout.sh - diff --git a/bin/lisascreenslayout.sh b/bin/lisascreenslayout.sh deleted file mode 100755 index ecf724f..0000000 --- a/bin/lisascreenslayout.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output DisplayPort-0 --off --output HDMI-0 --mode 1680x1050 --pos 0x0 --rotate normal --output DVI-0 --mode 1920x1200_60.00 --pos 1680x0 --rotate normal --output DVI-1 --off diff --git a/bin/lroot b/bin/lroot deleted file mode 120000 index 74980a5..0000000 --- a/bin/lroot +++ /dev/null @@ -1 +0,0 @@ -linux-chroot.sh \ No newline at end of file diff --git a/bin/netdevlist b/bin/netdevlist deleted file mode 100755 index 1b1fae2..0000000 --- a/bin/netdevlist +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -ls --color /sys/class/net - diff --git a/bin/pfetch b/bin/pfetch deleted file mode 100755 index d47b878..0000000 --- a/bin/pfetch +++ /dev/null @@ -1,1958 +0,0 @@ -#!/bin/sh -# -# pfetch - Simple POSIX sh fetch script. - -# Wrapper around all escape sequences used by pfetch to allow for -# greater control over which sequences are used (if any at all). -esc() { - case $1 in - CUU) e="${esc_c}[${2}A" ;; # cursor up - CUD) e="${esc_c}[${2}B" ;; # cursor down - CUF) e="${esc_c}[${2}C" ;; # cursor right - CUB) e="${esc_c}[${2}D" ;; # cursor left - - # text formatting - SGR) - case ${PF_COLOR:=1} in - (1) - e="${esc_c}[${2}m" - ;; - - (0) - # colors disabled - e= - ;; - esac - ;; - - # line wrap - DECAWM) - case $TERM in - (dumb | minix | cons25) - # not supported - e= - ;; - - (*) - e="${esc_c}[?7${2}" - ;; - esac - ;; - esac -} - -# Print a sequence to the terminal. -esc_p() { - esc "$@" - printf '%s' "$e" -} - -# This is just a simple wrapper around 'command -v' to avoid -# spamming '>/dev/null' throughout this function. This also guards -# against aliases and functions. -has() { - _cmd=$(command -v "$1") 2>/dev/null || return 1 - [ -x "$_cmd" ] || return 1 -} - -log() { - # The 'log()' function handles the printing of information. - # In 'pfetch' (and 'neofetch'!) the printing of the ascii art and info - # happen independently of each other. - # - # The size of the ascii art is stored and the ascii is printed first. - # Once the ascii is printed, the cursor is located right below the art - # (See marker $[1]). - # - # Using the stored ascii size, the cursor is then moved to marker $[2]. - # This is simply a cursor up escape sequence using the "height" of the - # ascii art. - # - # 'log()' then moves the cursor to the right the "width" of the ascii art - # with an additional amount of padding to add a gap between the art and - # the information (See marker $[3]). - # - # When 'log()' has executed, the cursor is then located at marker $[4]. - # When 'log()' is run a second time, the next line of information is - # printed, moving the cursor to marker $[5]. - # - # Markers $[4] and $[5] repeat all the way down through the ascii art - # until there is no more information left to print. - # - # Every time 'log()' is called the script keeps track of how many lines - # were printed. When printing is complete the cursor is then manually - # placed below the information and the art according to the "heights" - # of both. - # - # The math is simple: move cursor down $((ascii_height - info_height)). - # If the aim is to move the cursor from marker $[5] to marker $[6], - # plus the ascii height is 8 while the info height is 2 it'd be a move - # of 6 lines downwards. - # - # However, if the information printed is "taller" (takes up more lines) - # than the ascii art, the cursor isn't moved at all! - # - # Once the cursor is at marker $[6], the script exits. This is the gist - # of how this "dynamic" printing and layout works. - # - # This method allows ascii art to be stored without markers for info - # and it allows for easy swapping of info order and amount. - # - # $[2] ___ $[3] goldie@KISS - # $[4](.· | $[5] os KISS Linux - # (<> | - # / __ \ - # ( / \ /| - # _/\ __)/_) - # \/-____\/ - # $[1] - # - # $[6] /home/goldie $ - - # End here if no data was found. - [ "$2" ] || return - - # Store the values of '$1' and '$3' as we reset the argument list below. - name=$1 - use_seperator=$3 - - # Use 'set --' as a means of stripping all leading and trailing - # white-space from the info string. This also normalizes all - # white-space inside of the string. - # - # Disable the shellcheck warning for word-splitting - # as it's safe and intended ('set -f' disables globbing). - # shellcheck disable=2046,2086 - { - set -f - set +f -- $2 - info=$* - } - - # Move the cursor to the right, the width of the ascii art with an - # additional gap for text spacing. - esc_p CUF "$ascii_width" - - # Print the info name and color the text. - esc_p SGR "3${PF_COL1-4}"; - esc_p SGR 1 - printf '%s' "$name" - esc_p SGR 0 - - # Print the info name and info data separator, if applicable. - [ "$use_seperator" ] || printf %s "$PF_SEP" - - # Move the cursor backward the length of the *current* info name and - # then move it forwards the length of the *longest* info name. This - # aligns each info data line. - esc_p CUB "${#name}" - esc_p CUF "${PF_ALIGN:-$info_length}" - - # Print the info data, color it and strip all leading whitespace - # from the string. - esc_p SGR "3${PF_COL2-9}" - printf '%s' "$info" - esc_p SGR 0 - printf '\n' - - # Keep track of the number of times 'log()' has been run. - info_height=$((${info_height:-0} + 1)) -} - -get_title() { - # Username is retrieved by first checking '$USER' with a fallback - # to the 'id -un' command. - user=${USER:-$(id -un)} - - # Hostname is retrieved by first checking '$HOSTNAME' with a fallback - # to the 'hostname' command. - # - # Disable the warning about '$HOSTNAME' being undefined in POSIX sh as - # the intention for using it is allowing the user to overwrite the - # value on invocation. - # shellcheck disable=3028,2039 - hostname=${HOSTNAME:-${hostname:-$(hostname)}} - - # If the hostname is still not found, fallback to the contents of the - # /etc/hostname file. - [ "$hostname" ] || read -r hostname < /etc/hostname - - # Add escape sequences for coloring to user and host name. As we embed - # them directly in the arguments passed to log(), we cannot use esc_p(). - esc SGR 1 - user=$e$user - esc SGR "3${PF_COL3:-1}" - user=$e$user - esc SGR 1 - user=$user$e - esc SGR 1 - hostname=$e$hostname - esc SGR "3${PF_COL3:-1}" - hostname=$e$hostname - - log "${user}@${hostname}" " " " " >&6 -} - -get_os() { - # This function is called twice, once to detect the distribution name - # for the purposes of picking an ascii art early and secondly to display - # the distribution name in the info output (if enabled). - # - # On first run, this function displays _nothing_, only on the second - # invocation is 'log()' called. - [ "$distro" ] && { - log os "$distro" >&6 - return - } - - case $os in - (Linux*) - # Some Linux distributions (which are based on others) - # fail to identify as they **do not** change the upstream - # distribution's identification packages or files. - # - # It is senseless to add a special case in the code for - # each and every distribution (which _is_ technically no - # different from what it is based on) as they're either too - # lazy to modify upstream's identification files or they - # don't have the know-how (or means) to ship their own - # lsb-release package. - # - # This causes users to think there's a bug in system detection - # tools like neofetch or pfetch when they technically *do* - # function correctly. - # - # Exceptions are made for distributions which are independent, - # not based on another distribution or follow different - # standards. - # - # This applies only to distributions which follow the standard - # by shipping unmodified identification files and packages - # from their respective upstreams. - if has lsb_release; then - distro=$(lsb_release -sd) - - # Android detection works by checking for the existence of - # the follow two directories. I don't think there's a simpler - # method than this. - elif [ -d /system/app ] && [ -d /system/priv-app ]; then - distro="Android $(getprop ro.build.version.release)" - - elif [ -f /etc/os-release ]; then - # This used to be a simple '. /etc/os-release' but I believe - # this is insecure as we blindly executed whatever was in the - # file. This parser instead simply handles 'key=val', treating - # the file contents as plain-text. - while IFS='=' read -r key val; do - case $key in - (PRETTY_NAME) - distro=$val - ;; - esac - done < /etc/os-release - - else - # Special cases for (independent) distributions which - # don't follow any os-release/lsb standards whatsoever. - has crux && distro=$(crux) - has guix && distro='Guix System' - fi - - # 'os-release' and 'lsb_release' sometimes add quotes - # around the distribution name, strip them. - distro=${distro##[\"\']} - distro=${distro%%[\"\']} - - # Check to see if we're running Bedrock Linux which is - # very unique. This simply checks to see if the user's - # PATH contains a Bedrock specific value. - case $PATH in - (*/bedrock/cross/*) - distro='Bedrock Linux' - ;; - esac - - # Check to see if Linux is running in Windows 10 under - # WSL1 (Windows subsystem for Linux [version 1]) and - # append a string accordingly. - # - # If the kernel version string ends in "-Microsoft", - # we're very likely running under Windows 10 in WSL1. - if [ "$WSLENV" ]; then - distro="${distro}${WSLENV+ on Windows 10 [WSL2]}" - - # Check to see if Linux is running in Windows 10 under - # WSL2 (Windows subsystem for Linux [version 2]) and - # append a string accordingly. - # - # This checks to see if '$WSLENV' is defined. This - # appends the Windows 10 string even if '$WSLENV' is - # empty. We only need to check that is has been _exported_. - elif [ -z "${kernel%%*-Microsoft}" ]; then - distro="$distro on Windows 10 [WSL1]" - fi - ;; - - (Darwin*) - # Parse the SystemVersion.plist file to grab the macOS - # version. The file is in the following format: - # - # ProductVersion - # 10.14.6 - # - # 'IFS' is set to '<>' to enable splitting between the - # keys and a second 'read' is used to operate on the - # next line directly after a match. - # - # '_' is used to nullify a field. '_ _ line _' basically - # says "populate $line with the third field's contents". - while IFS='<>' read -r _ _ line _; do - case $line in - # Match 'ProductVersion' and read the next line - # directly as it contains the key's value. - ProductVersion) - IFS='<>' read -r _ _ mac_version _ - continue - ;; - - ProductName) - IFS='<>' read -r _ _ mac_product _ - continue - ;; - esac - done < /System/Library/CoreServices/SystemVersion.plist - - # Use the ProductVersion to determine which macOS/OS X codename - # the system has. As far as I'm aware there's no "dynamic" way - # of grabbing this information. - case $mac_version in - (10.4*) distro='Mac OS X Tiger' ;; - (10.5*) distro='Mac OS X Leopard' ;; - (10.6*) distro='Mac OS X Snow Leopard' ;; - (10.7*) distro='Mac OS X Lion' ;; - (10.8*) distro='OS X Mountain Lion' ;; - (10.9*) distro='OS X Mavericks' ;; - (10.10*) distro='OS X Yosemite' ;; - (10.11*) distro='OS X El Capitan' ;; - (10.12*) distro='macOS Sierra' ;; - (10.13*) distro='macOS High Sierra' ;; - (10.14*) distro='macOS Mojave' ;; - (10.15*) distro='macOS Catalina' ;; - (11*) distro='macOS Big Sur' ;; - (12*) distro='macOS Monterey' ;; - (*) distro='macOS' ;; - esac - - # Use the ProductName to determine if we're running in iOS. - case $mac_product in - (iP*) distro='iOS' ;; - esac - - distro="$distro $mac_version" - ;; - - (Haiku) - # Haiku uses 'uname -v' for version information - # instead of 'uname -r' which only prints '1'. - distro=$(uname -sv) - ;; - - (Minix|DragonFly) - distro="$os $kernel" - - # Minix and DragonFly don't support the escape - # sequences used, clear the exit trap. - trap '' EXIT - ;; - - (SunOS) - # Grab the first line of the '/etc/release' file - # discarding everything after '('. - IFS='(' read -r distro _ < /etc/release - ;; - - (OpenBSD*) - # Show the OpenBSD version type (current if present). - # kern.version=OpenBSD 6.6-current (GENERIC.MP) ... - IFS=' =' read -r _ distro openbsd_ver _ <<-EOF - $(sysctl kern.version) - EOF - - distro="$distro $openbsd_ver" - ;; - - (FreeBSD) - distro="$os $(freebsd-version)" - ;; - - (*) - # Catch all to ensure '$distro' is never blank. - # This also handles the BSDs. - distro="$os $kernel" - ;; - esac -} - -get_kernel() { - case $os in - # Don't print kernel output on some systems as the - # OS name includes it. - (*BSD*|Haiku|Minix) - return - ;; - esac - - # '$kernel' is the cached output of 'uname -r'. - log kernel "$kernel" >&6 -} - -get_host() { - case $os in - (Linux*) - # Despite what these files are called, version doesn't - # always contain the version nor does name always contain - # the name. - read -r name < /sys/devices/virtual/dmi/id/product_name - read -r version < /sys/devices/virtual/dmi/id/product_version - read -r model < /sys/firmware/devicetree/base/model - - host="$name $version $model" - ;; - - (Darwin* | FreeBSD* | DragonFly*) - host=$(sysctl -n hw.model) - ;; - - (NetBSD*) - host=$(sysctl -n machdep.dmi.system-vendor \ - machdep.dmi.system-product) - ;; - - (OpenBSD*) - host=$(sysctl -n hw.version) - ;; - - (*BSD* | Minix) - host=$(sysctl -n hw.vendor hw.product) - ;; - esac - - # Turn the host string into an argument list so we can iterate - # over it and remove OEM strings and other information which - # shouldn't be displayed. - # - # Disable the shellcheck warning for word-splitting - # as it's safe and intended ('set -f' disables globbing). - # shellcheck disable=2046,2086 - { - set -f - set +f -- $host - host= - } - - # Iterate over the host string word by word as a means of stripping - # unwanted and OEM information from the string as a whole. - # - # This could have been implemented using a long 'sed' command with - # a list of word replacements, however I want to show that something - # like this is possible in pure sh. - # - # This string reconstruction is needed as some OEMs either leave the - # identification information as "To be filled by OEM", "Default", - # "undefined" etc and we shouldn't print this to the screen. - for word do - # This works by reconstructing the string by excluding words - # found in the "blacklist" below. Only non-matches are appended - # to the final host string. - case $word in - (To | [Bb]e | [Ff]illed | [Bb]y | O.E.M. | OEM |\ - Not | Applicable | Specified | System | Product | Name |\ - Version | Undefined | Default | string | INVALID | � | os |\ - Type1ProductConfigId ) - continue - ;; - esac - - host="$host$word " - done - - # '$arch' is the cached output from 'uname -m'. - log host "${host:-$arch}" >&6 -} - -get_uptime() { - # Uptime works by retrieving the data in total seconds and then - # converting that data into days, hours and minutes using simple - # math. - case $os in - (Linux* | Minix* | SerenityOS*) - IFS=. read -r s _ < /proc/uptime - ;; - - (Darwin* | *BSD* | DragonFly*) - s=$(sysctl -n kern.boottime) - - # Extract the uptime in seconds from the following output: - # [...] { sec = 1271934886, usec = 667779 } Thu Apr 22 12:14:46 2010 - s=${s#*=} - s=${s%,*} - - # The uptime format from 'sysctl' needs to be subtracted from - # the current time in seconds. - s=$(($(date +%s) - s)) - ;; - - (Haiku) - # The boot time is returned in microseconds, convert it to - # regular seconds. - s=$(($(system_time) / 1000000)) - ;; - - (SunOS) - # Split the output of 'kstat' on '.' and any white-space - # which exists in the command output. - # - # The output is as follows: - # unix:0:system_misc:snaptime 14809.906993005 - # - # The parser extracts: ^^^^^ - IFS=' .' read -r _ s _ <<-EOF - $(kstat -p unix:0:system_misc:snaptime) - EOF - ;; - - (IRIX) - # Grab the uptime in a pretty format. Usually, - # 00:00:00 from the 'ps' command. - t=$(LC_ALL=POSIX ps -o etime= -p 1) - - # Split the pretty output into days or hours - # based on the uptime. - case $t in - (*-*) d=${t%%-*} t=${t#*-} ;; - (*:*:*) h=${t%%:*} t=${t#*:} ;; - esac - - h=${h#0} t=${t#0} - - # Convert the split pretty fields back into - # seconds so we may re-convert them to our format. - s=$((${d:-0}*86400 + ${h:-0}*3600 + ${t%%:*}*60 + ${t#*:})) - ;; - esac - - # Convert the uptime from seconds into days, hours and minutes. - d=$((s / 60 / 60 / 24)) - h=$((s / 60 / 60 % 24)) - m=$((s / 60 % 60)) - - # Only append days, hours and minutes if they're non-zero. - case "$d" in ([!0]*) uptime="${uptime}${d}d "; esac - case "$h" in ([!0]*) uptime="${uptime}${h}h "; esac - case "$m" in ([!0]*) uptime="${uptime}${m}m "; esac - - log uptime "${uptime:-0m}" >&6 -} - -get_pkgs() { - # This works by first checking for which package managers are - # installed and finally by printing each package manager's - # package list with each package one per line. - # - # The output from this is then piped to 'wc -l' to count each - # line, giving us the total package count of whatever package - # managers are installed. - packages=$( - case $os in - (Linux*) - # Commands which print packages one per line. - has bonsai && bonsai list - has crux && pkginfo -i - has pacman-key && pacman -Qq - has dpkg && dpkg-query -f '.\n' -W - has rpm && rpm -qa - has xbps-query && xbps-query -l - has apk && apk info - has guix && guix package --list-installed - has opkg && opkg list-installed - - # Directories containing packages. - has kiss && printf '%s\n' /var/db/kiss/installed/*/ - has cpt-list && printf '%s\n' /var/db/cpt/installed/*/ - has brew && printf '%s\n' "$(brew --cellar)/"* - has emerge && printf '%s\n' /var/db/pkg/*/*/ - has pkgtool && printf '%s\n' /var/log/packages/* - has eopkg && printf '%s\n' /var/lib/eopkg/package/* - - # 'nix' requires two commands. - has nix-store && { - nix-store -q --requisites /run/current-system/sw - nix-store -q --requisites ~/.nix-profile - } - ;; - - (Darwin*) - # Commands which print packages one per line. - has pkgin && pkgin list - has dpkg && dpkg-query -f '.\n' -W - - # Directories containing packages. - has brew && printf '%s\n' /usr/local/Cellar/* - - # 'port' prints a single line of output to 'stdout' - # when no packages are installed and exits with - # success causing a false-positive of 1 package - # installed. - # - # 'port' should really exit with a non-zero code - # in this case to allow scripts to cleanly handle - # this behavior. - has port && { - pkg_list=$(port installed) - - case "$pkg_list" in - ("No ports are installed.") - # do nothing - ;; - - (*) - printf '%s\n' "$pkg_list" - ;; - esac - } - ;; - - (FreeBSD*|DragonFly*) - pkg info - ;; - - (OpenBSD*) - printf '%s\n' /var/db/pkg/*/ - ;; - - (NetBSD*) - pkg_info - ;; - - (Haiku) - printf '%s\n' /boot/system/package-links/* - ;; - - (Minix) - printf '%s\n' /usr/pkg/var/db/pkg/*/ - ;; - - (SunOS) - has pkginfo && pkginfo -i - has pkg && pkg list - ;; - - (IRIX) - versions -b - ;; - - (SerenityOS) - while IFS=" " read -r type _; do - [ "$type" != dependency ] && - printf "\n" - done < /usr/Ports/packages.db - ;; - esac | wc -l - ) - - # 'wc -l' can have leading and/or trailing whitespace - # depending on the implementation, so strip them. - # Procedure explained at https://github.com/dylanaraps/pure-sh-bible - # (trim-leading-and-trailing-white-space-from-string) - packages=${packages#"${packages%%[![:space:]]*}"} - packages=${packages%"${packages##*[![:space:]]}"} - - case $os in - # IRIX's package manager adds 3 lines of extra - # output which we must account for here. - (IRIX) - packages=$((packages - 3)) - ;; - - # OpenBSD's wc prints whitespace before the output - # which needs to be stripped. - (OpenBSD) - packages=$((packages)) - ;; - esac - - case $packages in - (1?*|[2-9]*) - log pkgs "$packages" >&6 - ;; - esac -} - -get_memory() { - case $os in - # Used memory is calculated using the following "formula": - # MemUsed = MemTotal + Shmem - MemFree - Buffers - Cached - SReclaimable - # Source: https://github.com/KittyKatt/screenFetch/issues/386 - (Linux*) - # Parse the '/proc/meminfo' file splitting on ':' and 'k'. - # The format of the file is 'key: 000kB' and an additional - # split is used on 'k' to filter out 'kB'. - while IFS=':k ' read -r key val _; do - case $key in - (MemTotal) - mem_used=$((mem_used + val)) - mem_full=$val - ;; - - (Shmem) - mem_used=$((mem_used + val)) - ;; - - (MemFree | Buffers | Cached | SReclaimable) - mem_used=$((mem_used - val)) - ;; - - # If detected this will be used over the above calculation - # for mem_used. Available since Linux 3.14rc. - # See kernel commit 34e431b0ae398fc54ea69ff85ec700722c9da773 - (MemAvailable) - mem_avail=$val - ;; - esac - done < /proc/meminfo - - case $mem_avail in - (*[0-9]*) - mem_used=$(((mem_full - mem_avail) / 1024)) - ;; - - *) - mem_used=$((mem_used / 1024)) - ;; - esac - - mem_full=$((mem_full / 1024)) - ;; - - # Used memory is calculated using the following "formula": - # (wired + active + occupied) * 4 / 1024 - (Darwin*) - mem_full=$(($(sysctl -n hw.memsize) / 1024 / 1024)) - - # Parse the 'vmstat' file splitting on ':' and '.'. - # The format of the file is 'key: 000.' and an additional - # split is used on '.' to filter it out. - while IFS=:. read -r key val; do - case $key in - (*' wired'*|*' active'*|*' occupied'*) - mem_used=$((mem_used + ${val:-0})) - ;; - esac - - # Using '<<-EOF' is the only way to loop over a command's - # output without the use of a pipe ('|'). - # This ensures that any variables defined in the while loop - # are still accessible in the script. - done <<-EOF - $(vm_stat) - EOF - - mem_used=$((mem_used * 4 / 1024)) - ;; - - (OpenBSD*) - mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024)) - - # This is a really simpler parser for 'vmstat' which grabs - # the used memory amount in a lazy way. 'vmstat' prints 3 - # lines of output with the needed value being stored in the - # final line. - # - # This loop simply grabs the 3rd element of each line until - # the EOF is reached. Each line overwrites the value of the - # previous one so we're left with what we wanted. This isn't - # slow as only 3 lines are parsed. - while read -r _ _ line _; do - mem_used=${line%%M} - - # Using '<<-EOF' is the only way to loop over a command's - # output without the use of a pipe ('|'). - # This ensures that any variables defined in the while loop - # are still accessible in the script. - done <<-EOF - $(vmstat) - EOF - ;; - - # Used memory is calculated using the following "formula": - # mem_full - ((inactive + free + cache) * page_size / 1024) - (FreeBSD*|DragonFly*) - mem_full=$(($(sysctl -n hw.physmem) / 1024 / 1024)) - - # Use 'set --' to store the output of the command in the - # argument list. POSIX sh has no arrays but this is close enough. - # - # Disable the shellcheck warning for word-splitting - # as it's safe and intended ('set -f' disables globbing). - # shellcheck disable=2046 - { - set -f - set +f -- $(sysctl -n hw.pagesize \ - vm.stats.vm.v_inactive_count \ - vm.stats.vm.v_free_count \ - vm.stats.vm.v_cache_count) - } - - # Calculate the amount of used memory. - # $1: hw.pagesize - # $2: vm.stats.vm.v_inactive_count - # $3: vm.stats.vm.v_free_count - # $4: vm.stats.vm.v_cache_count - mem_used=$((mem_full - (($2 + $3 + $4) * $1 / 1024 / 1024))) - ;; - - (NetBSD*) - mem_full=$(($(sysctl -n hw.physmem64) / 1024 / 1024)) - - # NetBSD implements a lot of the Linux '/proc' filesystem, - # this uses the same parser as the Linux memory detection. - while IFS=':k ' read -r key val _; do - case $key in - (MemFree) - mem_free=$((val / 1024)) - break - ;; - esac - done < /proc/meminfo - - mem_used=$((mem_full - mem_free)) - ;; - - (Haiku) - # Read the first line of 'sysinfo -mem' splitting on - # '(', ' ', and ')'. The needed information is then - # stored in the 5th and 7th elements. Using '_' "consumes" - # an element allowing us to proceed to the next one. - # - # The parsed format is as follows: - # 3501142016 bytes free (used/max 792645632 / 4293787648) - IFS='( )' read -r _ _ _ _ mem_used _ mem_full <<-EOF - $(sysinfo -mem) - EOF - - mem_used=$((mem_used / 1024 / 1024)) - mem_full=$((mem_full / 1024 / 1024)) - ;; - - (Minix) - # Minix includes the '/proc' filesystem though the format - # differs from Linux. The '/proc/meminfo' file is only a - # single line with space separated elements and elements - # 2 and 3 contain the total and free memory numbers. - read -r _ mem_full mem_free _ < /proc/meminfo - - mem_used=$(((mem_full - mem_free) / 1024)) - mem_full=$(( mem_full / 1024)) - ;; - - (SunOS) - hw_pagesize=$(pagesize) - - # 'kstat' outputs memory in the following format: - # unix:0:system_pages:pagestotal 1046397 - # unix:0:system_pages:pagesfree 885018 - # - # This simply uses the first "element" (white-space - # separated) as the key and the second element as the - # value. - # - # A variable is then assigned based on the key. - while read -r key val; do - case $key in - (*total) - pages_full=$val - ;; - - (*free) - pages_free=$val - ;; - esac - done <<-EOF - $(kstat -p unix:0:system_pages:pagestotal \ - unix:0:system_pages:pagesfree) - EOF - - mem_full=$((pages_full * hw_pagesize / 1024 / 1024)) - mem_free=$((pages_free * hw_pagesize / 1024 / 1024)) - mem_used=$((mem_full - mem_free)) - ;; - - (IRIX) - # Read the memory information from the 'top' command. Parse - # and split each line until we reach the line starting with - # "Memory". - # - # Example output: Memory: 160M max, 147M avail, ..... - while IFS=' :' read -r label mem_full _ mem_free _; do - case $label in - (Memory) - mem_full=${mem_full%M} - mem_free=${mem_free%M} - break - ;; - esac - done <<-EOF - $(top -n) - EOF - - mem_used=$((mem_full - mem_free)) - ;; - - (SerenityOS) - IFS='{}' read -r _ memstat _ < /proc/memstat - - set -f -- "$IFS" - IFS=, - - for pair in $memstat; do - case $pair in - (*user_physical_allocated*) - mem_used=${pair##*:} - ;; - - (*user_physical_available*) - mem_free=${pair##*:} - ;; - esac - done - - IFS=$1 - set +f -- - - mem_used=$((mem_used * 4096 / 1024 / 1024)) - mem_free=$((mem_free * 4096 / 1024 / 1024)) - - mem_full=$((mem_used + mem_free)) - ;; - esac - - log memory "${mem_used:-?}M / ${mem_full:-?}M" >&6 -} - -get_wm() { - case $os in - (Darwin*) - # Don't display window manager on macOS. - ;; - - (*) - # xprop can be used to grab the window manager's properties - # which contains the window manager's name under '_NET_WM_NAME'. - # - # The upside to using 'xprop' is that you don't need to hardcode - # a list of known window manager names. The downside is that - # not all window managers conform to setting the '_NET_WM_NAME' - # atom.. - # - # List of window managers which fail to set the name atom: - # catwm, fvwm, dwm, 2bwm, monster, wmaker and sowm [mine! ;)]. - # - # The final downside to this approach is that it does _not_ - # support Wayland environments. The only solution which supports - # Wayland is the 'ps' parsing mentioned below. - # - # A more naive implementation is to parse the last line of - # '~/.xinitrc' to extract the second white-space separated - # element. - # - # The issue with an approach like this is that this line data - # does not always equate to the name of the window manager and - # could in theory be _anything_. - # - # This also fails when the user launches xorg through a display - # manager or other means. - # - # - # Another naive solution is to parse 'ps' with a hardcoded list - # of window managers to detect the current window manager (based - # on what is running). - # - # The issue with this approach is the need to hardcode and - # maintain a list of known window managers. - # - # Another issue is that process names do not always equate to - # the name of the window manager. False-positives can happen too. - # - # This is the only solution which supports Wayland based - # environments sadly. It'd be nice if some kind of standard were - # established to identify Wayland environments. - # - # pfetch's goal is to remain _simple_, if you'd like a "full" - # implementation of window manager detection use 'neofetch'. - # - # Neofetch use a combination of 'xprop' and 'ps' parsing to - # support all window managers (including non-conforming and - # Wayland) though it's a lot more complicated! - - # Don't display window manager if X isn't running. - [ "$DISPLAY" ] || return - - # This is a two pass call to xprop. One call to get the window - # manager's ID and another to print its properties. - has xprop && { - # The output of the ID command is as follows: - # _NET_SUPPORTING_WM_CHECK: window id # 0x400000 - # - # To extract the ID, everything before the last space - # is removed. - id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) - id=${id##* } - - # The output of the property command is as follows: - # _NAME 8t - # _NET_WM_PID = 252 - # _NET_WM_NAME = "bspwm" - # _NET_SUPPORTING_WM_CHECK: window id # 0x400000 - # WM_CLASS = "wm", "Bspwm" - # - # To extract the name, everything before '_NET_WM_NAME = \"' - # is removed and everything after the next '"' is removed. - wm=$(xprop -id "$id" -notype -len 25 -f _NET_WM_NAME 8t) - } - - # Handle cases of a window manager _not_ populating the - # '_NET_WM_NAME' atom. Display nothing in this case. - case $wm in - (*'_NET_WM_NAME = '*) - wm=${wm##*_NET_WM_NAME = \"} - wm=${wm%%\"*} - ;; - - (*) - # Fallback to checking the process list - # for the select few window managers which - # don't set '_NET_WM_NAME'. - while read -r ps_line; do - case $ps_line in - (*catwm*) wm=catwm ;; - (*fvwm*) wm=fvwm ;; - (*dwm*) wm=dwm ;; - (*2bwm*) wm=2bwm ;; - (*monsterwm*) wm=monsterwm ;; - (*wmaker*) wm='Window Maker' ;; - (*sowm*) wm=sowm ;; - (*penrose*) wm=penrose ;; - esac - done <<-EOF - $(ps x) - EOF - ;; - esac - ;; - esac - - log wm "$wm" >&6 -} - - -get_de() { - # This only supports Xorg related desktop environments though - # this is fine as knowing the desktop environment on Windows, - # macOS etc is useless (they'll always report the same value). - # - # Display the value of '$XDG_CURRENT_DESKTOP', if it's empty, - # display the value of '$DESKTOP_SESSION'. - log de "${XDG_CURRENT_DESKTOP:-$DESKTOP_SESSION}" >&6 -} - -get_shell() { - # Display the basename of the '$SHELL' environment variable. - log shell "${SHELL##*/}" >&6 -} - -get_editor() { - # Display the value of '$VISUAL', if it's empty, display the - # value of '$EDITOR'. - editor=${VISUAL:-"$EDITOR"} - - log editor "${editor##*/}" >&6 -} - -get_palette() { - # Print the first 8 terminal colors. This uses the existing - # sequences to change text color with a sequence prepended - # to reverse the foreground and background colors. - # - # This allows us to save hardcoding a second set of sequences - # for background colors. - # - # False positive. - # shellcheck disable=2154 - { - esc SGR 7 - palette="$e$c1 $c1 $c2 $c2 $c3 $c3 $c4 $c4 $c5 $c5 $c6 $c6 " - esc SGR 0 - palette="$palette$e" - } - - # Print the palette with a new-line before and afterwards but no seperator. - printf '\n' >&6 - log "$palette - " " " " " >&6 -} - -get_ascii() { - # This is a simple function to read the contents of - # an ascii file from 'stdin'. It allows for the use - # of '<<-EOF' to prevent the break in indentation in - # this source code. - # - # This function also sets the text colors according - # to the ascii color. - read_ascii() { - # 'PF_COL1': Set the info name color according to ascii color. - # 'PF_COL3': Set the title color to some other color. ¯\_(ツ)_/¯ - PF_COL1=${PF_COL1:-${1:-7}} - PF_COL3=${PF_COL3:-$((${1:-7}%8+1))} - - # POSIX sh has no 'var+=' so 'var=${var}append' is used. What's - # interesting is that 'var+=' _is_ supported inside '$(())' - # (arithmetic) though there's no support for 'var++/var--'. - # - # There is also no $'\n' to add a "literal"(?) newline to the - # string. The simplest workaround being to break the line inside - # the string (though this has the caveat of breaking indentation). - while IFS= read -r line; do - ascii="$ascii$line -" - done - } - - # This checks for ascii art in the following order: - # '$1': Argument given to 'get_ascii()' directly. - # '$PF_ASCII': Environment variable set by user. - # '$distro': The detected distribution name. - # '$os': The name of the operating system/kernel. - # - # NOTE: Each ascii art below is indented using tabs, this - # allows indentation to continue naturally despite - # the use of '<<-EOF'. - # - # False positive. - # shellcheck disable=2154 - case ${1:-${PF_ASCII:-${distro:-$os}}} in - ([Aa]lpine*) - read_ascii 4 <<-EOF - ${c4} /\\ /\\ - /${c7}/ ${c4}\\ \\ - /${c7}/ ${c4}\\ \\ - /${c7}// ${c4}\\ \\ - ${c7}// ${c4}\\ \\ - ${c4}\\ - EOF - ;; - - ([Aa]ndroid*) - read_ascii 2 <<-EOF - ${c2} ;, ,; - ${c2} ';,.-----.,;' - ${c2} ,' ', - ${c2} / O O \\ - ${c2}| | - ${c2}'-----------------' - EOF - ;; - - ([Aa]rch*) - read_ascii 4 <<-EOF - ${c6} /\\ - ${c6} / \\ - ${c6} /\\ \\ - ${c4} / \\ - ${c4} / ,, \\ - ${c4} / | | -\\ - ${c4} /_-'' ''-_\\ - EOF - ;; - - ([Aa]rco*) - read_ascii 4 <<-EOF - ${c4} /\\ - ${c4} / \\ - ${c4} / /\\ \\ - ${c4} / / \\ \\ - ${c4} / / \\ \\ - ${c4} / / _____\\ \\ - ${c4}/_/ \`----.\\_\\ - EOF - ;; - - ([Aa]rtix*) - read_ascii 6 <<-EOF - ${c4} /\\ - ${c4} / \\ - ${c4} /\`'.,\\ - ${c4} / ', - ${c4} / ,\`\\ - ${c4} / ,.'\`. \\ - ${c4}/.,'\` \`'.\\ - EOF - ;; - - ([Bb]edrock*) - read_ascii 4 <<-EOF - ${c7}__ - ${c7}\\ \\___ - ${c7} \\ _ \\ - ${c7} \\___/ - EOF - ;; - - ([Bb]uildroot*) - read_ascii 3 <<-EOF - ${c3} ___ - ${c3} / \` \\ - ${c3}| : :| - ${c3}-. _:__.- - ${c3} \` ---- \` - EOF - ;; - - ([Cc]el[Oo][Ss]*) - read_ascii 5 0 <<-EOF - ${c5} .////\\\\\//\\. - ${c5} //_ \\\\ - ${c5} /_ ${c7}############## - ${c5} // *\\ - ${c7}############### ${c5}|# - ${c5} \/ */ - ${c5} \* ${c7}############## - ${c5} */, .// - ${c5} '_///\\\\\//_' - EOF - ;; - - ([Cc]ent[Oo][Ss]*) - read_ascii 5 <<-EOF - ${c2} ____${c3}^${c5}____ - ${c2} |\\ ${c3}|${c5} /| - ${c2} | \\ ${c3}|${c5} / | - ${c5}<---- ${c4}----> - ${c4} | / ${c2}|${c3} \\ | - ${c4} |/__${c2}|${c3}__\\| - ${c2} v - EOF - ;; - - ([Cc]rystal*[Ll]inux) - read_ascii 5 5 <<-EOF - ${c5} -//. - ${c5} -//. - ${c5} -//. . - ${c5} -//. '//- - ${c5} /+: :+/ - ${c5} .//' .//. - ${c5} . .//. - ${c5} .//. - ${c5} .//. - EOF - ;; - - ([Dd]ahlia*) - read_ascii 1 <<-EOF - ${c1} _ - ${c1} ___/ \\___ - ${c1} | _-_ | - ${c1} | / \ | - ${c1}/ | | \\ - ${c1}\\ | | / - ${c1} | \ _ _ / | - ${c1} |___ - ___| - ${c1} \\_/ - EOF - ;; - - ([Dd]ebian*) - read_ascii 1 <<-EOF - ${c1} _____ - ${c1} / __ \\ - ${c1}| / | - ${c1}| \\___- - ${c1}-_ - ${c1} --_ - EOF - ;; - - ([Dd]evuan*) - read_ascii 6 <<-EOF - ${c4} ..:::. - ${c4} ..-==- - ${c4} .+#: - ${c4} =@@ - ${c4} :+%@#: - ${c4}.:=+#@@%*: - ${c4}#@@@#=: - EOF - ;; - - ([Dd]ragon[Ff]ly*) - read_ascii 1 <<-EOF - ,${c1}_${c7}, - ('-_${c1}|${c7}_-') - >--${c1}|${c7}--< - (_-'${c1}|${c7}'-_) - ${c1}| - ${c1}| - ${c1}| - EOF - ;; - - ([Ee]lementary*) - read_ascii <<-EOF - ${c7} _______ - ${c7} / ____ \\ - ${c7}/ | / /\\ - ${c7}|__\\ / / | - ${c7}\\ /__/ / - ${c7}\\_______/ - EOF - ;; - - ([Ee]ndeavour*) - read_ascii 4 <<-EOF - ${c1}/${c4}\\ - ${c1}/${c4}/ \\${c6}\\ - ${c1}/${c4}/ \\ ${c6}\\ - ${c1}/ ${c4}/ _) ${c6}) - ${c1}/_${c4}/___-- ${c6}__- - ${c6}/____-- - EOF - ;; - - ([Ff]edora*) - read_ascii 4 <<-EOF - ${c4},'''''. - ${c4}| ,. | - ${c4}| | '_' - ${c4} ,....| |.. - ${c4}.' ,_;| ..' - ${c4}| | | | - ${c4}| ',_,' | - ${c4} '. ,' - ${c4}''''' - EOF - ;; - - ([Ff]ree[Bb][Ss][Dd]*) - read_ascii 1 <<-EOF - ${c1}/\\,-'''''-,/\\ - ${c1}\\_) (_/ - ${c1}| | - ${c1}| | - ${c1}; ; - ${c1}'-_____-' - EOF - ;; - - ([Gg]aruda*) - read_ascii 4 <<-EOF - ${c3} _______ - ${c3} __/ \\_ - ${c3} _/ / \\_ - ${c7} _/ /_________\\ - ${c7}_/ | - ${c2}\\ ____________ - ${c2} \\_ __/ - ${c2} \\__________/ - EOF - ;; - - ([Gg]entoo*) - read_ascii 5 <<-EOF - ${c5} _-----_ - ${c5}( \\ - ${c5}\\ 0 \\ - ${c7} \\ ) - ${c7} / _/ - ${c7}( _- - ${c7}\\____- - EOF - ;; - - ([Gg][Nn][Uu]*) - read_ascii 3 <<-EOF - ${c2} _-\`\`-, ,-\`\`-_ - ${c2} .' _-_| |_-_ '. - ${c2}./ /_._ _._\\ \\. - ${c2}: _/_._\`:'_._\\_ : - ${c2}\\:._/ ,\` \\ \\ \\_.:/ - ${c2} ,-';'.@) \\ @) \\ - ${c2} ,'/' ..- .\\,-.| - ${c2} /'/' \\(( \\\` ./ ) - ${c2} '/'' \\_,----' - ${c2} '/'' ,;/'' - ${c2} \`\`;' - EOF - ;; - - ([Gg]uix[Ss][Dd]*|[Gg]uix*) - read_ascii 3 <<-EOF - ${c3}|.__ __.| - ${c3}|__ \\ / __| - ${c3}\\ \\ / / - ${c3}\\ \\ / / - ${c3}\\ \\ / / - ${c3}\\ \\/ / - ${c3}\\__/ - EOF - ;; - - ([Hh]aiku*) - read_ascii 3 <<-EOF - ${c3} ,^, - ${c3} / \\ - ${c3}*--_ ; ; _--* - ${c3}\\ '" "' / - ${c3}'. .' - ${c3}.-'" "'-. - ${c3}'-.__. .__.-' - ${c3}|_| - EOF - ;; - - ([Hh]ydroOS*) - read_ascii 4 <<-EOF - ${c1}╔╗╔╗──╔╗───╔═╦══╗ - ${c1}║╚╝╠╦╦╝╠╦╦═╣║║══╣ - ${c1}║╔╗║║║╬║╔╣╬║║╠══║ - ${c1}╚╝╚╬╗╠═╩╝╚═╩═╩══╝ - ${c1}───╚═╝ - EOF - ;; - - ([Hh]yperbola*) - read_ascii <<-EOF - ${c7} |\`__.\`/ - ${c7} \____/ - ${c7} .--. - ${c7} / \\ - ${c7} / ___ \\ - ${c7}/ .\` \`.\\ - ${c7}/.\` \`.\\ - EOF - ;; - - ([Ii]glunix*) - read_ascii <<-EOF - ${c0} | - ${c0} | | - ${c0} | - ${c0} | ________ - ${c0} | /\\ | \\ - ${c0} / \\ | \\ | - ${c0} / \\ \\ | - ${c0} / \\________\\ - ${c0} \\ / / - ${c0} \\ / / - ${c0} \\ / / - ${c0} \\/________/ - EOF - ;; - - ([Ii]nstant[Oo][Ss]*) - read_ascii <<-EOF - ${c0} ,-''-, - ${c0}: .''. : - ${c0}: ',,' : - ${c0} '-____:__ - ${c0} : \`. - ${c0} \`._.' - EOF - ;; - - ([Ii][Rr][Ii][Xx]*) - read_ascii 1 <<-EOF - ${c1} __ - ${c1} \\ \\ __ - ${c1} \\ \\ / / - ${c1} \\ v / - ${c1} / . \\ - ${c1} /_/ \\ \\ - ${c1} \\_\\ - EOF - ;; - - ([Kk][Dd][Ee]*[Nn]eon*) - read_ascii 6 <<-EOF - ${c7} .${c6}__${c7}.${c6}__${c7}. - ${c6} / _${c7}.${c6}_ \\ - ${c6} / / \\ \\ - ${c7} . ${c6}| ${c7}O${c6} | ${c7}. - ${c6} \\ \\_${c7}.${c6}_/ / - ${c6} \\${c7}.${c6}__${c7}.${c6}__${c7}.${c6}/ - EOF - ;; - - ([Ll]inux*[Ll]ite*|[Ll]ite*) - read_ascii 3 <<-EOF - ${c3} /\\ - ${c3} / \\ - ${c3} / ${c7}/ ${c3}/ - ${c3}> ${c7}/ ${c3}/ - ${c3}\\ ${c7}\\ ${c3}\\ - ${c3}\\_${c7}\\${c3}_\\ - ${c7} \\ - EOF - ;; - - ([Ll]inux*[Mm]int*|[Mm]int) - read_ascii 2 <<-EOF - ${c2} ___________ - ${c2}|_ \\ - ${c2}| ${c7}| _____ ${c2}| - ${c2}| ${c7}| | | | ${c2}| - ${c2}| ${c7}| | | | ${c2}| - ${c2}| ${c7}\\__${c7}___/ ${c2}| - ${c2}\\_________/ - EOF - ;; - - - ([Ll]inux*) - read_ascii 4 <<-EOF - ${c4} ___ - ${c4}(${c7}.. ${c4}| - ${c4}(${c5}<> ${c4}| - ${c4}/ ${c7}__ ${c4}\\ - ${c4}( ${c7}/ \\ ${c4}/| - ${c5}_${c4}/\\ ${c7}__)${c4}/${c5}_${c4}) - ${c5}\/${c4}-____${c5}\/ - EOF - ;; - - ([Mm]ac[Oo][Ss]*|[Dd]arwin*) - read_ascii 1 <<-EOF - ${c2} .:' - ${c2} _ :'_ - ${c3} .'\`_\`-'_\`\`. - ${c1}:________.-' - ${c1}:_______: - ${c4} :_______\`-; - ${c5} \`._.-._.' - EOF - ;; - - ([Mm]ageia*) - read_ascii 2 <<-EOF - ${c6} * - ${c6} * - ${c6} ** - ${c7} /\\__/\\ - ${c7}/ \\ - ${c7}\\ / - ${c7} \\____/ - EOF - ;; - - ([Mm]anjaro*) - read_ascii 2 <<-EOF - ${c2}||||||||| |||| - ${c2}||||||||| |||| - ${c2}|||| |||| - ${c2}|||| |||| |||| - ${c2}|||| |||| |||| - ${c2}|||| |||| |||| - ${c2}|||| |||| |||| - EOF - ;; - - ([Mm]inix*) - read_ascii 4 <<-EOF - ${c4} ,, ,, - ${c4};${c7},${c4} ', ,' ${c7},${c4}; - ${c4}; ${c7}',${c4} ',,' ${c7},'${c4} ; - ${c4}; ${c7}',${c4} ${c7},'${c4} ; - ${c4}; ${c7};, '' ,;${c4} ; - ${c4}; ${c7};${c4};${c7}',,'${c4};${c7};${c4} ; - ${c4}', ${c7};${c4};; ;;${c7};${c4} ,' - ${c4} '${c7};${c4}' '${c7};${c4}' - EOF - ;; - - ([Mm][Xx]*) - read_ascii <<-EOF - ${c7} \\\\ / - ${c7} \\\\/ - ${c7} \\\\ - ${c7} /\\/ \\\\ - ${c7} / \\ /\\ - ${c7} / \\/ \\ - ${c7}/__________\\ - EOF - ;; - - ([Nn]et[Bb][Ss][Dd]*) - read_ascii 3 <<-EOF - ${c7}\\\\${c3}\`-______,----__ - ${c7} \\\\ ${c3}__,---\`_ - ${c7} \\\\ ${c3}\`.____ - ${c7} \\\\${c3}-______,----\`- - ${c7} \\\\ - ${c7} \\\\ - ${c7} \\\\ - EOF - ;; - - ([Nn]ix[Oo][Ss]*) - read_ascii 4 <<-EOF - ${c4} \\\\ \\\\ // - ${c4} ==\\\\__\\\\/ // - ${c4} // \\\\// - ${c4}==// //== - ${c4} //\\\\___// - ${c4}// /\\\\ \\\\== - ${c4} // \\\\ \\\\ - EOF - ;; - - ([Oo]pen[Bb][Ss][Dd]*) - read_ascii 3 <<-EOF - ${c3} _____ - ${c3} \\- -/ - ${c3} \\_/ \\ - ${c3} | ${c7}O O${c3} | - ${c3} |_ < ) 3 ) - ${c3} / \\ / - ${c3} /-_____-\\ - EOF - ;; - - ([Oo]pen[Ss][Uu][Ss][Ee]*[Tt]umbleweed*) - read_ascii 2 <<-EOF - ${c2} _____ ______ - ${c2} / ____\\ / ____ \\ - ${c2}/ / \`/ / \\ \\ - ${c2}\\ \\____/ /,____/ / - ${c2} \\______/ \\_____/ - EOF - ;; - - ([Oo]pen[Ss][Uu][Ss][Ee]*|[Oo]pen*SUSE*|SUSE*|suse*) - read_ascii 2 <<-EOF - ${c2} _______ - ${c2}__| __ \\ - ${c2} / .\\ \\ - ${c2} \\__/ | - ${c2} _______| - ${c2} \\_______ - ${c2}__________/ - EOF - ;; - - ([Oo]pen[Ww]rt*) - read_ascii 1 <<-EOF - ${c1} _______ - ${c1}| |.-----.-----.-----. - ${c1}| - || _ | -__| | - ${c1}|_______|| __|_____|__|__| - ${c1} ________|__| __ - ${c1}| | | |.----.| |_ - ${c1}| | | || _|| _| - ${c1}|________||__| |____| - EOF - ;; - - ([Pp]arabola*) - read_ascii 5 <<-EOF - ${c5} __ __ __ _ - ${c5}.\`_//_//_/ / \`. - ${c5} / .\` - ${c5} / .\` - ${c5} /.\` - ${c5} /\` - EOF - ;; - - ([Pp]op!_[Oo][Ss]*) - read_ascii 6 <<-EOF - ${c6}______ - ${c6}\\ _ \\ __ - ${c6}\\ \\ \\ \\ / / - ${c6}\\ \\_\\ \\ / / - ${c6}\\ ___\\ /_/ - ${c6} \\ \\ _ - ${c6} __\\_\\__(_)_ - ${c6}(___________) - EOF - ;; - - ([Pp]ure[Oo][Ss]*) - read_ascii <<-EOF - ${c7} _____________ - ${c7}| _________ | - ${c7}| | | | - ${c7}| | | | - ${c7}| |_________| | - ${c7}|_____________| - EOF - ;; - - ([Rr]aspbian*) - read_ascii 1 <<-EOF - ${c2} __ __ - ${c2} (_\\)(/_) - ${c1} (_(__)_) - ${c1}(_(_)(_)_) - ${c1} (_(__)_) - ${c1} (__) - EOF - ;; - - ([Ss]erenity[Oo][Ss]*) - read_ascii 4 <<-EOF - ${c7} _____ - ${c1} ,-${c7} -, - ${c1} ;${c7} ( ; - ${c1}| ${c7}. \_${c1}.,${c7} | - ${c1}| ${c7}o _${c1} ',${c7} | - ${c1} ; ${c7}(_)${c1} )${c7} ; - ${c1} '-_____-${c7}' - EOF - ;; - - ([Ss]lackware*) - read_ascii 4 <<-EOF - ${c4} ________ - ${c4} / ______| - ${c4} | |______ - ${c4} \\______ \\ - ${c4} ______| | - ${c4}| |________/ - ${c4}|____________ - EOF - ;; - - ([Ss]olus*) - read_ascii 4 <<-EOF - ${c6} - ${c6} /| - ${c6} / |\\ - ${c6} / | \\ _ - ${c6} /___|__\\_\\ - ${c6} \\ / - ${c6} \`-------´ - EOF - ;; - - ([Ss]un[Oo][Ss]|[Ss]olaris*) - read_ascii 3 <<-EOF - ${c3} . .; . - ${c3} . :; :: ;: . - ${c3} .;. .. .. .;. - ${c3}.. .. .. .. - ${c3} .;, ,;. - EOF - ;; - - ([Uu]buntu*) - read_ascii 3 <<-EOF - ${c3} _ - ${c3} ---(_) - ${c3} _/ --- \\ - ${c3}(_) | | - ${c3} \\ --- _/ - ${c3} ---(_) - EOF - ;; - - ([Vv]oid*) - read_ascii 2 <<-EOF - ${c2} _______ - ${c2} _ \\______ - - ${c2}| \\ ___ \\ | - ${c2}| | / \ | | - ${c2}| | \___/ | | - ${c2}| \\______ \\_| - ${c2} -_______\\ - EOF - ;; - - ([Xx]eonix*) - read_ascii 2 <<-EOF - ${c2} ___ ___ - ${c2}___ \ \/ / ___ - ${c2}\ \ \ / / / - ${c2} \ \/ \/ / - ${c2} \ /\ / - ${c2} \__/ \__/ - EOF - ;; - - (*) - # On no match of a distribution ascii art, this function calls - # itself again, this time to look for a more generic OS related - # ascii art (KISS Linux -> Linux). - [ "$1" ] || { - get_ascii "$os" - return - } - - printf 'error: %s is not currently supported.\n' "$os" >&6 - printf 'error: Open an issue for support to be added.\n' >&6 - exit 1 - ;; - esac - - # Store the "width" (longest line) and "height" (number of lines) - # of the ascii art for positioning. This script prints to the screen - # *almost* like a TUI does. It uses escape sequences to allow dynamic - # printing of the information through user configuration. - # - # Iterate over each line of the ascii art to retrieve the above - # information. The 'sed' is used to strip '\033[3Xm' color codes from - # the ascii art so they don't affect the width variable. - while read -r line; do - ascii_height=$((${ascii_height:-0} + 1)) - - # This was a ternary operation but they aren't supported in - # Minix's shell. - [ "${#line}" -gt "${ascii_width:-0}" ] && - ascii_width=${#line} - - # Using '<<-EOF' is the only way to loop over a command's - # output without the use of a pipe ('|'). - # This ensures that any variables defined in the while loop - # are still accessible in the script. - done <<-EOF - $(printf %s "$ascii" | sed 's/\[3.m//g') - EOF - - # Add a gap between the ascii art and the information. - ascii_width=$((ascii_width + 4)) - - # Print the ascii art and position the cursor back where we - # started prior to printing it. - { - esc_p SGR 1 - printf '%s' "$ascii" - esc_p SGR 0 - esc_p CUU "$ascii_height" - } >&6 -} - -main() { - case $* in - -v) - printf '%s 0.7.0\n' "${0##*/}" - return 0 - ;; - - -d) - # Below exec is not run, stderr is shown. - ;; - - '') - exec 2>/dev/null - ;; - - *) - cat <&6'. - # This gives full control over what it displayed on the screen. - exec 6>&1 >/dev/null - - # Store raw escape sequence character for later reuse. - esc_c=$(printf '\033') - - # Allow the user to execute their own script and modify or - # extend pfetch's behavior. - # shellcheck source=/dev/null - ! [ -f "$PF_SOURCE" ] || . "$PF_SOURCE" - - # Ensure that the 'TMPDIR' is writable as heredocs use it and - # fail without the write permission. This was found to be the - # case on Android where the temporary directory requires root. - [ -w "${TMPDIR:-/tmp}" ] || export TMPDIR=~ - - # Generic color list. - # Disable warning about unused variables. - # shellcheck disable=2034 - for _c in c1 c2 c3 c4 c5 c6 c7 c8; do - esc SGR "3${_c#?}" 0 - export "$_c=$e" - done - - # Disable line wrapping and catch the EXIT signal to enable it again - # on exit. Ideally you'd somehow query the current value and retain - # it but I'm yet to see this irk anyone. - esc_p DECAWM l >&6 - trap 'esc_p DECAWM h >&6' EXIT - - # Store the output of 'uname' to avoid calling it multiple times - # throughout the script. 'read </dev/null || continue - - # This was a ternary operation but they aren't supported in - # Minix's shell. - [ "${#info}" -gt "${info_length:-0}" ] && - info_length=${#info} - done - - # Add an additional space of length to act as a gap. - info_length=$((info_length + 1)) - - # Iterate over the above list and run any existing "get_" functions. - for info do - "get_$info" - done - } - - # Position the cursor below both the ascii art and information lines - # according to the height of both. If the information exceeds the ascii - # art in height, don't touch the cursor (0/unset), else move it down - # N lines. - # - # This was a ternary operation but they aren't supported in Minix's shell. - [ "${info_height:-0}" -lt "${ascii_height:-0}" ] && - cursor_pos=$((ascii_height - info_height)) - - # Print '$cursor_pos' amount of newlines to correctly position the - # cursor. This used to be a 'printf $(seq X X)' however 'seq' is only - # typically available (by default) on GNU based systems! - while [ "${i:=0}" -le "${cursor_pos:-0}" ]; do - printf '\n' - i=$((i + 1)) - done >&6 -} - -main "$@" diff --git a/bin/restart_ags b/bin/restart_ags deleted file mode 100755 index dec9d14..0000000 --- a/bin/restart_ags +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -sudo killall ags -ags & - diff --git a/bin/restart_hypridle b/bin/restart_hypridle deleted file mode 100755 index 3194618..0000000 --- a/bin/restart_hypridle +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -hypridle & - diff --git a/bin/restart_waybar b/bin/restart_waybar deleted file mode 100755 index 5f787a6..0000000 --- a/bin/restart_waybar +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -killall waybar -waybar & - diff --git a/bin/shfm b/bin/shfm deleted file mode 100755 index aee611e..0000000 --- a/bin/shfm +++ /dev/null @@ -1,428 +0,0 @@ -#!/bin/sh - -esc() { - case $1 in - # vt100 (IL is vt102) (DECTCEM is vt520) - CUD) printf '%s[%sB' "$esc_c" "$2" ;; # cursor down - CUP) printf '%s[%s;%sH' "$esc_c" "$2" "$3" ;; # cursor home - CUU) printf '%s[%sA' "$esc_c" "$2" ;; # cursor up - DECAWM) printf '%s[?7%s' "$esc_c" "$2" ;; # line wrap - DECRC) printf '%s8' "$esc_c" ;; # cursor restore - DECSC) printf '%s7' "$esc_c" ;; # cursor save - DECSTBM) printf '%s[%s;%sr' "$esc_c" "$2" "$3" ;; # scroll region - DECTCEM) printf '%s[?25%s' "$esc_c" "$2" ;; # cursor visible - ED[0-2]) printf '%s[%sJ' "$esc_c" "${1#ED}" ;; # clear screen - EL[0-2]) printf '%s[%sK' "$esc_c" "${1#EL}" ;; # clear line - IL) printf '%s[%sL' "$esc_c" "$2" ;; # insert line - SGR) printf '%s[%s;%sm' "$esc_c" "$2" "$3" ;; # colors - - # xterm (since 1988, supported widely) - screen_alt) printf '%s[?1049%s' "$esc_c" "$2" ;; # alternate buffer - esac -} - -term_setup() { - stty=$(stty -g) - stty -icanon -echo - esc screen_alt h - esc DECAWM l - esc DECTCEM l - esc ED2 - esc DECSTBM 1 "$((LINES - 2))" -} - -term_reset() { - esc DECAWM h >&2 - esc DECTCEM h >&2 - esc ED2 >&2 - esc DECSTBM >&2 - esc screen_alt l >&2 - stty "$stty" - - # needed for cd-on-exit - printf '%s\n' "$PWD" >&1 -} - -term_resize() { - # false-positive, behavior intentional, globbing is disabled. - # shellcheck disable=2046 - { - set -f - set +f -- $(stty size) - } - - LINES=$1 COLUMNS=$2 - - # space for status_line - bottom=$((LINES - 2)) -} - -term_scroll_down() { - case $((y - $#)) in - [0-9]*) return - esac - - y=$((y + 1)) - y2=$((y2 + 1 < bottom ? y2 + 1 : bottom)) - - line_print "$((y - 1))" "$@" - printf '\n' - line_print "$y" "$@" - status_line "$#" -} - -term_scroll_up() { - case $y in - -*|0|1) return - esac - - y=$((y - 1)) - - line_print "$((y + 1))" "$@" - - case $y2 in - 1) esc IL ;; - *) esc CUU; y2=$((y2 > 1 ? y2 - 1 : 1)) - esac - - line_print "$y" "$@" - status_line "$#" -} - -cmd_run() { - stty "$stty" - esc DECTCEM h - esc DECSTBM - esc ED2 - "$@" ||: - esc DECSTBM 1 "$((LINES - 2))" - esc DECTCEM l - stty -icanon -echo - hist=2 -} - -file_escape() { - tmp=$1 safe= - - # loop over string char by char - while c=${tmp%"${tmp#?}"}; do - case $c in - '') return ;; - [[:cntrl:]]) safe=$safe\? ;; - *) safe=$safe$c ;; - esac - - tmp=${tmp#?} - done -} - -hist_search() { - hist=0 j=1 - - for file do - case ${PWD%%/}/$file in - "$old_pwd") y=$j y2=$((j >= bottom ? mid : j)) cur=$file - esac - - j=$((j + 1)) - done -} - -list_print() { - esc ED2 - esc CUP - - i=1 - end=$((bottom + 1)) - mid=$((bottom / 4 < 5 ? 1 : bottom / 4)) - - case $# in - 1) [ -e "$1" ] || [ "$1" = 'no results' ] || set -- empty - esac - - case $hist in - 2) # redraw after cmd run - shift "$((y > y2 ? y - y2 : 0))" - ;; - - 1) # redraw after go-to-parent - hist_search "$@" - shift "$((y >= bottom ? y - mid : 0))" - ;; - - *) # everything else - shift "$((y >= bottom ? y - bottom : 0))" - ;; - esac - - for file do - case $i in - "$y2") esc SGR 0 7 - esac - - case $((i - end)) in - -*) - line_format "$file" - esc CUD - ;; - esac - - i=$((i + 1)) - done - - esc CUP "$((y > y2 ? y2 : y))" -} - -redraw() { - list_print "$@" - status_line "$#" -} - -status_line() { - esc DECSC - esc CUP "$LINES" - - case $USER in - root) esc SGR 31 7 ;; - *) esc SGR 34 7 ;; - esac - - printf '%*s\r%s ' "$COLUMNS" "" "($y/$1)" - - case $ltype in - '') printf %s "$PWD" ;; - *) printf %s "$ltype" - esac - - esc SGR 0 0 - esc DECRC -} - -prompt() { - esc DECSC - esc CUP "$LINES" - printf %s "$1" - esc DECTCEM h - esc EL0 - - case $2 in - r) - stty icanon echo - read -r ans ||: - stty -icanon -echo - ;; - esac - - esc DECRC - esc DECTCEM l - status_line "($y/$#) $PWD" -} - -line_print() { - offset=$1 - - case $offset in - "$y") esc SGR 0 7 - esac - - shift "$offset" - - case $offset in - "$y") cur=$1 - esac - - line_format "$1" -} - -line_format() { - file_escape "$1" - [ -d "$1" ] && esc SGR 1 31 - printf %s "$safe" - [ -d "$1" ] && printf / - esc SGR 0 0 - esc EL0 - printf '\r' -} - -main() { - set -e - - case $1 in - -h|--help) - printf 'shfm -[hv] \n' - exit 0 - ;; - - -v|--version) - printf 'shfm 0.4.2\n' - exit 0 - ;; - - *) - cd -- "${1:-"$PWD"}" - ;; - esac - - esc_c=$(printf '\033') - bs_char=$(printf '\177') - - set -- * - cur=$1 - - term_resize - term_setup - - trap 'term_reset' EXIT INT - trap 'term_resize; term_setup; y=1 y2=1; redraw "$@"' WINCH - - y=1 y2=1 - redraw "$@" - - while key=$(dd ibs=1 count=1 2>/dev/null); do - case $key${esc:=0} in - k?|A2) - term_scroll_up "$@" - ;; - - j?|B2) - term_scroll_down "$@" - ;; - - l?|C2|"$esc") # ARROW RIGHT - if [ -d "$cur" ] && cd -- "$cur" >/dev/null 2>&1; then - set -- * - y=1 y2=1 cur=$1 ltype= - redraw "$@" - - elif [ -e "$cur" ]; then - cmd_run "${SHFM_OPENER:="${EDITOR:=vi}"}" "$cur" - redraw "$@" - fi - ;; - - h?|D2|"$bs_char"?) # ARROW LEFT - old_pwd=$PWD - - case $ltype in - '') cd .. || continue ;; - *) ltype= ;; - esac - - set -- * - y=1 y2=1 cur=$1 hist=1 - redraw "$@" - ;; - - g?) - case $y in - 1) continue - esac - - y=1 y2=1 cur=$1 - redraw "$@" - ;; - - G?) - y=$# - y2=$(($# < bottom ? $# : bottom)) - line_print "$y" "$@" - redraw "$@" - ;; - - .?) - case ${hidden:=1} in - 1) hidden=0; set -- .* ;; - 0) hidden=1; set -- * - esac - - y=1 y2=1 cur=$1 - redraw "$@" - ;; - - :?) - prompt "cd: " r - - # false positive, behavior intentional - # shellcheck disable=2088 - case $ans in - '~') ans=$HOME ;; - '~/'*) ans=$HOME/${ans#"~/"} - esac - - cd -- "${ans:="$0"}" >/dev/null 2>&1|| continue - set -- * - y=1 y2=1 cur=$1 - redraw "$@" - ;; - - /?) - prompt / r - - IFS= - # globbing intentional, word splitting is disabled. - # shellcheck disable=2086 - set -- $ans* - unset IFS - - case $1$# in - "$ans*1") set -- 'no results' - esac - - y=1 y2=1 cur=$1 ltype="search $PWD/$ans*" - redraw "$@" - status_line "$#" - ;; - - -?) - cd -- "$OLDPWD" >/dev/null 2>&1|| continue - set -- * - y=1 y2=1 cur=$1 - redraw "$@" - ;; - - \~?) - cd || continue - set -- * - y=1 y2=1 cur=$1 - redraw "$@" - ;; - - \!?) - export SHFM_LEVEL - SHFM_LEVEL=$((SHFM_LEVEL + 1)) - cmd_run "${SHELL:=/bin/sh}" - redraw "$@" - ;; - - \??) - set -- 'j - down' \ - 'k - up' \ - 'l - open file or directory' \ - 'h - go up level' \ - 'g - go to top' \ - 'G - go to bottom' \ - 'q - quit' \ - ': - cd to ' \ - '/ - search current directory *' \ - '- - go to last directory' \ - '~ - go home' \ - '! - spawn shell' \ - '. - toggle hidden files' \ - '? - show keybinds' - - y=1 y2=1 cur=$1 ltype=keybinds - redraw "$@" - status_line "$#" - ;; - - q?) exit 0 ;; - - # handle keys which emit escape sequences - "$esc_c"*) esc=1 ;; - '[1') esc=2 ;; - *) esc=0 ;; - esac - done -} - -main "$@" >/dev/tty diff --git a/bin/speedtest b/bin/speedtest deleted file mode 100755 index 44c03da..0000000 Binary files a/bin/speedtest and /dev/null differ diff --git a/bin/sysfetch b/bin/sysfetch deleted file mode 100755 index 42dad8e..0000000 --- a/bin/sysfetch +++ /dev/null @@ -1,233 +0,0 @@ -#!/bin/bash - -_user_host(){ - local username hostname - - username="${USER:-$(id -un)}" - hostname="${HOSTNAME:-$( 0 )); then - trap 'printf "\e[?1049l"; stty echo; exit' 2 - - printf '\e[?1049h' - - for((;;)){ - printf '\e[2J\e[H' - main - sleep "$1" - } -else - main -fi - -stty echo \ No newline at end of file diff --git a/bin/tux.sh b/bin/tux.sh deleted file mode 100755 index 344d1a5..0000000 --- a/bin/tux.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -print_little_tux() { - echo " .--." - echo " |o_o |" - echo " |:_/ |" - echo " // \ \ " - echo " (| | )" - echo "/'\_ _/\`\ " - echo "\___)=(___/" -} - -print_big_tux() { - echo " .88888888:." - echo " 88888888.88888." - echo " .8888888888888888." - echo " 888888888888888888" - echo " 88' _\`88'_ \`88888" - echo " 88 88 88 88 88888" - echo " 88_88_::_88_:88888" - echo " 88:::,::,:::::8888" - echo " 88\`:::::::::'\`8888" - echo " .88 \`::::' 8:88." - echo " 8888 \`8:888." - echo " .8888' \`888888." - echo " .8888:.. .::. ...:'8888888:." - echo " .8888.' :' \`'::\`88:88888" - echo " .8888 ' \`.888:8888." - echo " 888:8 . 888:88888" - echo " .888:88 .: 888:88888:" - echo " 8888888. :: 88:888888" - echo " \`.::.888. :: .88888888" - echo " .::::::.888. :: :::\`8888'.:." - echo " ::::::::::.888 ' .::::::::::::" - echo " ::::::::::::.8 ' .:8::::::::::::." - echo " .::::::::::::::. .:888:::::::::::::" - echo " :::::::::::::::88:.__..:88888:::::::::::'" - echo " \`'.:::::::::::88888888888.88:::::::::'" - echo " \`':::_:' -- '' -'-' \`':_::::'\`" -} - -case "$1" in - big|b|-b) - print_big_tux - ;; - little|l|-l) - print_little_tux - ;; - *) - print_little_tux - ;; -esac - diff --git a/bin/updatepacmanrepo b/bin/updatepacmanrepo deleted file mode 100755 index 953b5bc..0000000 --- a/bin/updatepacmanrepo +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo reflector --protocol https --latest 5 --age 24 --sort rate --save /etc/pacman.d/mirrorlist - diff --git a/bin/worknet b/bin/worknet deleted file mode 100755 index 99008a5..0000000 --- a/bin/worknet +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -if [[ "$(id -u)" != "0" ]]; then - echo "You must be root" - exit 1 -fi - -#ip route del default via 172.17.132.1 dev enp3s0 -ip route add 172.17.0.0/16 via 172.17.132.1 dev eno1 - -#ip route del default via 192.168.48.1 dev enp3s0 -#ip route add 172.17.0.0/16 via 192.168.48.1 dev enp3s0 -#ip route add 192.168.48.0/23 via 192.168.48.1 dev enp3s0 - diff --git a/cava/config b/cava/config deleted file mode 100644 index 3c7f202..0000000 --- a/cava/config +++ /dev/null @@ -1,233 +0,0 @@ -## Configuration file for CAVA. -# Remove the ; to change parameters. - - -[general] - -# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 -; mode = normal - -# Accepts only non-negative values. -; framerate = 60 - -# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off -# new as of 0.6.0 autosens of low values (dynamic range) -# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 -; autosens = 1 -; overshoot = 20 - -# Manual sensitivity in %. If autosens is enabled, this will only be the initial value. -# 200 means double height. Accepts only non-negative values. -; sensitivity = 100 - -# The number of bars (0-512). 0 sets it to auto (fill up console). -# Bars' width and space between bars in number of characters. -; bars = 0 -; bar_width = 2 -; bar_spacing = 1 -# bar_height is only used for output in "noritake" format -; bar_height = 32 - -# For SDL width and space between bars is in pixels, defaults are: -; bar_width = 20 -; bar_spacing = 5 - -# sdl_glsl have these default values, they are only used to calulate max number of bars. -; bar_width = 1 -; bar_spacing = 0 - - -# Lower and higher cutoff frequencies for lowest and highest bars -# the bandwidth of the visualizer. -# Note: there is a minimum total bandwidth of 43Mhz x number of bars. -# Cava will automatically increase the higher cutoff if a too low band is specified. -; lower_cutoff_freq = 50 -; higher_cutoff_freq = 10000 - - -# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and -# only check for input once per second. Cava will wake up once input is detected. 0 = disable. -; sleep_timer = 0 - - -[input] - -# Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' -# Defaults to 'pulse', 'pipewire', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. -# On Mac it defaults to 'portaudio' or 'fifo' -# On windows this is automatic and no input settings are needed. -# -# All input methods uses the same config variable 'source' -# to define where it should get the audio. -# -# For pulseaudio and pipewire 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink -# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). -# -# For piepwire 'source' will be the object name or object.serial of the device to capture from. -# Both input and output devices are supported. -# -# For alsa 'source' will be the capture device. -# For fifo 'source' will be the path to fifo-file. -# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address -; method = pulse -; source = auto - -; method = pipewire -; source = auto - -; method = alsa -; source = hw:Loopback,1 - -; method = fifo -; source = /tmp/mpd.fifo -; sample_rate = 44100 -; sample_bits = 16 - -; method = shmem -; source = /squeezelite-AA:BB:CC:DD:EE:FF - -; method = portaudio -; source = auto - - -[output] - -# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake', 'sdl' -# or 'sdl_glsl'. -# 'noncurses' uses a custom framebuffer technique and prints only changes -# from frame to frame in the terminal. 'ncurses' is default if supported. -# -# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data -# stream of the bar heights that can be used to send to other applications. -# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. -# -# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display -# in graphic mode. It only support the 3000 series graphical VFDs for now. -# -# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context. -# 'sdl_glsl' uses SDL to create an OpenGL context. Write your own shaders or -# use one of the predefined ones. -method = ncurses - -# Orientation of the visualization. Can be 'bottom', 'top', 'left' or 'right'. -# Default is 'bottom'. Other orientations are only supported on sdl and ncruses -# output. Note: many fonts have weird glyphs for 'top' and 'right' characters, -# which can make ncurses not look right. -; orientation = bottom - -# Visual channels. Can be 'stereo' or 'mono'. -# 'stereo' mirrors both channels with low frequencies in center. -# 'mono' outputs left to right lowest to highest frequencies. -# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. -# set 'reverse' to 1 to display frequencies the other way around. -; channels = stereo -; mono_option = average -; reverse = 0 - -# Raw output target. A fifo will be created if target does not exist. -; raw_target = /dev/stdout - -# Raw data format. Can be 'binary' or 'ascii'. -; data_format = binary - -# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). -; bit_format = 16bit - -# Ascii max value. In 'ascii' mode range will run from 0 to value specified here -; ascii_max_range = 1000 - -# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. -# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). -; bar_delimiter = 59 -; frame_delimiter = 10 - -# sdl window size and position. -1,-1 is centered. -; sdl_width = 1000 -; sdl_height = 500 -; sdl_x = -1 -; sdl_y= -1 - -# set label on bars on the x-axis. Can be 'frequency' or 'none'. Default: 'none' -# 'frequency' displays the lower cut off frequency of the bar above. -# Only supported on ncurses and noncurses output. -; xaxis = none - -# enable alacritty synchronized updates. 1 = on, 0 = off -# removes flickering in alacritty terminal emulator. -# defaults to off since the behaviour in other terminal emulators is unknown -; alacritty_sync = 0 - -# Shaders for sdl_glsl, located in $HOME/.config/cava/shaders -; vertex_shader = pass_through.vert -; fragment_shader = bar_spectrum.frag - -; for glsl output mode, keep rendering even if no audio -; continuous_rendering = 0 - -[color] - -# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. -# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires -# a terminal that can change color definitions such as Gnome-terminal or rxvt. -# default is to keep current terminal color -#; background = default -#; foreground = default - -# SDL and sdl_glsl only support hex code colors, these are the default: -;background = '#000000' -;foreground = '#333333' - - -# Gradient mode, only hex defined colors are supported, -# background must also be defined in hex or remain commented out. 1 = on, 0 = off. -# You can define as many as 8 different colors. They range from bottom to top of screen -gradient = 1 -gradient_count = 8 -gradient_color_1 = '#59cc33' -gradient_color_2 = '#80cc33' -gradient_color_3 = '#a6cc33' -gradient_color_4 = '#cccc33' -gradient_color_5 = '#cca633' -gradient_color_6 = '#cc8033' -gradient_color_7 = '#cc5933' -gradient_color_8 = '#cc3333' - - - -[smoothing] - -# Percentage value for integral smoothing. Takes values from 0 - 100. -# Higher values means smoother, but less precise. 0 to disable. -# DEPRECATED as of 0.8.0, use noise_reduction instead -; integral = 77 - -# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. -; monstercat = 0 -; waves = 0 - -# Set gravity percentage for "drop off". Higher values means bars will drop faster. -# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". -# DEPRECATED as of 0.8.0, use noise_reduction instead -; gravity = 100 - - -# In bar height, bars that would have been lower that this will not be drawn. -# DEPRECATED as of 0.8.0 -; ignore = 0 - -# Noise reduction, int 0 - 100. default 77 -# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth -# 100 will be very slow and smooth, 0 will be fast but noisy. -; noise_reduction = 77 - - -[eq] - -# This one is tricky. You can have as much keys as you want. -# Remember to uncomment more than one key! More keys = more precision. -# Look at readme.md on github for further explanations and examples. -; 1 = 1 # bass -; 2 = 1 -; 3 = 1 # midtone -; 4 = 1 -; 5 = 1 # treble diff --git a/cava/shaders/bar_spectrum.frag b/cava/shaders/bar_spectrum.frag deleted file mode 100644 index b078913..0000000 --- a/cava/shaders/bar_spectrum.frag +++ /dev/null @@ -1,79 +0,0 @@ -#version 330 - -in vec2 fragCoord; -out vec4 fragColor; - -// bar values. defaults to left channels first (low to high), then right (high to low). -uniform float bars[512]; - -uniform int bars_count; // number of bars (left + right) (configurable) -uniform int bar_width; // bar width (configurable), not used here -uniform int bar_spacing; // space bewteen bars (configurable) - -uniform vec3 u_resolution; // window resolution - -//colors, configurable in cava config file (r,g,b) (0.0 - 1.0) -uniform vec3 bg_color; // background color -uniform vec3 fg_color; // foreground color - -uniform int gradient_count; -uniform vec3 gradient_colors[8]; // gradient colors - -vec3 normalize_C(float y,vec3 col_1, vec3 col_2, float y_min, float y_max) -{ - //create color based on fraction of this color and next color - float yr = (y - y_min) / (y_max - y_min); - return col_1 * (1.0 - yr) + col_2 * yr; -} - -void main() -{ - // find which bar to use based on where we are on the x axis - float x = u_resolution.x * fragCoord.x; - int bar = int(bars_count * fragCoord.x); - - //calculate a bar size - float bar_size = u_resolution.x / bars_count; - - //the y coordinate and bar values are the same - float y = bars[bar]; - - // make sure there is a thin line at bottom - if (y * u_resolution.y < 1.0) - { - y = 1.0 / u_resolution.y; - } - - //draw the bar up to current height - if (y > fragCoord.y) - { - //make some space between bars basen on settings - if (x > (bar + 1) * (bar_size) - bar_spacing) - { - fragColor = vec4(bg_color,1.0); - } - else - { - if (gradient_count == 0) - { - fragColor = vec4(fg_color,1.0); - } - else - { - //find which color in the configured gradient we are at - int color = int((gradient_count - 1) * fragCoord.y); - - //find where on y this and next color is supposed to be - float y_min = color / (gradient_count - 1.0); - float y_max = (color + 1.0) / (gradient_count - 1.0); - - //make color - fragColor = vec4(normalize_C(fragCoord.y, gradient_colors[color], gradient_colors[color + 1], y_min, y_max), 1.0); - } - } - } - else - { - fragColor = vec4(bg_color,1.0); - } -} \ No newline at end of file diff --git a/cava/shaders/northern_lights.frag b/cava/shaders/northern_lights.frag deleted file mode 100644 index ecd859a..0000000 --- a/cava/shaders/northern_lights.frag +++ /dev/null @@ -1,34 +0,0 @@ -#version 330 - -in vec2 fragCoord; -out vec4 fragColor; - -// bar values. defaults to left channels first (low to high), then right (high to low). -uniform float bars[512]; - -uniform int bars_count; // number of bars (left + right) (configurable) - -uniform vec3 u_resolution; // window resolution, not used here - -//colors, configurable in cava config file -uniform vec3 bg_color; // background color(r,g,b) (0.0 - 1.0), not used here -uniform vec3 fg_color; // foreground color, not used here - -void main() -{ - // find which bar to use based on where we are on the x axis - int bar = int(bars_count * fragCoord.x); - - float bar_y = 1.0 - abs((fragCoord.y - 0.5)) * 2.0; - float y = (bars[bar]) * bar_y; - - float bar_x = (fragCoord.x - float(bar) / float(bars_count)) * bars_count; - float bar_r = 1.0 - abs((bar_x - 0.5)) * 2; - - bar_r = bar_r * bar_r * 2; - - // set color - fragColor.r = fg_color.x * y * bar_r; - fragColor.g = fg_color.y * y * bar_r; - fragColor.b = fg_color.z * y * bar_r; -} diff --git a/cava/shaders/pass_through.vert b/cava/shaders/pass_through.vert deleted file mode 100644 index a4f20e5..0000000 --- a/cava/shaders/pass_through.vert +++ /dev/null @@ -1,14 +0,0 @@ -#version 330 - - -// Input vertex data, different for all executions of this shader. -layout(location = 0) in vec3 vertexPosition_modelspace; - -// Output data ; will be interpolated for each fragment. -out vec2 fragCoord; - -void main() -{ - gl_Position = vec4(vertexPosition_modelspace,1); - fragCoord = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; -} diff --git a/dunst/dunstrc b/dunst/dunstrc deleted file mode 100644 index 81bc713..0000000 --- a/dunst/dunstrc +++ /dev/null @@ -1,144 +0,0 @@ - -[global] - - monitor = 0 - - follow = none - - width = 300 - - height = 300 - - origin = top-right - - offset = 10x50 - - scale = 0 - - notification_limit = 20 - - progress_bar = true - - progress_bar_height = 10 - - progress_bar_frame_width = 1 - - progress_bar_min_width = 150 - - progress_bar_max_width = 300 - - progress_bar_corner_radius = 0 - - progress_bar_corners = all - - icon_corner_radius = 10 - - icon_corners = all - - indicate_hidden = yes - - transparency = 0 - - separator_height = 2 - - padding = 8 - - horizontal_padding = 8 - - text_icon_padding = 0 - - frame_width = 3 - - frame_color = "#aaaaaa" - - gap_size = 0 - - separator_color = frame - - sort = yes - - font = JetBrainsMono Nerd Font Mono 11 - - line_height = 0 - - markup = full - - format = "%s\n%b" - - alignment = left - - vertical_alignment = center - - show_age_threshold = 60 - - ellipsize = middle - - ignore_newline = no - - stack_duplicates = true - - hide_duplicate_count = false - - show_indicators = yes - - enable_recursive_icon_lookup = true - - icon_theme = "Papirus-Dark" - - icon_position = left - - min_icon_size = 32 - - max_icon_size = 128 - - icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ - - sticky_history = yes - - history_length = 20 - - dmenu = /usr/bin/dmenu -p dunst: - - browser = /usr/bin/xdg-open - - always_run_script = true - - title = Dunst - - class = Dunst - - corner_radius = 10 - - corners = all - - ignore_dbusclose = false - - force_xwayland = false - - force_xinerama = false - - mouse_left_click = close_current - mouse_middle_click = do_action, close_current - mouse_right_click = close_all - -[experimental] - per_monitor_dpi = false - - -[urgency_low] - background = "#222222" - foreground = "#888888" - timeout = 10 - -[urgency_normal] - background = "#000000" - foreground = "#ffffff" - timeout = 10 - override_pause_level = 30 - -[urgency_critical] - background = "#900000" - foreground = "#ffffff" - frame_color = "#ff0000" - timeout = 0 - override_pause_level = 60 diff --git a/dwm/Xresources b/dwm/Xresources deleted file mode 100644 index 0cccbf4..0000000 --- a/dwm/Xresources +++ /dev/null @@ -1,13 +0,0 @@ -cursor.size: 24 - -xterm*Background: black -xterm*Foreground: white -xterm*faceName: JetBrainsMono Nerd Font Mono -xterm*faceSize: 14 - -dwm.normbordercolor: #444444 -dwm.normbgcolor: #222222 -dwm.normfgcolor: #bbbbbb -dwm.selbordercolor: #00ffff -dwm.selbgcolor: #000000 -dwm.selfgcolor: #eeeeee diff --git a/dwm/background.sh b/dwm/background.sh deleted file mode 100755 index 50ac97e..0000000 --- a/dwm/background.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -directory=~/Pictures/wallpaper - -while true; do - if [ -d "$directory" ]; then - random_background=$(ls $directory/* | shuf -n 1) - - feh --bg-fill $random_background - fi - sleep 60 -done - diff --git a/dwm/bin/dmenu-powermenu b/dwm/bin/dmenu-powermenu deleted file mode 100755 index 5f17cb0..0000000 --- a/dwm/bin/dmenu-powermenu +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -case "$(printf "Shutdown\nRestart\nLogout\nSuspend\nLock" | dmenu \ - -nb "${COLOR_BACKGROUND:-#151515}" \ - -nf "${COLOR_DEFAULT:-#aaaaaa}" \ - -sf "${COLOR_HIGHLIGHT:-#589cc5}" \ - -sb "#1a1a1a" \ - -i -p \ - "Power:" -l 5)" in - Shutdown) exec systemctl poweroff;; - Restart) exec systemctl reboot;; - Logout) kill -HUP $XDG_SESSION_PID;; - Suspend) exec systemctl suspend;; - Lock) exec systemctl --user start lock.target;; -esac diff --git a/dwm/bin/picom b/dwm/bin/picom deleted file mode 100755 index 0045322..0000000 --- a/dwm/bin/picom +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -~/dotfiles/dwm/picom/build/src/picom -b --animations --animation-window-mass 0.5 --animation-for-open-window zoom --animation-stiffnes 500 diff --git a/dwm/bin/startslstatus b/dwm/bin/startslstatus deleted file mode 100755 index 24e0f00..0000000 --- a/dwm/bin/startslstatus +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -~/dotfiles/dwm/bin/wttrd & -while true; do - if [ -f /tmp/wttr ]; then - slstatus & - break - fi - sleep 1 -done - diff --git a/dwm/bin/volume b/dwm/bin/volume deleted file mode 100755 index b11d8ab..0000000 --- a/dwm/bin/volume +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -iDIR="$HOME/.config/hypr/mako/icons" - -# Get Volume -get_volume() { - volume=$(pamixer --get-volume) - echo "$volume" -} - -# Get icons -get_icon() { - current=$(get_volume) - if [[ "$current" -eq "0" ]]; then - echo "$iDIR/volume-mute.png" - elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then - echo "$iDIR/volume-low.png" - elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then - echo "$iDIR/volume-mid.png" - elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then - echo "$iDIR/volume-high.png" - fi -} - -# Notify -notify_user() { - notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume : $(get_volume) %" -} - -# Increase Volume -inc_volume() { - pamixer -i 5 && notify_user -} - -# Decrease Volume -dec_volume() { - pamixer -d 5 && notify_user -} - -# Toggle Mute -toggle_mute() { - if [ "$(pamixer --get-mute)" == "false" ]; then - pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" - elif [ "$(pamixer --get-mute)" == "true" ]; then - pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON" - fi -} - -# Toggle Mic -toggle_mic() { - if [ "$(pamixer --default-source --get-mute)" == "false" ]; then - pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" - elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then - pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON" - fi -} -# Get icons -get_mic_icon() { - current=$(pamixer --default-source --get-volume) - if [[ "$current" -eq "0" ]]; then - echo "$iDIR/microphone.png" - elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then - echo "$iDIR/microphone.png" - elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then - echo "$iDIR/microphone.png" - elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then - echo "$iDIR/microphone.png" - fi -} -# Notify -notify_mic_user() { - notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_mic_icon)" "Mic-Level : $(pamixer --default-source --get-volume) %" -} - -# Increase MIC Volume -inc_mic_volume() { - pamixer --default-source -i 5 && notify_mic_user -} - -# Decrease MIC Volume -dec_mic_volume() { - pamixer --default-source -d 5 && notify_mic_user -} - -# Execute accordingly -if [[ "$1" == "--get" ]]; then - get_volume -elif [[ "$1" == "--inc" ]]; then - inc_volume -elif [[ "$1" == "--dec" ]]; then - dec_volume -elif [[ "$1" == "--toggle" ]]; then - toggle_mute -elif [[ "$1" == "--toggle-mic" ]]; then - toggle_mic -elif [[ "$1" == "--get-icon" ]]; then - get_icon -elif [[ "$1" == "--get-mic-icon" ]]; then - get_mic_icon -elif [[ "$1" == "--mic-inc" ]]; then - inc_mic_volume -elif [[ "$1" == "--mic-dec" ]]; then - dec_mic_volume -else - get_volume -fi diff --git a/dwm/bin/wttrd b/dwm/bin/wttrd deleted file mode 100755 index 388b18e..0000000 --- a/dwm/bin/wttrd +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -while true; do - ~/dotfiles/dwm/slstatus/components/wttr.sh - sleep 1800 -done diff --git a/dwm/debs/du-dust_1.1.1-1_amd64.deb b/dwm/debs/du-dust_1.1.1-1_amd64.deb deleted file mode 100644 index 156de8b..0000000 Binary files a/dwm/debs/du-dust_1.1.1-1_amd64.deb and /dev/null differ diff --git a/dwm/debs/fastfetch-linux-aarch64.deb b/dwm/debs/fastfetch-linux-aarch64.deb deleted file mode 100644 index 890eb72..0000000 Binary files a/dwm/debs/fastfetch-linux-aarch64.deb and /dev/null differ diff --git a/dwm/debs/fastfetch-linux-amd64.deb b/dwm/debs/fastfetch-linux-amd64.deb deleted file mode 100644 index 7e317db..0000000 Binary files a/dwm/debs/fastfetch-linux-amd64.deb and /dev/null differ diff --git a/dwm/dunst/dunstrc b/dwm/dunst/dunstrc deleted file mode 100644 index 81bc713..0000000 --- a/dwm/dunst/dunstrc +++ /dev/null @@ -1,144 +0,0 @@ - -[global] - - monitor = 0 - - follow = none - - width = 300 - - height = 300 - - origin = top-right - - offset = 10x50 - - scale = 0 - - notification_limit = 20 - - progress_bar = true - - progress_bar_height = 10 - - progress_bar_frame_width = 1 - - progress_bar_min_width = 150 - - progress_bar_max_width = 300 - - progress_bar_corner_radius = 0 - - progress_bar_corners = all - - icon_corner_radius = 10 - - icon_corners = all - - indicate_hidden = yes - - transparency = 0 - - separator_height = 2 - - padding = 8 - - horizontal_padding = 8 - - text_icon_padding = 0 - - frame_width = 3 - - frame_color = "#aaaaaa" - - gap_size = 0 - - separator_color = frame - - sort = yes - - font = JetBrainsMono Nerd Font Mono 11 - - line_height = 0 - - markup = full - - format = "%s\n%b" - - alignment = left - - vertical_alignment = center - - show_age_threshold = 60 - - ellipsize = middle - - ignore_newline = no - - stack_duplicates = true - - hide_duplicate_count = false - - show_indicators = yes - - enable_recursive_icon_lookup = true - - icon_theme = "Papirus-Dark" - - icon_position = left - - min_icon_size = 32 - - max_icon_size = 128 - - icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ - - sticky_history = yes - - history_length = 20 - - dmenu = /usr/bin/dmenu -p dunst: - - browser = /usr/bin/xdg-open - - always_run_script = true - - title = Dunst - - class = Dunst - - corner_radius = 10 - - corners = all - - ignore_dbusclose = false - - force_xwayland = false - - force_xinerama = false - - mouse_left_click = close_current - mouse_middle_click = do_action, close_current - mouse_right_click = close_all - -[experimental] - per_monitor_dpi = false - - -[urgency_low] - background = "#222222" - foreground = "#888888" - timeout = 10 - -[urgency_normal] - background = "#000000" - foreground = "#ffffff" - timeout = 10 - override_pause_level = 30 - -[urgency_critical] - background = "#900000" - foreground = "#ffffff" - frame_color = "#ff0000" - timeout = 0 - override_pause_level = 60 diff --git a/dwm/dwm.desktop b/dwm/dwm.desktop deleted file mode 100644 index 2cadcd8..0000000 --- a/dwm/dwm.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=DWM -Icon=dwm -Comment=An dynamic window manager for linux xorg -Exec=/home/tola/dotfiles/dwm/startdwm.sh -Type=XSession diff --git a/dwm/dwm/LICENSE b/dwm/dwm/LICENSE deleted file mode 100644 index 995172f..0000000 --- a/dwm/dwm/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2009 Jukka Salmi -© 2006-2007 Sander van Dijk -© 2007-2011 Peter Hartlich -© 2007-2009 Szabolcs Nagy -© 2007-2009 Christof Musik -© 2007-2009 Premysl Hruby -© 2007-2008 Enno Gottox Boland -© 2008 Martin Hurton -© 2008 Neale Pickett -© 2009 Mate Nagy -© 2010-2016 Hiltjo Posthuma -© 2010-2012 Connor Lane Smith -© 2011 Christoph Lohmann <20h@r-36.net> -© 2015-2016 Quentin Rameau -© 2015-2016 Eric Pruitt -© 2016-2017 Markus Teich -© 2020-2022 Chris Down - -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 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. diff --git a/dwm/dwm/Makefile b/dwm/dwm/Makefile deleted file mode 100644 index ffa69b4..0000000 --- a/dwm/dwm/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# dwm - dynamic window manager -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dwm.c util.c -OBJ = ${SRC:.c=.o} - -all: dwm - -.c.o: - ${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk - -config.h: - cp config.def.h $@ - -dwm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} - -clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.def.h config.mk\ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} - -install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -.PHONY: all clean dist install uninstall diff --git a/dwm/dwm/README b/dwm/dwm/README deleted file mode 100644 index 95d4fd0..0000000 --- a/dwm/dwm/README +++ /dev/null @@ -1,48 +0,0 @@ -dwm - dynamic window manager -============================ -dwm is an extremely fast, small, and dynamic window manager for X. - - -Requirements ------------- -In order to build dwm you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install dwm (if -necessary as root): - - make clean install - - -Running dwm ------------ -Add the following line to your .xinitrc to start dwm using startx: - - exec dwm - -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: - - DISPLAY=foo.bar:1 exec dwm - -(This will start dwm on display :1 of the host foo.bar.) - -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec dwm - - -Configuration -------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. diff --git a/dwm/dwm/config.def.h b/dwm/dwm/config.def.h deleted file mode 100644 index 2175bf4..0000000 --- a/dwm/dwm/config.def.h +++ /dev/null @@ -1,206 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 2; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int gappx = 5; /* gaps between windows */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrains Mono Nerd font:size=12" }; -static const char dmenufont[] = "JetBrains Mono Nerd font:size=12"; -static char normbgcolor[] = "#222222"; -static char normbordercolor[] = "#444444"; -static char normfgcolor[] = "#bbbbbb"; -static char selfgcolor[] = "#eeeeee"; -static char selbordercolor[] = "#00ffff"; -static char selbgcolor[] = "#005577"; -static char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, - [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, -}; -// static const char col_gray1[] = "#222222"; -// static const char col_gray2[] = "#444444"; -// static const char col_gray3[] = "#bbbbbb"; -// static const char col_gray4[] = "#eeeeee"; -// static const char col_cyan[] = "#00ffff"; -// static const char color_black[] = "#000000"; -// static const char *colors[][3] = { -// /* fg bg border */ -// [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -// [SchemeSel] = { col_gray4, color_black, col_cyan }, -// }; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ - -//------------------------------------------------- dmenu ------------------------------------------------- -static char dmenumon[2] = "0"; // component of dmenucmd, manipulated in spawn() -// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL }; -//--------------------------------------------------------------------------------------------------------- - -//-------------------------- applications --------------------------------------------------------- -static const char *termcmd[] = { "st", NULL }; -static const char *roficmd[] = { "/home/tola/dotfiles/rofi/launcher/launcher.sh", NULL }; -static const char *powermenucmd[] = { "/home/tola/dotfiles/rofi/powermenu/powermenu.sh", NULL }; -static const char *clipboardcmd[] = { "/home/tola/dotfiles/rofi/clipboard/clipboard.sh", NULL }; -static const char *rofimojicmd[] = { "/home/tola/dotfiles/rofi/emoji/rofimoji.sh", NULL }; -static const char *filemanagercmd[] = { "thunar", NULL }; -static const char *telegramcmd[] = { "telegram-desktop", NULL }; -static const char *googlecmd[] = { "google-chrome-stable", NULL }; -static const char *lockercmd[] = { "i3lock", "-c", "000000", NULL }; -//------------------------------------------------------------------------------------------------- - -//---------------------------- pamixer ------------------------------ -static const char *pamixericmd[] = { "pamixer", "-i", "10", NULL }; -static const char *pamixerdcmd[] = { "pamixer", "-d", "10", NULL }; -static const char *pamixermutecmd[] = { "pamixer", "-t", NULL }; -//------------------------------------------------------------------- - -//----------------------------- brightness -------------------------- -static const char *brightnessupcmd[] = { "brightnessctl", "s", "10%+", NULL }; -static const char *brightnessdowncmd[] = { "brightnessctl", "s", "10%-", NULL }; -//------------------------------------------------------------------- - -//------------------------------ keyboard brightness ---------------- -static const char *keyboardbrightnessupcmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%+", NULL }; -static const char *keyboardbrightnessdowncmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%-", NULL }; -//------------------------------------------------------------------- - -static const Key keys[] = { - /* modifier key function argument */ - - //-------------- pamixer ----------------------------------------------------------- - // XF86AudioRaiseVolume - { 0, 0x1008ff13, spawn, {.v = pamixericmd } }, - // XF86AudioLowerVolume - { 0, 0x1008ff11, spawn, {.v = pamixerdcmd } }, - // equal - { MODKEY, 0x3d, spawn, {.v = pamixericmd } }, - // minus - { MODKEY, 0x2d, spawn, {.v = pamixerdcmd } }, - // XF86AudioMute - { 0, 0x1008ff12, spawn, {.v = pamixermutecmd } }, - { MODKEY|ShiftMask, XK_m, spawn, {.v = pamixermutecmd } }, - //---------------------------------------------------------------------------------- - - //---------------------------------- brightness ------------------------------------ - // XF86MonBrightnessUp - { 0, 0x1008ff02, spawn, {.v = brightnessupcmd } }, - // XF86MonBrightnessDown - { 0, 0x1008ff03, spawn, {.v = brightnessdowncmd } }, - //---------------------------------------------------------------------------------- - - //-------------------------------- keyboard brightness ----------------------------- - // XF86KbdBrightnessUp - { 0, 0x1008ff05, spawn, {.v = keyboardbrightnessupcmd } }, - // XF86KbdBrightnessDown - { 0, 0x1008ff06, spawn, {.v = keyboardbrightnessdowncmd } }, - //---------------------------------------------------------------------------------- - - //--------------------------------- applications ----------------------------------- - { MODKEY|ShiftMask, XK_l, spawn, {.v = lockercmd } }, - { MODKEY, XK_p, spawn, {.v = roficmd } }, - { MODKEY|ShiftMask, XK_p, spawn, {.v = powermenucmd } }, - { MODKEY, XK_c, spawn, {.v = clipboardcmd } }, - { MODKEY, XK_e, spawn, {.v = rofimojicmd} }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_s, spawn, {.v = filemanagercmd } }, - { MODKEY, XK_a, spawn, {.v = telegramcmd } }, - { MODKEY, XK_g, spawn, {.v = googlecmd } }, - //---------------------------------------------------------------------------------- - - //------------------------------------ gaps ---------------------------- - { MODKEY|ShiftMask, XK_minus, setgaps, {.i = -1 } }, - { MODKEY|ShiftMask, XK_equal, setgaps, {.i = +1 } }, - { MODKEY|ShiftMask, XK_n, setgaps, {.i = 0 } }, - //---------------------------------------------------------------------- - - { MODKEY, XK_F5, xrdb, {.v = NULL } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_w, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY, XK_q, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY, XK_v, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - diff --git a/dwm/dwm/config.h b/dwm/dwm/config.h deleted file mode 100644 index 6367e12..0000000 --- a/dwm/dwm/config.h +++ /dev/null @@ -1,195 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 2; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int gappx = 5; /* gaps between windows */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrains Mono Nerd font:size=12" }; -static const char dmenufont[] = "JetBrains Mono Nerd font:size=12"; -static char normbgcolor[] = "#222222"; -static char normbordercolor[] = "#444444"; -static char normfgcolor[] = "#bbbbbb"; -static char selfgcolor[] = "#eeeeee"; -static char selbordercolor[] = "#00ffff"; -static char selbgcolor[] = "#005577"; -static char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, - [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ - -//------------------------------------------------- dmenu ------------------------------------------------- -static char dmenumon[2] = "0"; // component of dmenucmd, manipulated in spawn() -// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL }; -//--------------------------------------------------------------------------------------------------------- - -//-------------------------- applications --------------------------------------------------------- -static const char *termcmd[] = { "st", NULL }; -static const char *roficmd[] = { "/home/tola/dotfiles/rofi/launcher/launcher.sh", NULL }; -static const char *powermenucmd[] = { "/home/tola/dotfiles/rofi/powermenu/powermenu.sh", NULL }; -static const char *clipboardcmd[] = { "/home/tola/dotfiles/rofi/clipboard/clipboard.sh", NULL }; -static const char *rofimojicmd[] = { "/home/tola/dotfiles/rofi/emoji/rofimoji.sh", NULL }; -static const char *filemanagercmd[] = { "thunar", NULL }; -static const char *telegramcmd[] = { "telegram-desktop", NULL }; -static const char *googlecmd[] = { "google-chrome-stable", NULL }; -static const char *lockercmd[] = { "i3lock", "-c", "000000", NULL }; -//------------------------------------------------------------------------------------------------- - -//---------------------------- pamixer ------------------------------ -static const char *pamixericmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--inc", NULL }; -static const char *pamixerdcmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--dec", NULL }; -static const char *pamixermutecmd[] = { "/home/tola/dotfiles/dwm/bin/volume", "--toggle", NULL }; -//------------------------------------------------------------------- - -//----------------------------- brightness -------------------------- -static const char *brightnessupcmd[] = { "brightnessctl", "s", "10%+", NULL }; -static const char *brightnessdowncmd[] = { "brightnessctl", "s", "10%-", NULL }; -//------------------------------------------------------------------- - -//------------------------------ keyboard brightness ---------------- -static const char *keyboardbrightnessupcmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%+", NULL }; -static const char *keyboardbrightnessdowncmd[] = { "brightnessctl", "--device", "smc::kbd_backlight", "s", "10%-", NULL }; -//------------------------------------------------------------------- - -static const Key keys[] = { - /* modifier key function argument */ - - //-------------- pamixer ----------------------------------------------------------- - // XF86AudioRaiseVolume - { 0, 0x1008ff13, spawn, {.v = pamixericmd } }, - // XF86AudioLowerVolume - { 0, 0x1008ff11, spawn, {.v = pamixerdcmd } }, - // equal - { MODKEY, 0x3d, spawn, {.v = pamixericmd } }, - // minus - { MODKEY, 0x2d, spawn, {.v = pamixerdcmd } }, - // XF86AudioMute - { 0, 0x1008ff12, spawn, {.v = pamixermutecmd } }, - { MODKEY|ShiftMask, XK_m, spawn, {.v = pamixermutecmd } }, - //---------------------------------------------------------------------------------- - - //---------------------------------- brightness ------------------------------------ - // XF86MonBrightnessUp - { 0, 0x1008ff02, spawn, {.v = brightnessupcmd } }, - // XF86MonBrightnessDown - { 0, 0x1008ff03, spawn, {.v = brightnessdowncmd } }, - //---------------------------------------------------------------------------------- - - //-------------------------------- keyboard brightness ----------------------------- - // XF86KbdBrightnessUp - { 0, 0x1008ff05, spawn, {.v = keyboardbrightnessupcmd } }, - // XF86KbdBrightnessDown - { 0, 0x1008ff06, spawn, {.v = keyboardbrightnessdowncmd } }, - //---------------------------------------------------------------------------------- - - //--------------------------------- applications ----------------------------------- - { MODKEY|ShiftMask, XK_l, spawn, {.v = lockercmd } }, - { MODKEY, XK_p, spawn, {.v = roficmd } }, - { MODKEY|ShiftMask, XK_p, spawn, {.v = powermenucmd } }, - { MODKEY, XK_c, spawn, {.v = clipboardcmd } }, - { MODKEY, XK_e, spawn, {.v = rofimojicmd} }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_s, spawn, {.v = filemanagercmd } }, - { MODKEY, XK_a, spawn, {.v = telegramcmd } }, - { MODKEY, XK_g, spawn, {.v = googlecmd } }, - //---------------------------------------------------------------------------------- - - //------------------------------------ gaps ---------------------------- - { MODKEY|ShiftMask, XK_minus, setgaps, {.i = -1 } }, - { MODKEY|ShiftMask, XK_equal, setgaps, {.i = +1 } }, - { MODKEY|ShiftMask, XK_n, setgaps, {.i = 0 } }, - //---------------------------------------------------------------------- - - { MODKEY, XK_F5, xrdb, {.v = NULL } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_w, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY, XK_q, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY, XK_v, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - diff --git a/dwm/dwm/config.mk b/dwm/dwm/config.mk deleted file mode 100644 index 8efca9a..0000000 --- a/dwm/dwm/config.mk +++ /dev/null @@ -1,39 +0,0 @@ -# dwm version -VERSION = 6.5 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 -#MANPREFIX = ${PREFIX}/man - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc diff --git a/dwm/dwm/drw.c b/dwm/dwm/drw.c deleted file mode 100644 index f8a82f5..0000000 --- a/dwm/dwm/drw.c +++ /dev/null @@ -1,450 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); - drw->gc = XCreateGC(dpy, root, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - drw_fontset_free(drw->fonts); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - free(font); -} - -Fnt* -drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - drw_fontset_free(font->next); - xfont_free(font); - } -} - -void -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) -{ - if (!drw || !dest || !clrname) - return; - - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen), - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount) -{ - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - drw_clr_create(drw, &ret[i], clrnames[i]); - return ret; -} - -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) -{ - int i, ty, ellipsis_x = 0; - unsigned int tmpw, ew, ellipsis_w = 0, ellipsis_len; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0, overflow = 0; - /* keep track of a couple codepoints for which we have no match. */ - enum { nomatches_len = 64 }; - static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches; - static unsigned int ellipsis_width = 0; - - if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts) - return 0; - - if (!render) { - w = invert ? invert : ~invert; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - if (!ellipsis_width && render) - ellipsis_width = drw_fontset_getwidth(drw, "..."); - while (1) { - ew = ellipsis_len = utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - drw_font_getexts(curfont, text, utf8charlen, &tmpw, NULL); - if (ew + ellipsis_width <= w) { - /* keep track where the ellipsis still fits */ - ellipsis_x = x + ew; - ellipsis_w = w - ew; - ellipsis_len = utf8strlen; - } - - if (ew + tmpw > w) { - overflow = 1; - /* called from drw_fontset_getwidth_clamp(): - * it wants the width AFTER the overflow - */ - if (!render) - x += tmpw; - else - utf8strlen = ellipsis_len; - } else if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - ew += tmpw; - } else { - nextfont = curfont; - } - break; - } - } - - if (overflow || !charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)utf8str, utf8strlen); - } - x += ew; - w -= ew; - } - if (render && overflow) - drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert); - - if (!*text || overflow) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - for (i = 0; i < nomatches_len; ++i) { - /* avoid calling XftFontMatch if we know we won't find a match */ - if (utf8codepoint == nomatches.codepoint[i]) - goto no_match; - } - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - nomatches.codepoint[++nomatches.idx % nomatches_len] = utf8codepoint; -no_match: - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -} - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0); -} - -unsigned int -drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n) -{ - unsigned int tmp = 0; - if (drw && drw->fonts && text && n) - tmp = drw_text(drw, 0, 0, 0, 0, 0, text, n); - return MIN(n, tmp); -} - -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} diff --git a/dwm/dwm/drw.h b/dwm/dwm/drw.h deleted file mode 100644 index bdbf950..0000000 --- a/dwm/dwm/drw.h +++ /dev/null @@ -1,58 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; -} Fnt; - -enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - Drawable drawable; - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text); -unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); - -/* Colorscheme abstraction */ -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); -Clr *drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -void drw_setfontset(Drw *drw, Fnt *set); -void drw_setscheme(Drw *drw, Clr *scm); - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/dwm/dwm/drw.o b/dwm/dwm/drw.o deleted file mode 100644 index 18d23e9..0000000 Binary files a/dwm/dwm/drw.o and /dev/null differ diff --git a/dwm/dwm/dwm b/dwm/dwm/dwm deleted file mode 100755 index e5992c1..0000000 Binary files a/dwm/dwm/dwm and /dev/null differ diff --git a/dwm/dwm/dwm.1 b/dwm/dwm/dwm.1 deleted file mode 100644 index ddc8321..0000000 --- a/dwm/dwm/dwm.1 +++ /dev/null @@ -1,176 +0,0 @@ -.TH DWM 1 dwm\-VERSION -.SH NAME -dwm \- dynamic window manager -.SH SYNOPSIS -.B dwm -.RB [ \-v ] -.SH DESCRIPTION -dwm is a dynamic window manager for X. It manages windows in tiled, monocle -and floating layouts. Either layout can be applied dynamically, optimising the -environment for the application in use and the task performed. -.P -In tiled layouts windows are managed in a master and stacking area. The master -area on the left contains one window by default, and the stacking area on the -right contains all other windows. The number of master area windows can be -adjusted from zero to an arbitrary number. In monocle layout all windows are -maximised to the screen size. In floating layout windows can be resized and -moved freely. Dialog windows are always managed floating, regardless of the -layout applied. -.P -Windows are grouped by tags. Each window can be tagged with one or multiple -tags. Selecting certain tags displays all windows with these tags. -.P -Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an -empty square and a maximised floating window is indicated with a filled square -before the windows title. The selected tags are indicated with a different -color. The tags of the focused window are indicated with a filled square in the -top left corner. The tags which are applied to one or more windows are -indicated with an empty square in the top left corner. -.P -dwm draws a small border around windows to indicate the focus state. -.SH OPTIONS -.TP -.B \-v -prints version information to stderr, then exits. -.SH USAGE -.SS Status bar -.TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP -.B Button1 -click on a tag label to display all windows with that tag, click on the layout -label toggles between tiled and floating layout. -.TP -.B Button3 -click on a tag label adds/removes all windows with that tag to/from the view. -.TP -.B Mod1\-Button1 -click on a tag label applies that tag to the focused window. -.TP -.B Mod1\-Button3 -click on a tag label adds/removes that tag to/from the focused window. -.SS Keyboard commands -.TP -.B Mod1\-Shift\-Return -Start -.BR st(1). -.TP -.B Mod1\-p -Spawn -.BR dmenu(1) -for launching other programs. -.TP -.B Mod1\-, -Focus previous screen, if any. -.TP -.B Mod1\-. -Focus next screen, if any. -.TP -.B Mod1\-Shift\-, -Send focused window to previous screen, if any. -.TP -.B Mod1\-Shift\-. -Send focused window to next screen, if any. -.TP -.B Mod1\-b -Toggles bar on and off. -.TP -.B Mod1\-t -Sets tiled layout. -.TP -.B Mod1\-f -Sets floating layout. -.TP -.B Mod1\-m -Sets monocle layout. -.TP -.B Mod1\-space -Toggles between current and previous layout. -.TP -.B Mod1\-j -Focus next window. -.TP -.B Mod1\-k -Focus previous window. -.TP -.B Mod1\-i -Increase number of windows in master area. -.TP -.B Mod1\-d -Decrease number of windows in master area. -.TP -.B Mod1\-l -Increase master area size. -.TP -.B Mod1\-h -Decrease master area size. -.TP -.B Mod1\-Return -Zooms/cycles focused window to/from master area (tiled layouts only). -.TP -.B Mod1\-Shift\-c -Close focused window. -.TP -.B Mod1\-Shift\-space -Toggle focused window between tiled and floating state. -.TP -.B Mod1\-Tab -Toggles to the previously selected tags. -.TP -.B Mod1\-Shift\-[1..n] -Apply nth tag to focused window. -.TP -.B Mod1\-Shift\-0 -Apply all tags to focused window. -.TP -.B Mod1\-Control\-Shift\-[1..n] -Add/remove nth tag to/from focused window. -.TP -.B Mod1\-[1..n] -View all windows with nth tag. -.TP -.B Mod1\-0 -View all windows with any tag. -.TP -.B Mod1\-Control\-[1..n] -Add/remove all windows with nth tag to/from the view. -.TP -.B Mod1\-Shift\-q -Quit dwm. -.SS Mouse commands -.TP -.B Mod1\-Button1 -Move focused window while dragging. Tiled windows will be toggled to the floating state. -.TP -.B Mod1\-Button2 -Toggles focused window between floating and tiled state. -.TP -.B Mod1\-Button3 -Resize focused window while dragging. Tiled windows will be toggled to the floating state. -.SH CUSTOMIZATION -dwm is customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH SEE ALSO -.BR dmenu (1), -.BR st (1) -.SH ISSUES -Java applications which use the XToolkit/XAWT backend may draw grey windows -only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early -JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds -are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the -environment variable -.BR AWT_TOOLKIT=MToolkit -(to use the older Motif backend instead) or running -.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D -or -.B wmname LG3D -(to pretend that a non-reparenting window manager is running that the -XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable -.BR _JAVA_AWT_WM_NONREPARENTING=1 . -.SH BUGS -Send all bug reports with a patch to hackers@suckless.org. diff --git a/dwm/dwm/dwm.c b/dwm/dwm/dwm.c deleted file mode 100644 index be8b2cd..0000000 --- a/dwm/dwm/dwm.c +++ /dev/null @@ -1,2325 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ - * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define TAGMASK ((1 << LENGTH(tags)) - 1) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) -#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \ - if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \ - int i = 1; \ - for (; i <= 6; i++) { \ - if (value.addr[i] < 48) break; \ - if (value.addr[i] > 57 && value.addr[i] < 65) break; \ - if (value.addr[i] > 70 && value.addr[i] < 97) break; \ - if (value.addr[i] > 102) break; \ - } \ - if (i == 7) { \ - strncpy(V, value.addr, 7); \ - V[7] = '\0'; \ - } \ - } \ - } - -/* enums */ -enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { NetSupported, NetWMName, NetWMState, NetWMCheck, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ - -typedef union { - int i; - unsigned int ui; - float f; - const void *v; -} Arg; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -typedef struct Monitor Monitor; -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - int x, y, w, h; - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; - int bw, oldbw; - unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; - Client *next; - Client *snext; - Monitor *mon; - Window win; -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); -} Layout; - -typedef struct Pertag Pertag; -struct Monitor { - char ltsymbol[16]; - float mfact; - int nmaster; - int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - int gappx; /* gaps between windows */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; - int showbar; - int topbar; - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Window barwin; - const Layout *lt[2]; - Pertag *pertag; -}; - -typedef struct { - const char *class; - const char *instance; - const char *title; - unsigned int tags; - int isfloating; - int monitor; -} Rule; - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static void enternotify(XEvent *e); -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); -static Atom getatomprop(Client *c, Atom prop); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -static void grabkeys(void); -static void incnmaster(const Arg *arg); -static void keypress(XEvent *e); -static void killclient(const Arg *arg); -static void loadxrdb(void); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -static void monocle(Monitor *m); -static void motionnotify(XEvent *e); -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -static void pop(Client *c); -static void propertynotify(XEvent *e); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void restack(Monitor *m); -static void run(void); -static void scan(void); -static int sendevent(Client *c, Atom proto); -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setgaps(const Arg *arg); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -static void showhide(Client *c); -static void spawn(const Arg *arg); -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void tile(Monitor *m); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatetitle(Client *c); -static void updatewindowtype(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void xrdb(const Arg *arg); -static void zoom(const Arg *arg); - -/* variables */ -static const char broken[] = "broken"; -static char stext[256]; -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh; /* bar height */ -static int lrpad; /* sum of left and right padding for text */ -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -static void (*handler[LASTEvent]) (XEvent *) = { - [ButtonPress] = buttonpress, - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, - [UnmapNotify] = unmapnotify -}; -static Atom wmatom[WMLast], netatom[NetLast]; -static int running = 1; -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -struct Pertag { - unsigned int curtag, prevtag; /* current and previous tag */ - int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ - float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ - unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ - const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ - int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ -}; - -/* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; - -/* function implementations */ -void -applyrules(Client *c) -{ - const char *class, *instance; - unsigned int i; - const Rule *r; - Monitor *m; - XClassHint ch = { NULL, NULL }; - - /* rule matching */ - c->isfloating = 0; - c->tags = 0; - XGetClassHint(dpy, c->win, &ch); - class = ch.res_class ? ch.res_class : broken; - instance = ch.res_name ? ch.res_name : broken; - - for (i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if ((!r->title || strstr(c->name, r->title)) - && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) - { - c->isfloating = r->isfloating; - c->tags |= r->tags; - for (m = mons; m && m->num != r->monitor; m = m->next); - if (m) - c->mon = m; - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; -} - -int -applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) -{ - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - if (*w < bh) - *w = bh; - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - if (!c->hintsvalid) - updatesizehints(c); - /* see last two sentences in ICCCM 4.1.2.3 */ - baseismin = c->basew == c->minw && c->baseh == c->minh; - if (!baseismin) { /* temporarily remove base dimensions */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void -arrange(Monitor *m) -{ - if (m) - showhide(m->stack); - else for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else for (m = mons; m; m = m->next) - arrangemon(m); -} - -void -arrangemon(Monitor *m) -{ - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void -attach(Client *c) -{ - c->next = c->mon->clients; - c->mon->clients = c; -} - -void -attachstack(Client *c) -{ - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void -buttonpress(XEvent *e) -{ - unsigned int i, x, click; - Arg arg = {0}; - Client *c; - Monitor *m; - XButtonPressedEvent *ev = &e->xbutton; - - click = ClkRootWin; - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - if (ev->window == selmon->barwin) { - i = x = 0; - do - x += TEXTW(tags[i]); - while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; - } else if (ev->x < x + TEXTW(selmon->ltsymbol)) - click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext)) - click = ClkStatusText; - else - click = ClkWinTitle; - } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - for (i = 0; i < LENGTH(buttons); i++) - if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); -} - -void -checkotherwm(void) -{ - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void -cleanup(void) -{ - Arg a = {.ui = ~0}; - Layout foo = { "", NULL }; - Monitor *m; - size_t i; - - view(&a); - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors); i++) - free(scheme[i]); - free(scheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -} - -void -cleanupmon(Monitor *mon) -{ - Monitor *m; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next); - m->next = mon->next; - } - XUnmapWindow(dpy, mon->barwin); - XDestroyWindow(dpy, mon->barwin); - free(mon); -} - -void -clientmessage(XEvent *e) -{ - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] - || cme->data.l[2] == netatom[NetWMFullscreen]) - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); - } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - } -} - -void -configure(Client *c) -{ - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void -configurenotify(XEvent *e) -{ - Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; - int dirty; - - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); - } - focus(NULL); - arrange(NULL); - } - } -} - -void -configurerequest(XEvent *e) -{ - Client *c; - Monitor *m; - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -Monitor * -createmon(void) -{ - Monitor *m; - unsigned int i; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->gappx = gappx; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - m->pertag = ecalloc(1, sizeof(Pertag)); - m->pertag->curtag = m->pertag->prevtag = 1; - - for (i = 0; i <= LENGTH(tags); i++) { - m->pertag->nmasters[i] = m->nmaster; - m->pertag->mfacts[i] = m->mfact; - - m->pertag->ltidxs[i][0] = m->lt[0]; - m->pertag->ltidxs[i][1] = m->lt[1]; - m->pertag->sellts[i] = m->sellt; - - m->pertag->showbars[i] = m->showbar; - } - - return m; -} - -void -destroynotify(XEvent *e) -{ - Client *c; - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); -} - -void -detach(Client *c) -{ - Client **tc; - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next); - *tc = c->next; -} - -void -detachstack(Client *c) -{ - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); - c->mon->sel = t; - } -} - -Monitor * -dirtomon(int dir) -{ - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next); - else - for (m = mons; m->next != selmon; m = m->next); - return m; -} - -void -drawbar(Monitor *m) -{ - int x, w, tw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; - Client *c; - - if (!m->showbar) - return; - - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); - tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); - } - - for (c = m->clients; c; c = c->next) { - occ |= c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - w = TEXTW(tags[i]); - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); - x += w; - } - w = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww, bh); -} - -void -drawbars(void) -{ - Monitor *m; - - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -enternotify(XEvent *e) -{ - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - -void -expose(XEvent *e) -{ - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) - drawbar(m); -} - -void -focus(Client *c) -{ - if (!c || !ISVISIBLE(c)) - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - setfocus(c); - } else { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); -} - -/* there are some broken focus acquiring clients needing extra handling */ -void -focusin(XEvent *e) -{ - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void -focusmon(const Arg *arg) -{ - Monitor *m; - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - unfocus(selmon->sel, 0); - selmon = m; - focus(NULL); -} - -void -focusstack(const Arg *arg) -{ - Client *c = NULL, *i; - - if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) - return; - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - if (c) { - focus(c); - restack(selmon); - } -} - -Atom -getatomprop(Client *c, Atom prop) -{ - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; - XFree(p); - } - return atom; -} - -int -getrootptr(int *x, int *y) -{ - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long -getstate(Window w) -{ - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -int -gettextprop(Window w, Atom atom, char *text, unsigned int size) -{ - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) { - strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void -grabbuttons(Client *c, int focused) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, - BUTTONMASK, GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, - buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, - GrabModeAsync, GrabModeSync, None, None); - } -} - -void -grabkeys(void) -{ - updatenumlockmask(); - { - unsigned int i, j, k; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - int start, end, skip; - KeySym *syms; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XDisplayKeycodes(dpy, &start, &end); - syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip); - if (!syms) - return; - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(keys); i++) - /* skip modifier codes, we do that ourselves */ - if (keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, - keys[i].mod | modifiers[j], - root, True, - GrabModeAsync, GrabModeAsync); - XFree(syms); - } -} - -void -incnmaster(const Arg *arg) -{ - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - -#ifdef XINERAMA -static int -isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -{ - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org - && unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void -keypress(XEvent *e) -{ - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for (i = 0; i < LENGTH(keys); i++) - if (keysym == keys[i].keysym - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) - && keys[i].func) - keys[i].func(&(keys[i].arg)); -} - -void -killclient(const Arg *arg) -{ - if (!selmon->sel) - return; - if (!sendevent(selmon->sel, wmatom[WMDelete])) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } -} - -void -loadxrdb() -{ - Display *display; - char * resm; - XrmDatabase xrdb; - char *type; - XrmValue value; - - display = XOpenDisplay(NULL); - - if (display != NULL) { - resm = XResourceManagerString(display); - - if (resm != NULL) { - xrdb = XrmGetStringDatabase(resm); - - if (xrdb != NULL) { - XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor); - XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor); - XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor); - XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor); - XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor); - XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor); - } - } - } - - XCloseDisplay(display); -} - -void -manage(Window w, XWindowAttributes *wa) -{ - Client *c, *t = NULL; - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - - updatetitle(c); - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - } else { - c->mon = selmon; - applyrules(c); - } - - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) - c->x = c->mon->wx + c->mon->ww - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) - c->y = c->mon->wy + c->mon->wh - HEIGHT(c); - c->x = MAX(c->x, c->mon->wx); - c->y = MAX(c->y, c->mon->wy); - c->bw = borderpx; - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - configure(c); /* propagates border_width, if size doesn't change */ - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); - c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; - c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - attach(c); - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ - setclientstate(c, NormalState); - if (c->mon == selmon) - unfocus(selmon->sel, 0); - c->mon->sel = c; - arrange(c->mon); - XMapWindow(dpy, c->win); - focus(NULL); -} - -void -mappingnotify(XEvent *e) -{ - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void -maprequest(XEvent *e) -{ - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -void -monocle(Monitor *m) -{ - unsigned int n = 0; - Client *c; - - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} - -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - -void -movemouse(const Arg *arg) -{ - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, nx, ny, c->w, c->h, 1); - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -Client * -nexttiled(Client *c) -{ - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); - return c; -} - -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - -void -propertynotify(XEvent *e) -{ - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) - return; /* ignore */ - else if ((c = wintoclient(ev->window))) { - switch(ev->atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - c->hintsvalid = 0; - break; - case XA_WM_HINTS: - updatewmhints(c); - drawbars(); - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - if (ev->atom == netatom[NetWMWindowType]) - updatewindowtype(c); - } -} - -void -quit(const Arg *arg) -{ - running = 0; -} - -Monitor * -recttomon(int x, int y, int w, int h) -{ - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void -resize(Client *c, int x, int y, int w, int h, int interact) -{ - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void -resizeclient(Client *c, int x, int y, int w, int h) -{ - XWindowChanges wc; - - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; - if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) - || &monocle == c->mon->lt[c->mon->sellt]->arrange) - && !c->isfullscreen && !c->isfloating) { - c->w = wc.width += c->bw * 2; - c->h = wc.height += c->bw * 2; - wc.border_width = 0; - } - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -} - -void -resizemouse(const Arg *arg) -{ - int ocx, ocy, nw, nh; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - break; - } - } while (ev.type != ButtonRelease); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -void -restack(Monitor *m) -{ - Client *c; - XEvent ev; - XWindowChanges wc; - - drawbar(m); - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - wc.sibling = m->barwin; - for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { - XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void -run(void) -{ - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ -} - -void -scan(void) -{ - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) - || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) - continue; - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) - && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - if (wins) - XFree(wins); - } -} - -void -sendmon(Client *c, Monitor *m) -{ - if (c->mon == m) - return; - unfocus(c, 1); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - focus(NULL); - arrange(NULL); -} - -void -setclientstate(Client *c, long state) -{ - long data[] = { state, None }; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int -sendevent(Client *c, Atom proto) -{ - int n; - Atom *protocols; - int exists = 0; - XEvent ev; - - if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - if (exists) { - ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = proto; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); - } - return exists; -} - -void -setfocus(Client *c) -{ - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } - sendevent(c, wmatom[WMTakeFocus]); -} - -void -setfullscreen(Client *c, int fullscreen) -{ - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (!fullscreen && c->isfullscreen){ - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } -} - -void -setgaps(const Arg *arg) -{ - if ((arg->i == 0) || (selmon->gappx + arg->i < 0)) - selmon->gappx = 0; - else - selmon->gappx += arg->i; - arrange(selmon); -} - -void -setlayout(const Arg *arg) -{ - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; - if (arg && arg->v) - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; - arrange(selmon); -} - -void -setup(void) -{ - int i; - XSetWindowAttributes wa; - Atom utf8string; - struct sigaction sa; - - /* do not transform children into zombies when they terminate */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); - - /* clean up any zombies (inherited from .xinitrc etc) immediately */ - while (waitpid(-1, NULL, WNOHANG) > 0); - - /* init screen */ - screen = DefaultScreen(dpy); - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - drw = drw_create(dpy, screen, root, sw, sh); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - /* init bars */ - updatebars(); - updatestatus(); - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "dwm", 3); - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) netatom, NetLast); - XDeleteProperty(dpy, root, netatom[NetClientList]); - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask - |ButtonPressMask|PointerMotionMask|EnterWindowMask - |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - grabkeys(); - focus(NULL); -} - -void -seturgent(Client *c, int urg) -{ - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void -showhide(Client *c) -{ - if (!c) - return; - if (ISVISIBLE(c)) { - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -void -spawn(const Arg *arg) -{ - struct sigaction sa; - - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_DFL; - sigaction(SIGCHLD, &sa, NULL); - - execvp(((char **)arg->v)[0], (char **)arg->v); - die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); - } -} - -void -tag(const Arg *arg) -{ - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); - } -} - -void -tagmon(const Arg *arg) -{ - if (!selmon->sel || !mons->next) - return; - sendmon(selmon->sel, dirtomon(arg->i)); -} - -void -tile(Monitor *m) -{ - unsigned int i, n, h, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww - m->gappx; - for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; - resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0); - if (my + HEIGHT(c) + m->gappx < m->wh) - my += HEIGHT(c) + m->gappx; - } else { - h = (m->wh - ty) / (n - i) - m->gappx; - resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0); - if (ty + HEIGHT(c) + m->gappx < m->wh) - ty += HEIGHT(c) + m->gappx; - } -} - -void -togglebar(const Arg *arg) -{ - selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; - updatebarpos(selmon); - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - arrange(selmon); -} - -void -togglefloating(const Arg *arg) -{ - if (!selmon->sel) - return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; - selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, - selmon->sel->w, selmon->sel->h, 0); - arrange(selmon); -} - -void -toggletag(const Arg *arg) -{ - unsigned int newtags; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - arrange(selmon); - } -} - -void -toggleview(const Arg *arg) -{ - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); - int i; - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - - if (newtagset == ~0) { - selmon->pertag->prevtag = selmon->pertag->curtag; - selmon->pertag->curtag = 0; - } - - /* test if the user did not select the same tag */ - if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { - selmon->pertag->prevtag = selmon->pertag->curtag; - for (i = 0; !(newtagset & 1 << i); i++) ; - selmon->pertag->curtag = i + 1; - } - - /* apply settings for this view */ - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) - togglebar(NULL); - - focus(NULL); - arrange(selmon); - } -} - -void -unfocus(Client *c, int setfocus) -{ - if (!c) - return; - grabbuttons(c, 0); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void -unmanage(Client *c, int destroyed) -{ - Monitor *m = c->mon; - XWindowChanges wc; - - detach(c); - detachstack(c); - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XSelectInput(dpy, c->win, NoEventMask); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - free(c); - focus(NULL); - updateclientlist(); - arrange(m); -} - -void -unmapnotify(XEvent *e) -{ - Client *c; - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - } -} - -void -updatebars(void) -{ - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask|ExposureMask - }; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -} - -void -updatebarpos(Monitor *m) -{ - m->wy = m->my; - m->wh = m->mh; - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; -} - -void -updateclientlist(void) -{ - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); -} - -int -updategeom(void) -{ - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++); - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - - /* new monitors if nn > n */ - for (i = n; i < nn; i++) { - for (m = mons; m && m->next; m = m->next); - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) - if (i >= n - || unique[i].x_org != m->mx || unique[i].y_org != m->my - || unique[i].width != m->mw || unique[i].height != m->mh) - { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - /* removed monitors if n > nn */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next); - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void -updatenumlockmask(void) -{ - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] - == XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void -updatesizehints(Client *c) -{ - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - size.flags = PSize; - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); - c->hintsvalid = 1; -} - -void -updatestatus(void) -{ - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - drawbar(selmon); -} - -void -updatetitle(Client *c) -{ - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); -} - -void -updatewindowtype(Client *c) -{ - Atom state = getatomprop(c, netatom[NetWMState]); - Atom wtype = getatomprop(c, netatom[NetWMWindowType]); - - if (state == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - if (wtype == netatom[NetWMWindowTypeDialog]) - c->isfloating = 1; -} - -void -updatewmhints(Client *c) -{ - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -void -view(const Arg *arg) -{ - int i; - unsigned int tmptag; - - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) { - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - selmon->pertag->prevtag = selmon->pertag->curtag; - - if (arg->ui == ~0) - selmon->pertag->curtag = 0; - else { - for (i = 0; !(arg->ui & 1 << i); i++) ; - selmon->pertag->curtag = i + 1; - } - } else { - tmptag = selmon->pertag->prevtag; - selmon->pertag->prevtag = selmon->pertag->curtag; - selmon->pertag->curtag = tmptag; - } - - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) - togglebar(NULL); - - focus(NULL); - arrange(selmon); -} - -Client * -wintoclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Monitor * -wintomon(Window w) -{ - int x, y; - Client *c; - Monitor *m; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - if (w == m->barwin) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int -xerror(Display *dpy, XErrorEvent *ee) -{ - if (ee->error_code == BadWindow - || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) - || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) - || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) - || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) - || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabButton && ee->error_code == BadAccess) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) - || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int -xerrordummy(Display *dpy, XErrorEvent *ee) -{ - return 0; -} - -/* Startup Error handler to check if another window manager - * is already running. */ -int -xerrorstart(Display *dpy, XErrorEvent *ee) -{ - die("dwm: another window manager is already running"); - return -1; -} - -void -xrdb(const Arg *arg) -{ - loadxrdb(); - int i; - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - focus(NULL); - arrange(NULL); -} - -void -zoom(const Arg *arg) -{ - Client *c = selmon->sel; - - if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) - return; - if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) - return; - pop(c); -} - -int -main(int argc, char *argv[]) -{ - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - checkotherwm(); - XrmInitialize(); - loadxrdb(); - setup(); -#ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) - die("pledge"); -#endif /* __OpenBSD__ */ - scan(); - run(); - cleanup(); - XCloseDisplay(dpy); - return EXIT_SUCCESS; -} diff --git a/dwm/dwm/dwm.o b/dwm/dwm/dwm.o deleted file mode 100644 index 7ef06b1..0000000 Binary files a/dwm/dwm/dwm.o and /dev/null differ diff --git a/dwm/dwm/dwm.png b/dwm/dwm/dwm.png deleted file mode 100644 index b1f9ba7..0000000 Binary files a/dwm/dwm/dwm.png and /dev/null differ diff --git a/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff b/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff deleted file mode 100644 index 03ea9ef..0000000 --- a/dwm/dwm/patches/dwm-alwayscenter-20200625-f04cac6.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff -up dwm/dwm.c dwmmod/dwm.c ---- dwm/dwm.c 2020-06-25 00:21:30.383692180 -0300 -+++ dwmmod/dwm.c 2020-06-25 00:20:35.643692330 -0300 -@@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa) - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); -+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; -+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) diff --git a/dwm/dwm/patches/dwm-fullgaps-6.4.diff b/dwm/dwm/patches/dwm-fullgaps-6.4.diff deleted file mode 100644 index dc52139..0000000 --- a/dwm/dwm/patches/dwm-fullgaps-6.4.diff +++ /dev/null @@ -1,94 +0,0 @@ -diff -up a/config.def.h b/config.def.h ---- a/config.def.h -+++ b/config.def.h -@@ -2,6 +2,7 @@ - - /* appearance */ - static const unsigned int borderpx = 1; /* border pixel of windows */ -+static const unsigned int gappx = 5; /* gaps between windows */ - static const unsigned int snap = 32; /* snap pixel */ - static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ -@@ -85,6 +86,9 @@ static const Key keys[] = { - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, -+ { MODKEY, XK_minus, setgaps, {.i = -1 } }, -+ { MODKEY, XK_equal, setgaps, {.i = +1 } }, -+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) -diff -up a/dwm.c b/dwm.c ---- a/dwm.c 2023-04-30 -+++ b/dwm.c 2023-04-30 -@@ -119,6 +119,7 @@ struct Monitor { - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ -+ int gappx; /* gaps between windows */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; -@@ -200,6 +201,7 @@ static void sendmon(Client *c, Monitor * - static void setclientstate(Client *c, long state); - static void setfocus(Client *c); - static void setfullscreen(Client *c, int fullscreen); -+static void setgaps(const Arg *arg); - static void setlayout(const Arg *arg); - static void setmfact(const Arg *arg); - static void setup(void); -@@ -641,6 +643,7 @@ createmon(void) - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; -+ m->gappx = gappx; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -@@ -1508,6 +1511,16 @@ setfullscreen(Client *c, int fullscreen) - } - - void -+setgaps(const Arg *arg) -+{ -+ if ((arg->i == 0) || (selmon->gappx + arg->i < 0)) -+ selmon->gappx = 0; -+ else -+ selmon->gappx += arg->i; -+ arrange(selmon); -+} -+ -+void - setlayout(const Arg *arg) - { - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) -@@ -1697,18 +1710,18 @@ tile(Monitor *m) - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else -- mw = m->ww; -- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -- if (i < m->nmaster) { -- h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- if (my + HEIGHT(c) < m->wh) -- my += HEIGHT(c); -+ mw = m->ww - m->gappx; -+ for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ if (i < m->nmaster) { -+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; -+ resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0); -+ if (my + HEIGHT(c) + m->gappx < m->wh) -+ my += HEIGHT(c) + m->gappx; - } else { -- h = (m->wh - ty) / (n - i); -- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- if (ty + HEIGHT(c) < m->wh) -- ty += HEIGHT(c); -+ h = (m->wh - ty) / (n - i) - m->gappx; -+ resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0); -+ if (ty + HEIGHT(c) + m->gappx < m->wh) -+ ty += HEIGHT(c) + m->gappx; - } - } diff --git a/dwm/dwm/patches/dwm-noborder-6.2.diff b/dwm/dwm/patches/dwm-noborder-6.2.diff deleted file mode 100644 index f381eb8..0000000 --- a/dwm/dwm/patches/dwm-noborder-6.2.diff +++ /dev/null @@ -1,30 +0,0 @@ -From 9102fdb9c670218373bbe83c891c8e8138d6a6f4 Mon Sep 17 00:00:00 2001 -From: redacted -Date: Tue, 23 Apr 2019 00:39:27 +0100 -Subject: [PATCH] added noborder patch - ---- - dwm.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/dwm.c b/dwm.c -index 4465af1..685eca1 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -1282,6 +1282,13 @@ resizeclient(Client *c, int x, int y, int w, int h) - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; -+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) -+ || &monocle == c->mon->lt[c->mon->sellt]->arrange) -+ && !c->isfullscreen && !c->isfloating) { -+ c->w = wc.width += c->bw * 2; -+ c->h = wc.height += c->bw * 2; -+ wc.border_width = 0; -+ } - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); --- -2.21.0 - diff --git a/dwm/dwm/patches/dwm-pertag-6.2.diff b/dwm/dwm/patches/dwm-pertag-6.2.diff deleted file mode 100644 index d753727..0000000 --- a/dwm/dwm/patches/dwm-pertag-6.2.diff +++ /dev/null @@ -1,177 +0,0 @@ -diff --git a/dwm.c b/dwm.c -index 4465af1..6474055 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -111,6 +111,7 @@ typedef struct { - void (*arrange)(Monitor *); - } Layout; - -+typedef struct Pertag Pertag; - struct Monitor { - char ltsymbol[16]; - float mfact; -@@ -130,6 +131,7 @@ struct Monitor { - Monitor *next; - Window barwin; - const Layout *lt[2]; -+ Pertag *pertag; - }; - - typedef struct { -@@ -271,6 +273,15 @@ static Window root, wmcheckwin; - /* configuration, allows nested code to access above variables */ - #include "config.h" - -+struct Pertag { -+ unsigned int curtag, prevtag; /* current and previous tag */ -+ int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ -+ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ -+ unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ -+ const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ -+ int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ -+}; -+ - /* compile-time check if all tags fit into an unsigned int bit array. */ - struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; - -@@ -631,6 +642,7 @@ Monitor * - createmon(void) - { - Monitor *m; -+ unsigned int i; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; -@@ -641,6 +653,20 @@ createmon(void) - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -+ m->pertag = ecalloc(1, sizeof(Pertag)); -+ m->pertag->curtag = m->pertag->prevtag = 1; -+ -+ for (i = 0; i <= LENGTH(tags); i++) { -+ m->pertag->nmasters[i] = m->nmaster; -+ m->pertag->mfacts[i] = m->mfact; -+ -+ m->pertag->ltidxs[i][0] = m->lt[0]; -+ m->pertag->ltidxs[i][1] = m->lt[1]; -+ m->pertag->sellts[i] = m->sellt; -+ -+ m->pertag->showbars[i] = m->showbar; -+ } -+ - return m; - } - -@@ -966,7 +992,7 @@ grabkeys(void) - void - incnmaster(const Arg *arg) - { -- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); -+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); - } - -@@ -1501,9 +1527,9 @@ void - setlayout(const Arg *arg) - { - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) -- selmon->sellt ^= 1; -+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; - if (arg && arg->v) -- selmon->lt[selmon->sellt] = (Layout *)arg->v; -+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); -@@ -1522,7 +1548,7 @@ setmfact(const Arg *arg) - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.1 || f > 0.9) - return; -- selmon->mfact = f; -+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; - arrange(selmon); - } - -@@ -1699,7 +1725,7 @@ tile(Monitor *m) - void - togglebar(const Arg *arg) - { -- selmon->showbar = !selmon->showbar; -+ selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; - updatebarpos(selmon); - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - arrange(selmon); -@@ -1738,9 +1764,33 @@ void - toggleview(const Arg *arg) - { - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); -+ int i; - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; -+ -+ if (newtagset == ~0) { -+ selmon->pertag->prevtag = selmon->pertag->curtag; -+ selmon->pertag->curtag = 0; -+ } -+ -+ /* test if the user did not select the same tag */ -+ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { -+ selmon->pertag->prevtag = selmon->pertag->curtag; -+ for (i = 0; !(newtagset & 1 << i); i++) ; -+ selmon->pertag->curtag = i + 1; -+ } -+ -+ /* apply settings for this view */ -+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; -+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; -+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; -+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; -+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; -+ -+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) -+ togglebar(NULL); -+ - focus(NULL); - arrange(selmon); - } -@@ -2035,11 +2085,37 @@ updatewmhints(Client *c) - void - view(const Arg *arg) - { -+ int i; -+ unsigned int tmptag; -+ - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ -- if (arg->ui & TAGMASK) -+ if (arg->ui & TAGMASK) { - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; -+ selmon->pertag->prevtag = selmon->pertag->curtag; -+ -+ if (arg->ui == ~0) -+ selmon->pertag->curtag = 0; -+ else { -+ for (i = 0; !(arg->ui & 1 << i); i++) ; -+ selmon->pertag->curtag = i + 1; -+ } -+ } else { -+ tmptag = selmon->pertag->prevtag; -+ selmon->pertag->prevtag = selmon->pertag->curtag; -+ selmon->pertag->curtag = tmptag; -+ } -+ -+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; -+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; -+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; -+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; -+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; -+ -+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) -+ togglebar(NULL); -+ - focus(NULL); - arrange(selmon); - } diff --git a/dwm/dwm/patches/dwm-xrdb-6.4.diff b/dwm/dwm/patches/dwm-xrdb-6.4.diff deleted file mode 100644 index 929b4e6..0000000 --- a/dwm/dwm/patches/dwm-xrdb-6.4.diff +++ /dev/null @@ -1,203 +0,0 @@ -From e7c65d2ce902a19a20daa751b42f8ba0209fdb61 Mon Sep 17 00:00:00 2001 -From: NekoCWD -Date: Sun, 22 Jan 2023 23:42:57 +0300 -Subject: [PATCH] [dwm] xrdb update 6.4 - ---- - config.def.h | 22 ++++++++++--------- - drw.c | 2 +- - drw.h | 2 +- - dwm.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 76 insertions(+), 12 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 061ad66..686b947 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -7,15 +7,16 @@ static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ - static const char *fonts[] = { "monospace:size=10" }; - static const char dmenufont[] = "monospace:size=10"; --static const char col_gray1[] = "#222222"; --static const char col_gray2[] = "#444444"; --static const char col_gray3[] = "#bbbbbb"; --static const char col_gray4[] = "#eeeeee"; --static const char col_cyan[] = "#005577"; --static const char *colors[][3] = { -- /* fg bg border */ -- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -+static char normbgcolor[] = "#222222"; -+static char normbordercolor[] = "#444444"; -+static char normfgcolor[] = "#bbbbbb"; -+static char selfgcolor[] = "#eeeeee"; -+static char selbordercolor[] = "#005577"; -+static char selbgcolor[] = "#005577"; -+static char *colors[][3] = { -+ /* fg bg border */ -+ [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, -+ [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, - }; - - /* tagging */ -@@ -56,7 +57,7 @@ static const Layout layouts[] = { - #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - - /* commands */ --static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -+static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL }; - static const char *termcmd[] = { "st", NULL }; - - static const Key keys[] = { -@@ -84,6 +85,7 @@ static const Key keys[] = { - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, -+ { MODKEY, XK_F5, xrdb, {.v = NULL } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) -diff --git a/drw.c b/drw.c -index a58a2b4..f8a82f5 100644 ---- a/drw.c -+++ b/drw.c -@@ -195,7 +195,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname) - /* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ - Clr * --drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) -+drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount) - { - size_t i; - Clr *ret; -diff --git a/drw.h b/drw.h -index 6471431..bdbf950 100644 ---- a/drw.h -+++ b/drw.h -@@ -40,7 +40,7 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in - - /* Colorscheme abstraction */ - void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); --Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); -+Clr *drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount); - - /* Cursor abstraction */ - Cur *drw_cur_create(Drw *drw, int shape); -diff --git a/dwm.c b/dwm.c -index e5efb6a..3fe76be 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - #include - #ifdef XINERAMA - #include -@@ -56,6 +57,21 @@ - #define HEIGHT(X) ((X)->h + 2 * (X)->bw) - #define TAGMASK ((1 << LENGTH(tags)) - 1) - #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) -+#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \ -+ if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \ -+ int i = 1; \ -+ for (; i <= 6; i++) { \ -+ if (value.addr[i] < 48) break; \ -+ if (value.addr[i] > 57 && value.addr[i] < 65) break; \ -+ if (value.addr[i] > 70 && value.addr[i] < 97) break; \ -+ if (value.addr[i] > 102) break; \ -+ } \ -+ if (i == 7) { \ -+ strncpy(V, value.addr, 7); \ -+ V[7] = '\0'; \ -+ } \ -+ } \ -+ } - - /* enums */ - enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -@@ -178,6 +194,7 @@ static void grabkeys(void); - static void incnmaster(const Arg *arg); - static void keypress(XEvent *e); - static void killclient(const Arg *arg); -+static void loadxrdb(void); - static void manage(Window w, XWindowAttributes *wa); - static void mappingnotify(XEvent *e); - static void maprequest(XEvent *e); -@@ -233,6 +250,7 @@ static Monitor *wintomon(Window w); - static int xerror(Display *dpy, XErrorEvent *ee); - static int xerrordummy(Display *dpy, XErrorEvent *ee); - static int xerrorstart(Display *dpy, XErrorEvent *ee); -+static void xrdb(const Arg *arg); - static void zoom(const Arg *arg); - - /* variables */ -@@ -1019,6 +1037,37 @@ killclient(const Arg *arg) - } - } - -+void -+loadxrdb() -+{ -+ Display *display; -+ char * resm; -+ XrmDatabase xrdb; -+ char *type; -+ XrmValue value; -+ -+ display = XOpenDisplay(NULL); -+ -+ if (display != NULL) { -+ resm = XResourceManagerString(display); -+ -+ if (resm != NULL) { -+ xrdb = XrmGetStringDatabase(resm); -+ -+ if (xrdb != NULL) { -+ XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor); -+ XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor); -+ XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor); -+ XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor); -+ XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor); -+ XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor); -+ } -+ } -+ } -+ -+ XCloseDisplay(display); -+} -+ - void - manage(Window w, XWindowAttributes *wa) - { -@@ -2110,6 +2159,17 @@ xerrorstart(Display *dpy, XErrorEvent *ee) - return -1; - } - -+void -+xrdb(const Arg *arg) -+{ -+ loadxrdb(); -+ int i; -+ for (i = 0; i < LENGTH(colors); i++) -+ scheme[i] = drw_scm_create(drw, colors[i], 3); -+ focus(NULL); -+ arrange(NULL); -+} -+ - void - zoom(const Arg *arg) - { -@@ -2134,6 +2194,8 @@ main(int argc, char *argv[]) - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - checkotherwm(); -+ XrmInitialize(); -+ loadxrdb(); - setup(); - #ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) --- -2.38.2 - diff --git a/dwm/dwm/transient.c b/dwm/dwm/transient.c deleted file mode 100644 index 040adb5..0000000 --- a/dwm/dwm/transient.c +++ /dev/null @@ -1,42 +0,0 @@ -/* cc transient.c -o transient -lX11 */ - -#include -#include -#include -#include - -int main(void) { - Display *d; - Window r, f, t = None; - XSizeHints h; - XEvent e; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - r = DefaultRootWindow(d); - - f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); - h.min_width = h.max_width = h.min_height = h.max_height = 400; - h.flags = PMinSize | PMaxSize; - XSetWMNormalHints(d, f, &h); - XStoreName(d, f, "floating"); - XMapWindow(d, f); - - XSelectInput(d, f, ExposureMask); - while (1) { - XNextEvent(d, &e); - - if (t == None) { - sleep(5); - t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); - XSetTransientForHint(d, t, f); - XStoreName(d, t, "transient"); - XMapWindow(d, t); - XSelectInput(d, t, ExposureMask); - } - } - - XCloseDisplay(d); - exit(0); -} diff --git a/dwm/dwm/util.c b/dwm/dwm/util.c deleted file mode 100644 index 96b82c9..0000000 --- a/dwm/dwm/util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} diff --git a/dwm/dwm/util.h b/dwm/dwm/util.h deleted file mode 100644 index f633b51..0000000 --- a/dwm/dwm/util.h +++ /dev/null @@ -1,8 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); diff --git a/dwm/dwm/util.o b/dwm/dwm/util.o deleted file mode 100644 index 804cda6..0000000 Binary files a/dwm/dwm/util.o and /dev/null differ diff --git a/dwm/dwmbar/COPYING b/dwm/dwmbar/COPYING deleted file mode 100644 index f288702..0000000 --- a/dwm/dwmbar/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - 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 -. diff --git a/dwm/dwmbar/README.md b/dwm/dwmbar/README.md deleted file mode 100644 index c252d8c..0000000 --- a/dwm/dwmbar/README.md +++ /dev/null @@ -1,166 +0,0 @@ -dwmbar - A Modular Status Bar for dwm -===================================== -![Example image](res/example.png) - -dwmbar is a very simple status bar written for dwm. - -**This project is no longer actively maintained. You will likely not receive support from the devs if something's not right. If you are somebody who is interested in taking over this project, please contact me (thytom) and we can discuss adding you as a contributor. You are also more than welcome to fork the project if you wish to make improvements on your own.** - -# Installation - -## Prerequisites - -While some modules will work without these dependencies, we recommend grabbing -the ones you want for specific modules. - -Highly Recommended: -* Any patched Nerd Font for icons. - -Optional (By module): - -See [module prerequisites](#module-prerequisites). - - -## Arch Linux - -There is an [AUR package](https://aur.archlinux.org/packages/dwmbar-git) for -dwmbar, which can be installed with your favourite aur helper, or manually. - -Please see the [archwiki -page](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages) -for how to manually install AUR packages. - -## Manual Installation - -```bash -$ git clone https://github.com/thytom/dwmbar -$ cd dwmbar -$ sudo ./install.sh -``` -# Usage - -dwmbar works by setting the root window name, which dwm displays. It does this -by calling the dwmbarrc file in your .config/dwmbar folder. - -Add the line `dwmbar &` to your .xinitrc file to run on startup. You can also -run `dwmbar` in terminal for testing purposes. - -# Customisation - -## Configuring the Bar - -Most non-modular configuration is done in `~/.config/dwmbar/dwmbarrc`, a bash -script that calls scripts in turn, caching their output and then constructing -the bar from that. - -To add a module to the bar, simply include its name in the MODULES variable: - -```bash -MODULES="mpd volumebar wifi battery" -``` - -Modules are displayed left-to-right in the order they are written in `MODULES`. -By default, they are delimited by the `SEPARATOR` variable, which you can -change. - -We also offer a `PADDING` variable, which contains a string you can include at -the start of your bar, on the very right. This can either be padding spaces, to -move the bar away from the right edge, or even text. By default, we set -`PADDING` to `$USER@$HOSTNAME`. Feel free to change this. - -## Writing Modules - -Default modules are located within `/usr/share/dwmbar/modules`, and custom -modules can be placed in `~/.config/dwmbar/modules/custom`. If a default module -exists with the same name as a custom module, then the custom module will take -precedence. - -**Default modules will possibly be overwritten during updates, so if you want -to modify them be sure to make a copy in the custom folder, which will not be -touched, and edit it there.** - -Modules can be written in any language, so long as they are executable and -print their output to stdout. - -Currently available default modules are: -- archupdates - Gets the number of updates available **Arch Linux Only** -- backlight - Shows the brightness of the screen -- battery - Gets battery percentage -- bluetooth - Shows bluetooth status -- cpuload - Shows the CPU load in % -- date - Shows the calendar date -- daypercentage - Shows how far through the day you are, in % -- disksize - Shows the disk usage -- ethernet - Shows ethernet connection -- fanspeed - Shows the rpm of your main fan -- hostname - Shows your current user and hostname -- internet - Shows whether internet is available (TODO) -- kernel - Shows the kernel version -- localip - Shows your local IP address -- mail - Shows how much mail you have -- mpd - Shows MPD status -- networkdowntraffic - Gets the download traffic in Kb/s -- networkuptraffic - Gets the upload traffic in Kb/s -- publicip - Shows your public IP address -- ram - Shows RAM usage -- redshift - Shows current screen temperature from Redshift -- sunmoon - Displays a sun or moon for time of day -- temperature - Displays the temperature of the CPU -- time - Displays time -- todo - Prints the number of todos for the "t" todo manager -- tor - Prints if the tor service is enabled -- voidupdates - Gets the number of updates available **Void Linux Only** -- volumebar - Displays a volume bar -- volume - Prints volume in % -- weather - Shows weather info -- wifi - Shows wifi connection - -## Module Prerequisites - -See Module Dependencies - * archupdates - - Arch Linux - - yay - - pacman-contrib -* backlight - - light -* bluetooth - - bluez -* fanspeed - - lm_sensors -* mail - - mutt/neomutt (We recommend [Luke Smith's Mutt-Wizard](https://github.com/LukeSmithxyz/mutt-wizard)) for configuration. -* mpd - - mpd - - mpc -* publicip - - curl -* redshift - - redshift -* sunmoon - - redshift -* temperature - - lm_sensors -* todo - - [t todo manager](https://github.com/sjl/t) -* tor - - tor -* voidupdates - - xbps package manager -* volume - - pulseaudio -* volumebar - - pulseaudio -* weather - - curl - - Internet connection -* wifi - - Wifi card - -# Feature Wishlist - -* Paralellised Modules - - Some modules are slower than others. Have modules set a DELAY variable; - if they don't have one, use a default. - - Modules are called and bar is updated when a module finishes, but an - internal bar clock updates the clock at a specific delay. diff --git a/dwm/dwmbar/bar.sh b/dwm/dwmbar/bar.sh deleted file mode 100755 index f396834..0000000 --- a/dwm/dwmbar/bar.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Archie Hilton - -# 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 . -if [[ ! -z $CACHE_DIR ]]; then - OUTPUT_CACHE="$CACHE_DIR" -else - OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/" -fi - -source "$CONFIG_FILE" - -OUTPUT="" - -get_bar() -{ - for module in $MODULES; do - if [[ $INTERNET -eq 0 ]] || [[ $ONLINE_MODULES != *"$module"* ]];then - module_out="$(cat "$OUTPUT_CACHE""$module" | sed 's/\.$//g')" - bar="$bar$module_out" - fi - done - # Uncomment to remove last separator - # bar="$(echo "$bar" | sed 's/.$//g')" - echo "$LEFT_PADDING${bar::-2}$RIGHT_PADDING" -} - -run_module() -{ - if [[ -f "$CUSTOM_DIR$1" ]] - then - out="$("$CUSTOM_DIR""$1")" - else - out="$("$DEFAULT_MODULES_DIR""$1")" - fi - - if [[ "$out" = " " ]]; then - echo "" > "$OUTPUT_CACHE$module" - elif [[ ! "$out" = "" ]]; then - out="$out$SEPARATOR." - echo "$out" > "$OUTPUT_CACHE$module" - fi -} - -run() -{ - for module in $MODULES; do - [[ ! -f "$OUTPUT_CACHE$module" ]] && touch "$OUTPUT_CACHE$module" - pgrep "$module" &> /dev/null - notrunning=$([[ $? -eq 1 ]]) - if $notrunning && [[ $INTERNET -eq 0 ]]; then - run_module "$module" - elif $notrunning && [[ $INTERNET -eq 1 ]]; then - [[ "$ONLINE_MODULES" != *"$module"* ]] && run_module "$module" - fi - done - - get_bar - sleep "$DELAY"; -} - -run diff --git a/dwm/dwmbar/config b/dwm/dwmbar/config deleted file mode 100644 index b89c22e..0000000 --- a/dwm/dwmbar/config +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# What modules, in what order -MODULES="weather volume disksize wifi internet cpuload ram cputemp date time" - -# Modules that require an active internet connection -ONLINE_MODULES="weather internet" - -# Delay between showing the status bar -DELAY="0.05" - -# Where the custom modules are stored -CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/" - -# Separator between modules -SEPARATOR=" | " - -# Padding at the end and beginning of the status bar -RIGHT_PADDING=" " -LEFT_PADDING=" " diff --git a/dwm/dwmbar/dwmbar b/dwm/dwmbar/dwmbar deleted file mode 100755 index ba0de22..0000000 --- a/dwm/dwmbar/dwmbar +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# Copyright 2019 Archie Hilton - -# 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 . - -VERSION="1.0" - -DEFAULT_CONFIG_DIR="/usr/share/dwmbar" -export DEFAULT_CONFIG_DIR -DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules/" -export DEFAULT_MODULES_DIR -DEFAULT_BAR_LOCATION="$DEFAULT_CONFIG_DIR/bar.sh" -export DEFAULT_BAR_LOCATION -DEFAULT_CONFIG_LOCATION="$DEFAULT_CONFIG_DIR/config" -export DEFAULT_CONFIG_LOCATION - -CONFIG_DIR="/home/$USER/.config/dwmbar/" -export CONFIG_DIR - -CUSTOM_DIR="$CONFIG_DIR/custom/" -export CUSTOM_DIR - -CONFIG_FILE="$CONFIG_DIR/config" -if [[ ! -f "$CONFIG_FILE" ]]; then - CONFIG_FILE=$DEFAULT_CONFIG_LOCATION -fi -export CONFIG_FILE - -CACHE_DIR="$HOME/.cache/dwmbar/" -export CACHE_DIR - -INTERNET=1 # No internet -export INTERNET - -print_help(){ - echo "dwmbar $VERSION --v Display this help message. --c Copy default files to /home/$USER/.config/dwmbar -" -} - -copy_usr_to_home(){ - mkdir -p "$CUSTOM_DIR" - cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" -} - -check_files(){ - if [[ ! -d "$DEFAULT_CONFIG_DIR" ]]; then - echo "$DEFAULT_CONFIG_DIR does not exist." > /dev/stderr - exit 1 - fi - - if [[ ! -d "$DEFAULT_MODULES_DIR" ]]; then - echo "$DEFAULT_MODULES_DIR does not exist." > /dev/stderr - exit 1 - fi - - if [[ ! -d "$CACHE_DIR" ]]; then - mkdir -p "$CACHE_DIR" - fi - - if [[ ! -f "$DEFAULT_BAR_LOCATION" ]]; then - echo "$DEFAULT_BAR_LOCATION does not exist." > /dev/stderr - exit 1 - fi - - if [[ ! -f "$DEFAULT_CONFIG_LOCATION" ]]; then - echo "$DEFAULT_CONFIG_LOCATION does not exist." > /dev/stderr - exit 1 - fi -} - -while getopts 'vc' flag; do - case "${flag}" in - v) print_help - exit 0 ;; - c) copy_usr_to_home - exit 0 ;; - esac -done - -check_internet() { - wget --spider -q --timeout=2 www.google.com - if [[ $? -eq 0 ]]; then - echo 0 - else - echo 1 - fi -} - -check_files - -while :; do - date=$(date +'%S') - if [ $(( 10#$date % 5 )) -eq 0 ]; then - INTERNET=$(check_internet) - fi - xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)" -done diff --git a/dwm/dwmbar/install.sh b/dwm/dwmbar/install.sh deleted file mode 100755 index eb26b1d..0000000 --- a/dwm/dwmbar/install.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Archie Hilton - -# 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 . - -DWMBAR="/usr/bin/dwmbar" - -if [ "$EUID" -ne 0 ] - then echo "Please run as root" > /dev/stderr - exit 1 -fi - -if [[ ! -f "dwmbar" ]]; then - echo "dwmbar executable not found." > /dev/stderr - exit 1 -fi - -# Create /usr/share/dwmbar -# Containing example bar.sh and modules - -mkdir --parents "/usr/share/dwmbar/" - -echo "./modules --> /usr/share/dwmbar/modules" -cp -rT "./modules" "/usr/share/dwmbar/modules" - -echo "./bar.sh --> /usr/share/dwmbar/bar.sh" -cp "./bar.sh" "/usr/share/dwmbar/bar.sh" - -echo "./config --> /usr/share/dwmbar/config" -cp -r "./config" "/usr/share/dwmbar/config" - -echo "./dwmbar --> /usr/bin/dwmbar" -cp "./dwmbar" "/usr/bin/dwmbar" -[[ $? -eq 0 ]] && echo "Installation completed successfully" diff --git a/dwm/dwmbar/modules/archupdates b/dwm/dwmbar/modules/archupdates deleted file mode 100755 index d4cbc44..0000000 --- a/dwm/dwmbar/modules/archupdates +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Prints out the number of pacman updates (Arch Linux) -# Requires an internet connection -# Depends on yay and checkupdates (pacman-contrib) -# Optional: add --devel flag to the yay cmd to check for *-git package updates. - -PREFIX=' Updates: ' - -get_updates() -{ - if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then - updates_arch=0 - fi - - if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then - updates_aur=0 - fi - - updates=$(("$updates_arch" + "$updates_aur")) - - echo "$PREFIX$updates" -} - -if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then - get_updates -fi diff --git a/dwm/dwmbar/modules/backlight b/dwm/dwmbar/modules/backlight deleted file mode 100755 index 2e4fe88..0000000 --- a/dwm/dwmbar/modules/backlight +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints the backlight percentage -# Requires the light package - -PREFIX='ﯧ' - -get_backlight() -{ - echo "$PREFIX $(light | sed 's/\..*//g')%" -} - -get_backlight diff --git a/dwm/dwmbar/modules/battery b/dwm/dwmbar/modules/battery deleted file mode 100755 index 737290b..0000000 --- a/dwm/dwmbar/modules/battery +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Prints out battery percentage - -CHARGING_ICON=' ' -WARNING_ICON=' ' -BATTERY_FULL_ICON='' -BATTERY_2_ICON='' -BATTERY_3_ICON='' -BATTERY_4_ICON='' - -FULL_AT=98 - -BAT_ICON="" -ICON="" - -get_battery() -{ - # The vast majority of people only use one battery. - - if [ -d /sys/class/power_supply/BAT0 ]; then - capacity=$(cat /sys/class/power_supply/BAT0/capacity) - charging=$(cat /sys/class/power_supply/BAT0/status) - if [[ "$charging" == "Charging" ]]; then - ICON="$CHARGING_ICON" - elif [[ $capacity -le 25 ]]; then - ICON="$WARNING_ICON" - fi - - if [[ $capacity -ge $FULL_AT ]]; then - BAT_ICON=$BATTERY_FULL_ICON - elif [[ $capacity -le 25 ]]; then - BAT_ICON=$BATTERY_4_ICON - elif [[ $capacity -le 60 ]]; then - BAT_ICON=$BATTERY_3_ICON - elif [[ $capacity -le $FULL_AT ]]; then - BAT_ICON=$BATTERY_2_ICON - fi - fi - echo "$ICON$BAT_ICON $capacity%" -} - -get_battery diff --git a/dwm/dwmbar/modules/bluetooth b/dwm/dwmbar/modules/bluetooth deleted file mode 100755 index 5dea2b0..0000000 --- a/dwm/dwmbar/modules/bluetooth +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Prints out the bluetooth status - -BLUETOOTH_ON_ICON='' -BLUETOOTH_OFF_ICON='' - -get_bluetooth() -{ - status=$(systemctl is-active bluetooth.service) - - if [ "$status" == "active" ] - then - echo "$BLUETOOTH_ON_ICON" - else - : - #echo "$BLUETOOTH_OFF_ICON" - fi -} - -get_bluetooth diff --git a/dwm/dwmbar/modules/cpuload b/dwm/dwmbar/modules/cpuload deleted file mode 100755 index 133a748..0000000 --- a/dwm/dwmbar/modules/cpuload +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Prints out the CPU load percentage - -PREFIX=' ' - -get_load() -{ - # Get the first line with aggregate of all CPUs - cpu_last=($(head -n1 /proc/stat)) - cpu_last_sum="${cpu_last[@]:1}" - cpu_last_sum=$((${cpu_last_sum// /+})) - - sleep 0.05 - - cpu_now=($(head -n1 /proc/stat)) - cpu_sum="${cpu_now[@]:1}" - cpu_sum=$((${cpu_sum// /+})) - - cpu_delta=$((cpu_sum - cpu_last_sum)) - cpu_idle=$((cpu_now[4]- cpu_last[4])) - cpu_used=$((cpu_delta - cpu_idle)) - cpu_usage=$((100 * cpu_used / cpu_delta)) - - # Keep this as last for our next read - cpu_last=("${cpu_now[@]}") - cpu_last_sum=$cpu_sum - - echo "$PREFIX $cpu_usage%" -} - -get_load diff --git a/dwm/dwmbar/modules/cputemp b/dwm/dwmbar/modules/cputemp deleted file mode 100755 index da8f183..0000000 --- a/dwm/dwmbar/modules/cputemp +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Gets temperature of the CPU -# Dependencies: lm_sensors - -PREFIX=' ' -FIRE=' ' - -WARNING_LEVEL=80 - -get_cputemp() -{ - # CPU_T=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon?/temp2_input) - # CPU_TEMP=$(expr $CPU_T / 1000) - - CPU_TEMP="$(sensors | grep temp1 | awk 'NR==1{gsub("+", " "); gsub("\\..", " "); print $2}')" - - if [ "$CPU_TEMP" -ge $WARNING_LEVEL ]; then - PREFIX="$FIRE$PREFIX" - fi - - echo "$PREFIX$CPU_TEMP°C" -} - -get_cputemp diff --git a/dwm/dwmbar/modules/date b/dwm/dwmbar/modules/date deleted file mode 100755 index cc5ccc2..0000000 --- a/dwm/dwmbar/modules/date +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints out the date - -PREFIX='' - -get_date() -{ - echo "$PREFIX $(date '+%d-%m-%y (%a)')" -} - -get_date diff --git a/dwm/dwmbar/modules/day_of_week b/dwm/dwmbar/modules/day_of_week deleted file mode 100755 index 160da42..0000000 --- a/dwm/dwmbar/modules/day_of_week +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints out the date - -PREFIX='' - -get_day() -{ - echo "$PREFIX $(date '+%a')" -} - -get_day diff --git a/dwm/dwmbar/modules/daypercentage b/dwm/dwmbar/modules/daypercentage deleted file mode 100755 index d97d6d8..0000000 --- a/dwm/dwmbar/modules/daypercentage +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 - -PREFIX = ' ' - -import datetime - -now = datetime.datetime.now() -minutes = now.hour * 60 + now.minute -percentage = round(minutes * 100 / 1440) - -print(PREFIX + str(percentage) + "%") diff --git a/dwm/dwmbar/modules/default_shell b/dwm/dwmbar/modules/default_shell deleted file mode 100755 index 913ccb2..0000000 --- a/dwm/dwmbar/modules/default_shell +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints out the name of the default shell - -PREFIX=' ' - -get_default_shell() -{ - echo "$PREFIX$(echo $SHELL |sed 's/.*\///g')" -} - -get_default_shell diff --git a/dwm/dwmbar/modules/disksize b/dwm/dwmbar/modules/disksize deleted file mode 100755 index 8284894..0000000 --- a/dwm/dwmbar/modules/disksize +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Prints out the total disk memory and the available memory - -PREFIX=' ' - -get_disk() -{ - TOTAL_SIZE=$( df -h --total | rg 230 | awk {'printf $2'}) - USED_SIZE=$(df -h --total | rg 230 | awk {'printf $3'}) - PERCENTAGE=$(df -h --total | rg 230 | awk {'printf $5'}) - - echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)" -} - -get_disk diff --git a/dwm/dwmbar/modules/ethernet b/dwm/dwmbar/modules/ethernet deleted file mode 100755 index 0ebe572..0000000 --- a/dwm/dwmbar/modules/ethernet +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Prints out if there is an ethernet cable connected - -ETHERNET_ICON='' - -get_ethernet() -{ - if [ -d /sys/class/net/eth? ]; then - if [ "$(cat /sys/class/net/eth?/carrier)" == "1" ]; then - echo "$ETHERNET_ICON" - fi - fi -} - -get_ethernet diff --git a/dwm/dwmbar/modules/fanspeed b/dwm/dwmbar/modules/fanspeed deleted file mode 100755 index 8cc4c52..0000000 --- a/dwm/dwmbar/modules/fanspeed +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints the fan RPM -# Depends on lm_sensors - -PREFIX=' ' - -get_fan_speed() -{ - echo "$PREFIX$(sensors | grep fan1 | awk 'NR==1{print $2}') RPM" -} - -get_fan_speed diff --git a/dwm/dwmbar/modules/hostname b/dwm/dwmbar/modules/hostname deleted file mode 100755 index 41ec4fa..0000000 --- a/dwm/dwmbar/modules/hostname +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints USER@hostname - -PREFIX=' ' - -get_hostname() -{ - echo "$PREFIX$USER@$(hostname)" -} - -get_hostname diff --git a/dwm/dwmbar/modules/internet b/dwm/dwmbar/modules/internet deleted file mode 100755 index 22cbd6a..0000000 Binary files a/dwm/dwmbar/modules/internet and /dev/null differ diff --git a/dwm/dwmbar/modules/kernel b/dwm/dwmbar/modules/kernel deleted file mode 100755 index 1ee3939..0000000 --- a/dwm/dwmbar/modules/kernel +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints out the kernel version - -PREFIX=' ' - -get_kernel() -{ - echo "$PREFIX$(uname -r)" -} - -get_kernel diff --git a/dwm/dwmbar/modules/localip b/dwm/dwmbar/modules/localip deleted file mode 100755 index 91a74c0..0000000 --- a/dwm/dwmbar/modules/localip +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Prints out your local IP - -PREFIX='ﯱ ' - -get_local_ip() -{ - IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g') - - echo "$PREFIX$IP" -} - -get_local_ip diff --git a/dwm/dwmbar/modules/mail b/dwm/dwmbar/modules/mail deleted file mode 100755 index 52660d5..0000000 --- a/dwm/dwmbar/modules/mail +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Prints number of unread mail -# Requires mutt/neomutt - -MAIL_DIR="/home/$USER/Mail/INBOX/new/*" -PREFIX=' :' - -get_mail() -{ - echo "$PREFIX$(du -a $MAIL_DIR 2>/dev/null | wc -l)" -} - -get_mail diff --git a/dwm/dwmbar/modules/mpd b/dwm/dwmbar/modules/mpd deleted file mode 100755 index ecbdd4e..0000000 --- a/dwm/dwmbar/modules/mpd +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -PREFIX_PLAY=' ' -PREFIX_PAUSE=' ' - -get_mpd() -{ - current_song="$(mpc current)" - - if [[ "$current_song" = "" ]]; then - echo " " - exit 0 - else - playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}') - if [[ "$playpause" = "[playing]" ]]; then - current_song="$PREFIX_PLAY $current_song" - elif [[ "$playpause" = "[paused]" ]]; then - current_song="$PREFIX_PAUSE $current_song" - fi - fi - - echo "$current_song" -} - -get_mpd diff --git a/dwm/dwmbar/modules/networkdowntraffic b/dwm/dwmbar/modules/networkdowntraffic deleted file mode 100755 index 76e8d8d..0000000 --- a/dwm/dwmbar/modules/networkdowntraffic +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Prints out the current down network traffic in MB - -PREFIX=' ' - -get_down_traffic() -{ - RECEIVE1=0 - RECEIVE2=0 - - IFACES=$(ip -o link show | awk -F': ' '{print $2}') - for IFACE in $IFACES; do - if [ $IFACE != "lo" ]; then - RECEIVE1=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECEIVE1)) - fi - done - - sleep 1 - - IFACES=$(ip -o link show | awk -F': ' '{print $2}') - for IFACE in $IFACES; do - if [ $IFACE != "lo" ]; then - RECEIVE2=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECEIVE2)) - fi - done - - echo "$PREFIX$(expr $(expr $RECEIVE2 - $RECEIVE1 ) / 1000)KB/s" -} - -get_down_traffic diff --git a/dwm/dwmbar/modules/networkuptraffic b/dwm/dwmbar/modules/networkuptraffic deleted file mode 100755 index 396e969..0000000 --- a/dwm/dwmbar/modules/networkuptraffic +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Prints out the current up network traffic in MB - -PREFIX=' ' - -get_up_traffic() -{ - TRANSMIT1=0 - TRANSMIT2=0 - - IFACES=$(ip -o link show | awk -F': ' '{print $2}') - for IFACE in $IFACES; do - if [ $IFACE != "lo" ]; then - TRANSMIT1=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT1)) - fi - done - - sleep 1 - - IFACES=$(ip -o link show | awk -F': ' '{print $2}') - for IFACE in $IFACES; do - if [ $IFACE != "lo" ]; then - TRANSMIT2=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT2)) - fi - done - - echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000)KB/s" -} - -get_up_traffic - diff --git a/dwm/dwmbar/modules/nvidia_gpu_temp b/dwm/dwmbar/modules/nvidia_gpu_temp deleted file mode 100755 index 5fc26e7..0000000 --- a/dwm/dwmbar/modules/nvidia_gpu_temp +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Gets temperature of the GPU -# Dependencies: nvidia drivers and nvidia-settings - -PREFIX=' ' -FIRE=' ' - -WARNING_LEVEL=80 - -get_gputemp() -{ - GPU_TEMP="$(nvidia-settings -q gpucoretemp -t | head -n 1)" - - if [ "$GPU_TEMP" -ge $WARNING_LEVEL ]; then - PREFIX="$FIRE$PREFIX" - fi - - echo "$PREFIX$GPU_TEMP°C" -} - -get_gputemp diff --git a/dwm/dwmbar/modules/os-release b/dwm/dwmbar/modules/os-release deleted file mode 100755 index 165a7c3..0000000 --- a/dwm/dwmbar/modules/os-release +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Prints out your OS name - -PREFIX=' ' - -get_os_name() -{ - OS=$(cat /etc/os-release | head -n 1 | sed 's/NAME=//g') - - echo "$PREFIX$OS" -} - -get_os_name diff --git a/dwm/dwmbar/modules/process_count b/dwm/dwmbar/modules/process_count deleted file mode 100755 index 7d4d0ca..0000000 --- a/dwm/dwmbar/modules/process_count +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Prints out your process count - -PREFIX=' ' - -get_proc_count() -{ - PROC_COUNT=$(ps -Al | wc -l) - - echo "$PREFIX$PROC_COUNT" -} - -get_proc_count diff --git a/dwm/dwmbar/modules/publicip b/dwm/dwmbar/modules/publicip deleted file mode 100755 index bdcb6a1..0000000 --- a/dwm/dwmbar/modules/publicip +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints out your public IP address -# Depends on curl - -PREFIX=' ' - -get_pub_ip() -{ - echo "$PREFIX$(curl -s ifconfig.co)" -} - -get_pub_ip diff --git a/dwm/dwmbar/modules/ram b/dwm/dwmbar/modules/ram deleted file mode 100755 index 4fc567c..0000000 --- a/dwm/dwmbar/modules/ram +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Prints the total ram and used ram in Mb - -PREFIX='󰘚 ' - -get_ram() -{ - TOTAL_RAM=$(free -mh --si | awk {'print $2'} | head -n 2 | tail -1) - USED_RAM=$(free -mh --si | awk {'print $3'} | head -n 2 | tail -1) - MB="MB" - - echo "$PREFIX$USED_RAM/$TOTAL_RAM" -} - -get_ram diff --git a/dwm/dwmbar/modules/ram_perc b/dwm/dwmbar/modules/ram_perc deleted file mode 100755 index 40c2b2f..0000000 --- a/dwm/dwmbar/modules/ram_perc +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints the total ram and used ram in Mb - -PREFIX=' ' - -get_ram() -{ - USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}') - echo "$PREFIX$USED_RAM%" -} - -get_ram diff --git a/dwm/dwmbar/modules/redshift b/dwm/dwmbar/modules/redshift deleted file mode 100755 index 69f3f9e..0000000 --- a/dwm/dwmbar/modules/redshift +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints out the screen color temperature -# Requires the redshift package - -PREFIX='' - -get_redshift() -{ - echo "$PREFIX$(redshift -p 2> /dev/null | grep "temp" | awk '{print $3}')" -} - -get_redshift diff --git a/dwm/dwmbar/modules/src/internet.c b/dwm/dwmbar/modules/src/internet.c deleted file mode 100644 index 916445b..0000000 --- a/dwm/dwmbar/modules/src/internet.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() -{ - char *internet_icon = " "; - - printf("%s\n", internet_icon); - - return 0; -} diff --git a/dwm/dwmbar/modules/sunmoon b/dwm/dwmbar/modules/sunmoon deleted file mode 100755 index 4bbc062..0000000 --- a/dwm/dwmbar/modules/sunmoon +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Outputs sun if its daytime and moon if its nighttime -# Requires the redshift package - -SUN_ICON='盛' -MOON_ICON='' - -get_sunmoon() -{ - if [[ $(redshift -p | grep "Period" | awk '{print $2}') == "Night" ]]; then - echo "$MOON_ICON" - else - echo "$SUN_ICON" - fi -} - -get_sunmoon diff --git a/dwm/dwmbar/modules/time b/dwm/dwmbar/modules/time deleted file mode 100755 index dfd2400..0000000 --- a/dwm/dwmbar/modules/time +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Prints out the time - -PREFIX=' ' - -get_time() -{ - echo "$PREFIX$(date '+%H:%M')" -} - -get_time diff --git a/dwm/dwmbar/modules/todo b/dwm/dwmbar/modules/todo deleted file mode 100755 index 09b00ca..0000000 --- a/dwm/dwmbar/modules/todo +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Prints number of todos -# Requires t todo manager (https://github.com/sjl/t) - -TASKS_DIR="/home/$USER/.todo" -TASKS_NAME="tasks" -PREFIX=': ' - -get_todo() -{ -echo "$PREFIX$(t --task-dir $TASKS_DIR --list $TASKS_NAME | wc -l)" -} - -get_todo diff --git a/dwm/dwmbar/modules/tor b/dwm/dwmbar/modules/tor deleted file mode 100755 index 74ff5b1..0000000 --- a/dwm/dwmbar/modules/tor +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Prints if the tor service is enabled or not -# Requires tor - -TOR_ENABLED='ﴣ' -TOR_DISABLED='' - -get_tor() -{ - status=$(systemctl is-active tor.service) - - if [ "$status" == "active" ] - then - echo "$TOR_ENABLED" - else - : - #echo "$TOR_DISABLED" - fi - -} - -get_tor diff --git a/dwm/dwmbar/modules/uptime b/dwm/dwmbar/modules/uptime deleted file mode 100755 index 2c771d4..0000000 --- a/dwm/dwmbar/modules/uptime +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Prints the total ram and used ram in Mb - -PREFIX='' - -get_uptime() -{ - UPTIME=$(uptime | sed 's/.*up \([^,]*\), .*/\1/') - echo "$PREFIX$UPTIME" -} - -get_uptime diff --git a/dwm/dwmbar/modules/username b/dwm/dwmbar/modules/username deleted file mode 100755 index 2527b37..0000000 --- a/dwm/dwmbar/modules/username +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Prints the effective username of the current user - -PREFIX='' - -get_username() -{ - USERNAME=$(whoami) - - echo "$PREFIX $USERNAME" -} - -get_username \ No newline at end of file diff --git a/dwm/dwmbar/modules/voidupdates b/dwm/dwmbar/modules/voidupdates deleted file mode 100755 index 9411637..0000000 --- a/dwm/dwmbar/modules/voidupdates +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Prints the number of updates for Void Linux - -PREFIX=' Updates: ' - -get_updates() -{ - if ! updates=$(xbps-install -Mun 2> /dev/null | wc -l ); then - updates=0 - fi - - echo "$PREFIX$updates" -} - -if [ $(( 10#$(date '+%M') % 3 )) -eq 0 ] && [ $(( 10#$(date '+%S') )) -eq 5 ]; then - get_updates -fi diff --git a/dwm/dwmbar/modules/volume b/dwm/dwmbar/modules/volume deleted file mode 100755 index 6b5b96e..0000000 --- a/dwm/dwmbar/modules/volume +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Prints out the volume percentage - -VOLUME_ON_ICON='' -VOLUME_MUTED_ICON='' - -get_volume(){ - curStatus=$(pactl get-sink-mute @DEFAULT_SINK@) - volume=$(pactl get-sink-volume @DEFAULT_SINK@ | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1) - - if [ "${curStatus}" = 'Mute: yes' ] - then - echo "$VOLUME_MUTED_ICON $volume%" - else - echo "$VOLUME_ON_ICON $volume%" - fi -} - -get_volume diff --git a/dwm/dwmbar/modules/volumebar b/dwm/dwmbar/modules/volumebar deleted file mode 100755 index 219428d..0000000 --- a/dwm/dwmbar/modules/volumebar +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Prints out the volume percentage - -# Dependencies: bc - -VOLUME_WIDTH=9 -VOLUME_SLIDER='⬤' -VOLUME_RAIL='◯' -VOLUME_MUTED='muted' - -PREFIX='' - -# If volume is >100 -ALERT='!!!' - -get_volume(){ - active_sink=$(pacmd list-sinks | awk '/* index:/{print $3}') - curStatus=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | awk '/muted/{ print $2}') - volume=$(pacmd list-sinks | grep -A 15 "index: $active_sink$" | grep 'volume:' | grep -E -v 'base volume:' | awk -F : '{print $3}' | grep -o -P '.{0,3}%'| sed s/.$// | tr -d ' ') - slider_position=$(python -c "print(($volume / 100) * $VOLUME_WIDTH)") - - if [ "${curStatus}" = 'yes' ] - then - echo "$VOLUME_MUTED" - exit 0 - else - for i in $(seq 1 $VOLUME_WIDTH); do - [[ $i = $slider_position ]] && BAR=$BAR$VOLUME_SLIDER - [[ $i < $slider_position ]] && BAR=$BAR$VOLUME_SLIDER - [[ $i > $slider_position ]] && BAR=$BAR$VOLUME_RAIL - done - fi - - [[ $volume -gt 100 ]] && PREFIX=$PREFIX$ALERT - - echo "$PREFIX$BAR" -} - -get_volume diff --git a/dwm/dwmbar/modules/weather b/dwm/dwmbar/modules/weather deleted file mode 100755 index 17d7eec..0000000 --- a/dwm/dwmbar/modules/weather +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Deps: -# curl - - -get_weather() -{ - curl -s v2.wttr.in/tomsk | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//' -} - - -if [ $(( 10#$(date '+%S') % 30 )) -eq 0 ]; then - get_weather -fi diff --git a/dwm/dwmbar/modules/wifi b/dwm/dwmbar/modules/wifi deleted file mode 100755 index 65ac03c..0000000 --- a/dwm/dwmbar/modules/wifi +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Gets the wifi status - -WIFI_FULL_ICON=' ' -WIFI_MID_ICON=' ' -WIFI_LOW_ICON=' ' -NO_WIFI_ICON=' ' - -get_wifi() -{ - if grep -q wl* "/proc/net/wireless"; then - # Wifi quality percentage - percentage=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70)}'| xargs) - case $percentage in - 0) echo $NO_WIFI_ICON;; - 100|9[0-9]|8[0-9]|7[0-9]) echo "$WIFI_FULL_ICON" ;; - 6[0-9]|5[0-9]|4[0-9]|3[0-9]) echo "$WIFI_MID_ICON" ;; - 2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;; - esac - fi -} - -get_wifi diff --git a/dwm/dwmbar/res/example.png b/dwm/dwmbar/res/example.png deleted file mode 100644 index 195c3bf..0000000 Binary files a/dwm/dwmbar/res/example.png and /dev/null differ diff --git a/dwm/dwmbar/restart_dwmbar.sh b/dwm/dwmbar/restart_dwmbar.sh deleted file mode 100755 index d765cf4..0000000 --- a/dwm/dwmbar/restart_dwmbar.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -sudo killall dwmbar -dwmbar& - diff --git a/dwm/dwmbar/todo.md b/dwm/dwmbar/todo.md deleted file mode 100644 index 9c04c43..0000000 --- a/dwm/dwmbar/todo.md +++ /dev/null @@ -1,5 +0,0 @@ -# TODO - -- Separator optional between modules -- Call all modules once on startup, then deal with delays -- Different archupdates and arch AUR updates that write to the same file so you can use only 1 of them diff --git a/dwm/dwmbar/uninstall.sh b/dwm/dwmbar/uninstall.sh deleted file mode 100755 index 089158b..0000000 --- a/dwm/dwmbar/uninstall.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Archie Hilton - -# 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 . - -if [ "$EUID" -ne 0 ] - then echo "Please run as root" - exit 1 -fi - -rm -rf "/usr/share/dwmbar" -rm -f "/usr/bin/dwmbar" - -echo "Completed." -echo "Please delete ~/.config/dwmbar manually, if desired." diff --git a/dwm/fonts/JetBrainsMono.tar.xz b/dwm/fonts/JetBrainsMono.tar.xz deleted file mode 100644 index 9fe72b7..0000000 Binary files a/dwm/fonts/JetBrainsMono.tar.xz and /dev/null differ diff --git a/dwm/install.sh b/dwm/install.sh deleted file mode 100755 index 820105d..0000000 --- a/dwm/install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -# ---- colors ---- -RESET='\033[0m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -# ---------------- - -# -------- dwm --------- -printf "$GREEN installing dwm...$RESET" -cd ~/dotfiles/dwm/dwm -sudo make clean install &> /dev/null -if [ $? -eq 0 ]; then - printf "[$GREEN ok $RESET]\n" -else - printf "[$RED err $RESET]\n" -fi -# ---------------------- - -# ------- dwmbar ------- -printf "$GREEN installing dwmbar...$RESET" -cd ~/dotfiles/dwm/dwmbar -sudo ./install.sh &> /dev/null -if [ $? -eq 0 ]; then - printf "[$GREEN ok $RESET]\n" -else - printf "[$RED err $RESET]\n" -fi -# ---------------------- - -#--------- slstatus ------------ -printf "$GREEN installing slstatus...$RESET" -cd ~/dotfiles/dwm/slstatus -sudo make clean install &> /dev/null -if [ $? -eq 0 ]; then - printf "[$GREEN ok $RESET]\n" -else - printf "[$RED err $RESET]\n" -fi -#------------------------------- - -#---------- st ------------------ -printf "$GREEN installing st terminal...$RESET" -cd ~/dotfiles/dwm/st -sudo make clean install &> /dev/null -if [ $? -eq 0 ]; then - printf "[$GREEN ok $RESET]\n" -else - printf "[$RED err $RESET]\n" -fi -#-------------------------------- - -#---------- surf ------------------ -printf "$GREEN installing surf browser...$RESET" -cd ~/dotfiles/dwm/surf -sudo make clean install &> /dev/null -if [ $? -eq 0 ]; then - printf "[$GREEN ok $RESET]\n" -else - printf "[$RED err $RESET]\n" -fi -#---------------------------------- - diff --git a/dwm/picom/.builds/freebsd.yml b/dwm/picom/.builds/freebsd.yml deleted file mode 100644 index 41c3d92..0000000 --- a/dwm/picom/.builds/freebsd.yml +++ /dev/null @@ -1,28 +0,0 @@ -image: freebsd/latest -packages: - - libev - - libXext - - libxcb - - meson - - pkgconf - - cmake - - xcb-util-renderutil - - xcb-util-image - - pixman - - uthash - - libconfig - - libglvnd - - dbus - - pcre -sources: - - https://github.com/yshui/picom -tasks: - - setup: | - cd picom - CPPFLAGS="-I/usr/local/include" meson -Dunittest=true build - - build: | - cd picom - ninja -C build - - unittest: | - cd picom - ninja -C build test diff --git a/dwm/picom/.circleci/config.yml b/dwm/picom/.circleci/config.yml deleted file mode 100644 index 6c348fa..0000000 --- a/dwm/picom/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -executors: - e: - docker: - - image: yshui/comptonci - working_directory: "/tmp/workspace" - environment: - UBSAN_OPTIONS: "halt_on_error=1" - -version: 2.1 -commands: - build: - parameters: - build-config: - type: string - default: "" - cc: - type: string - default: cc - steps: - - restore_cache: - keys: - - source-v1-{{ .Branch }}-{{ .Revision }} - - source-v1-{{ .Branch }}- - - source-v1- - - checkout - - save_cache: - key: source-v1-{{ .Branch }}-{{ .Revision }} - paths: - - ".git" - - run: - name: config - command: CC=<< parameters.cc >> meson << parameters.build-config >> -Dunittest=true --werror . build - - run: - name: build - command: ninja -vC build - -jobs: - basic: - executor: e - steps: - - build: - build-config: -Dwith_docs=true -Db_coverage=true - - persist_to_workspace: - root: . - paths: - - . - test: - executor: e - steps: - - attach_workspace: - at: /tmp/workspace - - run: - name: unit test - command: ninja -vC build test - - run: - name: test config file parsing - command: xvfb-run -s "-screen 0 640x480x24" build/src/picom --config picom.sample.conf --no-vsync --diagnostics - - run: - name: run testsuite - command: tests/run_tests.sh build/src/picom - - run: - name: generate coverage reports - command: cd build; find -name '*.gcno' -exec gcov -pb {} + - - run: - name: download codecov scripts - command: curl -s https://codecov.io/bash > codecov.sh - - run: - name: upload coverage reports - command: bash ./codecov.sh -X gcov - - minimal: - executor: e - steps: - - build: - build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false - release: - executor: e - steps: - - build: - build-config: --buildtype=release - release-clang: - executor: e - steps: - - build: - cc: clang - build-config: --buildtype=release - nogl: - executor: e - steps: - - build: - build-config: -Dopengl=false - noregex: - executor: e - steps: - - build: - build-config: -Dregex=false - clang_basic: - executor: e - steps: - - build: - cc: clang - clang_minimal: - executor: e - steps: - - build: - cc: clang - build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false - clang_nogl: - executor: e - steps: - - build: - cc: clang - build-config: -Dopengl=false - clang_noregex: - executor: e - steps: - - build: - cc: clang - build-config: -Dregex=false - -workflows: - all_builds: - jobs: - - basic - - clang_basic - - minimal - - clang_minimal - - nogl - - clang_nogl - - release - - release-clang - - test: - requires: - - basic -# vim: set sw=2 ts=8 et: diff --git a/dwm/picom/.clang-format b/dwm/picom/.clang-format deleted file mode 100644 index 82c938a..0000000 --- a/dwm/picom/.clang-format +++ /dev/null @@ -1,38 +0,0 @@ -BasedOnStyle: LLVM -TabWidth: 8 -UseTab: ForIndentation -BreakBeforeBraces: Attach -#BreakStringLiterals: true -IndentWidth: 8 -AlignAfterOpenBracket: Align -ColumnLimit: 90 -#ExperimentalAutoDetectBinPacking: true -BinPackArguments: true -BinPackParameters: true -#ReflowComments: true -AlignTrailingComments: true -SpacesBeforeTrailingComments: 8 -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -AllowShortIfStatementsOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: false -IndentCaseLabels: false -IndentPPDirectives: None -PenaltyReturnTypeOnItsOwnLine: 0 -PenaltyBreakAssignment: 0 -PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 1 -PenaltyBreakString: 36 -PenaltyExcessCharacter: 3 -PenaltyBreakFirstLessLess: 0 -PenaltyBreakTemplateDeclaration: 0 -BreakBeforeBinaryOperators: None -IncludeCategories: - - Regex: '<.*\.h>' - Priority: 1 - - Regex: '".*\.h"' - Priority: 2 -SortIncludes: true -#ForEachMacros: [ list_for_each_entry, list_for_each_entry_safe, HASH_ITER ] -#AlignConsecutiveAssignments: true diff --git a/dwm/picom/.clang-tidy b/dwm/picom/.clang-tidy deleted file mode 100644 index 7b59c22..0000000 --- a/dwm/picom/.clang-tidy +++ /dev/null @@ -1,21 +0,0 @@ -Checks: > - readability-*, - performance-*, - modernize-*, - google-readability-todo, - cert-err34-c, - cert-flp30-c, - bugprone-*, - misc-misplaced-const, - misc-redundant-expression, - misc-static-assert, - -clang-analyzer-*, - -readability-isolate-declaration, - -readability-magic-numbers -AnalyzeTemporaryDtors: false -FormatStyle: file -CheckOptions: - - key: readability-magic-numbers.IgnoredIntegerValues - value: 4;8;16;24;32;1;2;3;4096;65536; - - key: readability-magic-numbers.IgnoredFloatingPointValues - value: 255.0;1.0; diff --git a/dwm/picom/.editorconfig b/dwm/picom/.editorconfig deleted file mode 100644 index b40d8e8..0000000 --- a/dwm/picom/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -root = true -[*.{c,h}] -indent_style = tab -indent_size = 8 -max_line_length = 90 diff --git a/dwm/picom/.github/issue_template.md b/dwm/picom/.github/issue_template.md deleted file mode 100644 index 4aee88a..0000000 --- a/dwm/picom/.github/issue_template.md +++ /dev/null @@ -1,57 +0,0 @@ - - -### Platform - - -### GPU, drivers, and screen setup - - -### Environment - - -### picom version - - -
-Diagnostics - - -
- -### Configuration: -
- Configuration file - -``` -// Paste your configuration here -``` -
- -### Steps of reproduction - - -1. -2. - -### Expected behavior - -### Current Behavior - -### Stack trace - - - - -### Other details - diff --git a/dwm/picom/.github/pull_request_template.md b/dwm/picom/.github/pull_request_template.md deleted file mode 100644 index 2dd690f..0000000 --- a/dwm/picom/.github/pull_request_template.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dwm/picom/.github/workflows/codeql-analysis.yml b/dwm/picom/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 8b65b61..0000000 --- a/dwm/picom/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [next] - pull_request: - branches: [next] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: ['cpp', 'python'] - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - - # Install dependencies - - run: sudo apt update && sudo apt install libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev meson ninja-build - if: ${{ matrix.language == 'cpp' }} - - # Autobuild - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/dwm/picom/.github/workflows/coding-style-pr.yml b/dwm/picom/.github/workflows/coding-style-pr.yml deleted file mode 100644 index e5b40c5..0000000 --- a/dwm/picom/.github/workflows/coding-style-pr.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: coding-style -on: pull_request - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - run: git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }} - - uses: yshui/git-clang-format-lint@v1.11 - with: - base: ${{ github.event.pull_request.base.sha }} diff --git a/dwm/picom/.github/workflows/coding-style.yml b/dwm/picom/.github/workflows/coding-style.yml deleted file mode 100644 index 79c7edc..0000000 --- a/dwm/picom/.github/workflows/coding-style.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: coding-style -on: push - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - uses: yshui/git-clang-format-lint@v1.12 - with: - base: ${{ github.event.ref }}~1 diff --git a/dwm/picom/.gitignore b/dwm/picom/.gitignore deleted file mode 100644 index 20b39d0..0000000 --- a/dwm/picom/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -# Build files -.deps -aclocal.m4 -autom4te.cache -config.log -config.status -configure -depcomp -install-sh -missing -stamp-h1 -compton -*.o -*.d -build/ -compile_commands.json -build.ninja - -# language servers -.ccls-cache -.clangd -.cache - -# CMake files -compton-*.deb -compton-*.rpm -compton-*.tar.bz2 -release/ -_CPack_Packages/ -CMakeCache.txt -CMakeFiles/ -cmake_install.cmake -CPackSourceConfig.cmake -install_manifest.txt - - -# Vim files -.sw[a-z] -.*.sw[a-z] -*~ - -# Misc files -core.* -.gdb_history -oprofile_data/ -compton.plist -callgrind.out.* -man/*.html -man/*.1 -doxygen/ -.clang_complete -.ycm_extra_conf.py -.ycm_extra_conf.pyc -/src/backtrace-symbols.[ch] -/compton*.trace -*.orig -/tests/log -/tests/testcases/__pycache__/ diff --git a/dwm/picom/.gitmodules b/dwm/picom/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/dwm/picom/CONTRIBUTORS b/dwm/picom/CONTRIBUTORS deleted file mode 100644 index 9512bf8..0000000 --- a/dwm/picom/CONTRIBUTORS +++ /dev/null @@ -1,85 +0,0 @@ -Sorted in alphabetical order -Open an issue or pull request if you don't want your name listed here. - -Adam Jackson -adelin-b -Alexander Kapshuna -Antonin Décimo -Antonio Vivace -Avi-D-coder -Ben Friesen -Bernd Busse -Bert Gijsbers -bhagwan -Bodhi -Brottweiler -Carl Worth -Christopher Jeffrey -Corax26 -Dan Elkouby -Dana Jansens -Daniel Kwan -Dave Airlie -David Schlachter -dolio -Duncan -Dylan Araps -Einar Lielmanis -Eric Anholt -Greg Flynn -Harish Rajagopal -hasufell -Ignacio Taranto -Istvan Petres -James Cloos -Jamey Sharp -Jan Beich -Jarrad -Javeed Shaikh -Jerónimo Navarro -jialeens -Johnny Pribyl -Keith Packard -Kevin Kelley -ktprograms -Lukas Schmelzeisen -mæp -Mark Tiefenbruck -Matthew Allum -Maxim Solovyov -Michael Reed -Michele Lambertucci -Namkhai Bourquin -Nate Hart -nia -notfoss -Omar Polo -orbea -@Paradigm0001 -Patrick Collins -Peter Mattern -Phil Blundell -Que Quotion -Rafael Kitover -Richard Grenville -Rytis Karpuska -Samuel Hand -Scott Leggett -scrouthtv -Sebastien Waegeneire -Subhaditya Nath -Tasos Sahanidis -Thiago Kenji Okada -Tilman Sauerbeck -Tim van Dalen -Tomas Janousek -Tom Dörr -Toni Jarjour -Tuomas Kinnunen -Uli Schlachter -Walter Lapchynski -Will Dietz -XeCycle -Yuxuan Shui -zilrich -ಠ_ಠ diff --git a/dwm/picom/COPYING b/dwm/picom/COPYING deleted file mode 100644 index f13a75b..0000000 --- a/dwm/picom/COPYING +++ /dev/null @@ -1,20 +0,0 @@ -picom - a compositor for X11 - -Based on xcompmgr, originally written by Keith Packard, with modifications -from several contributors (according to the xcompmgr man page): Matthew Allum, -Eric Anholt, Dan Doel, Thomas Luebking, Matthew Hawn, Ely Levy, Phil Blundell, -and Carl Worth. Menu transparency was implemented by Dana Jansens. - -Numerous contributions to picom from Richard Grenville. - -See the CONTRIBUTORS file for a complete list of contributors - -This source code is provided under: - - SPDX-License-Identifier: MPL-2.0 AND MIT - -And the preferred license for new source files in this project is: - - SPDX-License-Identifier: MPL-2.0 - -You can find the text of the licenses in the LICENSES directory. diff --git a/dwm/picom/Doxyfile b/dwm/picom/Doxyfile deleted file mode 100644 index 741325c..0000000 --- a/dwm/picom/Doxyfile +++ /dev/null @@ -1,1808 +0,0 @@ -# Doxyfile 1.8.2 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = "compton" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doxygen - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented classes, -# or namespaces to their corresponding documentation. Such a link can be -# prevented in individual cases by by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.c *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If left blank doxygen will -# generate a default style sheet. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -#
-# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = __attribute__(x)= - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# manageable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/dwm/picom/History.md b/dwm/picom/History.md deleted file mode 100644 index 8e5a9b4..0000000 --- a/dwm/picom/History.md +++ /dev/null @@ -1,156 +0,0 @@ -# Picom History - -Picom was forked in 2016 from the original Compton because it seemed to have become unmaintained. - -The battle plan of the fork was to refactor it to make the code _possible_ to maintain, so potential contributors won't be scared away when they take a look at the code. - -And also to try to fix bugs. - -## Rename - -In 2019 the project name was changed from Compton to picom (git revision 8ddbeb and following). - -### Rationale - -Since the inception of this fork, the existence of two compton repositories has caused some number of confusions. Mainly, people will report issues of this fork to the original compton, or report issues of the original compton here. Later, when distros started packaging this fork of compton, some wanted to differentiate the newer compton from the older version. They found themselves having no choice but to invent a name for this fork. This is less than ideal since this has the potential to cause more confusions among users. - -Therefore, we decided to move this fork to a new name. Personally, I consider this more than justified since this version of compton has gone through significant changes since it was forked. - -### The name - -The criteria for a good name were - -0. Being short, so it's easy to remember. -1. Pronounceability, again, helps memorability -2. Searchability, so when people search the name, it's easy for them to find this repository. - -Of course, choosing a name is never easy, and there is no apparent way to objectively evaluate the names. Yet, we have to solve the aforementioned problems as soon as possible. - -In the end, we picked `picom` (a portmanteau of `pico` and `composite`) as our new name. This name might not be perfect, but is what we will move forward with unless there's a compelling reason not to. - - -# Compton - -This is a copy of the README of the [original Compton project](https://github.com/chjj/compton/). - -[![Join the chat at https://gitter.im/chjj/compton](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/chjj/compton?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -__Compton__ is a compositor for X, and a fork of __xcompmgr-dana__. - -I was frustrated by the low amount of standalone lightweight compositors. -Compton was forked from Dana Jansens' fork of xcompmgr and refactored. I fixed -whatever bug I found, and added features I wanted. Things seem stable, but don't -quote me on it. I will most likely be actively working on this until I get the -features I want. This is also a learning experience for me. That is, I'm -partially doing this out of a desire to learn Xlib. - -## Changes from xcompmgr: - -* OpenGL backend (`--backend glx`), in addition to the old X Render backend. -* Inactive window transparency (`-i`) / dimming (`--inactive-dim`). -* Titlebar/frame transparency (`-e`). -* Menu transparency (`-m`, thanks to Dana). -* shadows are now enabled for argb windows, e.g. terminals with transparency -* removed serverside shadows (and simple compositing) to clean the code, - the only option that remains is clientside shadows -* configuration files (see the man page for more details) -* colored shadows (`--shadow-[red/green/blue]`) -* a new fade system -* VSync support (not always working) -* Blur of background of transparent windows, window color inversion (bad in performance) -* Some more options... - -## Fixes from the original xcompmgr: - -* fixed a segfault when opening certain window types -* fixed a memory leak caused by not freeing up shadows (from the freedesktop - repo) -* fixed the conflict with chromium and similar windows -* [many more](https://github.com/chjj/compton/issues) - -## Building - -### Dependencies: - -__B__ for build-time - -__R__ for runtime - -* libx11 (B,R) -* libxcomposite (B,R) -* libxdamage (B,R) -* libxfixes (B,R) -* libXext (B,R) -* libxrender (B,R) -* libXrandr (B,R) -* libXinerama (B,R) (Can be disabled with `NO_XINERAMA` at compile time) -* pkg-config (B) -* make (B) -* xproto / x11proto (B) -* sh (R) -* xprop,xwininfo / x11-utils (R) -* libpcre (B,R) (Can be disabled with `NO_REGEX_PCRE` at compile time) -* libconfig (B,R) (Can be disabled with `NO_LIBCONFIG` at compile time) -* libdrm (B) (Can be disabled with `NO_VSYNC_DRM` at compile time) -* libGL (B,R) (Can be disabled with `NO_VSYNC_OPENGL` at compile time) -* libdbus (B,R) (Can be disabled with `NO_DBUS` at compile time) -* asciidoc (B) (and docbook-xml-dtd-4.5, libxml-utils, libxslt, xsltproc, xmlto, etc. if your distro doesn't pull them in) - -### How to build - -To build, make sure you have the dependencies above: - -```bash -# Make the main program -$ make -# Make the man pages -$ make docs -# Install -$ make install -``` - -(Compton does include a `_CMakeLists.txt` in the tree, but we haven't decided whether we should switch to CMake yet. The `Makefile` is fully usable right now.) - -## Known issues - -* Our [FAQ](https://github.com/chjj/compton/wiki/faq) covers some known issues. - -* VSync does not work too well. You may check the [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide) for how to get (possibly) better effects. - -* If `--unredir-if-possible` is enabled, when compton redirects/unredirects windows, the screen may flicker. Using `--paint-on-overlay` minimizes the problem from my observation, yet I do not know if there's a cure. - -* compton may not track focus correctly in all situations. The focus tracking code is experimental. `--use-ewmh-active-win` might be helpful. - -* The performance of blur under X Render backend might be pretty bad. OpenGL backend could be faster. - -* With `--blur-background` you may sometimes see weird lines around damaged area. `--resize-damage YOUR_BLUR_RADIUS` might be helpful in the case. - -## Usage - -Please refer to the Asciidoc man pages (`man/compton.1.asciidoc` & `man/compton-trans.1.asciidoc`) for more details and examples. - -Note a sample configuration file `compton.sample.conf` is included in the repository. - -## Support - -* Bug reports and feature requests should go to the "Issues" section above. - -* Our (semi?) official IRC channel is #compton on FreeNode. - -* Some information is available on the wiki, including [FAQ](https://github.com/chjj/compton/wiki/faq), [VSync Guide](https://github.com/chjj/compton/wiki/vsync-guide), and [Performance Guide](https://github.com/chjj/compton/wiki/perf-guide). - -## License - -Although compton has kind of taken on a life of its own, it was originally -an xcompmgr fork. xcompmgr has gotten around. As far as I can tell, the lineage -for this particular tree is something like: - -* Keith Packard (original author) -* Matthew Hawn -* ... -* Dana Jansens -* chjj and richardgv - -Not counting the tens of people who forked it in between. - -Compton is distributed under MIT license, as far as I (richardgv) know. See LICENSE for more info. diff --git a/dwm/picom/LICENSE.spdx b/dwm/picom/LICENSE.spdx deleted file mode 100644 index 83aa2da..0000000 --- a/dwm/picom/LICENSE.spdx +++ /dev/null @@ -1,4 +0,0 @@ -SPDXVersion: SPDX-2.1 -DataLicense: CC0-1.0 -PackageName: picom -PackageLicenseDeclared: MPL-2.0 AND MIT diff --git a/dwm/picom/LICENSES/MIT b/dwm/picom/LICENSES/MIT deleted file mode 100644 index 1f95d26..0000000 --- a/dwm/picom/LICENSES/MIT +++ /dev/null @@ -1,5 +0,0 @@ -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 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. diff --git a/dwm/picom/LICENSES/MPL-2.0 b/dwm/picom/LICENSES/MPL-2.0 deleted file mode 100644 index 14e2f77..0000000 --- a/dwm/picom/LICENSES/MPL-2.0 +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/dwm/picom/README.md b/dwm/picom/README.md deleted file mode 100644 index 58343a5..0000000 --- a/dwm/picom/README.md +++ /dev/null @@ -1,136 +0,0 @@ -picom -===== - -__picom__ is a compositor for X, and a [fork of Compton](History.md). - -**This is a development branch, bugs to be expected** - -You can leave your feedback or thoughts in the [discussion tab](https://github.com/yshui/picom/discussions). - -## About this Fork - -Extended animation support (auto, fly-in, zoom, squeeze, slide-up, slide-down, slide-left, slide-right) from original [repo](https://github.com/dccsillag/picom) by @dccsillag, added slide-out, slide-in for workspace switching with [Custom Fluxbox](https://github.com/pijulius/fluxbox/commit/83ee4dbee67a68fe38b0f96431473719e165bf1e) , animation on window type basis (for e.g. make transient windows like "about us" slide down and slide backup to the titlebar of the owner window), animation-exclude list for disabling animations on window/program basis and some fixes. - -Reason: original picom by @yshui [repo](https://github.com/yshui/picom/) didn't have animation support and @dccsillag implementation was the best could find so building uppon his work this repo was made. FYI: looks like original picom will have animation support starting with version 12 but will keep this repo as atm looks like the animation here are smoother/better (of course everyone's own point of view) and had some trouble with the latest picom so till find out the reasons will use this repo personally and everyone is velcome to do so. - -**Would like to thank everyone working on all 3 repos of picom as without their work we (old timers) wouldn't have a good compositor so thank you guys for your hard work/time to keep it updated and maintenanced regularly!** - -**IMPORTANT**: always run picom with `--experimental-backends` argument as otherwise animations won't really look good. - -## Call for testers - -### `--experimental-backends` - -This flag enables the refactored/partially rewritten backends. - -Currently, new backends feature better vsync with the xrender backend and improved input lag with the glx backend (for non-NVIDIA users). The performance should be on par with the old backends. - -New backend features will only be implemented on the new backends from now on, and the old backends will eventually be phased out after the new backends stabilize. - -To test the new backends, add the `--experimental-backends` flag to the command you use to run picom. This flag is not available from the configuration file. - -To report issues with the new backends, please state explicitly you are using the new backends in your report. - -## Change Log - -See [Releases](https://github.com/yshui/picom/releases) - -## Build - -### Dependencies - -Assuming you already have all the usual building tools installed (e.g. gcc, python, meson, ninja, etc.), you still need: - -* libx11 -* libx11-xcb -* libXext -* xproto -* xcb -* xcb-damage -* xcb-xfixes -* xcb-shape -* xcb-renderutil -* xcb-render -* xcb-randr -* xcb-composite -* xcb-image -* xcb-present -* xcb-xinerama -* xcb-glx -* pixman -* libdbus (optional, disable with the `-Ddbus=false` meson configure flag) -* libconfig (optional, disable with the `-Dconfig_file=false` meson configure flag) -* libGL (optional, disable with the `-Dopengl=false` meson configure flag) -* libpcre (optional, disable with the `-Dregex=false` meson configure flag) -* libev -* uthash - -On Debian based distributions (e.g. Ubuntu), the needed packages are - -``` -libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev meson -``` - -On Fedora, the needed packages are - -``` -dbus-devel gcc git libconfig-devel libdrm-devel libev-devel libX11-devel libX11-xcb libXext-devel libxcb-devel mesa-libGL-devel meson pcre-devel pixman-devel uthash-devel xcb-util-image-devel xcb-util-renderutil-devel xorg-x11-proto-devel -``` - -To build the documents, you need `asciidoc` - -### To build - -```bash -$ git submodule update --init --recursive -$ meson --buildtype=release . build -$ ninja -C build -``` - -Built binary can be found in `build/src` - -If you have libraries and/or headers installed at non-default location (e.g. under `/usr/local/`), you might need to tell meson about them, since meson doesn't look for dependencies there by default. - -You can do that by setting the `CPPFLAGS` and `LDFLAGS` environment variables when running `meson`. Like this: - -```bash -$ LDFLAGS="-L/path/to/libraries" CPPFLAGS="-I/path/to/headers" meson --buildtype=release . build - -``` - -As an example, on FreeBSD, you might have to run meson with: -```bash -$ LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" meson --buildtype=release . build -$ ninja -C build -``` - -### To install - -``` bash -$ ninja -C build install -``` - -Default install prefix is `/usr/local`, you can change it with `meson configure -Dprefix= build` - -## How to Contribute - -### Code - -You can look at the [Projects](https://github.com/yshui/picom/projects) page, and see if there is anything that interests you. Or you can take a look at the [Issues](https://github.com/yshui/picom/issues). - -### Non-code - -Even if you don't want to contribute code, you can still contribute by compiling and running this branch, and report any issue you can find. - -Contributions to the documents and wiki will also be appreciated. - -## Contributors - -See [CONTRIBUTORS](CONTRIBUTORS) - -The README for the [original Compton project](https://github.com/chjj/compton/) can be found [here](History.md#Compton). - -## Licensing - -picom is free software, made available under the [MIT](LICENSES/MIT) and [MPL-2.0](LICENSES/MPL-2.0) software -licenses. See the individual source files for details. diff --git a/dwm/picom/bin/picom-trans b/dwm/picom/bin/picom-trans deleted file mode 100755 index b686128..0000000 --- a/dwm/picom/bin/picom-trans +++ /dev/null @@ -1,407 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: MIT - -# -# picom-trans -# Copyright (c) 2021, Subhaditya Nath -# Based on previous works of Christopher Jeffrey -# - -# -# Conforming to POSIX-1.2007 -# https://pubs.opengroup.org/onlinepubs/9699919799 -# - -# Usage: -# $ picom-trans [options] [+|-]opacity -# By window id -# $ picom-trans -w "$WINDOWID" 75 -# By name -# $ picom-trans -n "urxvt" 75 -# By current window -# $ picom-trans -c 75 -# By selection -# $ picom-trans 75 -# $ picom-trans -s 75 -# Increment current window 5% -# $ picom-trans -c +5 -# Delete current window's opacity -# $ picom-trans -c --delete -# Toggle current window's opacity between 90 and unset -# $ picom-trans -c --toggle 90 -# Reset all windows -# $ picom-trans --reset - - -# Save $0 now to print correct value while printing from functions. -# Printing errormsgs from functions using "$0" prints the function name -# instead of the executable name. -EXE_NAME="$0" - - -# Instead of printing the full path to this file (e.g. /usr/bin/picom-trans) -# only print the base name (i.e. picom-trans) -EXE_NAME="$(basename "$EXE_NAME")" - - -print_usage() -{ #{{ - echo "Usage: $EXE_NAME [options] [+|-]opacity" - echo "" - echo "Options:" - echo " -h, --help Print this help message." - echo " -o, --opacity OPACITY Specify the new opacity value in range 0-100 for the window. If" - echo " prefixed with + or -, increment or decrement from the current" - echo " opacity of the target window." - echo "" - echo "Actions:" - echo " -g, --get Print current opacity of the target window." - echo " -d, --delete Delete opacity of the target window." - echo " -t, --toggle Toggle the target window's opacity, i.e. set if not already set" - echo " and delete else." - echo " -r, --reset Reset opacity for all windows." - echo "" - echo "Window Selection:" - echo " -s, --select Select target window with mouse cursor. (DEFAULT)" - echo " -c, --current Select the currently active window as target." - echo " -n, --name WINDOW_NAME Specify and try to match a window name." - echo " -w, --window WINDOW_ID Specify the window id of the target window." -} #}} - - -parse_args() -{ #{{ - i=1 # because we start from "$1", not from "$0" - while [ $i -le $# ] - do - #### [START] Convert GNU longopts to POSIX equivalents #### - if [ "$1" = "--${1##--}" ] # check if $1 is a longopt - then - # Catch invalid options - case "$1" in - (--opacity=|--name=|--window=) - echo "$EXE_NAME: option ${1%=} needs a value" >&2 - exit 1;; - (--opacity|--name|--window) - test $i -eq $# \ - && echo "$EXE_NAME: option $1 needs a value" >&2 \ - && exit 1;; - esac - - # Separate "--ARG=VAL" into "--ARG" "VAL" - case "$1" in - (--opacity=*|--name=*|--window=*) - ARG="$(echo "$1" | sed -E 's/(--[^=]+)=.*$/\1/')" - VAL="${1##${ARG}=}" - shift && set -- "$ARG" "$VAL" "$@" - esac - - # Turn into short form - case "$1" in - (--help|--opacity|--get|--delete|--toggle|--reset|--select|--current|--name|--window) - ARG=${1#-} # remove one '-' from prefix - ARG="$(echo "$ARG" | cut -c -2)" # get first two characters - shift && set -- "$ARG" "$@" - esac - - # If the argument still starts with --, it is an invalid argument - case "$1" in - (--*) - echo "$EXE_NAME: illegal option $1" >&2 - exit 1 - esac - fi - #### [END] Convert GNU longopts to POSIX equivalents #### - - - #### [START] Prepend '-o' to standalone opacity values #### - # Iterate over every argument and check if it is an opacity without the -o - # option in the previous argument. If so, then prepend the -o option. - # e.g. Turn this - - # picom-trans -c +10 -s - # into this - - # picom-trans -c -o +10 -s - # - # NOTE: Don't touch arguments that are preceded by -o, -w, or -n (i.e. the - # options that take a value.) - # e.g. This - - # picom-trans -w 75 -o 90 - # should NOT be turned into this - - # picom-trans -w -o 75 -o 90 - # We ensure this by checking the "$#"th (i.e. the last) argument. If - # argument is an option that needs a value, we don't do anything to $1. - # - # NOTE: we are using printf because most echo implementations aren't - # POSIX-compliant. For example, according to POSIX.1-2017, echo doesn't - # support any options, so, - # $ echo "-n" - # should output - - # -n - # But it doesn't. It instead interprets the "-n" as the option -n, which, - # in most implementations, means that the trailing newline should not be - # printed. - if echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$' && \ - ! eval "printf '%s' \"\${$#}\"" | grep -q '^-[hdtrgsc]*[own]$' - # NOTE: eval "printf '%s' \"\${$#}\"" means 'print the last argument' - # NOTE: The letters inside the first square brackets (ie. hdtrgsc) are - # the same as those in the getopts argument, minus those that are - # followed by a ':' - # NOTE: The letters inside the second square brackets (ie. own) are - # the same as those in the getopts argument, minus those that are - # NOT followed by a ':' - then - set -- "$@" "-o" - i=$(( i + 1 )) - fi - #### [END] Prepend '-o' to standalone opacity values #### - - - # Prepare for next iteration - ARG="$1" - shift && set -- "$@" "$ARG" - i=$(( i + 1 )) - done - - - # NOTE: DO NOT ATTEMPT TO USE "$OPTIND" INSIDE THE getopts LOOP - # - https://github.com/yshui/picom/pull/634#discussion_r654571535 - # - https://www.mail-archive.com/austin-group-l%40opengroup.org/msg04112.html - OPTIND=1 - while getopts 'ho:dtrgsn:w:c' OPTION - do - case "$OPTION" in - (h) print_usage; exit 0;; - (o) target_opacity="$OPTARG";; - (d) action=delete;; - (t) action=toggle;; - (r) action=reset;; - (g) action=get;; - (s) winidtype=; winid=;; - (n) winidtype=-name; winid="$OPTARG";; - (w) winidtype=-id; winid="$OPTARG";; - (c) winidtype=-id; winid="$(get_focused_window_id)";; - (\?) exit 1 - esac - done -} #}} - - -get_target_window_id() -{ #{{ - - # Get the output of xwininfo - if test -z "$winidtype" - then xwininfo_output="$(xwininfo -children -frame)" - elif test "$winidtype" = "-name" - then xwininfo_output="$(xwininfo -children -name "$winid")" - elif test "$winidtype" = "-id" - then - # First, check if supplied window id is valid - if ! echo "$winid" | grep -Eiq '^[[:space:]]*(0x[[:xdigit:]]+|[[:digit:]]+)[[:space:]]*$' - then - echo "Bad window ID" >&2 - exit 1 - fi - xwininfo_output="$(xwininfo -children -id "$winid")" - fi - - # Extract window id from xwininfo output - winid="$(echo "$xwininfo_output" | sed -n 's/^xwininfo:.*: \(0x[[:xdigit:]]*\).*$/\1/p')" - if test -z "$winid" - then - echo "Failed to find window" >&2 - exit 1 - fi - - # Make sure it's not root window - if echo "$xwininfo_output" | grep -Fq "Parent window id: 0x0" - then - echo "Cannot set opacity on root window" >&2 - exit 1 - fi - - # If it's not the topmost window, get the topmost window - if ! echo "$xwininfo_output" | grep -q 'Parent window id: 0x[[:xdigit:]]* (the root window)' - then - window_tree="$(xwininfo -root -tree)" - if test -z "$window_tree" - then - echo "Failed to get root window tree" >&2 - exit 1 - fi - - # Find the highest ancestor of the target window - winid="$(echo "$window_tree" \ - | sed -n "/^\s*$winid/q;s/^ \(0x[[:xdigit:]]*\).*/\1/p" \ - | tail -n 1)" - if test -z "$winid" - then - echo "Failed to find window in window tree" >&2 - exit 1 - fi - fi - if test -z "$winid" - then - echo "Failed to find the highest parent window below root of the selected window" >&2 - exit 1 - fi - - echo "$winid" -} #}} - -get_focused_window_id() -{ #{{ - id="$(xprop -root -notype -f _NET_ACTIVE_WINDOW 32x '$0' _NET_ACTIVE_WINDOW)" - echo "${id#_NET_ACTIVE_WINDOW}" -} #}} - -get_current_opacity() -{ #{{ - # Gets current opacity in the range 0-100 - # Doesn't output anything if opacity isn't set - cur="$(xprop -id "$winid" -notype -f _NET_WM_WINDOW_OPACITY 32c '$0' _NET_WM_WINDOW_OPACITY)" - cur="${cur#_NET_WM_WINDOW_OPACITY}" - cur="${cur%:*}" - test -n "$cur" && - cur=$(( cur * 100 / 0xffffffff )) - echo "$cur" -} #}} - - -get_opacity() -{ #{{ - cur="$(get_current_opacity)" - test -z "$cur" && cur=100 # Unset opacity means fully opaque - echo "$cur" - exit 0 -} #}} - -delete_opacity() -{ #{{ - xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY - exit 0 -} #}} - -reset_opacity() # Reset opacity of all windows -{ #{{ - for winid in $(xwininfo -root -tree | sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p') - do xprop -id "$winid" -remove _NET_WM_WINDOW_OPACITY 2>/dev/null - done - exit 0 -} #}} - -set_opacity() -{ #{{ - if ! echo "$target_opacity" | grep -qE '^[+-]?[[:digit:]]+%?$' - then - if test -z "$target_opacity" - then echo "No opacity specified" >&2 - else echo "Invalid opacity specified: $target_opacity" >&2 - fi - exit 1 - fi - - # strip trailing '%' sign, if any - target_opacity="${target_opacity%%%}" - - if echo "$target_opacity" | grep -q '^[+-]' - then - current_opacity="$(get_current_opacity)" - test -z "$current_opacity" && current_opacity=100 - target_opacity=$(( current_opacity + target_opacity )) - fi - - test $target_opacity -lt 0 && target_opacity=0 - test $target_opacity -gt 100 && target_opacity=100 - - target_opacity=$(( target_opacity * 0xffffffff / 100 )) - xprop -id "$winid" -f _NET_WM_WINDOW_OPACITY 32c \ - -set _NET_WM_WINDOW_OPACITY "$target_opacity" - - exit $? -} #}} - -toggle_opacity() -{ #{{ - # If opacity is currently set, unset it. - # If opacity is currently unset, set opacity to the supplied value. If no - # value is supplied, we default to 100%. - if test -z "$(get_current_opacity)" - then - test -n "$target_opacity" || target_opacity=100 - set_opacity - else - delete_opacity - fi -} #}} - - -# Warn about rename of compton to picom -case "$0" in - *compton-trans*) echo "Warning: compton has been renamed, please use picom-trans instead" >&2;; -esac - - -# Check if both xwininfo and xprop are available -if ! command -v xprop >/dev/null || ! command -v xwininfo >/dev/null -then - echo "The command xwininfo or xprop is not available. They might reside in a package named xwininfo, xprop, x11-utils, xorg-xprop, or xorg-xwininfo" >&2 - exit 1 -fi - - -# No arguments given. Show help. -if test $# -eq 0 -then - print_usage >&2 - exit 1 -fi - - -# Variables -# action is set to 'set' by default -action=set -winid= -winidtype= -target_opacity= - -# If there's only one argument, and it's a valid opacity -# then take it as target_opacity. Else, parse all arguments. -if test $# -eq 1 && echo "$1" | grep -qE '^[+-]?[[:digit:]]+%?$' -then - target_opacity=$1 - shift -else - parse_args "$@" -fi - - -# reset_opacity doesn't need $winid -case $action in - (reset) reset_opacity;; -esac - -# Any other action needs $winid -# -# NOTE: Do NOT change the order of winid= and winidtype= below -# the output of get_target_window_id depends on $winidtype -# -# NOTE: If get_target_window_id returns with a non-zero $? -# that must mean that some error occured. So, exit with that same $? -# -winid=$(get_target_window_id) || exit $? -winidtype=-id -case $action in - (set) set_opacity;; - (get) get_opacity;; - (delete) delete_opacity;; - (toggle) toggle_opacity;; -esac - - -# We should never reach this part of the file -echo "This sentence shouldn't have been printed. Please file a bug report." >&2 -exit 128 - - -# vim:ft=sh:ts=4:sts=4:sw=2:et:fdm=marker:fmr=#{{,#}}:nowrap diff --git a/dwm/picom/compton-default-fshader-win.glsl b/dwm/picom/compton-default-fshader-win.glsl deleted file mode 100644 index e319523..0000000 --- a/dwm/picom/compton-default-fshader-win.glsl +++ /dev/null @@ -1,11 +0,0 @@ -uniform float opacity; -uniform bool invert_color; -uniform sampler2D tex; - -void main() { - vec4 c = texture2D(tex, gl_TexCoord[0]); - if (invert_color) - c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a); - c *= opacity; - gl_FragColor = c; -} diff --git a/dwm/picom/compton-fake-transparency-fshader-win.glsl b/dwm/picom/compton-fake-transparency-fshader-win.glsl deleted file mode 100644 index 88e3653..0000000 --- a/dwm/picom/compton-fake-transparency-fshader-win.glsl +++ /dev/null @@ -1,19 +0,0 @@ -uniform float opacity; -uniform bool invert_color; -uniform sampler2D tex; - -void main() { - vec4 c = texture2D(tex, gl_TexCoord[0]); - { - // Change vec4(1.0, 1.0, 1.0, 1.0) to your desired color - vec4 vdiff = abs(vec4(1.0, 1.0, 1.0, 1.0) - c); - float diff = max(max(max(vdiff.r, vdiff.g), vdiff.b), vdiff.a); - // Change 0.8 to your desired opacity - if (diff < 0.001) - c *= 0.8; - } - if (invert_color) - c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a); - c *= opacity; - gl_FragColor = c; -} diff --git a/dwm/picom/compton.desktop b/dwm/picom/compton.desktop deleted file mode 100644 index 77734f1..0000000 --- a/dwm/picom/compton.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -NoDisplay=true -Name=compton -GenericName=X compositor -Comment=An X compositor -Categories=Utility; -Keywords=compositor;composite manager;window effects;transparency;opacity; -TryExec=compton -Exec=compton -Icon=compton -# Thanks to quequotion for providing this file! diff --git a/dwm/picom/dbus-examples/cdbus-driver.sh b/dwm/picom/dbus-examples/cdbus-driver.sh deleted file mode 100755 index 31a9b2f..0000000 --- a/dwm/picom/dbus-examples/cdbus-driver.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -if [ -z "$SED" ]; then - SED="sed" - command -v gsed > /dev/null && SED="gsed" -fi - -# === Get connection parameters === - -dpy=$(echo -n "$DISPLAY" | tr -c '[:alnum:]' _) - -if [ -z "$dpy" ]; then - echo "Cannot find display." - exit 1 -fi - -service="com.github.chjj.compton.${dpy}" -interface='com.github.chjj.compton' -object='/com/github/chjj/compton' -type_win='uint32' -type_enum='uint32' - -# === DBus methods === - -# List all window ID compton manages (except destroyed ones) -dbus-send --print-reply --dest="$service" "$object" "${interface}.list_win" - -# Get window ID of currently focused window -focused=$(dbus-send --print-reply --dest="$service" "$object" "${interface}.find_win" string:focused | $SED -n 's/^[[:space:]]*'${type_win}'[[:space:]]*\([[:digit:]]*\).*/\1/p') - -if [ -n "$focused" ]; then - # Get invert_color_force property of the window - dbus-send --print-reply --dest="$service" "$object" "${interface}.win_get" "${type_win}:${focused}" string:invert_color_force - - # Set the window to have inverted color - dbus-send --print-reply --dest="$service" "$object" "${interface}.win_set" "${type_win}:${focused}" string:invert_color_force "${type_enum}:1" -else - echo "Cannot find focused window." -fi - -# Reset compton -sleep 3 -dbus-send --print-reply --dest="$service" "$object" "${interface}.reset" - -# Undirect window -sleep 3 -dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_set" string:redirected_force "${type_enum}:0" - -# Revert back to auto -sleep 3 -dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_set" string:redirected_force "${type_enum}:2" - -# Force repaint -dbus-send --print-reply --dest="$service" "$object" "${interface}.repaint" diff --git a/dwm/picom/dbus-examples/inverter.sh b/dwm/picom/dbus-examples/inverter.sh deleted file mode 100755 index e13cb2d..0000000 --- a/dwm/picom/dbus-examples/inverter.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# == Declare stderr function === - -stderr() { - printf "\033[1;31m%s\n\033[0m" "$@" >&2 -} - -# === Verify `picom --dbus` status === - -if [ -z "$(dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep compton)" ]; then - stderr "picom DBus interface unavailable" - if [ -n "$(pgrep picom)" ]; then - stderr "picom running without dbus interface" - #killall picom & # Causes all windows to flicker away and come back ugly. - #picom --dbus & # Causes all windows to flicker away and come back beautiful - else - stderr "picom not running" - fi - exit 1 -fi - -# === Setup sed === - -SED="${SED:-$(command -v gsed || printf 'sed')}" - -# === Get connection parameters === - -dpy=$(printf "$DISPLAY" | tr -c '[:alnum:]' _) - -if [ -z "$dpy" ]; then - stderr "Cannot find display." - exit 1 -fi - -service="com.github.chjj.compton.${dpy}" -interface="com.github.chjj.compton" -picom_dbus="dbus-send --print-reply --dest="${service}" / "${interface}"." -type_win='uint32' -type_enum='uint32' - -# === Color Inversion === - -# Get window ID of window to invert -if [ -z "$1" -o "$1" = "selected" ]; then - window=$(xwininfo -frame | sed -n 's/^xwininfo: Window id: \(0x[[:xdigit:]][[:xdigit:]]*\).*/\1/p') # Select window by mouse -elif [ "$1" = "focused" ]; then - # Ensure we are tracking focus - window=$(${picom_dbus}find_win string:focused | $SED -n 's/^[[:space:]]*'${type_win}'[[:space:]]*\([[:digit:]]*\).*/\1/p') # Query picom for the active window -elif echo "$1" | grep -Eiq '^([[:digit:]][[:digit:]]*|0x[[:xdigit:]][[:xdigit:]]*)$'; then - window="$1" # Accept user-specified window-id if the format is correct -else - echo "$0" "[ selected | focused | window-id ]" -fi - -# Color invert the selected or focused window -if [ -n "$window" ]; then - invert_status="$(${picom_dbus}win_get "${type_win}:${window}" string:invert_color | $SED -n 's/^[[:space:]]*boolean[[:space:]]*\([[:alpha:]]*\).*/\1/p')" - if [ "$invert_status" = true ]; then - invert=0 # Set the window to have normal color - else - invert=1 # Set the window to have inverted color - fi - ${picom_dbus}win_set "${type_win}:${window}" string:invert_color_force "${type_enum}:${invert}" & -else - stderr "Cannot find $1 window." - exit 1 -fi -exit 0 diff --git a/dwm/picom/desc.txt b/dwm/picom/desc.txt deleted file mode 100644 index eadc037..0000000 --- a/dwm/picom/desc.txt +++ /dev/null @@ -1 +0,0 @@ -Compton is a X compositing window manager, fork of xcompmgr-dana. diff --git a/dwm/picom/man/meson.build b/dwm/picom/man/meson.build deleted file mode 100644 index 6324830..0000000 --- a/dwm/picom/man/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -mans = ['picom.1', 'picom-trans.1'] -if get_option('with_docs') - a2x = find_program('a2x') - foreach m : mans - custom_target(m, output: [m], input: [m+'.asciidoc'], - command: [a2x, '-a', - 'picom-version='+version, - '--format', 'manpage', '@INPUT@', '-D', - meson.current_build_dir()], - install: true, - install_dir: join_paths(get_option('mandir'), 'man1')) - endforeach -endif diff --git a/dwm/picom/man/picom-trans.1.asciidoc b/dwm/picom/man/picom-trans.1.asciidoc deleted file mode 100644 index 22b1dd2..0000000 --- a/dwm/picom/man/picom-trans.1.asciidoc +++ /dev/null @@ -1,114 +0,0 @@ -picom-trans(1) -================ -:doctype: manpage -:man source: picom -:man version: {picom-version} -:man manual: User Commands - -NAME ----- -picom-trans - an opacity setter tool - -SYNOPSIS --------- - -*picom-trans* [-w 'WINDOW_ID'] [-n 'WINDOW_NAME'] [-c] [-s] 'OPACITY' - -DESCRIPTION ------------ - -*picom-trans* is a bash script that sets '_NET_WM_WINDOW_OPACITY' attribute of a window using standard X11 command-line utilities, including *xprop*(1) and *xwininfo*(1). It is similar to *transset*(1) or *transset-df*(1). - -OPTIONS -------- -*-w*, *--window*='WINDOW_ID':: -Specify the window id of the target window. - -*-n*, *--name*='WINDOW_NAME':: -Specify and try to match a window name. - -*-c*, *--current*:: -Specify the currently active window as target. Only works if EWMH '_NET_ACTIVE_WINDOW' property exists on root window. - -*-s*, *--select*:: -Select target window with mouse cursor. This is the default if no window has been specified. - -*-o*, *--opacity*='OPACITY':: -Specify the new opacity value for the window. This value can be anywhere from 1-100. If it is prefixed with a plus or minus (+/-), this will increment or decrement from the target window's current opacity instead. - -*-g*, *--get*:: -Print the target window's opacity instead of setting it. - -*-d*, *--delete*:: -Delete opacity of the target window instead of setting it. - -*-t*, *--toggle*:: -Toggle the target window's opacity: Set opacity if not already set, and delete if already set. - -*-r*, *--reset*:: -Reset opacity for all windows instead of setting it. - -EXAMPLES --------- - -* Set the opacity of the window with specific window ID to 75%: -+ ------------- -picom-trans -w "$WINDOWID" 75 ------------- - -* Set the opacity of the window with the name "urxvt" to 75%: -+ ------------- -picom-trans -n "urxvt" 75 ------------- - -* Set current window to opacity of 75%: -+ ------------- -picom-trans -c 75 ------------- - -* Select target window and set opacity to 75%: -+ ------------- -picom-trans -s 75 ------------- - -* Increment opacity of current active window by 5%: -+ ------------- -picom-trans -c +5 ------------- - -* Decrement opacity of current active window by 5%: -+ ------------- -picom-trans -c -- -5 ------------- - -* Delete current window's opacity: -+ ------------- -picom-trans -c --delete ------------- - -* Toggle current window's opacity between 90 and unset -+ ------------- -picom-trans -c --toggle 90 ------------- - -* Reset all windows: -+ ------------- -picom-trans --reset ------------- - -BUGS ----- -Please submit bug reports to . - -SEE ALSO --------- -link:picom.1.html[*picom*(1)], *xprop*(1), *xwininfo*(1) diff --git a/dwm/picom/man/picom.1.asciidoc b/dwm/picom/man/picom.1.asciidoc deleted file mode 100644 index ccd7e43..0000000 --- a/dwm/picom/man/picom.1.asciidoc +++ /dev/null @@ -1,509 +0,0 @@ -picom(1) -======== -:doctype: manpage -:man source: picom -:man version: {picom-version} -:man manual: User Commands - -NAME ----- -picom - a compositor for X11 - -SYNOPSIS --------- -*picom* ['OPTIONS'] - -DESCRIPTION ------------ -picom is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency. - -OPTIONS -------- -*-h*, *--help*:: - Get the usage text embedded in program code, which may be more up-to-date than this man page. - -*-r*, *--shadow-radius*='RADIUS':: - The blur radius for shadows, in pixels. (defaults to 12) - -*-o*, *--shadow-opacity*='OPACITY':: - The opacity of shadows. (0.0 - 1.0, defaults to 0.75) - -*-l*, *--shadow-offset-x*='OFFSET':: - The left offset for shadows, in pixels. (defaults to -15) - -*-t*, *--shadow-offset-y*='OFFSET':: - The top offset for shadows, in pixels. (defaults to -15) - -*-I*, *--fade-in-step*='OPACITY_STEP':: - Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) - -*-O*, *--fade-out-step*='OPACITY_STEP':: - Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) - -*-D*, *--fade-delta*='MILLISECONDS':: - The time between steps in fade step, in milliseconds. (> 0, defaults to 10) - -*-c*, *--shadow*:: - Enabled client-side shadows on windows. Note desktop windows (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, unless explicitly requested using the wintypes option. - -*-f*, *--fading*:: - Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used. - -*-F*:: - Equals to *-f*. Deprecated. - -*--animations*:: - Run animations for window geometry changes (movement and scaling). - We use spring-based animations, which are parametrized by *--animation-stiffness*, *--animation-dampening*, *--animation-window-mass* and *--animation-clamp*. + - A useful resource for selecting animation parameters is https://react-spring-visualizer.com/, which allows you to interactively try out various parameters and see the resulting animation curve. Or you can just edit the values in the config file, which is automatically reloaded. - -*--animation-for-open-window*:: - Which animation to run when opening a window. Must be one of `none`, `fly-in`, `zoom` (default: `none`). - -*--animation-stiffness*:: - Stiffness (a.k.a. tension) parameter for spring-based animation (default: 200.0). - -*--animation-dampening*:: - Dampening (a.k.a. friction) parameter for spring-based animation (default: 25.0). - -*--animation-window-mass*:: - Mass parameter for spring-based animation (default: 1.0). - -*--animation-clamping*:: - Whether to clamp animations (default: true). - - **NOTE:** With clamping disabled, on very low performance conditions (e.g., over 100ms to render an animation frame), windows may diverge. If this is your case, it is strongly advised to keep clamping on, as it protects against that. - -*-i*, *--inactive-opacity*='OPACITY':: - Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) - -*-e*, *--frame-opacity*='OPACITY':: - Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) - -*-b*, *--daemon*:: - Daemonize process. Fork to background after initialization. This option can only be set from the command line, setting this in the configuration file will have no effect. - -*--log-level*:: - Set the log level. Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using *--log-file*, since it can generate a huge stream of logs. - -*--log-file*:: - Set the log file. If *--log-file* is never specified, logs will be written to stderr. Otherwise, logs will to written to the given file, though some of the early logs might still be written to the stderr. When setting this option from the config file, it is recommended to use an absolute path. - -*--experimental-backends*:: - Use the new, reimplemented version of the backends. The new backends are HIGHLY UNSTABLE at this point, you have been warned. This option is not available in the config file. - -*--show-all-xerrors*:: - Show all X errors (for debugging). - -*--config* 'PATH':: - Look for configuration file at the path. See *CONFIGURATION FILES* section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file. - -*--write-pid-path* 'PATH':: - Write process ID to a file. it is recommended to use an absolute path. - -*--shadow-color* 'STRING':: - Color of shadow, as a hex string ('#000000') - -*--shadow-red* 'VALUE':: - Red color value of shadow (0.0 - 1.0, defaults to 0). - -*--shadow-green* 'VALUE':: - Green color value of shadow (0.0 - 1.0, defaults to 0). - -*--shadow-blue* 'VALUE':: - Blue color value of shadow (0.0 - 1.0, defaults to 0). - -*--inactive-opacity-override*:: - Let inactive opacity set by *-i* override the '_NET_WM_WINDOW_OPACITY' values of windows. - -*--active-opacity* 'OPACITY':: - Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) - -*--inactive-dim* 'VALUE':: - Dim inactive windows. (0.0 - 1.0, defaults to 0.0) - -*--corner-radius* 'VALUE':: - Sets the radius of rounded window corners. When > 0, the compositor will round the corners of windows. Does not interact well with *--transparent-clipping*. (defaults to 0). - -*--rounded-corners-exclude* 'CONDITION':: - Exclude conditions for rounded corners. - -*--mark-wmwin-focused*:: - Try to detect WM windows (a non-override-redirect window with no child that has 'WM_STATE') and mark them as active. - -*--mark-ovredir-focused*:: - Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. - -*--no-fading-openclose*:: - Do not fade on window open/close. - -*--no-fading-destroyed-argb*:: - Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. - -*--shadow-ignore-shaped*:: - Do not paint shadows on shaped windows. Note shaped windows here means windows setting its shape through X Shape extension. Those using ARGB background is beyond our control. Deprecated, use `--shadow-exclude 'bounding_shaped'` or `--shadow-exclude 'bounding_shaped && !rounded_corners'` instead. - -*--detect-rounded-corners*:: - Try to detect windows with rounded corners and don't consider them shaped windows. The accuracy is not very high, unfortunately. - -*--detect-client-opacity*:: - Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. - -*--vsync*, *--no-vsync*:: - Enable/disable VSync. - -*--use-ewmh-active-win*:: - Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it. - -*--unredir-if-possible*:: - Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows. - -*--unredir-if-possible-delay* 'MILLISECONDS':: - Delay before unredirecting the window, in milliseconds. Defaults to 0. - -*--unredir-if-possible-exclude* 'CONDITION':: - Conditions of windows that shouldn't be considered full-screen for unredirecting screen. - -*--shadow-exclude* 'CONDITION':: - Specify a list of conditions of windows that should have no shadow. - -*--clip-shadow-above* 'CONDITION':: - Specify a list of conditions of windows that should have no shadow painted over, such as a dock window. - -*--fade-exclude* 'CONDITION':: - Specify a list of conditions of windows that should not be faded. - -*--focus-exclude* 'CONDITION':: - Specify a list of conditions of windows that should always be considered focused. - -*--inactive-dim-fixed*:: - Use fixed inactive dim value, instead of adjusting according to window opacity. - -*--detect-transient*:: - Use 'WM_TRANSIENT_FOR' to group windows, and consider windows in the same group focused at the same time. - -*--detect-client-leader*:: - Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same group focused at the same time. This usually means windows from the same application will be considered focused or unfocused at the same time.'WM_TRANSIENT_FOR' has higher priority if *--detect-transient* is enabled, too. - -*--blur-method*, *--blur-size*, *--blur-deviation*, *--blur-strength*:: - Parameters for background blurring, see the *BLUR* section for more information. - -*--blur-background*:: - Blur background of semi-transparent / ARGB windows. Bad in performance, with driver-dependent behavior. The name of the switch may change without prior notifications. - -*--blur-background-frame*:: - Blur background of windows when the window frame is not opaque. Implies *--blur-background*. Bad in performance, with driver-dependent behavior. The name may change. - -*--blur-background-fixed*:: - Use fixed blur strength rather than adjusting according to window opacity. - -*--blur-kern* 'MATRIX':: - Specify the blur convolution kernel, with the following format: -+ ----- -WIDTH,HEIGHT,ELE1,ELE2,ELE3,ELE4,ELE5... ----- -+ -In other words, the matrix is formatted as a list of comma separated numbers. The first two numbers must be integers, which specify the width and height of the matrix. They must be odd numbers. Then, the following 'width * height - 1' numbers specifies the numbers in the matrix, row by row, excluding the center element. -+ -The elements are finite floating point numbers. The decimal pointer has to be '.' (a period), scientific notation is not supported. -+ -The element in the center will either be 1.0 or varying based on opacity, depending on whether you have *--blur-background-fixed*. Yet the automatic adjustment of blur factor may not work well with a custom blur kernel. -+ -A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like: -+ ----- ---blur-kern '7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.001723,0.059106,0.493069,0.493069,0.059106,0.001723,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003' ----- -+ -May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Gaussian kernels are generated with sigma = 0.84089642 . If you find yourself needing to generate custom blur kernels, you might want to try the new blur configuration supported by the experimental backends (See *BLUR* and *--experimental-backends*). - -*--blur-background-exclude* 'CONDITION':: - Exclude conditions for background blur. - -*--resize-damage* 'INTEGER':: - Resize damaged region by a specific number of pixels. A positive value enlarges it while a negative one shrinks it. If the value is positive, those additional pixels will not be actually painted to screen, only used in blur calculation, and such. (Due to technical limitations, with *--use-damage*, those pixels will still be incorrectly painted to screen.) Primarily used to fix the line corruption issues of blur, in which case you should use the blur radius value here (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, with a 5x5 one you use `--resize-damage 2`, and so on). May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. - -*--invert-color-include* 'CONDITION':: - Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested. - -*--opacity-rule* 'OPACITY':'CONDITION':: - Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name *= "Firefox"`. picom-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. - -*--shadow-exclude-reg* 'GEOMETRY':: - Specify a X geometry that describes the region in which shadow should not be painted in, such as a dock window region. Use `--shadow-exclude-reg x10+0-0`, for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. - -*--xinerama-shadow-crop*:: - Crop shadow of a window fully on a particular Xinerama screen to the screen. - -*--backend* 'BACKEND':: - Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. `xrender` is the default one. -+ --- -* `xrender` backend performs all rendering operations with X Render extension. It is what `xcompmgr` uses, and is generally a safe fallback when you encounter rendering artifacts or instability. -* `glx` (OpenGL) backend performs all rendering operations with OpenGL. It is more friendly to some VSync methods, and has significantly superior performance on color inversion (*--invert-color-include*) or blur (*--blur-background*). It requires proper OpenGL 2.0 support from your driver and hardware. You may wish to look at the GLX performance optimization options below. *--xrender-sync-fence* might be needed on some systems to avoid delay in changes of screen contents. -* `xr_glx_hybrid` backend renders the updated screen contents with X Render and presents it on the screen with GLX. It attempts to address the rendering issues some users encountered with GLX backend and enables the better VSync of GLX backends. *--vsync-use-glfinish* might fix some rendering issues with this backend. --- - -*--glx-no-stencil*:: - GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content (but never practically happened) and may not work with *--blur-background*. My tests show a 15% performance boost. Recommended. - -*--glx-no-rebind-pixmap*:: - GLX backend: Avoid rebinding pixmap on window damage. Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended if it works. - -*--no-use-damage*:: - Disable the use of damage information. This cause the whole screen to be redrawn everytime, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts. - -*--xrender-sync-fence*:: - Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users. - -*--glx-fshader-win* 'SHADER':: - GLX backend: Use specified GLSL fragment shader for rendering window contents. See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` in the source tree for examples. - -*--force-win-blend*:: - Force all windows to be painted with blending. Useful if you have a *--glx-fshader-win* that could turn opaque pixels transparent. - -*--dbus*:: - Enable remote control via D-Bus. See the *D-BUS API* section below for more details. - -*--benchmark* 'CYCLES':: - Benchmark mode. Repeatedly paint until reaching the specified cycles. - -*--benchmark-wid* 'WINDOW_ID':: - Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole screen is repainted. - -*--no-ewmh-fullscreen*:: - Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is fullscreen based only on its size and coordinates. - -*--max-brightness*:: - Dimming bright windows so their brightness doesn't exceed this set value. Brightness of a window is estimated by averaging all pixels in the window, so this could comes with a performance hit. Setting this to 1.0 disables this behaviour. Requires *--use-damage* to be disabled. (default: 1.0) - -*--transparent-clipping*:: - Make transparent windows clip other windows like non-transparent windows do, instead of blending on top of them. - -FORMAT OF CONDITIONS --------------------- -Some options accept a condition string to match certain windows. A condition string is formed by one or more conditions, joined by logical operators. - -A condition with "exists" operator looks like this: - - [] : - -With equals operator it looks like: - - [] : = - -With greater-than/less-than operators it looks like: - - [] : - -'NEGATION' (optional) is one or more exclamation marks; - -'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `x`, `y`, `x2` (`x` + `widthb`), `y2` (like `x2`), `width`, `height`, `widthb` (`width` + 2 * `border_width`), `heightb` (like `widthb`), `border_width`, `fullscreen`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `bounding_shaped`, `rounded_corners` (requires *--detect-rounded-corners*), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`. - -'CLIENT/FRAME' is a single `@` if the window attribute should be be looked up on client window, nothing if on frame window; - -'INDEX' (optional) is the index number of the property to look up. For example, `[2]` means look at the third value in the property. If not specified, the first value (index `[0]`) is used implicitly. Use the special value `[*]` to perform matching against all available property values using logical OR. Do not specify it for predefined targets. - -'FORMAT' (optional) specifies the format of the property, 8, 16, or 32. On absence we use format X reports. Do not specify it for predefined or string targets. - -'TYPE' is a single character representing the type of the property to match for: `c` for 'CARDINAL', `a` for 'ATOM', `w` for 'WINDOW', `d` for 'DRAWABLE', `s` for 'STRING' (and any other string types, such as 'UTF8_STRING'). Do not specify it for predefined targets. - -'OP QUALIFIER' (optional), applicable only for equals operator, could be `?` (ignore-case). - -'MATCH TYPE' (optional), applicable only for equals operator, could be nothing (exact match), `*` (match anywhere), `^` (match from start), `%` (wildcard), or `~` (PCRE regular expression). - -'OPERATOR' is one of `=` (equals), `<`, `>`, `<=`, `=>`, or nothing (exists). Exists operator checks whether a property exists on a window (but for predefined targets, exists means != 0 then). - -'PATTERN' is either an integer or a string enclosed by single or double quotes. Python-3-style escape sequences and raw string are supported in the string format. - -Supported logical operators are `&&` (and) and `||` (or). `&&` has higher precedence than `||`, left-to-right associativity. Use parentheses to change precedence. - -Examples: - - # If the window is focused - focused - focused = 1 - # If the window is not override-redirected - !override_redirect - override_redirect = false - override_redirect != true - override_redirect != 1 - # If the window is a menu - window_type *= "menu" - _NET_WM_WINDOW_TYPE@:a *= "MENU" - # If the window is marked hidden: _NET_WM_STATE contains _NET_WM_STATE_HIDDEN - _NET_WM_STATE@[*]:a = "_NET_WM_STATE_HIDDEN" - # If the window is marked sticky: _NET_WM_STATE contains an atom that contains - # "sticky", ignore case - _NET_WM_STATE@[*]:a *?= "sticky" - # If the window name contains "Firefox", ignore case - name *?= "Firefox" - _NET_WM_NAME@:s *?= "Firefox" - # If the window name ends with "Firefox" - name %= "*Firefox" - name ~= "Firefox$" - # If the window has a property _COMPTON_SHADOW with value 0, type CARDINAL, - # format 32, value 0, on its frame window - _COMPTON_SHADOW:32c = 0 - # If the third value of _NET_FRAME_EXTENTS is less than 20, or there's no - # _NET_FRAME_EXTENTS property on client window - _NET_FRAME_EXTENTS@[2]:32c < 20 || !_NET_FRAME_EXTENTS@:32c - # The pattern here will be parsed as "dd4" - name = "\x64\x64\o64" - # The pattern here will be parsed as "\x64\x64\x64" - name = r"\x64\x64\o64" - - -LEGACY FORMAT OF CONDITIONS ---------------------------- - -This is the old condition format we once used. Support of this format might be removed in the future. - - condition = TARGET:TYPE[FLAGS]:PATTERN - -'TARGET' is one of "n" (window name), "i" (window class instance), "g" (window general class), and "r" (window role). - -'TYPE' is one of "e" (exact match), "a" (match anywhere), "s" (match from start), "w" (wildcard), and "p" (PCRE regular expressions, if compiled with the support). - -'FLAGS' could be a series of flags. Currently the only defined flag is "i" (ignore case). - -'PATTERN' is the actual pattern string. - -CONFIGURATION FILES -------------------- -picom could read from a configuration file if libconfig support is compiled in. If *--config* is not used, picom will seek for a configuration file in `$XDG_CONFIG_HOME/picom.conf` (`~/.config/picom.conf`, usually), then `$XDG_CONFIG_HOME/picom/picom.conf`, then `$XDG_CONFIG_DIRS/picom.conf` (often `/etc/xdg/picom.conf`), then `$XDG_CONFIG_DIRS/picom/picom.conf`. - -picom uses general libconfig configuration file format. A sample configuration file is available as `picom.sample.conf` in the source tree. Most of commandline switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file. - -Window-type-specific settings are exposed only in configuration file and has the following format: - ------------- -wintypes: -{ - WINDOW_TYPE = { fade = BOOL; shadow = BOOL; opacity = FLOAT; focus = BOOL; blur-background = BOOL; full-shadow = BOOL; clip-shadow-above = BOOL; redir-ignore = BOOL; }; -}; ------------- - -'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: "unknown", "desktop", "dock", "toolbar", "menu", "utility", "splash", "dialog", "normal", "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd". - -Following per window-type options are available: :: - - fade, shadow::: - Controls window-type-specific shadow and fade settings. - - opacity::: - Controls default opacity of the window type. - - focus::: - Controls whether the window of this type is to be always considered focused. (By default, all window types except "normal" and "dialog" has this on.) - - blur-background::: - Controls wether the window of this type will have its transparent background blurred. - - full-shadow::: - Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas. - - clip-shadow-above::: - Controls wether shadows that would have been drawn above the window should be clipped. Useful for dock windows that should have no shadow painted on top. - - redir-ignore::: - Controls whether this type of windows should cause screen to become redirected again after been unredirected. If you have *--unredir-if-possible* set, and doesn't want certain window to cause unnecessary screen redirection, you can set this to `true`. - -BLUR ----- -You can configure how the window background is blurred using a 'blur' section in your configuration file. Here is an example: - --------- -blur: -{ - method = "gaussian"; - size = 10; - deviation = 5.0; -}; --------- - -Available options of the 'blur' section are: :: - - *method*::: - A string. Controls the blur method. Corresponds to the *--blur-method* command line option. Available choices are: - 'none' to disable blurring; 'gaussian' for gaussian blur; 'box' for box blur; 'kernel' for convolution blur with a custom kernel; 'dual_kawase' for dual-filter kawase blur. - Note: 'gaussian', 'box' and 'dual_kawase' blur methods are only supported by the experimental backends. - (default: none) - - *size*::: - An integer. The size of the blur kernel, required by 'gaussian' and 'box' blur methods. For the 'kernel' method, the size is included in the kernel. Corresponds to the *--blur-size* command line option (default: 3). - - *deviation*::: - A floating point number. The standard deviation for the 'gaussian' blur method. Corresponds to the *--blur-deviation* command line option (default: 0.84089642). - - *strength*::: - An integer in the range 0-20. The strength of the 'dual_kawase' blur method. Corresponds to the *--blur-strength* command line option. If set to zero, the value requested by *--blur-size* is approximated (default: 5). - - *kernel*::: - A string. The kernel to use for the 'kernel' blur method, specified in the same format as the *--blur-kerns* option. Corresponds to the *--blur-kerns* command line option. - -SIGNALS -------- - -* picom reinitializes itself upon receiving `SIGUSR1`. - -D-BUS API ---------- - -It's possible to control picom via D-Bus messages, by running picom with *--dbus* and send messages to `com.github.chjj.compton.`. `` is the display used by picom, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example. - -The D-Bus methods and signals are not yet stable, thus undocumented right now. - -EXAMPLES --------- - -* Disable configuration file parsing: -+ ------------- -$ picom --config /dev/null ------------- - -* Run picom with client-side shadow and fading: -+ ------------- -$ picom -cf ------------- - -* Same thing as above, plus making inactive windows 80% transparent, making frame 80% transparent, don't fade on window open/close, and fork to background: -+ ------------- -$ picom -bcf -i 0.8 -e 0.8 --no-fading-openclose ------------- - -* Draw white shadows: -+ ------------- -$ picom -c --shadow-red 1 --shadow-green 1 --shadow-blue 1 ------------- - -* Avoid drawing shadows on wbar window: -+ ------------- -$ picom -c --shadow-exclude 'class_g = "wbar"' ------------- - -* Enable VSync with GLX backend: -+ ------------- -$ picom --backend glx --vsync ------------- - -BUGS ----- -Please submit bug reports to . - -Out dated information in this man page is considered a bug. - -RESOURCES ---------- -Homepage: - -SEE ALSO --------- -*xcompmgr*(1), link:picom-trans.html[*picom-trans*(1)] diff --git a/dwm/picom/media/compton.svg b/dwm/picom/media/compton.svg deleted file mode 100644 index cfe1842..0000000 --- a/dwm/picom/media/compton.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dwm/picom/media/icons/48x48/compton.png b/dwm/picom/media/icons/48x48/compton.png deleted file mode 100644 index 8eb6320..0000000 Binary files a/dwm/picom/media/icons/48x48/compton.png and /dev/null differ diff --git a/dwm/picom/meson.build b/dwm/picom/meson.build deleted file mode 100644 index 505dba2..0000000 --- a/dwm/picom/meson.build +++ /dev/null @@ -1,83 +0,0 @@ -project('picom', 'c', version: '9', - default_options: ['c_std=c11']) - -cc = meson.get_compiler('c') - -# use project version by default -version = 'v'+meson.project_version() - -# use git describe if that's available -git = find_program('git', required: false) -if git.found() - gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD') - if gitv.returncode() == 0 - version = 'vgit-'+gitv.stdout().strip() - endif -endif - -add_global_arguments('-DCOMPTON_VERSION="'+version+'"', language: 'c') - -if get_option('buildtype') == 'release' - add_global_arguments('-DNDEBUG', language: 'c') -endif - -if get_option('sanitize') - sanitizers = ['address', 'undefined'] - if cc.has_argument('-fsanitize=integer') - sanitizers += ['integer'] - endif - if cc.has_argument('-fsanitize=nullability') - sanitizers += ['nullability'] - endif - add_global_arguments('-fsanitize='+','.join(sanitizers), language: 'c') - add_global_link_arguments('-fsanitize='+','.join(sanitizers), language: 'c') - if cc.has_argument('-fno-sanitize=unsigned-integer-overflow') - add_global_arguments('-fno-sanitize=unsigned-integer-overflow', language: 'c') - endif -endif - -if get_option('modularize') - if not cc.has_argument('-fmodules') - error('option \'modularize\' requires clang') - endif - add_global_arguments(['-fmodules', - '-fmodule-map-file='+ - meson.current_source_dir()+ - '/src/picom.modulemap'], - language: 'c') -endif - -add_global_arguments('-D_GNU_SOURCE', language: 'c') - -if cc.has_header('stdc-predef.h') - add_global_arguments('-DHAS_STDC_PREDEF_H', language: 'c') -endif - -warns = [ 'all', 'cast-function-type', 'ignored-qualifiers', 'missing-parameter-type', - 'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init', - 'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value', - 'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough', - 'no-unknown-warning-option', 'no-missing-braces', 'conversion', 'empty-body' ] -foreach w : warns - if cc.has_argument('-W'+w) - add_global_arguments('-W'+w, language: 'c') - endif -endforeach - -test_h_dep = subproject('test.h').get_variable('test_h_dep') - -subdir('src') -subdir('man') - -install_data('bin/picom-trans', install_dir: get_option('bindir')) -install_data('picom.desktop', install_dir: 'share/applications') - -if get_option('compton') - install_data('compton.desktop', install_dir: 'share/applications') - install_data('media/icons/48x48/compton.png', - install_dir: 'share/icons/hicolor/48x48/apps') - install_data('media/compton.svg', - install_dir: 'share/icons/hicolor/scalable/apps') - - meson.add_install_script('meson/install.sh') -endif diff --git a/dwm/picom/meson/install.sh b/dwm/picom/meson/install.sh deleted file mode 100755 index a591c39..0000000 --- a/dwm/picom/meson/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" ]; then - echo "Linking picom to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" - ln -s picom "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton" -fi - -if [ ! -e "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" ]; then - echo "Linking picom-trans to ${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" - ln -s picom-trans "${MESON_INSTALL_DESTDIR_PREFIX}/bin/compton-trans" -fi diff --git a/dwm/picom/meson_options.txt b/dwm/picom/meson_options.txt deleted file mode 100644 index 9c3b0da..0000000 --- a/dwm/picom/meson_options.txt +++ /dev/null @@ -1,18 +0,0 @@ -option('sanitize', type: 'boolean', value: false, description: 'Build with sanitizers enabled (deprecated)') -option('config_file', type: 'boolean', value: true, description: 'Enable config file support') -option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions') - -option('vsync_drm', type: 'boolean', value: false, description: 'Enable support for using drm for vsync') - -option('opengl', type: 'boolean', value: true, description: 'Enable features that require opengl (opengl backend, and opengl vsync methods)') -option('dbus', type: 'boolean', value: true, description: 'Enable support for D-Bus remote control') - -option('xrescheck', type: 'boolean', value: false, description: 'Enable X resource leak checker (for debug only)') - -option('compton', type: 'boolean', value: true, description: 'Install backwards compat with compton') - -option('with_docs', type: 'boolean', value: false, description: 'Build documentation and man pages') - -option('modularize', type: 'boolean', value: false, description: 'Build with clang\'s module system') - -option('unittest', type: 'boolean', value: false, description: 'Enable unittests in the code') diff --git a/dwm/picom/picom-dbus.desktop b/dwm/picom/picom-dbus.desktop deleted file mode 100644 index 5f35c8e..0000000 --- a/dwm/picom/picom-dbus.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -NoDisplay=true -Name=picom (dbus) -GenericName=X compositor (dbus) -Comment=An X compositor with dbus backend enabled -Categories=Utility; -Keywords=compositor;composite manager;window effects;transparency;opacity; -TryExec=picom -Exec=picom --dbus diff --git a/dwm/picom/picom.desktop b/dwm/picom/picom.desktop deleted file mode 100644 index 9d21f6d..0000000 --- a/dwm/picom/picom.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -NoDisplay=false -Name=picom -GenericName=X compositor -Comment=An X compositor -Categories=Utility; -Keywords=compositor;composite manager;window effects;transparency;opacity; -TryExec=picom -Exec=picom -# Thanks to quequotion for providing this file! -Icon=picom diff --git a/dwm/picom/picom.sample.conf b/dwm/picom/picom.sample.conf deleted file mode 100644 index efc04a4..0000000 --- a/dwm/picom/picom.sample.conf +++ /dev/null @@ -1,455 +0,0 @@ -################################# -# Shadows # -################################# - - -# Enabled client-side shadows on windows. Note desktop windows -# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, -# unless explicitly requested using the wintypes option. -# -# shadow = false -shadow = true; - -# The blur radius for shadows, in pixels. (defaults to 12) -# shadow-radius = 12 -shadow-radius = 7; - -# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) -# shadow-opacity = .75 - -# The left offset for shadows, in pixels. (defaults to -15) -# shadow-offset-x = -15 -shadow-offset-x = -7; - -# The top offset for shadows, in pixels. (defaults to -15) -# shadow-offset-y = -15 -shadow-offset-y = -7; - -# Red color value of shadow (0.0 - 1.0, defaults to 0). -# shadow-red = 0 - -# Green color value of shadow (0.0 - 1.0, defaults to 0). -# shadow-green = 0 - -# Blue color value of shadow (0.0 - 1.0, defaults to 0). -# shadow-blue = 0 - -# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue) -# shadow-color = "#000000" - -# Specify a list of conditions of windows that should have no shadow. -# -# examples: -# shadow-exclude = "n:e:Notification"; -# -# shadow-exclude = [] -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "_GTK_FRAME_EXTENTS@:c" -]; - -# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window. -# clip-shadow-above = [] - -# Specify a X geometry that describes the region in which shadow should not -# be painted in, such as a dock window region. Use -# shadow-exclude-reg = "x10+0+0" -# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. -# -# shadow-exclude-reg = "" - -# Crop shadow of a window fully on a particular Xinerama screen to the screen. -# xinerama-shadow-crop = false - - -################################# -# Fading # -################################# - - -# Fade windows in/out when opening/closing and when opacity changes, -# unless no-fading-openclose is used. -# fading = false -fading = true; - -# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) -# fade-in-step = 0.028 -fade-in-step = 0.03; - -# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) -# fade-out-step = 0.03 -fade-out-step = 0.03; - -# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) -# fade-delta = 10 - -# Specify a list of conditions of windows that should not be faded. -# fade-exclude = [] - -# Do not fade on window open/close. -# no-fading-openclose = false - -# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. -# no-fading-destroyed-argb = false - - -################################# -# Transparency / Opacity # -################################# - - -# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) -# inactive-opacity = 1 -inactive-opacity = 0.8; - -# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) -# frame-opacity = 1.0 -frame-opacity = 0.7; - -# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows. -# inactive-opacity-override = true -inactive-opacity-override = false; - -# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) -# active-opacity = 1.0 - -# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) -# inactive-dim = 0.0 - -# Specify a list of conditions of windows that should never be considered focused. -# focus-exclude = [] -focus-exclude = [ "class_g = 'Cairo-clock'" ]; - -# Use fixed inactive dim value, instead of adjusting according to window opacity. -# inactive-dim-fixed = 1.0 - -# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, -# like `50:name *= "Firefox"`. picom-trans is recommended over this. -# Note we don't make any guarantee about possible conflicts with other -# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. -# example: -# opacity-rule = [ "80:class_g = 'URxvt'" ]; -# -# opacity-rule = [] - - -################################# -# Corners # -################################# - -# Sets the radius of rounded window corners. When > 0, the compositor will -# round the corners of windows. Does not interact well with -# `transparent-clipping`. -corner-radius = 0 - -# Exclude conditions for rounded corners. -rounded-corners-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'" -]; - - -################################# -# Background-Blurring # -################################# - - -# Parameters for background blurring, see the *BLUR* section for more information. -# blur-method = -# blur-size = 12 -# -# blur-deviation = false -# -# blur-strength = 5 - -# Blur background of semi-transparent / ARGB windows. -# Bad in performance, with driver-dependent behavior. -# The name of the switch may change without prior notifications. -# -# blur-background = false - -# Blur background of windows when the window frame is not opaque. -# Implies: -# blur-background -# Bad in performance, with driver-dependent behavior. The name may change. -# -# blur-background-frame = false - - -# Use fixed blur strength rather than adjusting according to window opacity. -# blur-background-fixed = false - - -# Specify the blur convolution kernel, with the following format: -# example: -# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; -# -# blur-kern = "" -blur-kern = "3x3box"; - - -# Exclude conditions for background blur. -# blur-background-exclude = [] -blur-background-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c" -]; - -################################# -# General Settings # -################################# - -# Enable remote control via D-Bus. See the man page for more details. -# dbus = true - -# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. -# daemon = false - -# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. -# `xrender` is the default one. -# -# backend = "glx" -backend = "xrender"; - -# Enable/disable VSync. -# vsync = false -vsync = true; - -# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. -# dbus = false - -# Try to detect WM windows (a non-override-redirect window with no -# child that has 'WM_STATE') and mark them as active. -# -# mark-wmwin-focused = false -mark-wmwin-focused = true; - -# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. -# mark-ovredir-focused = false -mark-ovredir-focused = true; - -# Try to detect windows with rounded corners and don't consider them -# shaped windows. The accuracy is not very high, unfortunately. -# -# detect-rounded-corners = false -detect-rounded-corners = true; - -# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers -# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. -# -# detect-client-opacity = false -detect-client-opacity = true; - -# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, -# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, -# provided that the WM supports it. -# -# use-ewmh-active-win = false - -# Unredirect all windows if a full-screen opaque window is detected, -# to maximize performance for full-screen windows. Known to cause flickering -# when redirecting/unredirecting windows. -# -# unredir-if-possible = false - -# Delay before unredirecting the window, in milliseconds. Defaults to 0. -# unredir-if-possible-delay = 0 - -# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. -# unredir-if-possible-exclude = [] - -# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows -# in the same group focused at the same time. -# -# detect-transient = false -detect-transient = true; - -# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same -# group focused at the same time. This usually means windows from the same application -# will be considered focused or unfocused at the same time. -# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too. -# -# detect-client-leader = false - -# Resize damaged region by a specific number of pixels. -# A positive value enlarges it while a negative one shrinks it. -# If the value is positive, those additional pixels will not be actually painted -# to screen, only used in blur calculation, and such. (Due to technical limitations, -# with use-damage, those pixels will still be incorrectly painted to screen.) -# Primarily used to fix the line corruption issues of blur, -# in which case you should use the blur radius value here -# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, -# with a 5x5 one you use `--resize-damage 2`, and so on). -# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. -# -# resize-damage = 1 - -# Specify a list of conditions of windows that should be painted with inverted color. -# Resource-hogging, and is not well tested. -# -# invert-color-include = [] - -# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. -# Might cause incorrect opacity when rendering transparent content (but never -# practically happened) and may not work with blur-background. -# My tests show a 15% performance boost. Recommended. -# -# glx-no-stencil = false - -# GLX backend: Avoid rebinding pixmap on window damage. -# Probably could improve performance on rapid window content changes, -# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). -# Recommended if it works. -# -# glx-no-rebind-pixmap = false - -# Disable the use of damage information. -# This cause the whole screen to be redrawn everytime, instead of the part of the screen -# has actually changed. Potentially degrades the performance, but might fix some artifacts. -# The opposing option is use-damage -# -# no-use-damage = false -use-damage = true; - -# Use X Sync fence to sync clients' draw calls, to make sure all draw -# calls are finished before picom starts drawing. Needed on nvidia-drivers -# with GLX backend for some users. -# -# xrender-sync-fence = false - -# GLX backend: Use specified GLSL fragment shader for rendering window contents. -# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` -# in the source tree for examples. -# -# glx-fshader-win = "" - -# Force all windows to be painted with blending. Useful if you -# have a glx-fshader-win that could turn opaque pixels transparent. -# -# force-win-blend = false - -# Do not use EWMH to detect fullscreen windows. -# Reverts to checking if a window is fullscreen based only on its size and coordinates. -# -# no-ewmh-fullscreen = false - -# Dimming bright windows so their brightness doesn't exceed this set value. -# Brightness of a window is estimated by averaging all pixels in the window, -# so this could comes with a performance hit. -# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) -# -# max-brightness = 1.0 - -# Make transparent windows clip other windows like non-transparent windows do, -# instead of blending on top of them. -# -# transparent-clipping = false - -# Set the log level. Possible values are: -# "trace", "debug", "info", "warn", "error" -# in increasing level of importance. Case doesn't matter. -# If using the "TRACE" log level, it's better to log into a file -# using *--log-file*, since it can generate a huge stream of logs. -# -# log-level = "debug" -log-level = "warn"; - -# Set the log file. -# If *--log-file* is never specified, logs will be written to stderr. -# Otherwise, logs will to written to the given file, though some of the early -# logs might still be written to the stderr. -# When setting this option from the config file, it is recommended to use an absolute path. -# -# log-file = "/path/to/your/log/file" - -# Show all X errors (for debugging) -# show-all-xerrors = false - -# Write process ID to a file. -# write-pid-path = "/path/to/your/log/file" - -# Window type settings -# -# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: -# "unknown", "desktop", "dock", "toolbar", "menu", "utility", -# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", -# "tooltip", "notification", "combo", and "dnd". -# -# Following per window-type options are available: :: -# -# fade, shadow::: -# Controls window-type-specific shadow and fade settings. -# -# opacity::: -# Controls default opacity of the window type. -# -# focus::: -# Controls whether the window of this type is to be always considered focused. -# (By default, all window types except "normal" and "dialog" has this on.) -# -# full-shadow::: -# Controls whether shadow is drawn under the parts of the window that you -# normally won't be able to see. Useful when the window has parts of it -# transparent, and you want shadows in those areas. -# -# clip-shadow-above::: -# Controls wether shadows that would have been drawn above the window should -# be clipped. Useful for dock windows that should have no shadow painted on top. -# -# redir-ignore::: -# Controls whether this type of windows should cause screen to become -# redirected again after been unredirected. If you have unredir-if-possible -# set, and doesn't want certain window to cause unnecessary screen redirection, -# you can set this to `true`. -# -wintypes: -{ - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; clip-shadow-above = true; } - dnd = { shadow = false; } - menu = { animation = "slide-down"; } - popup_menu = { animation = "slide-down"; opacity = 0.8; } - dropdown_menu = { animation = "slide-down"; opacity = 0.8; } - toolbar = { animation = "none"; } -}; - -################################# -# Animation Settings # -################################# - -animations = true; - -# Values can be none, auto, fly-in, zoom, squeeze, slide-up, slide-down, slide-left, slide-right -animation-for-open-window = "squeeze"; -animation-for-transient-window = "slide-down"; -animation-for-unmap-window = "auto"; -animation-for-workspace-switch-in = "auto"; -animation-for-workspace-switch-out = "auto"; - -# Stiffness (a.k.a. tension) parameter for spring-based animation (default: 200.0). -animation-stiffness = 1000; - -# Dampening (a.k.a. friction) parameter for spring-based animation (default: 25.0). -animation-dampening = 50; - -# Mass parameter for spring-based animation (default: 1.0). -animation-window-mass = 1; - -# The time between steps in animation, in milliseconds. (> 0, defaults to 10). -animation-delta = 7; - -# Force animations to go step by step even if cpu usage is high -animation-force-steps = true; - -# Whether to clamp animations (default: true). -#animation-clamping = false; - -# Specify a list of conditions of windows that should have no animations. -animation-exclude = [ - "class_g *= 'flameshot'", - "class_g *= 'i3lock'" -]; diff --git a/dwm/picom/src/atom.c b/dwm/picom/src/atom.c deleted file mode 100644 index 0272dc8..0000000 --- a/dwm/picom/src/atom.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include - -#include "atom.h" -#include "common.h" -#include "utils.h" -#include "log.h" - -static inline void *atom_getter(void *ud, const char *atom_name, int *err) { - xcb_connection_t *c = ud; - xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply( - c, xcb_intern_atom(c, 0, to_u16_checked(strlen(atom_name)), atom_name), NULL); - - xcb_atom_t atom = XCB_NONE; - if (reply) { - log_debug("Atom %s is %d", atom_name, reply->atom); - atom = reply->atom; - free(reply); - } else { - log_error("Failed to intern atoms"); - *err = 1; - } - return (void *)(intptr_t)atom; -} - -/** - * Create a new atom structure and fetch all predefined atoms - */ -struct atom *init_atoms(xcb_connection_t *c) { - auto atoms = ccalloc(1, struct atom); - atoms->c = new_cache((void *)c, atom_getter, NULL); -#define ATOM_GET(x) atoms->a##x = (xcb_atom_t)(intptr_t)cache_get(atoms->c, #x, NULL) - LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST1); - LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST2); -#undef ATOM_GET - return atoms; -} diff --git a/dwm/picom/src/atom.h b/dwm/picom/src/atom.h deleted file mode 100644 index baf3360..0000000 --- a/dwm/picom/src/atom.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once -#include - -#include - -#include "meta.h" -#include "cache.h" - -// clang-format off -// Splitted into 2 lists because of the limitation of our macros -#define ATOM_LIST1 \ - _NET_WM_WINDOW_OPACITY, \ - _NET_FRAME_EXTENTS, \ - WM_STATE, \ - _NET_WM_NAME, \ - _NET_WM_PID, \ - WM_NAME, \ - WM_CLASS, \ - WM_ICON_NAME, \ - WM_TRANSIENT_FOR, \ - WM_WINDOW_ROLE, \ - WM_CLIENT_LEADER, \ - WM_CLIENT_MACHINE, \ - _NET_ACTIVE_WINDOW, \ - _COMPTON_SHADOW, \ - _NET_WM_WINDOW_TYPE, \ - _NET_CURRENT_DESKTOP - -#define ATOM_LIST2 \ - _NET_WM_WINDOW_TYPE_DESKTOP, \ - _NET_WM_WINDOW_TYPE_DOCK, \ - _NET_WM_WINDOW_TYPE_TOOLBAR, \ - _NET_WM_WINDOW_TYPE_MENU, \ - _NET_WM_WINDOW_TYPE_UTILITY, \ - _NET_WM_WINDOW_TYPE_SPLASH, \ - _NET_WM_WINDOW_TYPE_DIALOG, \ - _NET_WM_WINDOW_TYPE_NORMAL, \ - _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, \ - _NET_WM_WINDOW_TYPE_POPUP_MENU, \ - _NET_WM_WINDOW_TYPE_TOOLTIP, \ - _NET_WM_WINDOW_TYPE_NOTIFICATION, \ - _NET_WM_WINDOW_TYPE_COMBO, \ - _NET_WM_WINDOW_TYPE_DND, \ - _NET_WM_STATE, \ - _NET_WM_STATE_FULLSCREEN, \ - _NET_WM_BYPASS_COMPOSITOR, \ - UTF8_STRING, \ - C_STRING -// clang-format on - -#define ATOM_DEF(x) xcb_atom_t a##x - -struct atom { - struct cache *c; - LIST_APPLY(ATOM_DEF, SEP_COLON, ATOM_LIST1); - LIST_APPLY(ATOM_DEF, SEP_COLON, ATOM_LIST2); -}; - -struct atom *init_atoms(xcb_connection_t *); - -static inline xcb_atom_t get_atom(struct atom *a, const char *key) { - return (xcb_atom_t)(intptr_t)cache_get(a->c, key, NULL); -} - -static inline void destroy_atoms(struct atom *a) { - cache_free(a->c); - free(a); -} diff --git a/dwm/picom/src/backend/backend.c b/dwm/picom/src/backend/backend.c deleted file mode 100644 index 2ef5f03..0000000 --- a/dwm/picom/src/backend/backend.c +++ /dev/null @@ -1,540 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include -#include - -#include "backend/backend.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "log.h" -#include "region.h" -#include "types.h" -#include "win.h" -#include "x.h" - -extern struct backend_operations xrender_ops, dummy_ops; -#ifdef CONFIG_OPENGL -extern struct backend_operations glx_ops; -#endif - -struct backend_operations *backend_list[NUM_BKEND] = { - [BKEND_XRENDER] = &xrender_ops, - [BKEND_DUMMY] = &dummy_ops, -#ifdef CONFIG_OPENGL - [BKEND_GLX] = &glx_ops, -#endif -}; - -/** - * @param all_damage if true ignore damage and repaint the whole screen - */ -region_t get_damage(session_t *ps, bool all_damage) { - region_t region; - auto buffer_age_fn = ps->backend_data->ops->buffer_age; - int buffer_age = buffer_age_fn ? buffer_age_fn(ps->backend_data) : -1; - - if (all_damage) { - buffer_age = -1; - } - - pixman_region32_init(®ion); - if (buffer_age == -1 || buffer_age > ps->ndamage) { - pixman_region32_copy(®ion, &ps->screen_reg); - } else { - for (int i = 0; i < buffer_age; i++) { - auto curr = ((ps->damage - ps->damage_ring) + i) % ps->ndamage; - log_trace("damage index: %d, damage ring offset: %td", i, curr); - dump_region(&ps->damage_ring[curr]); - pixman_region32_union(®ion, ®ion, &ps->damage_ring[curr]); - } - pixman_region32_intersect(®ion, ®ion, &ps->screen_reg); - } - return region; -} - -static void process_window_for_painting(session_t *ps, struct managed_win *w, - void *win_image, double additional_alpha, - region_t *reg_bound, region_t *reg_visible, - region_t *reg_paint, region_t *reg_paint_in_bound) { - // For window image processing, we don't have to limit the process - // region to damage for correctness. (see for - // details) - - // The visible region, in window local coordinates Although we - // don't limit process region to damage, we provide that info in - // reg_visible as a hint. Since window image data outside of the - // damage region won't be painted onto target - region_t reg_visible_local; - { - // The bounding shape, in window local coordinates - region_t reg_bound_local; - pixman_region32_init(®_bound_local); - pixman_region32_copy(®_bound_local, reg_bound); - pixman_region32_translate(®_bound_local, -w->g.x, -w->g.y); - - pixman_region32_init(®_visible_local); - pixman_region32_intersect(®_visible_local, reg_visible, reg_paint); - pixman_region32_translate(®_visible_local, -w->g.x, -w->g.y); - // Data outside of the bounding shape won't be visible, - // but it is not necessary to limit the image operations - // to the bounding shape yet. So pass that as the visible - // region, not the clip region. - pixman_region32_intersect(®_visible_local, ®_visible_local, - ®_bound_local); - pixman_region32_fini(®_bound_local); - } - - auto new_img = ps->backend_data->ops->clone_image(ps->backend_data, win_image, - ®_visible_local); - auto reg_frame = win_get_region_frame_local_by_val(w); - double alpha = additional_alpha * w->opacity; - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_OPACITY, new_img, &alpha); - ps->backend_data->ops->image_op(ps->backend_data, IMAGE_OP_APPLY_ALPHA, new_img, - ®_frame, ®_visible_local, - (double[]){w->frame_opacity}); - pixman_region32_fini(®_frame); - ps->backend_data->ops->compose(ps->backend_data, new_img, w->g.x, w->g.y, - w->g.x + w->widthb, w->g.y + w->heightb, - reg_paint_in_bound, reg_visible); - ps->backend_data->ops->release_image(ps->backend_data, new_img); - pixman_region32_fini(®_visible_local); -} - -void handle_device_reset(session_t *ps) { - log_error("Device reset detected"); - // Wait for reset to complete - // Although ideally the backend should return DEVICE_STATUS_NORMAL after a reset - // is completed, it's not always possible. - // - // According to ARB_robustness (emphasis mine): - // - // "If a reset status other than NO_ERROR is returned and subsequent - // calls return NO_ERROR, the context reset was encountered and - // completed. If a reset status is repeatedly returned, the context **may** - // be in the process of resetting." - // - // Which means it may also not be in the process of resetting. For example on - // AMDGPU devices, Mesa OpenGL always return CONTEXT_RESET after a reset has - // started, completed or not. - // - // So here we blindly wait 5 seconds and hope ourselves best of the luck. - sleep(5); - - // Reset picom - log_info("Resetting picom after device reset"); - ev_break(ps->loop, EVBREAK_ALL); -} - -/// paint all windows -void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) { - if (ps->backend_data->ops->device_status && - ps->backend_data->ops->device_status(ps->backend_data) != DEVICE_STATUS_NORMAL) { - return handle_device_reset(ps); - } - if (ps->o.xrender_sync_fence) { - if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) { - log_error("x_fence_sync failed, xrender-sync-fence will be " - "disabled from now on."); - xcb_sync_destroy_fence(ps->c, ps->sync_fence); - ps->sync_fence = XCB_NONE; - ps->o.xrender_sync_fence = false; - ps->xsync_exists = false; - } - } - // All painting will be limited to the damage, if _some_ of - // the paints bleed out of the damage region, it will destroy - // part of the image we want to reuse - region_t reg_damage; - if (!ignore_damage) { - reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage); - } else { - pixman_region32_init(®_damage); - pixman_region32_copy(®_damage, &ps->screen_reg); - } - - if (!pixman_region32_not_empty(®_damage)) { - pixman_region32_fini(®_damage); - return; - } - -#ifdef DEBUG_REPAINT - static struct timespec last_paint = {0}; -#endif - - // - // If use_damage is enabled, we MUST make sure only the damaged regions of the - // screen are ever touched by the compositor. The reason is that at the beginning - // of each render, we clear the damaged regions with the wallpaper, and nothing - // else. If later during the render we changed anything outside the damaged - // region, that won't be cleared by the next render, and will thus accumulate. - // (e.g. if shadow is drawn outside the damaged region, it will become thicker and - // thicker over time.) - - /// The adjusted damaged regions - region_t reg_paint; - assert(ps->o.blur_method != BLUR_METHOD_INVALID); - if (ps->o.blur_method != BLUR_METHOD_NONE && ps->backend_data->ops->get_blur_size) { - int blur_width, blur_height; - ps->backend_data->ops->get_blur_size(ps->backend_blur_context, - &blur_width, &blur_height); - - // The region of screen a given window influences will be smeared - // out by blur. With more windows on top of the given window, the - // influences region will be smeared out more. - // - // Also, blurring requires data slightly outside the area that needs - // to be blurred. The more semi-transparent windows are stacked on top - // of each other, the larger the area will be. - // - // Instead of accurately calculate how much bigger the damage - // region will be because of blur, we assume the worst case here. - // That is, the damaged window is at the bottom of the stack, and - // all other windows have semi-transparent background - int resize_factor = 1; - if (t) { - resize_factor = t->stacking_rank; - } - resize_region_in_place(®_damage, blur_width * resize_factor, - blur_height * resize_factor); - reg_paint = resize_region(®_damage, blur_width * resize_factor, - blur_height * resize_factor); - pixman_region32_intersect(®_paint, ®_paint, &ps->screen_reg); - pixman_region32_intersect(®_damage, ®_damage, &ps->screen_reg); - } else { - pixman_region32_init(®_paint); - pixman_region32_copy(®_paint, ®_damage); - } - - // A hint to backend, the region that will be visible on screen - // backend can optimize based on this info - region_t reg_visible; - pixman_region32_init(®_visible); - pixman_region32_copy(®_visible, &ps->screen_reg); - if (t && !ps->o.transparent_clipping) { - // Calculate the region upon which the root window (wallpaper) is to be - // painted based on the ignore region of the lowest window, if available - // - // NOTE If transparent_clipping is enabled, transparent windows are - // included in the reg_ignore, but we still want to have the wallpaper - // beneath them, so we don't use reg_ignore for wallpaper in that case. - pixman_region32_subtract(®_visible, ®_visible, t->reg_ignore); - } - - // Region on screen we don't want any shadows on - region_t reg_shadow_clip; - pixman_region32_init(®_shadow_clip); - - if (ps->backend_data->ops->prepare) { - ps->backend_data->ops->prepare(ps->backend_data, ®_paint); - } - - if (ps->root_image) { - ps->backend_data->ops->compose(ps->backend_data, ps->root_image, 0, 0, - ps->root_width, ps->root_height, - ®_paint, ®_visible); - } else { - ps->backend_data->ops->fill(ps->backend_data, (struct color){0, 0, 0, 1}, - ®_paint); - } - - // Windows are sorted from bottom to top - // Each window has a reg_ignore, which is the region obscured by all the windows - // on top of that window. This is used to reduce the number of pixels painted. - // - // Whether this is beneficial is to be determined XXX - for (auto w = t; w; w = w->prev_trans) { - pixman_region32_subtract(®_visible, &ps->screen_reg, w->reg_ignore); - assert(!(w->flags & WIN_FLAGS_IMAGE_ERROR)); - assert(!(w->flags & WIN_FLAGS_PIXMAP_STALE)); - assert(!(w->flags & WIN_FLAGS_PIXMAP_NONE)); - - // The bounding shape of the window, in global/target coordinates - // reminder: bounding shape contains the WM frame - auto reg_bound = win_get_bounding_shape_global_by_val(w); - auto reg_bound_no_corner = - win_get_bounding_shape_global_without_corners_by_val(w); - - // The clip region for the current window, in global/target coordinates - // reg_paint_in_bound \in reg_paint - region_t reg_paint_in_bound; - pixman_region32_init(®_paint_in_bound); - pixman_region32_intersect(®_paint_in_bound, ®_bound, ®_paint); - if (ps->o.transparent_clipping) { - // - // If transparent_clipping is enabled, we need to be SURE that - // things are not drawn inside reg_ignore, because otherwise they - // will appear underneath transparent windows. - // So here we have make sure reg_paint_in_bound \in reg_visible - // There are a few other places below where this is needed as - // well. - pixman_region32_intersect(®_paint_in_bound, - ®_paint_in_bound, ®_visible); - } - - // Blur window background - /* TODO(yshui) since the backend might change the content of the window - * (e.g. with shaders), we should consult the backend whether the window - * is transparent or not. for now we will just rely on the force_win_blend - * option */ - auto real_win_mode = w->mode; - - if (w->blur_background && - (ps->o.force_win_blend || real_win_mode == WMODE_TRANS || - (ps->o.blur_background_frame && real_win_mode == WMODE_FRAME_TRANS))) { - // Minimize the region we try to blur, if the window - // itself is not opaque, only the frame is. - - double blur_opacity = 1; - if (w->opacity < (1.0 / MAX_ALPHA)) { - // Hide blur for fully transparent windows. - blur_opacity = 0; - } else if (w->state == WSTATE_MAPPING) { - // Gradually increase the blur intensity during - // fading in. - assert(w->opacity <= w->opacity_target); - blur_opacity = w->opacity / w->opacity_target; - } else if (w->state == WSTATE_UNMAPPING || - w->state == WSTATE_DESTROYING) { - // Gradually decrease the blur intensity during - // fading out. - assert(w->opacity <= w->opacity_target_old); - blur_opacity = w->opacity / w->opacity_target_old; - } else if (w->state == WSTATE_FADING) { - if (w->opacity < w->opacity_target && - w->opacity_target_old < (1.0 / MAX_ALPHA)) { - // Gradually increase the blur intensity during - // fading in. - assert(w->opacity <= w->opacity_target); - blur_opacity = w->opacity / w->opacity_target; - } else if (w->opacity > w->opacity_target && - w->opacity_target < (1.0 / MAX_ALPHA)) { - // Gradually decrease the blur intensity during - // fading out. - assert(w->opacity <= w->opacity_target_old); - blur_opacity = w->opacity / w->opacity_target_old; - } - } - assert(blur_opacity >= 0 && blur_opacity <= 1); - - if (real_win_mode == WMODE_TRANS || ps->o.force_win_blend) { - // We need to blur the bounding shape of the window - // (reg_paint_in_bound = reg_bound \cap reg_paint) - ps->backend_data->ops->blur( - ps->backend_data, blur_opacity, ps->backend_blur_context, - ®_paint_in_bound, ®_visible); - } else { - // Window itself is solid, we only need to blur the frame - // region - - // Readability assertions - assert(ps->o.blur_background_frame); - assert(real_win_mode == WMODE_FRAME_TRANS); - - auto reg_blur = win_get_region_frame_local_by_val(w); - pixman_region32_translate(®_blur, w->g.x, w->g.y); - // make sure reg_blur \in reg_paint - pixman_region32_intersect(®_blur, ®_blur, ®_paint); - if (ps->o.transparent_clipping) { - // ref: - pixman_region32_intersect(®_blur, ®_blur, - ®_visible); - } - ps->backend_data->ops->blur(ps->backend_data, blur_opacity, - ps->backend_blur_context, - ®_blur, ®_visible); - pixman_region32_fini(®_blur); - } - } - - // Draw shadow on target - if (w->shadow) { - assert(!(w->flags & WIN_FLAGS_SHADOW_NONE)); - // Clip region for the shadow - // reg_shadow \in reg_paint - auto reg_shadow = win_extents_by_val(w); - pixman_region32_intersect(®_shadow, ®_shadow, ®_paint); - if (!ps->o.wintype_option[w->window_type].full_shadow) { - pixman_region32_subtract(®_shadow, ®_shadow, - ®_bound_no_corner); - } - - // Mask out the region we don't want shadow on - if (pixman_region32_not_empty(&ps->shadow_exclude_reg)) { - pixman_region32_subtract(®_shadow, ®_shadow, - &ps->shadow_exclude_reg); - } - if (pixman_region32_not_empty(®_shadow_clip)) { - pixman_region32_subtract(®_shadow, ®_shadow, - ®_shadow_clip); - } - - if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 && - w->xinerama_scr < ps->xinerama_nscrs) { - // There can be a window where number of screens is - // updated, but the screen number attached to the windows - // have not. - // - // Window screen number will be updated eventually, so - // here we just check to make sure we don't access out of - // bounds. - pixman_region32_intersect( - ®_shadow, ®_shadow, - &ps->xinerama_scr_regs[w->xinerama_scr]); - } - - if (ps->o.transparent_clipping) { - // ref: - pixman_region32_intersect(®_shadow, ®_shadow, - ®_visible); - } - - assert(w->shadow_image); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_OPACITY, w->shadow_image, - &w->opacity); - - ps->backend_data->ops->compose( - ps->backend_data, w->shadow_image, w->g.x + w->shadow_dx, - w->g.y + w->shadow_dy, w->g.x + w->shadow_dx + w->shadow_width, - w->g.y + w->shadow_dy + w->shadow_height, ®_shadow, - ®_visible); - pixman_region32_fini(®_shadow); - } - - // Update image properties - { - double dim_opacity = 0.0; - if (w->dim) { - dim_opacity = ps->o.inactive_dim; - if (!ps->o.inactive_dim_fixed) { - dim_opacity *= w->opacity; - } - } - - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_MAX_BRIGHTNESS, w->win_image, - &ps->o.max_brightness); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_INVERTED, w->win_image, - &w->invert_color); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_DIM_LEVEL, w->win_image, - &dim_opacity); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_OPACITY, w->win_image, &w->opacity); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_CORNER_RADIUS, w->win_image, - (double[]){w->corner_radius}); - if (w->corner_radius) { - int border_width = w->g.border_width; - if (border_width == 0) { - // Some WM has borders implemented as WM frames - border_width = min3(w->frame_extents.left, - w->frame_extents.right, - w->frame_extents.bottom); - } - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_BORDER_WIDTH, - w->win_image, &border_width); - if (w->old_win_image) { - // TODO(dccsillag): explain why the following is - // "necessary" - double zero = 0.0; - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_BORDER_WIDTH, - w->old_win_image, &zero); - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_CORNER_RADIUS, - w->old_win_image, &zero); - } - } - } - - if (w->opacity * MAX_ALPHA < 1) { - // We don't need to paint the window body itself if it's - // completely transparent. - goto skip; - } - - if (w->clip_shadow_above) { - // Add window bounds to shadow-clip region - pixman_region32_union(®_shadow_clip, ®_shadow_clip, ®_bound); - } else { - // Remove overlapping window bounds from shadow-clip region - pixman_region32_subtract(®_shadow_clip, ®_shadow_clip, ®_bound); - } - - // Draw window on target - bool is_animating = 0 <= w->animation_progress && w->animation_progress < 1.0; - if (w->frame_opacity == 1 && !is_animating) { - ps->backend_data->ops->compose(ps->backend_data, w->win_image, - w->g.x, w->g.y, - w->g.x + w->widthb, w->g.y + w->heightb, - ®_paint_in_bound, ®_visible); - } else { - process_window_for_painting( - ps, w, w->win_image, 1.0, ®_bound, ®_visible, - ®_paint, ®_paint_in_bound); - - if (w->old_win_image) { - bool resizing = - w->g.width != w->pending_g.width || - w->g.height != w->pending_g.height; - - // Only do this if size changes as otherwise moving - // transparent windows will flicker - if (resizing) { - assert(w->old_win_image); - - process_window_for_painting(ps, w, w->old_win_image, - 1.0 - w->animation_progress, - ®_bound, ®_visible, - ®_paint, ®_paint_in_bound); - } - } - } - skip: - pixman_region32_fini(®_bound); - pixman_region32_fini(®_bound_no_corner); - pixman_region32_fini(®_paint_in_bound); - } - pixman_region32_fini(®_paint); - pixman_region32_fini(®_shadow_clip); - - if (ps->o.monitor_repaint) { - const struct color DEBUG_COLOR = {0.5, 0, 0, 0.5}; - auto reg_damage_debug = get_damage(ps, false); - ps->backend_data->ops->fill(ps->backend_data, DEBUG_COLOR, ®_damage_debug); - pixman_region32_fini(®_damage_debug); - } - - // Move the head of the damage ring - ps->damage = ps->damage - 1; - if (ps->damage < ps->damage_ring) { - ps->damage = ps->damage_ring + ps->ndamage - 1; - } - pixman_region32_clear(ps->damage); - - if (ps->backend_data->ops->present) { - // Present the rendered scene - // Vsync is done here - ps->backend_data->ops->present(ps->backend_data, ®_damage); - } - - pixman_region32_fini(®_damage); - -#ifdef DEBUG_REPAINT - struct timespec now = get_time_timespec(); - struct timespec diff = {0}; - timespec_subtract(&diff, &now, &last_paint); - log_trace("[ %5ld:%09ld ] ", diff.tv_sec, diff.tv_nsec); - last_paint = now; - log_trace("paint:"); - for (win *w = t; w; w = w->prev_trans) - log_trace(" %#010lx", w->id); -#endif -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/backend/backend.h b/dwm/picom/src/backend/backend.h deleted file mode 100644 index 5652a36..0000000 --- a/dwm/picom/src/backend/backend.h +++ /dev/null @@ -1,294 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018, Yuxuan Shui - -#pragma once - -#include - -#include "compiler.h" -#include "config.h" -#include "driver.h" -#include "kernel.h" -#include "region.h" -#include "types.h" -#include "x.h" - -typedef struct session session_t; -struct managed_win; - -struct ev_loop; -struct backend_operations; - -typedef struct backend_base { - struct backend_operations *ops; - xcb_connection_t *c; - xcb_window_t root; - struct ev_loop *loop; - - /// Whether the backend can accept new render request at the moment - bool busy; - // ... -} backend_t; - -typedef void (*backend_ready_callback_t)(void *); - -// This mimics OpenGL's ARB_robustness extension, which enables detection of GPU context -// resets. -// See: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness.txt, section -// 2.6 "Graphics Reset Recovery". -enum device_status { - DEVICE_STATUS_NORMAL, - DEVICE_STATUS_RESETTING, -}; - -// When image properties are actually applied to the image, they are applied in a -// particular order: -// -// Color inversion -> Dimming -> Opacity multiply -> Limit maximum brightness -// (Corner radius could be applied in any order) -enum image_properties { - // Whether the color of the image is inverted - // 1 boolean, default: false - IMAGE_PROPERTY_INVERTED, - // How much the image is dimmed - // 1 double, default: 0 - IMAGE_PROPERTY_DIM_LEVEL, - // Image opacity, i.e. an alpha value multiplied to the alpha channel - // 1 double, default: 1 - IMAGE_PROPERTY_OPACITY, - // The effective size of the image, the image will be tiled to fit. - // 2 int, default: the actual size of the image - IMAGE_PROPERTY_EFFECTIVE_SIZE, - // Limit how bright image can be. The image brightness is estimated by averaging - // the pixels in the image, and dimming will be applied to scale the average - // brightness down to the max brightness value. - // 1 double, default: 1 - IMAGE_PROPERTY_MAX_BRIGHTNESS, - // Gives the image a rounded corner. - // 1 double, default: 0 - IMAGE_PROPERTY_CORNER_RADIUS, - // Border width - // 1 int, default: 0 - IMAGE_PROPERTY_BORDER_WIDTH, -}; - -enum image_operations { - // Multiply the alpha channel by the argument - IMAGE_OP_APPLY_ALPHA, -}; - -struct gaussian_blur_args { - int size; - double deviation; -}; - -struct box_blur_args { - int size; -}; - -struct kernel_blur_args { - struct conv **kernels; - int kernel_count; -}; - -struct dual_kawase_blur_args { - int size; - int strength; -}; - -struct backend_operations { - // =========== Initialization =========== - - /// Initialize the backend, prepare for rendering to the target window. - /// Here is how you should choose target window: - /// 1) if ps->overlay is not XCB_NONE, use that - /// 2) use ps->root otherwise - // TODO(yshui) make the target window a parameter - backend_t *(*init)(session_t *)attr_nonnull(1); - void (*deinit)(backend_t *backend_data) attr_nonnull(1); - - /// Called when rendering will be stopped for an unknown amount of - /// time (e.g. when screen is unredirected). Free some resources. - /// - /// Optional, not yet used - void (*pause)(backend_t *backend_data, session_t *ps); - - /// Called before rendering is resumed - /// - /// Optional, not yet used - void (*resume)(backend_t *backend_data, session_t *ps); - - /// Called when root property changed, returns the new - /// backend_data. Even if the backend_data changed, all - /// the existing image data returned by this backend should - /// remain valid. - /// - /// Optional - void *(*root_change)(backend_t *backend_data, session_t *ps); - - // =========== Rendering ============ - - // NOTE: general idea about reg_paint/reg_op vs reg_visible is that reg_visible is - // merely a hint. Ignoring reg_visible entirely don't affect the correctness of - // the operation performed. OTOH reg_paint/reg_op is part of the parameters of the - // operation, and must be honored in order to complete the operation correctly. - - // NOTE: due to complications introduced by use-damage and blur, the rendering API - // is a bit weird. The idea is, `compose` and `blur` have to update a temporary - // buffer, because `blur` requires data from an area slightly larger than the area - // that will be visible. So the area outside the visible area has to be rendered, - // but we have to discard the result (because the result of blurring that area - // will be wrong). That's why we cannot render into the back buffer directly. - // After rendering is done, `present` is called to update a portion of the actual - // back buffer, then present it to the target (or update the target directly, - // if not back buffered). - - /// Called before when a new frame starts. - /// - /// Optional - void (*prepare)(backend_t *backend_data, const region_t *reg_damage); - - /** - * Paint the content of an image onto the rendering buffer - * - * @param backend_data the backend data - * @param image_data the image to paint - * @param dst_x1, dst_y1 the top left corner of the image in the target - * @param dst_x2, dst_y2 the top right corner of the image in the target - * @param reg_paint the clip region, in target coordinates - * @param reg_visible the visible region, in target coordinates - */ - void (*compose)(backend_t *backend_data, void *image_data, - int dst_x1, int dst_y1, int dst_x2, int dst_y2, - const region_t *reg_paint, const region_t *reg_visible); - - /// Fill rectangle of the rendering buffer, mostly for debug purposes, optional. - void (*fill)(backend_t *backend_data, struct color, const region_t *clip); - - /// Blur a given region of the rendering buffer. - bool (*blur)(backend_t *backend_data, double opacity, void *blur_ctx, - const region_t *reg_blur, const region_t *reg_visible) - attr_nonnull(1, 3, 4, 5); - - /// Update part of the back buffer with the rendering buffer, then present the - /// back buffer onto the target window (if not back buffered, update part of the - /// target window directly). - /// - /// Optional, if NULL, indicates the backend doesn't have render output - /// - /// @param region part of the target that should be updated - void (*present)(backend_t *backend_data, const region_t *region) attr_nonnull(1, 2); - - /** - * Bind a X pixmap to the backend's internal image data structure. - * - * @param backend_data backend data - * @param pixmap X pixmap to bind - * @param fmt information of the pixmap's visual - * @param owned whether the ownership of the pixmap is transfered to the backend - * @return backend internal data structure bound with this pixmap - */ - void *(*bind_pixmap)(backend_t *backend_data, xcb_pixmap_t pixmap, - struct xvisual_info fmt, bool owned); - - /// Create a shadow image based on the parameters - /// Default implementation: default_backend_render_shadow - void *(*render_shadow)(backend_t *backend_data, int width, int height, - const conv *kernel, double r, double g, double b, double a); - - // ============ Resource management =========== - - /// Free resources associated with an image data structure - void (*release_image)(backend_t *backend_data, void *img_data) attr_nonnull(1, 2); - - // =========== Query =========== - - /// Return if image is not completely opaque. - /// - /// This function is needed because some backend might change the content of the - /// window (e.g. when using a custom shader with the glx backend), so only the - /// backend knows if an image is transparent. - bool (*is_image_transparent)(backend_t *backend_data, void *image_data) - attr_nonnull(1, 2); - - /// Get the age of the buffer content we are currently rendering ontop - /// of. The buffer that has just been `present`ed has a buffer age of 1. - /// Everytime `present` is called, buffers get older. Return -1 if the - /// buffer is empty. - /// - /// Optional - int (*buffer_age)(backend_t *backend_data); - - /// The maximum number buffer_age might return. - int max_buffer_age; - - // =========== Post-processing ============ - - /* TODO(yshui) Consider preserving the order of image ops. - * Currently in both backends, the image ops are applied lazily when needed. - * However neither backends preserve the order of image ops, they just applied all - * pending lazy ops in a pre-determined fixed order, regardless in which order - * they were originally applied. This might lead to inconsistencies.*/ - - /** - * Change image properties - * - * @param backend_data backend data - * @param prop the property to change - * @param image_data an image data structure returned by the backend - * @param args property value - * @return whether the operation is successful - */ - bool (*set_image_property)(backend_t *backend_data, enum image_properties prop, - void *image_data, void *args); - - /** - * Manipulate an image. Image properties are untouched. - * - * @param backend_data backend data - * @param op the operation to perform - * @param image_data an image data structure returned by the backend - * @param reg_op the clip region, define the part of the image to be - * operated on. - * @param reg_visible define the part of the image that will eventually - * be visible on target. this is a hint to the backend - * for optimization purposes. - * @param args extra arguments, operation specific - * @return whether the operation is successful - */ - bool (*image_op)(backend_t *backend_data, enum image_operations op, void *image_data, - const region_t *reg_op, const region_t *reg_visible, void *args); - - /// Create another instance of the `image_data`. All `image_op` and - /// `set_image_property` calls on the returned image should not affect the - /// original image - void *(*clone_image)(backend_t *base, const void *image_data, - const region_t *reg_visible); - - /// Create a blur context that can be used to call `blur` - void *(*create_blur_context)(backend_t *base, enum blur_method, void *args); - /// Destroy a blur context - void (*destroy_blur_context)(backend_t *base, void *ctx); - /// Get how many pixels outside of the blur area is needed for blur - void (*get_blur_size)(void *blur_context, int *width, int *height); - - // =========== Hooks ============ - /// Let the backend hook into the event handling queue - /// Not implemented yet - void (*set_ready_callback)(backend_t *, backend_ready_callback_t cb); - /// Called right after the core has handled its events. - /// Not implemented yet - void (*handle_events)(backend_t *); - // =========== Misc ============ - /// Return the driver that is been used by the backend - enum driver (*detect_driver)(backend_t *backend_data); - - void (*diagnostics)(backend_t *backend_data); - - enum device_status (*device_status)(backend_t *backend_data); -}; - -extern struct backend_operations *backend_list[]; - -void paint_all_new(session_t *ps, struct managed_win *const t, bool ignore_damage) - attr_nonnull(1); diff --git a/dwm/picom/src/backend/backend_common.c b/dwm/picom/src/backend/backend_common.c deleted file mode 100644 index 5bd75e2..0000000 --- a/dwm/picom/src/backend/backend_common.c +++ /dev/null @@ -1,483 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include -#include -#include -#include -#include - -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "common.h" -#include "config.h" -#include "kernel.h" -#include "log.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -/** - * Generate a 1x1 Picture of a particular color. - */ -xcb_render_picture_t solid_picture(xcb_connection_t *c, xcb_drawable_t d, bool argb, - double a, double r, double g, double b) { - xcb_pixmap_t pixmap; - xcb_render_picture_t picture; - xcb_render_create_picture_value_list_t pa; - xcb_render_color_t col; - xcb_rectangle_t rect; - - pixmap = x_create_pixmap(c, argb ? 32 : 8, d, 1, 1); - if (!pixmap) - return XCB_NONE; - - pa.repeat = 1; - picture = x_create_picture_with_standard_and_pixmap( - c, argb ? XCB_PICT_STANDARD_ARGB_32 : XCB_PICT_STANDARD_A_8, pixmap, - XCB_RENDER_CP_REPEAT, &pa); - - if (!picture) { - xcb_free_pixmap(c, pixmap); - return XCB_NONE; - } - - col.alpha = (uint16_t)(a * 0xffff); - col.red = (uint16_t)(r * 0xffff); - col.green = (uint16_t)(g * 0xffff); - col.blue = (uint16_t)(b * 0xffff); - - rect.x = 0; - rect.y = 0; - rect.width = 1; - rect.height = 1; - - xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, picture, col, 1, &rect); - xcb_free_pixmap(c, pixmap); - - return picture; -} - -xcb_image_t * -make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height) { - /* - * We classify shadows into 4 kinds of regions - * r = shadow radius - * (0, 0) is the top left of the window itself - * -r r width-r width+r - * -r +-----+---------+-----+ - * | 1 | 2 | 1 | - * r +-----+---------+-----+ - * | 2 | 3 | 2 | - * height-r +-----+---------+-----+ - * | 1 | 2 | 1 | - * height+r +-----+---------+-----+ - */ - xcb_image_t *ximage; - const double *shadow_sum = kernel->rsum; - assert(shadow_sum); - // We only support square kernels for shadow - assert(kernel->w == kernel->h); - int d = kernel->w; - int r = d / 2; - int swidth = width + r * 2, sheight = height + r * 2; - - assert(d % 2 == 1); - assert(d > 0); - - ximage = xcb_image_create_native(c, to_u16_checked(swidth), to_u16_checked(sheight), - XCB_IMAGE_FORMAT_Z_PIXMAP, 8, 0, 0, NULL); - if (!ximage) { - log_error("failed to create an X image"); - return 0; - } - - unsigned char *data = ximage->data; - long long sstride = ximage->stride; - - // If the window body is smaller than the kernel, we do convolution directly - if (width < r * 2 && height < r * 2) { - for (int y = 0; y < sheight; y++) { - for (int x = 0; x < swidth; x++) { - double sum = sum_kernel_normalized( - kernel, d - x - 1, d - y - 1, width, height); - data[y * sstride + x] = (uint8_t)(sum * 255.0 * opacity); - } - } - return ximage; - } - - if (height < r * 2) { - // Implies width >= r * 2 - // If the window height is smaller than the kernel, we divide - // the window like this: - // -r r width-r width+r - // +------+-------------+------+ - // | | | | - // +------+-------------+------+ - for (int y = 0; y < sheight; y++) { - for (int x = 0; x < r * 2; x++) { - double sum = sum_kernel_normalized(kernel, d - x - 1, - d - y - 1, d, height) * - 255.0 * opacity; - data[y * sstride + x] = (uint8_t)sum; - data[y * sstride + swidth - x - 1] = (uint8_t)sum; - } - } - for (int y = 0; y < sheight; y++) { - double sum = sum_kernel_normalized(kernel, 0, d - y - 1, d, height) * - 255.0 * opacity; - memset(&data[y * sstride + r * 2], (uint8_t)sum, - (size_t)(width - 2 * r)); - } - return ximage; - } - if (width < r * 2) { - // Similarly, for width smaller than kernel - for (int y = 0; y < r * 2; y++) { - for (int x = 0; x < swidth; x++) { - double sum = sum_kernel_normalized(kernel, d - x - 1, - d - y - 1, width, d) * - 255.0 * opacity; - data[y * sstride + x] = (uint8_t)sum; - data[(sheight - y - 1) * sstride + x] = (uint8_t)sum; - } - } - for (int x = 0; x < swidth; x++) { - double sum = sum_kernel_normalized(kernel, d - x - 1, 0, width, d) * - 255.0 * opacity; - for (int y = r * 2; y < height; y++) { - data[y * sstride + x] = (uint8_t)sum; - } - } - return ximage; - } - - // Implies: width >= r * 2 && height >= r * 2 - - // Fill part 3 - for (int y = r; y < height + r; y++) { - memset(data + sstride * y + r, (uint8_t)(255 * opacity), (size_t)width); - } - - // Part 1 - for (int y = 0; y < r * 2; y++) { - for (int x = 0; x < r * 2; x++) { - double tmpsum = shadow_sum[y * d + x] * opacity * 255.0; - data[y * sstride + x] = (uint8_t)tmpsum; - data[(sheight - y - 1) * sstride + x] = (uint8_t)tmpsum; - data[(sheight - y - 1) * sstride + (swidth - x - 1)] = (uint8_t)tmpsum; - data[y * sstride + (swidth - x - 1)] = (uint8_t)tmpsum; - } - } - - // Part 2, top/bottom - for (int y = 0; y < r * 2; y++) { - double tmpsum = shadow_sum[d * y + d - 1] * opacity * 255.0; - memset(&data[y * sstride + r * 2], (uint8_t)tmpsum, (size_t)(width - r * 2)); - memset(&data[(sheight - y - 1) * sstride + r * 2], (uint8_t)tmpsum, - (size_t)(width - r * 2)); - } - - // Part 2, left/right - for (int x = 0; x < r * 2; x++) { - double tmpsum = shadow_sum[d * (d - 1) + x] * opacity * 255.0; - for (int y = r * 2; y < height; y++) { - data[y * sstride + x] = (uint8_t)tmpsum; - data[y * sstride + (swidth - x - 1)] = (uint8_t)tmpsum; - } - } - - return ximage; -} - -/** - * Generate shadow Picture for a window. - */ -bool build_shadow(xcb_connection_t *c, xcb_drawable_t d, double opacity, const int width, - const int height, const conv *kernel, xcb_render_picture_t shadow_pixel, - xcb_pixmap_t *pixmap, xcb_render_picture_t *pict) { - xcb_image_t *shadow_image = NULL; - xcb_pixmap_t shadow_pixmap = XCB_NONE, shadow_pixmap_argb = XCB_NONE; - xcb_render_picture_t shadow_picture = XCB_NONE, shadow_picture_argb = XCB_NONE; - xcb_gcontext_t gc = XCB_NONE; - - shadow_image = make_shadow(c, kernel, opacity, width, height); - if (!shadow_image) { - log_error("Failed to make shadow"); - return false; - } - - shadow_pixmap = x_create_pixmap(c, 8, d, shadow_image->width, shadow_image->height); - shadow_pixmap_argb = - x_create_pixmap(c, 32, d, shadow_image->width, shadow_image->height); - - if (!shadow_pixmap || !shadow_pixmap_argb) { - log_error("Failed to create shadow pixmaps"); - goto shadow_picture_err; - } - - shadow_picture = x_create_picture_with_standard_and_pixmap( - c, XCB_PICT_STANDARD_A_8, shadow_pixmap, 0, NULL); - shadow_picture_argb = x_create_picture_with_standard_and_pixmap( - c, XCB_PICT_STANDARD_ARGB_32, shadow_pixmap_argb, 0, NULL); - if (!shadow_picture || !shadow_picture_argb) { - goto shadow_picture_err; - } - - gc = x_new_id(c); - xcb_create_gc(c, gc, shadow_pixmap, 0, NULL); - - // We need to make room for protocol metadata in the request. The metadata should - // be 24 bytes plus padding, let's be generous and give it 1kb - auto maximum_image_size = xcb_get_maximum_request_length(c) * 4 - 1024; - auto maximum_row = - to_u16_checked(clamp(maximum_image_size / shadow_image->stride, 0, UINT16_MAX)); - if (maximum_row <= 0) { - // TODO(yshui) Upload image with XShm - log_error("X server request size limit is too restrictive, or the shadow " - "image is too wide for us to send a single row of the shadow " - "image. Shadow size: %dx%d", - width, height); - goto shadow_picture_err; - } - - for (uint32_t row = 0; row < shadow_image->height; row += maximum_row) { - auto batch_height = maximum_row; - if (batch_height > shadow_image->height - row) { - batch_height = to_u16_checked(shadow_image->height - row); - } - - uint32_t offset = row * shadow_image->stride / sizeof(*shadow_image->data); - xcb_put_image(c, (uint8_t)shadow_image->format, shadow_pixmap, gc, - shadow_image->width, batch_height, 0, to_i16_checked(row), - 0, shadow_image->depth, shadow_image->stride * batch_height, - shadow_image->data + offset); - } - - xcb_render_composite(c, XCB_RENDER_PICT_OP_SRC, shadow_pixel, shadow_picture, - shadow_picture_argb, 0, 0, 0, 0, 0, 0, shadow_image->width, - shadow_image->height); - - *pixmap = shadow_pixmap_argb; - *pict = shadow_picture_argb; - - xcb_free_gc(c, gc); - xcb_image_destroy(shadow_image); - xcb_free_pixmap(c, shadow_pixmap); - xcb_render_free_picture(c, shadow_picture); - - return true; - -shadow_picture_err: - if (shadow_image) { - xcb_image_destroy(shadow_image); - } - if (shadow_pixmap) { - xcb_free_pixmap(c, shadow_pixmap); - } - if (shadow_pixmap_argb) { - xcb_free_pixmap(c, shadow_pixmap_argb); - } - if (shadow_picture) { - xcb_render_free_picture(c, shadow_picture); - } - if (shadow_picture_argb) { - xcb_render_free_picture(c, shadow_picture_argb); - } - if (gc) { - xcb_free_gc(c, gc); - } - - return false; -} - -void * -default_backend_render_shadow(backend_t *backend_data, int width, int height, - const conv *kernel, double r, double g, double b, double a) { - xcb_pixmap_t shadow_pixel = solid_picture(backend_data->c, backend_data->root, - true, 1, r, g, b), - shadow = XCB_NONE; - xcb_render_picture_t pict = XCB_NONE; - - if (!build_shadow(backend_data->c, backend_data->root, a, width, height, kernel, - shadow_pixel, &shadow, &pict)) { - return NULL; - } - - auto visual = x_get_visual_for_standard(backend_data->c, XCB_PICT_STANDARD_ARGB_32); - void *ret = backend_data->ops->bind_pixmap( - backend_data, shadow, x_get_visual_info(backend_data->c, visual), true); - xcb_render_free_picture(backend_data->c, pict); - return ret; -} - -static struct conv **generate_box_blur_kernel(struct box_blur_args *args, int *kernel_count) { - int r = args->size * 2 + 1; - assert(r > 0); - auto ret = ccalloc(2, struct conv *); - ret[0] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r); - ret[1] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r); - ret[0]->w = r; - ret[0]->h = 1; - ret[1]->w = 1; - ret[1]->h = r; - for (int i = 0; i < r; i++) { - ret[0]->data[i] = 1; - ret[1]->data[i] = 1; - } - *kernel_count = 2; - return ret; -} - -static struct conv ** -generate_gaussian_blur_kernel(struct gaussian_blur_args *args, int *kernel_count) { - int r = args->size * 2 + 1; - assert(r > 0); - auto ret = ccalloc(2, struct conv *); - ret[0] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r); - ret[1] = cvalloc(sizeof(struct conv) + sizeof(double) * (size_t)r); - ret[0]->w = r; - ret[0]->h = 1; - ret[1]->w = 1; - ret[1]->h = r; - for (int i = 0; i <= args->size; i++) { - ret[0]->data[i] = ret[0]->data[r - i - 1] = - 1.0 / (sqrt(2.0 * M_PI) * args->deviation) * - exp(-(args->size - i) * (args->size - i) / - (2 * args->deviation * args->deviation)); - ret[1]->data[i] = ret[1]->data[r - i - 1] = ret[0]->data[i]; - } - *kernel_count = 2; - return ret; -} - -/// Generate blur kernels for gaussian and box blur methods. Generated kernel is not -/// normalized, and the center element will always be 1. -struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count) { - switch (method) { - case BLUR_METHOD_BOX: return generate_box_blur_kernel(args, kernel_count); - case BLUR_METHOD_GAUSSIAN: - return generate_gaussian_blur_kernel(args, kernel_count); - default: break; - } - return NULL; -} - -/// Generate kernel parameters for dual-kawase blur method. Falls back on approximating -/// standard gauss radius if strength is zero or below. -struct dual_kawase_params *generate_dual_kawase_params(void *args) { - struct dual_kawase_blur_args *blur_args = args; - static const struct { - int iterations; /// Number of down- and upsample iterations - float offset; /// Sample offset in half-pixels - int min_radius; /// Approximate gauss-blur with at least this - /// radius and std-deviation - } strength_levels[20] = { - {.iterations = 1, .offset = 1.25f, .min_radius = 1}, // LVL 1 - {.iterations = 1, .offset = 2.25f, .min_radius = 6}, // LVL 2 - {.iterations = 2, .offset = 2.00f, .min_radius = 11}, // LVL 3 - {.iterations = 2, .offset = 3.00f, .min_radius = 17}, // LVL 4 - {.iterations = 2, .offset = 4.25f, .min_radius = 24}, // LVL 5 - {.iterations = 3, .offset = 2.50f, .min_radius = 32}, // LVL 6 - {.iterations = 3, .offset = 3.25f, .min_radius = 40}, // LVL 7 - {.iterations = 3, .offset = 4.25f, .min_radius = 51}, // LVL 8 - {.iterations = 3, .offset = 5.50f, .min_radius = 67}, // LVL 9 - {.iterations = 4, .offset = 3.25f, .min_radius = 83}, // LVL 10 - {.iterations = 4, .offset = 4.00f, .min_radius = 101}, // LVL 11 - {.iterations = 4, .offset = 5.00f, .min_radius = 123}, // LVL 12 - {.iterations = 4, .offset = 6.00f, .min_radius = 148}, // LVL 13 - {.iterations = 4, .offset = 7.25f, .min_radius = 178}, // LVL 14 - {.iterations = 4, .offset = 8.25f, .min_radius = 208}, // LVL 15 - {.iterations = 5, .offset = 4.50f, .min_radius = 236}, // LVL 16 - {.iterations = 5, .offset = 5.25f, .min_radius = 269}, // LVL 17 - {.iterations = 5, .offset = 6.25f, .min_radius = 309}, // LVL 18 - {.iterations = 5, .offset = 7.25f, .min_radius = 357}, // LVL 19 - {.iterations = 5, .offset = 8.50f, .min_radius = 417}, // LVL 20 - }; - - auto params = ccalloc(1, struct dual_kawase_params); - params->iterations = 0; - params->offset = 1.0f; - - if (blur_args->strength <= 0 && blur_args->size) { - // find highest level that approximates blur-strength with the selected - // gaussian blur-radius - int lvl = 1; - while (strength_levels[lvl - 1].min_radius < blur_args->size && lvl < 20) { - ++lvl; - } - blur_args->strength = lvl; - } - if (blur_args->strength <= 0) { - // default value - blur_args->strength = 5; - } - - assert(blur_args->strength > 0 && blur_args->strength <= 20); - params->iterations = strength_levels[blur_args->strength - 1].iterations; - params->offset = strength_levels[blur_args->strength - 1].offset; - - // Expand sample area to cover the smallest texture / highest selected iteration: - // - Smallest texture dimensions are halved `iterations`-times - // - Upsample needs pixels two-times `offset` away from the border - // - Plus one for interpolation differences - params->expand = (1 << params->iterations) * 2 * (int)ceil(params->offset) + 1; - - return params; -} - -void *default_clone_image(backend_t *base attr_unused, const void *image_data, - const region_t *reg_visible attr_unused) { - auto new_img = ccalloc(1, struct backend_image); - *new_img = *(struct backend_image *)image_data; - new_img->inner->refcount++; - return new_img; -} - -bool default_set_image_property(backend_t *base attr_unused, enum image_properties op, - void *image_data, void *arg) { - struct backend_image *tex = image_data; - int *iargs = arg; - bool *bargs = arg; - double *dargs = arg; - switch (op) { - case IMAGE_PROPERTY_INVERTED: tex->color_inverted = bargs[0]; break; - case IMAGE_PROPERTY_DIM_LEVEL: tex->dim = dargs[0]; break; - case IMAGE_PROPERTY_OPACITY: tex->opacity = dargs[0]; break; - case IMAGE_PROPERTY_EFFECTIVE_SIZE: - // texture is already set to repeat, so nothing else we need to do - tex->ewidth = iargs[0]; - tex->eheight = iargs[1]; - break; - case IMAGE_PROPERTY_CORNER_RADIUS: tex->corner_radius = dargs[0]; break; - case IMAGE_PROPERTY_MAX_BRIGHTNESS: tex->max_brightness = dargs[0]; break; - case IMAGE_PROPERTY_BORDER_WIDTH: tex->border_width = *(int *)arg; break; - } - - return true; -} - -bool default_is_image_transparent(backend_t *base attr_unused, void *image_data) { - struct backend_image *img = image_data; - return img->opacity < 1 || img->inner->has_alpha; -} - -struct backend_image *default_new_backend_image(int w, int h) { - auto ret = ccalloc(1, struct backend_image); - ret->opacity = 1; - ret->dim = 0; - ret->max_brightness = 1; - ret->eheight = h; - ret->ewidth = w; - ret->color_inverted = false; - ret->corner_radius = 0; - return ret; -} - -void init_backend_base(struct backend_base *base, session_t *ps) { - base->c = ps->c; - base->loop = ps->loop; - base->root = ps->root; - base->busy = false; - base->ops = NULL; -} diff --git a/dwm/picom/src/backend/backend_common.h b/dwm/picom/src/backend/backend_common.h deleted file mode 100644 index 53b4a26..0000000 --- a/dwm/picom/src/backend/backend_common.h +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once - -#include -#include - -#include - -#include "backend.h" -#include "config.h" -#include "region.h" - -typedef struct session session_t; -typedef struct win win; -typedef struct conv conv; -typedef struct backend_base backend_t; -struct backend_operations; - -struct dual_kawase_params { - /// Number of downsample passes - int iterations; - /// Pixel offset for down- and upsample - float offset; - /// Save area around blur target (@ref resize_width, @ref resize_height) - int expand; -}; - -struct backend_image_inner_base { - int refcount; - bool has_alpha; -}; - -struct backend_image { - // Backend dependent inner image data - struct backend_image_inner_base *inner; - double opacity; - double dim; - double max_brightness; - double corner_radius; - // Effective size of the image - int ewidth, eheight; - bool color_inverted; - int border_width; -}; - -bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, int width, - int height, const conv *kernel, xcb_render_picture_t shadow_pixel, - xcb_pixmap_t *pixmap, xcb_render_picture_t *pict); - -xcb_render_picture_t solid_picture(xcb_connection_t *, xcb_drawable_t, bool argb, - double a, double r, double g, double b); - -xcb_image_t * -make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height); - -/// The default implementation of `is_win_transparent`, it simply looks at win::mode. So -/// this is not suitable for backends that alter the content of windows -bool default_is_win_transparent(void *, win *, void *); - -/// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same -/// caveat as `default_is_win_transparent` applies. -bool default_is_frame_transparent(void *, win *, void *); - -void * -default_backend_render_shadow(backend_t *backend_data, int width, int height, - const conv *kernel, double r, double g, double b, double a); - -void init_backend_base(struct backend_base *base, session_t *ps); - -struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count); -struct dual_kawase_params *generate_dual_kawase_params(void *args); - -void *default_clone_image(backend_t *base, const void *image_data, const region_t *reg); -void *default_resize_image(backend_t *base, const void *image_data, uint16_t desired_width, - uint16_t desired_height, const region_t *reg); -bool default_is_image_transparent(backend_t *base attr_unused, void *image_data); -bool default_set_image_property(backend_t *base attr_unused, enum image_properties op, - void *image_data, void *arg); -struct backend_image *default_new_backend_image(int w, int h); diff --git a/dwm/picom/src/backend/driver.c b/dwm/picom/src/backend/driver.c deleted file mode 100644 index a41d2fd..0000000 --- a/dwm/picom/src/backend/driver.c +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include -#include - -#include -#include - -#include "backend/backend.h" -#include "backend/driver.h" -#include "common.h" -#include "compiler.h" -#include "log.h" - -/// Apply driver specified global workarounds. It's safe to call this multiple times. -void apply_driver_workarounds(struct session *ps, enum driver driver) { - if (driver & DRIVER_NVIDIA) { - // setenv("__GL_YIELD", "usleep", true); - setenv("__GL_MaxFramesAllowed", "1", true); - ps->o.xrender_sync_fence = true; - } -} - -enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_window_t window) { - enum driver ret = 0; - // First we try doing backend agnostic detection using RANDR - // There's no way to query the X server about what driver is loaded, so RANDR is - // our best shot. - auto randr_version = xcb_randr_query_version_reply( - c, xcb_randr_query_version(c, XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION), - NULL); - if (randr_version && - (randr_version->major_version > 1 || randr_version->minor_version >= 4)) { - auto r = xcb_randr_get_providers_reply( - c, xcb_randr_get_providers(c, window), NULL); - if (r == NULL) { - log_warn("Failed to get RANDR providers"); - free(randr_version); - return 0; - } - - auto providers = xcb_randr_get_providers_providers(r); - for (auto i = 0; i < xcb_randr_get_providers_providers_length(r); i++) { - auto r2 = xcb_randr_get_provider_info_reply( - c, xcb_randr_get_provider_info(c, providers[i], r->timestamp), NULL); - if (r2 == NULL) { - continue; - } - if (r2->num_outputs == 0) { - free(r2); - continue; - } - - auto name_len = xcb_randr_get_provider_info_name_length(r2); - assert(name_len >= 0); - auto name = - strndup(xcb_randr_get_provider_info_name(r2), (size_t)name_len); - if (strcasestr(name, "modesetting") != NULL) { - ret |= DRIVER_MODESETTING; - } else if (strcasestr(name, "Radeon") != NULL) { - // Be conservative, add both radeon drivers - ret |= DRIVER_AMDGPU | DRIVER_RADEON; - } else if (strcasestr(name, "NVIDIA") != NULL) { - ret |= DRIVER_NVIDIA; - } else if (strcasestr(name, "nouveau") != NULL) { - ret |= DRIVER_NOUVEAU; - } else if (strcasestr(name, "Intel") != NULL) { - ret |= DRIVER_INTEL; - } - free(name); - free(r2); - } - free(r); - } - free(randr_version); - - // If the backend supports driver detection, use that as well - if (backend_data && backend_data->ops->detect_driver) { - ret |= backend_data->ops->detect_driver(backend_data); - } - return ret; -} diff --git a/dwm/picom/src/backend/driver.h b/dwm/picom/src/backend/driver.h deleted file mode 100644 index a37cda3..0000000 --- a/dwm/picom/src/backend/driver.h +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#pragma once - -#include -#include -#include - -#include "utils.h" - -struct session; -struct backend_base; - -// A list of known driver quirks: -// * NVIDIA driver doesn't like seeing the same pixmap under different -// ids, so avoid naming the pixmap again when it didn't actually change. - -/// A list of possible drivers. -/// The driver situation is a bit complicated. There are two drivers we care about: the -/// DDX, and the OpenGL driver. They are usually paired, but not always, since there is -/// also the generic modesetting driver. -/// This enum represents _both_ drivers. -enum driver { - DRIVER_AMDGPU = 1, // AMDGPU for DDX, radeonsi for OpenGL - DRIVER_RADEON = 2, // ATI for DDX, mesa r600 for OpenGL - DRIVER_FGLRX = 4, - DRIVER_NVIDIA = 8, - DRIVER_NOUVEAU = 16, - DRIVER_INTEL = 32, - DRIVER_MODESETTING = 64, -}; - -static const char *driver_names[] = { - "AMDGPU", "Radeon", "fglrx", "NVIDIA", "nouveau", "Intel", "modesetting", -}; - -/// Return a list of all drivers currently in use by the X server. -/// Note, this is a best-effort test, so no guarantee all drivers will be detected. -enum driver detect_driver(xcb_connection_t *, struct backend_base *, xcb_window_t); - -/// Apply driver specified global workarounds. It's safe to call this multiple times. -void apply_driver_workarounds(struct session *ps, enum driver); - -// Print driver names to stdout, for diagnostics -static inline void print_drivers(enum driver drivers) { - const char *seen_drivers[ARR_SIZE(driver_names)]; - int driver_count = 0; - for (size_t i = 0; i < ARR_SIZE(driver_names); i++) { - if (drivers & (1ul << i)) { - seen_drivers[driver_count++] = driver_names[i]; - } - } - - if (driver_count > 0) { - printf("%s", seen_drivers[0]); - for (int i = 1; i < driver_count; i++) { - printf(", %s", seen_drivers[i]); - } - } - printf("\n"); -} diff --git a/dwm/picom/src/backend/dummy/dummy.c b/dwm/picom/src/backend/dummy/dummy.c deleted file mode 100644 index a057b97..0000000 --- a/dwm/picom/src/backend/dummy/dummy.c +++ /dev/null @@ -1,174 +0,0 @@ -#include -#include - -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "log.h" -#include "region.h" -#include "types.h" -#include "uthash_extra.h" -#include "utils.h" -#include "x.h" - -struct dummy_image { - xcb_pixmap_t pixmap; - bool transparent; - int *refcount; - UT_hash_handle hh; -}; - -struct dummy_data { - struct backend_base base; - struct dummy_image *images; -}; - -struct backend_base *dummy_init(struct session *ps attr_unused) { - auto ret = (struct backend_base *)ccalloc(1, struct dummy_data); - ret->c = ps->c; - ret->loop = ps->loop; - ret->root = ps->root; - ret->busy = false; - return ret; -} - -void dummy_deinit(struct backend_base *data) { - auto dummy = (struct dummy_data *)data; - HASH_ITER2(dummy->images, img) { - log_warn("Backend image for pixmap %#010x is not freed", img->pixmap); - HASH_DEL(dummy->images, img); - free(img->refcount); - free(img); - } - free(dummy); -} - -static void dummy_check_image(struct backend_base *base, const struct dummy_image *img) { - auto dummy = (struct dummy_data *)base; - struct dummy_image *tmp = NULL; - HASH_FIND_INT(dummy->images, &img->pixmap, tmp); - if (!tmp) { - log_warn("Using an invalid (possibly freed) image"); - assert(false); - } - assert(*tmp->refcount > 0); -} - -void dummy_compose(struct backend_base *base, void *image, int dst_x1 attr_unused, - int dst_y1 attr_unused, int dst_x2 attr_unused, int dst_y2 attr_unused, - const region_t *reg_paint attr_unused, const region_t *reg_visible attr_unused) { - dummy_check_image(base, image); -} - -void dummy_fill(struct backend_base *backend_data attr_unused, struct color c attr_unused, - const region_t *clip attr_unused) { -} - -bool dummy_blur(struct backend_base *backend_data attr_unused, double opacity attr_unused, - void *blur_ctx attr_unused, const region_t *reg_blur attr_unused, - const region_t *reg_visible attr_unused) { - return true; -} - -void *dummy_bind_pixmap(struct backend_base *base, xcb_pixmap_t pixmap, - struct xvisual_info fmt, bool owned attr_unused) { - auto dummy = (struct dummy_data *)base; - struct dummy_image *img = NULL; - HASH_FIND_INT(dummy->images, &pixmap, img); - if (img) { - (*img->refcount)++; - return img; - } - - img = ccalloc(1, struct dummy_image); - img->pixmap = pixmap; - img->transparent = fmt.alpha_size != 0; - img->refcount = ccalloc(1, int); - *img->refcount = 1; - - HASH_ADD_INT(dummy->images, pixmap, img); - return (void *)img; -} - -void dummy_release_image(backend_t *base, void *image) { - auto dummy = (struct dummy_data *)base; - auto img = (struct dummy_image *)image; - assert(*img->refcount > 0); - (*img->refcount)--; - if (*img->refcount == 0) { - HASH_DEL(dummy->images, img); - free(img->refcount); - free(img); - } -} - -bool dummy_is_image_transparent(struct backend_base *base, void *image) { - auto img = (struct dummy_image *)image; - dummy_check_image(base, img); - return img->transparent; -} - -int dummy_buffer_age(struct backend_base *base attr_unused) { - return 2; -} - -bool dummy_image_op(struct backend_base *base, enum image_operations op attr_unused, - void *image, const region_t *reg_op attr_unused, - const region_t *reg_visible attr_unused, void *args attr_unused) { - dummy_check_image(base, image); - return true; -} - -bool dummy_set_image_property(struct backend_base *base, enum image_properties prop attr_unused, - void *image, void *arg attr_unused) { - dummy_check_image(base, image); - return true; -} - -void *dummy_clone_image(struct backend_base *base, const void *image, - const region_t *reg_visible attr_unused) { - auto img = (const struct dummy_image *)image; - dummy_check_image(base, img); - (*img->refcount)++; - return (void *)img; -} - -void *dummy_create_blur_context(struct backend_base *base attr_unused, - enum blur_method method attr_unused, void *args attr_unused) { - static int dummy_context; - return &dummy_context; -} - -void dummy_destroy_blur_context(struct backend_base *base attr_unused, void *ctx attr_unused) { -} - -void dummy_get_blur_size(void *ctx attr_unused, int *width, int *height) { - // These numbers are arbitrary, to make sure the reisze_region code path is - // covered. - *width = 5; - *height = 5; -} - -struct backend_operations dummy_ops = { - .init = dummy_init, - .deinit = dummy_deinit, - .compose = dummy_compose, - .fill = dummy_fill, - .blur = dummy_blur, - .bind_pixmap = dummy_bind_pixmap, - .render_shadow = default_backend_render_shadow, - .release_image = dummy_release_image, - .is_image_transparent = dummy_is_image_transparent, - .buffer_age = dummy_buffer_age, - .max_buffer_age = 5, - - .image_op = dummy_image_op, - .clone_image = dummy_clone_image, - .set_image_property = dummy_set_image_property, - .create_blur_context = dummy_create_blur_context, - .destroy_blur_context = dummy_destroy_blur_context, - .get_blur_size = dummy_get_blur_size, - -}; diff --git a/dwm/picom/src/backend/gl/gl_common.c b/dwm/picom/src/backend/gl/gl_common.c deleted file mode 100644 index bf00e74..0000000 --- a/dwm/picom/src/backend/gl/gl_common.c +++ /dev/null @@ -1,1946 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include -#include -#include -#include -#include -#include -#include // for xcb_render_fixed_t, XXX - -#include "backend/backend.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "string_utils.h" -#include "types.h" -#include "utils.h" - -#include "backend/backend_common.h" -#include "backend/gl/gl_common.h" - -#define GLSL(version, ...) "#version " #version "\n" #__VA_ARGS__ -#define QUOTE(...) #__VA_ARGS__ - -static const GLuint vert_coord_loc = 0; -static const GLuint vert_in_texcoord_loc = 1; - -struct gl_blur_context { - enum blur_method method; - gl_blur_shader_t *blur_shader; - - /// Temporary textures used for blurring - GLuint *blur_textures; - int blur_texture_count; - /// Temporary fbos used for blurring - GLuint *blur_fbos; - int blur_fbo_count; - - /// Cached dimensions of each blur_texture. They are the same size as the target, - /// so they are always big enough without resizing. - /// Turns out calling glTexImage to resize is expensive, so we avoid that. - struct texture_size { - int width; - int height; - } * texture_sizes; - - /// Cached dimensions of the offscreen framebuffer. It's the same size as the - /// target but is expanded in either direction by resize_width / resize_height. - int fb_width, fb_height; - - /// How much do we need to resize the damaged region for blurring. - int resize_width, resize_height; - - int npasses; -}; - -GLuint gl_create_shader(GLenum shader_type, const char *shader_str) { - log_trace("===\n%s\n===", shader_str); - - bool success = false; - GLuint shader = glCreateShader(shader_type); - if (!shader) { - log_error("Failed to create shader with type %#x.", shader_type); - goto end; - } - glShaderSource(shader, 1, &shader_str, NULL); - glCompileShader(shader); - - // Get shader status - { - GLint status = GL_FALSE; - glGetShaderiv(shader, GL_COMPILE_STATUS, &status); - if (GL_FALSE == status) { - GLint log_len = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &log_len); - if (log_len) { - char log[log_len + 1]; - glGetShaderInfoLog(shader, log_len, NULL, log); - log_error("Failed to compile shader with type %d: %s", - shader_type, log); - } - goto end; - } - } - - success = true; - -end: - if (shader && !success) { - glDeleteShader(shader); - shader = 0; - } - - return shader; -} - -GLuint gl_create_program(const GLuint *const shaders, int nshaders) { - bool success = false; - GLuint program = glCreateProgram(); - if (!program) { - log_error("Failed to create program."); - goto end; - } - - for (int i = 0; i < nshaders; ++i) - glAttachShader(program, shaders[i]); - glLinkProgram(program); - - // Get program status - { - GLint status = GL_FALSE; - glGetProgramiv(program, GL_LINK_STATUS, &status); - if (GL_FALSE == status) { - GLint log_len = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_len); - if (log_len) { - char log[log_len + 1]; - glGetProgramInfoLog(program, log_len, NULL, log); - log_error("Failed to link program: %s", log); - } - goto end; - } - } - success = true; - -end: - if (program) { - for (int i = 0; i < nshaders; ++i) - glDetachShader(program, shaders[i]); - } - if (program && !success) { - glDeleteProgram(program); - program = 0; - } - - return program; -} - -/** - * @brief Create a program from vertex and fragment shader strings. - */ -GLuint gl_create_program_from_str(const char *vert_shader_str, const char *frag_shader_str) { - GLuint vert_shader = 0; - GLuint frag_shader = 0; - GLuint prog = 0; - - if (vert_shader_str) - vert_shader = gl_create_shader(GL_VERTEX_SHADER, vert_shader_str); - if (frag_shader_str) - frag_shader = gl_create_shader(GL_FRAGMENT_SHADER, frag_shader_str); - - { - GLuint shaders[2]; - int count = 0; - if (vert_shader) { - shaders[count++] = vert_shader; - } - if (frag_shader) { - shaders[count++] = frag_shader; - } - if (count) { - prog = gl_create_program(shaders, count); - } - } - - if (vert_shader) - glDeleteShader(vert_shader); - if (frag_shader) - glDeleteShader(frag_shader); - - return prog; -} - -static void gl_free_prog_main(gl_win_shader_t *pprogram) { - if (!pprogram) - return; - if (pprogram->prog) { - glDeleteProgram(pprogram->prog); - pprogram->prog = 0; - } -} - -/* - * @brief Implements recursive part of gl_average_texture_color. - * - * @note In order to reduce number of textures which needs to be - * allocated and deleted during this recursive render - * we reuse the same two textures for render source and - * destination simply by alterating between them. - * Unfortunately on first iteration source_texture might - * be read-only. In this case we will select auxiliary_texture as - * destination_texture in order not to touch that read-only source - * texture in following render iteration. - * Otherwise we simply will switch source and destination textures - * between each other on each render iteration. - */ -static GLuint -_gl_average_texture_color(backend_t *base, GLuint source_texture, GLuint destination_texture, - GLuint auxiliary_texture, GLuint fbo, int width, int height) { - const int max_width = 1; - const int max_height = 1; - const int from_width = next_power_of_two(width); - const int from_height = next_power_of_two(height); - const int to_width = from_width > max_width ? from_width / 2 : from_width; - const int to_height = from_height > max_height ? from_height / 2 : from_height; - - // Prepare coordinates - GLint coord[] = { - // top left - 0, 0, // vertex coord - 0, 0, // texture coord - - // top right - to_width, 0, // vertex coord - width, 0, // texture coord - - // bottom right - to_width, to_height, // vertex coord - width, height, // texture coord - - // bottom left - 0, to_height, // vertex coord - 0, height, // texture coord - }; - glBufferSubData(GL_ARRAY_BUFFER, 0, (long)sizeof(*coord) * 16, coord); - - // Prepare framebuffer for new render iteration - glBindTexture(GL_TEXTURE_2D, destination_texture); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, - destination_texture, 0); - gl_check_fb_complete(GL_FRAMEBUFFER); - - // Bind source texture as downscaling shader uniform input - glBindTexture(GL_TEXTURE_2D, source_texture); - - // Render into framebuffer - glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); - - // Have we downscaled enough? - GLuint result; - if (to_width > max_width || to_height > max_height) { - GLuint new_source_texture = destination_texture; - GLuint new_destination_texture = - auxiliary_texture != 0 ? auxiliary_texture : source_texture; - result = _gl_average_texture_color(base, new_source_texture, - new_destination_texture, 0, fbo, - to_width, to_height); - } else { - result = destination_texture; - } - - return result; -} - -/* - * @brief Builds a 1x1 texture which has color corresponding to the average of all - * pixels of img by recursively rendering into texture of quorter the size (half - * width and half height). - * Returned texture must not be deleted, since it's owned by the gl_image. It will be - * deleted when the gl_image is released. - */ -static GLuint gl_average_texture_color(backend_t *base, struct backend_image *img) { - auto gd = (struct gl_data *)base; - auto inner = (struct gl_texture *)img->inner; - - // Prepare textures which will be used for destination and source of rendering - // during downscaling. - const int texture_count = ARR_SIZE(inner->auxiliary_texture); - if (!inner->auxiliary_texture[0]) { - assert(!inner->auxiliary_texture[1]); - glGenTextures(texture_count, inner->auxiliary_texture); - glActiveTexture(GL_TEXTURE0); - for (int i = 0; i < texture_count; i++) { - glBindTexture(GL_TEXTURE_2D, inner->auxiliary_texture[i]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, - (GLint[]){0, 0, 0, 0}); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, inner->width, - inner->height, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL); - } - } - - // Prepare framebuffer used for rendering and bind it - GLuint fbo; - glGenFramebuffers(1, &fbo); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - - // Enable shaders - glUseProgram(gd->brightness_shader.prog); - glUniform2f(glGetUniformLocationChecked(gd->brightness_shader.prog, "texsize"), - (GLfloat)inner->width, (GLfloat)inner->height); - - // Prepare vertex attributes - GLuint vao; - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - GLuint bo[2]; - glGenBuffers(2, bo); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - glEnableVertexAttribArray(vert_coord_loc); - glEnableVertexAttribArray(vert_in_texcoord_loc); - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL); - glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE, - sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2)); - - // Allocate buffers for render input - GLint coord[16] = {0}; - GLuint indices[] = {0, 1, 2, 2, 3, 0}; - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * 16, coord, GL_DYNAMIC_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * 6, indices, - GL_STATIC_DRAW); - - // Do actual recursive render to 1x1 texture - GLuint result_texture = _gl_average_texture_color( - base, inner->texture, inner->auxiliary_texture[0], - inner->auxiliary_texture[1], fbo, inner->width, inner->height); - - // Cleanup vertex attributes - glDisableVertexAttribArray(vert_coord_loc); - glDisableVertexAttribArray(vert_in_texcoord_loc); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glDeleteBuffers(2, bo); - glBindVertexArray(0); - glDeleteVertexArrays(1, &vao); - - // Cleanup shaders - glUseProgram(0); - - // Cleanup framebuffers - glDeleteFramebuffers(1, &fbo); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glDrawBuffer(GL_BACK); - - // Cleanup render textures - glBindTexture(GL_TEXTURE_2D, 0); - - gl_check_err(); - - return result_texture; -} - -/** - * Render a region with texture data. - * - * @param ptex the texture - * @param target the framebuffer to render into - * @param dst_x,dst_y the top left corner of region where this texture - * should go. In OpenGL coordinate system (important!). - * @param reg_tgt the clip region, in Xorg coordinate system - * @param reg_visible ignored - */ -static void _gl_compose(backend_t *base, struct backend_image *img, GLuint target, - GLint *coord, GLuint *indices, int nrects) { - auto gd = (struct gl_data *)base; - auto inner = (struct gl_texture *)img->inner; - if (!img || !inner->texture) { - log_error("Missing texture."); - return; - } - - GLuint brightness = 0; - if (img->max_brightness < 1.0) { - brightness = gl_average_texture_color(base, img); - } - - assert(gd->win_shader.prog); - glUseProgram(gd->win_shader.prog); - if (gd->win_shader.uniform_opacity >= 0) { - glUniform1f(gd->win_shader.uniform_opacity, (float)img->opacity); - } - if (gd->win_shader.uniform_invert_color >= 0) { - glUniform1i(gd->win_shader.uniform_invert_color, img->color_inverted); - } - if (gd->win_shader.uniform_tex >= 0) { - glUniform1i(gd->win_shader.uniform_tex, 0); - } - if (gd->win_shader.uniform_dim >= 0) { - glUniform1f(gd->win_shader.uniform_dim, (float)img->dim); - } - if (gd->win_shader.uniform_brightness >= 0) { - glUniform1i(gd->win_shader.uniform_brightness, 1); - } - if (gd->win_shader.uniform_max_brightness >= 0) { - glUniform1f(gd->win_shader.uniform_max_brightness, (float)img->max_brightness); - } - if (gd->win_shader.uniform_corner_radius >= 0) { - glUniform1f(gd->win_shader.uniform_corner_radius, (float)img->corner_radius); - } - if (gd->win_shader.uniform_border_width >= 0) { - auto border_width = img->border_width; - if (border_width > img->corner_radius) { - border_width = 0; - } - glUniform1f(gd->win_shader.uniform_border_width, (float)border_width); - } - - // log_trace("Draw: %d, %d, %d, %d -> %d, %d (%d, %d) z %d\n", - // x, y, width, height, dx, dy, ptex->width, ptex->height, z); - - // Bind texture - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, brightness); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, inner->texture); - - GLuint vao; - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - - GLuint bo[2]; - glGenBuffers(2, bo); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * nrects * 16, coord, GL_STATIC_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * nrects * 6, - indices, GL_STATIC_DRAW); - - glEnableVertexAttribArray(vert_coord_loc); - glEnableVertexAttribArray(vert_in_texcoord_loc); - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL); - glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE, - sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2)); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target); - glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL); - - glDisableVertexAttribArray(vert_coord_loc); - glDisableVertexAttribArray(vert_in_texcoord_loc); - glBindVertexArray(0); - glDeleteVertexArrays(1, &vao); - - // Cleanup - glBindTexture(GL_TEXTURE_2D, 0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glDrawBuffer(GL_BACK); - - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glDeleteBuffers(2, bo); - - glUseProgram(0); - - gl_check_err(); - - return; -} - -/// Convert rectangles in X coordinates to OpenGL vertex and texture coordinates -/// @param[in] nrects, rects rectangles -/// @param[in] dst_x, dst_y origin of the OpenGL texture, affect the calculated texture -/// coordinates -/// @param[in] texture_height height of the OpenGL texture -/// @param[in] root_height height of the back buffer -/// @param[in] y_inverted whether the texture is y inverted -/// @param[out] coord, indices output -static void -x_rect_to_coords(int nrects, const rect_t *rects, int dst_x, int dst_y, int texture_height, - int root_height, bool y_inverted, GLint *coord, GLuint *indices) { - dst_y = root_height - dst_y; - if (y_inverted) { - dst_y -= texture_height; - } - - for (int i = 0; i < nrects; i++) { - // Y-flip. Note after this, crect.y1 > crect.y2 - rect_t crect = rects[i]; - crect.y1 = root_height - crect.y1; - crect.y2 = root_height - crect.y2; - - // Calculate texture coordinates - // (texture_x1, texture_y1), texture coord for the _bottom left_ corner - GLint texture_x1 = crect.x1 - dst_x, texture_y1 = crect.y2 - dst_y, - texture_x2 = texture_x1 + (crect.x2 - crect.x1), - texture_y2 = texture_y1 + (crect.y1 - crect.y2); - - // X pixmaps might be Y inverted, invert the texture coordinates - if (y_inverted) { - texture_y1 = texture_height - texture_y1; - texture_y2 = texture_height - texture_y2; - } - - // Vertex coordinates - auto vx1 = crect.x1; - auto vy1 = crect.y2; - auto vx2 = crect.x2; - auto vy2 = crect.y1; - - // log_trace("Rect %d: %f, %f, %f, %f -> %d, %d, %d, %d", - // ri, rx, ry, rxe, rye, rdx, rdy, rdxe, rdye); - - memcpy(&coord[i * 16], - ((GLint[][2]){ - {vx1, vy1}, - {texture_x1, texture_y1}, - {vx2, vy1}, - {texture_x2, texture_y1}, - {vx2, vy2}, - {texture_x2, texture_y2}, - {vx1, vy2}, - {texture_x1, texture_y2}, - }), - sizeof(GLint[2]) * 8); - - GLuint u = (GLuint)(i * 4); - memcpy(&indices[i * 6], - ((GLuint[]){u + 0, u + 1, u + 2, u + 2, u + 3, u + 0}), - sizeof(GLuint) * 6); - } -} - -// TODO(yshui) make use of reg_visible -void gl_compose(backend_t *base, void *image_data, - int dst_x1, int dst_y1, int dst_x2, int dst_y2, - const region_t *reg_tgt, const region_t *reg_visible attr_unused) { - auto gd = (struct gl_data *)base; - struct backend_image *img = image_data; - auto inner = (struct gl_texture *)img->inner; - - // Painting - int nrects; - const rect_t *rects; - rects = pixman_region32_rectangles((region_t *)reg_tgt, &nrects); - if (!nrects) { - // Nothing to paint - return; - } - - // Until we start to use glClipControl, reg_tgt, dst_x and dst_y and - // in a different coordinate system than the one OpenGL uses. - // OpenGL window coordinate (or NDC) has the origin at the lower left of the - // screen, with y axis pointing up; Xorg has the origin at the upper left of the - // screen, with y axis pointing down. We have to do some coordinate conversion in - // this function - - auto coord = ccalloc(nrects * 16, GLint); - auto indices = ccalloc(nrects * 6, GLuint); - x_rect_to_coords(nrects, rects, dst_x1, dst_y1, inner->height, gd->height, - inner->y_inverted, coord, indices); - - // Interpolate the texture coordinates into the specified range - for (unsigned int i = 2; i < 16; i+=4) { - coord[i+0] = lerp_range(0, dst_x2 - dst_x1, 0, inner->width, coord[i+0]); - coord[i+1] = lerp_range(0, dst_y2 - dst_y1, 0, inner->height, coord[i+1]); - } - - _gl_compose(base, img, gd->back_fbo, coord, indices, nrects); - - free(indices); - free(coord); -} - -/** - * Blur contents in a particular region. - */ -bool gl_kernel_blur(backend_t *base, double opacity, void *ctx, const rect_t *extent, - const GLuint vao[2], const int vao_nelems[2]) { - auto bctx = (struct gl_blur_context *)ctx; - auto gd = (struct gl_data *)base; - - int dst_y_fb_coord = bctx->fb_height - extent->y2; - - int curr = 0; - for (int i = 0; i < bctx->npasses; ++i) { - const gl_blur_shader_t *p = &bctx->blur_shader[i]; - assert(p->prog); - - assert(bctx->blur_textures[curr]); - - // The origin to use when sampling from the source texture - GLint texorig_x = extent->x1, texorig_y = dst_y_fb_coord; - GLint tex_width, tex_height; - GLuint src_texture; - - if (i == 0) { - src_texture = gd->back_texture; - tex_width = gd->width; - tex_height = gd->height; - } else { - src_texture = bctx->blur_textures[curr]; - auto src_size = bctx->texture_sizes[curr]; - tex_width = src_size.width; - tex_height = src_size.height; - } - - glBindTexture(GL_TEXTURE_2D, src_texture); - glUseProgram(p->prog); - glUniform2f(p->uniform_pixel_norm, 1.0f / (GLfloat)tex_width, - 1.0f / (GLfloat)tex_height); - - // The number of indices in the selected vertex array - GLsizei nelems; - - if (i < bctx->npasses - 1) { - assert(bctx->blur_fbos[0]); - assert(bctx->blur_textures[!curr]); - - // not last pass, draw into framebuffer, with resized regions - glBindVertexArray(vao[1]); - nelems = vao_nelems[1]; - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[0]); - - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, bctx->blur_textures[!curr], 0); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - if (!gl_check_fb_complete(GL_FRAMEBUFFER)) { - return false; - } - - glUniform1f(p->uniform_opacity, 1.0); - } else { - // last pass, draw directly into the back buffer, with origin - // regions - glBindVertexArray(vao[0]); - nelems = vao_nelems[0]; - glBindFramebuffer(GL_FRAMEBUFFER, gd->back_fbo); - - glUniform1f(p->uniform_opacity, (float)opacity); - } - - glUniform2f(p->texorig_loc, (GLfloat)texorig_x, (GLfloat)texorig_y); - glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL); - - // XXX use multiple draw calls is probably going to be slow than - // just simply blur the whole area. - - curr = !curr; - } - - return true; -} - -bool gl_dual_kawase_blur(backend_t *base, double opacity, void *ctx, const rect_t *extent, - const GLuint vao[2], const int vao_nelems[2]) { - auto bctx = (struct gl_blur_context *)ctx; - auto gd = (struct gl_data *)base; - - int dst_y_fb_coord = bctx->fb_height - extent->y2; - - int iterations = bctx->blur_texture_count; - int scale_factor = 1; - - // Kawase downsample pass - const gl_blur_shader_t *down_pass = &bctx->blur_shader[0]; - assert(down_pass->prog); - glUseProgram(down_pass->prog); - - glUniform2f(down_pass->texorig_loc, (GLfloat)extent->x1, (GLfloat)dst_y_fb_coord); - - for (int i = 0; i < iterations; ++i) { - // Scale output width / height by half in each iteration - scale_factor <<= 1; - - GLuint src_texture; - int tex_width, tex_height; - - if (i == 0) { - // first pass: copy from back buffer - src_texture = gd->back_texture; - tex_width = gd->width; - tex_height = gd->height; - } else { - // copy from previous pass - src_texture = bctx->blur_textures[i - 1]; - auto src_size = bctx->texture_sizes[i - 1]; - tex_width = src_size.width; - tex_height = src_size.height; - } - - assert(src_texture); - assert(bctx->blur_fbos[i]); - - glBindTexture(GL_TEXTURE_2D, src_texture); - glBindVertexArray(vao[1]); - auto nelems = vao_nelems[1]; - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i]); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - - glUniform1f(down_pass->scale_loc, (GLfloat)scale_factor); - - glUniform2f(down_pass->uniform_pixel_norm, 1.0f / (GLfloat)tex_width, - 1.0f / (GLfloat)tex_height); - - glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL); - } - - // Kawase upsample pass - const gl_blur_shader_t *up_pass = &bctx->blur_shader[1]; - assert(up_pass->prog); - glUseProgram(up_pass->prog); - - glUniform2f(up_pass->texorig_loc, (GLfloat)extent->x1, (GLfloat)dst_y_fb_coord); - - for (int i = iterations - 1; i >= 0; --i) { - // Scale output width / height back by two in each iteration - scale_factor >>= 1; - - const GLuint src_texture = bctx->blur_textures[i]; - assert(src_texture); - - // Calculate normalized half-width/-height of a src pixel - auto src_size = bctx->texture_sizes[i]; - int tex_width = src_size.width; - int tex_height = src_size.height; - - // The number of indices in the selected vertex array - GLsizei nelems; - - glBindTexture(GL_TEXTURE_2D, src_texture); - if (i > 0) { - assert(bctx->blur_fbos[i - 1]); - - // not last pass, draw into next framebuffer - glBindVertexArray(vao[1]); - nelems = vao_nelems[1]; - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i - 1]); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - - glUniform1f(up_pass->uniform_opacity, (GLfloat)1); - } else { - // last pass, draw directly into the back buffer - glBindVertexArray(vao[0]); - nelems = vao_nelems[0]; - glBindFramebuffer(GL_FRAMEBUFFER, gd->back_fbo); - - glUniform1f(up_pass->uniform_opacity, (GLfloat)opacity); - } - - glUniform1f(up_pass->scale_loc, (GLfloat)scale_factor); - glUniform2f(up_pass->uniform_pixel_norm, 1.0f / (GLfloat)tex_width, - 1.0f / (GLfloat)tex_height); - - glDrawElements(GL_TRIANGLES, nelems, GL_UNSIGNED_INT, NULL); - } - - return true; -} - -bool gl_blur(backend_t *base, double opacity, void *ctx, const region_t *reg_blur, - const region_t *reg_visible attr_unused) { - auto bctx = (struct gl_blur_context *)ctx; - auto gd = (struct gl_data *)base; - - bool ret = false; - - if (gd->width != bctx->fb_width || gd->height != bctx->fb_height) { - // Resize the temporary textures used for blur in case the root - // size changed - bctx->fb_width = gd->width; - bctx->fb_height = gd->height; - - for (int i = 0; i < bctx->blur_texture_count; ++i) { - auto tex_size = bctx->texture_sizes + i; - if (bctx->method == BLUR_METHOD_DUAL_KAWASE) { - // Use smaller textures for each iteration (quarter of the - // previous texture) - tex_size->width = 1 + ((bctx->fb_width - 1) >> (i + 1)); - tex_size->height = 1 + ((bctx->fb_height - 1) >> (i + 1)); - } else { - tex_size->width = bctx->fb_width; - tex_size->height = bctx->fb_height; - } - - glBindTexture(GL_TEXTURE_2D, bctx->blur_textures[i]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_size->width, - tex_size->height, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - - if (bctx->method == BLUR_METHOD_DUAL_KAWASE) { - // Attach texture to FBO target - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, bctx->blur_fbos[i]); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, - bctx->blur_textures[i], 0); - if (!gl_check_fb_complete(GL_FRAMEBUFFER)) { - glBindFramebuffer(GL_FRAMEBUFFER, 0); - return false; - } - } - } - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - } - - // Remainder: regions are in Xorg coordinates - auto reg_blur_resized = - resize_region(reg_blur, bctx->resize_width, bctx->resize_height); - const rect_t *extent = pixman_region32_extents((region_t *)reg_blur), - *extent_resized = pixman_region32_extents(®_blur_resized); - int width = extent->x2 - extent->x1, height = extent->y2 - extent->y1; - if (width == 0 || height == 0) { - return true; - } - - int nrects, nrects_resized; - const rect_t *rects = pixman_region32_rectangles((region_t *)reg_blur, &nrects), - *rects_resized = - pixman_region32_rectangles(®_blur_resized, &nrects_resized); - if (!nrects || !nrects_resized) { - return true; - } - - auto coord = ccalloc(nrects * 16, GLint); - auto indices = ccalloc(nrects * 6, GLuint); - x_rect_to_coords(nrects, rects, extent_resized->x1, extent_resized->y2, - bctx->fb_height, gd->height, false, coord, indices); - - auto coord_resized = ccalloc(nrects_resized * 16, GLint); - auto indices_resized = ccalloc(nrects_resized * 6, GLuint); - x_rect_to_coords(nrects_resized, rects_resized, extent_resized->x1, - extent_resized->y2, bctx->fb_height, bctx->fb_height, false, - coord_resized, indices_resized); - pixman_region32_fini(®_blur_resized); - - GLuint vao[2]; - glGenVertexArrays(2, vao); - GLuint bo[4]; - glGenBuffers(4, bo); - - glBindVertexArray(vao[0]); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * nrects * 16, coord, GL_STATIC_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * nrects * 6, - indices, GL_STATIC_DRAW); - glEnableVertexAttribArray(vert_coord_loc); - glEnableVertexAttribArray(vert_in_texcoord_loc); - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL); - glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE, - sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2)); - - glBindVertexArray(vao[1]); - glBindBuffer(GL_ARRAY_BUFFER, bo[2]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[3]); - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord_resized) * nrects_resized * 16, - coord_resized, GL_STATIC_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, - (long)sizeof(*indices_resized) * nrects_resized * 6, indices_resized, - GL_STATIC_DRAW); - glEnableVertexAttribArray(vert_coord_loc); - glEnableVertexAttribArray(vert_in_texcoord_loc); - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL); - glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE, - sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2)); - - int vao_nelems[2] = {nrects * 6, nrects_resized * 6}; - - if (bctx->method == BLUR_METHOD_DUAL_KAWASE) { - ret = gl_dual_kawase_blur(base, opacity, ctx, extent_resized, vao, vao_nelems); - } else { - ret = gl_kernel_blur(base, opacity, ctx, extent_resized, vao, vao_nelems); - } - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glBindTexture(GL_TEXTURE_2D, 0); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glDeleteBuffers(4, bo); - glBindVertexArray(0); - glDeleteVertexArrays(2, vao); - glUseProgram(0); - - free(indices); - free(coord); - free(indices_resized); - free(coord_resized); - - gl_check_err(); - return ret; -} - -// clang-format off -const char *vertex_shader = GLSL(330, - uniform mat4 projection; - uniform float scale = 1.0; - uniform vec2 texorig; - layout(location = 0) in vec2 coord; - layout(location = 1) in vec2 in_texcoord; - out vec2 texcoord; - void main() { - gl_Position = projection * vec4(coord, 0, scale); - texcoord = in_texcoord + texorig; - } -); -// clang-format on - -/** - * Load a GLSL main program from shader strings. - */ -static int gl_win_shader_from_string(const char *vshader_str, const char *fshader_str, - gl_win_shader_t *ret) { - // Build program - ret->prog = gl_create_program_from_str(vshader_str, fshader_str); - if (!ret->prog) { - log_error("Failed to create GLSL program."); - return -1; - } - - // Get uniform addresses - bind_uniform(ret, opacity); - bind_uniform(ret, invert_color); - bind_uniform(ret, tex); - bind_uniform(ret, dim); - bind_uniform(ret, brightness); - bind_uniform(ret, max_brightness); - bind_uniform(ret, corner_radius); - bind_uniform(ret, border_width); - - gl_check_err(); - - return true; -} - -/** - * Callback to run on root window size change. - */ -void gl_resize(struct gl_data *gd, int width, int height) { - GLint viewport_dimensions[2]; - glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions); - - gd->height = height; - gd->width = width; - - assert(viewport_dimensions[0] >= gd->width); - assert(viewport_dimensions[1] >= gd->height); - - glBindTexture(GL_TEXTURE_2D, gd->back_texture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0, GL_BGR, - GL_UNSIGNED_BYTE, NULL); - - gl_check_err(); -} - -// clang-format off -static const char dummy_frag[] = GLSL(330, - uniform sampler2D tex; - in vec2 texcoord; - void main() { - gl_FragColor = texelFetch(tex, ivec2(texcoord.xy), 0); - } -); - -static const char fill_frag[] = GLSL(330, - uniform vec4 color; - void main() { - gl_FragColor = color; - } -); - -static const char fill_vert[] = GLSL(330, - layout(location = 0) in vec2 in_coord; - uniform mat4 projection; - void main() { - gl_Position = projection * vec4(in_coord, 0, 1); - } -); - -static const char interpolating_frag[] = GLSL(330, - uniform sampler2D tex; - in vec2 texcoord; - void main() { - gl_FragColor = vec4(texture2D(tex, vec2(texcoord.xy), 0).rgb, 1); - } -); - -static const char interpolating_vert[] = GLSL(330, - uniform mat4 projection; - uniform vec2 texsize; - layout(location = 0) in vec2 in_coord; - layout(location = 1) in vec2 in_texcoord; - out vec2 texcoord; - void main() { - gl_Position = projection * vec4(in_coord, 0, 1); - texcoord = in_texcoord / texsize; - } -); -// clang-format on - -/// Fill a given region in bound framebuffer. -/// @param[in] y_inverted whether the y coordinates in `clip` should be inverted -static void _gl_fill(backend_t *base, struct color c, const region_t *clip, GLuint target, - int height, bool y_inverted) { - static const GLuint fill_vert_in_coord_loc = 0; - int nrects; - const rect_t *rect = pixman_region32_rectangles((region_t *)clip, &nrects); - auto gd = (struct gl_data *)base; - - GLuint vao; - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - - GLuint bo[2]; - glGenBuffers(2, bo); - glUseProgram(gd->fill_shader.prog); - glUniform4f(gd->fill_shader.color_loc, (GLfloat)c.red, (GLfloat)c.green, - (GLfloat)c.blue, (GLfloat)c.alpha); - glEnableVertexAttribArray(fill_vert_in_coord_loc); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - - auto coord = ccalloc(nrects * 8, GLint); - auto indices = ccalloc(nrects * 6, GLuint); - for (int i = 0; i < nrects; i++) { - GLint y1 = y_inverted ? height - rect[i].y2 : rect[i].y1, - y2 = y_inverted ? height - rect[i].y1 : rect[i].y2; - // clang-format off - memcpy(&coord[i * 8], - ((GLint[][2]){ - {rect[i].x1, y1}, {rect[i].x2, y1}, - {rect[i].x2, y2}, {rect[i].x1, y2}}), - sizeof(GLint[2]) * 4); - // clang-format on - indices[i * 6 + 0] = (GLuint)i * 4 + 0; - indices[i * 6 + 1] = (GLuint)i * 4 + 1; - indices[i * 6 + 2] = (GLuint)i * 4 + 2; - indices[i * 6 + 3] = (GLuint)i * 4 + 2; - indices[i * 6 + 4] = (GLuint)i * 4 + 3; - indices[i * 6 + 5] = (GLuint)i * 4 + 0; - } - glBufferData(GL_ARRAY_BUFFER, nrects * 8 * (long)sizeof(*coord), coord, GL_STREAM_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, nrects * 6 * (long)sizeof(*indices), - indices, GL_STREAM_DRAW); - - glVertexAttribPointer(fill_vert_in_coord_loc, 2, GL_INT, GL_FALSE, - sizeof(*coord) * 2, (void *)0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target); - glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glDisableVertexAttribArray(fill_vert_in_coord_loc); - glBindVertexArray(0); - glDeleteVertexArrays(1, &vao); - - glDeleteBuffers(2, bo); - free(indices); - free(coord); - - gl_check_err(); -} - -void gl_fill(backend_t *base, struct color c, const region_t *clip) { - auto gd = (struct gl_data *)base; - return _gl_fill(base, c, clip, gd->back_fbo, gd->height, true); -} - -static void gl_release_image_inner(backend_t *base, struct gl_texture *inner) { - auto gd = (struct gl_data *)base; - if (inner->user_data) { - gd->release_user_data(base, inner); - } - assert(inner->user_data == NULL); - - glDeleteTextures(1, &inner->texture); - glDeleteTextures(2, inner->auxiliary_texture); - free(inner); - gl_check_err(); -} - -void gl_release_image(backend_t *base, void *image_data) { - struct backend_image *wd = image_data; - auto inner = (struct gl_texture *)wd->inner; - inner->refcount--; - assert(inner->refcount >= 0); - if (inner->refcount == 0) { - gl_release_image_inner(base, inner); - } - free(wd); -} - -static inline void gl_free_blur_shader(gl_blur_shader_t *shader) { - if (shader->prog) { - glDeleteProgram(shader->prog); - } - - shader->prog = 0; -} - -void gl_destroy_blur_context(backend_t *base attr_unused, void *ctx) { - auto bctx = (struct gl_blur_context *)ctx; - // Free GLSL shaders/programs - for (int i = 0; i < bctx->npasses; ++i) { - gl_free_blur_shader(&bctx->blur_shader[i]); - } - free(bctx->blur_shader); - - if (bctx->blur_texture_count && bctx->blur_textures) { - glDeleteTextures(bctx->blur_texture_count, bctx->blur_textures); - free(bctx->blur_textures); - } - if (bctx->blur_texture_count && bctx->texture_sizes) { - free(bctx->texture_sizes); - } - if (bctx->blur_fbo_count && bctx->blur_fbos) { - glDeleteFramebuffers(bctx->blur_fbo_count, bctx->blur_fbos); - free(bctx->blur_fbos); - } - - bctx->blur_texture_count = 0; - bctx->blur_fbo_count = 0; - - free(bctx); - - gl_check_err(); -} - -/** - * Initialize GL blur filters. - */ -bool gl_create_kernel_blur_context(void *blur_context, GLfloat *projection, - enum blur_method method, void *args) { - bool success = false; - auto ctx = (struct gl_blur_context *)blur_context; - - struct conv **kernels; - - int nkernels; - ctx->method = BLUR_METHOD_KERNEL; - if (method == BLUR_METHOD_KERNEL) { - nkernels = ((struct kernel_blur_args *)args)->kernel_count; - kernels = ((struct kernel_blur_args *)args)->kernels; - } else { - kernels = generate_blur_kernel(method, args, &nkernels); - } - - if (!nkernels) { - ctx->method = BLUR_METHOD_NONE; - return true; - } - - // Specify required textures and FBOs - ctx->blur_texture_count = 2; - ctx->blur_fbo_count = 1; - - ctx->blur_shader = ccalloc(max2(2, nkernels), gl_blur_shader_t); - - char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL)); - // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane - // Thanks to hiciu for reporting. - setlocale(LC_NUMERIC, "C"); - - // clang-format off - static const char *FRAG_SHADER_BLUR = GLSL(330, - %s\n // other extension pragmas - uniform sampler2D tex_src; - uniform vec2 pixel_norm; - uniform float opacity; - in vec2 texcoord; - out vec4 out_color; - void main() { - vec2 uv = texcoord * pixel_norm; - vec4 sum = vec4(0.0, 0.0, 0.0, 0.0); - %s //body of the convolution - out_color = sum / float(%.7g) * opacity; - } - ); - static const char *FRAG_SHADER_BLUR_ADD = QUOTE( - sum += float(%.7g) * texture2D(tex_src, uv + pixel_norm * vec2(%.7g, %.7g)); - ); - // clang-format on - - const char *shader_add = FRAG_SHADER_BLUR_ADD; - char *extension = strdup(""); - - for (int i = 0; i < nkernels; i++) { - auto kern = kernels[i]; - // Build shader - int width = kern->w, height = kern->h; - int nele = width * height; - // '%.7g' is at most 14 characters, inserted 3 times - size_t body_len = (strlen(shader_add) + 42) * (uint)nele; - char *shader_body = ccalloc(body_len, char); - char *pc = shader_body; - - // Make use of the linear interpolation hardware by sampling 2 pixels with - // one texture access by sampling between both pixels based on their - // relative weight. Easiest done in a single dimension as 2D bilinear - // filtering would raise additional constraints on the kernels. Therefore - // only use interpolation along the larger dimension. - double sum = 0.0; - if (width > height) { - // use interpolation in x dimension (width) - for (int j = 0; j < height; ++j) { - for (int k = 0; k < width; k += 2) { - double val1, val2; - val1 = kern->data[j * width + k]; - val2 = (k + 1 < width) - ? kern->data[j * width + k + 1] - : 0; - - double combined_weight = val1 + val2; - if (combined_weight == 0) { - continue; - } - sum += combined_weight; - - double offset_x = - k + (val2 / combined_weight) - (width / 2); - double offset_y = j - (height / 2); - pc += snprintf( - pc, body_len - (ulong)(pc - shader_body), - shader_add, combined_weight, offset_x, offset_y); - assert(pc < shader_body + body_len); - } - } - } else { - // use interpolation in y dimension (height) - for (int j = 0; j < height; j += 2) { - for (int k = 0; k < width; ++k) { - double val1, val2; - val1 = kern->data[j * width + k]; - val2 = (j + 1 < height) - ? kern->data[(j + 1) * width + k] - : 0; - - double combined_weight = val1 + val2; - if (combined_weight == 0) { - continue; - } - sum += combined_weight; - - double offset_x = k - (width / 2); - double offset_y = - j + (val2 / combined_weight) - (height / 2); - pc += snprintf( - pc, body_len - (ulong)(pc - shader_body), - shader_add, combined_weight, offset_x, offset_y); - assert(pc < shader_body + body_len); - } - } - } - - auto pass = ctx->blur_shader + i; - size_t shader_len = strlen(FRAG_SHADER_BLUR) + strlen(extension) + - strlen(shader_body) + 10 /* sum */ + - 1 /* null terminator */; - char *shader_str = ccalloc(shader_len, char); - auto real_shader_len = snprintf(shader_str, shader_len, FRAG_SHADER_BLUR, - extension, shader_body, sum); - CHECK(real_shader_len >= 0); - CHECK((size_t)real_shader_len < shader_len); - free(shader_body); - - // Build program - pass->prog = gl_create_program_from_str(vertex_shader, shader_str); - free(shader_str); - if (!pass->prog) { - log_error("Failed to create GLSL program."); - success = false; - goto out; - } - glBindFragDataLocation(pass->prog, 0, "out_color"); - - // Get uniform addresses - bind_uniform(pass, pixel_norm); - bind_uniform(pass, opacity); - pass->texorig_loc = glGetUniformLocationChecked(pass->prog, "texorig"); - - // Setup projection matrix - glUseProgram(pass->prog); - int pml = glGetUniformLocationChecked(pass->prog, "projection"); - glUniformMatrix4fv(pml, 1, false, projection); - glUseProgram(0); - - ctx->resize_width += kern->w / 2; - ctx->resize_height += kern->h / 2; - } - - if (nkernels == 1) { - // Generate an extra null pass so we don't need special code path for - // the single pass case - auto pass = &ctx->blur_shader[1]; - pass->prog = gl_create_program_from_str(vertex_shader, dummy_frag); - pass->uniform_pixel_norm = -1; - pass->uniform_opacity = -1; - pass->texorig_loc = glGetUniformLocationChecked(pass->prog, "texorig"); - - // Setup projection matrix - glUseProgram(pass->prog); - int pml = glGetUniformLocationChecked(pass->prog, "projection"); - glUniformMatrix4fv(pml, 1, false, projection); - glUseProgram(0); - - ctx->npasses = 2; - } else { - ctx->npasses = nkernels; - } - - success = true; -out: - if (method != BLUR_METHOD_KERNEL) { - // We generated the blur kernels, so we need to free them - for (int i = 0; i < nkernels; i++) { - free(kernels[i]); - } - free(kernels); - } - - free(extension); - // Restore LC_NUMERIC - setlocale(LC_NUMERIC, lc_numeric_old); - free(lc_numeric_old); - - return success; -} - -bool gl_create_dual_kawase_blur_context(void *blur_context, GLfloat *projection, - enum blur_method method, void *args) { - bool success = false; - auto ctx = (struct gl_blur_context *)blur_context; - - ctx->method = method; - - auto blur_params = generate_dual_kawase_params(args); - - // Specify required textures and FBOs - ctx->blur_texture_count = blur_params->iterations; - ctx->blur_fbo_count = blur_params->iterations; - - ctx->resize_width += blur_params->expand; - ctx->resize_height += blur_params->expand; - - ctx->npasses = 2; - ctx->blur_shader = ccalloc(ctx->npasses, gl_blur_shader_t); - - char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL)); - // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane - // Thanks to hiciu for reporting. - setlocale(LC_NUMERIC, "C"); - - // Dual-kawase downsample shader / program - auto down_pass = ctx->blur_shader; - { - // clang-format off - static const char *FRAG_SHADER_DOWN = GLSL(330, - uniform sampler2D tex_src; - uniform float scale = 1.0; - uniform vec2 pixel_norm; - in vec2 texcoord; - out vec4 out_color; - void main() { - vec2 offset = %.7g * pixel_norm; - vec2 uv = texcoord * pixel_norm * (2.0 / scale); - vec4 sum = texture2D(tex_src, uv) * 4.0; - sum += texture2D(tex_src, uv - vec2(0.5, 0.5) * offset); - sum += texture2D(tex_src, uv + vec2(0.5, 0.5) * offset); - sum += texture2D(tex_src, uv + vec2(0.5, -0.5) * offset); - sum += texture2D(tex_src, uv - vec2(0.5, -0.5) * offset); - out_color = sum / 8.0; - } - ); - // clang-format on - - // Build shader - size_t shader_len = - strlen(FRAG_SHADER_DOWN) + 10 /* offset */ + 1 /* null terminator */; - char *shader_str = ccalloc(shader_len, char); - auto real_shader_len = - snprintf(shader_str, shader_len, FRAG_SHADER_DOWN, blur_params->offset); - CHECK(real_shader_len >= 0); - CHECK((size_t)real_shader_len < shader_len); - - // Build program - down_pass->prog = gl_create_program_from_str(vertex_shader, shader_str); - free(shader_str); - if (!down_pass->prog) { - log_error("Failed to create GLSL program."); - success = false; - goto out; - } - glBindFragDataLocation(down_pass->prog, 0, "out_color"); - - // Get uniform addresses - bind_uniform(down_pass, pixel_norm); - down_pass->texorig_loc = - glGetUniformLocationChecked(down_pass->prog, "texorig"); - down_pass->scale_loc = - glGetUniformLocationChecked(down_pass->prog, "scale"); - - // Setup projection matrix - glUseProgram(down_pass->prog); - int pml = glGetUniformLocationChecked(down_pass->prog, "projection"); - glUniformMatrix4fv(pml, 1, false, projection); - glUseProgram(0); - } - - // Dual-kawase upsample shader / program - auto up_pass = ctx->blur_shader + 1; - { - // clang-format off - static const char *FRAG_SHADER_UP = GLSL(330, - uniform sampler2D tex_src; - uniform float scale = 1.0; - uniform vec2 pixel_norm; - uniform float opacity; - in vec2 texcoord; - out vec4 out_color; - void main() { - vec2 offset = %.7g * pixel_norm; - vec2 uv = texcoord * pixel_norm / (2 * scale); - vec4 sum = texture2D(tex_src, uv + vec2(-1.0, 0.0) * offset); - sum += texture2D(tex_src, uv + vec2(-0.5, 0.5) * offset) * 2.0; - sum += texture2D(tex_src, uv + vec2(0.0, 1.0) * offset); - sum += texture2D(tex_src, uv + vec2(0.5, 0.5) * offset) * 2.0; - sum += texture2D(tex_src, uv + vec2(1.0, 0.0) * offset); - sum += texture2D(tex_src, uv + vec2(0.5, -0.5) * offset) * 2.0; - sum += texture2D(tex_src, uv + vec2(0.0, -1.0) * offset); - sum += texture2D(tex_src, uv + vec2(-0.5, -0.5) * offset) * 2.0; - out_color = sum / 12.0 * opacity; - } - ); - // clang-format on - - // Build shader - size_t shader_len = - strlen(FRAG_SHADER_UP) + 10 /* offset */ + 1 /* null terminator */; - char *shader_str = ccalloc(shader_len, char); - auto real_shader_len = - snprintf(shader_str, shader_len, FRAG_SHADER_UP, blur_params->offset); - CHECK(real_shader_len >= 0); - CHECK((size_t)real_shader_len < shader_len); - - // Build program - up_pass->prog = gl_create_program_from_str(vertex_shader, shader_str); - free(shader_str); - if (!up_pass->prog) { - log_error("Failed to create GLSL program."); - success = false; - goto out; - } - glBindFragDataLocation(up_pass->prog, 0, "out_color"); - - // Get uniform addresses - bind_uniform(up_pass, pixel_norm); - bind_uniform(up_pass, opacity); - up_pass->texorig_loc = - glGetUniformLocationChecked(up_pass->prog, "texorig"); - up_pass->scale_loc = glGetUniformLocationChecked(up_pass->prog, "scale"); - - // Setup projection matrix - glUseProgram(up_pass->prog); - int pml = glGetUniformLocationChecked(up_pass->prog, "projection"); - glUniformMatrix4fv(pml, 1, false, projection); - glUseProgram(0); - } - - success = true; -out: - free(blur_params); - - if (!success) { - ctx = NULL; - } - - // Restore LC_NUMERIC - setlocale(LC_NUMERIC, lc_numeric_old); - free(lc_numeric_old); - - return success; -} - -void *gl_create_blur_context(backend_t *base, enum blur_method method, void *args) { - bool success; - auto gd = (struct gl_data *)base; - - auto ctx = ccalloc(1, struct gl_blur_context); - - if (!method || method >= BLUR_METHOD_INVALID) { - ctx->method = BLUR_METHOD_NONE; - return ctx; - } - - // Set projection matrix to gl viewport dimensions so we can use screen - // coordinates for all vertices - // Note: OpenGL matrices are column major - GLint viewport_dimensions[2]; - glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions); - GLfloat projection_matrix[4][4] = {{2.0f / (GLfloat)viewport_dimensions[0], 0, 0, 0}, - {0, 2.0f / (GLfloat)viewport_dimensions[1], 0, 0}, - {0, 0, 0, 0}, - {-1, -1, 0, 1}}; - - if (method == BLUR_METHOD_DUAL_KAWASE) { - success = gl_create_dual_kawase_blur_context(ctx, projection_matrix[0], - method, args); - } else { - success = - gl_create_kernel_blur_context(ctx, projection_matrix[0], method, args); - } - if (!success || ctx->method == BLUR_METHOD_NONE) { - goto out; - } - - // Texture size will be defined by gl_blur - ctx->blur_textures = ccalloc(ctx->blur_texture_count, GLuint); - ctx->texture_sizes = ccalloc(ctx->blur_texture_count, struct texture_size); - glGenTextures(ctx->blur_texture_count, ctx->blur_textures); - - for (int i = 0; i < ctx->blur_texture_count; ++i) { - glBindTexture(GL_TEXTURE_2D, ctx->blur_textures[i]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - - // Generate FBO and textures when needed - ctx->blur_fbos = ccalloc(ctx->blur_fbo_count, GLuint); - glGenFramebuffers(ctx->blur_fbo_count, ctx->blur_fbos); - - for (int i = 0; i < ctx->blur_fbo_count; ++i) { - if (!ctx->blur_fbos[i]) { - log_error("Failed to generate framebuffer objects for blur"); - success = false; - goto out; - } - } - -out: - if (!success) { - gl_destroy_blur_context(&gd->base, ctx); - ctx = NULL; - } - - gl_check_err(); - return ctx; -} - -void gl_get_blur_size(void *blur_context, int *width, int *height) { - auto ctx = (struct gl_blur_context *)blur_context; - *width = ctx->resize_width; - *height = ctx->resize_height; -} - -// clang-format off -const char *win_shader_glsl = GLSL(330, - uniform float opacity; - uniform float dim; - uniform float corner_radius; - uniform float border_width; - uniform bool invert_color; - in vec2 texcoord; - uniform sampler2D tex; - uniform sampler2D brightness; - uniform float max_brightness; - // Signed distance field for rectangle center at (0, 0), with size of - // half_size * 2 - float rectangle_sdf(vec2 point, vec2 half_size) { - vec2 d = abs(point) - half_size; - return length(max(d, 0.0)); - } - - void main() { - vec4 c = texelFetch(tex, ivec2(texcoord), 0); - vec4 border_color = texture(tex, vec2(0.0, 0.5)); - if (invert_color) { - c = vec4(c.aaa - c.rgb, c.a); - border_color = vec4(border_color.aaa - border_color.rgb, border_color.a); - } - c = vec4(c.rgb * (1.0 - dim), c.a) * opacity; - border_color = vec4(border_color.rgb * (1.0 - dim), border_color.a) * opacity; - - vec3 rgb_brightness = texelFetch(brightness, ivec2(0, 0), 0).rgb; - // Ref: https://en.wikipedia.org/wiki/Relative_luminance - float brightness = rgb_brightness.r * 0.21 + - rgb_brightness.g * 0.72 + - rgb_brightness.b * 0.07; - if (brightness > max_brightness) { - c.rgb = c.rgb * (max_brightness / brightness); - border_color.rgb = border_color.rgb * (max_brightness / brightness); - } - - // Rim color is the color of the outer rim of the window, if there is no - // border, it's the color of the window itself, otherwise it's the border. - // Using mix() to avoid a branch here. - vec4 rim_color = mix(c, border_color, clamp(border_width, 0.0f, 1.0f)); - - vec2 outer_size = vec2(textureSize(tex, 0)); - vec2 inner_size = outer_size - vec2(corner_radius) * 2.0f - 1; - float rect_distance = rectangle_sdf(texcoord - outer_size / 2.0f, - inner_size / 2.0f) - corner_radius; - if (rect_distance > 0.0f) { - c = (1.0f - clamp(rect_distance, 0.0f, 1.0f)) * rim_color; - } else { - float factor = clamp(rect_distance + border_width, 0.0f, 1.0f); - c = (1.0f - factor) * c + factor * border_color; - } - - gl_FragColor = c; - } -); - -const char *present_vertex_shader = GLSL(330, - uniform mat4 projection; - layout(location = 0) in vec2 coord; - out vec2 texcoord; - void main() { - gl_Position = projection * vec4(coord, 0, 1); - texcoord = coord; - } -); -// clang-format on - -bool gl_init(struct gl_data *gd, session_t *ps) { - // Initialize GLX data structure - glDisable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); - - glEnable(GL_BLEND); - // X pixmap is in premultiplied alpha, so we might just as well use it too. - // Thanks to derhass for help. - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - - // Initialize stencil buffer - glDisable(GL_STENCIL_TEST); - glStencilMask(0x1); - glStencilFunc(GL_EQUAL, 0x1, 0x1); - - // Set gl viewport to the maximum supported size so we won't have to worry about - // it later on when the screen is resized. The corresponding projection matrix can - // be set now and won't have to be updated. Since fragments outside the target - // buffer are skipped anyways, this should have no impact on performance. - GLint viewport_dimensions[2]; - glGetIntegerv(GL_MAX_VIEWPORT_DIMS, viewport_dimensions); - glViewport(0, 0, viewport_dimensions[0], viewport_dimensions[1]); - - // Clear screen - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - - glGenFramebuffers(1, &gd->back_fbo); - glGenTextures(1, &gd->back_texture); - if (!gd->back_fbo || !gd->back_texture) { - log_error("Failed to generate a framebuffer object"); - return false; - } - - glBindTexture(GL_TEXTURE_2D, gd->back_texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindTexture(GL_TEXTURE_2D, 0); - - // Set projection matrix to gl viewport dimensions so we can use screen - // coordinates for all vertices - // Note: OpenGL matrices are column major - GLfloat projection_matrix[4][4] = {{2.0f / (GLfloat)viewport_dimensions[0], 0, 0, 0}, - {0, 2.0f / (GLfloat)viewport_dimensions[1], 0, 0}, - {0, 0, 0, 0}, - {-1, -1, 0, 1}}; - - // Initialize shaders - gl_win_shader_from_string(vertex_shader, win_shader_glsl, &gd->win_shader); - int pml = glGetUniformLocationChecked(gd->win_shader.prog, "projection"); - glUseProgram(gd->win_shader.prog); - glUniformMatrix4fv(pml, 1, false, projection_matrix[0]); - glUseProgram(0); - - gd->fill_shader.prog = gl_create_program_from_str(fill_vert, fill_frag); - gd->fill_shader.color_loc = glGetUniformLocation(gd->fill_shader.prog, "color"); - pml = glGetUniformLocationChecked(gd->fill_shader.prog, "projection"); - glUseProgram(gd->fill_shader.prog); - glUniformMatrix4fv(pml, 1, false, projection_matrix[0]); - glUseProgram(0); - - gd->present_prog = gl_create_program_from_str(present_vertex_shader, dummy_frag); - if (!gd->present_prog) { - log_error("Failed to create the present shader"); - return false; - } - pml = glGetUniformLocationChecked(gd->present_prog, "projection"); - glUseProgram(gd->present_prog); - glUniform1i(glGetUniformLocationChecked(gd->present_prog, "tex"), 0); - glUniformMatrix4fv(pml, 1, false, projection_matrix[0]); - glUseProgram(0); - - gd->brightness_shader.prog = - gl_create_program_from_str(interpolating_vert, interpolating_frag); - if (!gd->brightness_shader.prog) { - log_error("Failed to create the brightness shader"); - return false; - } - pml = glGetUniformLocationChecked(gd->brightness_shader.prog, "projection"); - glUseProgram(gd->brightness_shader.prog); - glUniform1i(glGetUniformLocationChecked(gd->brightness_shader.prog, "tex"), 0); - glUniformMatrix4fv(pml, 1, false, projection_matrix[0]); - glUseProgram(0); - - // Set up the size of the back texture - gl_resize(gd, ps->root_width, ps->root_height); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, gd->back_fbo); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, - gd->back_texture, 0); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - if (!gl_check_fb_complete(GL_FRAMEBUFFER)) { - return false; - } - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - gd->logger = gl_string_marker_logger_new(); - if (gd->logger) { - log_add_target_tls(gd->logger); - } - - const char *vendor = (const char *)glGetString(GL_VENDOR); - log_debug("GL_VENDOR = %s", vendor); - if (strcmp(vendor, "NVIDIA Corporation") == 0) { - log_info("GL vendor is NVIDIA, don't use glFinish"); - gd->is_nvidia = true; - } else { - gd->is_nvidia = false; - } - gd->has_robustness = gl_has_extension("GL_ARB_robustness"); - - return true; -} - -void gl_deinit(struct gl_data *gd) { - gl_free_prog_main(&gd->win_shader); - - if (gd->logger) { - log_remove_target_tls(gd->logger); - gd->logger = NULL; - } - - gl_check_err(); -} - -GLuint gl_new_texture(GLenum target) { - GLuint texture; - glGenTextures(1, &texture); - if (!texture) { - log_error("Failed to generate texture"); - return 0; - } - - glBindTexture(target, texture); - glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT); - glBindTexture(target, 0); - - return texture; -} - -/// Actually duplicate a texture into a new one, if this texture is shared -static inline void gl_image_decouple(backend_t *base, struct backend_image *img) { - if (img->inner->refcount == 1) { - return; - } - auto gd = (struct gl_data *)base; - auto inner = (struct gl_texture *)img->inner; - auto new_tex = ccalloc(1, struct gl_texture); - - new_tex->texture = gl_new_texture(GL_TEXTURE_2D); - new_tex->y_inverted = true; - new_tex->height = inner->height; - new_tex->width = inner->width; - new_tex->refcount = 1; - new_tex->user_data = gd->decouple_texture_user_data(base, inner->user_data); - - glBindTexture(GL_TEXTURE_2D, new_tex->texture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, new_tex->width, new_tex->height, 0, - GL_BGRA, GL_UNSIGNED_BYTE, NULL); - glBindTexture(GL_TEXTURE_2D, 0); - - assert(gd->present_prog); - glUseProgram(gd->present_prog); - glBindTexture(GL_TEXTURE_2D, inner->texture); - - GLuint fbo; - glGenFramebuffers(1, &fbo); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, - new_tex->texture, 0); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - gl_check_fb_complete(GL_DRAW_FRAMEBUFFER); - - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - - // clang-format off - GLint coord[] = { - // top left - 0, 0, // vertex coord - 0, 0, // texture coord - - // top right - new_tex->width, 0, // vertex coord - new_tex->width, 0, // texture coord - - // bottom right - new_tex->width, new_tex->height, - new_tex->width, new_tex->height, - - // bottom left - 0, new_tex->height, - 0, new_tex->height, - }; - // clang-format on - GLuint indices[] = {0, 1, 2, 2, 3, 0}; - - GLuint vao; - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - - GLuint bo[2]; - glGenBuffers(2, bo); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(*coord) * 16, coord, GL_STATIC_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(*indices) * 6, indices, - GL_STATIC_DRAW); - - glEnableVertexAttribArray(vert_coord_loc); - glEnableVertexAttribArray(vert_in_texcoord_loc); - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 4, NULL); - glVertexAttribPointer(vert_in_texcoord_loc, 2, GL_INT, GL_FALSE, - sizeof(GLint) * 4, (void *)(sizeof(GLint) * 2)); - - glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); - - glDisableVertexAttribArray(vert_coord_loc); - glDisableVertexAttribArray(vert_in_texcoord_loc); - glBindVertexArray(0); - glDeleteVertexArrays(1, &vao); - - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glDeleteBuffers(2, bo); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &fbo); - - glBindTexture(GL_TEXTURE_2D, 0); - glUseProgram(0); - - gl_check_err(); - - img->inner = (struct backend_image_inner_base *)new_tex; - inner->refcount--; -} - -static void gl_image_apply_alpha(backend_t *base, struct backend_image *img, - const region_t *reg_op, double alpha) { - // Result color = 0 (GL_ZERO) + alpha (GL_CONSTANT_ALPHA) * original color - auto inner = (struct gl_texture *)img->inner; - glBlendFunc(GL_ZERO, GL_CONSTANT_ALPHA); - glBlendColor(0, 0, 0, (GLclampf)alpha); - GLuint fbo; - glGenFramebuffers(1, &fbo); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, - inner->texture, 0); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - _gl_fill(base, (struct color){0, 0, 0, 0}, reg_op, fbo, 0, false); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &fbo); -} - -void gl_present(backend_t *base, const region_t *region) { - auto gd = (struct gl_data *)base; - - int nrects; - const rect_t *rect = pixman_region32_rectangles((region_t *)region, &nrects); - auto coord = ccalloc(nrects * 8, GLint); - auto indices = ccalloc(nrects * 6, GLuint); - for (int i = 0; i < nrects; i++) { - // clang-format off - memcpy(&coord[i * 8], - ((GLint[]){rect[i].x1, gd->height - rect[i].y2, - rect[i].x2, gd->height - rect[i].y2, - rect[i].x2, gd->height - rect[i].y1, - rect[i].x1, gd->height - rect[i].y1}), - sizeof(GLint) * 8); - // clang-format on - - GLuint u = (GLuint)(i * 4); - memcpy(&indices[i * 6], - ((GLuint[]){u + 0, u + 1, u + 2, u + 2, u + 3, u + 0}), - sizeof(GLuint) * 6); - } - - glUseProgram(gd->present_prog); - glBindTexture(GL_TEXTURE_2D, gd->back_texture); - - GLuint vao; - glGenVertexArrays(1, &vao); - glBindVertexArray(vao); - - GLuint bo[2]; - glGenBuffers(2, bo); - glEnableVertexAttribArray(vert_coord_loc); - glBindBuffer(GL_ARRAY_BUFFER, bo[0]); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bo[1]); - glBufferData(GL_ARRAY_BUFFER, (long)sizeof(GLint) * nrects * 8, coord, GL_STREAM_DRAW); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (long)sizeof(GLuint) * nrects * 6, indices, - GL_STREAM_DRAW); - - glVertexAttribPointer(vert_coord_loc, 2, GL_INT, GL_FALSE, sizeof(GLint) * 2, NULL); - glDrawElements(GL_TRIANGLES, nrects * 6, GL_UNSIGNED_INT, NULL); - - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindVertexArray(0); - glDeleteBuffers(2, bo); - glDeleteVertexArrays(1, &vao); - - free(coord); - free(indices); -} - -bool gl_image_op(backend_t *base, enum image_operations op, void *image_data, - const region_t *reg_op, const region_t *reg_visible attr_unused, void *arg) { - struct backend_image *tex = image_data; - switch (op) { - case IMAGE_OP_APPLY_ALPHA: - gl_image_decouple(base, tex); - assert(tex->inner->refcount == 1); - gl_image_apply_alpha(base, tex, reg_op, *(double *)arg); - break; - } - - return true; -} - -enum device_status gl_device_status(backend_t *base) { - auto gd = (struct gl_data *)base; - if (!gd->has_robustness) { - return DEVICE_STATUS_NORMAL; - } - if (glGetGraphicsResetStatusARB() == GL_NO_ERROR) { - return DEVICE_STATUS_NORMAL; - } else { - return DEVICE_STATUS_RESETTING; - } -} diff --git a/dwm/picom/src/backend/gl/gl_common.h b/dwm/picom/src/backend/gl/gl_common.h deleted file mode 100644 index 8bbbabb..0000000 --- a/dwm/picom/src/backend/gl/gl_common.h +++ /dev/null @@ -1,238 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once -#include -#include -#include -#include - -#include "backend/backend.h" -#include "log.h" -#include "region.h" - -#define CASESTRRET(s) \ - case s: return #s - -static inline GLint glGetUniformLocationChecked(GLuint p, const char *name) { - auto ret = glGetUniformLocation(p, name); - if (ret < 0) { - log_info("Failed to get location of uniform '%s'. This is normal when " - "using custom shaders.", - name); - } - return ret; -} - -#define bind_uniform(shader, uniform) \ - (shader)->uniform_##uniform = glGetUniformLocationChecked((shader)->prog, #uniform) - -// Program and uniforms for window shader -typedef struct { - GLuint prog; - GLint uniform_opacity; - GLint uniform_invert_color; - GLint uniform_tex; - GLint uniform_dim; - GLint uniform_brightness; - GLint uniform_max_brightness; - GLint uniform_corner_radius; - GLint uniform_border_width; -} gl_win_shader_t; - -// Program and uniforms for brightness shader -typedef struct { - GLuint prog; -} gl_brightness_shader_t; - -// Program and uniforms for blur shader -typedef struct { - GLuint prog; - GLint uniform_pixel_norm; - GLint uniform_opacity; - GLint texorig_loc; - GLint scale_loc; -} gl_blur_shader_t; - -typedef struct { - GLuint prog; - GLint color_loc; -} gl_fill_shader_t; - -/// @brief Wrapper of a binded GLX texture. -struct gl_texture { - int refcount; - bool has_alpha; - GLuint texture; - int width, height; - bool y_inverted; - - // Textures for auxiliary uses. - GLuint auxiliary_texture[2]; - void *user_data; -}; - -struct gl_data { - backend_t base; - // If we are using proprietary NVIDIA driver - bool is_nvidia; - // If ARB_robustness extension is present - bool has_robustness; - // Height and width of the root window - int height, width; - gl_win_shader_t win_shader; - gl_brightness_shader_t brightness_shader; - gl_fill_shader_t fill_shader; - GLuint back_texture, back_fbo; - GLuint present_prog; - - /// Called when an gl_texture is decoupled from the texture it refers. Returns - /// the decoupled user_data - void *(*decouple_texture_user_data)(backend_t *base, void *user_data); - - /// Release the user data attached to a gl_texture - void (*release_user_data)(backend_t *base, struct gl_texture *); - - struct log_target *logger; -}; - -typedef struct session session_t; - -#define GL_PROG_MAIN_INIT \ - { .prog = 0, .unifm_opacity = -1, .unifm_invert_color = -1, .unifm_tex = -1, } - -GLuint gl_create_shader(GLenum shader_type, const char *shader_str); -GLuint gl_create_program(const GLuint *const shaders, int nshaders); -GLuint gl_create_program_from_str(const char *vert_shader_str, const char *frag_shader_str); - -/** - * @brief Render a region with texture data. - */ -void gl_compose(backend_t *, void *ptex, - int dst_x1, int dst_y1, int dst_x2, int dst_y2, - const region_t *reg_tgt, const region_t *reg_visible); - -void gl_resize(struct gl_data *, int width, int height); - -bool gl_init(struct gl_data *gd, session_t *); -void gl_deinit(struct gl_data *gd); - -GLuint gl_new_texture(GLenum target); - -bool gl_image_op(backend_t *base, enum image_operations op, void *image_data, - const region_t *reg_op, const region_t *reg_visible, void *arg); - -void gl_release_image(backend_t *base, void *image_data); - -void *gl_clone(backend_t *base, const void *image_data, const region_t *reg_visible); - -bool gl_blur(backend_t *base, double opacity, void *, const region_t *reg_blur, - const region_t *reg_visible); -void *gl_create_blur_context(backend_t *base, enum blur_method, void *args); -void gl_destroy_blur_context(backend_t *base, void *ctx); -void gl_get_blur_size(void *blur_context, int *width, int *height); - -void gl_fill(backend_t *base, struct color, const region_t *clip); - -void gl_present(backend_t *base, const region_t *); -bool gl_read_pixel(backend_t *base, void *image_data, int x, int y, struct color *output); -enum device_status gl_device_status(backend_t *base); - -static inline void gl_delete_texture(GLuint texture) { - glDeleteTextures(1, &texture); -} - -/** - * Get a textual representation of an OpenGL error. - */ -static inline const char *gl_get_err_str(GLenum err) { - switch (err) { - CASESTRRET(GL_NO_ERROR); - CASESTRRET(GL_INVALID_ENUM); - CASESTRRET(GL_INVALID_VALUE); - CASESTRRET(GL_INVALID_OPERATION); - CASESTRRET(GL_INVALID_FRAMEBUFFER_OPERATION); - CASESTRRET(GL_OUT_OF_MEMORY); - CASESTRRET(GL_STACK_UNDERFLOW); - CASESTRRET(GL_STACK_OVERFLOW); - CASESTRRET(GL_FRAMEBUFFER_UNDEFINED); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER); - CASESTRRET(GL_FRAMEBUFFER_UNSUPPORTED); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE); - CASESTRRET(GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS); - } - return NULL; -} - -/** - * Check for GLX error. - * - * http://blog.nobel-joergensen.com/2013/01/29/debugging-opengl-using-glgeterror/ - */ -static inline void gl_check_err_(const char *func, int line) { - GLenum err = GL_NO_ERROR; - - while (GL_NO_ERROR != (err = glGetError())) { - const char *errtext = gl_get_err_str(err); - if (errtext) { - log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "GLX error at line %d: %s", line, errtext); - } else { - log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "GLX error at line %d: %d", line, err); - } - } -} - -static inline void gl_clear_err(void) { - while (glGetError() != GL_NO_ERROR) - ; -} - -#define gl_check_err() gl_check_err_(__func__, __LINE__) - -/** - * Check for GL framebuffer completeness. - */ -static inline bool gl_check_fb_complete_(const char *func, int line, GLenum fb) { - GLenum status = glCheckFramebufferStatus(fb); - - if (status == GL_FRAMEBUFFER_COMPLETE) { - return true; - } - - const char *stattext = gl_get_err_str(status); - if (stattext) { - log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "Framebuffer attachment failed at line %d: %s", line, stattext); - } else { - log_printf(tls_logger, LOG_LEVEL_ERROR, func, - "Framebuffer attachment failed at line %d: %d", line, status); - } - - return false; -} - -#define gl_check_fb_complete(fb) gl_check_fb_complete_(__func__, __LINE__, (fb)) - -/** - * Check if a GLX extension exists. - */ -static inline bool gl_has_extension(const char *ext) { - int nexts = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &nexts); - for (int i = 0; i < nexts || !nexts; i++) { - const char *exti = (const char *)glGetStringi(GL_EXTENSIONS, (GLuint)i); - if (exti == NULL) { - break; - } - if (strcmp(ext, exti) == 0) { - return true; - } - } - gl_clear_err(); - log_info("Missing GL extension %s.", ext); - return false; -} diff --git a/dwm/picom/src/backend/gl/glx.c b/dwm/picom/src/backend/gl/glx.c deleted file mode 100644 index 3af7c1b..0000000 --- a/dwm/picom/src/backend/gl/glx.c +++ /dev/null @@ -1,654 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * Copyright (c) 2019 Yuxuan Shui - * See LICENSE-mit for more information. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "backend/gl/gl_common.h" -#include "backend/gl/glx.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "log.h" -#include "picom.h" -#include "region.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -struct _glx_pixmap { - GLXPixmap glpixmap; - xcb_pixmap_t pixmap; - bool owned; -}; - -struct _glx_data { - struct gl_data gl; - Display *display; - int screen; - xcb_window_t target_win; - GLXContext ctx; -}; - -#define glXGetFBConfigAttribChecked(a, b, attr, c) \ - do { \ - if (glXGetFBConfigAttrib(a, b, attr, c)) { \ - log_info("Cannot get FBConfig attribute " #attr); \ - continue; \ - } \ - } while (0) - -struct glx_fbconfig_info *glx_find_fbconfig(Display *dpy, int screen, struct xvisual_info m) { - log_debug("Looking for FBConfig for RGBA%d%d%d%d, depth %d", m.red_size, - m.blue_size, m.green_size, m.alpha_size, m.visual_depth); - - int ncfg; - // clang-format off - GLXFBConfig *cfg = - glXChooseFBConfig(dpy, screen, (int[]){ - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT, - GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR, - GLX_X_RENDERABLE, true, - GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, (GLint)GLX_DONT_CARE, - GLX_BUFFER_SIZE, m.red_size + m.green_size + - m.blue_size + m.alpha_size, - GLX_RED_SIZE, m.red_size, - GLX_BLUE_SIZE, m.blue_size, - GLX_GREEN_SIZE, m.green_size, - GLX_ALPHA_SIZE, m.alpha_size, - GLX_STENCIL_SIZE, 0, - GLX_DEPTH_SIZE, 0, - 0 - }, &ncfg); - // clang-format on - - int texture_tgts, y_inverted, texture_fmt; - bool found = false; - int min_cost = INT_MAX; - GLXFBConfig ret; - for (int i = 0; i < ncfg; i++) { - int depthbuf, stencil, doublebuf, bufsize; - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BUFFER_SIZE, &bufsize); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_DEPTH_SIZE, &depthbuf); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_STENCIL_SIZE, &stencil); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_DOUBLEBUFFER, &doublebuf); - if (depthbuf + stencil + bufsize * (doublebuf + 1) >= min_cost) { - continue; - } - int red, green, blue; - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_RED_SIZE, &red); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BLUE_SIZE, &blue); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_GREEN_SIZE, &green); - if (red != m.red_size || green != m.green_size || blue != m.blue_size) { - // Color size doesn't match, this cannot work - continue; - } - - int rgb, rgba; - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGB_EXT, &rgb); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_RGBA_EXT, &rgba); - if (!rgb && !rgba) { - log_info("FBConfig is neither RGBA nor RGB, we cannot " - "handle this setup."); - continue; - } - - int visual; - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_VISUAL_ID, &visual); - if (m.visual_depth != -1 && - x_get_visual_depth(XGetXCBConnection(dpy), (xcb_visualid_t)visual) != - m.visual_depth) { - // FBConfig and the correspondent X Visual might not have the same - // depth. (e.g. 32 bit FBConfig with a 24 bit Visual). This is - // quite common, seen in both open source and proprietary drivers. - // - // If the FBConfig has a matching depth but its visual doesn't, we - // still cannot use it. - continue; - } - - // All check passed, we are using this one. - found = true; - ret = cfg[i]; - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_BIND_TO_TEXTURE_TARGETS_EXT, - &texture_tgts); - glXGetFBConfigAttribChecked(dpy, cfg[i], GLX_Y_INVERTED_EXT, &y_inverted); - - // Prefer the texture format with matching alpha, with the other one as - // fallback - if (m.alpha_size) { - texture_fmt = rgba ? GLX_TEXTURE_FORMAT_RGBA_EXT - : GLX_TEXTURE_FORMAT_RGB_EXT; - } else { - texture_fmt = - rgb ? GLX_TEXTURE_FORMAT_RGB_EXT : GLX_TEXTURE_FORMAT_RGBA_EXT; - } - min_cost = depthbuf + stencil + bufsize * (doublebuf + 1); - } - free(cfg); - if (!found) { - return NULL; - } - - auto info = cmalloc(struct glx_fbconfig_info); - info->cfg = ret; - info->texture_tgts = texture_tgts; - info->texture_fmt = texture_fmt; - info->y_inverted = y_inverted; - return info; -} - -/** - * Free a glx_texture_t. - */ -static void glx_release_image(backend_t *base, struct gl_texture *tex) { - struct _glx_data *gd = (void *)base; - - struct _glx_pixmap *p = tex->user_data; - // Release binding - if (p->glpixmap && tex->texture) { - glBindTexture(GL_TEXTURE_2D, tex->texture); - glXReleaseTexImageEXT(gd->display, p->glpixmap, GLX_FRONT_LEFT_EXT); - glBindTexture(GL_TEXTURE_2D, 0); - } - - // Free GLX Pixmap - if (p->glpixmap) { - glXDestroyPixmap(gd->display, p->glpixmap); - p->glpixmap = 0; - } - - if (p->owned) { - xcb_free_pixmap(base->c, p->pixmap); - p->pixmap = XCB_NONE; - } - - free(p); - tex->user_data = NULL; -} - -/** - * Destroy GLX related resources. - */ -void glx_deinit(backend_t *base) { - struct _glx_data *gd = (void *)base; - - gl_deinit(&gd->gl); - - // Destroy GLX context - if (gd->ctx) { - glXMakeCurrent(gd->display, None, NULL); - glXDestroyContext(gd->display, gd->ctx); - gd->ctx = 0; - } - - free(gd); -} - -static void *glx_decouple_user_data(backend_t *base attr_unused, void *ud attr_unused) { - auto ret = cmalloc(struct _glx_pixmap); - ret->owned = false; - ret->glpixmap = 0; - ret->pixmap = 0; - return ret; -} - -static bool glx_set_swap_interval(int interval, Display *dpy, GLXDrawable drawable) { - bool vsync_enabled = false; - if (glxext.has_GLX_MESA_swap_control) { - vsync_enabled = (glXSwapIntervalMESA((uint)interval) == 0); - } - if (!vsync_enabled && glxext.has_GLX_SGI_swap_control) { - vsync_enabled = (glXSwapIntervalSGI(interval) == 0); - } - if (!vsync_enabled && glxext.has_GLX_EXT_swap_control) { - // glXSwapIntervalEXT doesn't return if it's successful - glXSwapIntervalEXT(dpy, drawable, interval); - vsync_enabled = true; - } - return vsync_enabled; -} - -/** - * Initialize OpenGL. - */ -static backend_t *glx_init(session_t *ps) { - bool success = false; - glxext_init(ps->dpy, ps->scr); - auto gd = ccalloc(1, struct _glx_data); - init_backend_base(&gd->gl.base, ps); - - gd->display = ps->dpy; - gd->screen = ps->scr; - gd->target_win = session_get_target_window(ps); - - XVisualInfo *pvis = NULL; - - // Check for GLX extension - if (!ps->glx_exists) { - log_error("No GLX extension."); - goto end; - } - - // Get XVisualInfo - int nitems = 0; - XVisualInfo vreq = {.visualid = ps->vis}; - pvis = XGetVisualInfo(ps->dpy, VisualIDMask, &vreq, &nitems); - if (!pvis) { - log_error("Failed to acquire XVisualInfo for current visual."); - goto end; - } - - // Ensure the visual is double-buffered - int value = 0; - if (glXGetConfig(ps->dpy, pvis, GLX_USE_GL, &value) || !value) { - log_error("Root visual is not a GL visual."); - goto end; - } - - if (glXGetConfig(ps->dpy, pvis, GLX_STENCIL_SIZE, &value) || !value) { - log_error("Root visual lacks stencil buffer."); - goto end; - } - - if (glXGetConfig(ps->dpy, pvis, GLX_DOUBLEBUFFER, &value) || !value) { - log_error("Root visual is not a double buffered GL visual."); - goto end; - } - - if (glXGetConfig(ps->dpy, pvis, GLX_RGBA, &value) || !value) { - log_error("Root visual is a color index visual, not supported"); - goto end; - } - - if (!glxext.has_GLX_EXT_texture_from_pixmap) { - log_error("GLX_EXT_texture_from_pixmap is not supported by your driver"); - goto end; - } - - if (!glxext.has_GLX_ARB_create_context) { - log_error("GLX_ARB_create_context is not supported by your driver"); - goto end; - } - - // Find a fbconfig with visualid matching the one from the target win, so we can - // be sure that the fbconfig is compatible with our target window. - int ncfgs; - GLXFBConfig *cfg = glXGetFBConfigs(gd->display, gd->screen, &ncfgs); - bool found = false; - for (int i = 0; i < ncfgs; i++) { - int visualid; - glXGetFBConfigAttribChecked(gd->display, cfg[i], GLX_VISUAL_ID, &visualid); - if ((VisualID)visualid != pvis->visualid) { - continue; - } - - int *attributes = (int[]){GLX_CONTEXT_MAJOR_VERSION_ARB, - 3, - GLX_CONTEXT_MINOR_VERSION_ARB, - 3, - GLX_CONTEXT_PROFILE_MASK_ARB, - GLX_CONTEXT_CORE_PROFILE_BIT_ARB, - 0, - 0, - 0}; - if (glxext.has_GLX_ARB_create_context_robustness) { - attributes[6] = GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB; - attributes[7] = GLX_LOSE_CONTEXT_ON_RESET_ARB; - } - - gd->ctx = glXCreateContextAttribsARB(ps->dpy, cfg[i], 0, true, attributes); - free(cfg); - - if (!gd->ctx) { - log_error("Failed to get GLX context."); - goto end; - } - found = true; - break; - } - - if (!found) { - log_error("Couldn't find a suitable fbconfig for the target window"); - goto end; - } - - // Attach GLX context - GLXDrawable tgt = gd->target_win; - if (!glXMakeCurrent(ps->dpy, tgt, gd->ctx)) { - log_error("Failed to attach GLX context."); - goto end; - } - - if (!gl_init(&gd->gl, ps)) { - log_error("Failed to setup OpenGL"); - goto end; - } - - gd->gl.decouple_texture_user_data = glx_decouple_user_data; - gd->gl.release_user_data = glx_release_image; - - if (ps->o.vsync) { - if (!glx_set_swap_interval(1, ps->dpy, tgt)) { - log_error("Failed to enable vsync."); - } - } else { - glx_set_swap_interval(0, ps->dpy, tgt); - } - - success = true; - -end: - if (pvis) { - XFree(pvis); - } - - if (!success) { - glx_deinit(&gd->gl.base); - return NULL; - } - - return &gd->gl.base; -} - -static void * -glx_bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, bool owned) { - struct _glx_data *gd = (void *)base; - struct _glx_pixmap *glxpixmap = NULL; - // Retrieve pixmap parameters, if they aren't provided - if (fmt.visual_depth > OPENGL_MAX_DEPTH) { - log_error("Requested depth %d higher than max possible depth %d.", - fmt.visual_depth, OPENGL_MAX_DEPTH); - return false; - } - - if (fmt.visual_depth < 0) { - log_error("Pixmap %#010x with invalid depth %d", pixmap, fmt.visual_depth); - return false; - } - - auto r = xcb_get_geometry_reply(base->c, xcb_get_geometry(base->c, pixmap), NULL); - if (!r) { - log_error("Invalid pixmap %#010x", pixmap); - return NULL; - } - - log_trace("Binding pixmap %#010x", pixmap); - auto wd = ccalloc(1, struct backend_image); - wd->max_brightness = 1; - auto inner = ccalloc(1, struct gl_texture); - inner->width = wd->ewidth = r->width; - inner->height = wd->eheight = r->height; - wd->inner = (struct backend_image_inner_base *)inner; - free(r); - - auto fbcfg = glx_find_fbconfig(gd->display, gd->screen, fmt); - if (!fbcfg) { - log_error("Couldn't find FBConfig with requested visual %x", fmt.visual); - goto err; - } - - // Choose a suitable texture target for our pixmap. - // Refer to GLX_EXT_texture_om_pixmap spec to see what are the mean - // of the bits in texture_tgts - if (!(fbcfg->texture_tgts & GLX_TEXTURE_2D_BIT_EXT)) { - log_error("Cannot bind pixmap to GL_TEXTURE_2D, giving up"); - goto err; - } - - log_debug("depth %d, rgba %d", fmt.visual_depth, - (fbcfg->texture_fmt == GLX_TEXTURE_FORMAT_RGBA_EXT)); - - GLint attrs[] = { - GLX_TEXTURE_FORMAT_EXT, - fbcfg->texture_fmt, - GLX_TEXTURE_TARGET_EXT, - GLX_TEXTURE_2D_EXT, - 0, - }; - - inner->y_inverted = fbcfg->y_inverted; - - glxpixmap = cmalloc(struct _glx_pixmap); - glxpixmap->pixmap = pixmap; - glxpixmap->glpixmap = glXCreatePixmap(gd->display, fbcfg->cfg, pixmap, attrs); - glxpixmap->owned = owned; - free(fbcfg); - - if (!glxpixmap->glpixmap) { - log_error("Failed to create glpixmap for pixmap %#010x", pixmap); - goto err; - } - - log_trace("GLXPixmap %#010lx", glxpixmap->glpixmap); - - // Create texture - inner->user_data = glxpixmap; - inner->texture = gl_new_texture(GL_TEXTURE_2D); - inner->has_alpha = fmt.alpha_size != 0; - wd->opacity = 1; - wd->color_inverted = false; - wd->dim = 0; - wd->inner->refcount = 1; - glBindTexture(GL_TEXTURE_2D, inner->texture); - glXBindTexImageEXT(gd->display, glxpixmap->glpixmap, GLX_FRONT_LEFT_EXT, NULL); - glBindTexture(GL_TEXTURE_2D, 0); - - gl_check_err(); - return wd; -err: - if (glxpixmap && glxpixmap->glpixmap) { - glXDestroyPixmap(gd->display, glxpixmap->glpixmap); - } - free(glxpixmap); - - if (owned) { - xcb_free_pixmap(base->c, pixmap); - } - free(wd); - return NULL; -} - -static void glx_present(backend_t *base, const region_t *region attr_unused) { - struct _glx_data *gd = (void *)base; - gl_present(base, region); - glXSwapBuffers(gd->display, gd->target_win); - if (!gd->gl.is_nvidia) { - glFinish(); - } -} - -static int glx_buffer_age(backend_t *base) { - if (!glxext.has_GLX_EXT_buffer_age) { - return -1; - } - - struct _glx_data *gd = (void *)base; - unsigned int val; - glXQueryDrawable(gd->display, gd->target_win, GLX_BACK_BUFFER_AGE_EXT, &val); - return (int)val ?: -1; -} - -static void glx_diagnostics(backend_t *base) { - struct _glx_data *gd = (void *)base; - bool warn_software_rendering = false; - const char *software_renderer_names[] = {"llvmpipe", "SWR", "softpipe"}; - auto glx_vendor = glXGetClientString(gd->display, GLX_VENDOR); - printf("* Driver vendors:\n"); - printf(" * GLX: %s\n", glx_vendor); - printf(" * GL: %s\n", glGetString(GL_VENDOR)); - - auto gl_renderer = (const char *)glGetString(GL_RENDERER); - printf("* GL renderer: %s\n", gl_renderer); - if (strcmp(glx_vendor, "Mesa Project and SGI")) { - for (size_t i = 0; i < ARR_SIZE(software_renderer_names); i++) { - if (strstr(gl_renderer, software_renderer_names[i]) != NULL) { - warn_software_rendering = true; - break; - } - } - } - -#ifdef GLX_MESA_query_renderer - if (glxext.has_GLX_MESA_query_renderer) { - unsigned int accelerated = 0; - glXQueryCurrentRendererIntegerMESA(GLX_RENDERER_ACCELERATED_MESA, &accelerated); - printf("* Accelerated: %d\n", accelerated); - - // Trust GLX_MESA_query_renderer when it's available - warn_software_rendering = (accelerated == 0); - } -#endif - - if (warn_software_rendering) { - printf("\n(You are using a software renderer. Unless you are doing this\n" - "intentionally, this means you don't have a graphics driver\n" - "properly installed. Performance will suffer. Please fix this\n" - "before reporting your issue.)\n"); - } -} - -struct backend_operations glx_ops = { - .init = glx_init, - .deinit = glx_deinit, - .bind_pixmap = glx_bind_pixmap, - .release_image = gl_release_image, - .compose = gl_compose, - .image_op = gl_image_op, - .set_image_property = default_set_image_property, - .clone_image = default_clone_image, - .blur = gl_blur, - .is_image_transparent = default_is_image_transparent, - .present = glx_present, - .buffer_age = glx_buffer_age, - .render_shadow = default_backend_render_shadow, - .fill = gl_fill, - .create_blur_context = gl_create_blur_context, - .destroy_blur_context = gl_destroy_blur_context, - .get_blur_size = gl_get_blur_size, - .diagnostics = glx_diagnostics, - .device_status = gl_device_status, - .max_buffer_age = 5, // Why? -}; - -/** - * Check if a GLX extension exists. - */ -static inline bool glx_has_extension(Display *dpy, int screen, const char *ext) { - const char *glx_exts = glXQueryExtensionsString(dpy, screen); - if (!glx_exts) { - log_error("Failed get GLX extension list."); - return false; - } - - auto inlen = strlen(ext); - const char *curr = glx_exts; - bool match = false; - while (curr && !match) { - const char *end = strchr(curr, ' '); - if (!end) { - // Last extension string - match = strcmp(ext, curr) == 0; - } else if (curr + inlen == end) { - // Length match, do match string - match = strncmp(ext, curr, (unsigned long)(end - curr)) == 0; - } - curr = end ? end + 1 : NULL; - } - - if (!match) { - log_info("Missing GLX extension %s.", ext); - } else { - log_info("Found GLX extension %s.", ext); - } - - return match; -} - -struct glxext_info glxext = {0}; -PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI; -PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI; -PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML; -PFNGLXWAITFORMSCOMLPROC glXWaitForMscOML; -PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT; -PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; -PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA; -PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT; -PFNGLXRELEASETEXIMAGEEXTPROC glXReleaseTexImageEXT; -PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB; - -#ifdef GLX_MESA_query_renderer -PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA; -#endif - -void glxext_init(Display *dpy, int screen) { - if (glxext.initialized) { - return; - } - glxext.initialized = true; -#define check_ext(name) glxext.has_##name = glx_has_extension(dpy, screen, #name) - check_ext(GLX_SGI_video_sync); - check_ext(GLX_SGI_swap_control); - check_ext(GLX_OML_sync_control); - check_ext(GLX_MESA_swap_control); - check_ext(GLX_EXT_swap_control); - check_ext(GLX_EXT_texture_from_pixmap); - check_ext(GLX_ARB_create_context); - check_ext(GLX_EXT_buffer_age); - check_ext(GLX_ARB_create_context_robustness); -#ifdef GLX_MESA_query_renderer - check_ext(GLX_MESA_query_renderer); -#endif -#undef check_ext - -#define lookup(name) (name = (__typeof__(name))glXGetProcAddress((GLubyte *)#name)) - // Checking if the returned function pointer is NULL is not really necessary, - // or maybe not even useful, since glXGetProcAddress might always return - // something. We are doing it just for completeness' sake. - if (!lookup(glXGetVideoSyncSGI) || !lookup(glXWaitVideoSyncSGI)) { - glxext.has_GLX_SGI_video_sync = false; - } - if (!lookup(glXSwapIntervalEXT)) { - glxext.has_GLX_EXT_swap_control = false; - } - if (!lookup(glXSwapIntervalMESA)) { - glxext.has_GLX_MESA_swap_control = false; - } - if (!lookup(glXSwapIntervalSGI)) { - glxext.has_GLX_SGI_swap_control = false; - } - if (!lookup(glXWaitForMscOML) || !lookup(glXGetSyncValuesOML)) { - glxext.has_GLX_OML_sync_control = false; - } - if (!lookup(glXBindTexImageEXT) || !lookup(glXReleaseTexImageEXT)) { - glxext.has_GLX_EXT_texture_from_pixmap = false; - } - if (!lookup(glXCreateContextAttribsARB)) { - glxext.has_GLX_ARB_create_context = false; - } -#ifdef GLX_MESA_query_renderer - if (!lookup(glXQueryCurrentRendererIntegerMESA)) { - glxext.has_GLX_MESA_query_renderer = false; - } -#endif -#undef lookup -} diff --git a/dwm/picom/src/backend/gl/glx.h b/dwm/picom/src/backend/gl/glx.h deleted file mode 100644 index 44b4da0..0000000 --- a/dwm/picom/src/backend/gl/glx.h +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once -#include -// Older version of glx.h defines function prototypes for these extensions... -// Rename them to avoid conflicts -#define glXSwapIntervalMESA glXSwapIntervalMESA_ -#define glXBindTexImageEXT glXBindTexImageEXT_ -#define glXReleaseTexImageEXT glXReleaseTexImageEXT -#include -#undef glXSwapIntervalMESA -#undef glXBindTexImageEXT -#undef glXReleaseTexImageEXT -#include -#include -#include - -#include "log.h" -#include "compiler.h" -#include "utils.h" -#include "x.h" - -struct glx_fbconfig_info { - GLXFBConfig cfg; - int texture_tgts; - int texture_fmt; - int y_inverted; -}; - -/// The search criteria for glx_find_fbconfig -struct glx_fbconfig_criteria { - /// Bit width of the red component - int red_size; - /// Bit width of the green component - int green_size; - /// Bit width of the blue component - int blue_size; - /// Bit width of the alpha component - int alpha_size; - /// The depth of X visual - int visual_depth; -}; - -struct glx_fbconfig_info *glx_find_fbconfig(Display *, int screen, struct xvisual_info); - - -struct glxext_info { - bool initialized; - bool has_GLX_SGI_video_sync; - bool has_GLX_SGI_swap_control; - bool has_GLX_OML_sync_control; - bool has_GLX_MESA_swap_control; - bool has_GLX_EXT_swap_control; - bool has_GLX_EXT_texture_from_pixmap; - bool has_GLX_ARB_create_context; - bool has_GLX_EXT_buffer_age; - bool has_GLX_MESA_query_renderer; - bool has_GLX_ARB_create_context_robustness; -}; - -extern struct glxext_info glxext; - -extern PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI; -extern PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI; -extern PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML; -extern PFNGLXWAITFORMSCOMLPROC glXWaitForMscOML; -extern PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT; -extern PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; -extern PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA; -extern PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT; -extern PFNGLXRELEASETEXIMAGEEXTPROC glXReleaseTexImageEXT; -extern PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB; - -#ifdef GLX_MESA_query_renderer -extern PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESA; -#endif - -void glxext_init(Display *, int screen); diff --git a/dwm/picom/src/backend/meson.build b/dwm/picom/src/backend/meson.build deleted file mode 100644 index b8f0ad9..0000000 --- a/dwm/picom/src/backend/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -# enable xrender -srcs += [ files('backend_common.c', 'xrender/xrender.c', 'dummy/dummy.c', 'backend.c', 'driver.c') ] - -# enable opengl -if get_option('opengl') - srcs += [ files('gl/gl_common.c', 'gl/glx.c') ] -endif diff --git a/dwm/picom/src/backend/xrender/xrender.c b/dwm/picom/src/backend/xrender/xrender.c deleted file mode 100644 index 6e661e8..0000000 --- a/dwm/picom/src/backend/xrender/xrender.c +++ /dev/null @@ -1,889 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "common.h" -#include "config.h" -#include "kernel.h" -#include "log.h" -#include "picom.h" -#include "region.h" -#include "types.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -typedef struct _xrender_data { - backend_t base; - /// If vsync is enabled and supported by the current system - bool vsync; - xcb_visualid_t default_visual; - /// Target window - xcb_window_t target_win; - /// Painting target, it is either the root or the overlay - xcb_render_picture_t target; - /// Back buffers. Double buffer, with 1 for temporary render use - xcb_render_picture_t back[3]; - /// The back buffer that is for temporary use - /// Age of each back buffer. - int buffer_age[3]; - /// The back buffer we should be painting into - int curr_back; - /// The corresponding pixmap to the back buffer - xcb_pixmap_t back_pixmap[3]; - /// Pictures of pixel of different alpha value, used as a mask to - /// paint transparent images - xcb_render_picture_t alpha_pict[256]; - - // XXX don't know if these are really needed - - /// 1x1 white picture - xcb_render_picture_t white_pixel; - /// 1x1 black picture - xcb_render_picture_t black_pixel; - - /// Width and height of the target pixmap - int target_width, target_height; - - xcb_special_event_t *present_event; -} xrender_data; - -struct _xrender_blur_context { - enum blur_method method; - /// Blur kernels converted to X format - struct x_convolution_kernel **x_blur_kernel; - - int resize_width, resize_height; - - /// Number of blur kernels - int x_blur_kernel_count; -}; - -struct _xrender_image_data_inner { - // struct backend_image_inner_base - int refcount; - bool has_alpha; - - // Pixmap that the client window draws to, - // it will contain the content of client window. - xcb_pixmap_t pixmap; - // A Picture links to the Pixmap - xcb_render_picture_t pict; - int width, height; - xcb_visualid_t visual; - uint8_t depth; - // Whether we own this image, e.g. we allocated it; - // or not, e.g. this is a named pixmap of a X window. - bool owned; -}; - -struct xrender_rounded_rectangle_cache { - int refcount; - // A cached picture of a rounded rectangle. Xorg rasterizes shapes on CPU so it's - // exceedingly slow. - xcb_render_picture_t p; -}; - -struct xrender_image { - struct backend_image base; - - struct xrender_rounded_rectangle_cache *rounded_rectangle; -}; - -/// Make a picture of size width x height, which has a rounded rectangle of corner_radius -/// rendered in it. -struct xrender_rounded_rectangle_cache * -make_rounded_corner_cache(xcb_connection_t *c, xcb_render_picture_t src, - xcb_drawable_t root, int width, int height, int corner_radius) { - auto picture = x_create_picture_with_standard(c, root, width, height, - XCB_PICT_STANDARD_ARGB_32, 0, NULL); - if (picture == XCB_NONE) { - return NULL; - } - - int inner_height = height - 2 * corner_radius; - int cap_height = corner_radius; - if (inner_height < 0) { - cap_height = height / 2; - inner_height = 0; - } - auto points = ccalloc(cap_height * 4 + 4, xcb_render_pointfix_t); - int point_count = 0; - -#define ADD_POINT(px, py) \ - assert(point_count < cap_height * 4 + 4); \ - points[point_count].x = DOUBLE_TO_XFIXED(px); \ - points[point_count].y = DOUBLE_TO_XFIXED(py); \ - point_count += 1; - - // The top cap - for (int i = 0; i <= cap_height; i++) { - double y = corner_radius - i; - double delta = sqrt(corner_radius * corner_radius - y * y); - double left = corner_radius - delta; - double right = width - corner_radius + delta; - if (left >= right) { - continue; - } - ADD_POINT(left, i); - ADD_POINT(right, i); - } - - // The middle rectangle - if (inner_height > 0) { - ADD_POINT(0, cap_height + inner_height); - ADD_POINT(width, cap_height + inner_height); - } - - // The bottom cap - for (int i = cap_height + inner_height + 1; i <= height; i++) { - double y = corner_radius - (height - i); - double delta = sqrt(corner_radius * corner_radius - y * y); - double left = corner_radius - delta; - double right = width - corner_radius + delta; - if (left >= right) { - break; - } - ADD_POINT(left, i); - ADD_POINT(right, i); - } -#undef ADD_POINT - - XCB_AWAIT_VOID(xcb_render_tri_strip, c, XCB_RENDER_PICT_OP_SRC, src, picture, - x_get_pictfmt_for_standard(c, XCB_PICT_STANDARD_A_8), 0, 0, - (uint32_t)point_count, points); - free(points); - auto ret = ccalloc(1, struct xrender_rounded_rectangle_cache); - ret->p = picture; - ret->refcount = 1; - return ret; -} - -static void compose_impl(struct _xrender_data *xd, struct xrender_image *xrimg, - int dst_x1, int dst_y1, int dst_x2, int dst_y2, - const region_t *reg_paint, const region_t *reg_visible, - xcb_render_picture_t result) { - const struct backend_image *img = &xrimg->base; - auto alpha_pict = xd->alpha_pict[(int)(img->opacity * MAX_ALPHA)]; - auto inner = (struct _xrender_image_data_inner *)img->inner; - region_t reg; - - bool has_alpha = inner->has_alpha || img->opacity != 1; - const auto tmpw = to_u16_checked(dst_x2 - dst_x1); - const auto tmph = to_u16_checked(dst_y2 - dst_y1); - const auto tmpew = to_u16_checked(dst_x2 - dst_x1); - const auto tmpeh = to_u16_checked(dst_y2 - dst_y1); - const xcb_render_color_t dim_color = { - .red = 0, .green = 0, .blue = 0, .alpha = (uint16_t)(0xffff * img->dim)}; - - // Clip region of rendered_pict might be set during rendering, clear it to - // make sure we get everything into the buffer - x_clear_picture_clip_region(xd->base.c, inner->pict); - - pixman_region32_init(®); - pixman_region32_intersect(®, (region_t *)reg_paint, (region_t *)reg_visible); - x_set_picture_clip_region(xd->base.c, result, 0, 0, ®); -#define DOUBLE_TO_XFIXED(value) ((xcb_render_fixed_t)(((double)(value)) * 65536)) - { - const xcb_render_transform_t transform = { - DOUBLE_TO_XFIXED((double)img->ewidth / (double)tmpew), DOUBLE_TO_XFIXED(0.0), DOUBLE_TO_XFIXED(0.0), - DOUBLE_TO_XFIXED(0.0), DOUBLE_TO_XFIXED((double)img->eheight / (double)tmpeh), DOUBLE_TO_XFIXED(0.0), - DOUBLE_TO_XFIXED(0.0), DOUBLE_TO_XFIXED(0.0), DOUBLE_TO_XFIXED(1.0), - }; - xcb_render_set_picture_transform(xd->base.c, inner->pict, transform); - xcb_render_set_picture_filter(xd->base.c, inner->pict, 7, "nearest", 0, NULL); - } -#undef DOUBLE_TO_XFIXED - - if (img->corner_radius != 0 && xrimg->rounded_rectangle == NULL) { - xrimg->rounded_rectangle = make_rounded_corner_cache( - xd->base.c, xd->white_pixel, xd->base.root, inner->width, - inner->height, (int)img->corner_radius); - } - if (((img->color_inverted || img->dim != 0) && has_alpha) || img->corner_radius != 0) { - // Apply image properties using a temporary image, because the source - // image is transparent. Otherwise the properties can be applied directly - // on the target image. - auto tmp_pict = - x_create_picture_with_visual(xd->base.c, xd->base.root, inner->width, - inner->height, inner->visual, 0, NULL); - - // Set clip region translated to source coordinate - x_set_picture_clip_region(xd->base.c, tmp_pict, to_i16_checked(-dst_x1), - to_i16_checked(-dst_y1), ®); - // Copy source -> tmp - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_OVER, inner->pict, - XCB_NONE, tmp_pict, 0, 0, 0, 0, 0, 0, tmpw, tmph); - if (img->color_inverted) { - if (inner->has_alpha) { - auto tmp_pict2 = x_create_picture_with_visual( - xd->base.c, xd->base.root, tmpw, tmph, inner->visual, - 0, NULL); - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_OVER, - tmp_pict, XCB_NONE, tmp_pict2, 0, 0, - 0, 0, 0, 0, tmpw, tmph); - - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_DIFFERENCE, - xd->white_pixel, XCB_NONE, tmp_pict, - 0, 0, 0, 0, 0, 0, tmpw, tmph); - xcb_render_composite( - xd->base.c, XCB_RENDER_PICT_OP_IN_REVERSE, tmp_pict2, - XCB_NONE, tmp_pict, 0, 0, 0, 0, 0, 0, tmpw, tmph); - xcb_render_free_picture(xd->base.c, tmp_pict2); - } else { - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_DIFFERENCE, - xd->white_pixel, XCB_NONE, tmp_pict, - 0, 0, 0, 0, 0, 0, tmpw, tmph); - } - } - if (img->dim != 0) { - // Dim the actually content of window - xcb_rectangle_t rect = { - .x = 0, - .y = 0, - .width = tmpw, - .height = tmph, - }; - - xcb_render_fill_rectangles(xd->base.c, XCB_RENDER_PICT_OP_OVER, - tmp_pict, dim_color, 1, &rect); - } - - if (img->corner_radius != 0 && xrimg->rounded_rectangle != NULL) { - // Clip tmp_pict with a rounded rectangle - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_IN_REVERSE, - xrimg->rounded_rectangle->p, XCB_NONE, - tmp_pict, 0, 0, 0, 0, 0, 0, tmpw, tmph); - } - - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_OVER, tmp_pict, - alpha_pict, result, 0, 0, 0, 0, to_i16_checked(dst_x1), - to_i16_checked(dst_y1), tmpew, tmpeh); - xcb_render_free_picture(xd->base.c, tmp_pict); - } else { - uint8_t op = (has_alpha ? XCB_RENDER_PICT_OP_OVER : XCB_RENDER_PICT_OP_SRC); - - xcb_render_composite(xd->base.c, op, inner->pict, alpha_pict, result, 0, - 0, 0, 0, to_i16_checked(dst_x1), - to_i16_checked(dst_y1), tmpew, tmpeh); - if (img->dim != 0 || img->color_inverted) { - // Apply properties, if we reach here, then has_alpha == false - assert(!has_alpha); - if (img->color_inverted) { - xcb_render_composite(xd->base.c, XCB_RENDER_PICT_OP_DIFFERENCE, - xd->white_pixel, XCB_NONE, result, 0, - 0, 0, 0, to_i16_checked(dst_x1), - to_i16_checked(dst_y1), tmpew, tmpeh); - } - - if (img->dim != 0) { - // Dim the actually content of window - xcb_rectangle_t rect = { - .x = to_i16_checked(dst_x1), - .y = to_i16_checked(dst_y1), - .width = tmpew, - .height = tmpeh, - }; - - xcb_render_fill_rectangles(xd->base.c, XCB_RENDER_PICT_OP_OVER, - result, dim_color, 1, &rect); - } - } - } - pixman_region32_fini(®); -} - -static void compose(backend_t *base, void *img_data, - int dst_x1, int dst_y1, int dst_x2, int dst_y2, - const region_t *reg_paint, const region_t *reg_visible) { - // TODO(dccsillag): use dst_{x,y}2 - struct _xrender_data *xd = (void *)base; - return compose_impl(xd, img_data, dst_x1, dst_y1, dst_x2, dst_y2, reg_paint, reg_visible, xd->back[2]); -} - -static void fill(backend_t *base, struct color c, const region_t *clip) { - struct _xrender_data *xd = (void *)base; - const rect_t *extent = pixman_region32_extents((region_t *)clip); - x_set_picture_clip_region(base->c, xd->back[2], 0, 0, clip); - // color is in X fixed point representation - xcb_render_fill_rectangles( - base->c, XCB_RENDER_PICT_OP_OVER, xd->back[2], - (xcb_render_color_t){.red = (uint16_t)(c.red * 0xffff), - .green = (uint16_t)(c.green * 0xffff), - .blue = (uint16_t)(c.blue * 0xffff), - .alpha = (uint16_t)(c.alpha * 0xffff)}, - 1, - (xcb_rectangle_t[]){{.x = to_i16_checked(extent->x1), - .y = to_i16_checked(extent->y1), - .width = to_u16_checked(extent->x2 - extent->x1), - .height = to_u16_checked(extent->y2 - extent->y1)}}); -} - -static bool blur(backend_t *backend_data, double opacity, void *ctx_, - const region_t *reg_blur, const region_t *reg_visible) { - struct _xrender_blur_context *bctx = ctx_; - if (bctx->method == BLUR_METHOD_NONE) { - return true; - } - - struct _xrender_data *xd = (void *)backend_data; - xcb_connection_t *c = xd->base.c; - region_t reg_op; - pixman_region32_init(®_op); - pixman_region32_intersect(®_op, (region_t *)reg_blur, (region_t *)reg_visible); - if (!pixman_region32_not_empty(®_op)) { - pixman_region32_fini(®_op); - return true; - } - - region_t reg_op_resized = - resize_region(®_op, bctx->resize_width, bctx->resize_height); - - const pixman_box32_t *extent_resized = pixman_region32_extents(®_op_resized); - const auto height_resized = to_u16_checked(extent_resized->y2 - extent_resized->y1); - const auto width_resized = to_u16_checked(extent_resized->x2 - extent_resized->x1); - static const char *filter0 = "Nearest"; // The "null" filter - static const char *filter = "convolution"; - - // Create a buffer for storing blurred picture, make it just big enough - // for the blur region - const uint32_t pic_attrs_mask = XCB_RENDER_CP_REPEAT; - const xcb_render_create_picture_value_list_t pic_attrs = {.repeat = XCB_RENDER_REPEAT_PAD}; - xcb_render_picture_t tmp_picture[2] = { - x_create_picture_with_visual(xd->base.c, xd->base.root, width_resized, height_resized, - xd->default_visual, pic_attrs_mask, &pic_attrs), - x_create_picture_with_visual(xd->base.c, xd->base.root, width_resized, height_resized, - xd->default_visual, pic_attrs_mask, &pic_attrs)}; - - if (!tmp_picture[0] || !tmp_picture[1]) { - log_error("Failed to build intermediate Picture."); - pixman_region32_fini(®_op); - pixman_region32_fini(®_op_resized); - return false; - } - - region_t clip; - pixman_region32_init(&clip); - pixman_region32_copy(&clip, ®_op_resized); - pixman_region32_translate(&clip, -extent_resized->x1, -extent_resized->y1); - x_set_picture_clip_region(c, tmp_picture[0], 0, 0, &clip); - x_set_picture_clip_region(c, tmp_picture[1], 0, 0, &clip); - pixman_region32_fini(&clip); - - xcb_render_picture_t src_pict = xd->back[2], dst_pict = tmp_picture[0]; - auto alpha_pict = xd->alpha_pict[(int)(opacity * MAX_ALPHA)]; - int current = 0; - x_set_picture_clip_region(c, src_pict, 0, 0, ®_op_resized); - - // For more than 1 pass, we do: - // back -(pass 1)-> tmp0 -(pass 2)-> tmp1 ... - // -(pass n-1)-> tmp0 or tmp1 -(pass n)-> back - // For 1 pass, we do - // back -(pass 1)-> tmp0 -(copy)-> target_buffer - int i; - for (i = 0; i < bctx->x_blur_kernel_count; i++) { - // Copy from source picture to destination. The filter must - // be applied on source picture, to get the nearby pixels outside the - // window. - xcb_render_set_picture_filter(c, src_pict, to_u16_checked(strlen(filter)), - filter, - to_u32_checked(bctx->x_blur_kernel[i]->size), - bctx->x_blur_kernel[i]->kernel); - - if (i == 0) { - // First pass, back buffer -> tmp picture - // (we do this even if this is also the last pass, because we - // cannot do back buffer -> back buffer) - xcb_render_composite(c, XCB_RENDER_PICT_OP_SRC, src_pict, XCB_NONE, - dst_pict, to_i16_checked(extent_resized->x1), - to_i16_checked(extent_resized->y1), 0, 0, 0, - 0, width_resized, height_resized); - } else if (i < bctx->x_blur_kernel_count - 1) { - // This is not the last pass or the first pass, - // tmp picture 1 -> tmp picture 2 - xcb_render_composite(c, XCB_RENDER_PICT_OP_SRC, src_pict, - XCB_NONE, dst_pict, 0, 0, 0, 0, 0, 0, - width_resized, height_resized); - } else { - x_set_picture_clip_region(c, xd->back[2], 0, 0, ®_op); - // This is the last pass, and we are doing more than 1 pass - xcb_render_composite(c, XCB_RENDER_PICT_OP_OVER, src_pict, - alpha_pict, xd->back[2], 0, 0, 0, 0, - to_i16_checked(extent_resized->x1), - to_i16_checked(extent_resized->y1), - width_resized, height_resized); - } - - // reset filter - xcb_render_set_picture_filter( - c, src_pict, to_u16_checked(strlen(filter0)), filter0, 0, NULL); - - src_pict = tmp_picture[current]; - dst_pict = tmp_picture[!current]; - current = !current; - } - - // There is only 1 pass - if (i == 1) { - x_set_picture_clip_region(c, xd->back[2], 0, 0, ®_op); - xcb_render_composite( - c, XCB_RENDER_PICT_OP_OVER, src_pict, alpha_pict, xd->back[2], 0, 0, - 0, 0, to_i16_checked(extent_resized->x1), - to_i16_checked(extent_resized->y1), width_resized, height_resized); - } - - xcb_render_free_picture(c, tmp_picture[0]); - xcb_render_free_picture(c, tmp_picture[1]); - pixman_region32_fini(®_op); - pixman_region32_fini(®_op_resized); - return true; -} - -static void * -bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, bool owned) { - xcb_generic_error_t *e; - auto r = xcb_get_geometry_reply(base->c, xcb_get_geometry(base->c, pixmap), &e); - if (!r) { - log_error("Invalid pixmap: %#010x", pixmap); - x_print_error(e->full_sequence, e->major_code, e->minor_code, e->error_code); - return NULL; - } - - auto img = ccalloc(1, struct xrender_image); - auto inner = ccalloc(1, struct _xrender_image_data_inner); - inner->depth = (uint8_t)fmt.visual_depth; - inner->width = img->base.ewidth = r->width; - inner->height = img->base.eheight = r->height; - inner->pixmap = pixmap; - inner->has_alpha = fmt.alpha_size != 0; - inner->pict = - x_create_picture_with_visual_and_pixmap(base->c, fmt.visual, pixmap, 0, NULL); - inner->owned = owned; - inner->visual = fmt.visual; - inner->refcount = 1; - - img->base.inner = (struct backend_image_inner_base *)inner; - img->base.opacity = 1; - img->rounded_rectangle = NULL; - free(r); - - if (inner->pict == XCB_NONE) { - free(inner); - free(img); - return NULL; - } - return img; -} -static void release_image_inner(backend_t *base, struct _xrender_image_data_inner *inner) { - xcb_render_free_picture(base->c, inner->pict); - if (inner->owned) { - xcb_free_pixmap(base->c, inner->pixmap); - } - free(inner); -} - -static void -release_rounded_corner_cache(backend_t *base, struct xrender_rounded_rectangle_cache *cache) { - if (!cache) { - return; - } - - assert(cache->refcount > 0); - cache->refcount--; - if (cache->refcount == 0) { - xcb_free_pixmap(base->c, cache->p); - free(cache); - } -} - -static void release_image(backend_t *base, void *image) { - struct xrender_image *img = image; - release_rounded_corner_cache(base, img->rounded_rectangle); - img->rounded_rectangle = NULL; - img->base.inner->refcount -= 1; - if (img->base.inner->refcount == 0) { - release_image_inner(base, (void *)img->base.inner); - } - free(img); -} - -static void deinit(backend_t *backend_data) { - struct _xrender_data *xd = (void *)backend_data; - for (int i = 0; i < 256; i++) { - xcb_render_free_picture(xd->base.c, xd->alpha_pict[i]); - } - xcb_render_free_picture(xd->base.c, xd->target); - for (int i = 0; i < 2; i++) { - xcb_render_free_picture(xd->base.c, xd->back[i]); - xcb_free_pixmap(xd->base.c, xd->back_pixmap[i]); - } - if (xd->present_event) { - xcb_unregister_for_special_event(xd->base.c, xd->present_event); - } - xcb_render_free_picture(xd->base.c, xd->white_pixel); - xcb_render_free_picture(xd->base.c, xd->black_pixel); - free(xd); -} - -static void present(backend_t *base, const region_t *region) { - struct _xrender_data *xd = (void *)base; - const rect_t *extent = pixman_region32_extents((region_t *)region); - int16_t orig_x = to_i16_checked(extent->x1), orig_y = to_i16_checked(extent->y1); - uint16_t region_width = to_u16_checked(extent->x2 - extent->x1), - region_height = to_u16_checked(extent->y2 - extent->y1); - - // compose() sets clip region on the back buffer, so clear it first - x_clear_picture_clip_region(base->c, xd->back[xd->curr_back]); - - // limit the region of update - x_set_picture_clip_region(base->c, xd->back[2], 0, 0, region); - - if (xd->vsync) { - // Update the back buffer first, then present - xcb_render_composite(base->c, XCB_RENDER_PICT_OP_SRC, xd->back[2], - XCB_NONE, xd->back[xd->curr_back], orig_x, orig_y, 0, - 0, orig_x, orig_y, region_width, region_height); - - // Make sure we got reply from PresentPixmap before waiting for events, - // to avoid deadlock - auto e = xcb_request_check( - base->c, xcb_present_pixmap_checked( - xd->base.c, xd->target_win, - xd->back_pixmap[xd->curr_back], 0, XCB_NONE, XCB_NONE, 0, - 0, XCB_NONE, XCB_NONE, XCB_NONE, 0, 0, 0, 0, 0, NULL)); - if (e) { - log_error("Failed to present pixmap"); - free(e); - return; - } - // TODO(yshui) don't block wait for present completion - xcb_present_generic_event_t *pev = - (void *)xcb_wait_for_special_event(base->c, xd->present_event); - if (!pev) { - // We don't know what happened, maybe X died - // But reset buffer age, so in case we do recover, we will - // render correctly. - xd->buffer_age[0] = xd->buffer_age[1] = -1; - return; - } - assert(pev->evtype == XCB_PRESENT_COMPLETE_NOTIFY); - xcb_present_complete_notify_event_t *pcev = (void *)pev; - // log_trace("Present complete: %d %ld", pcev->mode, pcev->msc); - xd->buffer_age[xd->curr_back] = 1; - - // buffer_age < 0 means that back buffer is empty - if (xd->buffer_age[1 - xd->curr_back] > 0) { - xd->buffer_age[1 - xd->curr_back]++; - } - if (pcev->mode == XCB_PRESENT_COMPLETE_MODE_FLIP) { - // We cannot use the pixmap we used anymore - xd->curr_back = 1 - xd->curr_back; - } - free(pev); - } else { - // No vsync needed, draw into the target picture directly - xcb_render_composite(base->c, XCB_RENDER_PICT_OP_SRC, xd->back[2], - XCB_NONE, xd->target, orig_x, orig_y, 0, 0, orig_x, - orig_y, region_width, region_height); - } -} - -static int buffer_age(backend_t *backend_data) { - struct _xrender_data *xd = (void *)backend_data; - if (!xd->vsync) { - // Only the target picture really holds the screen content, and its - // content is always up to date. So buffer age is always 1. - return 1; - } - return xd->buffer_age[xd->curr_back]; -} - -static struct _xrender_image_data_inner * -new_inner(backend_t *base, int w, int h, xcb_visualid_t visual, uint8_t depth) { - auto new_inner = ccalloc(1, struct _xrender_image_data_inner); - new_inner->pixmap = x_create_pixmap(base->c, depth, base->root, w, h); - if (new_inner->pixmap == XCB_NONE) { - log_error("Failed to create pixmap for copy"); - free(new_inner); - return NULL; - } - new_inner->pict = x_create_picture_with_visual_and_pixmap( - base->c, visual, new_inner->pixmap, 0, NULL); - if (new_inner->pict == XCB_NONE) { - log_error("Failed to create picture for copy"); - xcb_free_pixmap(base->c, new_inner->pixmap); - free(new_inner); - return NULL; - } - new_inner->width = w; - new_inner->height = h; - new_inner->visual = visual; - new_inner->depth = depth; - new_inner->refcount = 1; - new_inner->owned = true; - return new_inner; -} - -static bool decouple_image(backend_t *base, struct backend_image *img, const region_t *reg) { - if (img->inner->refcount == 1) { - return true; - } - auto inner = (struct _xrender_image_data_inner *)img->inner; - // Force new pixmap to a 32-bit ARGB visual to allow for transparent frames around - // non-transparent windows - auto visual = (inner->depth == 32) - ? inner->visual - : x_get_visual_for_standard(base->c, XCB_PICT_STANDARD_ARGB_32); - auto inner2 = new_inner(base, inner->width, inner->height, visual, 32); - if (!inner2) { - return false; - } - - x_set_picture_clip_region(base->c, inner->pict, 0, 0, reg); - xcb_render_composite(base->c, XCB_RENDER_PICT_OP_SRC, inner->pict, XCB_NONE, - inner2->pict, 0, 0, 0, 0, 0, 0, to_u16_checked(inner->width), - to_u16_checked(inner->height)); - - img->inner = (struct backend_image_inner_base *)inner2; - inner->refcount--; - return true; -} - -static bool image_op(backend_t *base, enum image_operations op, void *image, - const region_t *reg_op, const region_t *reg_visible, void *arg) { - struct _xrender_data *xd = (void *)base; - struct backend_image *img = image; - region_t reg; - double *dargs = arg; - - pixman_region32_init(®); - pixman_region32_intersect(®, (region_t *)reg_op, (region_t *)reg_visible); - - switch (op) { - case IMAGE_OP_APPLY_ALPHA: - assert(reg_op); - - if (!pixman_region32_not_empty(®)) { - break; - } - - if (dargs[0] == 1) { - break; - } - - if (!decouple_image(base, img, reg_visible)) { - pixman_region32_fini(®); - return false; - } - - auto inner = (struct _xrender_image_data_inner *)img->inner; - auto alpha_pict = xd->alpha_pict[(int)((1 - dargs[0]) * MAX_ALPHA)]; - x_set_picture_clip_region(base->c, inner->pict, 0, 0, ®); - xcb_render_composite(base->c, XCB_RENDER_PICT_OP_OUT_REVERSE, alpha_pict, - XCB_NONE, inner->pict, 0, 0, 0, 0, 0, 0, - to_u16_checked(inner->width), - to_u16_checked(inner->height)); - inner->has_alpha = true; - break; - } - pixman_region32_fini(®); - return true; -} - -static void * -create_blur_context(backend_t *base attr_unused, enum blur_method method, void *args) { - auto ret = ccalloc(1, struct _xrender_blur_context); - if (!method || method >= BLUR_METHOD_INVALID) { - ret->method = BLUR_METHOD_NONE; - return ret; - } - if (method == BLUR_METHOD_DUAL_KAWASE) { - log_warn("Blur method 'dual_kawase' is not compatible with the 'xrender' " - "backend."); - ret->method = BLUR_METHOD_NONE; - return ret; - } - - ret->method = BLUR_METHOD_KERNEL; - struct conv **kernels; - int kernel_count; - if (method == BLUR_METHOD_KERNEL) { - kernels = ((struct kernel_blur_args *)args)->kernels; - kernel_count = ((struct kernel_blur_args *)args)->kernel_count; - } else { - kernels = generate_blur_kernel(method, args, &kernel_count); - } - - ret->x_blur_kernel = ccalloc(kernel_count, struct x_convolution_kernel *); - for (int i = 0; i < kernel_count; i++) { - int center = kernels[i]->h * kernels[i]->w / 2; - x_create_convolution_kernel(kernels[i], kernels[i]->data[center], - &ret->x_blur_kernel[i]); - ret->resize_width += kernels[i]->w / 2; - ret->resize_height += kernels[i]->h / 2; - } - ret->x_blur_kernel_count = kernel_count; - - if (method != BLUR_METHOD_KERNEL) { - // Kernels generated by generate_blur_kernel, so we need to free them. - for (int i = 0; i < kernel_count; i++) { - free(kernels[i]); - } - free(kernels); - } - return ret; -} - -static void destroy_blur_context(backend_t *base attr_unused, void *ctx_) { - struct _xrender_blur_context *ctx = ctx_; - for (int i = 0; i < ctx->x_blur_kernel_count; i++) { - free(ctx->x_blur_kernel[i]); - } - free(ctx->x_blur_kernel); - free(ctx); -} - -static void get_blur_size(void *blur_context, int *width, int *height) { - struct _xrender_blur_context *ctx = blur_context; - *width = ctx->resize_width; - *height = ctx->resize_height; -} - -static backend_t *backend_xrender_init(session_t *ps) { - auto xd = ccalloc(1, struct _xrender_data); - init_backend_base(&xd->base, ps); - - for (int i = 0; i <= MAX_ALPHA; ++i) { - double o = (double)i / (double)MAX_ALPHA; - xd->alpha_pict[i] = solid_picture(ps->c, ps->root, false, o, 0, 0, 0); - assert(xd->alpha_pict[i] != XCB_NONE); - } - - xd->target_width = ps->root_width; - xd->target_height = ps->root_height; - xd->default_visual = ps->vis; - xd->black_pixel = solid_picture(ps->c, ps->root, true, 1, 0, 0, 0); - xd->white_pixel = solid_picture(ps->c, ps->root, true, 1, 1, 1, 1); - - xd->target_win = session_get_target_window(ps); - xcb_render_create_picture_value_list_t pa = { - .subwindowmode = XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS, - }; - xd->target = x_create_picture_with_visual_and_pixmap( - ps->c, ps->vis, xd->target_win, XCB_RENDER_CP_SUBWINDOW_MODE, &pa); - - auto pictfmt = x_get_pictform_for_visual(ps->c, ps->vis); - if (!pictfmt) { - log_fatal("Default visual is invalid"); - abort(); - } - - xd->vsync = ps->o.vsync; - if (ps->present_exists) { - auto eid = x_new_id(ps->c); - auto e = - xcb_request_check(ps->c, xcb_present_select_input_checked( - ps->c, eid, xd->target_win, - XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY)); - if (e) { - log_error("Cannot select present input, vsync will be disabled"); - xd->vsync = false; - free(e); - } - - xd->present_event = - xcb_register_for_special_xge(ps->c, &xcb_present_id, eid, NULL); - if (!xd->present_event) { - log_error("Cannot register for special XGE, vsync will be " - "disabled"); - xd->vsync = false; - } - } else { - xd->vsync = false; - } - - // We might need to do double buffering for vsync, and buffer 0 and 1 are for - // double buffering. - int first_buffer_index = xd->vsync ? 0 : 2; - for (int i = first_buffer_index; i < 3; i++) { - xd->back_pixmap[i] = x_create_pixmap(ps->c, pictfmt->depth, ps->root, - to_u16_checked(ps->root_width), - to_u16_checked(ps->root_height)); - const uint32_t pic_attrs_mask = XCB_RENDER_CP_REPEAT; - const xcb_render_create_picture_value_list_t pic_attrs = { - .repeat = XCB_RENDER_REPEAT_PAD}; - xd->back[i] = x_create_picture_with_pictfmt_and_pixmap( - ps->c, pictfmt, xd->back_pixmap[i], pic_attrs_mask, &pic_attrs); - xd->buffer_age[i] = -1; - if (xd->back_pixmap[i] == XCB_NONE || xd->back[i] == XCB_NONE) { - log_error("Cannot create pixmap for rendering"); - goto err; - } - } - xd->curr_back = 0; - - return &xd->base; -err: - deinit(&xd->base); - return NULL; -} - -void *clone_image(backend_t *base attr_unused, const void *image_data, - const region_t *reg_visible attr_unused) { - auto new_img = ccalloc(1, struct xrender_image); - *new_img = *(struct xrender_image *)image_data; - new_img->base.inner->refcount++; - if (new_img->rounded_rectangle) { - new_img->rounded_rectangle->refcount++; - } - return new_img; -} - -static bool -set_image_property(backend_t *base, enum image_properties op, void *image, void *args) { - auto xrimg = (struct xrender_image *)image; - if (op == IMAGE_PROPERTY_CORNER_RADIUS && - ((double *)args)[0] != xrimg->base.corner_radius) { - // Free cached rounded rectangle if corner radius changed - release_rounded_corner_cache(base, xrimg->rounded_rectangle); - xrimg->rounded_rectangle = NULL; - } - return default_set_image_property(base, op, image, args); -} - -struct backend_operations xrender_ops = { - .init = backend_xrender_init, - .deinit = deinit, - .blur = blur, - .present = present, - .compose = compose, - .fill = fill, - .bind_pixmap = bind_pixmap, - .release_image = release_image, - .render_shadow = default_backend_render_shadow, - //.prepare_win = prepare_win, - //.release_win = release_win, - .is_image_transparent = default_is_image_transparent, - .buffer_age = buffer_age, - .max_buffer_age = 2, - - .image_op = image_op, - .clone_image = clone_image, - .set_image_property = set_image_property, - .create_blur_context = create_blur_context, - .destroy_blur_context = destroy_blur_context, - .get_blur_size = get_blur_size, -}; - -// vim: set noet sw=8 ts=8: diff --git a/dwm/picom/src/c2.c b/dwm/picom/src/c2.c deleted file mode 100644 index d0c1aeb..0000000 --- a/dwm/picom/src/c2.c +++ /dev/null @@ -1,1674 +0,0 @@ -// SPDX-License-Identifier: MIT - -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#include -#include -#include -#include - -// libpcre -#ifdef CONFIG_REGEX_PCRE -#include - -// For compatibility with -#include - -#include "atom.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "log.h" -#include "string_utils.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -#include "c2.h" - -#pragma GCC diagnostic error "-Wunused-parameter" - -#define C2_MAX_LEVELS 10 - -typedef struct _c2_b c2_b_t; -typedef struct _c2_l c2_l_t; - -/// Pointer to a condition tree. -typedef struct { - bool isbranch : 1; - union { - c2_b_t *b; - c2_l_t *l; - }; -} c2_ptr_t; - -/// Initializer for c2_ptr_t. -#define C2_PTR_INIT \ - { .isbranch = false, .l = NULL, } - -static const c2_ptr_t C2_PTR_NULL = C2_PTR_INIT; - -/// Operator of a branch element. -typedef enum { - C2_B_OUNDEFINED, - C2_B_OAND, - C2_B_OOR, - C2_B_OXOR, -} c2_b_op_t; - -/// Structure for branch element in a window condition -struct _c2_b { - bool neg : 1; - c2_b_op_t op; - c2_ptr_t opr1; - c2_ptr_t opr2; -}; - -/// Initializer for c2_b_t. -#define C2_B_INIT \ - { .neg = false, .op = C2_B_OUNDEFINED, .opr1 = C2_PTR_INIT, .opr2 = C2_PTR_INIT, } - -/// Structure for leaf element in a window condition -struct _c2_l { - bool neg : 1; - enum { C2_L_OEXISTS, - C2_L_OEQ, - C2_L_OGT, - C2_L_OGTEQ, - C2_L_OLT, - C2_L_OLTEQ, - } op : 3; - enum { C2_L_MEXACT, - C2_L_MSTART, - C2_L_MCONTAINS, - C2_L_MWILDCARD, - C2_L_MPCRE, - } match : 3; - bool match_ignorecase : 1; - char *tgt; - xcb_atom_t tgtatom; - bool tgt_onframe; - int index; - enum { C2_L_PUNDEFINED = -1, - C2_L_PID = 0, - C2_L_PX, - C2_L_PY, - C2_L_PX2, - C2_L_PY2, - C2_L_PWIDTH, - C2_L_PHEIGHT, - C2_L_PWIDTHB, - C2_L_PHEIGHTB, - C2_L_PBDW, - C2_L_PFULLSCREEN, - C2_L_POVREDIR, - C2_L_PARGB, - C2_L_PFOCUSED, - C2_L_PWMWIN, - C2_L_PBSHAPED, - C2_L_PROUNDED, - C2_L_PCLIENT, - C2_L_PWINDOWTYPE, - C2_L_PLEADER, - C2_L_PNAME, - C2_L_PCLASSG, - C2_L_PCLASSI, - C2_L_PROLE, - } predef; - enum c2_l_type { - C2_L_TUNDEFINED, - C2_L_TSTRING, - C2_L_TCARDINAL, - C2_L_TWINDOW, - C2_L_TATOM, - C2_L_TDRAWABLE, - } type; - int format; - enum { C2_L_PTUNDEFINED, - C2_L_PTSTRING, - C2_L_PTINT, - } ptntype; - char *ptnstr; - long ptnint; -#ifdef CONFIG_REGEX_PCRE - pcre *regex_pcre; - pcre_extra *regex_pcre_extra; -#endif -}; - -/// Initializer for c2_l_t. -#define C2_L_INIT \ - { \ - .neg = false, .op = C2_L_OEXISTS, .match = C2_L_MEXACT, \ - .match_ignorecase = false, .tgt = NULL, .tgtatom = 0, .tgt_onframe = false, \ - .predef = C2_L_PUNDEFINED, .index = 0, .type = C2_L_TUNDEFINED, \ - .format = 0, .ptntype = C2_L_PTUNDEFINED, .ptnstr = NULL, .ptnint = 0, \ - } - -static const c2_l_t leaf_def = C2_L_INIT; - -/// Linked list type of conditions. -struct _c2_lptr { - c2_ptr_t ptr; - void *data; - struct _c2_lptr *next; -}; - -/// Initializer for c2_lptr_t. -#define C2_LPTR_INIT \ - { .ptr = C2_PTR_INIT, .data = NULL, .next = NULL, } - -/// Structure representing a predefined target. -typedef struct { - const char *name; - enum c2_l_type type; - int format; -} c2_predef_t; - -// Predefined targets. -static const c2_predef_t C2_PREDEFS[] = { - [C2_L_PID] = {"id", C2_L_TCARDINAL, 0}, - [C2_L_PX] = {"x", C2_L_TCARDINAL, 0}, - [C2_L_PY] = {"y", C2_L_TCARDINAL, 0}, - [C2_L_PX2] = {"x2", C2_L_TCARDINAL, 0}, - [C2_L_PY2] = {"y2", C2_L_TCARDINAL, 0}, - [C2_L_PWIDTH] = {"width", C2_L_TCARDINAL, 0}, - [C2_L_PHEIGHT] = {"height", C2_L_TCARDINAL, 0}, - [C2_L_PWIDTHB] = {"widthb", C2_L_TCARDINAL, 0}, - [C2_L_PHEIGHTB] = {"heightb", C2_L_TCARDINAL, 0}, - [C2_L_PBDW] = {"border_width", C2_L_TCARDINAL, 0}, - [C2_L_PFULLSCREEN] = {"fullscreen", C2_L_TCARDINAL, 0}, - [C2_L_POVREDIR] = {"override_redirect", C2_L_TCARDINAL, 0}, - [C2_L_PARGB] = {"argb", C2_L_TCARDINAL, 0}, - [C2_L_PFOCUSED] = {"focused", C2_L_TCARDINAL, 0}, - [C2_L_PWMWIN] = {"wmwin", C2_L_TCARDINAL, 0}, - [C2_L_PBSHAPED] = {"bounding_shaped", C2_L_TCARDINAL, 0}, - [C2_L_PROUNDED] = {"rounded_corners", C2_L_TCARDINAL, 0}, - [C2_L_PCLIENT] = {"client", C2_L_TWINDOW, 0}, - [C2_L_PWINDOWTYPE] = {"window_type", C2_L_TSTRING, 0}, - [C2_L_PLEADER] = {"leader", C2_L_TWINDOW, 0}, - [C2_L_PNAME] = {"name", C2_L_TSTRING, 0}, - [C2_L_PCLASSG] = {"class_g", C2_L_TSTRING, 0}, - [C2_L_PCLASSI] = {"class_i", C2_L_TSTRING, 0}, - [C2_L_PROLE] = {"role", C2_L_TSTRING, 0}, -}; - -/** - * Get the numeric property value from a win_prop_t. - */ -static inline long winprop_get_int(winprop_t prop, size_t index) { - long tgt = 0; - - if (!prop.nitems || index >= prop.nitems) { - return 0; - } - - switch (prop.format) { - case 8: tgt = *(prop.p8 + index); break; - case 16: tgt = *(prop.p16 + index); break; - case 32: tgt = *(prop.p32 + index); break; - default: assert(0); break; - } - - return tgt; -} - -/** - * Compare next word in a string with another string. - */ -static inline int strcmp_wd(const char *needle, const char *src) { - int ret = mstrncmp(needle, src); - if (ret) - return ret; - - char c = src[strlen(needle)]; - if (isalnum((unsigned char)c) || '_' == c) - return 1; - else - return 0; -} - -/** - * Return whether a c2_ptr_t is empty. - */ -static inline attr_unused bool c2_ptr_isempty(const c2_ptr_t p) { - return !(p.isbranch ? (bool)p.b : (bool)p.l); -} - -/** - * Reset a c2_ptr_t. - */ -static inline void c2_ptr_reset(c2_ptr_t *pp) { - if (pp) - memcpy(pp, &C2_PTR_NULL, sizeof(c2_ptr_t)); -} - -/** - * Combine two condition trees. - */ -static inline c2_ptr_t c2h_comb_tree(c2_b_op_t op, c2_ptr_t p1, c2_ptr_t p2) { - c2_ptr_t p = {.isbranch = true, .b = NULL}; - p.b = cmalloc(c2_b_t); - - p.b->neg = false; - p.b->op = op; - p.b->opr1 = p1; - p.b->opr2 = p2; - - return p; -} - -/** - * Get the precedence value of a condition branch operator. - */ -static inline int c2h_b_opp(c2_b_op_t op) { - switch (op) { - case C2_B_OAND: return 2; - case C2_B_OOR: return 1; - case C2_B_OXOR: return 1; - default: break; - } - - assert(0); - return 0; -} - -/** - * Compare precedence of two condition branch operators. - * - * Associativity is left-to-right, forever. - * - * @return positive number if op1 > op2, 0 if op1 == op2 in precedence, - * negative number otherwise - */ -static inline int c2h_b_opcmp(c2_b_op_t op1, c2_b_op_t op2) { - return c2h_b_opp(op1) - c2h_b_opp(op2); -} - -static int c2_parse_grp(const char *pattern, int offset, c2_ptr_t *presult, int level); - -static int c2_parse_target(const char *pattern, int offset, c2_ptr_t *presult); - -static int c2_parse_op(const char *pattern, int offset, c2_ptr_t *presult); - -static int c2_parse_pattern(const char *pattern, int offset, c2_ptr_t *presult); - -static int c2_parse_legacy(const char *pattern, int offset, c2_ptr_t *presult); - -static void c2_free(c2_ptr_t p); - -/** - * Wrapper of c2_free(). - */ -static inline void c2_freep(c2_ptr_t *pp) { - if (pp) { - c2_free(*pp); - c2_ptr_reset(pp); - } -} - -static const char *c2h_dump_str_tgt(const c2_l_t *pleaf); - -static const char *c2h_dump_str_type(const c2_l_t *pleaf); - -static void attr_unused c2_dump(c2_ptr_t p); - -static xcb_atom_t c2_get_atom_type(const c2_l_t *pleaf); - -static bool c2_match_once(session_t *ps, const struct managed_win *w, const c2_ptr_t cond); - -/** - * Parse a condition string. - */ -c2_lptr_t *c2_parse(c2_lptr_t **pcondlst, const char *pattern, void *data) { - if (!pattern) - return NULL; - - // Parse the pattern - c2_ptr_t result = C2_PTR_INIT; - int offset = -1; - - if (strlen(pattern) >= 2 && ':' == pattern[1]) - offset = c2_parse_legacy(pattern, 0, &result); - else - offset = c2_parse_grp(pattern, 0, &result, 0); - - if (offset < 0) { - c2_freep(&result); - return NULL; - } - - // Insert to pcondlst - { - static const c2_lptr_t lptr_def = C2_LPTR_INIT; - auto plptr = cmalloc(c2_lptr_t); - memcpy(plptr, &lptr_def, sizeof(c2_lptr_t)); - plptr->ptr = result; - plptr->data = data; - if (pcondlst) { - plptr->next = *pcondlst; - *pcondlst = plptr; - } - -#ifdef DEBUG_C2 - log_trace("(\"%s\"): ", pattern); - c2_dump(plptr->ptr); - putchar('\n'); -#endif - - return plptr; - } -} - -#define c2_error(format, ...) \ - do { \ - log_error("Pattern \"%s\" pos %d: " format, pattern, offset, ##__VA_ARGS__); \ - goto fail; \ - } while (0) - -// TODO(yshui) Not a very good macro, should probably be a function -#define C2H_SKIP_SPACES() \ - { \ - while (isspace((unsigned char)pattern[offset])) \ - ++offset; \ - } - -/** - * Parse a group in condition string. - * - * @return offset of next character in string - */ -static int c2_parse_grp(const char *pattern, int offset, c2_ptr_t *presult, int level) { - // Check for recursion levels - if (level > C2_MAX_LEVELS) - c2_error("Exceeded maximum recursion levels."); - - if (!pattern) - return -1; - - // Expected end character - const char endchar = (offset ? ')' : '\0'); - - // We use a system that a maximum of 2 elements are kept. When we find - // the third element, we combine the elements according to operator - // precedence. This design limits operators to have at most two-levels - // of precedence and fixed left-to-right associativity. - - // For storing branch operators. ops[0] is actually unused - c2_b_op_t ops[3] = {}; - // For storing elements - c2_ptr_t eles[2] = {C2_PTR_INIT, C2_PTR_INIT}; - // Index of next free element slot in eles - int elei = 0; - // Pointer to the position of next element - c2_ptr_t *pele = eles; - // Negation flag of next operator - bool neg = false; - // Whether we are expecting an element immediately, is true at first, or - // after encountering a logical operator - bool next_expected = true; - - // Parse the pattern character-by-character - for (; pattern[offset]; ++offset) { - assert(elei <= 2); - - // Jump over spaces - if (isspace((unsigned char)pattern[offset])) - continue; - - // Handle end of group - if (')' == pattern[offset]) - break; - - // Handle "!" - if ('!' == pattern[offset]) { - if (!next_expected) - c2_error("Unexpected \"!\"."); - - neg = !neg; - continue; - } - - // Handle AND and OR - if ('&' == pattern[offset] || '|' == pattern[offset]) { - if (next_expected) - c2_error("Unexpected logical operator."); - - next_expected = true; - if (!mstrncmp("&&", pattern + offset)) { - ops[elei] = C2_B_OAND; - ++offset; - } else if (!mstrncmp("||", pattern + offset)) { - ops[elei] = C2_B_OOR; - ++offset; - } else - c2_error("Illegal logical operator."); - - continue; - } - - // Parsing an element - if (!next_expected) - c2_error("Unexpected expression."); - - assert(!elei || ops[elei]); - - // If we are out of space - if (2 == elei) { - --elei; - // If the first operator has higher or equal precedence, combine - // the first two elements - if (c2h_b_opcmp(ops[1], ops[2]) >= 0) { - eles[0] = c2h_comb_tree(ops[1], eles[0], eles[1]); - c2_ptr_reset(&eles[1]); - pele = &eles[elei]; - ops[1] = ops[2]; - } - // Otherwise, combine the second and the incoming one - else { - eles[1] = c2h_comb_tree(ops[2], eles[1], C2_PTR_NULL); - assert(eles[1].isbranch); - pele = &eles[1].b->opr2; - } - // The last operator always needs to be reset - ops[2] = C2_B_OUNDEFINED; - } - - // It's a subgroup if it starts with '(' - if ('(' == pattern[offset]) { - if ((offset = c2_parse_grp(pattern, offset + 1, pele, level + 1)) < 0) - goto fail; - } - // Otherwise it's a leaf - else { - if ((offset = c2_parse_target(pattern, offset, pele)) < 0) - goto fail; - - assert(!pele->isbranch && !c2_ptr_isempty(*pele)); - - if ((offset = c2_parse_op(pattern, offset, pele)) < 0) - goto fail; - - if ((offset = c2_parse_pattern(pattern, offset, pele)) < 0) - goto fail; - } - // Decrement offset -- we will increment it in loop update - --offset; - - // Apply negation - if (neg) { - neg = false; - if (pele->isbranch) - pele->b->neg = !pele->b->neg; - else - pele->l->neg = !pele->l->neg; - } - - next_expected = false; - ++elei; - pele = &eles[elei]; - } - - // Wrong end character? - if (pattern[offset] && !endchar) - c2_error("Expected end of string but found '%c'.", pattern[offset]); - if (!pattern[offset] && endchar) - c2_error("Expected '%c' but found end of string.", endchar); - - // Handle end of group - if (!elei) { - c2_error("Empty group."); - } else if (next_expected) { - c2_error("Missing rule before end of group."); - } else if (elei > 1) { - assert(2 == elei); - assert(ops[1]); - eles[0] = c2h_comb_tree(ops[1], eles[0], eles[1]); - c2_ptr_reset(&eles[1]); - } - - *presult = eles[0]; - - if (')' == pattern[offset]) - ++offset; - - return offset; - -fail: - c2_freep(&eles[0]); - c2_freep(&eles[1]); - - return -1; -} - -/** - * Parse the target part of a rule. - */ -static int c2_parse_target(const char *pattern, int offset, c2_ptr_t *presult) { - // Initialize leaf - presult->isbranch = false; - presult->l = cmalloc(c2_l_t); - - c2_l_t *const pleaf = presult->l; - memcpy(pleaf, &leaf_def, sizeof(c2_l_t)); - - // Parse negation marks - while ('!' == pattern[offset]) { - pleaf->neg = !pleaf->neg; - ++offset; - C2H_SKIP_SPACES(); - } - - // Copy target name out - int tgtlen = 0; - for (; pattern[offset] && (isalnum((unsigned char)pattern[offset]) || - '_' == pattern[offset] || '.' == pattern[offset]); - ++offset) { - ++tgtlen; - } - if (!tgtlen) { - c2_error("Empty target."); - } - pleaf->tgt = strndup(&pattern[offset - tgtlen], (size_t)tgtlen); - - // Check for predefined targets - static const int npredefs = (int)(sizeof(C2_PREDEFS) / sizeof(C2_PREDEFS[0])); - for (int i = 0; i < npredefs; ++i) { - if (!strcmp(C2_PREDEFS[i].name, pleaf->tgt)) { - pleaf->predef = i; - pleaf->type = C2_PREDEFS[i].type; - pleaf->format = C2_PREDEFS[i].format; - break; - } - } - - C2H_SKIP_SPACES(); - - // Parse target-on-frame flag - if ('@' == pattern[offset]) { - pleaf->tgt_onframe = true; - ++offset; - C2H_SKIP_SPACES(); - } - - // Parse index - if ('[' == pattern[offset]) { - if (pleaf->predef != C2_L_PUNDEFINED) { - c2_error("Predefined targets can't have index."); - } - - offset++; - - C2H_SKIP_SPACES(); - - long index = -1; - const char *endptr = NULL; - - if ('*' == pattern[offset]) { - index = -1; - endptr = pattern + offset + 1; - } else { - index = strtol(pattern + offset, (char **)&endptr, 0); - if (index < 0) { - c2_error("Index number invalid."); - } - } - - if (!endptr || pattern + offset == endptr) { - c2_error("No index number found after bracket."); - } - - pleaf->index = to_int_checked(index); - offset = to_int_checked(endptr - pattern); - - C2H_SKIP_SPACES(); - - if (pattern[offset] != ']') { - c2_error("Index end marker not found."); - } - - ++offset; - - C2H_SKIP_SPACES(); - } - - // Parse target type and format - if (':' == pattern[offset]) { - ++offset; - C2H_SKIP_SPACES(); - - // Look for format - bool hasformat = false; - long format = 0; - { - char *endptr = NULL; - format = strtol(pattern + offset, &endptr, 0); - assert(endptr); - if ((hasformat = (endptr && endptr != pattern + offset))) { - offset = to_int_checked(endptr - pattern); - } - C2H_SKIP_SPACES(); - } - - // Look for type - enum c2_l_type type = C2_L_TUNDEFINED; - switch (pattern[offset]) { - case 'w': type = C2_L_TWINDOW; break; - case 'd': type = C2_L_TDRAWABLE; break; - case 'c': type = C2_L_TCARDINAL; break; - case 's': type = C2_L_TSTRING; break; - case 'a': type = C2_L_TATOM; break; - default: c2_error("Invalid type character."); - } - - if (type) { - if (pleaf->predef != C2_L_PUNDEFINED) { - log_warn("Type specified for a default target " - "will be ignored."); - } else { - if (pleaf->type && type != pleaf->type) { - log_warn("Default type overridden on " - "target."); - } - pleaf->type = type; - } - } - - offset++; - C2H_SKIP_SPACES(); - - // Default format - if (!pleaf->format) { - switch (pleaf->type) { - case C2_L_TWINDOW: - case C2_L_TDRAWABLE: - case C2_L_TATOM: pleaf->format = 32; break; - case C2_L_TSTRING: pleaf->format = 8; break; - default: break; - } - } - - // Write format - if (hasformat) { - if (pleaf->predef != C2_L_PUNDEFINED) { - log_warn("Format \"%ld\" specified on a default target " - "will be ignored.", - format); - } else if (pleaf->type == C2_L_TSTRING) { - log_warn("Format \"%ld\" specified on a string target " - "will be ignored.", - format); - } else { - if (pleaf->format && pleaf->format != format) { - log_warn("Default format %d overridden on " - "target.", - pleaf->format); - } - pleaf->format = to_int_checked(format); - } - } - } - - if (!pleaf->type) { - c2_error("Target type cannot be determined."); - } - - // if (!pleaf->predef && !pleaf->format && C2_L_TSTRING != pleaf->type) - // c2_error("Target format cannot be determined."); - - if (pleaf->format && 8 != pleaf->format && 16 != pleaf->format && 32 != pleaf->format) { - c2_error("Invalid format."); - } - - return offset; - -fail: - return -1; -} - -/** - * Parse the operator part of a leaf. - */ -static int c2_parse_op(const char *pattern, int offset, c2_ptr_t *presult) { - c2_l_t *const pleaf = presult->l; - - // Parse negation marks - C2H_SKIP_SPACES(); - while ('!' == pattern[offset]) { - pleaf->neg = !pleaf->neg; - ++offset; - C2H_SKIP_SPACES(); - } - - // Parse qualifiers - if ('*' == pattern[offset] || '^' == pattern[offset] || '%' == pattern[offset] || - '~' == pattern[offset]) { - switch (pattern[offset]) { - case '*': pleaf->match = C2_L_MCONTAINS; break; - case '^': pleaf->match = C2_L_MSTART; break; - case '%': pleaf->match = C2_L_MWILDCARD; break; - case '~': pleaf->match = C2_L_MPCRE; break; - default: assert(0); - } - ++offset; - C2H_SKIP_SPACES(); - } - - // Parse flags - while ('?' == pattern[offset]) { - pleaf->match_ignorecase = true; - ++offset; - C2H_SKIP_SPACES(); - } - - // Parse operator - while ('=' == pattern[offset] || '>' == pattern[offset] || '<' == pattern[offset]) { - if ('=' == pattern[offset] && C2_L_OGT == pleaf->op) - pleaf->op = C2_L_OGTEQ; - else if ('=' == pattern[offset] && C2_L_OLT == pleaf->op) - pleaf->op = C2_L_OLTEQ; - else if (pleaf->op) { - c2_error("Duplicate operator."); - } else { - switch (pattern[offset]) { - case '=': pleaf->op = C2_L_OEQ; break; - case '>': pleaf->op = C2_L_OGT; break; - case '<': pleaf->op = C2_L_OLT; break; - default: assert(0); - } - } - ++offset; - C2H_SKIP_SPACES(); - } - - // Check for problems - if (C2_L_OEQ != pleaf->op && (pleaf->match || pleaf->match_ignorecase)) - c2_error("Exists/greater-than/less-than operators cannot have a " - "qualifier."); - - return offset; - -fail: - return -1; -} - -/** - * Parse the pattern part of a leaf. - */ -static int c2_parse_pattern(const char *pattern, int offset, c2_ptr_t *presult) { - c2_l_t *const pleaf = presult->l; - - // Exists operator cannot have pattern - if (!pleaf->op) { - return offset; - } - - C2H_SKIP_SPACES(); - - char *endptr = NULL; - if (!strcmp_wd("true", &pattern[offset])) { - pleaf->ptntype = C2_L_PTINT; - pleaf->ptnint = true; - offset += 4; // length of "true"; - } else if (!strcmp_wd("false", &pattern[offset])) { - pleaf->ptntype = C2_L_PTINT; - pleaf->ptnint = false; - offset += 5; // length of "false"; - } else if (pleaf->ptnint = strtol(pattern + offset, &endptr, 0), - pattern + offset != endptr) { - pleaf->ptntype = C2_L_PTINT; - offset = to_int_checked(endptr - pattern); - // Make sure we are stopping at the end of a word - if (isalnum((unsigned char)pattern[offset])) { - c2_error("Trailing characters after a numeric pattern."); - } - } else { - // Parse string patterns - bool raw = false; - char delim = '\0'; - - // String flags - if (tolower((unsigned char)pattern[offset]) == 'r') { - raw = true; - ++offset; - C2H_SKIP_SPACES(); - } - - // Check for delimiters - if (pattern[offset] == '\"' || pattern[offset] == '\'') { - pleaf->ptntype = C2_L_PTSTRING; - delim = pattern[offset]; - ++offset; - } - - if (pleaf->ptntype != C2_L_PTSTRING) { - c2_error("Invalid pattern type."); - } - - // Parse the string now - // We can't determine the length of the pattern, so we use the length - // to the end of the pattern string -- currently escape sequences - // cannot be converted to a string longer than itself. - auto tptnstr = ccalloc((strlen(pattern + offset) + 1), char); - char *ptptnstr = tptnstr; - pleaf->ptnstr = tptnstr; - for (; pattern[offset] && delim != pattern[offset]; ++offset) { - // Handle escape sequences if it's not a raw string - if ('\\' == pattern[offset] && !raw) { - switch (pattern[++offset]) { - case '\\': *(ptptnstr++) = '\\'; break; - case '\'': *(ptptnstr++) = '\''; break; - case '\"': *(ptptnstr++) = '\"'; break; - case 'a': *(ptptnstr++) = '\a'; break; - case 'b': *(ptptnstr++) = '\b'; break; - case 'f': *(ptptnstr++) = '\f'; break; - case 'n': *(ptptnstr++) = '\n'; break; - case 'r': *(ptptnstr++) = '\r'; break; - case 't': *(ptptnstr++) = '\t'; break; - case 'v': *(ptptnstr++) = '\v'; break; - case 'o': - case 'x': { - char *tstr = strndup(pattern + offset + 1, 2); - char *pstr = NULL; - long val = strtol( - tstr, &pstr, ('o' == pattern[offset] ? 8 : 16)); - free(tstr); - if (pstr != &tstr[2] || val <= 0) - c2_error("Invalid octal/hex escape " - "sequence."); - *(ptptnstr++) = to_char_checked(val); - offset += 2; - break; - } - default: c2_error("Invalid escape sequence."); - } - } else { - *(ptptnstr++) = pattern[offset]; - } - } - if (!pattern[offset]) - c2_error("Premature end of pattern string."); - ++offset; - *ptptnstr = '\0'; - pleaf->ptnstr = strdup(tptnstr); - free(tptnstr); - } - - C2H_SKIP_SPACES(); - - if (!pleaf->ptntype) - c2_error("Invalid pattern type."); - - // Check if the type is correct - if (!(((C2_L_TSTRING == pleaf->type || C2_L_TATOM == pleaf->type) && - C2_L_PTSTRING == pleaf->ptntype) || - ((C2_L_TCARDINAL == pleaf->type || C2_L_TWINDOW == pleaf->type || - C2_L_TDRAWABLE == pleaf->type) && - C2_L_PTINT == pleaf->ptntype))) - c2_error("Pattern type incompatible with target type."); - - if (C2_L_PTINT == pleaf->ptntype && pleaf->match) - c2_error("Integer/boolean pattern cannot have operator qualifiers."); - - if (C2_L_PTINT == pleaf->ptntype && pleaf->match_ignorecase) - c2_error("Integer/boolean pattern cannot have flags."); - - if (C2_L_PTSTRING == pleaf->ptntype && - (C2_L_OGT == pleaf->op || C2_L_OGTEQ == pleaf->op || C2_L_OLT == pleaf->op || - C2_L_OLTEQ == pleaf->op)) - c2_error("String pattern cannot have an arithmetic operator."); - - return offset; - -fail: - return -1; -} - -/** - * Parse a condition with legacy syntax. - */ -static int c2_parse_legacy(const char *pattern, int offset, c2_ptr_t *presult) { - if (strlen(pattern + offset) < 4 || pattern[offset + 1] != ':' || - !strchr(pattern + offset + 2, ':')) { - c2_error("Legacy parser: Invalid format."); - } - - // Allocate memory for new leaf - auto pleaf = cmalloc(c2_l_t); - presult->isbranch = false; - presult->l = pleaf; - memcpy(pleaf, &leaf_def, sizeof(c2_l_t)); - pleaf->type = C2_L_TSTRING; - pleaf->op = C2_L_OEQ; - pleaf->ptntype = C2_L_PTSTRING; - - // Determine the pattern target -#define TGTFILL(pdefid) \ - (pleaf->predef = pdefid, pleaf->type = C2_PREDEFS[pdefid].type, \ - pleaf->format = C2_PREDEFS[pdefid].format) - switch (pattern[offset]) { - case 'n': TGTFILL(C2_L_PNAME); break; - case 'i': TGTFILL(C2_L_PCLASSI); break; - case 'g': TGTFILL(C2_L_PCLASSG); break; - case 'r': TGTFILL(C2_L_PROLE); break; - default: c2_error("Target \"%c\" invalid.\n", pattern[offset]); - } -#undef TGTFILL - - offset += 2; - - // Determine the match type - switch (pattern[offset]) { - case 'e': pleaf->match = C2_L_MEXACT; break; - case 'a': pleaf->match = C2_L_MCONTAINS; break; - case 's': pleaf->match = C2_L_MSTART; break; - case 'w': pleaf->match = C2_L_MWILDCARD; break; - case 'p': pleaf->match = C2_L_MPCRE; break; - default: c2_error("Type \"%c\" invalid.\n", pattern[offset]); - } - ++offset; - - // Determine the pattern flags - while (':' != pattern[offset]) { - switch (pattern[offset]) { - case 'i': pleaf->match_ignorecase = true; break; - default: c2_error("Flag \"%c\" invalid.", pattern[offset]); - } - ++offset; - } - ++offset; - - // Copy the pattern - pleaf->ptnstr = strdup(pattern + offset); - - return offset; - -fail: - return -1; -} - -#undef c2_error - -/** - * Do postprocessing on a condition leaf. - */ -static bool c2_l_postprocess(session_t *ps, c2_l_t *pleaf) { - // Give a pattern type to a leaf with exists operator, if needed - if (C2_L_OEXISTS == pleaf->op && !pleaf->ptntype) { - pleaf->ptntype = (C2_L_TSTRING == pleaf->type ? C2_L_PTSTRING : C2_L_PTINT); - } - - // Get target atom if it's not a predefined one - if (pleaf->predef == C2_L_PUNDEFINED) { - pleaf->tgtatom = get_atom(ps->atoms, pleaf->tgt); - if (!pleaf->tgtatom) { - log_error("Failed to get atom for target \"%s\".", pleaf->tgt); - return false; - } - } - - // Insert target Atom into atom track list - if (pleaf->tgtatom) { - bool found = false; - for (latom_t *platom = ps->track_atom_lst; platom; platom = platom->next) { - if (pleaf->tgtatom == platom->atom) { - found = true; - break; - } - } - if (!found) { - auto pnew = cmalloc(latom_t); - pnew->next = ps->track_atom_lst; - pnew->atom = pleaf->tgtatom; - ps->track_atom_lst = pnew; - } - } - - // Warn about lower case characters in target name - if (pleaf->predef == C2_L_PUNDEFINED) { - for (const char *pc = pleaf->tgt; *pc; ++pc) { - if (islower((unsigned char)*pc)) { - log_warn("Lowercase character in target name \"%s\".", - pleaf->tgt); - break; - } - } - } - - // PCRE patterns - if (C2_L_PTSTRING == pleaf->ptntype && C2_L_MPCRE == pleaf->match) { -#ifdef CONFIG_REGEX_PCRE - const char *error = NULL; - int erroffset = 0; - int options = 0; - - // Ignore case flag - if (pleaf->match_ignorecase) - options |= PCRE_CASELESS; - - // Compile PCRE expression - pleaf->regex_pcre = - pcre_compile(pleaf->ptnstr, options, &error, &erroffset, NULL); - if (!pleaf->regex_pcre) { - log_error("Pattern \"%s\": PCRE regular expression parsing " - "failed on " - "offset %d: %s", - pleaf->ptnstr, erroffset, error); - return false; - } -#ifdef CONFIG_REGEX_PCRE_JIT - pleaf->regex_pcre_extra = - pcre_study(pleaf->regex_pcre, PCRE_STUDY_JIT_COMPILE, &error); - if (!pleaf->regex_pcre_extra) { - printf("Pattern \"%s\": PCRE regular expression study failed: %s", - pleaf->ptnstr, error); - } -#endif - - // Free the target string - // free(pleaf->tgt); - // pleaf->tgt = NULL; -#else - log_error("PCRE regular expression support not compiled in."); - return false; -#endif - } - - return true; -} - -static bool c2_tree_postprocess(session_t *ps, c2_ptr_t node) { - if (!node.isbranch) { - return c2_l_postprocess(ps, node.l); - } - if (!c2_tree_postprocess(ps, node.b->opr1)) - return false; - return c2_tree_postprocess(ps, node.b->opr2); -} - -bool c2_list_postprocess(session_t *ps, c2_lptr_t *list) { - c2_lptr_t *head = list; - while (head) { - if (!c2_tree_postprocess(ps, head->ptr)) - return false; - head = head->next; - } - return true; -} -/** - * Free a condition tree. - */ -static void c2_free(c2_ptr_t p) { - // For a branch element - if (p.isbranch) { - c2_b_t *const pbranch = p.b; - - if (!pbranch) - return; - - c2_free(pbranch->opr1); - c2_free(pbranch->opr2); - free(pbranch); - } - // For a leaf element - else { - c2_l_t *const pleaf = p.l; - - if (!pleaf) - return; - - free(pleaf->tgt); - free(pleaf->ptnstr); -#ifdef CONFIG_REGEX_PCRE - pcre_free(pleaf->regex_pcre); - LPCRE_FREE_STUDY(pleaf->regex_pcre_extra); -#endif - free(pleaf); - } -} - -/** - * Free a condition tree in c2_lptr_t. - */ -c2_lptr_t *c2_free_lptr(c2_lptr_t *lp) { - if (!lp) - return NULL; - - c2_lptr_t *pnext = lp->next; - c2_free(lp->ptr); - free(lp); - - return pnext; -} - -/** - * Get a string representation of a rule target. - */ -static const char *c2h_dump_str_tgt(const c2_l_t *pleaf) { - if (pleaf->predef != C2_L_PUNDEFINED) { - return C2_PREDEFS[pleaf->predef].name; - } else { - return pleaf->tgt; - } -} - -/** - * Get a string representation of a target. - */ -static const char *c2h_dump_str_type(const c2_l_t *pleaf) { - switch (pleaf->type) { - case C2_L_TWINDOW: return "w"; - case C2_L_TDRAWABLE: return "d"; - case C2_L_TCARDINAL: return "c"; - case C2_L_TSTRING: return "s"; - case C2_L_TATOM: return "a"; - case C2_L_TUNDEFINED: break; - } - - return NULL; -} - -/** - * Dump a condition tree. - */ -static void c2_dump(c2_ptr_t p) { - // For a branch - if (p.isbranch) { - const c2_b_t *const pbranch = p.b; - - if (!pbranch) { - return; - } - - if (pbranch->neg) { - putchar('!'); - } - - printf("("); - c2_dump(pbranch->opr1); - - switch (pbranch->op) { - case C2_B_OAND: printf(" && "); break; - case C2_B_OOR: printf(" || "); break; - case C2_B_OXOR: printf(" XOR "); break; - default: assert(0); break; - } - - c2_dump(pbranch->opr2); - printf(") "); - } - // For a leaf - else { - const c2_l_t *const pleaf = p.l; - - if (!pleaf) { - return; - } - - if (C2_L_OEXISTS == pleaf->op && pleaf->neg) { - putchar('!'); - } - - // Print target name, type, and format - { - printf("%s", c2h_dump_str_tgt(pleaf)); - if (pleaf->tgt_onframe) { - putchar('@'); - } - if (pleaf->predef == C2_L_PUNDEFINED) { - if (pleaf->index < 0) { - printf("[*]"); - } else { - printf("[%d]", pleaf->index); - } - } - printf(":%d%s", pleaf->format, c2h_dump_str_type(pleaf)); - } - - // Print operator - putchar(' '); - - if (C2_L_OEXISTS != pleaf->op && pleaf->neg) { - putchar('!'); - } - - switch (pleaf->match) { - case C2_L_MEXACT: break; - case C2_L_MCONTAINS: putchar('*'); break; - case C2_L_MSTART: putchar('^'); break; - case C2_L_MPCRE: putchar('~'); break; - case C2_L_MWILDCARD: putchar('%'); break; - } - - if (pleaf->match_ignorecase) { - putchar('?'); - } - - switch (pleaf->op) { - case C2_L_OEXISTS: break; - case C2_L_OEQ: fputs("=", stdout); break; - case C2_L_OGT: fputs(">", stdout); break; - case C2_L_OGTEQ: fputs(">=", stdout); break; - case C2_L_OLT: fputs("<", stdout); break; - case C2_L_OLTEQ: fputs("<=", stdout); break; - } - - if (C2_L_OEXISTS == pleaf->op) { - return; - } - - // Print pattern - putchar(' '); - switch (pleaf->ptntype) { - case C2_L_PTINT: printf("%ld", pleaf->ptnint); break; - case C2_L_PTSTRING: - // TODO(yshui) Escape string before printing out? - printf("\"%s\"", pleaf->ptnstr); - break; - default: assert(0); break; - } - } -} - -/** - * Get the type atom of a condition. - */ -static xcb_atom_t c2_get_atom_type(const c2_l_t *pleaf) { - switch (pleaf->type) { - case C2_L_TCARDINAL: return XCB_ATOM_CARDINAL; - case C2_L_TWINDOW: return XCB_ATOM_WINDOW; - case C2_L_TSTRING: return XCB_ATOM_STRING; - case C2_L_TATOM: return XCB_ATOM_ATOM; - case C2_L_TDRAWABLE: return XCB_ATOM_DRAWABLE; - default: assert(0); break; - } - unreachable; -} - -/** - * Match a window against a single leaf window condition. - * - * For internal use. - */ -static inline void c2_match_once_leaf(session_t *ps, const struct managed_win *w, - const c2_l_t *pleaf, bool *pres, bool *perr) { - assert(pleaf); - - const xcb_window_t wid = (pleaf->tgt_onframe ? w->client_win : w->base.id); - - // Return if wid is missing - if (pleaf->predef == C2_L_PUNDEFINED && !wid) { - return; - } - - const int idx = (pleaf->index < 0 ? 0 : pleaf->index); - - switch (pleaf->ptntype) { - // Deal with integer patterns - case C2_L_PTINT: { - long long *targets = NULL; - long long *targets_free = NULL; - size_t ntargets = 0; - - // Get the value - // A predefined target - long long predef_target = 0; - if (pleaf->predef != C2_L_PUNDEFINED) { - *perr = false; - switch (pleaf->predef) { - case C2_L_PID: predef_target = wid; break; - case C2_L_PX: predef_target = w->g.x; break; - case C2_L_PY: predef_target = w->g.y; break; - case C2_L_PX2: predef_target = w->g.x + w->widthb; break; - case C2_L_PY2: predef_target = w->g.y + w->heightb; break; - case C2_L_PWIDTH: predef_target = w->g.width; break; - case C2_L_PHEIGHT: predef_target = w->g.height; break; - case C2_L_PWIDTHB: predef_target = w->widthb; break; - case C2_L_PHEIGHTB: predef_target = w->heightb; break; - case C2_L_PBDW: predef_target = w->g.border_width; break; - case C2_L_PFULLSCREEN: - predef_target = win_is_fullscreen(ps, w); - break; - case C2_L_POVREDIR: predef_target = w->a.override_redirect; break; - case C2_L_PARGB: predef_target = win_has_alpha(w); break; - case C2_L_PFOCUSED: - predef_target = win_is_focused_raw(ps, w); - break; - case C2_L_PWMWIN: predef_target = w->wmwin; break; - case C2_L_PBSHAPED: predef_target = w->bounding_shaped; break; - case C2_L_PROUNDED: predef_target = w->rounded_corners; break; - case C2_L_PCLIENT: predef_target = w->client_win; break; - case C2_L_PLEADER: predef_target = w->leader; break; - default: - *perr = true; - assert(0); - break; - } - ntargets = 1; - targets = &predef_target; - } - // A raw window property - else { - int word_count = 1; - if (pleaf->index < 0) { - // Get length of property in 32-bit multiples - auto prop_info = x_get_prop_info(ps->c, wid, pleaf->tgtatom); - word_count = to_int_checked((prop_info.length + 4 - 1) / 4); - } - winprop_t prop = x_get_prop_with_offset( - ps->c, wid, pleaf->tgtatom, idx, word_count, - c2_get_atom_type(pleaf), pleaf->format); - - ntargets = (pleaf->index < 0 ? prop.nitems : min2(prop.nitems, 1)); - if (ntargets > 0) { - targets = targets_free = ccalloc(ntargets, long long); - *perr = false; - for (size_t i = 0; i < ntargets; ++i) { - targets[i] = winprop_get_int(prop, i); - } - } - free_winprop(&prop); - } - - if (*perr) { - goto fail_int; - } - - // Do comparison - bool res = false; - for (size_t i = 0; i < ntargets; ++i) { - long long tgt = targets[i]; - switch (pleaf->op) { - case C2_L_OEXISTS: - res = (pleaf->predef != C2_L_PUNDEFINED ? tgt : true); - break; - case C2_L_OEQ: res = (tgt == pleaf->ptnint); break; - case C2_L_OGT: res = (tgt > pleaf->ptnint); break; - case C2_L_OGTEQ: res = (tgt >= pleaf->ptnint); break; - case C2_L_OLT: res = (tgt < pleaf->ptnint); break; - case C2_L_OLTEQ: res = (tgt <= pleaf->ptnint); break; - default: *perr = true; assert(0); - } - if (res) { - break; - } - } - *pres = res; - - fail_int: - // Free property values after usage, if necessary - if (targets_free) { - free(targets_free); - } - } break; - // String patterns - case C2_L_PTSTRING: { - const char **targets = NULL; - const char **targets_free = NULL; - const char **targets_free_inner = NULL; - size_t ntargets = 0; - - // A predefined target - const char *predef_target = NULL; - if (pleaf->predef != C2_L_PUNDEFINED) { - switch (pleaf->predef) { - case C2_L_PWINDOWTYPE: - predef_target = WINTYPES[w->window_type]; - break; - case C2_L_PNAME: predef_target = w->name; break; - case C2_L_PCLASSG: predef_target = w->class_general; break; - case C2_L_PCLASSI: predef_target = w->class_instance; break; - case C2_L_PROLE: predef_target = w->role; break; - default: assert(0); break; - } - ntargets = 1; - targets = &predef_target; - } - // An atom type property, convert it to string - else if (pleaf->type == C2_L_TATOM) { - int word_count = 1; - if (pleaf->index < 0) { - // Get length of property in 32-bit multiples - auto prop_info = x_get_prop_info(ps->c, wid, pleaf->tgtatom); - word_count = to_int_checked((prop_info.length + 4 - 1) / 4); - } - winprop_t prop = x_get_prop_with_offset( - ps->c, wid, pleaf->tgtatom, idx, word_count, - c2_get_atom_type(pleaf), pleaf->format); - - ntargets = (pleaf->index < 0 ? prop.nitems : min2(prop.nitems, 1)); - targets = targets_free = (const char **)ccalloc(2 * ntargets, char *); - targets_free_inner = targets + ntargets; - - for (size_t i = 0; i < ntargets; ++i) { - xcb_atom_t atom = (xcb_atom_t)winprop_get_int(prop, i); - if (atom) { - xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply( - ps->c, xcb_get_atom_name(ps->c, atom), NULL); - if (reply) { - targets[i] = targets_free_inner[i] = strndup( - xcb_get_atom_name_name(reply), - (size_t)xcb_get_atom_name_name_length(reply)); - free(reply); - } - } - } - free_winprop(&prop); - } - // Not an atom type, just fetch the string list - else { - char **strlst = NULL; - int nstr = 0; - if (wid_get_text_prop(ps, wid, pleaf->tgtatom, &strlst, &nstr)) { - if (pleaf->index < 0 && nstr > 0 && strlen(strlst[0]) > 0) { - ntargets = to_u32_checked(nstr); - targets = (const char **)strlst; - } else if (nstr > idx) { - ntargets = 1; - targets = (const char **)strlst + idx; - } - } - if (strlst) { - targets_free = (const char **)strlst; - } - } - - if (ntargets == 0) { - goto fail_str; - } - for (size_t i = 0; i < ntargets; ++i) { - if (!targets[i]) { - goto fail_str; - } - } - *perr = false; - - // Actual matching - bool res = false; - for (size_t i = 0; i < ntargets; ++i) { - const char *tgt = targets[i]; - switch (pleaf->op) { - case C2_L_OEXISTS: res = true; break; - case C2_L_OEQ: - switch (pleaf->match) { - case C2_L_MEXACT: - if (pleaf->match_ignorecase) { - res = !strcasecmp(tgt, pleaf->ptnstr); - } else { - res = !strcmp(tgt, pleaf->ptnstr); - } - break; - case C2_L_MCONTAINS: - if (pleaf->match_ignorecase) { - res = strcasestr(tgt, pleaf->ptnstr); - } else { - res = strstr(tgt, pleaf->ptnstr); - } - break; - case C2_L_MSTART: - if (pleaf->match_ignorecase) { - res = !strncasecmp(tgt, pleaf->ptnstr, - strlen(pleaf->ptnstr)); - } else { - res = !strncmp(tgt, pleaf->ptnstr, - strlen(pleaf->ptnstr)); - } - break; - case C2_L_MWILDCARD: { - int flags = 0; - if (pleaf->match_ignorecase) { - flags |= FNM_CASEFOLD; - } - res = !fnmatch(pleaf->ptnstr, tgt, flags); - } break; - case C2_L_MPCRE: -#ifdef CONFIG_REGEX_PCRE - assert(strlen(tgt) <= INT_MAX); - res = (pcre_exec(pleaf->regex_pcre, - pleaf->regex_pcre_extra, tgt, - (int)strlen(tgt), 0, 0, NULL, 0) >= 0); -#else - assert(0); -#endif - break; - } - break; - default: *perr = true; assert(0); - } - if (res) { - break; - } - } - *pres = res; - - fail_str: - // Free the string after usage, if necessary - if (targets_free_inner) { - for (size_t i = 0; i < ntargets; ++i) { - if (targets_free_inner[i]) { - free((void *)targets_free_inner[i]); - } - } - } - // Free property values after usage, if necessary - if (targets_free) { - free(targets_free); - } - } break; - default: assert(0); break; - } -} - -/** - * Match a window against a single window condition. - * - * @return true if matched, false otherwise. - */ -static bool c2_match_once(session_t *ps, const struct managed_win *w, const c2_ptr_t cond) { - bool result = false; - bool error = true; - - // Handle a branch - if (cond.isbranch) { - const c2_b_t *pb = cond.b; - - if (!pb) - return false; - - error = false; - - switch (pb->op) { - case C2_B_OAND: - result = (c2_match_once(ps, w, pb->opr1) && - c2_match_once(ps, w, pb->opr2)); - break; - case C2_B_OOR: - result = (c2_match_once(ps, w, pb->opr1) || - c2_match_once(ps, w, pb->opr2)); - break; - case C2_B_OXOR: - result = (c2_match_once(ps, w, pb->opr1) != - c2_match_once(ps, w, pb->opr2)); - break; - default: error = true; assert(0); - } - -#ifdef DEBUG_WINMATCH - log_trace("(%#010x): branch: result = %d, pattern = ", w->base.id, result); - c2_dump(cond); - putchar('\n'); -#endif - } - // Handle a leaf - else { - const c2_l_t *pleaf = cond.l; - - if (!pleaf) - return false; - - c2_match_once_leaf(ps, w, pleaf, &result, &error); - - // For EXISTS operator, no errors are fatal - if (C2_L_OEXISTS == pleaf->op && error) { - result = false; - error = false; - } - -#ifdef DEBUG_WINMATCH - log_trace("(%#010x): leaf: result = %d, error = %d, " - "client = %#010x, pattern = ", - w->base.id, result, error, w->client_win); - c2_dump(cond); - putchar('\n'); -#endif - } - - // Postprocess the result - if (error) - result = false; - - if (cond.isbranch ? cond.b->neg : cond.l->neg) - result = !result; - - return result; -} - -/** - * Match a window against a condition linked list. - * - * @param cache a place to cache the last matched condition - * @param pdata a place to return the data - * @return true if matched, false otherwise. - */ -bool c2_match(session_t *ps, const struct managed_win *w, const c2_lptr_t *condlst, - void **pdata) { - assert(ps->server_grabbed); - // Then go through the whole linked list - for (; condlst; condlst = condlst->next) { - if (c2_match_once(ps, w, condlst->ptr)) { - if (pdata) - *pdata = condlst->data; - return true; - } - } - - return false; -} diff --git a/dwm/picom/src/c2.h b/dwm/picom/src/c2.h deleted file mode 100644 index d6b1d37..0000000 --- a/dwm/picom/src/c2.h +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#pragma once - -#include - -typedef struct _c2_lptr c2_lptr_t; -typedef struct session session_t; -struct managed_win; - -c2_lptr_t *c2_parse(c2_lptr_t **pcondlst, const char *pattern, void *data); - -c2_lptr_t *c2_free_lptr(c2_lptr_t *lp); - -bool c2_match(session_t *ps, const struct managed_win *w, const c2_lptr_t *condlst, void **pdata); - -bool c2_list_postprocess(session_t *ps, c2_lptr_t *list); diff --git a/dwm/picom/src/cache.c b/dwm/picom/src/cache.c deleted file mode 100644 index 1ffb31c..0000000 --- a/dwm/picom/src/cache.c +++ /dev/null @@ -1,95 +0,0 @@ -#include - -#include "compiler.h" -#include "utils.h" -#include "cache.h" - -struct cache_entry { - char *key; - void *value; - UT_hash_handle hh; -}; - -struct cache { - cache_getter_t getter; - cache_free_t free; - void *user_data; - struct cache_entry *entries; -}; - -void cache_set(struct cache *c, const char *key, void *data) { - struct cache_entry *e = NULL; - HASH_FIND_STR(c->entries, key, e); - CHECK(!e); - - e = ccalloc(1, struct cache_entry); - e->key = strdup(key); - e->value = data; - HASH_ADD_STR(c->entries, key, e); -} - -void *cache_get(struct cache *c, const char *key, int *err) { - struct cache_entry *e; - HASH_FIND_STR(c->entries, key, e); - if (e) { - return e->value; - } - - int tmperr; - if (!err) { - err = &tmperr; - } - - *err = 0; - e = ccalloc(1, struct cache_entry); - e->key = strdup(key); - e->value = c->getter(c->user_data, key, err); - if (*err) { - free(e->key); - free(e); - return NULL; - } - - HASH_ADD_STR(c->entries, key, e); - return e->value; -} - -static inline void _cache_invalidate(struct cache *c, struct cache_entry *e) { - if (c->free) { - c->free(c->user_data, e->value); - } - free(e->key); - HASH_DEL(c->entries, e); - free(e); -} - -void cache_invalidate(struct cache *c, const char *key) { - struct cache_entry *e; - HASH_FIND_STR(c->entries, key, e); - - if (e) { - _cache_invalidate(c, e); - } -} - -void cache_invalidate_all(struct cache *c) { - struct cache_entry *e, *tmpe; - HASH_ITER(hh, c->entries, e, tmpe) { - _cache_invalidate(c, e); - } -} - -void *cache_free(struct cache *c) { - void *ret = c->user_data; - cache_invalidate_all(c); - free(c); - return ret; -} - -struct cache *new_cache(void *ud, cache_getter_t getter, cache_free_t f) { - auto c = ccalloc(1, struct cache); - c->user_data = ud; - c->getter = getter; - c->free = f; - return c; -} diff --git a/dwm/picom/src/cache.h b/dwm/picom/src/cache.h deleted file mode 100644 index 3ca054f..0000000 --- a/dwm/picom/src/cache.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -struct cache; - -typedef void *(*cache_getter_t)(void *user_data, const char *key, int *err); -typedef void (*cache_free_t)(void *user_data, void *data); - -/// Create a cache with `getter`, and a free function `f` which is used to free the cache -/// value when they are invalidated. -/// -/// `user_data` will be passed to `getter` and `f` when they are called. -struct cache *new_cache(void *user_data, cache_getter_t getter, cache_free_t f); - -/// Fetch a value from the cache. If the value doesn't present in the cache yet, the -/// getter will be called, and the returned value will be stored into the cache. -void *cache_get(struct cache *, const char *key, int *err); - -/// Invalidate a value in the cache. -void cache_invalidate(struct cache *, const char *key); - -/// Invalidate all values in the cache. -void cache_invalidate_all(struct cache *); - -/// Invalidate all values in the cache and free it. Returns the user data passed to -/// `new_cache` -void *cache_free(struct cache *); - -/// Insert a key-value pair into the cache. Only used for internal testing. Takes -/// ownership of `data` -/// -/// If `key` already exists in the cache, this function will abort the program. -void cache_set(struct cache *c, const char *key, void *data); diff --git a/dwm/picom/src/common.h b/dwm/picom/src/common.h deleted file mode 100644 index d5dda60..0000000 --- a/dwm/picom/src/common.h +++ /dev/null @@ -1,534 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * Copyright (c) 2018, Yuxuan Shui - * - * See LICENSE-mit for more information. - * - */ - -#pragma once - -// === Options === - -// Debug options, enable them using -D in CFLAGS -// #define DEBUG_REPAINT 1 -// #define DEBUG_EVENTS 1 -// #define DEBUG_RESTACK 1 -// #define DEBUG_WINMATCH 1 -// #define DEBUG_C2 1 -// #define DEBUG_GLX_DEBUG_CONTEXT 1 - -#define MAX_ALPHA (255) - -// === Includes === - -// For some special functions -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "uthash_extra.h" -#ifdef CONFIG_OPENGL -#include "backend/gl/glx.h" -#endif - -// X resource checker -#ifdef DEBUG_XRC -#include "xrescheck.h" -#endif - -// FIXME This list of includes should get shorter -#include "backend/backend.h" -#include "backend/driver.h" -#include "compiler.h" -#include "config.h" -#include "region.h" -#include "types.h" -#include "utils.h" -#include "list.h" -#include "render.h" -#include "win_defs.h" -#include "x.h" - -// === Constants ===0 - -#define NS_PER_SEC 1000000000L -#define US_PER_SEC 1000000L -#define MS_PER_SEC 1000 - -/// @brief Maximum OpenGL FBConfig depth. -#define OPENGL_MAX_DEPTH 32 - -/// @brief Maximum OpenGL buffer age. -#define CGLX_MAX_BUFFER_AGE 5 - -// Window flags - -// === Types === -typedef struct glx_fbconfig glx_fbconfig_t; -struct glx_session; -struct atom; -struct conv; - -typedef struct _ignore { - struct _ignore *next; - unsigned long sequence; -} ignore_t; - -#ifdef CONFIG_OPENGL -#ifdef DEBUG_GLX_DEBUG_CONTEXT -typedef GLXContext (*f_glXCreateContextAttribsARB)(Display *dpy, GLXFBConfig config, - GLXContext share_context, Bool direct, - const int *attrib_list); -typedef void (*GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, - GLsizei length, const GLchar *message, GLvoid *userParam); -typedef void (*f_DebugMessageCallback)(GLDEBUGPROC, void *userParam); -#endif - -typedef struct glx_prog_main { - /// GLSL program. - GLuint prog; - /// Location of uniform "opacity" in window GLSL program. - GLint unifm_opacity; - /// Location of uniform "invert_color" in blur GLSL program. - GLint unifm_invert_color; - /// Location of uniform "tex" in window GLSL program. - GLint unifm_tex; - /// Location of uniform "time" in window GLSL program. - GLint unifm_time; -} glx_prog_main_t; - -#define GLX_PROG_MAIN_INIT \ - { \ - .prog = 0, .unifm_opacity = -1, .unifm_invert_color = -1, \ - .unifm_tex = -1, .unifm_time = -1 \ - } - -#else -struct glx_prog_main {}; -#endif - -#define PAINT_INIT \ - { .pixmap = XCB_NONE, .pict = XCB_NONE } - -/// Linked list type of atoms. -typedef struct _latom { - xcb_atom_t atom; - struct _latom *next; -} latom_t; - -/// Structure containing all necessary data for a session. -typedef struct session { - // === Event handlers === - /// ev_io for X connection - ev_io xiow; - /// Timeout for delayed unredirection. - ev_timer unredir_timer; - /// Timer for fading - ev_timer fade_timer; - /// Timer for animations - ev_timer animation_timer; - /// Use an ev_idle callback for drawing - /// So we only start drawing when events are processed - ev_idle draw_idle; - /// Called everytime we have timeouts or new data on socket, - /// so we can be sure if xcb read from X socket at anytime during event - /// handling, we will not left any event unhandled in the queue - ev_prepare event_check; - /// Signal handler for SIGUSR1 - ev_signal usr1_signal; - /// Signal handler for SIGINT - ev_signal int_signal; - /// backend data - backend_t *backend_data; - /// backend blur context - void *backend_blur_context; - /// graphic drivers used - enum driver drivers; - /// file watch handle - void *file_watch_handle; - /// libev mainloop - struct ev_loop *loop; - - // === Display related === - /// Whether the X server is grabbed by us - bool server_grabbed; - /// Display in use. - Display *dpy; - /// Previous handler of X errors - XErrorHandler previous_xerror_handler; - /// Default screen. - int scr; - /// XCB connection. - xcb_connection_t *c; - /// Default visual. - xcb_visualid_t vis; - /// Default depth. - int depth; - /// Root window. - xcb_window_t root; - /// Height of root window. - int root_height; - /// Width of root window. - int root_width; - /// Current desktop number of root window - int root_desktop_num; - /// Desktop switch direction - int root_desktop_switch_direction; - // Damage of root window. - // Damage root_damage; - /// X Composite overlay window. - xcb_window_t overlay; - /// The target window for debug mode - xcb_window_t debug_window; - /// Whether the root tile is filled by us. - bool root_tile_fill; - /// Picture of the root window background. - paint_t root_tile_paint; - /// The backend data the root pixmap bound to - void *root_image; - /// A region of the size of the screen. - region_t screen_reg; - /// Picture of root window. Destination of painting in no-DBE painting - /// mode. - xcb_render_picture_t root_picture; - /// A Picture acting as the painting target. - xcb_render_picture_t tgt_picture; - /// Temporary buffer to paint to before sending to display. - paint_t tgt_buffer; - /// Window ID of the window we register as a symbol. - xcb_window_t reg_win; -#ifdef CONFIG_OPENGL - /// Pointer to GLX data. - struct glx_session *psglx; - /// Custom GLX program used for painting window. - // XXX should be in struct glx_session - glx_prog_main_t glx_prog_win; - struct glx_fbconfig_info *argb_fbconfig; -#endif - /// Sync fence to sync draw operations - xcb_sync_fence_t sync_fence; - /// Whether we are rendering the first frame after screen is redirected - bool first_frame; - - // === Operation related === - /// Flags related to the root window - uint64_t root_flags; - /// Program options. - options_t o; - /// Whether we have hit unredirection timeout. - bool tmout_unredir_hit; - /// Whether we need to redraw the screen - bool redraw_needed; - - /// Cache a xfixes region so we don't need to allocate it everytime. - /// A workaround for yshui/picom#301 - xcb_xfixes_region_t damaged_region; - /// The region needs to painted on next paint. - region_t *damage; - /// The region damaged on the last paint. - region_t *damage_ring; - /// Number of damage regions we track - int ndamage; - /// Whether all windows are currently redirected. - bool redirected; - /// Pre-generated alpha pictures. - xcb_render_picture_t *alpha_picts; - /// Time of last fading. In milliseconds. - long long fade_time; - /// Time of last window animation step. In milliseconds. - long animation_time; // TODO(dccsillag) turn into `long long`, like fade_time - /// Head pointer of the error ignore linked list. - ignore_t *ignore_head; - /// Pointer to the next member of tail element of the error - /// ignore linked list. - ignore_t **ignore_tail; - // Cached blur convolution kernels. - struct x_convolution_kernel **blur_kerns_cache; - /// If we should quit - bool quit:1; - // TODO(yshui) use separate flags for dfferent kinds of updates so we don't - // waste our time. - /// Whether there are pending updates, like window creation, etc. - bool pending_updates:1; - - // === Expose event related === - /// Pointer to an array of XRectangle-s of exposed region. - /// XXX why do we need this array? - rect_t *expose_rects; - /// Number of XRectangle-s in expose_rects. - int size_expose; - /// Index of the next free slot in expose_rects. - int n_expose; - - // === Window related === - /// A hash table of all windows. - struct win *windows; - /// Windows in their stacking order - struct list_node window_stack; - /// Pointer to win of current active window. Used by - /// EWMH _NET_ACTIVE_WINDOW focus detection. In theory, - /// it's more reliable to store the window ID directly here, just in - /// case the WM does something extraordinary, but caching the pointer - /// means another layer of complexity. - struct managed_win *active_win; - /// Window ID of leader window of currently active window. Used for - /// subsidiary window detection. - xcb_window_t active_leader; - - // === Shadow/dimming related === - /// 1x1 black Picture. - xcb_render_picture_t black_picture; - /// 1x1 Picture of the shadow color. - xcb_render_picture_t cshadow_picture; - /// 1x1 white Picture. - xcb_render_picture_t white_picture; - /// Gaussian map of shadow. - struct conv *gaussian_map; - // for shadow precomputation - /// A region in which shadow is not painted on. - region_t shadow_exclude_reg; - - // === Software-optimization-related === - /// Nanosecond offset of the first painting. - long paint_tm_offset; - -#ifdef CONFIG_VSYNC_DRM - // === DRM VSync related === - /// File descriptor of DRI device file. Used for DRM VSync. - int drm_fd; -#endif - - // === X extension related === - /// Event base number for X Fixes extension. - int xfixes_event; - /// Error base number for X Fixes extension. - int xfixes_error; - /// Event base number for X Damage extension. - int damage_event; - /// Error base number for X Damage extension. - int damage_error; - /// Event base number for X Render extension. - int render_event; - /// Error base number for X Render extension. - int render_error; - /// Event base number for X Composite extension. - int composite_event; - /// Error base number for X Composite extension. - int composite_error; - /// Major opcode for X Composite extension. - int composite_opcode; - /// Whether X Shape extension exists. - bool shape_exists; - /// Event base number for X Shape extension. - int shape_event; - /// Error base number for X Shape extension. - int shape_error; - /// Whether X RandR extension exists. - bool randr_exists; - /// Event base number for X RandR extension. - int randr_event; - /// Error base number for X RandR extension. - int randr_error; - /// Whether X Present extension exists. - bool present_exists; - /// Whether X GLX extension exists. - bool glx_exists; - /// Event base number for X GLX extension. - int glx_event; - /// Error base number for X GLX extension. - int glx_error; - /// Whether X Xinerama extension exists. - bool xinerama_exists; - /// Xinerama screen regions. - region_t *xinerama_scr_regs; - /// Number of Xinerama screens. - int xinerama_nscrs; - /// Whether X Sync extension exists. - bool xsync_exists; - /// Event base number for X Sync extension. - int xsync_event; - /// Error base number for X Sync extension. - int xsync_error; - /// Whether X Render convolution filter exists. - bool xrfilter_convolution_exists; - - // === Atoms === - struct atom *atoms; - /// Array of atoms of all possible window types. - xcb_atom_t atoms_wintypes[NUM_WINTYPES]; - /// Linked list of additional atoms to track. - latom_t *track_atom_lst; - -#ifdef CONFIG_DBUS - // === DBus related === - void *dbus_data; -#endif - - int (*vsync_wait)(session_t *); -} session_t; - -/// Enumeration for window event hints. -typedef enum { WIN_EVMODE_UNKNOWN, WIN_EVMODE_FRAME, WIN_EVMODE_CLIENT } win_evmode_t; - -extern const char *const WINTYPES[NUM_WINTYPES]; -extern session_t *ps_g; - -void ev_xcb_error(session_t *ps, xcb_generic_error_t *err); - -// === Functions === - -/** - * Subtracting two struct timespec values. - * - * Taken from glibc manual. - * - * Subtract the `struct timespec' values X and Y, - * storing the result in RESULT. - * Return 1 if the difference is negative, otherwise 0. - */ -static inline int -timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y) { - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_nsec < y->tv_nsec) { - long nsec = (y->tv_nsec - x->tv_nsec) / NS_PER_SEC + 1; - y->tv_nsec -= NS_PER_SEC * nsec; - y->tv_sec += nsec; - } - - if (x->tv_nsec - y->tv_nsec > NS_PER_SEC) { - long nsec = (x->tv_nsec - y->tv_nsec) / NS_PER_SEC; - y->tv_nsec += NS_PER_SEC * nsec; - y->tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - tv_nsec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_nsec = x->tv_nsec - y->tv_nsec; - - /* Return 1 if result is negative. */ - return x->tv_sec < y->tv_sec; -} - -/** - * Get current time in struct timeval. - */ -static inline struct timeval get_time_timeval(void) { - struct timeval tv = {0, 0}; - - gettimeofday(&tv, NULL); - - // Return a time of all 0 if the call fails - return tv; -} - -/** - * Get current time in struct timespec. - * - * Note its starting time is unspecified. - */ -static inline struct timespec get_time_timespec(void) { - struct timespec tm = {0, 0}; - - clock_gettime(CLOCK_MONOTONIC, &tm); - - // Return a time of all 0 if the call fails - return tm; -} - -/** - * Return the painting target window. - */ -static inline xcb_window_t get_tgt_window(session_t *ps) { - return ps->overlay != XCB_NONE ? ps->overlay : ps->root; -} - -/** - * Check if current backend uses GLX. - */ -static inline bool bkend_use_glx(session_t *ps) { - return BKEND_GLX == ps->o.backend || BKEND_XR_GLX_HYBRID == ps->o.backend; -} - -static void set_ignore(session_t *ps, unsigned long sequence) { - if (ps->o.show_all_xerrors) - return; - - auto i = cmalloc(ignore_t); - if (!i) - return; - - i->sequence = sequence; - i->next = 0; - *ps->ignore_tail = i; - ps->ignore_tail = &i->next; -} - -/** - * Ignore X errors caused by given X request. - */ -static inline void set_ignore_cookie(session_t *ps, xcb_void_cookie_t cookie) { - set_ignore(ps, cookie.sequence); -} - -/** - * Determine if a window has a specific property. - * - * @param ps current session - * @param w window to check - * @param atom atom of property to check - * @return true if it has the attribute, false otherwise - */ -static inline bool wid_has_prop(const session_t *ps, xcb_window_t w, xcb_atom_t atom) { - auto r = xcb_get_property_reply( - ps->c, xcb_get_property(ps->c, 0, w, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, 0), NULL); - if (!r) { - return false; - } - - auto rtype = r->type; - free(r); - - if (rtype != XCB_NONE) { - return true; - } - return false; -} - -void force_repaint(session_t *ps); - -/** @name DBus handling - */ -///@{ -#ifdef CONFIG_DBUS -/** @name DBus hooks - */ -///@{ -void opts_set_no_fading_openclose(session_t *ps, bool newval); -//!@} -#endif - -/** - * Set a bool array of all wintypes to true. - */ -static inline void wintype_arr_enable(bool arr[]) { - wintype_t i; - - for (i = 0; i < NUM_WINTYPES; ++i) { - arr[i] = true; - } -} diff --git a/dwm/picom/src/compiler.h b/dwm/picom/src/compiler.h deleted file mode 100644 index f146bd2..0000000 --- a/dwm/picom/src/compiler.h +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui -#pragma once - -#ifdef HAS_STDC_PREDEF_H -#include -#endif - -// clang-format off -#define auto __auto_type -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#define likely_if(x) if (likely(x)) -#define unlikely_if(x) if (unlikely(x)) - -#ifndef __has_attribute -# if __GNUC__ >= 4 -# define __has_attribute(x) 1 -# else -# define __has_attribute(x) 0 -# endif -#endif - -#if __has_attribute(const) -# define attr_const __attribute__((const)) -#else -# define attr_const -#endif - -#if __has_attribute(format) -# define attr_printf(a, b) __attribute__((format(printf, a, b))) -#else -# define attr_printf(a, b) -#endif - -#if __has_attribute(pure) -# define attr_pure __attribute__((pure)) -#else -# define attr_pure -#endif - -#if __has_attribute(unused) -# define attr_unused __attribute__((unused)) -#else -# define attr_unused -#endif - -#if __has_attribute(warn_unused_result) -# define attr_warn_unused_result __attribute__((warn_unused_result)) -#else -# define attr_warn_unused_result -#endif -// An alias for conveninence -#define must_use attr_warn_unused_result - -#if __has_attribute(nonnull) -# define attr_nonnull(...) __attribute__((nonnull(__VA_ARGS__))) -# define attr_nonnull_all __attribute__((nonnull)) -#else -# define attr_nonnull(...) -# define attr_nonnull_all -#endif - -#if __has_attribute(returns_nonnull) -# define attr_ret_nonnull __attribute__((returns_nonnull)) -#else -# define attr_ret_nonnull -#endif - -#if __has_attribute(deprecated) -# define attr_deprecated __attribute__((deprecated)) -#else -# define attr_deprecated -#endif - -#if __has_attribute(malloc) -# define attr_malloc __attribute__((malloc)) -#else -# define attr_malloc -#endif - -#if __has_attribute(fallthrough) -# define fallthrough() __attribute__((fallthrough)) -#else -# define fallthrough() -#endif - -#if __STDC_VERSION__ >= 201112L -# define attr_noret _Noreturn -#else -# if __has_attribute(noreturn) -# define attr_noret __attribute__((noreturn)) -# else -# define attr_noret -# endif -#endif - -#if defined(__GNUC__) || defined(__clang__) -# define unreachable __builtin_unreachable() -#else -# define unreachable do {} while(0) -#endif - -#ifndef __has_include -# define __has_include(x) 0 -#endif - -#if !defined(__STDC_NO_THREADS__) && __has_include() -# include -#elif __STDC_VERSION__ >= 201112L -# define thread_local _Thread_local -#elif defined(__GNUC__) || defined(__clang__) -# define thread_local __thread -#else -# define thread_local _Pragma("GCC error \"No thread local storage support\"") __error__ -#endif -// clang-format on - -typedef unsigned long ulong; -typedef unsigned int uint; - -static inline int attr_const popcntul(unsigned long a) { - return __builtin_popcountl(a); -} diff --git a/dwm/picom/src/config.c b/dwm/picom/src/config.c deleted file mode 100644 index 5b814cc..0000000 --- a/dwm/picom/src/config.c +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2011-2013, Christopher Jeffrey -// Copyright (c) 2013 Richard Grenville - -#include -#include -#include -#include -#include -#include -#include // for xcb_render_fixed_t, XXX - -#include "c2.h" -#include "common.h" -#include "compiler.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "string_utils.h" -#include "types.h" -#include "utils.h" -#include "win.h" - -#include "config.h" - -/** - * Parse a long number. - */ -bool parse_long(const char *s, long *dest) { - const char *endptr = NULL; - long val = strtol(s, (char **)&endptr, 0); - if (!endptr || endptr == s) { - log_error("Invalid number: %s", s); - return false; - } - while (isspace((unsigned char)*endptr)) - ++endptr; - if (*endptr) { - log_error("Trailing characters: %s", s); - return false; - } - *dest = val; - return true; -} - -/** - * Parse an int number. - */ -bool parse_int(const char *s, int *dest) { - long val; - if (!parse_long(s, &val)) { - return false; - } - if (val > INT_MAX || val < INT_MIN) { - log_error("Number exceeded int limits: %ld", val); - return false; - } - *dest = (int)val; - return true; -} - -/** - * Parse a floating-point number in from a string, - * also strips the trailing space and comma after the number. - * - * @param[in] src string to parse - * @param[out] dest return the number parsed from the string - * @return pointer to the last character parsed - */ -const char *parse_readnum(const char *src, double *dest) { - const char *pc = NULL; - double val = strtod_simple(src, &pc); - if (!pc || pc == src) { - log_error("No number found: %s", src); - return src; - } - while (*pc && (isspace((unsigned char)*pc) || *pc == ',')) { - ++pc; - } - *dest = val; - return pc; -} - -enum blur_method parse_blur_method(const char *src) { - if (strcmp(src, "kernel") == 0) { - return BLUR_METHOD_KERNEL; - } else if (strcmp(src, "box") == 0) { - return BLUR_METHOD_BOX; - } else if (strcmp(src, "gaussian") == 0) { - return BLUR_METHOD_GAUSSIAN; - } else if (strcmp(src, "dual_kawase") == 0) { - return BLUR_METHOD_DUAL_KAWASE; - } else if (strcmp(src, "kawase") == 0) { - log_warn("Blur method 'kawase' has been renamed to 'dual_kawase'. " - "Interpreted as 'dual_kawase', but this will stop working " - "soon."); - return BLUR_METHOD_DUAL_KAWASE; - } else if (strcmp(src, "none") == 0) { - return BLUR_METHOD_NONE; - } - return BLUR_METHOD_INVALID; -} - -/** - * Parse a matrix. - * - * @param[in] src the blur kernel string - * @param[out] endptr return where the end of kernel is in the string - * @param[out] hasneg whether the kernel has negative values - */ -conv *parse_blur_kern(const char *src, const char **endptr, bool *hasneg) { - int width = 0, height = 0; - *hasneg = false; - - const char *pc = NULL; - - // Get matrix width and height - double val = 0.0; - if (src == (pc = parse_readnum(src, &val))) - goto err1; - src = pc; - width = (int)val; - if (src == (pc = parse_readnum(src, &val))) - goto err1; - src = pc; - height = (int)val; - - // Validate matrix width and height - if (width <= 0 || height <= 0) { - log_error("Blue kernel width/height can't be negative."); - goto err1; - } - if (!(width % 2 && height % 2)) { - log_error("Blur kernel width/height must be odd."); - goto err1; - } - if (width > 16 || height > 16) - log_warn("Blur kernel width/height too large, may slow down" - "rendering, and/or consume lots of memory"); - - // Allocate memory - conv *matrix = cvalloc(sizeof(conv) + (size_t)(width * height) * sizeof(double)); - - // Read elements - int skip = height / 2 * width + width / 2; - for (int i = 0; i < width * height; ++i) { - // Ignore the center element - if (i == skip) { - matrix->data[i] = 1; - continue; - } - if (src == (pc = parse_readnum(src, &val))) { - goto err2; - } - src = pc; - if (val < 0) { - *hasneg = true; - } - matrix->data[i] = val; - } - - // Detect trailing characters - for (; *pc && *pc != ';'; pc++) { - if (!isspace((unsigned char)*pc) && *pc != ',') { - // TODO(yshui) isspace is locale aware, be careful - log_error("Trailing characters in blur kernel string."); - goto err2; - } - } - - // Jump over spaces after ';' - if (*pc == ';') { - pc++; - while (*pc && isspace((unsigned char)*pc)) { - ++pc; - } - } - - // Require an end of string if endptr is not provided, otherwise - // copy end pointer to endptr - if (endptr) { - *endptr = pc; - } else if (*pc) { - log_error("Only one blur kernel expected."); - goto err2; - } - - // Fill in width and height - matrix->w = width; - matrix->h = height; - return matrix; - -err2: - free(matrix); -err1: - return NULL; -} - -/** - * Parse a list of convolution kernels. - * - * @param[in] src string to parse - * @param[out] hasneg whether any of the kernels have negative values - * @return the kernels - */ -struct conv **parse_blur_kern_lst(const char *src, bool *hasneg, int *count) { - // TODO(yshui) just return a predefined kernels, not parse predefined strings... - static const struct { - const char *name; - const char *kern_str; - } CONV_KERN_PREDEF[] = { - {"3x3box", "3,3,1,1,1,1,1,1,1,1,"}, - {"5x5box", "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"}, - {"7x7box", "7,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1," - "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"}, - {"3x3gaussian", "3,3,0.243117,0.493069,0.243117,0.493069,0.493069,0.243117,0." - "493069,0.243117,"}, - {"5x5gaussian", "5,5,0.003493,0.029143,0.059106,0.029143,0.003493,0.029143,0." - "243117,0.493069,0.243117,0.029143,0.059106,0.493069,0." - "493069,0.059106,0.029143,0.243117,0.493069,0.243117,0." - "029143,0.003493,0.029143,0.059106,0.029143,0.003493,"}, - {"7x7gaussian", "7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0." - "000003,0.000102,0.003493,0.029143,0.059106,0.029143,0." - "003493,0.000102,0.000849,0.029143,0.243117,0.493069,0." - "243117,0.029143,0.000849,0.001723,0.059106,0.493069,0." - "493069,0.059106,0.001723,0.000849,0.029143,0.243117,0." - "493069,0.243117,0.029143,0.000849,0.000102,0.003493,0." - "029143,0.059106,0.029143,0.003493,0.000102,0.000003,0." - "000102,0.000849,0.001723,0.000849,0.000102,0.000003,"}, - {"9x9gaussian", - "9,9,0.000000,0.000000,0.000001,0.000006,0.000012,0.000006,0.000001,0." - "000000,0.000000,0.000000,0.000003,0.000102,0.000849,0.001723,0.000849,0." - "000102,0.000003,0.000000,0.000001,0.000102,0.003493,0.029143,0.059106,0." - "029143,0.003493,0.000102,0.000001,0.000006,0.000849,0.029143,0.243117,0." - "493069,0.243117,0.029143,0.000849,0.000006,0.000012,0.001723,0.059106,0." - "493069,0.493069,0.059106,0.001723,0.000012,0.000006,0.000849,0.029143,0." - "243117,0.493069,0.243117,0.029143,0.000849,0.000006,0.000001,0.000102,0." - "003493,0.029143,0.059106,0.029143,0.003493,0.000102,0.000001,0.000000,0." - "000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0.000000,0." - "000000,0.000000,0.000001,0.000006,0.000012,0.000006,0.000001,0.000000,0." - "000000,"}, - {"11x11gaussian", - "11,11,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0." - "000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000001,0." - "000006,0.000012,0.000006,0.000001,0.000000,0.000000,0.000000,0.000000,0." - "000000,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0." - "000000,0.000000,0.000000,0.000001,0.000102,0.003493,0.029143,0.059106,0." - "029143,0.003493,0.000102,0.000001,0.000000,0.000000,0.000006,0.000849,0." - "029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.000006,0.000000,0." - "000000,0.000012,0.001723,0.059106,0.493069,0.493069,0.059106,0.001723,0." - "000012,0.000000,0.000000,0.000006,0.000849,0.029143,0.243117,0.493069,0." - "243117,0.029143,0.000849,0.000006,0.000000,0.000000,0.000001,0.000102,0." - "003493,0.029143,0.059106,0.029143,0.003493,0.000102,0.000001,0.000000,0." - "000000,0.000000,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0." - "000003,0.000000,0.000000,0.000000,0.000000,0.000000,0.000001,0.000006,0." - "000012,0.000006,0.000001,0.000000,0.000000,0.000000,0.000000,0.000000,0." - "000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0." - "000000,"}, - }; - - *count = 0; - *hasneg = false; - for (unsigned int i = 0; - i < sizeof(CONV_KERN_PREDEF) / sizeof(CONV_KERN_PREDEF[0]); ++i) { - if (!strcmp(CONV_KERN_PREDEF[i].name, src)) - return parse_blur_kern_lst(CONV_KERN_PREDEF[i].kern_str, hasneg, count); - } - - int nkernels = 1; - for (int i = 0; src[i]; i++) { - if (src[i] == ';') { - nkernels++; - } - } - - struct conv **ret = ccalloc(nkernels, struct conv *); - - int i = 0; - const char *pc = src; - - // Continue parsing until the end of source string - i = 0; - while (pc && *pc) { - bool tmp_hasneg; - assert(i < nkernels); - ret[i] = parse_blur_kern(pc, &pc, &tmp_hasneg); - if (!ret[i]) { - for (int j = 0; j < i; j++) { - free(ret[j]); - } - free(ret); - return NULL; - } - i++; - *hasneg |= tmp_hasneg; - } - - if (i > 1) { - log_warn("You are seeing this message because you are using " - "multipass blur. Please report an issue to us so we know " - "multipass blur is actually been used. Otherwise it might be " - "removed in future releases"); - } - - *count = i; - - return ret; -} - -/** - * Parse a X geometry. - * - * ps->root_width and ps->root_height must be valid - */ -bool parse_geometry(session_t *ps, const char *src, region_t *dest) { - pixman_region32_clear(dest); - if (!src) { - return true; - } - if (!ps->root_width || !ps->root_height) { - return true; - } - - long x = 0, y = 0; - long width = ps->root_width, height = ps->root_height; - long val = 0L; - char *endptr = NULL; - - src = skip_space(src); - if (!*src) { - goto parse_geometry_end; - } - - // Parse width - // Must be base 10, because "0x0..." may appear - if (*src != '+' && *src != '-') { - val = strtol(src, &endptr, 10); - assert(endptr); - if (src != endptr) { - if (val < 0) { - log_error("Invalid width: %s", src); - return false; - } - width = val; - src = endptr; - } - src = skip_space(src); - } - - // Parse height - if (*src == 'x') { - ++src; - val = strtol(src, &endptr, 10); - assert(endptr); - if (src != endptr) { - if (val < 0) { - log_error("Invalid height: %s", src); - return false; - } - height = val; - src = endptr; - } - src = skip_space(src); - } - - // Parse x - if (*src == '+' || *src == '-') { - val = strtol(src, &endptr, 10); - if (endptr && src != endptr) { - x = val; - if (*src == '-') { - x += ps->root_width - width; - } - src = endptr; - } - src = skip_space(src); - } - - // Parse y - if (*src == '+' || *src == '-') { - val = strtol(src, &endptr, 10); - if (endptr && src != endptr) { - y = val; - if (*src == '-') { - y += ps->root_height - height; - } - src = endptr; - } - src = skip_space(src); - } - - if (*src) { - log_error("Trailing characters: %s", src); - return false; - } - -parse_geometry_end: - if (x < INT_MIN || x > INT_MAX || y < INT_MIN || y > INT_MAX) { - log_error("Geometry coordinates exceeded limits: %s", src); - return false; - } - if (width > UINT_MAX || height > UINT_MAX) { - // less than 0 is checked for earlier - log_error("Geometry size exceeded limits: %s", src); - return false; - } - pixman_region32_union_rect(dest, dest, (int)x, (int)y, (uint)width, (uint)height); - return true; -} - -/** - * Parse a list of opacity rules. - */ -bool parse_rule_opacity(c2_lptr_t **res, const char *src) { - // Find opacity value - char *endptr = NULL; - long val = strtol(src, &endptr, 0); - if (!endptr || endptr == src) { - log_error("No opacity specified: %s", src); - return false; - } - if (val > 100 || val < 0) { - log_error("Opacity %ld invalid: %s", val, src); - return false; - } - - // Skip over spaces - while (*endptr && isspace((unsigned char)*endptr)) - ++endptr; - if (':' != *endptr) { - log_error("Opacity terminator not found: %s", src); - return false; - } - ++endptr; - - // Parse pattern - // I hope 1-100 is acceptable for (void *) - return c2_parse(res, endptr, (void *)val); -} - -/** - * Add a pattern to a condition linked list. - */ -bool condlst_add(c2_lptr_t **pcondlst, const char *pattern) { - if (!pattern) - return false; - - if (!c2_parse(pcondlst, pattern, NULL)) - exit(1); - - return true; -} - -void set_default_winopts(options_t *opt, win_option_mask_t *mask, bool shadow_enable, - bool fading_enable, bool blur_enable) { - // Apply default wintype options. - if (!mask[WINTYPE_DESKTOP].shadow) { - // Desktop windows are always drawn without shadow by default. - mask[WINTYPE_DESKTOP].shadow = true; - opt->wintype_option[WINTYPE_DESKTOP].shadow = false; - } - - // Focused/unfocused state only apply to a few window types, all other windows - // are always considered focused. - const wintype_t nofocus_type[] = {WINTYPE_UNKNOWN, WINTYPE_NORMAL, WINTYPE_UTILITY}; - for (unsigned long i = 0; i < ARR_SIZE(nofocus_type); i++) { - if (!mask[nofocus_type[i]].focus) { - mask[nofocus_type[i]].focus = true; - opt->wintype_option[nofocus_type[i]].focus = false; - } - } - for (unsigned long i = 0; i < NUM_WINTYPES; i++) { - if (!mask[i].shadow) { - mask[i].shadow = true; - opt->wintype_option[i].shadow = shadow_enable; - } - if (!mask[i].fade) { - mask[i].fade = true; - opt->wintype_option[i].fade = fading_enable; - } - if (!mask[i].focus) { - mask[i].focus = true; - opt->wintype_option[i].focus = true; - } - if (!mask[i].blur_background) { - mask[i].blur_background = true; - opt->wintype_option[i].blur_background = blur_enable; - } - if (!mask[i].full_shadow) { - mask[i].full_shadow = true; - opt->wintype_option[i].full_shadow = false; - } - if (!mask[i].redir_ignore) { - mask[i].redir_ignore = true; - opt->wintype_option[i].redir_ignore = false; - } - if (!mask[i].opacity) { - mask[i].opacity = true; - // Opacity is not set to a concrete number here because the - // opacity logic is complicated, and needs an "unset" state - opt->wintype_option[i].opacity = NAN; - } - if (!mask[i].animation) { - mask[i].animation = OPEN_WINDOW_ANIMATION_INVALID; - opt->wintype_option[i].animation = OPEN_WINDOW_ANIMATION_INVALID; - } - if (!mask[i].animation_unmap) { - mask[i].animation_unmap = OPEN_WINDOW_ANIMATION_INVALID; - opt->wintype_option[i].animation_unmap = OPEN_WINDOW_ANIMATION_INVALID; - } - if (!mask[i].animation_workspace_in) { - mask[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID; - opt->wintype_option[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID; - } - if (!mask[i].animation_workspace_out) { - mask[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID; - opt->wintype_option[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID; - } - if (!mask[i].clip_shadow_above) { - mask[i].clip_shadow_above = true; - opt->wintype_option[i].clip_shadow_above = false; - } - } -} - -enum open_window_animation parse_open_window_animation(const char *src) { - if (strcmp(src, "none") == 0) { - return OPEN_WINDOW_ANIMATION_NONE; - }else if (strcmp(src, "auto") == 0) { - return OPEN_WINDOW_ANIMATION_AUTO; - } else if (strcmp(src, "fly-in") == 0) { - return OPEN_WINDOW_ANIMATION_FLYIN; - } else if (strcmp(src, "zoom") == 0) { - return OPEN_WINDOW_ANIMATION_ZOOM; - } else if (strcmp(src, "squeeze") == 0) { - return OPEN_WINDOW_ANIMATION_SQUEEZE; - } else if (strcmp(src, "slide-up") == 0) { - return OPEN_WINDOW_ANIMATION_SLIDE_UP; - } else if (strcmp(src, "slide-down") == 0) { - return OPEN_WINDOW_ANIMATION_SLIDE_DOWN; - } else if (strcmp(src, "slide-left") == 0) { - return OPEN_WINDOW_ANIMATION_SLIDE_LEFT; - } else if (strcmp(src, "slide-right") == 0) { - return OPEN_WINDOW_ANIMATION_SLIDE_RIGHT; - } - return OPEN_WINDOW_ANIMATION_INVALID; -} - -char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable, - bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask) { - // clang-format off - *opt = (struct options){ - .backend = BKEND_XRENDER, - .glx_no_stencil = false, - .mark_wmwin_focused = false, - .mark_ovredir_focused = false, - .detect_rounded_corners = false, - .resize_damage = 0, - .unredir_if_possible = false, - .unredir_if_possible_blacklist = NULL, - .unredir_if_possible_delay = 0, - .redirected_force = UNSET, - .stoppaint_force = UNSET, - .dbus = false, - .benchmark = 0, - .benchmark_wid = XCB_NONE, - .logpath = NULL, - - .use_damage = true, - - .shadow_red = 0.0, - .shadow_green = 0.0, - .shadow_blue = 0.0, - .shadow_radius = 18, - .shadow_offset_x = -15, - .shadow_offset_y = -15, - .shadow_opacity = .75, - .shadow_blacklist = NULL, - .shadow_ignore_shaped = false, - .xinerama_shadow_crop = false, - .shadow_clip_list = NULL, - - .corner_radius = 0, - - .fade_in_step = 0.028, - .fade_out_step = 0.03, - .fade_delta = 10, - .no_fading_openclose = false, - .no_fading_destroyed_argb = false, - .fade_blacklist = NULL, - - .animations = false, - .animation_for_open_window = OPEN_WINDOW_ANIMATION_NONE, - .animation_for_transient_window = OPEN_WINDOW_ANIMATION_NONE, - .animation_for_unmap_window = OPEN_WINDOW_ANIMATION_AUTO, - .animation_for_workspace_switch_in = OPEN_WINDOW_ANIMATION_AUTO, - .animation_for_workspace_switch_out = OPEN_WINDOW_ANIMATION_AUTO, - .animation_stiffness = 200.0, - .animation_window_mass = 1.0, - .animation_dampening = 25, - .animation_delta = 10, - .animation_force_steps = false, - .animation_clamping = true, - .animation_blacklist = NULL, - - .inactive_opacity = 1.0, - .inactive_opacity_override = false, - .active_opacity = 1.0, - .frame_opacity = 1.0, - .detect_client_opacity = false, - - .blur_method = BLUR_METHOD_NONE, - .blur_radius = 3, - .blur_deviation = 0.84089642, - .blur_strength = 5, - .blur_background_frame = false, - .blur_background_fixed = false, - .blur_background_blacklist = NULL, - .blur_kerns = NULL, - .blur_kernel_count = 0, - .inactive_dim = 0.0, - .inactive_dim_fixed = false, - .invert_color_list = NULL, - .opacity_rules = NULL, - .max_brightness = 1.0, - - .use_ewmh_active_win = false, - .focus_blacklist = NULL, - .detect_transient = false, - .detect_client_leader = false, - .no_ewmh_fullscreen = false, - - .track_leader = false, - - .rounded_corners_blacklist = NULL - }; - // clang-format on - - char *ret = NULL; -#ifdef CONFIG_LIBCONFIG - ret = parse_config_libconfig(opt, config_file, shadow_enable, fading_enable, - hasneg, winopt_mask); -#else - (void)config_file; - (void)shadow_enable; - (void)fading_enable; - (void)hasneg; - (void)winopt_mask; -#endif - return ret; -} diff --git a/dwm/picom/src/config.h b/dwm/picom/src/config.h deleted file mode 100644 index 8d604f2..0000000 --- a/dwm/picom/src/config.h +++ /dev/null @@ -1,378 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2011-2013, Christopher Jeffrey -// Copyright (c) 2013 Richard Grenville -// Copyright (c) 2018 Yuxuan Shui -#pragma once - -/// Common functions and definitions for configuration parsing -/// Used for command line arguments and config files - -#include -#include -#include -#include -#include // for xcb_render_fixed_t, XXX -#include -#include - -#ifdef CONFIG_LIBCONFIG -#include -#endif - -#include "compiler.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "types.h" -#include "win_defs.h" - -typedef struct session session_t; - -/// @brief Possible backends -enum backend { - BKEND_XRENDER, - BKEND_GLX, - BKEND_XR_GLX_HYBRID, - BKEND_DUMMY, - NUM_BKEND, -}; - -enum open_window_animation { - OPEN_WINDOW_ANIMATION_NONE = 0, - OPEN_WINDOW_ANIMATION_AUTO, - OPEN_WINDOW_ANIMATION_FLYIN, - OPEN_WINDOW_ANIMATION_ZOOM, - OPEN_WINDOW_ANIMATION_SQUEEZE, - OPEN_WINDOW_ANIMATION_SLIDE_UP, - OPEN_WINDOW_ANIMATION_SLIDE_DOWN, - OPEN_WINDOW_ANIMATION_SLIDE_LEFT, - OPEN_WINDOW_ANIMATION_SLIDE_RIGHT, - OPEN_WINDOW_ANIMATION_SLIDE_IN, - OPEN_WINDOW_ANIMATION_SLIDE_OUT, - OPEN_WINDOW_ANIMATION_INVALID, -}; - -typedef struct win_option_mask { - bool shadow : 1; - bool fade : 1; - bool focus : 1; - bool blur_background : 1; - bool full_shadow : 1; - bool redir_ignore : 1; - bool opacity : 1; - bool clip_shadow_above : 1; - enum open_window_animation animation; - enum open_window_animation animation_unmap; - enum open_window_animation animation_workspace_in; - enum open_window_animation animation_workspace_out; -} win_option_mask_t; - -typedef struct win_option { - bool shadow; - bool fade; - bool focus; - bool blur_background; - bool full_shadow; - bool redir_ignore; - double opacity; - bool clip_shadow_above; - enum open_window_animation animation; - enum open_window_animation animation_unmap; - enum open_window_animation animation_workspace_in; - enum open_window_animation animation_workspace_out; -} win_option_t; - -enum blur_method { - BLUR_METHOD_NONE = 0, - BLUR_METHOD_KERNEL, - BLUR_METHOD_BOX, - BLUR_METHOD_GAUSSIAN, - BLUR_METHOD_DUAL_KAWASE, - BLUR_METHOD_INVALID, -}; - -typedef struct _c2_lptr c2_lptr_t; - -/// Structure representing all options. -typedef struct options { - // === Debugging === - bool monitor_repaint; - bool print_diagnostics; - /// Render to a separate window instead of taking over the screen - bool debug_mode; - // === General === - /// Use the experimental new backends? - bool experimental_backends; - /// Path to write PID to. - char *write_pid_path; - /// The backend in use. - enum backend backend; - /// Whether to sync X drawing with X Sync fence to avoid certain delay - /// issues with GLX backend. - bool xrender_sync_fence; - /// Whether to avoid using stencil buffer under GLX backend. Might be - /// unsafe. - bool glx_no_stencil; - /// Whether to avoid rebinding pixmap on window damage. - bool glx_no_rebind_pixmap; - /// Custom fragment shader for painting windows, as a string. - char *glx_fshader_win_str; - /// Whether to detect rounded corners. - bool detect_rounded_corners; - /// Force painting of window content with blending. - bool force_win_blend; - /// Resize damage for a specific number of pixels. - int resize_damage; - /// Whether to unredirect all windows if a full-screen opaque window - /// is detected. - bool unredir_if_possible; - /// List of conditions of windows to ignore as a full-screen window - /// when determining if a window could be unredirected. - c2_lptr_t *unredir_if_possible_blacklist; - /// Delay before unredirecting screen, in milliseconds. - long unredir_if_possible_delay; - /// Forced redirection setting through D-Bus. - switch_t redirected_force; - /// Whether to stop painting. Controlled through D-Bus. - switch_t stoppaint_force; - /// Whether to enable D-Bus support. - bool dbus; - /// Path to log file. - char *logpath; - /// Number of cycles to paint in benchmark mode. 0 for disabled. - int benchmark; - /// Window to constantly repaint in benchmark mode. 0 for full-screen. - xcb_window_t benchmark_wid; - /// A list of conditions of windows not to paint. - c2_lptr_t *paint_blacklist; - /// Whether to show all X errors. - bool show_all_xerrors; - /// Whether to avoid acquiring X Selection. - bool no_x_selection; - /// Window type option override. - win_option_t wintype_option[NUM_WINTYPES]; - - // === VSync & software optimization === - /// VSync method to use; - bool vsync; - /// Whether to use glFinish() instead of glFlush() for (possibly) better - /// VSync yet probably higher CPU usage. - bool vsync_use_glfinish; - /// Whether use damage information to help limit the area to paint - bool use_damage; - - // === Shadow === - /// Red, green and blue tone of the shadow. - double shadow_red, shadow_green, shadow_blue; - int shadow_radius; - int shadow_offset_x, shadow_offset_y; - double shadow_opacity; - /// argument string to shadow-exclude-reg option - char *shadow_exclude_reg_str; - /// Shadow blacklist. A linked list of conditions. - c2_lptr_t *shadow_blacklist; - /// Whether bounding-shaped window should be ignored. - bool shadow_ignore_shaped; - /// Whether to crop shadow to the very Xinerama screen. - bool xinerama_shadow_crop; - /// Don't draw shadow over these windows. A linked list of conditions. - c2_lptr_t *shadow_clip_list; - - // === Fading === - /// How much to fade in in a single fading step. - double fade_in_step; - /// How much to fade out in a single fading step. - double fade_out_step; - /// Fading time delta. In milliseconds. - int fade_delta; - /// Whether to disable fading on window open/close. - bool no_fading_openclose; - /// Whether to disable fading on ARGB managed destroyed windows. - bool no_fading_destroyed_argb; - /// Fading blacklist. A linked list of conditions. - c2_lptr_t *fade_blacklist; - - // === Animations === - /// Whether to do window animations - bool animations; - /// Which animation to run when opening a window - enum open_window_animation animation_for_open_window; - /// Which animation to run when opening a transient window - enum open_window_animation animation_for_transient_window; - /// Which animation to run when unmapping (e.g. minimizing) a window - enum open_window_animation animation_for_unmap_window; - /// Which animation to run when switching workspace - /// IMPORTANT: will only work if window manager updates - /// _NET_CURRENT_DESKTOP before doing the hide/show of windows - enum open_window_animation animation_for_workspace_switch_in; - enum open_window_animation animation_for_workspace_switch_out; - /// Spring stiffness for animation - double animation_stiffness; - /// Window mass for animation - double animation_window_mass; - /// Animation dampening - double animation_dampening; - /// Animation delta. In milliseconds. - double animation_delta; - /// Whether to force animations to not miss a beat - bool animation_force_steps; - /// Whether to clamp animations - bool animation_clamping; - /// Animation blacklist. A linked list of conditions. - c2_lptr_t *animation_blacklist; - /// TODO: open/close animations - - // === Opacity === - /// Default opacity for inactive windows. - /// 32-bit integer with the format of _NET_WM_WINDOW_OPACITY. - double inactive_opacity; - /// Default opacity for inactive windows. - double active_opacity; - /// Whether inactive_opacity overrides the opacity set by window - /// attributes. - bool inactive_opacity_override; - /// Frame opacity. Relative to window opacity, also affects shadow - /// opacity. - double frame_opacity; - /// Whether to detect _NET_WM_WINDOW_OPACITY on client windows. Used on window - /// managers that don't pass _NET_WM_WINDOW_OPACITY to frame windows. - bool detect_client_opacity; - - // === Other window processing === - /// Blur method for background of semi-transparent windows - enum blur_method blur_method; - // Size of the blur kernel - int blur_radius; - // Standard deviation for the gaussian blur - double blur_deviation; - // Strength of the dual_kawase blur - int blur_strength; - /// Whether to blur background when the window frame is not opaque. - /// Implies blur_background. - bool blur_background_frame; - /// Whether to use fixed blur strength instead of adjusting according - /// to window opacity. - bool blur_background_fixed; - /// Background blur blacklist. A linked list of conditions. - c2_lptr_t *blur_background_blacklist; - /// Blur convolution kernel. - struct conv **blur_kerns; - /// Number of convolution kernels - int blur_kernel_count; - /// How much to dim an inactive window. 0.0 - 1.0, 0 to disable. - double inactive_dim; - /// Whether to use fixed inactive dim opacity, instead of deciding - /// based on window opacity. - bool inactive_dim_fixed; - /// Conditions of windows to have inverted colors. - c2_lptr_t *invert_color_list; - /// Rules to change window opacity. - c2_lptr_t *opacity_rules; - /// Limit window brightness - double max_brightness; - // Radius of rounded window corners - int corner_radius; - /// Rounded corners blacklist. A linked list of conditions. - c2_lptr_t *rounded_corners_blacklist; - - // === Focus related === - /// Whether to try to detect WM windows and mark them as focused. - bool mark_wmwin_focused; - /// Whether to mark override-redirect windows as focused. - bool mark_ovredir_focused; - /// Whether to use EWMH _NET_ACTIVE_WINDOW to find active window. - bool use_ewmh_active_win; - /// A list of windows always to be considered focused. - c2_lptr_t *focus_blacklist; - /// Whether to do window grouping with WM_TRANSIENT_FOR. - bool detect_transient; - /// Whether to do window grouping with WM_CLIENT_LEADER. - bool detect_client_leader; - - // === Calculated === - /// Whether we need to track window leaders. - bool track_leader; - - // Don't use EWMH to detect fullscreen applications - bool no_ewmh_fullscreen; - - // Make transparent windows clip other windows, instead of blending on top of - // them - bool transparent_clipping; -} options_t; - -extern const char *const BACKEND_STRS[NUM_BKEND + 1]; - -bool must_use parse_long(const char *, long *); -bool must_use parse_int(const char *, int *); -struct conv **must_use parse_blur_kern_lst(const char *, bool *hasneg, int *count); -bool must_use parse_geometry(session_t *, const char *, region_t *); -bool must_use parse_rule_opacity(c2_lptr_t **, const char *); -enum blur_method must_use parse_blur_method(const char *src); -enum open_window_animation must_use parse_open_window_animation(const char *src); - -/** - * Add a pattern to a condition linked list. - */ -bool condlst_add(c2_lptr_t **, const char *); - -#ifdef CONFIG_LIBCONFIG -/// Parse a configuration file -/// Returns the actually config_file name used, allocated on heap -/// Outputs: -/// shadow_enable = whether shaodw is enabled globally -/// fading_enable = whether fading is enabled globally -/// win_option_mask = whether option overrides for specific window type is set for given -/// options -/// hasneg = whether the convolution kernel has negative values -char * -parse_config_libconfig(options_t *, const char *config_file, bool *shadow_enable, - bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask); -#endif - -void set_default_winopts(options_t *, win_option_mask_t *, bool shadow_enable, - bool fading_enable, bool blur_enable); -/// Parse a configuration file is that is enabled, also initialize the winopt_mask with -/// default values -/// Outputs and returns: -/// same as parse_config_libconfig -char *parse_config(options_t *, const char *config_file, bool *shadow_enable, - bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask); - -/** - * Parse a backend option argument. - */ -static inline attr_pure enum backend parse_backend(const char *str) { - for (enum backend i = 0; BACKEND_STRS[i]; ++i) { - if (!strcasecmp(str, BACKEND_STRS[i])) { - return i; - } - } - // Keep compatibility with an old revision containing a spelling mistake... - if (!strcasecmp(str, "xr_glx_hybird")) { - log_warn("backend xr_glx_hybird should be xr_glx_hybrid, the misspelt " - "version will be removed soon."); - return BKEND_XR_GLX_HYBRID; - } - // cju wants to use dashes - if (!strcasecmp(str, "xr-glx-hybrid")) { - log_warn("backend xr-glx-hybrid should be xr_glx_hybrid, the alternative " - "version will be removed soon."); - return BKEND_XR_GLX_HYBRID; - } - log_error("Invalid backend argument: %s", str); - return NUM_BKEND; -} - -/** - * Parse a VSync option argument. - */ -static inline bool parse_vsync(const char *str) { - if (strcmp(str, "no") == 0 || strcmp(str, "none") == 0 || - strcmp(str, "false") == 0 || strcmp(str, "nah") == 0) { - return false; - } - return true; -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/config_libconfig.c b/dwm/picom/src/config_libconfig.c deleted file mode 100644 index 06f1ba4..0000000 --- a/dwm/picom/src/config_libconfig.c +++ /dev/null @@ -1,767 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2012-2014 Richard Grenville - -#include -#include -#include -#include - -#include -#include - -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "err.h" -#include "log.h" -#include "options.h" -#include "string_utils.h" -#include "utils.h" -#include "win.h" - -#pragma GCC diagnostic error "-Wunused-parameter" - -/** - * Wrapper of libconfig's config_lookup_int. - * - * So it takes a pointer to bool. - */ -static inline int lcfg_lookup_bool(const config_t *config, const char *path, bool *value) { - int ival; - - int ret = config_lookup_bool(config, path, &ival); - if (ret) { - *value = ival; - } - - return ret; -} - -const char *xdg_config_home(void) { - char *xdgh = getenv("XDG_CONFIG_HOME"); - char *home = getenv("HOME"); - const char *default_dir = "/.config"; - - if (!xdgh) { - if (!home) { - return NULL; - } - - xdgh = cvalloc(strlen(home) + strlen(default_dir) + 1); - - strcpy(xdgh, home); - strcat(xdgh, default_dir); - } else { - xdgh = strdup(xdgh); - } - - return xdgh; -} - -char **xdg_config_dirs(void) { - char *xdgd = getenv("XDG_CONFIG_DIRS"); - size_t count = 0; - - if (!xdgd) { - xdgd = "/etc/xdg"; - } - - for (int i = 0; xdgd[i]; i++) { - if (xdgd[i] == ':') { - count++; - } - } - - // Store the string and the result pointers together so they can be - // freed together - char **dir_list = cvalloc(sizeof(char *) * (count + 2) + strlen(xdgd) + 1); - auto dirs = strcpy((char *)dir_list + sizeof(char *) * (count + 2), xdgd); - auto path = dirs; - - for (size_t i = 0; i < count; i++) { - dir_list[i] = path; - path = strchr(path, ':'); - *path = '\0'; - path++; - } - dir_list[count] = path; - - size_t fill = 0; - for (size_t i = 0; i <= count; i++) { - if (dir_list[i][0] == '/') { - dir_list[fill] = dir_list[i]; - fill++; - } - } - - dir_list[fill] = NULL; - - return dir_list; -} - -TEST_CASE(xdg_config_dirs) { - auto old_var = getenv("XDG_CONFIG_DIRS"); - if (old_var) { - old_var = strdup(old_var); - } - unsetenv("XDG_CONFIG_DIRS"); - - auto result = xdg_config_dirs(); - TEST_STREQUAL(result[0], "/etc/xdg"); - TEST_EQUAL(result[1], NULL); - free(result); - - setenv("XDG_CONFIG_DIRS", ".:.:/etc/xdg:.:/:", 1); - result = xdg_config_dirs(); - TEST_STREQUAL(result[0], "/etc/xdg"); - TEST_STREQUAL(result[1], "/"); - TEST_EQUAL(result[2], NULL); - free(result); - - setenv("XDG_CONFIG_DIRS", ":", 1); - result = xdg_config_dirs(); - TEST_EQUAL(result[0], NULL); - free(result); - - if (old_var) { - setenv("XDG_CONFIG_DIRS", old_var, 1); - free(old_var); - } -} - -/// Search for config file under a base directory -FILE *open_config_file_at(const char *base, char **out_path) { - static const char *config_paths[] = {"/picom.conf", "/picom/picom.conf", - "/compton.conf", "/compton/compton.conf"}; - for (size_t i = 0; i < ARR_SIZE(config_paths); i++) { - char *path = mstrjoin(base, config_paths[i]); - FILE *ret = fopen(path, "r"); - if (ret && out_path) { - *out_path = path; - } else { - free(path); - } - if (ret) { - if (strstr(config_paths[i], "compton")) { - log_warn("This compositor has been renamed to \"picom\", " - "the old config file paths is deprecated. " - "Please replace the \"compton\"s in the path " - "with \"picom\""); - } - return ret; - } - } - return NULL; -} - -/** - * Get a file stream of the configuration file to read. - * - * Follows the XDG specification to search for the configuration file. - */ -FILE *open_config_file(const char *cpath, char **ppath) { - static const char config_filename_legacy[] = "/.compton.conf"; - - if (cpath) { - FILE *ret = fopen(cpath, "r"); - if (ret && ppath) - *ppath = strdup(cpath); - return ret; - } - - // First search for config file in user config directory - auto config_home = xdg_config_home(); - auto ret = open_config_file_at(config_home, ppath); - free((void *)config_home); - if (ret) { - return ret; - } - - // Fall back to legacy config file in user home directory - const char *home = getenv("HOME"); - if (home && strlen(home)) { - auto path = mstrjoin(home, config_filename_legacy); - ret = fopen(path, "r"); - if (ret && ppath) { - *ppath = path; - } else { - free(path); - } - if (ret) { - return ret; - } - } - - // Fall back to config file in system config directory - auto config_dirs = xdg_config_dirs(); - for (int i = 0; config_dirs[i]; i++) { - ret = open_config_file_at(config_dirs[i], ppath); - if (ret) { - free(config_dirs); - return ret; - } - } - free(config_dirs); - - return NULL; -} - -/** - * Parse a condition list in configuration file. - */ -void parse_cfg_condlst(const config_t *pcfg, c2_lptr_t **pcondlst, const char *name) { - config_setting_t *setting = config_lookup(pcfg, name); - if (setting) { - // Parse an array of options - if (config_setting_is_array(setting)) { - int i = config_setting_length(setting); - while (i--) - condlst_add(pcondlst, - config_setting_get_string_elem(setting, i)); - } - // Treat it as a single pattern if it's a string - else if (CONFIG_TYPE_STRING == config_setting_type(setting)) { - condlst_add(pcondlst, config_setting_get_string(setting)); - } - } -} - -/** - * Parse an opacity rule list in configuration file. - */ -static inline void -parse_cfg_condlst_opct(options_t *opt, const config_t *pcfg, const char *name) { - config_setting_t *setting = config_lookup(pcfg, name); - if (setting) { - // Parse an array of options - if (config_setting_is_array(setting)) { - int i = config_setting_length(setting); - while (i--) - if (!parse_rule_opacity( - &opt->opacity_rules, - config_setting_get_string_elem(setting, i))) - exit(1); - } - // Treat it as a single pattern if it's a string - else if (config_setting_type(setting) == CONFIG_TYPE_STRING) { - if (!parse_rule_opacity(&opt->opacity_rules, - config_setting_get_string(setting))) - exit(1); - } - } -} - -static inline void parse_wintype_config(const config_t *cfg, const char *member_name, - win_option_t *o, win_option_mask_t *mask) { - char *str = mstrjoin("wintypes.", member_name); - const config_setting_t *setting = config_lookup(cfg, str); - free(str); - - int ival = 0; - const char *sval = NULL; - - if (setting) { - if (config_setting_lookup_bool(setting, "shadow", &ival)) { - o->shadow = ival; - mask->shadow = true; - } - if (config_setting_lookup_bool(setting, "fade", &ival)) { - o->fade = ival; - mask->fade = true; - } - if (config_setting_lookup_bool(setting, "focus", &ival)) { - o->focus = ival; - mask->focus = true; - } - if (config_setting_lookup_bool(setting, "blur-background", &ival)) { - o->blur_background = ival; - mask->blur_background = true; - } - if (config_setting_lookup_bool(setting, "full-shadow", &ival)) { - o->full_shadow = ival; - mask->full_shadow = true; - } - if (config_setting_lookup_bool(setting, "redir-ignore", &ival)) { - o->redir_ignore = ival; - mask->redir_ignore = true; - } - if (config_setting_lookup_bool(setting, "clip-shadow-above", &ival)) { - o->clip_shadow_above = ival; - mask->clip_shadow_above = true; - } - if (config_setting_lookup_string(setting, "animation", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) - animation = OPEN_WINDOW_ANIMATION_NONE; - - o->animation = animation; - mask->animation = OPEN_WINDOW_ANIMATION_INVALID; - } - if (config_setting_lookup_string(setting, "animation-unmap", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) - animation = OPEN_WINDOW_ANIMATION_NONE; - - o->animation_unmap = animation; - mask->animation_unmap = OPEN_WINDOW_ANIMATION_INVALID; - } - if (config_setting_lookup_string(setting, "animation-workspace-in", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) - animation = OPEN_WINDOW_ANIMATION_NONE; - - o->animation_workspace_in = animation; - mask->animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID; - } - if (config_setting_lookup_string(setting, "animation-workspace-out", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) - animation = OPEN_WINDOW_ANIMATION_NONE; - - o->animation_workspace_out = animation; - mask->animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID; - } - - double fval; - if (config_setting_lookup_float(setting, "opacity", &fval)) { - o->opacity = normalize_d(fval); - mask->opacity = true; - } - } -} - -/** - * Parse a configuration file from default location. - * - * Returns the actually config_file name - */ -char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shadow_enable, - bool *fading_enable, bool *conv_kern_hasneg, - win_option_mask_t *winopt_mask) { - - const char *deprecation_message = - "option has been deprecated. Please remove it from your configuration file. " - "If you encounter any problems without this feature, please feel free to " - "open a bug report"; - char *path = NULL; - FILE *f; - config_t cfg; - int ival = 0; - bool bval; - double dval = 0.0; - // libconfig manages string memory itself, so no need to manually free - // anything - const char *sval = NULL; - - f = open_config_file(config_file, &path); - if (!f) { - free(path); - if (config_file) { - log_fatal("Failed to read configuration file \"%s\".", config_file); - return ERR_PTR(-1); - } - return NULL; - } - - config_init(&cfg); -#ifdef CONFIG_OPTION_ALLOW_OVERRIDES - config_set_options(&cfg, CONFIG_OPTION_ALLOW_OVERRIDES); -#endif - { - // dirname() could modify the original string, thus we must pass a - // copy - char *path2 = strdup(path); - char *parent = dirname(path2); - - if (parent) - config_set_include_dir(&cfg, parent); - - free(path2); - } - - { - int read_result = config_read(&cfg, f); - fclose(f); - f = NULL; - if (read_result == CONFIG_FALSE) { - log_fatal("Error when reading configuration file \"%s\", line " - "%d: %s", - path, config_error_line(&cfg), config_error_text(&cfg)); - goto err; - } - } - config_set_auto_convert(&cfg, 1); - - // Get options from the configuration file. We don't do range checking - // right now. It will be done later - - // --dbus - lcfg_lookup_bool(&cfg, "dbus", &opt->dbus); - - // -D (fade_delta) - if (config_lookup_int(&cfg, "fade-delta", &ival)) { - opt->fade_delta = ival; - } - // -I (fade_in_step) - if (config_lookup_float(&cfg, "fade-in-step", &dval)) { - opt->fade_in_step = normalize_d(dval); - } - // -O (fade_out_step) - if (config_lookup_float(&cfg, "fade-out-step", &dval)) { - opt->fade_out_step = normalize_d(dval); - } - // -r (shadow_radius) - config_lookup_int(&cfg, "shadow-radius", &opt->shadow_radius); - // -o (shadow_opacity) - config_lookup_float(&cfg, "shadow-opacity", &opt->shadow_opacity); - // -l (shadow_offset_x) - config_lookup_int(&cfg, "shadow-offset-x", &opt->shadow_offset_x); - // -t (shadow_offset_y) - config_lookup_int(&cfg, "shadow-offset-y", &opt->shadow_offset_y); - // -i (inactive_opacity) - if (config_lookup_float(&cfg, "inactive-opacity", &dval)) { - opt->inactive_opacity = normalize_d(dval); - } - // --active_opacity - if (config_lookup_float(&cfg, "active-opacity", &dval)) { - opt->active_opacity = normalize_d(dval); - } - // --corner-radius - config_lookup_int(&cfg, "corner-radius", &opt->corner_radius); - // --rounded-corners-exclude - parse_cfg_condlst(&cfg, &opt->rounded_corners_blacklist, "rounded-corners-exclude"); - // -e (frame_opacity) - config_lookup_float(&cfg, "frame-opacity", &opt->frame_opacity); - // -c (shadow_enable) - lcfg_lookup_bool(&cfg, "shadow", shadow_enable); - // -m (menu_opacity) - if (config_lookup_float(&cfg, "menu-opacity", &dval)) { - log_warn("Option `menu-opacity` is deprecated, and will be removed." - "Please use the wintype option `opacity` of `popup_menu`" - "and `dropdown_menu` instead."); - opt->wintype_option[WINTYPE_DROPDOWN_MENU].opacity = dval; - opt->wintype_option[WINTYPE_POPUP_MENU].opacity = dval; - winopt_mask[WINTYPE_DROPDOWN_MENU].opacity = true; - winopt_mask[WINTYPE_POPUP_MENU].opacity = true; - } - // -f (fading_enable) - if (config_lookup_bool(&cfg, "fading", &ival)) - *fading_enable = ival; - // --no-fading-open-close - lcfg_lookup_bool(&cfg, "no-fading-openclose", &opt->no_fading_openclose); - // --no-fading-destroyed-argb - lcfg_lookup_bool(&cfg, "no-fading-destroyed-argb", &opt->no_fading_destroyed_argb); - // --shadow-red - config_lookup_float(&cfg, "shadow-red", &opt->shadow_red); - // --shadow-green - config_lookup_float(&cfg, "shadow-green", &opt->shadow_green); - // --shadow-blue - config_lookup_float(&cfg, "shadow-blue", &opt->shadow_blue); - // --shadow-color - if (config_lookup_string(&cfg, "shadow-color", &sval)) { - struct color rgb; - rgb = hex_to_rgb(sval); - opt->shadow_red = rgb.red; - opt->shadow_green = rgb.green; - opt->shadow_blue = rgb.blue; - } - // --shadow-exclude-reg - if (config_lookup_string(&cfg, "shadow-exclude-reg", &sval)) - opt->shadow_exclude_reg_str = strdup(sval); - // --inactive-opacity-override - lcfg_lookup_bool(&cfg, "inactive-opacity-override", &opt->inactive_opacity_override); - // --inactive-dim - config_lookup_float(&cfg, "inactive-dim", &opt->inactive_dim); - // --mark-wmwin-focused - lcfg_lookup_bool(&cfg, "mark-wmwin-focused", &opt->mark_wmwin_focused); - // --mark-ovredir-focused - lcfg_lookup_bool(&cfg, "mark-ovredir-focused", &opt->mark_ovredir_focused); - // --shadow-ignore-shaped - lcfg_lookup_bool(&cfg, "shadow-ignore-shaped", &opt->shadow_ignore_shaped); - // --detect-rounded-corners - lcfg_lookup_bool(&cfg, "detect-rounded-corners", &opt->detect_rounded_corners); - // --xinerama-shadow-crop - lcfg_lookup_bool(&cfg, "xinerama-shadow-crop", &opt->xinerama_shadow_crop); - // --detect-client-opacity - lcfg_lookup_bool(&cfg, "detect-client-opacity", &opt->detect_client_opacity); - // --refresh-rate - if (config_lookup_int(&cfg, "refresh-rate", &ival)) { - log_warn("The refresh-rate %s", deprecation_message); - } - // --vsync - if (config_lookup_string(&cfg, "vsync", &sval)) { - bool parsed_vsync = parse_vsync(sval); - log_error("vsync option will take a boolean from now on. \"%s\" in " - "your configuration should be changed to \"%s\"", - sval, parsed_vsync ? "true" : "false"); - goto err; - } - lcfg_lookup_bool(&cfg, "vsync", &opt->vsync); - // --backend - if (config_lookup_string(&cfg, "backend", &sval)) { - opt->backend = parse_backend(sval); - if (opt->backend >= NUM_BKEND) { - log_fatal("Cannot parse backend"); - goto err; - } - } - // --log-level - if (config_lookup_string(&cfg, "log-level", &sval)) { - auto level = string_to_log_level(sval); - if (level == LOG_LEVEL_INVALID) { - log_warn("Invalid log level, defaults to WARN"); - } else { - log_set_level_tls(level); - } - } - // --log-file - if (config_lookup_string(&cfg, "log-file", &sval)) { - if (*sval != '/') { - log_warn("The log-file in your configuration file is not an " - "absolute path"); - } - opt->logpath = strdup(sval); - } - // --sw-opti - if (lcfg_lookup_bool(&cfg, "sw-opti", &bval)) { - log_warn("The sw-opti %s", deprecation_message); - } - // --use-ewmh-active-win - lcfg_lookup_bool(&cfg, "use-ewmh-active-win", &opt->use_ewmh_active_win); - // --unredir-if-possible - lcfg_lookup_bool(&cfg, "unredir-if-possible", &opt->unredir_if_possible); - // --unredir-if-possible-delay - if (config_lookup_int(&cfg, "unredir-if-possible-delay", &ival)) { - if (ival < 0) { - log_warn("Invalid unredir-if-possible-delay %d", ival); - } else { - opt->unredir_if_possible_delay = ival; - } - } - // --inactive-dim-fixed - lcfg_lookup_bool(&cfg, "inactive-dim-fixed", &opt->inactive_dim_fixed); - // --detect-transient - lcfg_lookup_bool(&cfg, "detect-transient", &opt->detect_transient); - // --detect-client-leader - lcfg_lookup_bool(&cfg, "detect-client-leader", &opt->detect_client_leader); - // --no-ewmh-fullscreen - lcfg_lookup_bool(&cfg, "no-ewmh-fullscreen", &opt->no_ewmh_fullscreen); - // --transparent-clipping - lcfg_lookup_bool(&cfg, "transparent-clipping", &opt->transparent_clipping); - // --shadow-exclude - parse_cfg_condlst(&cfg, &opt->shadow_blacklist, "shadow-exclude"); - // --clip-shadow-above - parse_cfg_condlst(&cfg, &opt->shadow_clip_list, "clip-shadow-above"); - // --fade-exclude - parse_cfg_condlst(&cfg, &opt->fade_blacklist, "fade-exclude"); - // --animations - lcfg_lookup_bool(&cfg, "animations", &opt->animations); - // --animation-for-open-window - if (config_lookup_string(&cfg, "animation-for-open-window", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_fatal("Invalid open-window animation %s", sval); - goto err; - } - opt->animation_for_open_window = animation; - } - // --animation-for-transient-window - if (config_lookup_string(&cfg, "animation-for-transient-window", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_fatal("Invalid transient-window animation %s", sval); - goto err; - } - opt->animation_for_transient_window = animation; - } - // --animation-for-unmap-window - if (config_lookup_string(&cfg, "animation-for-unmap-window", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_fatal("Invalid unmap-window animation %s", sval); - goto err; - } - opt->animation_for_unmap_window = animation; - } - // --animation-for-workspace-switch-in - if (config_lookup_string(&cfg, "animation-for-workspace-switch-in", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_fatal("Invalid workspace-switch-in animation %s", sval); - goto err; - } - opt->animation_for_workspace_switch_in = animation; - } - // --animation-for-workspace-switch-out - if (config_lookup_string(&cfg, "animation-for-workspace-switch-out", &sval)) { - enum open_window_animation animation = parse_open_window_animation(sval); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_fatal("Invalid workspace-switch-out animation %s", sval); - goto err; - } - opt->animation_for_workspace_switch_out = animation; - } - // --animation-stiffness - config_lookup_float(&cfg, "animation-stiffness", &opt->animation_stiffness); - // --animation-window-mass - config_lookup_float(&cfg, "animation-window-mass", &opt->animation_window_mass); - // --animation-dampening - config_lookup_float(&cfg, "animation-dampening", &opt->animation_dampening); - // --animation-delta - config_lookup_float(&cfg, "animation-delta", &opt->animation_delta); - // --animation-force-steps - lcfg_lookup_bool(&cfg, "animation-force-steps", &opt->animation_force_steps); - // --animation-clamping - lcfg_lookup_bool(&cfg, "animation-clamping", &opt->animation_clamping); - // --animation-exclude - parse_cfg_condlst(&cfg, &opt->animation_blacklist, "animation-exclude"); - // --focus-exclude - parse_cfg_condlst(&cfg, &opt->focus_blacklist, "focus-exclude"); - // --invert-color-include - parse_cfg_condlst(&cfg, &opt->invert_color_list, "invert-color-include"); - // --blur-background-exclude - parse_cfg_condlst(&cfg, &opt->blur_background_blacklist, "blur-background-exclude"); - // --opacity-rule - parse_cfg_condlst_opct(opt, &cfg, "opacity-rule"); - // --unredir-if-possible-exclude - parse_cfg_condlst(&cfg, &opt->unredir_if_possible_blacklist, - "unredir-if-possible-exclude"); - // --blur-method - if (config_lookup_string(&cfg, "blur-method", &sval)) { - enum blur_method method = parse_blur_method(sval); - if (method >= BLUR_METHOD_INVALID) { - log_fatal("Invalid blur method %s", sval); - goto err; - } - opt->blur_method = method; - } - // --blur-size - config_lookup_int(&cfg, "blur-size", &opt->blur_radius); - // --blur-deviation - config_lookup_float(&cfg, "blur-deviation", &opt->blur_deviation); - // --blur-strength - config_lookup_int(&cfg, "blur-strength", &opt->blur_strength); - // --blur-background - if (config_lookup_bool(&cfg, "blur-background", &ival) && ival) { - if (opt->blur_method == BLUR_METHOD_NONE) { - opt->blur_method = BLUR_METHOD_KERNEL; - } - } - // --blur-background-frame - lcfg_lookup_bool(&cfg, "blur-background-frame", &opt->blur_background_frame); - // --blur-background-fixed - lcfg_lookup_bool(&cfg, "blur-background-fixed", &opt->blur_background_fixed); - // --blur-kern - if (config_lookup_string(&cfg, "blur-kern", &sval)) { - opt->blur_kerns = - parse_blur_kern_lst(sval, conv_kern_hasneg, &opt->blur_kernel_count); - if (!opt->blur_kerns) { - log_fatal("Cannot parse \"blur-kern\""); - goto err; - } - } - // --resize-damage - config_lookup_int(&cfg, "resize-damage", &opt->resize_damage); - // --glx-no-stencil - lcfg_lookup_bool(&cfg, "glx-no-stencil", &opt->glx_no_stencil); - // --glx-no-rebind-pixmap - lcfg_lookup_bool(&cfg, "glx-no-rebind-pixmap", &opt->glx_no_rebind_pixmap); - lcfg_lookup_bool(&cfg, "force-win-blend", &opt->force_win_blend); - // --glx-swap-method - if (config_lookup_string(&cfg, "glx-swap-method", &sval)) { - char *endptr; - long val = strtol(sval, &endptr, 10); - bool should_remove = true; - if (*endptr || !(*sval)) { - // sval is not a number, or an empty string - val = -1; - } - if (strcmp(sval, "undefined") != 0 && val != 0) { - // If not undefined, we will use damage and buffer-age to limit - // the rendering area. - should_remove = false; - } - log_error("glx-swap-method has been removed, your setting " - "\"%s\" should be %s.", - sval, - !should_remove ? "replaced by `use-damage = true`" : "removed"); - goto err; - } - // --use-damage - lcfg_lookup_bool(&cfg, "use-damage", &opt->use_damage); - - // --max-brightness - if (config_lookup_float(&cfg, "max-brightness", &opt->max_brightness) && - opt->use_damage && opt->max_brightness < 1) { - log_warn("max-brightness requires use-damage = false. Falling back to " - "1.0"); - opt->max_brightness = 1.0; - } - - // --glx-use-gpushader4 - if (config_lookup_bool(&cfg, "glx-use-gpushader4", &ival)) { - log_error("glx-use-gpushader4 has been removed, please remove it " - "from your config file"); - goto err; - } - // --xrender-sync-fence - lcfg_lookup_bool(&cfg, "xrender-sync-fence", &opt->xrender_sync_fence); - - if (lcfg_lookup_bool(&cfg, "clear-shadow", &bval)) - log_warn("\"clear-shadow\" is removed as an option, and is always" - " enabled now. Consider removing it from your config file"); - - config_setting_t *blur_cfg = config_lookup(&cfg, "blur"); - if (blur_cfg) { - if (config_setting_lookup_string(blur_cfg, "method", &sval)) { - enum blur_method method = parse_blur_method(sval); - if (method >= BLUR_METHOD_INVALID) { - log_warn("Invalid blur method %s, ignoring.", sval); - } else { - opt->blur_method = method; - } - } - - config_setting_lookup_int(blur_cfg, "size", &opt->blur_radius); - - if (config_setting_lookup_string(blur_cfg, "kernel", &sval)) { - opt->blur_kerns = parse_blur_kern_lst(sval, conv_kern_hasneg, - &opt->blur_kernel_count); - if (!opt->blur_kerns) { - log_warn("Failed to parse blur kernel: %s", sval); - } - } - - config_setting_lookup_float(blur_cfg, "deviation", &opt->blur_deviation); - config_setting_lookup_int(blur_cfg, "strength", &opt->blur_strength); - } - - // --write-pid-path - if (config_lookup_string(&cfg, "write-pid-path", &sval)) { - if (*sval != '/') { - log_warn("The write-pid-path in your configuration file is not" - " an absolute path"); - } - opt->write_pid_path = strdup(sval); - } - - // Wintype settings - - // XXX ! Refactor all the wintype_* arrays into a struct - for (wintype_t i = 0; i < NUM_WINTYPES; ++i) { - parse_wintype_config(&cfg, WINTYPES[i], &opt->wintype_option[i], - &winopt_mask[i]); - } - - // Compatibility with the old name for notification windows. - parse_wintype_config(&cfg, "notify", &opt->wintype_option[WINTYPE_NOTIFICATION], - &winopt_mask[WINTYPE_NOTIFICATION]); - - config_destroy(&cfg); - return path; - -err: - config_destroy(&cfg); - free(path); - return ERR_PTR(-1); -} diff --git a/dwm/picom/src/dbus.c b/dwm/picom/src/dbus.c deleted file mode 100644 index e037167..0000000 --- a/dwm/picom/src/dbus.c +++ /dev/null @@ -1,1700 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "list.h" -#include "log.h" -#include "string_utils.h" -#include "types.h" -#include "uthash_extra.h" -#include "utils.h" -#include "win.h" - -#include "dbus.h" - -struct cdbus_data { - /// DBus connection. - DBusConnection *dbus_conn; - /// DBus service name. - char *dbus_service; -}; - -// Window type -typedef uint32_t cdbus_window_t; -#define CDBUS_TYPE_WINDOW DBUS_TYPE_UINT32 -#define CDBUS_TYPE_WINDOW_STR DBUS_TYPE_UINT32_AS_STRING - -typedef uint32_t cdbus_enum_t; -#define CDBUS_TYPE_ENUM DBUS_TYPE_UINT32 -#define CDBUS_TYPE_ENUM_STR DBUS_TYPE_UINT32_AS_STRING - -#define CDBUS_SERVICE_NAME "com.github.chjj.compton" -#define CDBUS_INTERFACE_NAME CDBUS_SERVICE_NAME -#define CDBUS_OBJECT_NAME "/com/github/chjj/compton" -#define CDBUS_ERROR_PREFIX CDBUS_INTERFACE_NAME ".error" -#define CDBUS_ERROR_UNKNOWN CDBUS_ERROR_PREFIX ".unknown" -#define CDBUS_ERROR_UNKNOWN_S "Well, I don't know what happened. Do you?" -#define CDBUS_ERROR_BADMSG CDBUS_ERROR_PREFIX ".bad_message" -#define CDBUS_ERROR_BADMSG_S \ - "Unrecognized command. Beware compton " \ - "cannot make you a sandwich." -#define CDBUS_ERROR_BADARG CDBUS_ERROR_PREFIX ".bad_argument" -#define CDBUS_ERROR_BADARG_S "Failed to parse argument %d: %s" -#define CDBUS_ERROR_BADWIN CDBUS_ERROR_PREFIX ".bad_window" -#define CDBUS_ERROR_BADWIN_S "Requested window %#010x not found." -#define CDBUS_ERROR_BADTGT CDBUS_ERROR_PREFIX ".bad_target" -#define CDBUS_ERROR_BADTGT_S "Target \"%s\" not found." -#define CDBUS_ERROR_FORBIDDEN CDBUS_ERROR_PREFIX ".forbidden" -#define CDBUS_ERROR_FORBIDDEN_S "Incorrect password, access denied." -#define CDBUS_ERROR_CUSTOM CDBUS_ERROR_PREFIX ".custom" -#define CDBUS_ERROR_CUSTOM_S "%s" - -#define cdbus_reply_err(ps, srcmsg, err_name, err_format, ...) \ - cdbus_reply_errm((ps), dbus_message_new_error_printf( \ - (srcmsg), (err_name), (err_format), ##__VA_ARGS__)) - -#define PICOM_WINDOW_INTERFACE "picom.Window" -#define PICOM_COMPOSITOR_INTERFACE "picom.Compositor" - -static DBusHandlerResult cdbus_process(DBusConnection *conn, DBusMessage *m, void *); -static DBusHandlerResult cdbus_process_windows(DBusConnection *c, DBusMessage *msg, void *ud); - -static dbus_bool_t cdbus_callback_add_timeout(DBusTimeout *timeout, void *data); - -static void cdbus_callback_remove_timeout(DBusTimeout *timeout, void *data); - -static void cdbus_callback_timeout_toggled(DBusTimeout *timeout, void *data); - -static dbus_bool_t cdbus_callback_add_watch(DBusWatch *watch, void *data); - -static void cdbus_callback_remove_watch(DBusWatch *watch, void *data); - -static void cdbus_callback_watch_toggled(DBusWatch *watch, void *data); - -/** - * Initialize D-Bus connection. - */ -bool cdbus_init(session_t *ps, const char *uniq) { - auto cd = cmalloc(struct cdbus_data); - cd->dbus_service = NULL; - - // Set ps->dbus_data here because add_watch functions need it - ps->dbus_data = cd; - - DBusError err = {}; - - // Initialize - dbus_error_init(&err); - - // Connect to D-Bus - // Use dbus_bus_get_private() so we can fully recycle it ourselves - cd->dbus_conn = dbus_bus_get_private(DBUS_BUS_SESSION, &err); - if (dbus_error_is_set(&err)) { - log_error("D-Bus connection failed (%s).", err.message); - dbus_error_free(&err); - goto fail; - } - - if (!cd->dbus_conn) { - log_error("D-Bus connection failed for unknown reason."); - goto fail; - } - - // Avoid exiting on disconnect - dbus_connection_set_exit_on_disconnect(cd->dbus_conn, false); - - // Request service name - { - // Build service name - size_t service_len = strlen(CDBUS_SERVICE_NAME) + strlen(uniq) + 2; - char *service = ccalloc(service_len, char); - snprintf(service, service_len, "%s.%s", CDBUS_SERVICE_NAME, uniq); - - // Make a valid dbus name by converting non alphanumeric characters to - // underscore - char *tmp = service + strlen(CDBUS_SERVICE_NAME) + 1; - while (*tmp) { - if (!isalnum((unsigned char)*tmp)) { - *tmp = '_'; - } - tmp++; - } - cd->dbus_service = service; - - // Request for the name - int ret = dbus_bus_request_name(cd->dbus_conn, service, - DBUS_NAME_FLAG_DO_NOT_QUEUE, &err); - - if (dbus_error_is_set(&err)) { - log_error("Failed to obtain D-Bus name (%s).", err.message); - dbus_error_free(&err); - goto fail; - } - - if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret && - DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER != ret) { - log_error("Failed to become the primary owner of requested D-Bus " - "name (%d).", - ret); - goto fail; - } - } - - // Add watch handlers - if (!dbus_connection_set_watch_functions(cd->dbus_conn, cdbus_callback_add_watch, - cdbus_callback_remove_watch, - cdbus_callback_watch_toggled, ps, NULL)) { - log_error("Failed to add D-Bus watch functions."); - goto fail; - } - - // Add timeout handlers - if (!dbus_connection_set_timeout_functions( - cd->dbus_conn, cdbus_callback_add_timeout, cdbus_callback_remove_timeout, - cdbus_callback_timeout_toggled, ps, NULL)) { - log_error("Failed to add D-Bus timeout functions."); - goto fail; - } - - // Add match - dbus_bus_add_match(cd->dbus_conn, - "type='method_call',interface='" CDBUS_INTERFACE_NAME "'", &err); - if (dbus_error_is_set(&err)) { - log_error("Failed to add D-Bus match."); - dbus_error_free(&err); - goto fail; - } - dbus_connection_register_object_path( - cd->dbus_conn, CDBUS_OBJECT_NAME, - (DBusObjectPathVTable[]){{NULL, cdbus_process}}, ps); - dbus_connection_register_fallback( - cd->dbus_conn, CDBUS_OBJECT_NAME "/windows", - (DBusObjectPathVTable[]){{NULL, cdbus_process_windows}}, ps); - return true; -fail: - ps->dbus_data = NULL; - free(cd->dbus_service); - free(cd); - return false; -} - -/** - * Destroy D-Bus connection. - */ -void cdbus_destroy(session_t *ps) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - // Release DBus name firstly - if (cd->dbus_service) { - DBusError err = {}; - dbus_error_init(&err); - - dbus_bus_release_name(cd->dbus_conn, cd->dbus_service, &err); - if (dbus_error_is_set(&err)) { - log_error("Failed to release DBus name (%s).", err.message); - dbus_error_free(&err); - } - free(cd->dbus_service); - } - - // Close and unref the connection - dbus_connection_close(cd->dbus_conn); - dbus_connection_unref(cd->dbus_conn); - } - free(cd); -} - -/** @name DBusTimeout handling - */ -///@{ - -typedef struct ev_dbus_timer { - ev_timer w; - DBusTimeout *t; -} ev_dbus_timer; - -/** - * Callback for handling a D-Bus timeout. - */ -static void -cdbus_callback_handle_timeout(EV_P attr_unused, ev_timer *w, int revents attr_unused) { - ev_dbus_timer *t = (void *)w; - dbus_timeout_handle(t->t); -} - -/** - * Callback for adding D-Bus timeout. - */ -static dbus_bool_t cdbus_callback_add_timeout(DBusTimeout *timeout, void *data) { - session_t *ps = data; - - auto t = ccalloc(1, ev_dbus_timer); - double i = dbus_timeout_get_interval(timeout) / 1000.0; - ev_timer_init(&t->w, cdbus_callback_handle_timeout, i, i); - t->t = timeout; - dbus_timeout_set_data(timeout, t, NULL); - - if (dbus_timeout_get_enabled(timeout)) - ev_timer_start(ps->loop, &t->w); - - return true; -} - -/** - * Callback for removing D-Bus timeout. - */ -static void cdbus_callback_remove_timeout(DBusTimeout *timeout, void *data) { - session_t *ps = data; - - ev_dbus_timer *t = dbus_timeout_get_data(timeout); - assert(t); - ev_timer_stop(ps->loop, &t->w); - free(t); -} - -/** - * Callback for toggling a D-Bus timeout. - */ -static void cdbus_callback_timeout_toggled(DBusTimeout *timeout, void *data) { - session_t *ps = data; - ev_dbus_timer *t = dbus_timeout_get_data(timeout); - - assert(t); - ev_timer_stop(ps->loop, &t->w); - if (dbus_timeout_get_enabled(timeout)) { - double i = dbus_timeout_get_interval(timeout) / 1000.0; - ev_timer_set(&t->w, i, i); - ev_timer_start(ps->loop, &t->w); - } -} - -///@} - -/** @name DBusWatch handling - */ -///@{ - -typedef struct ev_dbus_io { - ev_io w; - struct cdbus_data *cd; - DBusWatch *dw; -} ev_dbus_io; - -void cdbus_io_callback(EV_P attr_unused, ev_io *w, int revents) { - ev_dbus_io *dw = (void *)w; - DBusWatchFlags flags = 0; - if (revents & EV_READ) - flags |= DBUS_WATCH_READABLE; - if (revents & EV_WRITE) - flags |= DBUS_WATCH_WRITABLE; - dbus_watch_handle(dw->dw, flags); - while (dbus_connection_dispatch(dw->cd->dbus_conn) != DBUS_DISPATCH_COMPLETE) - ; -} - -/** - * Determine the poll condition of a DBusWatch. - */ -static inline int cdbus_get_watch_cond(DBusWatch *watch) { - const unsigned flags = dbus_watch_get_flags(watch); - int condition = 0; - if (flags & DBUS_WATCH_READABLE) - condition |= EV_READ; - if (flags & DBUS_WATCH_WRITABLE) - condition |= EV_WRITE; - - return condition; -} - -/** - * Callback for adding D-Bus watch. - */ -static dbus_bool_t cdbus_callback_add_watch(DBusWatch *watch, void *data) { - session_t *ps = data; - - auto w = ccalloc(1, ev_dbus_io); - w->dw = watch; - w->cd = ps->dbus_data; - ev_io_init(&w->w, cdbus_io_callback, dbus_watch_get_unix_fd(watch), - cdbus_get_watch_cond(watch)); - - // Leave disabled watches alone - if (dbus_watch_get_enabled(watch)) - ev_io_start(ps->loop, &w->w); - - dbus_watch_set_data(watch, w, NULL); - - // Always return true - return true; -} - -/** - * Callback for removing D-Bus watch. - */ -static void cdbus_callback_remove_watch(DBusWatch *watch, void *data) { - session_t *ps = data; - ev_dbus_io *w = dbus_watch_get_data(watch); - ev_io_stop(ps->loop, &w->w); - free(w); -} - -/** - * Callback for toggling D-Bus watch status. - */ -static void cdbus_callback_watch_toggled(DBusWatch *watch, void *data) { - session_t *ps = data; - ev_io *w = dbus_watch_get_data(watch); - if (dbus_watch_get_enabled(watch)) - ev_io_start(ps->loop, w); - else - ev_io_stop(ps->loop, w); -} - -///@} - -/** @name Message argument appending callbacks - */ -///@{ - -/** - * Callback to append a bool argument to a message. - */ -static bool cdbus_apdarg_bool(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - assert(data); - - dbus_bool_t val = *(const bool *)data; - - if (!dbus_message_append_args(msg, DBUS_TYPE_BOOLEAN, &val, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append an int32 argument to a message. - */ -static bool cdbus_apdarg_int32(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - if (!dbus_message_append_args(msg, DBUS_TYPE_INT32, data, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append an uint32 argument to a message. - */ -static bool -cdbus_apdarg_uint32(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - if (!dbus_message_append_args(msg, DBUS_TYPE_UINT32, data, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append a double argument to a message. - */ -static bool -cdbus_apdarg_double(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - if (!dbus_message_append_args(msg, DBUS_TYPE_DOUBLE, data, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append a Window argument to a message. - */ -static bool cdbus_apdarg_wid(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - assert(data); - cdbus_window_t val = *(const xcb_window_t *)data; - - if (!dbus_message_append_args(msg, CDBUS_TYPE_WINDOW, &val, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append a Window argument to a message as a variant. - */ -static bool -cdbus_append_wid_variant(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - assert(data); - cdbus_window_t val = *(const xcb_window_t *)data; - - DBusMessageIter it, it2; - dbus_message_iter_init_append(msg, &it); - if (!dbus_message_iter_open_container(&it, DBUS_TYPE_VARIANT, - CDBUS_TYPE_WINDOW_STR, &it2)) { - return false; - } - if (!dbus_message_iter_append_basic(&it2, CDBUS_TYPE_WINDOW, &val)) { - log_error("Failed to append argument."); - return false; - } - if (!dbus_message_iter_close_container(&it, &it2)) { - return false; - } - - return true; -} - -/** - * Callback to append a bool argument to a message as a variant. - */ -static bool -cdbus_append_bool_variant(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - assert(data); - - dbus_bool_t val = *(const bool *)data; - DBusMessageIter it, it2; - dbus_message_iter_init_append(msg, &it); - if (!dbus_message_iter_open_container(&it, DBUS_TYPE_VARIANT, - DBUS_TYPE_BOOLEAN_AS_STRING, &it2)) { - return false; - } - if (!dbus_message_iter_append_basic(&it2, DBUS_TYPE_BOOLEAN, &val)) { - log_error("Failed to append argument."); - return false; - } - if (!dbus_message_iter_close_container(&it, &it2)) { - return false; - } - - return true; -} - -/** - * Callback to append an cdbus_enum_t argument to a message. - */ -static bool cdbus_apdarg_enum(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - assert(data); - if (!dbus_message_append_args(msg, CDBUS_TYPE_ENUM, data, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append a string argument to a message. - */ -static bool -cdbus_apdarg_string(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - const char *str = data; - if (!str) - str = ""; - - if (!dbus_message_append_args(msg, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - return false; - } - - return true; -} - -/** - * Callback to append a string argument to a message as a variant. - */ -static bool -cdbus_append_string_variant(session_t *ps attr_unused, DBusMessage *msg, const void *data) { - const char *str = *(const char **)data; - if (!str) { - str = ""; - } - - DBusMessageIter it, it2; - dbus_message_iter_init_append(msg, &it); - if (!dbus_message_iter_open_container(&it, DBUS_TYPE_VARIANT, - DBUS_TYPE_STRING_AS_STRING, &it2)) { - return false; - } - if (!dbus_message_iter_append_basic(&it2, DBUS_TYPE_STRING, &str)) { - log_error("Failed to append argument."); - return false; - } - if (!dbus_message_iter_close_container(&it, &it2)) { - return false; - } - - return true; -} - -static bool cdbus_append_empty_dict(session_t *ps attr_unused, DBusMessage *msg, - const void *data attr_unused) { - DBusMessageIter it, it2; - dbus_message_iter_init_append(msg, &it); - if (!dbus_message_iter_open_container(&it, DBUS_TYPE_ARRAY, "{sv}", &it2)) { - return false; - } - if (!dbus_message_iter_close_container(&it, &it2)) { - return false; - } - return true; -} - -/** - * Callback to append all window IDs to a message. - */ -static bool cdbus_apdarg_wids(session_t *ps, DBusMessage *msg, const void *data attr_unused) { - // Get the number of wids we are to include - unsigned count = 0; - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - ++count; - } - - if (!count) { - // Nothing to append - return true; - } - - // Allocate memory for an array of window IDs - auto arr = ccalloc(count, cdbus_window_t); - - // Build the array - cdbus_window_t *pcur = arr; - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - *pcur = w->id; - ++pcur; - } - assert(pcur == arr + count); - - // Append arguments - if (!dbus_message_append_args(msg, DBUS_TYPE_ARRAY, CDBUS_TYPE_WINDOW, &arr, - count, DBUS_TYPE_INVALID)) { - log_error("Failed to append argument."); - free(arr); - return false; - } - - free(arr); - return true; -} -///@} - -/** - * Send a D-Bus signal. - * - * @param ps current session - * @param name signal name - * @param func a function that modifies the built message, to, for example, - * add an argument - * @param data data pointer to pass to the function - */ -static bool cdbus_signal(session_t *ps, const char *interface, const char *name, - bool (*func)(session_t *ps, DBusMessage *msg, const void *data), - const void *data) { - struct cdbus_data *cd = ps->dbus_data; - DBusMessage *msg = NULL; - - // Create a signal - msg = dbus_message_new_signal(CDBUS_OBJECT_NAME, interface, name); - if (!msg) { - log_error("Failed to create D-Bus signal."); - return false; - } - - // Append arguments onto message - if (func && !func(ps, msg, data)) { - dbus_message_unref(msg); - return false; - } - - // Send the message and flush the connection - if (!dbus_connection_send(cd->dbus_conn, msg, NULL)) { - log_error("Failed to send D-Bus signal."); - dbus_message_unref(msg); - return false; - } - dbus_connection_flush(cd->dbus_conn); - - // Free the message - dbus_message_unref(msg); - - return true; -} - -/** - * Send a signal with a Window ID as argument. - */ -static inline bool -cdbus_signal_wid(session_t *ps, const char *interface, const char *name, xcb_window_t wid) { - return cdbus_signal(ps, interface, name, cdbus_apdarg_wid, &wid); -} - -/** - * Send a D-Bus reply. - * - * @param ps current session - * @param srcmsg original message - * @param func a function that modifies the built message, to, for example, - * add an argument - * @param data data pointer to pass to the function - */ -static bool cdbus_reply(session_t *ps, DBusMessage *srcmsg, - bool (*func)(session_t *ps, DBusMessage *msg, const void *data), - const void *data) { - struct cdbus_data *cd = ps->dbus_data; - DBusMessage *msg = NULL; - - // Create a reply - msg = dbus_message_new_method_return(srcmsg); - if (!msg) { - log_error("Failed to create D-Bus reply."); - return false; - } - - // Append arguments onto message - if (func && !func(ps, msg, data)) { - dbus_message_unref(msg); - return false; - } - - // Send the message and flush the connection - if (!dbus_connection_send(cd->dbus_conn, msg, NULL)) { - log_error("Failed to send D-Bus reply."); - dbus_message_unref(msg); - return false; - } - dbus_connection_flush(cd->dbus_conn); - - // Free the message - dbus_message_unref(msg); - - return true; -} - -/** - * Send a reply with a bool argument. - */ -static inline bool cdbus_reply_bool(session_t *ps, DBusMessage *srcmsg, bool bval) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_bool, &bval); -} - -/** - * Send a reply with an int32 argument. - */ -static inline bool cdbus_reply_int32(session_t *ps, DBusMessage *srcmsg, int32_t val) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_int32, &val); -} - -/** - * Send a reply with an int32 argument, cast from a long. - */ -static inline bool cdbus_reply_int32l(session_t *ps, DBusMessage *srcmsg, long val) { - int32_t tmp = (int32_t)val; - return cdbus_reply(ps, srcmsg, cdbus_apdarg_int32, &tmp); -} - -/** - * Send a reply with an uint32 argument. - */ -static inline bool cdbus_reply_uint32(session_t *ps, DBusMessage *srcmsg, uint32_t val) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_uint32, &val); -} - -/** - * Send a reply with a double argument. - */ -static inline bool cdbus_reply_double(session_t *ps, DBusMessage *srcmsg, double val) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_double, &val); -} - -/** - * Send a reply with a wid argument. - */ -static inline bool cdbus_reply_wid(session_t *ps, DBusMessage *srcmsg, xcb_window_t wid) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_wid, &wid); -} - -/** - * Send a reply with a string argument. - */ -static inline bool cdbus_reply_string(session_t *ps, DBusMessage *srcmsg, const char *str) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_string, str); -} - -/** - * Send a reply with a enum argument. - */ -static inline bool cdbus_reply_enum(session_t *ps, DBusMessage *srcmsg, cdbus_enum_t eval) { - return cdbus_reply(ps, srcmsg, cdbus_apdarg_enum, &eval); -} - -/** - * Send a D-Bus error reply. - * - * @param ps current session - * @param msg the new error DBusMessage - */ -static bool cdbus_reply_errm(session_t *ps, DBusMessage *msg) { - struct cdbus_data *cd = ps->dbus_data; - if (!msg) { - log_error("Failed to create D-Bus reply."); - return false; - } - - // Send the message and flush the connection - if (!dbus_connection_send(cd->dbus_conn, msg, NULL)) { - log_error("Failed to send D-Bus reply."); - dbus_message_unref(msg); - return false; - } - dbus_connection_flush(cd->dbus_conn); - - // Free the message - dbus_message_unref(msg); - - return true; -} - -/** - * Get n-th argument of a D-Bus message. - * - * @param count the position of the argument to get, starting from 0 - * @param type libdbus type number of the type - * @param pdest pointer to the target - * @return true if successful, false otherwise. - */ -static bool cdbus_msg_get_arg(DBusMessage *msg, int count, const int type, void *pdest) { - assert(count >= 0); - - DBusMessageIter iter = {}; - if (!dbus_message_iter_init(msg, &iter)) { - log_error("Message has no argument."); - return false; - } - - { - const int oldcount = count; - while (count) { - if (!dbus_message_iter_next(&iter)) { - log_error("Failed to find argument %d.", oldcount); - return false; - } - --count; - } - } - - if (type != dbus_message_iter_get_arg_type(&iter)) { - log_error("Argument has incorrect type."); - return false; - } - - dbus_message_iter_get_basic(&iter, pdest); - - return true; -} - -/** @name Message processing - */ -///@{ - -/** - * Process a list_win D-Bus request. - */ -static bool cdbus_process_list_win(session_t *ps, DBusMessage *msg) { - cdbus_reply(ps, msg, cdbus_apdarg_wids, NULL); - - return true; -} - -/** - * Process a win_get D-Bus request. - */ -static bool -cdbus_process_window_property_get(session_t *ps, DBusMessage *msg, cdbus_window_t wid) { - const char *target = NULL; - const char *interface = NULL; - DBusError err = {}; - - if (!dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &interface, - DBUS_TYPE_STRING, &target, DBUS_TYPE_INVALID)) { - log_error("Failed to parse argument of \"Get\" (%s).", err.message); - dbus_error_free(&err); - return false; - } - - if (strcmp(interface, PICOM_WINDOW_INTERFACE)) { - return false; - } - - auto w = find_managed_win(ps, wid); - - if (!w) { - log_error("Window %#010x not found.", wid); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADWIN, CDBUS_ERROR_BADWIN_S, wid); - return true; - } - -#define cdbus_m_win_get_do(tgt, member, apdarg_func) \ - if (!strcmp(#tgt, target)) { \ - cdbus_reply(ps, msg, apdarg_func, &w->member); \ - return true; \ - } - - if (!strcmp("Mapped", target)) { - cdbus_reply(ps, msg, cdbus_append_bool_variant, - (bool[]){win_is_mapped_in_x(w)}); - return true; - } - - if (!strcmp(target, "Id")) { - cdbus_reply(ps, msg, cdbus_append_wid_variant, &w->base.id); - return true; - } - - // next - if (!strcmp("Next", target)) { - cdbus_window_t next_id = 0; - if (!list_node_is_last(&ps->window_stack, &w->base.stack_neighbour)) { - next_id = list_entry(w->base.stack_neighbour.next, struct win, - stack_neighbour) - ->id; - } - cdbus_reply(ps, msg, cdbus_append_wid_variant, &next_id); - return true; - } - - cdbus_m_win_get_do(ClientWin, client_win, cdbus_append_wid_variant); - cdbus_m_win_get_do(Leader, leader, cdbus_append_wid_variant); - cdbus_m_win_get_do(Name, name, cdbus_append_string_variant); - if (!strcmp("Type", target)) { - cdbus_reply(ps, msg, cdbus_append_string_variant, &WINTYPES[w->window_type]); - return true; - } - if (!strcmp("RawFocused", target)) { - cdbus_reply(ps, msg, cdbus_append_bool_variant, - (bool[]){win_is_focused_raw(ps, w)}); - return true; - } - -#undef cdbus_m_win_get_do - - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; -} - -/** - * Process a win_get D-Bus request. - */ -static bool cdbus_process_win_get(session_t *ps, DBusMessage *msg) { - cdbus_window_t wid = XCB_NONE; - const char *target = NULL; - DBusError err = {}; - - if (!dbus_message_get_args(msg, &err, CDBUS_TYPE_WINDOW, &wid, DBUS_TYPE_STRING, - &target, DBUS_TYPE_INVALID)) { - log_error("Failed to parse argument of \"win_get\" (%s).", err.message); - dbus_error_free(&err); - return false; - } - - auto w = find_managed_win(ps, wid); - - if (!w) { - log_error("Window %#010x not found.", wid); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADWIN, CDBUS_ERROR_BADWIN_S, wid); - return true; - } - -#define cdbus_m_win_get_do(tgt, apdarg_func) \ - if (!strcmp(#tgt, target)) { \ - apdarg_func(ps, msg, w->tgt); \ - return true; \ - } - - if (!strcmp(target, "id")) { - cdbus_reply_wid(ps, msg, w->base.id); - return true; - } - - // next - if (!strcmp("next", target)) { - cdbus_reply_wid( - ps, msg, - (list_node_is_last(&ps->window_stack, &w->base.stack_neighbour) - ? 0 - : list_entry(w->base.stack_neighbour.next, struct win, stack_neighbour) - ->id)); - return true; - } - - // map_state - if (!strcmp("map_state", target)) { - cdbus_reply_bool(ps, msg, w->a.map_state); - return true; - } - - cdbus_m_win_get_do(mode, cdbus_reply_enum); - cdbus_m_win_get_do(client_win, cdbus_reply_wid); - cdbus_m_win_get_do(ever_damaged, cdbus_reply_bool); - cdbus_m_win_get_do(window_type, cdbus_reply_enum); - cdbus_m_win_get_do(wmwin, cdbus_reply_bool); - cdbus_m_win_get_do(leader, cdbus_reply_wid); - if (!strcmp("focused_raw", target)) { - cdbus_reply_bool(ps, msg, win_is_focused_raw(ps, w)); - return true; - } - cdbus_m_win_get_do(fade_force, cdbus_reply_enum); - cdbus_m_win_get_do(shadow_force, cdbus_reply_enum); - cdbus_m_win_get_do(focused_force, cdbus_reply_enum); - cdbus_m_win_get_do(invert_color_force, cdbus_reply_enum); - cdbus_m_win_get_do(name, cdbus_reply_string); - cdbus_m_win_get_do(class_instance, cdbus_reply_string); - cdbus_m_win_get_do(class_general, cdbus_reply_string); - cdbus_m_win_get_do(role, cdbus_reply_string); - - cdbus_m_win_get_do(opacity, cdbus_reply_double); - cdbus_m_win_get_do(opacity_target, cdbus_reply_double); - cdbus_m_win_get_do(has_opacity_prop, cdbus_reply_bool); - cdbus_m_win_get_do(opacity_prop, cdbus_reply_uint32); - cdbus_m_win_get_do(opacity_is_set, cdbus_reply_bool); - cdbus_m_win_get_do(opacity_set, cdbus_reply_double); - - cdbus_m_win_get_do(frame_opacity, cdbus_reply_double); - if (!strcmp("left_width", target)) { - cdbus_reply_int32(ps, msg, w->frame_extents.left); - return true; - } - if (!strcmp("right_width", target)) { - cdbus_reply_int32(ps, msg, w->frame_extents.right); - return true; - } - if (!strcmp("top_width", target)) { - cdbus_reply_int32(ps, msg, w->frame_extents.top); - return true; - } - if (!strcmp("bottom_width", target)) { - cdbus_reply_int32(ps, msg, w->frame_extents.bottom); - return true; - } - - cdbus_m_win_get_do(shadow, cdbus_reply_bool); - cdbus_m_win_get_do(invert_color, cdbus_reply_bool); - cdbus_m_win_get_do(blur_background, cdbus_reply_bool); -#undef cdbus_m_win_get_do - - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; -} - -/** - * Process a win_set D-Bus request. - */ -static bool cdbus_process_win_set(session_t *ps, DBusMessage *msg) { - cdbus_window_t wid = XCB_NONE; - const char *target = NULL; - DBusError err = {}; - - if (!dbus_message_get_args(msg, &err, CDBUS_TYPE_WINDOW, &wid, DBUS_TYPE_STRING, - &target, DBUS_TYPE_INVALID)) { - log_error("(): Failed to parse argument of \"win_set\" (%s).", err.message); - dbus_error_free(&err); - return false; - } - - auto w = find_managed_win(ps, wid); - - if (!w) { - log_error("Window %#010x not found.", wid); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADWIN, CDBUS_ERROR_BADWIN_S, wid); - return true; - } - -#define cdbus_m_win_set_do(tgt, type, real_type) \ - if (!strcmp(MSTR(tgt), target)) { \ - real_type val; \ - if (!cdbus_msg_get_arg(msg, 2, type, &val)) \ - return false; \ - w->tgt = val; \ - goto cdbus_process_win_set_success; \ - } - - if (!strcmp("shadow_force", target)) { - cdbus_enum_t val = UNSET; - if (!cdbus_msg_get_arg(msg, 2, CDBUS_TYPE_ENUM, &val)) - return false; - win_set_shadow_force(ps, w, val); - goto cdbus_process_win_set_success; - } - - if (!strcmp("fade_force", target)) { - cdbus_enum_t val = UNSET; - if (!cdbus_msg_get_arg(msg, 2, CDBUS_TYPE_ENUM, &val)) - return false; - win_set_fade_force(w, val); - goto cdbus_process_win_set_success; - } - - if (!strcmp("focused_force", target)) { - cdbus_enum_t val = UNSET; - if (!cdbus_msg_get_arg(msg, 2, CDBUS_TYPE_ENUM, &val)) - return false; - win_set_focused_force(ps, w, val); - goto cdbus_process_win_set_success; - } - - if (!strcmp("invert_color_force", target)) { - cdbus_enum_t val = UNSET; - if (!cdbus_msg_get_arg(msg, 2, CDBUS_TYPE_ENUM, &val)) - return false; - win_set_invert_color_force(ps, w, val); - goto cdbus_process_win_set_success; - } -#undef cdbus_m_win_set_do - - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; - -cdbus_process_win_set_success: - if (!dbus_message_get_no_reply(msg)) - cdbus_reply_bool(ps, msg, true); - return true; -} - -/** - * Process a find_win D-Bus request. - */ -static bool cdbus_process_find_win(session_t *ps, DBusMessage *msg) { - const char *target = NULL; - - if (!cdbus_msg_get_arg(msg, 0, DBUS_TYPE_STRING, &target)) - return false; - - xcb_window_t wid = XCB_NONE; - - // Find window by client window - if (!strcmp("client", target)) { - cdbus_window_t client = XCB_NONE; - if (!cdbus_msg_get_arg(msg, 1, CDBUS_TYPE_WINDOW, &client)) - return false; - auto w = find_toplevel(ps, client); - if (w) { - wid = w->base.id; - } - } - // Find focused window - else if (!strcmp("focused", target)) { - if (ps->active_win && ps->active_win->state != WSTATE_UNMAPPED) { - wid = ps->active_win->base.id; - } - } else { - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; - } - - cdbus_reply_wid(ps, msg, wid); - - return true; -} - -/** - * Process a opts_get D-Bus request. - */ -static bool cdbus_process_opts_get(session_t *ps, DBusMessage *msg) { - const char *target = NULL; - - if (!cdbus_msg_get_arg(msg, 0, DBUS_TYPE_STRING, &target)) - return false; - -#define cdbus_m_opts_get_do(tgt, apdarg_func) \ - if (!strcmp(#tgt, target)) { \ - apdarg_func(ps, msg, ps->o.tgt); \ - return true; \ - } - -#define cdbus_m_opts_get_stub(tgt, apdarg_func, ret) \ - if (!strcmp(#tgt, target)) { \ - apdarg_func(ps, msg, ret); \ - return true; \ - } - - // version - if (!strcmp("version", target)) { - cdbus_reply_string(ps, msg, COMPTON_VERSION); - return true; - } - - // pid - if (!strcmp("pid", target)) { - cdbus_reply_int32(ps, msg, getpid()); - return true; - } - - // display - if (!strcmp("display", target)) { - cdbus_reply_string(ps, msg, DisplayString(ps->dpy)); - return true; - } - - cdbus_m_opts_get_stub(config_file, cdbus_reply_string, "Unknown"); - cdbus_m_opts_get_do(write_pid_path, cdbus_reply_string); - cdbus_m_opts_get_do(mark_wmwin_focused, cdbus_reply_bool); - cdbus_m_opts_get_do(mark_ovredir_focused, cdbus_reply_bool); - cdbus_m_opts_get_do(detect_rounded_corners, cdbus_reply_bool); - cdbus_m_opts_get_stub(paint_on_overlay, cdbus_reply_bool, ps->overlay != XCB_NONE); - // paint_on_overlay_id: Get ID of the X composite overlay window - if (!strcmp("paint_on_overlay_id", target)) { - cdbus_reply_uint32(ps, msg, ps->overlay); - return true; - } - cdbus_m_opts_get_do(unredir_if_possible, cdbus_reply_bool); - cdbus_m_opts_get_do(unredir_if_possible_delay, cdbus_reply_int32l); - cdbus_m_opts_get_do(redirected_force, cdbus_reply_enum); - cdbus_m_opts_get_do(stoppaint_force, cdbus_reply_enum); - cdbus_m_opts_get_do(logpath, cdbus_reply_string); - - cdbus_m_opts_get_stub(refresh_rate, cdbus_reply_int32, 0); - cdbus_m_opts_get_stub(sw_opti, cdbus_reply_bool, false); - cdbus_m_opts_get_do(vsync, cdbus_reply_bool); - if (!strcmp("backend", target)) { - assert(ps->o.backend < sizeof(BACKEND_STRS) / sizeof(BACKEND_STRS[0])); - cdbus_reply_string(ps, msg, BACKEND_STRS[ps->o.backend]); - return true; - } - - cdbus_m_opts_get_do(shadow_red, cdbus_reply_double); - cdbus_m_opts_get_do(shadow_green, cdbus_reply_double); - cdbus_m_opts_get_do(shadow_blue, cdbus_reply_double); - cdbus_m_opts_get_do(shadow_radius, cdbus_reply_int32); - cdbus_m_opts_get_do(shadow_offset_x, cdbus_reply_int32); - cdbus_m_opts_get_do(shadow_offset_y, cdbus_reply_int32); - cdbus_m_opts_get_do(shadow_opacity, cdbus_reply_double); - cdbus_m_opts_get_do(xinerama_shadow_crop, cdbus_reply_bool); - - cdbus_m_opts_get_do(fade_delta, cdbus_reply_int32); - cdbus_m_opts_get_do(fade_in_step, cdbus_reply_double); - cdbus_m_opts_get_do(fade_out_step, cdbus_reply_double); - cdbus_m_opts_get_do(no_fading_openclose, cdbus_reply_bool); - - cdbus_m_opts_get_do(blur_method, cdbus_reply_bool); - cdbus_m_opts_get_do(blur_background_frame, cdbus_reply_bool); - cdbus_m_opts_get_do(blur_background_fixed, cdbus_reply_bool); - - cdbus_m_opts_get_do(inactive_dim, cdbus_reply_double); - cdbus_m_opts_get_do(inactive_dim_fixed, cdbus_reply_bool); - - cdbus_m_opts_get_do(max_brightness, cdbus_reply_double); - - cdbus_m_opts_get_do(use_ewmh_active_win, cdbus_reply_bool); - cdbus_m_opts_get_do(detect_transient, cdbus_reply_bool); - cdbus_m_opts_get_do(detect_client_leader, cdbus_reply_bool); - cdbus_m_opts_get_do(use_damage, cdbus_reply_bool); - -#ifdef CONFIG_OPENGL - cdbus_m_opts_get_do(glx_no_stencil, cdbus_reply_bool); - cdbus_m_opts_get_do(glx_no_rebind_pixmap, cdbus_reply_bool); -#endif - -#undef cdbus_m_opts_get_do -#undef cdbus_m_opts_get_stub - - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; -} - -// XXX Remove this after header clean up -void queue_redraw(session_t *ps); - -/** - * Process a opts_set D-Bus request. - */ -static bool cdbus_process_opts_set(session_t *ps, DBusMessage *msg) { - const char *target = NULL; - - if (!cdbus_msg_get_arg(msg, 0, DBUS_TYPE_STRING, &target)) - return false; - -#define cdbus_m_opts_set_do(tgt, type, real_type) \ - if (!strcmp(#tgt, target)) { \ - real_type val; \ - if (!cdbus_msg_get_arg(msg, 1, type, &val)) \ - return false; \ - ps->o.tgt = val; \ - goto cdbus_process_opts_set_success; \ - } - - // fade_delta - if (!strcmp("fade_delta", target)) { - int32_t val = 0; - if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_INT32, &val)) { - return false; - } - if (val <= 0) { - return false; - } - ps->o.fade_delta = max2(val, 1); - goto cdbus_process_opts_set_success; - } - - // fade_in_step - if (!strcmp("fade_in_step", target)) { - double val = 0.0; - if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_DOUBLE, &val)) - return false; - ps->o.fade_in_step = normalize_d(val); - goto cdbus_process_opts_set_success; - } - - // fade_out_step - if (!strcmp("fade_out_step", target)) { - double val = 0.0; - if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_DOUBLE, &val)) - return false; - ps->o.fade_out_step = normalize_d(val); - goto cdbus_process_opts_set_success; - } - - // no_fading_openclose - if (!strcmp("no_fading_openclose", target)) { - dbus_bool_t val = FALSE; - if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_BOOLEAN, &val)) - return false; - opts_set_no_fading_openclose(ps, val); - goto cdbus_process_opts_set_success; - } - - // unredir_if_possible - if (!strcmp("unredir_if_possible", target)) { - dbus_bool_t val = FALSE; - if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_BOOLEAN, &val)) - return false; - if (ps->o.unredir_if_possible != val) { - ps->o.unredir_if_possible = val; - queue_redraw(ps); - } - goto cdbus_process_opts_set_success; - } - - // clear_shadow - if (!strcmp("clear_shadow", target)) { - goto cdbus_process_opts_set_success; - } - - // track_focus - if (!strcmp("track_focus", target)) { - goto cdbus_process_opts_set_success; - } - - // redirected_force - if (!strcmp("redirected_force", target)) { - cdbus_enum_t val = UNSET; - if (!cdbus_msg_get_arg(msg, 1, CDBUS_TYPE_ENUM, &val)) - return false; - ps->o.redirected_force = val; - force_repaint(ps); - goto cdbus_process_opts_set_success; - } - - // stoppaint_force - cdbus_m_opts_set_do(stoppaint_force, CDBUS_TYPE_ENUM, cdbus_enum_t); - -#undef cdbus_m_opts_set_do - - log_error(CDBUS_ERROR_BADTGT_S, target); - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADTGT, CDBUS_ERROR_BADTGT_S, target); - - return true; - -cdbus_process_opts_set_success: - if (!dbus_message_get_no_reply(msg)) - cdbus_reply_bool(ps, msg, true); - return true; -} - -/** - * Process an Introspect D-Bus request. - */ -static bool cdbus_process_introspect(session_t *ps, DBusMessage *msg) { - static const char *str_introspect = - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"; - - cdbus_reply_string(ps, msg, str_introspect); - - return true; -} -///@} - -/** - * Process an D-Bus Introspect request, for /windows. - */ -static bool cdbus_process_windows_root_introspect(session_t *ps, DBusMessage *msg) { - static const char *str_introspect = - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n"; - - char *ret = NULL; - mstrextend(&ret, str_introspect); - - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - if (!w->managed) { - continue; - } - char *tmp = NULL; - asprintf(&tmp, "\n", w->id); - mstrextend(&ret, tmp); - free(tmp); - } - mstrextend(&ret, ""); - - bool success = cdbus_reply_string(ps, msg, ret); - free(ret); - return success; -} - -static bool cdbus_process_window_introspect(session_t *ps, DBusMessage *msg) { - // clang-format off - static const char *str_introspect = - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n"; - // clang-format on - - return cdbus_reply_string(ps, msg, str_introspect); -} - -/** - * Process a message from D-Bus. - */ -static DBusHandlerResult -cdbus_process(DBusConnection *c attr_unused, DBusMessage *msg, void *ud) { - session_t *ps = ud; - bool handled = false; - -#define cdbus_m_ismethod(method) \ - dbus_message_is_method_call(msg, CDBUS_INTERFACE_NAME, method) - - if (cdbus_m_ismethod("reset")) { - log_info("picom is resetting..."); - ev_break(ps->loop, EVBREAK_ALL); - if (!dbus_message_get_no_reply(msg)) - cdbus_reply_bool(ps, msg, true); - handled = true; - } else if (cdbus_m_ismethod("repaint")) { - force_repaint(ps); - if (!dbus_message_get_no_reply(msg)) - cdbus_reply_bool(ps, msg, true); - handled = true; - } else if (cdbus_m_ismethod("list_win")) { - handled = cdbus_process_list_win(ps, msg); - } else if (cdbus_m_ismethod("win_get")) { - handled = cdbus_process_win_get(ps, msg); - } else if (cdbus_m_ismethod("win_set")) { - handled = cdbus_process_win_set(ps, msg); - } else if (cdbus_m_ismethod("find_win")) { - handled = cdbus_process_find_win(ps, msg); - } else if (cdbus_m_ismethod("opts_get")) { - handled = cdbus_process_opts_get(ps, msg); - } else if (cdbus_m_ismethod("opts_set")) { - handled = cdbus_process_opts_set(ps, msg); - } -#undef cdbus_m_ismethod - else if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Introspectable", - "Introspect")) { - handled = cdbus_process_introspect(ps, msg); - } else if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Peer", "Ping")) { - cdbus_reply(ps, msg, NULL, NULL); - handled = true; - } else if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Peer", - "GetMachineId")) { - char *uuid = dbus_get_local_machine_id(); - if (uuid) { - cdbus_reply_string(ps, msg, uuid); - dbus_free(uuid); - handled = true; - } - } else if (dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameAcquired") || - dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameLost")) { - handled = true; - } else { - if (DBUS_MESSAGE_TYPE_ERROR == dbus_message_get_type(msg)) { - log_error( - "Error message of path \"%s\" " - "interface \"%s\", member \"%s\", error \"%s\"", - dbus_message_get_path(msg), dbus_message_get_interface(msg), - dbus_message_get_member(msg), dbus_message_get_error_name(msg)); - } else { - log_error("Illegal message of type \"%s\", path \"%s\" " - "interface \"%s\", member \"%s\"", - cdbus_repr_msgtype(msg), dbus_message_get_path(msg), - dbus_message_get_interface(msg), - dbus_message_get_member(msg)); - } - if (DBUS_MESSAGE_TYPE_METHOD_CALL == dbus_message_get_type(msg) && - !dbus_message_get_no_reply(msg)) - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADMSG, CDBUS_ERROR_BADMSG_S); - handled = true; - } - - // If the message could not be processed, and an reply is expected, return - // an empty reply. - if (!handled && DBUS_MESSAGE_TYPE_METHOD_CALL == dbus_message_get_type(msg) && - !dbus_message_get_no_reply(msg)) { - cdbus_reply_err(ps, msg, CDBUS_ERROR_UNKNOWN, CDBUS_ERROR_UNKNOWN_S); - handled = true; - } - - return handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -/** - * Process a message from D-Bus, for /windows path. - */ -static DBusHandlerResult -cdbus_process_windows(DBusConnection *c attr_unused, DBusMessage *msg, void *ud) { - session_t *ps = ud; - bool handled = false; - const char *path = dbus_message_get_path(msg); - const char *last_segment = strrchr(path, '/'); - if (last_segment == NULL) { - if (DBUS_MESSAGE_TYPE_METHOD_CALL == dbus_message_get_type(msg) && - !dbus_message_get_no_reply(msg)) - cdbus_reply_err(ps, msg, CDBUS_ERROR_BADMSG, CDBUS_ERROR_BADMSG_S); - return DBUS_HANDLER_RESULT_HANDLED; - } - bool is_root = strncmp(last_segment, "/windows", 8) == 0; - if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Introspectable", - "Introspect")) { - if (is_root) { - handled = cdbus_process_windows_root_introspect(ps, msg); - } else { - handled = cdbus_process_window_introspect(ps, msg); - } - goto finished; - } - - if (!is_root) { - auto wid = (cdbus_window_t)strtol(last_segment + 1, NULL, 0); - if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Properties", - "GetAll")) { - handled = cdbus_reply(ps, msg, cdbus_append_empty_dict, NULL); - goto finished; - } - - if (dbus_message_is_method_call(msg, "org.freedesktop.DBus.Properties", "Get")) { - handled = cdbus_process_window_property_get(ps, msg, wid); - goto finished; - } - } - - if (dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameAcquired") || - dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameLost")) { - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (DBUS_MESSAGE_TYPE_ERROR == dbus_message_get_type(msg)) { - log_error("Error message of path \"%s\" " - "interface \"%s\", member \"%s\", error \"%s\"", - dbus_message_get_path(msg), dbus_message_get_interface(msg), - dbus_message_get_member(msg), dbus_message_get_error_name(msg)); - } else { - log_error("Illegal message of type \"%s\", path \"%s\" " - "interface \"%s\", member \"%s\"", - cdbus_repr_msgtype(msg), dbus_message_get_path(msg), - dbus_message_get_interface(msg), dbus_message_get_member(msg)); - } - if (DBUS_MESSAGE_TYPE_METHOD_CALL == dbus_message_get_type(msg) && - !dbus_message_get_no_reply(msg)) { - handled = cdbus_reply_err(ps, msg, CDBUS_ERROR_BADMSG, CDBUS_ERROR_BADMSG_S); - } - -finished: - if (!handled && dbus_message_get_type(msg) == DBUS_MESSAGE_TYPE_METHOD_CALL && - !dbus_message_get_no_reply(msg)) { - handled = - cdbus_reply_err(ps, msg, CDBUS_ERROR_UNKNOWN, CDBUS_ERROR_UNKNOWN_S); - } - return handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -/** @name Core callbacks - */ -///@{ -void cdbus_ev_win_added(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_added", w->id); - cdbus_signal_wid(ps, PICOM_COMPOSITOR_INTERFACE, "WinAdded", w->id); - } -} - -void cdbus_ev_win_destroyed(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_destroyed", w->id); - cdbus_signal_wid(ps, PICOM_COMPOSITOR_INTERFACE, "WinDestroyed", w->id); - } -} - -void cdbus_ev_win_mapped(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_mapped", w->id); - cdbus_signal_wid(ps, PICOM_COMPOSITOR_INTERFACE, "WinMapped", w->id); - } -} - -void cdbus_ev_win_unmapped(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_unmapped", w->id); - cdbus_signal_wid(ps, PICOM_COMPOSITOR_INTERFACE, "WinUnmapped", w->id); - } -} - -void cdbus_ev_win_focusout(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_focusout", w->id); - } -} - -void cdbus_ev_win_focusin(session_t *ps, struct win *w) { - struct cdbus_data *cd = ps->dbus_data; - if (cd->dbus_conn) { - cdbus_signal_wid(ps, CDBUS_INTERFACE_NAME, "win_focusin", w->id); - } -} -//!@} diff --git a/dwm/picom/src/dbus.h b/dwm/picom/src/dbus.h deleted file mode 100644 index 54a58af..0000000 --- a/dwm/picom/src/dbus.h +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#include - -#include - -typedef struct session session_t; -struct win; - -/** - * Return a string representation of a D-Bus message type. - */ -static inline const char *cdbus_repr_msgtype(DBusMessage *msg) { - return dbus_message_type_to_string(dbus_message_get_type(msg)); -} - -/** - * Initialize D-Bus connection. - */ -bool cdbus_init(session_t *ps, const char *uniq_name); - -/** - * Destroy D-Bus connection. - */ -void cdbus_destroy(session_t *ps); - -/// Generate dbus win_added signal -void cdbus_ev_win_added(session_t *ps, struct win *w); - -/// Generate dbus win_destroyed signal -void cdbus_ev_win_destroyed(session_t *ps, struct win *w); - -/// Generate dbus win_mapped signal -void cdbus_ev_win_mapped(session_t *ps, struct win *w); - -/// Generate dbus win_unmapped signal -void cdbus_ev_win_unmapped(session_t *ps, struct win *w); - -/// Generate dbus win_focusout signal -void cdbus_ev_win_focusout(session_t *ps, struct win *w); - -/// Generate dbus win_focusin signal -void cdbus_ev_win_focusin(session_t *ps, struct win *w); - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/diagnostic.c b/dwm/picom/src/diagnostic.c deleted file mode 100644 index d275b1a..0000000 --- a/dwm/picom/src/diagnostic.c +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui - -#include -#include -#include - -#include "backend/driver.h" -#include "diagnostic.h" -#include "config.h" -#include "picom.h" -#include "common.h" - -void print_diagnostics(session_t *ps, const char *config_file, bool compositor_running) { - printf("**Version:** " COMPTON_VERSION "\n"); - //printf("**CFLAGS:** %s\n", "??"); - printf("\n### Extensions:\n\n"); - printf("* Shape: %s\n", ps->shape_exists ? "Yes" : "No"); - printf("* XRandR: %s\n", ps->randr_exists ? "Yes" : "No"); - printf("* Present: %s\n", ps->present_exists ? "Present" : "Not Present"); - printf("\n### Misc:\n\n"); - printf("* Use Overlay: %s\n", ps->overlay != XCB_NONE ? "Yes" : "No"); - if (ps->overlay == XCB_NONE) { - if (compositor_running) { - printf(" (Another compositor is already running)\n"); - } else if (session_redirection_mode(ps) != XCB_COMPOSITE_REDIRECT_MANUAL) { - printf(" (Not in manual redirection mode)\n"); - } else { - printf("\n"); - } - } -#ifdef __FAST_MATH__ - printf("* Fast Math: Yes\n"); -#endif - printf("* Config file used: %s\n", config_file ?: "None"); - printf("\n### Drivers (inaccurate):\n\n"); - print_drivers(ps->drivers); - - for (int i = 0; i < NUM_BKEND; i++) { - if (backend_list[i] && backend_list[i]->diagnostics) { - printf("\n### Backend: %s\n\n", BACKEND_STRS[i]); - auto data = backend_list[i]->init(ps); - if (!data) { - printf(" Cannot initialize this backend\n"); - } else { - backend_list[i]->diagnostics(data); - backend_list[i]->deinit(data); - } - } - } -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/diagnostic.h b/dwm/picom/src/diagnostic.h deleted file mode 100644 index c958589..0000000 --- a/dwm/picom/src/diagnostic.h +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui - -#pragma once -#include - -typedef struct session session_t; - -void print_diagnostics(session_t *, const char *config_file, bool compositor_running); diff --git a/dwm/picom/src/err.h b/dwm/picom/src/err.h deleted file mode 100644 index f989bf9..0000000 --- a/dwm/picom/src/err.h +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2019 Yuxuan Shui - -#pragma once -#include -#include -#include "compiler.h" - -// Functions for error reporting, adopted from Linux - -// INFO in user space we can probably be more liberal about what pointer we consider -// error. e.g. In x86_64 Linux, all addresses with the highest bit set is invalid in user -// space. -#define MAX_ERRNO 4095 - -static inline void *must_use ERR_PTR(intptr_t err) { - return (void *)err; -} - -static inline intptr_t must_use PTR_ERR(void *ptr) { - return (intptr_t)ptr; -} - -static inline bool must_use IS_ERR(void *ptr) { - return unlikely((uintptr_t)ptr > (uintptr_t)-MAX_ERRNO); -} - -static inline bool must_use IS_ERR_OR_NULL(void *ptr) { - return unlikely(!ptr) || IS_ERR(ptr); -} - -static inline intptr_t must_use PTR_ERR_OR_ZERO(void *ptr) { - if (IS_ERR(ptr)) { - return PTR_ERR(ptr); - } - return 0; -} diff --git a/dwm/picom/src/event.c b/dwm/picom/src/event.c deleted file mode 100644 index beec195..0000000 --- a/dwm/picom/src/event.c +++ /dev/null @@ -1,757 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2019, Yuxuan Shui - -#include - -#include -#include -#include -#include - -#include "atom.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "event.h" -#include "log.h" -#include "picom.h" -#include "region.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -/// Event handling with X is complicated. Handling events with other events possibly -/// in-flight is no good. Because your internal state won't be up to date. Also, querying -/// the server while events are in-flight is not good. Because events later in the queue -/// might container information you are querying. Thus those events will cause you to do -/// unnecessary updates even when you already have the latest information (remember, you -/// made the query when those events were already in the queue. so the reply you got is -/// more up-to-date than the events). Also, handling events when other client are making -/// concurrent requests is not good. Because the server states are changing without you -/// knowning them. This is super racy, and can cause lots of potential problems. -/// -/// All of above mandates we do these things: -/// 1. Grab server when handling events -/// 2. Make sure the event queue is empty before we make any query to the server -/// -/// Notice (2) has a dependency circle. To handle events, you sometimes need to make -/// queries. But to make queries you have to first handle events. -/// -/// To break that circle, we split all event handling into top and bottom halves. The -/// bottom half will just look at the event itself, update as much state as they can -/// without making queries, then queue up necessary works need to be done by the top half. -/// The top half will do all the other necessary updates. Before entering the top half, we -/// grab the server and make sure the event queue is empty. -/// -/// When top half finished, we enter the render stage, where no server state should be -/// queried. All rendering should be done with our internal knowledge of the server state. -/// - -// TODO(yshui) the things described above - -/** - * Get a window's name from window ID. - */ -static inline const char *ev_window_name(session_t *ps, xcb_window_t wid) { - char *name = ""; - if (wid) { - name = "(Failed to get title)"; - if (ps->root == wid) { - name = "(Root window)"; - } else if (ps->overlay == wid) { - name = "(Overlay)"; - } else { - auto w = find_managed_win(ps, wid); - if (!w) { - w = find_toplevel(ps, wid); - } - - if (w && w->name) { - name = w->name; - } - } - } - return name; -} - -static inline xcb_window_t attr_pure ev_window(session_t *ps, xcb_generic_event_t *ev) { - switch (ev->response_type) { - case FocusIn: - case FocusOut: return ((xcb_focus_in_event_t *)ev)->event; - case CreateNotify: return ((xcb_create_notify_event_t *)ev)->window; - case ConfigureNotify: return ((xcb_configure_notify_event_t *)ev)->window; - case DestroyNotify: return ((xcb_destroy_notify_event_t *)ev)->window; - case MapNotify: return ((xcb_map_notify_event_t *)ev)->window; - case UnmapNotify: return ((xcb_unmap_notify_event_t *)ev)->window; - case ReparentNotify: return ((xcb_reparent_notify_event_t *)ev)->window; - case CirculateNotify: return ((xcb_circulate_notify_event_t *)ev)->window; - case Expose: return ((xcb_expose_event_t *)ev)->window; - case PropertyNotify: return ((xcb_property_notify_event_t *)ev)->window; - case ClientMessage: return ((xcb_client_message_event_t *)ev)->window; - default: - if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type) { - return ((xcb_damage_notify_event_t *)ev)->drawable; - } - - if (ps->shape_exists && ev->response_type == ps->shape_event) { - return ((xcb_shape_notify_event_t *)ev)->affected_window; - } - - return 0; - } -} - -#define CASESTRRET(s) \ - case s: return #s; - -static inline const char *ev_name(session_t *ps, xcb_generic_event_t *ev) { - static char buf[128]; - switch (ev->response_type & 0x7f) { - CASESTRRET(FocusIn); - CASESTRRET(FocusOut); - CASESTRRET(CreateNotify); - CASESTRRET(ConfigureNotify); - CASESTRRET(DestroyNotify); - CASESTRRET(MapNotify); - CASESTRRET(UnmapNotify); - CASESTRRET(ReparentNotify); - CASESTRRET(CirculateNotify); - CASESTRRET(Expose); - CASESTRRET(PropertyNotify); - CASESTRRET(ClientMessage); - } - - if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type) - return "Damage"; - - if (ps->shape_exists && ev->response_type == ps->shape_event) - return "ShapeNotify"; - - if (ps->xsync_exists) { - int o = ev->response_type - ps->xsync_event; - switch (o) { - CASESTRRET(XSyncCounterNotify); - CASESTRRET(XSyncAlarmNotify); - } - } - - sprintf(buf, "Event %d", ev->response_type); - - return buf; -} - -static inline const char *attr_pure ev_focus_mode_name(xcb_focus_in_event_t *ev) { - switch (ev->mode) { - CASESTRRET(NotifyNormal); - CASESTRRET(NotifyWhileGrabbed); - CASESTRRET(NotifyGrab); - CASESTRRET(NotifyUngrab); - } - - return "Unknown"; -} - -static inline const char *attr_pure ev_focus_detail_name(xcb_focus_in_event_t *ev) { - switch (ev->detail) { - CASESTRRET(NotifyAncestor); - CASESTRRET(NotifyVirtual); - CASESTRRET(NotifyInferior); - CASESTRRET(NotifyNonlinear); - CASESTRRET(NotifyNonlinearVirtual); - CASESTRRET(NotifyPointer); - CASESTRRET(NotifyPointerRoot); - CASESTRRET(NotifyDetailNone); - } - - return "Unknown"; -} - -#undef CASESTRRET - -static inline void ev_focus_in(session_t *ps, xcb_focus_in_event_t *ev) { - log_debug("{ mode: %s, detail: %s }\n", ev_focus_mode_name(ev), - ev_focus_detail_name(ev)); - ps->pending_updates = true; -} - -static inline void ev_focus_out(session_t *ps, xcb_focus_out_event_t *ev) { - log_debug("{ mode: %s, detail: %s }\n", ev_focus_mode_name(ev), - ev_focus_detail_name(ev)); - ps->pending_updates = true; -} - -static inline void ev_create_notify(session_t *ps, xcb_create_notify_event_t *ev) { - if (ev->parent == ps->root) { - add_win_top(ps, ev->window); - } -} - -/// Handle configure event of a regular window -static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { - auto w = find_win(ps, ce->window); - - if (!w) { - return; - } - - if (!w->managed) { - restack_above(ps, w, ce->above_sibling); - return; - } - - auto mw = (struct managed_win *)w; - - restack_above(ps, w, ce->above_sibling); - - // We check against pending_g here, because there might have been multiple - // configure notifies in this cycle, or the window could receive multiple updates - // while it's unmapped. - bool position_changed = mw->pending_g.x != ce->x || mw->pending_g.y != ce->y; - bool size_changed = mw->pending_g.width != ce->width || - mw->pending_g.height != ce->height || - mw->pending_g.border_width != ce->border_width; - if (position_changed || size_changed) { - // Queue pending updates - win_set_flags(mw, WIN_FLAGS_FACTOR_CHANGED); - // TODO(yshui) don't set pending_updates if the window is not - // visible/mapped - ps->pending_updates = true; - - // At least one of the following if's is true - if (position_changed) { - log_trace("Window position changed, %dx%d -> %dx%d", mw->g.x, - mw->g.y, ce->x, ce->y); - mw->pending_g.x = ce->x; - mw->pending_g.y = ce->y; - win_set_flags(mw, WIN_FLAGS_POSITION_STALE); - } - - if (size_changed) { - log_trace("Window size changed, %dx%d -> %dx%d", mw->g.width, - mw->g.height, ce->width, ce->height); - mw->pending_g.width = ce->width; - mw->pending_g.height = ce->height; - mw->pending_g.border_width = ce->border_width; - win_set_flags(mw, WIN_FLAGS_SIZE_STALE); - } - - // Recalculate which screen this window is on - win_update_screen(ps->xinerama_nscrs, ps->xinerama_scr_regs, mw); - } - - // override_redirect flag cannot be changed after window creation, as far - // as I know, so there's no point to re-match windows here. - mw->a.override_redirect = ce->override_redirect; -} - -static inline void ev_configure_notify(session_t *ps, xcb_configure_notify_event_t *ev) { - log_debug("{ send_event: %d, id: %#010x, above: %#010x, override_redirect: %d }", - ev->event, ev->window, ev->above_sibling, ev->override_redirect); - if (ev->window == ps->root) { - set_root_flags(ps, ROOT_FLAGS_CONFIGURED); - } else { - configure_win(ps, ev); - } -} - -static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *ev) { - auto w = find_win(ps, ev->window); - auto mw = find_toplevel(ps, ev->window); - if (mw && mw->client_win == mw->base.id) { - // We only want _real_ frame window - assert(&mw->base == w); - mw = NULL; - } - assert(w == NULL || mw == NULL); - - if (w != NULL) { - auto _ attr_unused = destroy_win_start(ps, w); - } else if (mw != NULL) { - win_unmark_client(ps, mw); - win_set_flags(mw, WIN_FLAGS_CLIENT_STALE); - ps->pending_updates = true; - } else { - log_debug("Received a destroy notify from an unknown window, %#010x", - ev->window); - } -} - -static inline void ev_map_notify(session_t *ps, xcb_map_notify_event_t *ev) { - // Unmap overlay window if it got mapped but we are currently not - // in redirected state. - if (ps->overlay && ev->window == ps->overlay && !ps->redirected) { - log_debug("Overlay is mapped while we are not redirected"); - auto e = xcb_request_check(ps->c, xcb_unmap_window(ps->c, ps->overlay)); - if (e) { - log_error("Failed to unmap the overlay window"); - free(e); - } - // We don't track the overlay window, so we can return - return; - } - - auto w = find_managed_win(ps, ev->window); - if (!w) { - return; - } - - win_set_flags(w, WIN_FLAGS_MAPPED); - - // FocusIn/Out may be ignored when the window is unmapped, so we must - // recheck focus here - ps->pending_updates = true; // to update focus -} - -static inline void ev_unmap_notify(session_t *ps, xcb_unmap_notify_event_t *ev) { - auto w = find_managed_win(ps, ev->window); - if (w) { - unmap_win_start(ps, w); - } -} - -static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t *ev) { - log_debug("Window %#010x has new parent: %#010x, override_redirect: %d", - ev->window, ev->parent, ev->override_redirect); - auto w_top = find_toplevel(ps, ev->window); - if (w_top) { - win_unmark_client(ps, w_top); - win_set_flags(w_top, WIN_FLAGS_CLIENT_STALE); - ps->pending_updates = true; - } - - if (ev->parent == ps->root) { - // X will generate reparent notifiy even if the parent didn't actually - // change (i.e. reparent again to current parent). So we check if that's - // the case - auto w = find_win(ps, ev->window); - if (w) { - // This window has already been reparented to root before, - // so we don't need to create a new window for it, we just need to - // move it to the top - restack_top(ps, w); - } else { - add_win_top(ps, ev->window); - } - } else { - // otherwise, find and destroy the window first - { - auto w = find_win(ps, ev->window); - if (w) { - auto ret = destroy_win_start(ps, w); - if (!ret && w->managed) { - auto mw = (struct managed_win *)w; - CHECK(win_skip_fading(ps, mw)); - } - } - } - - // Reset event mask in case something wrong happens - xcb_change_window_attributes( - ps->c, ev->window, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask(ps, ev->window, WIN_EVMODE_UNKNOWN)}); - - if (!wid_has_prop(ps, ev->window, ps->atoms->aWM_STATE)) { - log_debug("Window %#010x doesn't have WM_STATE property, it is " - "probably not a client window. But we will listen for " - "property change in case it gains one.", - ev->window); - xcb_change_window_attributes( - ps->c, ev->window, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask(ps, ev->window, WIN_EVMODE_UNKNOWN) | - XCB_EVENT_MASK_PROPERTY_CHANGE}); - } else { - auto w_real_top = find_managed_window_or_parent(ps, ev->parent); - if (w_real_top && w_real_top->state != WSTATE_UNMAPPED && - w_real_top->state != WSTATE_UNMAPPING) { - log_debug("Mark window %#010x (%s) as having a stale " - "client", - w_real_top->base.id, w_real_top->name); - win_set_flags(w_real_top, WIN_FLAGS_CLIENT_STALE); - ps->pending_updates = true; - } else { - if (!w_real_top) - log_debug("parent %#010x not found", ev->parent); - else { - // Window is not currently mapped, unmark its - // client to trigger a client recheck when it is - // mapped later. - win_unmark_client(ps, w_real_top); - log_debug("parent %#010x (%s) is in state %d", - w_real_top->base.id, w_real_top->name, - w_real_top->state); - } - } - } - } -} - -static inline void ev_circulate_notify(session_t *ps, xcb_circulate_notify_event_t *ev) { - auto w = find_win(ps, ev->window); - - if (!w) - return; - - if (ev->place == PlaceOnTop) { - restack_top(ps, w); - } else { - restack_bottom(ps, w); - } -} - -static inline void expose_root(session_t *ps, const rect_t *rects, int nrects) { - region_t region; - pixman_region32_init_rects(®ion, rects, nrects); - add_damage(ps, ®ion); - pixman_region32_fini(®ion); -} - -static inline void ev_expose(session_t *ps, xcb_expose_event_t *ev) { - if (ev->window == ps->root || (ps->overlay && ev->window == ps->overlay)) { - int more = ev->count + 1; - if (ps->n_expose == ps->size_expose) { - if (ps->expose_rects) { - ps->expose_rects = - crealloc(ps->expose_rects, ps->size_expose + more); - ps->size_expose += more; - } else { - ps->expose_rects = ccalloc(more, rect_t); - ps->size_expose = more; - } - } - - ps->expose_rects[ps->n_expose].x1 = ev->x; - ps->expose_rects[ps->n_expose].y1 = ev->y; - ps->expose_rects[ps->n_expose].x2 = ev->x + ev->width; - ps->expose_rects[ps->n_expose].y2 = ev->y + ev->height; - ps->n_expose++; - - if (ev->count == 0) { - expose_root(ps, ps->expose_rects, ps->n_expose); - ps->n_expose = 0; - } - } -} - -static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t *ev) { - if (unlikely(log_get_level_tls() <= LOG_LEVEL_TRACE)) { - // Print out changed atom - xcb_get_atom_name_reply_t *reply = - xcb_get_atom_name_reply(ps->c, xcb_get_atom_name(ps->c, ev->atom), NULL); - const char *name = "?"; - int name_len = 1; - if (reply) { - name = xcb_get_atom_name_name(reply); - name_len = xcb_get_atom_name_name_length(reply); - } - - log_debug("{ atom = %.*s }", name_len, name); - free(reply); - } - - if (ps->root == ev->window) { - // If desktop number property changes - if (ev->atom == ps->atoms->a_NET_CURRENT_DESKTOP) { - auto prop = x_get_prop(ps->c, ps->root, ps->atoms->a_NET_CURRENT_DESKTOP, - 1L, XCB_ATOM_CARDINAL, 32); - - if (prop.nitems) { - ps->root_desktop_switch_direction = ((int)*prop.c32) - ps->root_desktop_num; - ps->root_desktop_num = (int)*prop.c32; - } - } - - if (ps->o.use_ewmh_active_win && ps->atoms->a_NET_ACTIVE_WINDOW == ev->atom) { - // to update focus - ps->pending_updates = true; - } else { - // Destroy the root "image" if the wallpaper probably changed - if (x_is_root_back_pixmap_atom(ps->atoms, ev->atom)) { - root_damaged(ps); - } - } - - // Unconcerned about any other proprties on root window - return; - } - - ps->pending_updates = true; - // If WM_STATE changes - if (ev->atom == ps->atoms->aWM_STATE) { - // Check whether it could be a client window - if (!find_toplevel(ps, ev->window)) { - // Reset event mask anyway - xcb_change_window_attributes(ps->c, ev->window, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask( - ps, ev->window, WIN_EVMODE_UNKNOWN)}); - - auto w_top = find_managed_window_or_parent(ps, ev->window); - // ev->window might have not been managed yet, in that case w_top - // would be NULL. - if (w_top) { - win_set_flags(w_top, WIN_FLAGS_CLIENT_STALE); - } - } - return; - } - - // If _NET_WM_WINDOW_TYPE changes... God knows why this would happen, but - // there are always some stupid applications. (#144) - if (ev->atom == ps->atoms->a_NET_WM_WINDOW_TYPE) { - struct managed_win *w = NULL; - if ((w = find_toplevel(ps, ev->window))) { - win_set_property_stale(w, ev->atom); - } - } - - if (ev->atom == ps->atoms->a_NET_WM_BYPASS_COMPOSITOR) { - // Unnecessay until we remove the queue_redraw in ev_handle - queue_redraw(ps); - } - - // If _NET_WM_WINDOW_OPACITY changes - if (ev->atom == ps->atoms->a_NET_WM_WINDOW_OPACITY) { - auto w = find_managed_win(ps, ev->window) ?: find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If frame extents property changes - if (ev->atom == ps->atoms->a_NET_FRAME_EXTENTS) { - auto w = find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If name changes - if (ps->atoms->aWM_NAME == ev->atom || ps->atoms->a_NET_WM_NAME == ev->atom) { - auto w = find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If class changes - if (ps->atoms->aWM_CLASS == ev->atom) { - auto w = find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If role changes - if (ps->atoms->aWM_WINDOW_ROLE == ev->atom) { - auto w = find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If _COMPTON_SHADOW changes - if (ps->atoms->a_COMPTON_SHADOW == ev->atom) { - auto w = find_managed_win(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // If a leader property changes - if ((ps->o.detect_transient && ps->atoms->aWM_TRANSIENT_FOR == ev->atom) || - (ps->o.detect_client_leader && ps->atoms->aWM_CLIENT_LEADER == ev->atom)) { - auto w = find_toplevel(ps, ev->window); - if (w) { - win_set_property_stale(w, ev->atom); - } - } - - // Check for other atoms we are tracking - for (latom_t *platom = ps->track_atom_lst; platom; platom = platom->next) { - if (platom->atom == ev->atom) { - auto w = find_managed_win(ps, ev->window); - if (!w) { - w = find_toplevel(ps, ev->window); - } - if (w) { - // Set FACTOR_CHANGED so rules based on properties will be - // re-evaluated. - // Don't need to set property stale here, since that only - // concerns properties we explicitly check. - win_set_flags(w, WIN_FLAGS_FACTOR_CHANGED); - } - break; - } - } -} - -static inline void repair_win(session_t *ps, struct managed_win *w) { - // Only mapped window can receive damages - assert(win_is_mapped_in_x(w)); - - region_t parts; - pixman_region32_init(&parts); - - if (!w->ever_damaged) { - win_extents(w, &parts); - set_ignore_cookie( - ps, xcb_damage_subtract(ps->c, w->damage, XCB_NONE, XCB_NONE)); - } else { - set_ignore_cookie( - ps, xcb_damage_subtract(ps->c, w->damage, XCB_NONE, ps->damaged_region)); - x_fetch_region(ps->c, ps->damaged_region, &parts); - pixman_region32_translate(&parts, w->g.x + w->g.border_width, - w->g.y + w->g.border_width); - } - - log_trace("Mark window %#010x (%s) as having received damage", w->base.id, w->name); - w->ever_damaged = true; - w->pixmap_damaged = true; - - // Why care about damage when screen is unredirected? - // We will force full-screen repaint on redirection. - if (!ps->redirected) { - pixman_region32_fini(&parts); - return; - } - - // Remove the part in the damage area that could be ignored - if (w->reg_ignore && win_is_region_ignore_valid(ps, w)) { - pixman_region32_subtract(&parts, &parts, w->reg_ignore); - } - - add_damage(ps, &parts); - pixman_region32_fini(&parts); -} - -static inline void ev_damage_notify(session_t *ps, xcb_damage_notify_event_t *de) { - /* - if (ps->root == de->drawable) { - root_damaged(); - return; - } */ - - auto w = find_managed_win(ps, de->drawable); - - if (!w) { - return; - } - - repair_win(ps, w); -} - -static inline void ev_shape_notify(session_t *ps, xcb_shape_notify_event_t *ev) { - auto w = find_managed_win(ps, ev->affected_window); - if (!w || w->a.map_state == XCB_MAP_STATE_UNMAPPED) { - return; - } - - /* - * Empty bounding_shape may indicated an - * unmapped/destroyed window, in which case - * seemingly BadRegion errors would be triggered - * if we attempt to rebuild border_size - */ - // Mark the old bounding shape as damaged - if (!win_check_flags_any(w, WIN_FLAGS_SIZE_STALE | WIN_FLAGS_POSITION_STALE)) { - region_t tmp = win_get_bounding_shape_global_by_val(w); - add_damage(ps, &tmp); - pixman_region32_fini(&tmp); - } - w->reg_ignore_valid = false; - - win_set_flags(w, WIN_FLAGS_SIZE_STALE); - ps->pending_updates = true; -} - -static inline void -ev_selection_clear(session_t *ps, xcb_selection_clear_event_t attr_unused *ev) { - // The only selection we own is the _NET_WM_CM_Sn selection. - // If we lose that one, we should exit. - log_fatal("Another composite manager started and took the _NET_WM_CM_Sn " - "selection."); - quit(ps); -} - -void ev_handle(session_t *ps, xcb_generic_event_t *ev) { - if ((ev->response_type & 0x7f) != KeymapNotify) { - discard_ignore(ps, ev->full_sequence); - } - - xcb_window_t wid = ev_window(ps, ev); - if (ev->response_type != ps->damage_event + XCB_DAMAGE_NOTIFY) { - log_debug("event %10.10s serial %#010x window %#010x \"%s\"", - ev_name(ps, ev), ev->full_sequence, wid, ev_window_name(ps, wid)); - } else { - log_trace("event %10.10s serial %#010x window %#010x \"%s\"", - ev_name(ps, ev), ev->full_sequence, wid, ev_window_name(ps, wid)); - } - - // Check if a custom XEvent constructor was registered in xlib for this event - // type, and call it discarding the constructed XEvent if any. XESetWireToEvent - // might be used by libraries to intercept messages from the X server e.g. the - // OpenGL lib waiting for DRI2 events. - - // XXX This exists to workaround compton issue #33, #34, #47 - // For even more details, see: - // https://bugs.freedesktop.org/show_bug.cgi?id=35945 - // https://lists.freedesktop.org/archives/xcb/2011-November/007337.html - auto proc = XESetWireToEvent(ps->dpy, ev->response_type, 0); - if (proc) { - XESetWireToEvent(ps->dpy, ev->response_type, proc); - XEvent dummy; - - // Stop Xlib from complaining about lost sequence numbers. - // proc might also just be Xlib internal event processing functions, and - // because they probably won't see all X replies, they will complain about - // missing sequence numbers. - // - // We only need the low 16 bits - ev->sequence = (uint16_t)(LastKnownRequestProcessed(ps->dpy) & 0xffff); - proc(ps->dpy, &dummy, (xEvent *)ev); - } - - // XXX redraw needs to be more fine grained - queue_redraw(ps); - - switch (ev->response_type) { - case FocusIn: ev_focus_in(ps, (xcb_focus_in_event_t *)ev); break; - case FocusOut: ev_focus_out(ps, (xcb_focus_out_event_t *)ev); break; - case CreateNotify: ev_create_notify(ps, (xcb_create_notify_event_t *)ev); break; - case ConfigureNotify: - ev_configure_notify(ps, (xcb_configure_notify_event_t *)ev); - break; - case DestroyNotify: - ev_destroy_notify(ps, (xcb_destroy_notify_event_t *)ev); - break; - case MapNotify: ev_map_notify(ps, (xcb_map_notify_event_t *)ev); break; - case UnmapNotify: ev_unmap_notify(ps, (xcb_unmap_notify_event_t *)ev); break; - case ReparentNotify: - ev_reparent_notify(ps, (xcb_reparent_notify_event_t *)ev); - break; - case CirculateNotify: - ev_circulate_notify(ps, (xcb_circulate_notify_event_t *)ev); - break; - case Expose: ev_expose(ps, (xcb_expose_event_t *)ev); break; - case PropertyNotify: - ev_property_notify(ps, (xcb_property_notify_event_t *)ev); - break; - case SelectionClear: - ev_selection_clear(ps, (xcb_selection_clear_event_t *)ev); - break; - case 0: ev_xcb_error(ps, (xcb_generic_error_t *)ev); break; - default: - if (ps->shape_exists && ev->response_type == ps->shape_event) { - ev_shape_notify(ps, (xcb_shape_notify_event_t *)ev); - break; - } - if (ps->randr_exists && - ev->response_type == (ps->randr_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY)) { - set_root_flags(ps, ROOT_FLAGS_SCREEN_CHANGE); - break; - } - if (ps->damage_event + XCB_DAMAGE_NOTIFY == ev->response_type) { - ev_damage_notify(ps, (xcb_damage_notify_event_t *)ev); - break; - } - } -} diff --git a/dwm/picom/src/event.h b/dwm/picom/src/event.h deleted file mode 100644 index 629dec0..0000000 --- a/dwm/picom/src/event.h +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2019, Yuxuan Shui - -#include - -#include "common.h" - -void ev_handle(session_t *ps, xcb_generic_event_t *ev); diff --git a/dwm/picom/src/file_watch.c b/dwm/picom/src/file_watch.c deleted file mode 100644 index faa8f68..0000000 --- a/dwm/picom/src/file_watch.c +++ /dev/null @@ -1,188 +0,0 @@ -#include -#include -#ifdef HAS_INOTIFY -#include -#elif HAS_KQUEUE -// clang-format off -#include -// clang-format on -#include -#undef EV_ERROR // Avoid clashing with libev's EV_ERROR -#include // For O_RDONLY -#include // For struct timespec -#include // For open -#endif - -#include -#include - -#include "file_watch.h" -#include "list.h" -#include "log.h" -#include "utils.h" - -struct watched_file { - int wd; - void *ud; - file_watch_cb_t cb; - - UT_hash_handle hh; -}; - -struct file_watch_registry { - struct ev_io w; - - struct watched_file *reg; -}; - -static void file_watch_ev_cb(EV_P attr_unused, struct ev_io *w, int revent attr_unused) { - auto fwr = (struct file_watch_registry *)w; - - while (true) { - int wd = -1; -#ifdef HAS_INOTIFY - struct inotify_event inotify_event; - auto ret = read(w->fd, &inotify_event, sizeof(struct inotify_event)); - if (ret < 0) { - if (errno != EAGAIN) { - log_error_errno("Failed to read from inotify fd"); - } - break; - } - wd = inotify_event.wd; -#elif HAS_KQUEUE - struct kevent ev; - struct timespec timeout = {0}; - int ret = kevent(fwr->w.fd, NULL, 0, &ev, 1, &timeout); - if (ret <= 0) { - if (ret < 0) { - log_error_errno("Failed to get kevent"); - } - break; - } - wd = (int)ev.ident; -#else - assert(false); -#endif - - struct watched_file *wf = NULL; - HASH_FIND_INT(fwr->reg, &wd, wf); - if (!wf) { - log_warn("Got notification for a file I didn't watch."); - continue; - } - wf->cb(wf->ud); - } -} - -void *file_watch_init(EV_P) { - log_debug("Starting watching for file changes"); - int fd = -1; -#ifdef HAS_INOTIFY - fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); - if (fd < 0) { - log_error_errno("inotify_init1 failed"); - return NULL; - } -#elif HAS_KQUEUE - fd = kqueue(); - if (fd < 0) { - log_error_errno("Failed to create kqueue"); - return NULL; - } -#else - log_info("No file watching support found on the host system."); - return NULL; -#endif - auto fwr = ccalloc(1, struct file_watch_registry); - ev_io_init(&fwr->w, file_watch_ev_cb, fd, EV_READ); - ev_io_start(EV_A_ & fwr->w); - - return fwr; -} - -void file_watch_destroy(EV_P_ void *_fwr) { - log_debug("Stopping watching for file changes"); - auto fwr = (struct file_watch_registry *)_fwr; - struct watched_file *i, *tmp; - - HASH_ITER(hh, fwr->reg, i, tmp) { - HASH_DEL(fwr->reg, i); -#ifdef HAS_KQUEUE - // kqueue watch descriptors are file descriptors of - // the files we are watching, so we need to close - // them - close(i->wd); -#endif - free(i); - } - - ev_io_stop(EV_A_ & fwr->w); - close(fwr->w.fd); - free(fwr); -} - -bool file_watch_add(void *_fwr, const char *filename, file_watch_cb_t cb, void *ud) { - log_debug("Adding \"%s\" to watched files", filename); - auto fwr = (struct file_watch_registry *)_fwr; - int wd = -1; - - struct stat statbuf; - int ret = stat(filename, &statbuf); - if (ret < 0) { - log_error_errno("Failed to retrieve information about file \"%s\"", filename); - return false; - } - if (!S_ISREG(statbuf.st_mode)) { - log_info("\"%s\" is not a regular file, not watching it.", filename); - return false; - } - -#ifdef HAS_INOTIFY - wd = inotify_add_watch(fwr->w.fd, filename, - IN_CLOSE_WRITE | IN_MOVE_SELF | IN_DELETE_SELF); - if (wd < 0) { - log_error_errno("Failed to watch file \"%s\"", filename); - return false; - } -#elif HAS_KQUEUE - wd = open(filename, O_RDONLY); - if (wd < 0) { - log_error_errno("Cannot open file \"%s\" for watching", filename); - return false; - } - - uint32_t fflags = NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE | NOTE_ATTRIB; - // NOTE_CLOSE_WRITE is relatively new, so we cannot just use it -#ifdef NOTE_CLOSE_WRITE - fflags |= NOTE_CLOSE_WRITE; -#else - // NOTE_WRITE will receive notification more frequent than necessary, so is less - // preferrable - fflags |= NOTE_WRITE; -#endif - struct kevent ev = { - .ident = (unsigned int)wd, // the wd < 0 case is checked above - .filter = EVFILT_VNODE, - .flags = EV_ADD | EV_CLEAR, - .fflags = fflags, - .data = 0, - .udata = NULL, - }; - if (kevent(fwr->w.fd, &ev, 1, NULL, 0, NULL) < 0) { - log_error_errno("Failed to register kevent"); - close(wd); - return false; - } -#else - assert(false); -#endif // HAS_KQUEUE - - auto w = ccalloc(1, struct watched_file); - w->wd = wd; - w->cb = cb; - w->ud = ud; - - HASH_ADD_INT(fwr->reg, wd, w); - return true; -} diff --git a/dwm/picom/src/file_watch.h b/dwm/picom/src/file_watch.h deleted file mode 100644 index c249cd2..0000000 --- a/dwm/picom/src/file_watch.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include - -#include - -typedef void (*file_watch_cb_t)(void *); - -void *file_watch_init(EV_P); -bool file_watch_add(void *, const char *, file_watch_cb_t, void *); -void file_watch_destroy(EV_P_ void *); diff --git a/dwm/picom/src/kernel.c b/dwm/picom/src/kernel.c deleted file mode 100644 index 5151045..0000000 --- a/dwm/picom/src/kernel.c +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#include -#include - -#include "compiler.h" -#include "kernel.h" -#include "log.h" -#include "utils.h" - -/// Sum a region convolution kernel. Region is defined by a width x height rectangle whose -/// top left corner is at (x, y) -double sum_kernel(const conv *map, int x, int y, int width, int height) { - double ret = 0; - - // Compute sum of values which are "in range" - int xstart = normalize_i_range(x, 0, map->w), - xend = normalize_i_range(width + x, 0, map->w); - int ystart = normalize_i_range(y, 0, map->h), - yend = normalize_i_range(height + y, 0, map->h); - assert(yend >= ystart && xend >= xstart); - - int d = map->w; - if (map->rsum) { - // See sum_kernel_preprocess - double v1 = xstart ? map->rsum[(yend - 1) * d + xstart - 1] : 0; - double v2 = ystart ? map->rsum[(ystart - 1) * d + xend - 1] : 0; - double v3 = (xstart && ystart) ? map->rsum[(ystart - 1) * d + xstart - 1] : 0; - return map->rsum[(yend - 1) * d + xend - 1] - v1 - v2 + v3; - } - - for (int yi = ystart; yi < yend; yi++) { - for (int xi = xstart; xi < xend; xi++) { - ret += map->data[yi * d + xi]; - } - } - - return ret; -} - -double sum_kernel_normalized(const conv *map, int x, int y, int width, int height) { - double ret = sum_kernel(map, x, y, width, height); - if (ret < 0) { - ret = 0; - } - if (ret > 1) { - ret = 1; - } - return ret; -} - -static inline double attr_const gaussian(double r, double x, double y) { - // Formula can be found here: - // https://en.wikipedia.org/wiki/Gaussian_blur#Mathematics - // Except a special case for r == 0 to produce sharp shadows - if (r == 0) - return 1; - return exp(-0.5 * (x * x + y * y) / (r * r)) / (2 * M_PI * r * r); -} - -conv *gaussian_kernel(double r, int size) { - conv *c; - int center = size / 2; - double t; - assert(size % 2 == 1); - - c = cvalloc(sizeof(conv) + (size_t)(size * size) * sizeof(double)); - c->w = c->h = size; - c->rsum = NULL; - t = 0.0; - - for (int y = 0; y < size; y++) { - for (int x = 0; x < size; x++) { - double g = gaussian(r, x - center, y - center); - t += g; - c->data[y * size + x] = g; - } - } - - for (int y = 0; y < size; y++) { - for (int x = 0; x < size; x++) { - c->data[y * size + x] /= t; - } - } - - return c; -} - -/// Estimate the element of the sum of the first row in a gaussian kernel with standard -/// deviation `r` and size `size`, -static inline double estimate_first_row_sum(double size, double r) { - double factor = erf(size / r / sqrt(2)); - double a = exp(-0.5 * size * size / (r * r)) / sqrt(2 * M_PI) / r; - return a / factor; -} - -/// Pick a suitable gaussian kernel radius for a given kernel size. The returned radius -/// is the maximum possible radius (<= size*2) that satisfies no sum of the rows in -/// the kernel are less than `row_limit` (up to certain precision). -static inline double gaussian_kernel_std_for_size(int size, double row_limit) { - assert(size > 0); - if (row_limit >= 1.0 / 2.0 / size) { - return size * 2; - } - double l = 0, r = size * 2; - while (r - l > 1e-2) { - double mid = (l + r) / 2.0; - double vmid = estimate_first_row_sum(size, mid); - if (vmid > row_limit) { - r = mid; - } else { - l = mid; - } - } - return (l + r) / 2.0; -} - -/// Create a gaussian kernel with auto detected standard deviation. The choosen standard -/// deviation tries to make sure the outer most pixels of the shadow are completely -/// transparent, so the transition from shadow to the background is smooth. -/// -/// @param[in] shadow_radius the radius of the shadow -conv *gaussian_kernel_autodetect_deviation(int shadow_radius) { - assert(shadow_radius >= 0); - int size = shadow_radius * 2 + 1; - - if (shadow_radius == 0) { - return gaussian_kernel(0, size); - } - double std = gaussian_kernel_std_for_size(shadow_radius, 1.0 / 256.0); - return gaussian_kernel(std, size); -} - -/// preprocess kernels to make shadow generation faster -/// shadow_sum[x*d+y] is the sum of the kernel from (0, 0) to (x, y), inclusive -void sum_kernel_preprocess(conv *map) { - if (map->rsum) { - free(map->rsum); - } - - auto sum = map->rsum = ccalloc(map->w * map->h, double); - sum[0] = map->data[0]; - - for (int x = 1; x < map->w; x++) { - sum[x] = sum[x - 1] + map->data[x]; - } - - const int d = map->w; - for (int y = 1; y < map->h; y++) { - sum[y * d] = sum[(y - 1) * d] + map->data[y * d]; - for (int x = 1; x < map->w; x++) { - double tmp = sum[(y - 1) * d + x] + sum[y * d + x - 1] - - sum[(y - 1) * d + x - 1]; - sum[y * d + x] = tmp + map->data[y * d + x]; - } - } -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/kernel.h b/dwm/picom/src/kernel.h deleted file mode 100644 index 251d127..0000000 --- a/dwm/picom/src/kernel.h +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#pragma once -#include -#include "compiler.h" - -/// Code for generating convolution kernels - -typedef struct conv { - int w, h; - double *rsum; - double data[]; -} conv; - -/// Calculate the sum of a rectangle part of the convolution kernel -/// the rectangle is defined by top left (x, y), and a size (width x height) -double attr_pure sum_kernel(const conv *map, int x, int y, int width, int height); -double attr_pure sum_kernel_normalized(const conv *map, int x, int y, int width, int height); - -/// Create a kernel with gaussian distribution with standard deviation `r`, and size -/// `size`. -conv *gaussian_kernel(double r, int size); - -/// Create a gaussian kernel with auto detected standard deviation. The choosen standard -/// deviation tries to make sure the outer most pixels of the shadow are completely -/// transparent. -/// -/// @param[in] shadow_radius the radius of the shadow -conv *gaussian_kernel_autodetect_deviation(int shadow_radius); - -/// preprocess kernels to make shadow generation faster -/// shadow_sum[x*d+y] is the sum of the kernel from (0, 0) to (x, y), inclusive -void sum_kernel_preprocess(conv *map); - -static inline void free_conv(conv *k) { - free(k->rsum); - free(k); -} diff --git a/dwm/picom/src/list.h b/dwm/picom/src/list.h deleted file mode 100644 index 19e2c2c..0000000 --- a/dwm/picom/src/list.h +++ /dev/null @@ -1,108 +0,0 @@ -#pragma once -#include -#include - -/** - * container_of - cast a member of a structure out to the containing structure - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - */ -#define container_of(ptr, type, member) \ - ({ \ - const __typeof__(((type *)0)->member) *__mptr = (ptr); \ - (type *)((char *)__mptr - offsetof(type, member)); \ - }) - -struct list_node { - struct list_node *next, *prev; -}; - -#define list_entry(ptr, type, node) container_of(ptr, type, node) -#define list_next_entry(ptr, node) list_entry((ptr)->node.next, __typeof__(*(ptr)), node) -#define list_prev_entry(ptr, node) list_entry((ptr)->node.prev, __typeof__(*(ptr)), node) - -/// Insert a new node between two adjacent nodes in the list -static inline void __list_insert_between(struct list_node *prev, struct list_node *next, - struct list_node *new_) { - new_->prev = prev; - new_->next = next; - next->prev = new_; - prev->next = new_; -} - -/// Insert a new node after `curr` -static inline void list_insert_after(struct list_node *curr, struct list_node *new_) { - __list_insert_between(curr, curr->next, new_); -} - -/// Insert a new node before `curr` -static inline void list_insert_before(struct list_node *curr, struct list_node *new_) { - __list_insert_between(curr->prev, curr, new_); -} - -/// Link two nodes in the list, so `next` becomes the successor node of `prev` -static inline void __list_link(struct list_node *prev, struct list_node *next) { - next->prev = prev; - prev->next = next; -} - -/// Remove a node from the list -static inline void list_remove(struct list_node *to_remove) { - __list_link(to_remove->prev, to_remove->next); - to_remove->prev = (void *)-1; - to_remove->next = (void *)-2; -} - -/// Move `to_move` so that it's before `new_next` -static inline void list_move_before(struct list_node *to_move, struct list_node *new_next) { - list_remove(to_move); - list_insert_before(new_next, to_move); -} - -/// Move `to_move` so that it's after `new_prev` -static inline void list_move_after(struct list_node *to_move, struct list_node *new_prev) { - list_remove(to_move); - list_insert_after(new_prev, to_move); -} - -/// Initialize a list node that's intended to be the head node -static inline void list_init_head(struct list_node *head) { - head->next = head->prev = head; -} - -/// Replace list node `old` with `n` -static inline void list_replace(struct list_node *old, struct list_node *n) { - __list_insert_between(old->prev, old->next, n); - old->prev = (void *)-1; - old->next = (void *)-2; -} - -/// Return true if head is the only node in the list. Under usual circumstances this means -/// the list is empty -static inline bool list_is_empty(const struct list_node *head) { - return head->prev == head; -} - -/// Return true if `to_check` is the first node in list headed by `head` -static inline bool -list_node_is_first(const struct list_node *head, const struct list_node *to_check) { - return head->next == to_check; -} - -/// Return true if `to_check` is the last node in list headed by `head` -static inline bool -list_node_is_last(const struct list_node *head, const struct list_node *to_check) { - return head->prev == to_check; -} - -#define list_foreach(type, i, head, member) \ - for (type *i = list_entry((head)->next, type, member); &i->member != (head); \ - i = list_next_entry(i, member)) - -/// Like list_for_each, but it's safe to remove the current list node from the list -#define list_foreach_safe(type, i, head, member) \ - for (type *i = list_entry((head)->next, type, member), \ - *__tmp = list_next_entry(i, member); \ - &i->member != (head); i = __tmp, __tmp = list_next_entry(i, member)) diff --git a/dwm/picom/src/log.c b/dwm/picom/src/log.c deleted file mode 100644 index 0b663e7..0000000 --- a/dwm/picom/src/log.c +++ /dev/null @@ -1,376 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_OPENGL -#include -#include "backend/gl/gl_common.h" -#include "backend/gl/glx.h" -#endif - -#include "compiler.h" -#include "log.h" -#include "utils.h" - -thread_local struct log *tls_logger; - -struct log_target; - -struct log { - struct log_target *head; - - int log_level; -}; - -struct log_target { - const struct log_ops *ops; - struct log_target *next; -}; - -struct log_ops { - void (*write)(struct log_target *, const char *, size_t); - void (*writev)(struct log_target *, const struct iovec *, int vcnt); - void (*destroy)(struct log_target *); - - /// Additional strings to print around the log_level string - const char *(*colorize_begin)(enum log_level); - const char *(*colorize_end)(enum log_level); -}; - -/// Fallback writev for targets don't implement it -static attr_unused void -log_default_writev(struct log_target *tgt, const struct iovec *vec, int vcnt) { - size_t total = 0; - for (int i = 0; i < vcnt; i++) { - total += vec[i].iov_len; - } - - if (!total) { - // Nothing to write - return; - } - char *buf = ccalloc(total, char); - total = 0; - for (int i = 0; i < vcnt; i++) { - memcpy(buf + total, vec[i].iov_base, vec[i].iov_len); - total += vec[i].iov_len; - } - tgt->ops->write(tgt, buf, total); - free(buf); -} - -static attr_const const char *log_level_to_string(enum log_level level) { - switch (level) { - case LOG_LEVEL_TRACE: return "TRACE"; - case LOG_LEVEL_DEBUG: return "DEBUG"; - case LOG_LEVEL_INFO: return "INFO"; - case LOG_LEVEL_WARN: return "WARN"; - case LOG_LEVEL_ERROR: return "ERROR"; - case LOG_LEVEL_FATAL: return "FATAL ERROR"; - default: return "????"; - } -} - -enum log_level string_to_log_level(const char *str) { - if (strcasecmp(str, "TRACE") == 0) - return LOG_LEVEL_TRACE; - else if (strcasecmp(str, "DEBUG") == 0) - return LOG_LEVEL_DEBUG; - else if (strcasecmp(str, "INFO") == 0) - return LOG_LEVEL_INFO; - else if (strcasecmp(str, "WARN") == 0) - return LOG_LEVEL_WARN; - else if (strcasecmp(str, "ERROR") == 0) - return LOG_LEVEL_ERROR; - return LOG_LEVEL_INVALID; -} - -struct log *log_new(void) { - auto ret = cmalloc(struct log); - ret->log_level = LOG_LEVEL_WARN; - ret->head = NULL; - return ret; -} - -void log_add_target(struct log *l, struct log_target *tgt) { - assert(tgt->ops->writev); - tgt->next = l->head; - l->head = tgt; -} - -/// Remove a previously added log target for a log struct, and destroy it. If the log -/// target was never added, nothing happens. -void log_remove_target(struct log *l, struct log_target *tgt) { - struct log_target *now = l->head, **prev = &l->head; - while (now) { - if (now == tgt) { - *prev = now->next; - tgt->ops->destroy(tgt); - break; - } - prev = &now->next; - now = now->next; - } -} - -/// Destroy a log struct and every log target added to it -void log_destroy(struct log *l) { - // free all tgt - struct log_target *head = l->head; - while (head) { - auto next = head->next; - head->ops->destroy(head); - head = next; - } - free(l); -} - -void log_set_level(struct log *l, int level) { - assert(level <= LOG_LEVEL_FATAL && level >= 0); - l->log_level = level; -} - -enum log_level log_get_level(const struct log *l) { - return l->log_level; -} - -attr_printf(4, 5) void log_printf(struct log *l, int level, const char *func, - const char *fmt, ...) { - assert(level <= LOG_LEVEL_FATAL && level >= 0); - if (level < l->log_level) - return; - - char *buf = NULL; - va_list args; - - va_start(args, fmt); - int blen = vasprintf(&buf, fmt, args); - va_end(args); - - if (blen < 0 || !buf) { - free(buf); - return; - } - - struct timespec ts; - timespec_get(&ts, TIME_UTC); - struct tm now; - localtime_r(&ts.tv_sec, &now); - char time_buf[100]; - strftime(time_buf, sizeof time_buf, "%x %T", &now); - - char *time = NULL; - int tlen = asprintf(&time, "%s.%03ld", time_buf, ts.tv_nsec / 1000000); - if (tlen < 0 || !time) { - free(buf); - free(time); - return; - } - - const char *log_level_str = log_level_to_string(level); - size_t llen = strlen(log_level_str); - size_t flen = strlen(func); - - struct log_target *head = l->head; - while (head) { - const char *p = "", *s = ""; - size_t plen = 0, slen = 0; - - if (head->ops->colorize_begin) { - // construct target specific prefix - p = head->ops->colorize_begin(level); - plen = strlen(p); - if (head->ops->colorize_end) { - s = head->ops->colorize_end(level); - slen = strlen(s); - } - } - head->ops->writev( - head, - (struct iovec[]){{.iov_base = "[ ", .iov_len = 2}, - {.iov_base = time, .iov_len = (size_t)tlen}, - {.iov_base = " ", .iov_len = 1}, - {.iov_base = (void *)func, .iov_len = flen}, - {.iov_base = " ", .iov_len = 1}, - {.iov_base = (void *)p, .iov_len = plen}, - {.iov_base = (void *)log_level_str, .iov_len = llen}, - {.iov_base = (void *)s, .iov_len = slen}, - {.iov_base = " ] ", .iov_len = 3}, - {.iov_base = buf, .iov_len = (size_t)blen}, - {.iov_base = "\n", .iov_len = 1}}, - 11); - head = head->next; - } - free(time); - free(buf); -} - -/// A trivial deinitializer that simply frees the memory -static attr_unused void logger_trivial_destroy(struct log_target *tgt) { - free(tgt); -} - -/// A null log target that does nothing -static const struct log_ops null_logger_ops; -static struct log_target null_logger_target = { - .ops = &null_logger_ops, -}; - -struct log_target *null_logger_new(void) { - return &null_logger_target; -} - -static void null_logger_write(struct log_target *tgt attr_unused, - const char *str attr_unused, size_t len attr_unused) { - return; -} - -static void null_logger_writev(struct log_target *tgt attr_unused, - const struct iovec *vec attr_unused, int vcnt attr_unused) { - return; -} - -static const struct log_ops null_logger_ops = { - .write = null_logger_write, - .writev = null_logger_writev, -}; - -/// A file based logger that writes to file (or stdout/stderr) -struct file_logger { - struct log_target tgt; - FILE *f; - struct log_ops ops; -}; - -static void file_logger_write(struct log_target *tgt, const char *str, size_t len) { - auto f = (struct file_logger *)tgt; - fwrite(str, 1, len, f->f); -} - -static void file_logger_writev(struct log_target *tgt, const struct iovec *vec, int vcnt) { - auto f = (struct file_logger *)tgt; - fflush(f->f); - writev(fileno(f->f), vec, vcnt); -} - -static void file_logger_destroy(struct log_target *tgt) { - auto f = (struct file_logger *)tgt; - fclose(f->f); - free(tgt); -} - -#define ANSI(x) "\033[" x "m" -static const char *terminal_colorize_begin(enum log_level level) { - switch (level) { - case LOG_LEVEL_TRACE: return ANSI("30;2"); - case LOG_LEVEL_DEBUG: return ANSI("37;2"); - case LOG_LEVEL_INFO: return ANSI("92"); - case LOG_LEVEL_WARN: return ANSI("33"); - case LOG_LEVEL_ERROR: return ANSI("31;1"); - case LOG_LEVEL_FATAL: return ANSI("30;103;1"); - default: return ""; - } -} - -static const char *terminal_colorize_end(enum log_level level attr_unused) { - return ANSI("0"); -} -#undef PREFIX - -static const struct log_ops file_logger_ops = { - .write = file_logger_write, - .writev = file_logger_writev, - .destroy = file_logger_destroy, -}; - -struct log_target *file_logger_new(const char *filename) { - FILE *f = fopen(filename, "a"); - if (!f) { - return NULL; - } - - auto ret = cmalloc(struct file_logger); - ret->tgt.ops = &ret->ops; - ret->f = f; - - // Always assume a file is not a terminal - ret->ops = file_logger_ops; - - return &ret->tgt; -} - -struct log_target *stderr_logger_new(void) { - int fd = dup(STDERR_FILENO); - if (fd < 0) { - return NULL; - } - - FILE *f = fdopen(fd, "w"); - if (!f) { - return NULL; - } - - auto ret = cmalloc(struct file_logger); - ret->tgt.ops = &ret->ops; - ret->f = f; - ret->ops = file_logger_ops; - - if (isatty(fd)) { - ret->ops.colorize_begin = terminal_colorize_begin; - ret->ops.colorize_end = terminal_colorize_end; - } - return &ret->tgt; -} - -#ifdef CONFIG_OPENGL -/// An opengl logger that can be used for logging into opengl debugging tools, -/// such as apitrace -struct gl_string_marker_logger { - struct log_target tgt; - PFNGLSTRINGMARKERGREMEDYPROC gl_string_marker; -}; - -static void -gl_string_marker_logger_write(struct log_target *tgt, const char *str, size_t len) { - auto g = (struct gl_string_marker_logger *)tgt; - // strip newlines at the end of the string - while (len > 0 && str[len-1] == '\n') { - len--; - } - g->gl_string_marker((GLsizei)len, str); -} - -static const struct log_ops gl_string_marker_logger_ops = { - .write = gl_string_marker_logger_write, - .writev = log_default_writev, - .destroy = logger_trivial_destroy, -}; - -struct log_target *gl_string_marker_logger_new(void) { - if (!gl_has_extension("GL_GREMEDY_string_marker")) { - return NULL; - } - - void *fnptr = glXGetProcAddress((GLubyte *)"glStringMarkerGREMEDY"); - if (!fnptr) - return NULL; - - auto ret = cmalloc(struct gl_string_marker_logger); - ret->tgt.ops = &gl_string_marker_logger_ops; - ret->gl_string_marker = fnptr; - return &ret->tgt; -} - -#else -struct log_target *gl_string_marker_logger_new(void) { - return NULL; -} -#endif - -// vim: set noet sw=8 ts=8: diff --git a/dwm/picom/src/log.h b/dwm/picom/src/log.h deleted file mode 100644 index e40fe3c..0000000 --- a/dwm/picom/src/log.h +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui - -#pragma once -#include -#include - -#include "compiler.h" - -enum log_level { - LOG_LEVEL_INVALID = -1, - LOG_LEVEL_TRACE = 0, - LOG_LEVEL_DEBUG, - LOG_LEVEL_INFO, - LOG_LEVEL_WARN, - LOG_LEVEL_ERROR, - LOG_LEVEL_FATAL, -}; - -#define LOG_UNLIKELY(level, x, ...) \ - do { \ - if (unlikely(LOG_LEVEL_##level >= log_get_level_tls())) { \ - log_printf(tls_logger, LOG_LEVEL_##level, __func__, x, ##__VA_ARGS__); \ - } \ - } while (0) - -#define LOG(level, x, ...) \ - do { \ - if (LOG_LEVEL_##level >= log_get_level_tls()) { \ - log_printf(tls_logger, LOG_LEVEL_##level, __func__, x, ##__VA_ARGS__); \ - } \ - } while (0) -#define log_trace(x, ...) LOG_UNLIKELY(TRACE, x, ##__VA_ARGS__) -#define log_debug(x, ...) LOG_UNLIKELY(DEBUG, x, ##__VA_ARGS__) -#define log_info(x, ...) LOG(INFO, x, ##__VA_ARGS__) -#define log_warn(x, ...) LOG(WARN, x, ##__VA_ARGS__) -#define log_error(x, ...) LOG(ERROR, x, ##__VA_ARGS__) -#define log_fatal(x, ...) LOG(FATAL, x, ##__VA_ARGS__) - -#define log_error_errno(x, ...) LOG(ERROR, x ": %s", ##__VA_ARGS__, strerror(errno)) - -struct log; -struct log_target; - -attr_printf(4, 5) void log_printf(struct log *, int level, const char *func, - const char *fmt, ...); - -attr_malloc struct log *log_new(void); -/// Destroy a log struct and every log target added to it -attr_nonnull_all void log_destroy(struct log *); -attr_nonnull(1) void log_set_level(struct log *l, int level); -attr_pure enum log_level log_get_level(const struct log *l); -attr_nonnull_all void log_add_target(struct log *, struct log_target *); -attr_pure enum log_level string_to_log_level(const char *); -/// Remove a previously added log target for a log struct, and destroy it. If the log -/// target was never added, nothing happens. -void log_remove_target(struct log *l, struct log_target *tgt); - -extern thread_local struct log *tls_logger; - -/// Create a thread local logger -static inline void log_init_tls(void) { - tls_logger = log_new(); -} -/// Set thread local logger log level -static inline void log_set_level_tls(int level) { - assert(tls_logger); - log_set_level(tls_logger, level); -} -static inline attr_nonnull_all void log_add_target_tls(struct log_target *tgt) { - assert(tls_logger); - log_add_target(tls_logger, tgt); -} - -static inline attr_nonnull_all void log_remove_target_tls(struct log_target *tgt) { - assert(tls_logger); - log_remove_target(tls_logger, tgt); -} - -static inline attr_pure enum log_level log_get_level_tls(void) { - assert(tls_logger); - return log_get_level(tls_logger); -} - -static inline void log_deinit_tls(void) { - assert(tls_logger); - log_destroy(tls_logger); - tls_logger = NULL; -} - -attr_malloc struct log_target *stderr_logger_new(void); -attr_malloc struct log_target *file_logger_new(const char *file); -attr_malloc struct log_target *null_logger_new(void); -attr_malloc struct log_target *gl_string_marker_logger_new(void); - -// vim: set noet sw=8 ts=8: diff --git a/dwm/picom/src/meson.build b/dwm/picom/src/meson.build deleted file mode 100644 index 0a882f9..0000000 --- a/dwm/picom/src/meson.build +++ /dev/null @@ -1,97 +0,0 @@ -libev = dependency('libev', required: false) -if not libev.found() - libev = cc.find_library('ev') -endif -base_deps = [ - cc.find_library('m'), - libev -] - -srcs = [ files('picom.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'vsync.c', 'utils.c', - 'diagnostic.c', 'string_utils.c', 'render.c', 'kernel.c', 'log.c', - 'options.c', 'event.c', 'cache.c', 'atom.c', 'file_watch.c') ] -picom_inc = include_directories('.') - -cflags = [] - -required_xcb_packages = [ - 'xcb-render', 'xcb-damage', 'xcb-randr', 'xcb-sync', 'xcb-composite', - 'xcb-shape', 'xcb-xinerama', 'xcb-xfixes', 'xcb-present', 'xcb-glx', 'xcb' -] - -required_packages = [ - 'x11', 'x11-xcb', 'xcb-renderutil', 'xcb-image', 'xext', 'pixman-1' -] - -foreach i : required_packages - base_deps += [dependency(i, required: true)] -endforeach - -foreach i : required_xcb_packages - base_deps += [dependency(i, version: '>=1.12.0', required: true)] -endforeach - -if not cc.has_header('uthash.h') - error('Dependency uthash not found') -endif - -deps = [] - -if get_option('config_file') - deps += [dependency('libconfig', version: '>=1.4', required: true)] - - cflags += ['-DCONFIG_LIBCONFIG'] - srcs += [ 'config_libconfig.c' ] -endif -if get_option('regex') - pcre = dependency('libpcre', required: true) - cflags += ['-DCONFIG_REGEX_PCRE'] - if pcre.version().version_compare('>=8.20') - cflags += ['-DCONFIG_REGEX_PCRE_JIT'] - endif - deps += [pcre] -endif - -if get_option('vsync_drm') - cflags += ['-DCONFIG_VSYNC_DRM'] - deps += [dependency('libdrm', required: true)] -endif - -if get_option('opengl') - cflags += ['-DCONFIG_OPENGL', '-DGL_GLEXT_PROTOTYPES'] - deps += [dependency('gl', required: true)] - srcs += [ 'opengl.c' ] -endif - -if get_option('dbus') - cflags += ['-DCONFIG_DBUS'] - deps += [dependency('dbus-1', required: true)] - srcs += [ 'dbus.c' ] -endif - -if get_option('xrescheck') - cflags += ['-DDEBUG_XRC'] - srcs += [ 'xrescheck.c' ] -endif - -if get_option('unittest') - cflags += ['-DUNIT_TEST'] -endif - -host_system = host_machine.system() -if host_system == 'linux' - cflags += ['-DHAS_INOTIFY'] -elif (host_system == 'freebsd' or host_system == 'netbsd' or - host_system == 'dragonfly' or host_system == 'openbsd') - cflags += ['-DHAS_KQUEUE'] -endif - -subdir('backend') - -picom = executable('picom', srcs, c_args: cflags, - dependencies: [ base_deps, deps, test_h_dep ], - install: true, include_directories: picom_inc) - -if get_option('unittest') - test('picom unittest', picom, args: [ '--unittest' ]) -endif diff --git a/dwm/picom/src/meta.h b/dwm/picom/src/meta.h deleted file mode 100644 index 4314356..0000000 --- a/dwm/picom/src/meta.h +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2019, Yuxuan Shui - -#pragma once - -/// Macro metaprogramming - -#define _APPLY1(a, ...) a(__VA_ARGS__) -#define _APPLY2(a, ...) a(__VA_ARGS__) -#define _APPLY3(a, ...) a(__VA_ARGS__) -#define _APPLY4(a, ...) a(__VA_ARGS__) - -#define RIOTA1(x) x -#define RIOTA2(x) RIOTA1(x##1), RIOTA1(x##0) -#define RIOTA4(x) RIOTA2(x##1), RIOTA2(x##0) -#define RIOTA8(x) RIOTA4(x##1), RIOTA4(x##0) -#define RIOTA16(x) RIOTA8(x##1), RIOTA8(x##0) -/// Generate a list containing 31, 30, ..., 0, in binary -#define RIOTA32(x) RIOTA16(x##1), RIOTA16(x##0) - -#define CONCAT2(a, b) a##b -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT(a, b) CONCAT1(a, b) - -#define _ARGS_HEAD(head, ...) head -#define _ARGS_SKIP4(_1, _2, _3, _4, ...) __VA_ARGS__ -#define _ARGS_SKIP8(...) _APPLY1(_ARGS_SKIP4, _ARGS_SKIP4(__VA_ARGS__)) -#define _ARGS_SKIP16(...) _APPLY2(_ARGS_SKIP8, _ARGS_SKIP8(__VA_ARGS__)) -#define _ARGS_SKIP32(...) _APPLY3(_ARGS_SKIP16, _ARGS_SKIP16(__VA_ARGS__)) - -/// Return the 33rd argument -#define _ARG33(...) _APPLY4(_ARGS_HEAD, _ARGS_SKIP32(__VA_ARGS__)) - -/// Return the number of arguments passed in binary, handles at most 31 elements -#define VA_ARGS_LENGTH(...) _ARG33(0, ##__VA_ARGS__, RIOTA32(0)) - -#define LIST_APPLY_000000(fn, sep, ...) -#define LIST_APPLY_000001(fn, sep, x, ...) fn(x) -#define LIST_APPLY_000010(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000001(fn, sep, __VA_ARGS__) -#define LIST_APPLY_000011(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000010(fn, sep, __VA_ARGS__) -#define LIST_APPLY_000100(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000011(fn, sep, __VA_ARGS__) -#define LIST_APPLY_000101(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000100(fn, sep, __VA_ARGS__) -#define LIST_APPLY_000110(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000101(fn, sep, __VA_ARGS__) -#define LIST_APPLY_000111(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000110(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001000(fn, sep, x, ...) fn(x) sep() LIST_APPLY_000111(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001001(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001000(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001010(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001001(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001011(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001010(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001100(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001011(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001101(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001100(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001110(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001101(fn, sep, __VA_ARGS__) -#define LIST_APPLY_001111(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001110(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010000(fn, sep, x, ...) fn(x) sep() LIST_APPLY_001111(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010001(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010000(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010010(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010001(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010011(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010010(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010100(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010011(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010101(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010100(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010110(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010101(fn, sep, __VA_ARGS__) -#define LIST_APPLY_010111(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010110(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011000(fn, sep, x, ...) fn(x) sep() LIST_APPLY_010111(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011001(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011000(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011010(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011001(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011011(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011010(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011100(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011011(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011101(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011100(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011110(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011101(fn, sep, __VA_ARGS__) -#define LIST_APPLY_011111(fn, sep, x, ...) fn(x) sep() LIST_APPLY_011110(fn, sep, __VA_ARGS__) -#define LIST_APPLY_(N, fn, sep, ...) CONCAT(LIST_APPLY_, N)(fn, sep, __VA_ARGS__) -#define LIST_APPLY(fn, sep, ...) \ - LIST_APPLY_(VA_ARGS_LENGTH(__VA_ARGS__), fn, sep, __VA_ARGS__) - -#define SEP_COMMA() , -#define SEP_COLON() ; -#define SEP_NONE() diff --git a/dwm/picom/src/opengl.c b/dwm/picom/src/opengl.c deleted file mode 100644 index 5d2d66c..0000000 --- a/dwm/picom/src/opengl.c +++ /dev/null @@ -1,1514 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#include -#include -#include -#include -#include -#include - -#include "backend/gl/gl_common.h" -#include "backend/gl/glx.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "string_utils.h" -#include "uthash_extra.h" -#include "utils.h" -#include "win.h" - -#include "opengl.h" - -#ifndef GL_TEXTURE_RECTANGLE -#define GL_TEXTURE_RECTANGLE 0x84F5 -#endif - -static inline XVisualInfo *get_visualinfo_from_visual(session_t *ps, xcb_visualid_t visual) { - XVisualInfo vreq = {.visualid = visual}; - int nitems = 0; - - return XGetVisualInfo(ps->dpy, VisualIDMask, &vreq, &nitems); -} - -/** - * Initialize OpenGL. - */ -bool glx_init(session_t *ps, bool need_render) { - bool success = false; - XVisualInfo *pvis = NULL; - - // Check for GLX extension - if (!ps->glx_exists) { - log_error("No GLX extension."); - goto glx_init_end; - } - - // Get XVisualInfo - pvis = get_visualinfo_from_visual(ps, ps->vis); - if (!pvis) { - log_error("Failed to acquire XVisualInfo for current visual."); - goto glx_init_end; - } - - // Ensure the visual is double-buffered - if (need_render) { - int value = 0; - if (Success != glXGetConfig(ps->dpy, pvis, GLX_USE_GL, &value) || !value) { - log_error("Root visual is not a GL visual."); - goto glx_init_end; - } - - if (Success != glXGetConfig(ps->dpy, pvis, GLX_DOUBLEBUFFER, &value) || !value) { - log_error("Root visual is not a double buffered GL visual."); - goto glx_init_end; - } - } - - // Ensure GLX_EXT_texture_from_pixmap exists - if (need_render && !glxext.has_GLX_EXT_texture_from_pixmap) - goto glx_init_end; - - // Initialize GLX data structure - if (!ps->psglx) { - static const glx_session_t CGLX_SESSION_DEF = CGLX_SESSION_INIT; - ps->psglx = cmalloc(glx_session_t); - memcpy(ps->psglx, &CGLX_SESSION_DEF, sizeof(glx_session_t)); - - // +1 for the zero terminator - ps->psglx->blur_passes = ccalloc(ps->o.blur_kernel_count, glx_blur_pass_t); - - for (int i = 0; i < ps->o.blur_kernel_count; ++i) { - glx_blur_pass_t *ppass = &ps->psglx->blur_passes[i]; - ppass->unifm_factor_center = -1; - ppass->unifm_offset_x = -1; - ppass->unifm_offset_y = -1; - } - - ps->psglx->round_passes = ccalloc(1, glx_round_pass_t); - glx_round_pass_t *ppass = ps->psglx->round_passes; - ppass->unifm_radius = -1; - ppass->unifm_texcoord = -1; - ppass->unifm_texsize = -1; - ppass->unifm_borderw = -1; - ppass->unifm_borderc = -1; - ppass->unifm_resolution = -1; - ppass->unifm_tex_scr = -1; - } - - glx_session_t *psglx = ps->psglx; - - if (!psglx->context) { - // Get GLX context -#ifndef DEBUG_GLX_DEBUG_CONTEXT - psglx->context = glXCreateContext(ps->dpy, pvis, None, GL_TRUE); -#else - { - GLXFBConfig fbconfig = get_fbconfig_from_visualinfo(ps, pvis); - if (!fbconfig) { - log_error("Failed to get GLXFBConfig for root visual " - "%#lx.", - pvis->visualid); - goto glx_init_end; - } - - f_glXCreateContextAttribsARB p_glXCreateContextAttribsARB = - (f_glXCreateContextAttribsARB)glXGetProcAddress( - (const GLubyte *)"glXCreateContextAttribsARB"); - if (!p_glXCreateContextAttribsARB) { - log_error("Failed to get glXCreateContextAttribsARB()."); - goto glx_init_end; - } - - static const int attrib_list[] = { - GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, None}; - psglx->context = p_glXCreateContextAttribsARB( - ps->dpy, fbconfig, NULL, GL_TRUE, attrib_list); - } -#endif - - if (!psglx->context) { - log_error("Failed to get GLX context."); - goto glx_init_end; - } - - // Attach GLX context - if (!glXMakeCurrent(ps->dpy, get_tgt_window(ps), psglx->context)) { - log_error("Failed to attach GLX context."); - goto glx_init_end; - } - -#ifdef DEBUG_GLX_DEBUG_CONTEXT - { - f_DebugMessageCallback p_DebugMessageCallback = - (f_DebugMessageCallback)glXGetProcAddress( - (const GLubyte *)"glDebugMessageCallback"); - if (!p_DebugMessageCallback) { - log_error("Failed to get glDebugMessageCallback(0."); - goto glx_init_end; - } - p_DebugMessageCallback(glx_debug_msg_callback, ps); - } -#endif - } - - // Ensure we have a stencil buffer. X Fixes does not guarantee rectangles - // in regions don't overlap, so we must use stencil buffer to make sure - // we don't paint a region for more than one time, I think? - if (need_render && !ps->o.glx_no_stencil) { - GLint val = 0; - glGetIntegerv(GL_STENCIL_BITS, &val); - if (!val) { - log_error("Target window doesn't have stencil buffer."); - goto glx_init_end; - } - } - - // Check GL_ARB_texture_non_power_of_two, requires a GLX context and - // must precede FBConfig fetching - if (need_render) - psglx->has_texture_non_power_of_two = - gl_has_extension("GL_ARB_texture_non_power_of_two"); - - // Render preparations - if (need_render) { - glx_on_root_change(ps); - - glDisable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glDisable(GL_BLEND); - - if (!ps->o.glx_no_stencil) { - // Initialize stencil buffer - glClear(GL_STENCIL_BUFFER_BIT); - glDisable(GL_STENCIL_TEST); - glStencilMask(0x1); - glStencilFunc(GL_EQUAL, 0x1, 0x1); - } - - // Clear screen - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - // glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - // glXSwapBuffers(ps->dpy, get_tgt_window(ps)); - } - - success = true; - -glx_init_end: - XFree(pvis); - - if (!success) - glx_destroy(ps); - - return success; -} - -static void glx_free_prog_main(glx_prog_main_t *pprogram) { - if (!pprogram) - return; - if (pprogram->prog) { - glDeleteProgram(pprogram->prog); - pprogram->prog = 0; - } - pprogram->unifm_opacity = -1; - pprogram->unifm_invert_color = -1; - pprogram->unifm_tex = -1; -} - -/** - * Destroy GLX related resources. - */ -void glx_destroy(session_t *ps) { - if (!ps->psglx) - return; - - // Free all GLX resources of windows - win_stack_foreach_managed(w, &ps->window_stack) { - free_win_res_glx(ps, w); - } - - // Free GLSL shaders/programs - for (int i = 0; i < ps->o.blur_kernel_count; ++i) { - glx_blur_pass_t *ppass = &ps->psglx->blur_passes[i]; - if (ppass->frag_shader) { - glDeleteShader(ppass->frag_shader); - } - if (ppass->prog) { - glDeleteProgram(ppass->prog); - } - } - free(ps->psglx->blur_passes); - - glx_round_pass_t *ppass = ps->psglx->round_passes; - if (ppass->frag_shader) { - glDeleteShader(ppass->frag_shader); - } - if (ppass->prog) { - glDeleteProgram(ppass->prog); - } - free(ps->psglx->round_passes); - - glx_free_prog_main(&ps->glx_prog_win); - - gl_check_err(); - - // Destroy GLX context - if (ps->psglx->context) { - glXMakeCurrent(ps->dpy, None, NULL); - glXDestroyContext(ps->dpy, ps->psglx->context); - ps->psglx->context = NULL; - } - - free(ps->psglx); - ps->psglx = NULL; - ps->argb_fbconfig = NULL; -} - -/** - * Callback to run on root window size change. - */ -void glx_on_root_change(session_t *ps) { - glViewport(0, 0, ps->root_width, ps->root_height); - - // Initialize matrix, copied from dcompmgr - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, ps->root_width, 0, ps->root_height, -1000.0, 1000.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - -/** - * Initialize GLX blur filter. - */ -bool glx_init_blur(session_t *ps) { - assert(ps->o.blur_kernel_count > 0); - assert(ps->o.blur_kerns); - assert(ps->o.blur_kerns[0]); - - // Allocate PBO if more than one blur kernel is present - if (ps->o.blur_kernel_count > 1) { - // Try to generate a framebuffer - GLuint fbo = 0; - glGenFramebuffers(1, &fbo); - if (!fbo) { - log_error("Failed to generate Framebuffer. Cannot do multi-pass " - "blur with GLX" - " backend."); - return false; - } - glDeleteFramebuffers(1, &fbo); - } - - { - char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL)); - // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane - // Thanks to hiciu for reporting. - setlocale(LC_NUMERIC, "C"); - - static const char *FRAG_SHADER_BLUR_PREFIX = - "#version 110\n" - "%s" - "uniform float offset_x;\n" - "uniform float offset_y;\n" - "uniform float factor_center;\n" - "uniform %s tex_scr;\n" - "\n" - "void main() {\n" - " vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);\n"; - static const char *FRAG_SHADER_BLUR_ADD = - " sum += float(%.7g) * %s(tex_scr, vec2(gl_TexCoord[0].x + offset_x " - "* float(%d), gl_TexCoord[0].y + offset_y * float(%d)));\n"; - static const char *FRAG_SHADER_BLUR_SUFFIX = - " sum += %s(tex_scr, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y)) * " - "factor_center;\n" - " gl_FragColor = sum / (factor_center + float(%.7g));\n" - "}\n"; - - const bool use_texture_rect = !ps->psglx->has_texture_non_power_of_two; - const char *sampler_type = (use_texture_rect ? "sampler2DRect" : "sampler2D"); - const char *texture_func = (use_texture_rect ? "texture2DRect" : "texture2D"); - const char *shader_add = FRAG_SHADER_BLUR_ADD; - char *extension = NULL; - if (use_texture_rect) { - mstrextend(&extension, "#extension GL_ARB_texture_rectangle : " - "require\n"); - } - if (!extension) { - extension = strdup(""); - } - - for (int i = 0; i < ps->o.blur_kernel_count; ++i) { - auto kern = ps->o.blur_kerns[i]; - glx_blur_pass_t *ppass = &ps->psglx->blur_passes[i]; - - // Build shader - int width = kern->w, height = kern->h; - int nele = width * height - 1; - assert(nele >= 0); - auto len = - strlen(FRAG_SHADER_BLUR_PREFIX) + strlen(sampler_type) + - strlen(extension) + - (strlen(shader_add) + strlen(texture_func) + 42) * (uint)nele + - strlen(FRAG_SHADER_BLUR_SUFFIX) + strlen(texture_func) + 12 + 1; - char *shader_str = ccalloc(len, char); - char *pc = shader_str; - sprintf(pc, FRAG_SHADER_BLUR_PREFIX, extension, sampler_type); - pc += strlen(pc); - assert(strlen(shader_str) < len); - - double sum = 0.0; - for (int j = 0; j < height; ++j) { - for (int k = 0; k < width; ++k) { - if (height / 2 == j && width / 2 == k) - continue; - double val = kern->data[j * width + k]; - if (val == 0) { - continue; - } - sum += val; - sprintf(pc, shader_add, val, texture_func, - k - width / 2, j - height / 2); - pc += strlen(pc); - assert(strlen(shader_str) < len); - } - } - - sprintf(pc, FRAG_SHADER_BLUR_SUFFIX, texture_func, sum); - assert(strlen(shader_str) < len); - ppass->frag_shader = gl_create_shader(GL_FRAGMENT_SHADER, shader_str); - free(shader_str); - - if (!ppass->frag_shader) { - log_error("Failed to create fragment shader %d.", i); - free(extension); - free(lc_numeric_old); - return false; - } - - // Build program - ppass->prog = gl_create_program(&ppass->frag_shader, 1); - if (!ppass->prog) { - log_error("Failed to create GLSL program."); - free(extension); - free(lc_numeric_old); - return false; - } - - // Get uniform addresses -#define P_GET_UNIFM_LOC(name, target) \ - { \ - ppass->target = glGetUniformLocation(ppass->prog, name); \ - if (ppass->target < 0) { \ - log_error("Failed to get location of %d-th uniform '" name \ - "'. Might be troublesome.", \ - i); \ - } \ - } - - P_GET_UNIFM_LOC("factor_center", unifm_factor_center); - P_GET_UNIFM_LOC("offset_x", unifm_offset_x); - P_GET_UNIFM_LOC("offset_y", unifm_offset_y); - -#undef P_GET_UNIFM_LOC - } - free(extension); - - // Restore LC_NUMERIC - setlocale(LC_NUMERIC, lc_numeric_old); - free(lc_numeric_old); - } - - gl_check_err(); - - return true; -} - -/** - * Initialize GLX rounded corners filter. - */ -bool glx_init_rounded_corners(session_t *ps) { - char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL)); - // Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane - // Thanks to hiciu for reporting. - setlocale(LC_NUMERIC, "C"); - - static const char *FRAG_SHADER = - "#version 110\n" - "%s" // extensions - "uniform float u_radius;\n" - "uniform float u_borderw;\n" - "uniform vec4 u_borderc;\n" - "uniform vec2 u_texcoord;\n" - "uniform vec2 u_texsize;\n" - "uniform vec2 u_resolution;\n" - "uniform %s tex_scr;\n" // sampler2D | sampler2DRect - "\n" - "// https://www.shadertoy.com/view/ltS3zW\n" - "float RectSDF(vec2 p, vec2 b, float r) {\n" - " vec2 d = abs(p) - b + vec2(r);\n" - " return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - r;\n" - "}\n\n" - "void main()\n" - "{\n" - " vec2 coord = vec2(u_texcoord.x, " - "u_resolution.y-u_texsize.y-u_texcoord.y);\n" - " vec4 u_v4WndBgColor = %s(tex_scr, vec2(gl_TexCoord[0].st));\n" - " float u_fRadiusPx = u_radius;\n" - " float u_fHalfBorderThickness = u_borderw / 2.0;\n" - " vec4 u_v4BorderColor = u_borderc;\n" - " vec4 u_v4FillColor = vec4(0.0, 0.0, 0.0, 0.0);\n" - " vec4 v4FromColor = u_v4BorderColor; //Always the border " - "color. If no border, this still should be set\n" - " vec4 v4ToColor = u_v4WndBgColor; //Outside color is the " - "background texture\n" - "\n" - " vec2 u_v2HalfShapeSizePx = u_texsize/2.0 - " - "vec2(u_fHalfBorderThickness);\n" - " vec2 v_v2CenteredPos = (gl_FragCoord.xy - u_texsize.xy / 2.0 - " - "coord);\n" - "\n" - " float fDist = RectSDF(v_v2CenteredPos, u_v2HalfShapeSizePx, " - "u_fRadiusPx - u_fHalfBorderThickness);\n" - " if (u_fHalfBorderThickness > 0.0) {\n" - " if (fDist < 0.0) {\n" - " v4ToColor = u_v4FillColor;\n" - " }\n" - " fDist = abs(fDist) - u_fHalfBorderThickness;\n" - " } else {\n" - " v4FromColor = u_v4FillColor;\n" - " }\n" - " float fBlendAmount = smoothstep(-1.0, 1.0, fDist);\n" - " vec4 c = mix(v4FromColor, v4ToColor, fBlendAmount);\n" - "\n" - " // final color\n" - " gl_FragColor = c;\n" - "\n" - "}\n"; - - const bool use_texture_rect = !ps->psglx->has_texture_non_power_of_two; - const char *sampler_type = (use_texture_rect ? "sampler2DRect" : "sampler2D"); - const char *texture_func = (use_texture_rect ? "texture2DRect" : "texture2D"); - char *extension = NULL; - if (use_texture_rect) { - mstrextend(&extension, "#extension GL_ARB_texture_rectangle : " - "require\n"); - } - if (!extension) { - extension = strdup(""); - } - - bool success = false; - // Build rounded corners shader - auto ppass = ps->psglx->round_passes; - auto len = strlen(FRAG_SHADER) + strlen(extension) + strlen(sampler_type) + - strlen(texture_func) + 1; - char *shader_str = ccalloc(len, char); - - sprintf(shader_str, FRAG_SHADER, extension, sampler_type, texture_func); - assert(strlen(shader_str) < len); - - log_debug("Generated rounded corners shader:\n%s\n", shader_str); - - ppass->frag_shader = gl_create_shader(GL_FRAGMENT_SHADER, shader_str); - free(shader_str); - - if (!ppass->frag_shader) { - log_error("Failed to create rounded corners fragment shader."); - goto out; - } - - // Build program - ppass->prog = gl_create_program(&ppass->frag_shader, 1); - if (!ppass->prog) { - log_error("Failed to create GLSL program."); - goto out; - } - - // Get uniform addresses -#define P_GET_UNIFM_LOC(name, target) \ - { \ - ppass->target = glGetUniformLocation(ppass->prog, name); \ - if (ppass->target < 0) { \ - log_debug("Failed to get location of rounded corners uniform " \ - "'" name "'. Might be troublesome."); \ - } \ - } - P_GET_UNIFM_LOC("u_radius", unifm_radius); - P_GET_UNIFM_LOC("u_texcoord", unifm_texcoord); - P_GET_UNIFM_LOC("u_texsize", unifm_texsize); - P_GET_UNIFM_LOC("u_borderw", unifm_borderw); - P_GET_UNIFM_LOC("u_borderc", unifm_borderc); - P_GET_UNIFM_LOC("u_resolution", unifm_resolution); - P_GET_UNIFM_LOC("tex_scr", unifm_tex_scr); -#undef P_GET_UNIFM_LOC - - success = true; - -out: - free(extension); - - // Restore LC_NUMERIC - setlocale(LC_NUMERIC, lc_numeric_old); - free(lc_numeric_old); - - gl_check_err(); - - return success; -} - -/** - * Load a GLSL main program from shader strings. - */ -bool glx_load_prog_main(const char *vshader_str, const char *fshader_str, - glx_prog_main_t *pprogram) { - assert(pprogram); - - // Build program - pprogram->prog = gl_create_program_from_str(vshader_str, fshader_str); - if (!pprogram->prog) { - log_error("Failed to create GLSL program."); - return false; - } - - // Get uniform addresses -#define P_GET_UNIFM_LOC(name, target) \ - { \ - pprogram->target = glGetUniformLocation(pprogram->prog, name); \ - if (pprogram->target < 0) { \ - log_error("Failed to get location of uniform '" name \ - "'. Might be troublesome."); \ - } \ - } - P_GET_UNIFM_LOC("opacity", unifm_opacity); - P_GET_UNIFM_LOC("invert_color", unifm_invert_color); - P_GET_UNIFM_LOC("tex", unifm_tex); - P_GET_UNIFM_LOC("time", unifm_time); -#undef P_GET_UNIFM_LOC - - gl_check_err(); - - return true; -} - -static inline void glx_copy_region_to_tex(session_t *ps, GLenum tex_tgt, int basex, - int basey, int dx, int dy, int width, int height) { - if (width > 0 && height > 0) { - glCopyTexSubImage2D(tex_tgt, 0, dx - basex, dy - basey, dx, - ps->root_height - dy - height, width, height); - } -} - -static inline GLuint glx_gen_texture(GLenum tex_tgt, int width, int height) { - GLuint tex = 0; - glGenTextures(1, &tex); - if (!tex) { - return 0; - } - glEnable(tex_tgt); - glBindTexture(tex_tgt, tex); - glTexParameteri(tex_tgt, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(tex_tgt, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(tex_tgt, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(tex_tgt, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(tex_tgt, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); - glBindTexture(tex_tgt, 0); - - return tex; -} - -/** - * Bind an OpenGL texture and fill it with pixel data from back buffer - */ -bool glx_bind_texture(session_t *ps attr_unused, glx_texture_t **pptex, int x, int y, - int width, int height) { - if (ps->o.backend != BKEND_GLX && ps->o.backend != BKEND_XR_GLX_HYBRID) { - return true; - } - - glx_texture_t *ptex = *pptex; - - // log_trace("Copying xy(%d %d) wh(%d %d) ptex(%p)", x, y, width, height, ptex); - - // Release texture if parameters are inconsistent - if (ptex && ptex->texture && (ptex->width != width || ptex->height != height)) { - free_texture(ps, &ptex); - } - - // Allocate structure - if (!ptex) { - ptex = ccalloc(1, glx_texture_t); - *pptex = ptex; - - ptex->width = width; - ptex->height = height; - ptex->target = GL_TEXTURE_RECTANGLE; - if (ps->psglx->has_texture_non_power_of_two) { - ptex->target = GL_TEXTURE_2D; - } - } - - // Create texture - if (!ptex->texture) { - ptex->texture = glx_gen_texture(ptex->target, width, height); - } - if (!ptex->texture) { - log_error("Failed to allocate texture."); - return false; - } - - // Read destination pixels into a texture - glEnable(ptex->target); - glBindTexture(ptex->target, ptex->texture); - if (width > 0 && height > 0) { - glx_copy_region_to_tex(ps, ptex->target, x, y, x, y, width, height); - } - - // Cleanup - glBindTexture(ptex->target, 0); - glDisable(ptex->target); - - gl_check_err(); - - return true; -} - -/** - * Bind a X pixmap to an OpenGL texture. - */ -bool glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, xcb_pixmap_t pixmap, int width, - int height, bool repeat, const struct glx_fbconfig_info *fbcfg) { - if (ps->o.backend != BKEND_GLX && ps->o.backend != BKEND_XR_GLX_HYBRID) - return true; - - if (!pixmap) { - log_error("Binding to an empty pixmap %#010x. This can't work.", pixmap); - return false; - } - - assert(fbcfg); - glx_texture_t *ptex = *pptex; - bool need_release = true; - - // Release pixmap if parameters are inconsistent - if (ptex && ptex->texture && ptex->pixmap != pixmap) { - glx_release_pixmap(ps, ptex); - } - - // Allocate structure - if (!ptex) { - static const glx_texture_t GLX_TEX_DEF = { - .texture = 0, - .glpixmap = 0, - .pixmap = 0, - .target = 0, - .width = 0, - .height = 0, - .y_inverted = false, - }; - - ptex = cmalloc(glx_texture_t); - memcpy(ptex, &GLX_TEX_DEF, sizeof(glx_texture_t)); - *pptex = ptex; - } - - // Create GLX pixmap - int depth = 0; - if (!ptex->glpixmap) { - need_release = false; - - // Retrieve pixmap parameters, if they aren't provided - if (!width || !height) { - auto r = xcb_get_geometry_reply( - ps->c, xcb_get_geometry(ps->c, pixmap), NULL); - if (!r) { - log_error("Failed to query info of pixmap %#010x.", pixmap); - return false; - } - if (r->depth > OPENGL_MAX_DEPTH) { - log_error("Requested depth %d higher than %d.", depth, - OPENGL_MAX_DEPTH); - return false; - } - depth = r->depth; - width = r->width; - height = r->height; - free(r); - } - - // Determine texture target, copied from compiz - // The assumption we made here is the target never changes based on any - // pixmap-specific parameters, and this may change in the future - GLenum tex_tgt = 0; - if (GLX_TEXTURE_2D_BIT_EXT & fbcfg->texture_tgts && - ps->psglx->has_texture_non_power_of_two) - tex_tgt = GLX_TEXTURE_2D_EXT; - else if (GLX_TEXTURE_RECTANGLE_BIT_EXT & fbcfg->texture_tgts) - tex_tgt = GLX_TEXTURE_RECTANGLE_EXT; - else if (!(GLX_TEXTURE_2D_BIT_EXT & fbcfg->texture_tgts)) - tex_tgt = GLX_TEXTURE_RECTANGLE_EXT; - else - tex_tgt = GLX_TEXTURE_2D_EXT; - - log_debug("depth %d, tgt %#x, rgba %d", depth, tex_tgt, - (GLX_TEXTURE_FORMAT_RGBA_EXT == fbcfg->texture_fmt)); - - GLint attrs[] = { - GLX_TEXTURE_FORMAT_EXT, - fbcfg->texture_fmt, - GLX_TEXTURE_TARGET_EXT, - (GLint)tex_tgt, - 0, - }; - - ptex->glpixmap = glXCreatePixmap(ps->dpy, fbcfg->cfg, pixmap, attrs); - ptex->pixmap = pixmap; - ptex->target = - (GLX_TEXTURE_2D_EXT == tex_tgt ? GL_TEXTURE_2D : GL_TEXTURE_RECTANGLE); - ptex->width = width; - ptex->height = height; - ptex->y_inverted = fbcfg->y_inverted; - } - if (!ptex->glpixmap) { - log_error("Failed to allocate GLX pixmap."); - return false; - } - - glEnable(ptex->target); - - // Create texture - if (!ptex->texture) { - need_release = false; - - GLuint texture = 0; - glGenTextures(1, &texture); - glBindTexture(ptex->target, texture); - - glTexParameteri(ptex->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(ptex->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - if (repeat) { - glTexParameteri(ptex->target, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(ptex->target, GL_TEXTURE_WRAP_T, GL_REPEAT); - } else { - glTexParameteri(ptex->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(ptex->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - - glBindTexture(ptex->target, 0); - - ptex->texture = texture; - } - if (!ptex->texture) { - log_error("Failed to allocate texture."); - return false; - } - - glBindTexture(ptex->target, ptex->texture); - - // The specification requires rebinding whenever the content changes... - // We can't follow this, too slow. - if (need_release) - glXReleaseTexImageEXT(ps->dpy, ptex->glpixmap, GLX_FRONT_LEFT_EXT); - - glXBindTexImageEXT(ps->dpy, ptex->glpixmap, GLX_FRONT_LEFT_EXT, NULL); - - // Cleanup - glBindTexture(ptex->target, 0); - glDisable(ptex->target); - - gl_check_err(); - - return true; -} - -/** - * @brief Release binding of a texture. - */ -void glx_release_pixmap(session_t *ps, glx_texture_t *ptex) { - // Release binding - if (ptex->glpixmap && ptex->texture) { - glBindTexture(ptex->target, ptex->texture); - glXReleaseTexImageEXT(ps->dpy, ptex->glpixmap, GLX_FRONT_LEFT_EXT); - glBindTexture(ptex->target, 0); - } - - // Free GLX Pixmap - if (ptex->glpixmap) { - glXDestroyPixmap(ps->dpy, ptex->glpixmap); - ptex->glpixmap = 0; - } - - gl_check_err(); -} - -/** - * Set clipping region on the target window. - */ -void glx_set_clip(session_t *ps, const region_t *reg) { - // Quit if we aren't using stencils - if (ps->o.glx_no_stencil) - return; - - glDisable(GL_STENCIL_TEST); - glDisable(GL_SCISSOR_TEST); - - if (!reg) - return; - - int nrects; - const rect_t *rects = pixman_region32_rectangles((region_t *)reg, &nrects); - - if (nrects == 1) { - glEnable(GL_SCISSOR_TEST); - glScissor(rects[0].x1, ps->root_height - rects[0].y2, - rects[0].x2 - rects[0].x1, rects[0].y2 - rects[0].y1); - } - - gl_check_err(); -} - -#define P_PAINTREG_START(var) \ - region_t reg_new; \ - int nrects; \ - const rect_t *rects; \ - assert(width >= 0 && height >= 0); \ - pixman_region32_init_rect(®_new, dx, dy, (uint)width, (uint)height); \ - pixman_region32_intersect(®_new, ®_new, (region_t *)reg_tgt); \ - rects = pixman_region32_rectangles(®_new, &nrects); \ - glBegin(GL_QUADS); \ - \ - for (int ri = 0; ri < nrects; ++ri) { \ - rect_t var = rects[ri]; - -#define P_PAINTREG_END() \ - } \ - glEnd(); \ - \ - pixman_region32_fini(®_new); - -/** - * Blur contents in a particular region. - * - * XXX seems to be way to complex for what it does - */ -bool glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z, - GLfloat factor_center, const region_t *reg_tgt, glx_blur_cache_t *pbc) { - assert(ps->psglx->blur_passes[0].prog); - const bool more_passes = ps->o.blur_kernel_count > 1; - const bool have_scissors = glIsEnabled(GL_SCISSOR_TEST); - const bool have_stencil = glIsEnabled(GL_STENCIL_TEST); - bool ret = false; - - // Calculate copy region size - glx_blur_cache_t ibc = {.width = 0, .height = 0}; - if (!pbc) - pbc = &ibc; - - int mdx = dx, mdy = dy, mwidth = width, mheight = height; - // log_trace("%d, %d, %d, %d", mdx, mdy, mwidth, mheight); - - /* - if (ps->o.resize_damage > 0) { - int inc_x = 0, inc_y = 0; - for (int i = 0; i < MAX_BLUR_PASS; ++i) { - XFixed *kern = ps->o.blur_kerns[i]; - if (!kern) break; - inc_x += XFIXED_TO_DOUBLE(kern[0]) / 2; - inc_y += XFIXED_TO_DOUBLE(kern[1]) / 2; - } - inc_x = min2(ps->o.resize_damage, inc_x); - inc_y = min2(ps->o.resize_damage, inc_y); - - mdx = max2(dx - inc_x, 0); - mdy = max2(dy - inc_y, 0); - int mdx2 = min2(dx + width + inc_x, ps->root_width), - mdy2 = min2(dy + height + inc_y, ps->root_height); - mwidth = mdx2 - mdx; - mheight = mdy2 - mdy; - } - */ - - GLenum tex_tgt = GL_TEXTURE_RECTANGLE; - if (ps->psglx->has_texture_non_power_of_two) - tex_tgt = GL_TEXTURE_2D; - - // Free textures if size inconsistency discovered - if (mwidth != pbc->width || mheight != pbc->height) - free_glx_bc_resize(ps, pbc); - - // Generate FBO and textures if needed - if (!pbc->textures[0]) - pbc->textures[0] = glx_gen_texture(tex_tgt, mwidth, mheight); - GLuint tex_scr = pbc->textures[0]; - if (more_passes && !pbc->textures[1]) - pbc->textures[1] = glx_gen_texture(tex_tgt, mwidth, mheight); - pbc->width = mwidth; - pbc->height = mheight; - GLuint tex_scr2 = pbc->textures[1]; - if (more_passes && !pbc->fbo) - glGenFramebuffers(1, &pbc->fbo); - const GLuint fbo = pbc->fbo; - - if (!tex_scr || (more_passes && !tex_scr2)) { - log_error("Failed to allocate texture."); - goto glx_blur_dst_end; - } - if (more_passes && !fbo) { - log_error("Failed to allocate framebuffer."); - goto glx_blur_dst_end; - } - - // Read destination pixels into a texture - glEnable(tex_tgt); - glBindTexture(tex_tgt, tex_scr); - glx_copy_region_to_tex(ps, tex_tgt, mdx, mdy, mdx, mdy, mwidth, mheight); - /* - if (tex_scr2) { - glBindTexture(tex_tgt, tex_scr2); - glx_copy_region_to_tex(ps, tex_tgt, mdx, mdy, mdx, mdy, mwidth, dx - mdx); - glx_copy_region_to_tex(ps, tex_tgt, mdx, mdy, mdx, dy + height, - mwidth, mdy + mheight - dy - height); - glx_copy_region_to_tex(ps, tex_tgt, mdx, mdy, mdx, dy, dx - mdx, height); - glx_copy_region_to_tex(ps, tex_tgt, mdx, mdy, dx + width, dy, - mdx + mwidth - dx - width, height); - } */ - - // Texture scaling factor - GLfloat texfac_x = 1.0f, texfac_y = 1.0f; - if (tex_tgt == GL_TEXTURE_2D) { - texfac_x /= (GLfloat)mwidth; - texfac_y /= (GLfloat)mheight; - } - - // Paint it back - if (more_passes) { - glDisable(GL_STENCIL_TEST); - glDisable(GL_SCISSOR_TEST); - } - - bool last_pass = false; - for (int i = 0; i < ps->o.blur_kernel_count; ++i) { - last_pass = (i == ps->o.blur_kernel_count - 1); - const glx_blur_pass_t *ppass = &ps->psglx->blur_passes[i]; - assert(ppass->prog); - - assert(tex_scr); - glBindTexture(tex_tgt, tex_scr); - - if (!last_pass) { - glBindFramebuffer(GL_FRAMEBUFFER, fbo); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, tex_scr2, 0); - glDrawBuffer(GL_COLOR_ATTACHMENT0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { - log_error("Framebuffer attachment failed."); - goto glx_blur_dst_end; - } - } else { - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDrawBuffer(GL_BACK); - if (have_scissors) - glEnable(GL_SCISSOR_TEST); - if (have_stencil) - glEnable(GL_STENCIL_TEST); - } - - // Color negation for testing... - // glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); - // glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); - // glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_ONE_MINUS_SRC_COLOR); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glUseProgram(ppass->prog); - if (ppass->unifm_offset_x >= 0) - glUniform1f(ppass->unifm_offset_x, texfac_x); - if (ppass->unifm_offset_y >= 0) - glUniform1f(ppass->unifm_offset_y, texfac_y); - if (ppass->unifm_factor_center >= 0) - glUniform1f(ppass->unifm_factor_center, factor_center); - - P_PAINTREG_START(crect) { - auto rx = (GLfloat)(crect.x1 - mdx) * texfac_x; - auto ry = (GLfloat)(mheight - (crect.y1 - mdy)) * texfac_y; - auto rxe = rx + (GLfloat)(crect.x2 - crect.x1) * texfac_x; - auto rye = ry - (GLfloat)(crect.y2 - crect.y1) * texfac_y; - auto rdx = (GLfloat)(crect.x1 - mdx); - auto rdy = (GLfloat)(mheight - crect.y1 + mdy); - if (last_pass) { - rdx = (GLfloat)crect.x1; - rdy = (GLfloat)(ps->root_height - crect.y1); - } - auto rdxe = rdx + (GLfloat)(crect.x2 - crect.x1); - auto rdye = rdy - (GLfloat)(crect.y2 - crect.y1); - - // log_trace("%f, %f, %f, %f -> %f, %f, %f, %f", rx, ry, - // rxe, rye, rdx, - // rdy, rdxe, rdye); - - glTexCoord2f(rx, ry); - glVertex3f(rdx, rdy, z); - - glTexCoord2f(rxe, ry); - glVertex3f(rdxe, rdy, z); - - glTexCoord2f(rxe, rye); - glVertex3f(rdxe, rdye, z); - - glTexCoord2f(rx, rye); - glVertex3f(rdx, rdye, z); - } - P_PAINTREG_END(); - - glUseProgram(0); - - // Swap tex_scr and tex_scr2 - { - GLuint tmp = tex_scr2; - tex_scr2 = tex_scr; - tex_scr = tmp; - } - } - - ret = true; - -glx_blur_dst_end: - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glBindTexture(tex_tgt, 0); - glDisable(tex_tgt); - if (have_scissors) - glEnable(GL_SCISSOR_TEST); - if (have_stencil) - glEnable(GL_STENCIL_TEST); - - if (&ibc == pbc) { - free_glx_bc(ps, pbc); - } - - gl_check_err(); - - return ret; -} - -// TODO(bhagwan) this is a mess and needs a more consistent way of getting the border -// pixel I tried looking for a notify event for XCB_CW_BORDER_PIXEL (in -// xcb_create_window()) or a way to get the pixels from xcb_render_picture_t but the -// documentation for the xcb_xrender extension is literaly non existent... -// -// NOTE(yshui) There is no consistent way to get the "border" color of a X window. From -// the WM's perspective there are multiple ways to implement window borders. Using -// glReadPixel is probably the most reliable way. -void glx_read_border_pixel(int root_height, int root_width, int x, int y, int width, - int height, float *ppixel) { - assert(ppixel); - - // Reset the color so the shader doesn't use it - ppixel[0] = ppixel[1] = ppixel[2] = ppixel[3] = -1.0F; - - // First try bottom left corner past the - // circle radius (after the rounded corner ends) - auto screen_x = x; - auto screen_y = root_height - height - y; - - // X is out of bounds - // move to the right side - if (screen_x < 0) { - screen_x += width; - } - - // Y is out of bounds - // move to to top part - if (screen_y < 0) { - screen_y += height; - } - - // All corners are out of bounds, give up - if (screen_x < 0 || screen_y < 0 || screen_x >= root_width || screen_y >= root_height) { - return; - } - - // Invert Y-axis so we can query border color from texture (0,0) - glReadPixels(screen_x, screen_y, 1, 1, GL_RGBA, GL_FLOAT, (void *)ppixel); - - log_trace("xy(%d, %d), glxy(%d %d) wh(%d %d), border_col(%.2f, %.2f, %.2f, %.2f)", - x, y, screen_x, screen_y, width, height, (float)ppixel[0], - (float)ppixel[1], (float)ppixel[2], (float)ppixel[3]); - - gl_check_err(); -} - -bool glx_round_corners_dst(session_t *ps, struct managed_win *w, - const glx_texture_t *ptex, int dx, int dy, int width, - int height, float z, float cr, const region_t *reg_tgt) { - assert(ps->psglx->round_passes->prog); - bool ret = false; - - // log_warn("dxy(%d, %d) wh(%d %d) rwh(%d %d) b(%d), f(%d)", - // dx, dy, width, height, ps->root_width, ps->root_height, w->g.border_width, - // w->focused); - - int mdx = dx, mdy = dy, mwidth = width, mheight = height; - log_trace("%d, %d, %d, %d", mdx, mdy, mwidth, mheight); - - if (w->g.border_width > 0) { - glx_read_border_pixel(ps->root_height, ps->root_width, dx, dy, width, - height, &w->border_col[0]); - } - - { - const glx_round_pass_t *ppass = ps->psglx->round_passes; - assert(ppass->prog); - - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - - glUseProgram(ppass->prog); - - // If caller specified a texture use it as source - log_trace("ptex: %p wh(%d %d) %d %d", ptex, ptex->width, ptex->height, - ptex->target, ptex->texture); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(ptex->target, ptex->texture); - - if (ppass->unifm_tex_scr >= 0) { - glUniform1i(ppass->unifm_tex_scr, (GLint)0); - } - if (ppass->unifm_radius >= 0) { - glUniform1f(ppass->unifm_radius, cr); - } - if (ppass->unifm_texcoord >= 0) { - glUniform2f(ppass->unifm_texcoord, (float)dx, (float)dy); - } - if (ppass->unifm_texsize >= 0) { - glUniform2f(ppass->unifm_texsize, (float)mwidth, (float)mheight); - } - if (ppass->unifm_borderw >= 0) { - // Don't render rounded border if we don't know the border color - glUniform1f(ppass->unifm_borderw, - w->border_col[0] != -1. ? (GLfloat)w->g.border_width : 0); - } - if (ppass->unifm_borderc >= 0) { - glUniform4f(ppass->unifm_borderc, w->border_col[0], - w->border_col[1], w->border_col[2], w->border_col[3]); - } - if (ppass->unifm_resolution >= 0) { - glUniform2f(ppass->unifm_resolution, (float)ps->root_width, - (float)ps->root_height); - } - - // Painting - { - P_PAINTREG_START(crect) { - // texture-local coordinates - auto rx = (GLfloat)(crect.x1 - dx); - auto ry = (GLfloat)(crect.y1 - dy); - auto rxe = rx + (GLfloat)(crect.x2 - crect.x1); - auto rye = ry + (GLfloat)(crect.y2 - crect.y1); - if (GL_TEXTURE_2D == ptex->target) { - rx = rx / (GLfloat)width; - ry = ry / (GLfloat)height; - rxe = rxe / (GLfloat)width; - rye = rye / (GLfloat)height; - } - - // coordinates for the texture in the target - auto rdx = (GLfloat)crect.x1; - auto rdy = (GLfloat)(ps->root_height - crect.y1); - auto rdxe = (GLfloat)rdx + (GLfloat)(crect.x2 - crect.x1); - auto rdye = (GLfloat)rdy - (GLfloat)(crect.y2 - crect.y1); - - // Invert Y if needed, this may not work as expected, - // though. I don't have such a FBConfig to test with. - ry = 1.0F - ry; - rye = 1.0F - rye; - - // log_trace("Rect %d (i:%d): %f, %f, %f, %f -> %f, %f, - // %f, %f", ri ,ptex ? ptex->y_inverted : -1, rx, ry, - // rxe, - // rye, rdx, rdy, rdxe, rdye); - - glTexCoord2f(rx, ry); - glVertex3f(rdx, rdy, z); - - glTexCoord2f(rxe, ry); - glVertex3f(rdxe, rdy, z); - - glTexCoord2f(rxe, rye); - glVertex3f(rdxe, rdye, z); - - glTexCoord2f(rx, rye); - glVertex3f(rdx, rdye, z); - } - P_PAINTREG_END(); - } - - glUseProgram(0); - glDisable(GL_BLEND); - } - - ret = true; - - glBindTexture(ptex->target, 0); - glDisable(ptex->target); - glDisable(GL_BLEND); - - gl_check_err(); - - return ret; -} - -bool glx_dim_dst(session_t *ps, int dx, int dy, int width, int height, int z, - GLfloat factor, const region_t *reg_tgt) { - // It's possible to dim in glx_render(), but it would be over-complicated - // considering all those mess in color negation and modulation - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(0.0f, 0.0f, 0.0f, factor); - - P_PAINTREG_START(crect) { - // XXX what does all of these variables mean? - GLint rdx = crect.x1; - GLint rdy = ps->root_height - crect.y1; - GLint rdxe = rdx + (crect.x2 - crect.x1); - GLint rdye = rdy - (crect.y2 - crect.y1); - - glVertex3i(rdx, rdy, z); - glVertex3i(rdxe, rdy, z); - glVertex3i(rdxe, rdye, z); - glVertex3i(rdx, rdye, z); - } - P_PAINTREG_END(); - - glColor4f(0.0f, 0.0f, 0.0f, 0.0f); - glDisable(GL_BLEND); - - gl_check_err(); - - return true; -} - -/** - * @brief Render a region with texture data. - */ -bool glx_render(session_t *ps, const glx_texture_t *ptex, int x, int y, int dx, int dy, - int width, int height, int z, double opacity, bool argb, bool neg, - const region_t *reg_tgt, const glx_prog_main_t *pprogram) { - if (!ptex || !ptex->texture) { - log_error("Missing texture."); - return false; - } - - const bool has_prog = pprogram && pprogram->prog; - bool dual_texture = false; - - // It's required by legacy versions of OpenGL to enable texture target - // before specifying environment. Thanks to madsy for telling me. - glEnable(ptex->target); - - // Enable blending if needed - if (opacity < 1.0 || argb) { - - glEnable(GL_BLEND); - - // Needed for handling opacity of ARGB texture - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - // This is all weird, but X Render is using premultiplied ARGB format, and - // we need to use those things to correct it. Thanks to derhass for help. - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glColor4d(opacity, opacity, opacity, opacity); - } - - if (!has_prog) { - // The default, fixed-function path - // Color negation - if (neg) { - // Simple color negation - if (!glIsEnabled(GL_BLEND)) { - glEnable(GL_COLOR_LOGIC_OP); - glLogicOp(GL_COPY_INVERTED); - } - // ARGB texture color negation - else if (argb) { - dual_texture = true; - - // Use two texture stages because the calculation is too - // complicated, thanks to madsy for providing code Texture - // stage 0 - glActiveTexture(GL_TEXTURE0); - - // Negation for premultiplied color: color = A - C - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_SUBTRACT); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_ALPHA); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); - - // Pass texture alpha through - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); - - // Texture stage 1 - glActiveTexture(GL_TEXTURE1); - glEnable(ptex->target); - glBindTexture(ptex->target, ptex->texture); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); - - // Modulation with constant factor - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PRIMARY_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_ALPHA); - - // Modulation with constant factor - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_PREVIOUS); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PRIMARY_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); - - glActiveTexture(GL_TEXTURE0); - } - // RGB blend color negation - else { - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); - - // Modulation with constant factor - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, - GL_ONE_MINUS_SRC_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_PRIMARY_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR); - - // Modulation with constant factor - glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, GL_TEXTURE); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA); - glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, GL_PRIMARY_COLOR); - glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA); - } - } - } else { - // Programmable path - assert(pprogram->prog); - glUseProgram(pprogram->prog); - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - if (pprogram->unifm_opacity >= 0) - glUniform1f(pprogram->unifm_opacity, (float)opacity); - if (pprogram->unifm_invert_color >= 0) - glUniform1i(pprogram->unifm_invert_color, neg); - if (pprogram->unifm_tex >= 0) - glUniform1i(pprogram->unifm_tex, 0); - if (pprogram->unifm_time >= 0) - glUniform1f(pprogram->unifm_time, (float)ts.tv_sec * 1000.0f + - (float)ts.tv_nsec / 1.0e6f); - } - - // log_trace("Draw: %d, %d, %d, %d -> %d, %d (%d, %d) z %d", x, y, width, height, - // dx, dy, ptex->width, ptex->height, z); - - // Bind texture - glBindTexture(ptex->target, ptex->texture); - if (dual_texture) { - glActiveTexture(GL_TEXTURE1); - glBindTexture(ptex->target, ptex->texture); - glActiveTexture(GL_TEXTURE0); - } - - // Painting - { - P_PAINTREG_START(crect) { - // texture-local coordinates - auto rx = (GLfloat)(crect.x1 - dx + x); - auto ry = (GLfloat)(crect.y1 - dy + y); - auto rxe = rx + (GLfloat)(crect.x2 - crect.x1); - auto rye = ry + (GLfloat)(crect.y2 - crect.y1); - // Rectangle textures have [0-w] [0-h] while 2D texture has [0-1] - // [0-1] Thanks to amonakov for pointing out! - if (GL_TEXTURE_2D == ptex->target) { - rx = rx / (GLfloat)ptex->width; - ry = ry / (GLfloat)ptex->height; - rxe = rxe / (GLfloat)ptex->width; - rye = rye / (GLfloat)ptex->height; - } - - // coordinates for the texture in the target - GLint rdx = crect.x1; - GLint rdy = ps->root_height - crect.y1; - GLint rdxe = rdx + (crect.x2 - crect.x1); - GLint rdye = rdy - (crect.y2 - crect.y1); - - // Invert Y if needed, this may not work as expected, though. I - // don't have such a FBConfig to test with. - if (!ptex->y_inverted) { - ry = 1.0f - ry; - rye = 1.0f - rye; - } - - // log_trace("Rect %d: %f, %f, %f, %f -> %d, %d, %d, %d", ri, rx, - // ry, rxe, rye, - // rdx, rdy, rdxe, rdye); - -#define P_TEXCOORD(cx, cy) \ - { \ - if (dual_texture) { \ - glMultiTexCoord2f(GL_TEXTURE0, cx, cy); \ - glMultiTexCoord2f(GL_TEXTURE1, cx, cy); \ - } else \ - glTexCoord2f(cx, cy); \ - } - P_TEXCOORD(rx, ry); - glVertex3i(rdx, rdy, z); - - P_TEXCOORD(rxe, ry); - glVertex3i(rdxe, rdy, z); - - P_TEXCOORD(rxe, rye); - glVertex3i(rdxe, rdye, z); - - P_TEXCOORD(rx, rye); - glVertex3i(rdx, rdye, z); - } - P_PAINTREG_END(); - } - - // Cleanup - glBindTexture(ptex->target, 0); - glColor4f(0.0f, 0.0f, 0.0f, 0.0f); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glDisable(GL_BLEND); - glDisable(GL_COLOR_LOGIC_OP); - glDisable(ptex->target); - - if (dual_texture) { - glActiveTexture(GL_TEXTURE1); - glBindTexture(ptex->target, 0); - glDisable(ptex->target); - glActiveTexture(GL_TEXTURE0); - } - - if (has_prog) - glUseProgram(0); - - gl_check_err(); - - return true; -} diff --git a/dwm/picom/src/opengl.h b/dwm/picom/src/opengl.h deleted file mode 100644 index dcd8697..0000000 --- a/dwm/picom/src/opengl.h +++ /dev/null @@ -1,246 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#pragma once - -#include "common.h" -#include "compiler.h" -#include "log.h" -#include "region.h" -#include "render.h" -#include "win.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct { - /// Fragment shader for blur. - GLuint frag_shader; - /// GLSL program for blur. - GLuint prog; - /// Location of uniform "offset_x" in blur GLSL program. - GLint unifm_offset_x; - /// Location of uniform "offset_y" in blur GLSL program. - GLint unifm_offset_y; - /// Location of uniform "factor_center" in blur GLSL program. - GLint unifm_factor_center; -} glx_blur_pass_t; - -typedef struct { - /// Fragment shader for rounded corners. - GLuint frag_shader; - /// GLSL program for rounded corners. - GLuint prog; - /// Location of uniform "radius" in rounded-corners GLSL program. - GLint unifm_radius; - /// Location of uniform "texcoord" in rounded-corners GLSL program. - GLint unifm_texcoord; - /// Location of uniform "texsize" in rounded-corners GLSL program. - GLint unifm_texsize; - /// Location of uniform "borderw" in rounded-corners GLSL program. - GLint unifm_borderw; - /// Location of uniform "borderc" in rounded-corners GLSL program. - GLint unifm_borderc; - /// Location of uniform "resolution" in rounded-corners GLSL program. - GLint unifm_resolution; - /// Location of uniform "texture_scr" in rounded-corners GLSL program. - GLint unifm_tex_scr; - -} glx_round_pass_t; - -/// Structure containing GLX-dependent data for a session. -typedef struct glx_session { - // === OpenGL related === - /// GLX context. - GLXContext context; - /// Whether we have GL_ARB_texture_non_power_of_two. - bool has_texture_non_power_of_two; - /// Current GLX Z value. - int z; - glx_blur_pass_t *blur_passes; - glx_round_pass_t *round_passes; -} glx_session_t; - -/// @brief Wrapper of a binded GLX texture. -typedef struct _glx_texture { - GLuint texture; - GLXPixmap glpixmap; - xcb_pixmap_t pixmap; - GLenum target; - int width; - int height; - bool y_inverted; -} glx_texture_t; - -#define CGLX_SESSION_INIT \ - { .context = NULL } - -bool glx_dim_dst(session_t *ps, int dx, int dy, int width, int height, int z, - GLfloat factor, const region_t *reg_tgt); - -bool glx_render(session_t *ps, const glx_texture_t *ptex, int x, int y, int dx, int dy, - int width, int height, int z, double opacity, bool argb, bool neg, - const region_t *reg_tgt, const glx_prog_main_t *pprogram); - -bool glx_init(session_t *ps, bool need_render); - -void glx_destroy(session_t *ps); - -void glx_on_root_change(session_t *ps); - -bool glx_init_blur(session_t *ps); - -bool glx_init_rounded_corners(session_t *ps); - -#ifdef CONFIG_OPENGL -bool glx_load_prog_main(const char *vshader_str, const char *fshader_str, - glx_prog_main_t *pprogram); -#endif - -bool glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, xcb_pixmap_t pixmap, int width, - int height, bool repeat, const struct glx_fbconfig_info *); - -void glx_release_pixmap(session_t *ps, glx_texture_t *ptex); - -bool glx_bind_texture(session_t *ps, glx_texture_t **pptex, int x, int y, int width, int height); - -void glx_paint_pre(session_t *ps, region_t *preg) attr_nonnull(1, 2); - -/** - * Check if a texture is binded, or is binded to the given pixmap. - */ -static inline bool glx_tex_binded(const glx_texture_t *ptex, xcb_pixmap_t pixmap) { - return ptex && ptex->glpixmap && ptex->texture && (!pixmap || pixmap == ptex->pixmap); -} - -void glx_set_clip(session_t *ps, const region_t *reg); - -bool glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z, - GLfloat factor_center, const region_t *reg_tgt, glx_blur_cache_t *pbc); - -bool glx_round_corners_dst(session_t *ps, struct managed_win *w, - const glx_texture_t *ptex, int dx, int dy, int width, - int height, float z, float cr, const region_t *reg_tgt); - -GLuint glx_create_shader(GLenum shader_type, const char *shader_str); - -GLuint glx_create_program(const GLuint *const shaders, int nshaders); - -GLuint glx_create_program_from_str(const char *vert_shader_str, const char *frag_shader_str); - -unsigned char *glx_take_screenshot(session_t *ps, int *out_length); - -/** - * Check if there's a GLX context. - */ -static inline bool glx_has_context(session_t *ps) { - return ps->psglx && ps->psglx->context; -} - -/** - * Ensure we have a GLX context. - */ -static inline bool ensure_glx_context(session_t *ps) { - // Create GLX context - if (!glx_has_context(ps)) - glx_init(ps, false); - - return ps->psglx->context; -} - -/** - * Free a GLX texture. - */ -static inline void free_texture_r(session_t *ps attr_unused, GLuint *ptexture) { - if (*ptexture) { - assert(glx_has_context(ps)); - glDeleteTextures(1, ptexture); - *ptexture = 0; - } -} - -/** - * Free a GLX Framebuffer object. - */ -static inline void free_glx_fbo(GLuint *pfbo) { - if (*pfbo) { - glDeleteFramebuffers(1, pfbo); - *pfbo = 0; - } - assert(!*pfbo); -} - -/** - * Free data in glx_blur_cache_t on resize. - */ -static inline void free_glx_bc_resize(session_t *ps, glx_blur_cache_t *pbc) { - free_texture_r(ps, &pbc->textures[0]); - free_texture_r(ps, &pbc->textures[1]); - pbc->width = 0; - pbc->height = 0; -} - -/** - * Free a glx_blur_cache_t - */ -static inline void free_glx_bc(session_t *ps, glx_blur_cache_t *pbc) { - free_glx_fbo(&pbc->fbo); - free_glx_bc_resize(ps, pbc); -} - -/** - * Free a glx_texture_t. - */ -static inline void free_texture(session_t *ps, glx_texture_t **pptex) { - glx_texture_t *ptex = *pptex; - - // Quit if there's nothing - if (!ptex) { - return; - } - - glx_release_pixmap(ps, ptex); - - free_texture_r(ps, &ptex->texture); - - // Free structure itself - free(ptex); - *pptex = NULL; -} - -/** - * Free GLX part of paint_t. - */ -static inline void free_paint_glx(session_t *ps, paint_t *ppaint) { - free_texture(ps, &ppaint->ptex); -#ifdef CONFIG_OPENGL - free(ppaint->fbcfg); -#endif - ppaint->fbcfg = NULL; -} - -/** - * Free GLX part of win. - */ -static inline void free_win_res_glx(session_t *ps, struct managed_win *w) { - free_paint_glx(ps, &w->paint); - free_paint_glx(ps, &w->shadow_paint); -#ifdef CONFIG_OPENGL - free_glx_bc(ps, &w->glx_blur_cache); - free_texture(ps, &w->glx_texture_bg); -#endif -} diff --git a/dwm/picom/src/options.c b/dwm/picom/src/options.c deleted file mode 100644 index 1808167..0000000 --- a/dwm/picom/src/options.c +++ /dev/null @@ -1,1093 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#include -#include -#include -#include -#include -#include -#include -#include // for xcb_render_fixed_t, XXX - -#include "backend/backend.h" -#include "common.h" -#include "config.h" -#include "log.h" -#include "options.h" -#include "utils.h" -#include "win.h" - -#pragma GCC diagnostic error "-Wunused-parameter" - -/** - * Print usage text. - */ -static void usage(const char *argv0, int ret) { -#define WARNING_DISABLED " (DISABLED AT COMPILE TIME)" - static const char *usage_text = - "picom (" COMPTON_VERSION ")\n" - "Please report bugs to https://github.com/yshui/picom\n\n" - "usage: %s [options]\n" - "Options:\n" - "\n" - "-r radius\n" - " The blur radius for shadows. (default 12)\n" - "\n" - "-o opacity\n" - " The translucency for shadows. (default .75)\n" - "\n" - "-l left-offset\n" - " The left offset for shadows. (default -15)\n" - "\n" - "-t top-offset\n" - " The top offset for shadows. (default -15)\n" - "\n" - "-I fade-in-step\n" - " Opacity change between steps while fading in. (default 0.028)\n" - "\n" - "-O fade-out-step\n" - " Opacity change between steps while fading out. (default 0.03)\n" - "\n" - "-D fade-delta-time\n" - " The time between steps in a fade in milliseconds. (default 10)\n" - "\n" - "-m opacity\n" - " The opacity for menus. (default 1.0)\n" - "\n" - "-c\n" - " Enabled client-side shadows on windows.\n" - "\n" - "-C\n" - " Avoid drawing shadows on dock/panel windows.\n" - "\n" - "-z\n" - " Zero the part of the shadow's mask behind the window.\n" - "\n" - "-f\n" - " Fade windows in/out when opening/closing and when opacity\n" - " changes, unless --no-fading-openclose is used.\n" - "\n" - "-F\n" - " Equals to -f. Deprecated.\n" - "\n" - "--animations\n" - " Run animations for window geometry changes (movement and scaling).\n" - "\n" - "--animation-for-open-window\n" - " Which animation to run when opening a window.\n" - " Must be one of `none`, `fly-in`, `zoom`,\n" - " `slide-down`, `slide-up`, `slide-left`, `slide-right`\n" - " (default: none).\n" - "\n" - "--animation-for-transient-window\n" - " Which animation to run when opening a transient window.\n" - " Must be one of `none`, `fly-in`, `zoom`,\n" - " `slide-down`, `slide-up`, `slide-left`, `slide-right`\n" - " (default: none).\n" - "\n" - "--animation-for-unmap-window\n" - " Which animation to run when hiding (e.g. minimize) a window.\n" - " Must be one of `auto`, `none`, `fly-in`, `zoom`,\n" - " `slide-down`, `slide-up`, `slide-left`, `slide-right`\n" - " `slide-in`, `slide-out`\n" - " (default: auto).\n" - "\n" - "--animation-for-workspace-switch-in\n" - " Which animation to run on switching workspace for windows\n" - " comming into view.\n" - " IMPORTANT: window manager must set _NET_CURRENT_DESKTOP\n" - " before doing the hide/show of windows\n" - " Must be one of `auto`, `none`, `fly-in`, `zoom`,\n" - " `slide-down`, `slide-up`, `slide-left`, `slide-right`\n" - " `slide-in`, `slide-out`\n" - " (default: auto).\n" - "\n" - "--animation-for-workspace-switch-out\n" - " Which animation to run on switching workspace for windows\n" - " going out of view.\n" - " IMPORTANT: window manager must set _NET_CURRENT_DESKTOP\n" - " before doing the hide/show of windows\n" - " Must be one of `auto`, `none`, `fly-in`, `zoom`,\n" - " `slide-down`, `slide-up`, `slide-left`, `slide-right`\n" - " `slide-in`, `slide-out`\n" - " (default: auto).\n" - "\n" - "--animation-stiffness\n" - " Stiffness (a.k.a. tension) parameter for animation (default: 200.0).\n" - "\n" - "--animation-dampening\n" - " Dampening (a.k.a. friction) parameter for animation (default: 25.0).\n" - "\n" - "--animation-window-mass\n" - " Mass parameter for animation (default: 1.0).\n" - "\n" - "--animation-delta\n" - " The time between steps in animation, in milliseconds. (> 0, defaults to 10).\n" - "\n" - "--animation-force-steps\n" - " Force animations to go step by step even if cpu usage is high \n" - " (default: false)\n" - "\n" - "--animation-clamping\n" - " Whether to clamp animations (default: true)\n" - "\n" - "--animation-exclude condition\n" - " Exclude conditions for animations.\n" - "\n" - "-i opacity\n" - " Opacity of inactive windows. (0.1 - 1.0)\n" - "\n" - "-e opacity\n" - " Opacity of window titlebars and borders. (0.1 - 1.0)\n" - "\n" - "-G\n" - " Don't draw shadows on DND windows\n" - "\n" - "-b\n" - " Daemonize process.\n" - "\n" - "--show-all-xerrors\n" - " Show all X errors (for debugging).\n" - "\n" - "--config path\n" - " Look for configuration file at the path. Use /dev/null to avoid\n" - " loading configuration file." -#ifndef CONFIG_LIBCONFIG - WARNING_DISABLED -#endif - "\n\n" - "--write-pid-path path\n" - " Write process ID to a file.\n" - "\n" - "--shadow-color color\n" - " Color of shadow, as a hex RGB string (defaults to #000000)\n" - "\n" - "--shadow-red value\n" - " Red color value of shadow (0.0 - 1.0, defaults to 0).\n" - "\n" - "--shadow-green value\n" - " Green color value of shadow (0.0 - 1.0, defaults to 0).\n" - "\n" - "--shadow-blue value\n" - " Blue color value of shadow (0.0 - 1.0, defaults to 0).\n" - "\n" - "--inactive-opacity-override\n" - " Inactive opacity set by -i overrides value of _NET_WM_WINDOW_OPACITY.\n" - "\n" - "--inactive-dim value\n" - " Dim inactive windows. (0.0 - 1.0, defaults to 0)\n" - "\n" - "--active-opacity opacity\n" - " Default opacity for active windows. (0.0 - 1.0)\n" - "\n" - "--corner-radius value\n" - " Sets the radius of rounded window corners. When > 0, the compositor\n" - " will round the corners of windows. (defaults to 0).\n" - "\n" - "--rounded-corners-exclude condition\n" - " Exclude conditions for rounded corners.\n" - "\n" - "--mark-wmwin-focused\n" - " Try to detect WM windows and mark them as active.\n" - "\n" - "--shadow-exclude condition\n" - " Exclude conditions for shadows.\n" - "\n" - "--fade-exclude condition\n" - " Exclude conditions for fading.\n" - "\n" - "--mark-ovredir-focused\n" - " Mark windows that have no WM frame as active.\n" - "\n" - "--no-fading-openclose\n" - " Do not fade on window open/close.\n" - "\n" - "--no-fading-destroyed-argb\n" - " Do not fade destroyed ARGB windows with WM frame. Workaround of bugs\n" - " in Openbox, Fluxbox, etc.\n" - "\n" - "--shadow-ignore-shaped\n" - " Do not paint shadows on shaped windows. (Deprecated, use\n" - " --shadow-exclude \'bounding_shaped\' or\n" - " --shadow-exclude \'bounding_shaped && !rounded_corners\' instead.)\n" - "\n" - "--detect-rounded-corners\n" - " Try to detect windows with rounded corners and don't consider\n" - " them shaped windows. Affects --shadow-ignore-shaped,\n" - " --unredir-if-possible, and possibly others. You need to turn this\n" - " on manually if you want to match against rounded_corners in\n" - " conditions.\n" - "\n" - "--detect-client-opacity\n" - " Detect _NET_WM_WINDOW_OPACITY on client windows, useful for window\n" - " managers not passing _NET_WM_WINDOW_OPACITY of client windows to frame\n" - " windows.\n" - "\n" - "--vsync\n" - " Enable VSync\n" - "\n" - "--use-ewmh-active-win\n" - " Use _NET_WM_ACTIVE_WINDOW on the root window to determine which\n" - " window is focused instead of using FocusIn/Out events.\n" - "\n" - "--unredir-if-possible\n" - " Unredirect all windows if a full-screen opaque window is\n" - " detected, to maximize performance for full-screen windows.\n" - "\n" - "--unredir-if-possible-delay ms\n" - " Delay before unredirecting the window, in milliseconds.\n" - " Defaults to 0.\n" - "\n" - "--unredir-if-possible-exclude condition\n" - " Conditions of windows that shouldn't be considered full-screen\n" - " for unredirecting screen.\n" - "\n" - "--focus-exclude condition\n" - " Specify a list of conditions of windows that should always be\n" - " considered focused.\n" - "\n" - "--inactive-dim-fixed\n" - " Use fixed inactive dim value.\n" - "\n" - "--max-brightness\n" - " Dims windows which average brightness is above this threshold.\n" - " Requires --no-use-damage.\n" - " Default: 1.0 or no dimming.\n" - "\n" - "--detect-transient\n" - " Use WM_TRANSIENT_FOR to group windows, and consider windows in\n" - " the same group focused at the same time.\n" - "\n" - "--detect-client-leader\n" - " Use WM_CLIENT_LEADER to group windows, and consider windows in\n" - " the same group focused at the same time. This usually means windows\n" - " from the same application will be considered focused or unfocused at\n" - " the same time. WM_TRANSIENT_FOR has higher priority if\n" - " --detect-transient is enabled, too.\n" - "\n" - "--blur-method\n" - " The algorithm used for background bluring. Available choices are:\n" - " 'none' to disable, 'gaussian', 'box' or 'kernel' for custom\n" - " convolution blur with --blur-kern.\n" - " Note: 'gaussian' and 'box' require --experimental-backends.\n" - "\n" - "--blur-size\n" - " The radius of the blur kernel for 'box' and 'gaussian' blur method.\n" - "\n" - "--blur-deviation\n" - " The standard deviation for the 'gaussian' blur method.\n" - "\n" - "--blur-strength\n" - " The strength level of the 'dual_kawase' blur method.\n" - "\n" - "--blur-background\n" - " Blur background of semi-transparent / ARGB windows. Bad in\n" - " performance. The switch name may change without prior\n" - " notifications.\n" - "\n" - "--blur-background-frame\n" - " Blur background of windows when the window frame is not opaque.\n" - " Implies --blur-background. Bad in performance. The switch name\n" - " may change.\n" - "\n" - "--blur-background-fixed\n" - " Use fixed blur strength instead of adjusting according to window\n" - " opacity.\n" - "\n" - "--blur-kern matrix\n" - " Specify the blur convolution kernel, with the following format:\n" - " WIDTH,HEIGHT,ELE1,ELE2,ELE3,ELE4,ELE5...\n" - " The element in the center must not be included, it will be forever\n" - " 1.0 or changing based on opacity, depending on whether you have\n" - " --blur-background-fixed.\n" - " A 7x7 Gaussian blur kernel looks like:\n" - " --blur-kern " - "'7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0." - "000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000849,0." - "029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.001723,0.059106,0." - "493069,0.493069,0.059106,0.001723,0.000849,0.029143,0.243117,0.493069,0." - "243117,0.029143,0.000849,0.000102,0.003494,0.029143,0.059106,0.029143,0." - "003494,0.000102,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0." - "000003'\n" - " Up to 4 blur kernels may be specified, separated with semicolon, for\n" - " multi-pass blur.\n" - " May also be one the predefined kernels: 3x3box (default), 5x5box,\n" - " 7x7box, 3x3gaussian, 5x5gaussian, 7x7gaussian, 9x9gaussian,\n" - " 11x11gaussian.\n" - "\n" - "--blur-background-exclude condition\n" - " Exclude conditions for background blur.\n" - "\n" - "--resize-damage integer\n" - " Resize damaged region by a specific number of pixels. A positive\n" - " value enlarges it while a negative one shrinks it. Useful for\n" - " fixing the line corruption issues of blur. May or may not\n" - " work with --glx-no-stencil. Shrinking doesn't function correctly.\n" - "\n" - "--invert-color-include condition\n" - " Specify a list of conditions of windows that should be painted with\n" - " inverted color. Resource-hogging, and is not well tested.\n" - "\n" - "--opacity-rule opacity:condition\n" - " Specify a list of opacity rules, in the format \"PERCENT:PATTERN\",\n" - " like \'50:name *= \"Firefox\"'. picom-trans is recommended over\n" - " this. Note we do not distinguish 100%% and unset, and we don't make\n" - " any guarantee about possible conflicts with other programs that set\n" - " _NET_WM_WINDOW_OPACITY on frame or client windows.\n" - "\n" - "--shadow-exclude-reg geometry\n" - " Specify a X geometry that describes the region in which shadow\n" - " should not be painted in, such as a dock window region.\n" - " Use --shadow-exclude-reg \'x10+0-0\', for example, if the 10 pixels\n" - " on the bottom of the screen should not have shadows painted on.\n" - "\n" - "--clip-shadow-above condition\n" - " Specify a list of conditions of windows to not paint a shadow over,\n" - " such as a dock window.\n" - "\n" - "--xinerama-shadow-crop\n" - " Crop shadow of a window fully on a particular Xinerama screen to the\n" - " screen.\n" - "\n" - "--backend backend\n" - " Choose backend. Possible choices are xrender, glx, and\n" - " xr_glx_hybrid." -#ifndef CONFIG_OPENGL - " (GLX BACKENDS DISABLED AT COMPILE TIME)" -#endif - "\n\n" - "--glx-no-stencil\n" - " GLX backend: Avoid using stencil buffer. Might cause issues\n" - " when rendering transparent content. My tests show a 15%% performance\n" - " boost.\n" - "\n" - "--glx-no-rebind-pixmap\n" - " GLX backend: Avoid rebinding pixmap on window damage. Probably\n" - " could improve performance on rapid window content changes, but is\n" - " known to break things on some drivers (LLVMpipe, xf86-video-intel,\n" - " etc.).\n" - "\n" - "--no-use-damage\n" - " Disable the use of damage information. This cause the whole screen to\n" - " be redrawn everytime, instead of the part of the screen that has\n" - " actually changed. Potentially degrades the performance, but might fix\n" - " some artifacts.\n" - "\n" - "--xrender-sync-fence\n" - " Additionally use X Sync fence to sync clients' draw calls. Needed\n" - " on nvidia-drivers with GLX backend for some users.\n" - "\n" - "--force-win-blend\n" - " Force all windows to be painted with blending. Useful if you have a\n" - " --glx-fshader-win that could turn opaque pixels transparent.\n" - "\n" - "--dbus\n" - " Enable remote control via D-Bus. See the D-BUS API section in the\n" - " man page for more details." -#ifndef CONFIG_DBUS - WARNING_DISABLED -#endif - "\n\n" - "--benchmark cycles\n" - " Benchmark mode. Repeatedly paint until reaching the specified cycles.\n" - "\n" - "--benchmark-wid window-id\n" - " Specify window ID to repaint in benchmark mode. If omitted or is 0,\n" - " the whole screen is repainted.\n" - "\n" - "--monitor-repaint\n" - " Highlight the updated area of the screen. For debugging the xrender\n" - " backend only.\n" - "\n" - "--debug-mode\n" - " Render into a separate window, and don't take over the screen. Useful\n" - " when you want to attach a debugger to picom\n" - "\n" - "--no-ewmh-fullscreen\n" - " Do not use EWMH to detect fullscreen windows. Reverts to checking\n" - " if a window is fullscreen based only on its size and coordinates.\n" - "\n" - "--transparent-clipping\n" - " Make transparent windows clip other windows like non-transparent windows\n" - " do, instead of blending on top of them\n"; - FILE *f = (ret ? stderr : stdout); - fprintf(f, usage_text, argv0); -#undef WARNING_DISABLED -} - -static const char *shortopts = "D:I:O:r:o:m:l:t:i:e:hscnfFCazGb"; -static const struct option longopts[] = { - {"help", no_argument, NULL, 'h'}, - {"config", required_argument, NULL, 256}, - {"shadow-radius", required_argument, NULL, 'r'}, - {"shadow-opacity", required_argument, NULL, 'o'}, - {"shadow-offset-x", required_argument, NULL, 'l'}, - {"shadow-offset-y", required_argument, NULL, 't'}, - {"fade-in-step", required_argument, NULL, 'I'}, - {"fade-out-step", required_argument, NULL, 'O'}, - {"fade-delta", required_argument, NULL, 'D'}, - {"menu-opacity", required_argument, NULL, 'm'}, - {"shadow", no_argument, NULL, 'c'}, - {"clear-shadow", no_argument, NULL, 'z'}, - {"fading", no_argument, NULL, 'f'}, - {"inactive-opacity", required_argument, NULL, 'i'}, - {"frame-opacity", required_argument, NULL, 'e'}, - {"daemon", no_argument, NULL, 'b'}, - {"shadow-red", required_argument, NULL, 257}, - {"shadow-green", required_argument, NULL, 258}, - {"shadow-blue", required_argument, NULL, 259}, - {"inactive-opacity-override", no_argument, NULL, 260}, - {"inactive-dim", required_argument, NULL, 261}, - {"mark-wmwin-focused", no_argument, NULL, 262}, - {"shadow-exclude", required_argument, NULL, 263}, - {"mark-ovredir-focused", no_argument, NULL, 264}, - {"no-fading-openclose", no_argument, NULL, 265}, - {"shadow-ignore-shaped", no_argument, NULL, 266}, - {"detect-rounded-corners", no_argument, NULL, 267}, - {"detect-client-opacity", no_argument, NULL, 268}, - {"refresh-rate", required_argument, NULL, 269}, - {"vsync", optional_argument, NULL, 270}, - {"sw-opti", no_argument, NULL, 274}, - {"vsync-aggressive", no_argument, NULL, 275}, - {"use-ewmh-active-win", no_argument, NULL, 276}, - {"respect-prop-shadow", no_argument, NULL, 277}, - {"unredir-if-possible", no_argument, NULL, 278}, - {"focus-exclude", required_argument, NULL, 279}, - {"inactive-dim-fixed", no_argument, NULL, 280}, - {"detect-transient", no_argument, NULL, 281}, - {"detect-client-leader", no_argument, NULL, 282}, - {"blur-background", no_argument, NULL, 283}, - {"blur-background-frame", no_argument, NULL, 284}, - {"blur-background-fixed", no_argument, NULL, 285}, - {"dbus", no_argument, NULL, 286}, - {"logpath", required_argument, NULL, 287}, - {"invert-color-include", required_argument, NULL, 288}, - {"opengl", no_argument, NULL, 289}, - {"backend", required_argument, NULL, 290}, - {"glx-no-stencil", no_argument, NULL, 291}, - {"benchmark", required_argument, NULL, 293}, - {"benchmark-wid", required_argument, NULL, 294}, - {"blur-background-exclude", required_argument, NULL, 296}, - {"active-opacity", required_argument, NULL, 297}, - {"glx-no-rebind-pixmap", no_argument, NULL, 298}, - {"glx-swap-method", required_argument, NULL, 299}, - {"fade-exclude", required_argument, NULL, 300}, - {"blur-kern", required_argument, NULL, 301}, - {"resize-damage", required_argument, NULL, 302}, - {"glx-use-gpushader4", no_argument, NULL, 303}, - {"opacity-rule", required_argument, NULL, 304}, - {"shadow-exclude-reg", required_argument, NULL, 305}, - {"paint-exclude", required_argument, NULL, 306}, - {"xinerama-shadow-crop", no_argument, NULL, 307}, - {"unredir-if-possible-exclude", required_argument, NULL, 308}, - {"unredir-if-possible-delay", required_argument, NULL, 309}, - {"write-pid-path", required_argument, NULL, 310}, - {"vsync-use-glfinish", no_argument, NULL, 311}, - {"xrender-sync-fence", no_argument, NULL, 313}, - {"show-all-xerrors", no_argument, NULL, 314}, - {"no-fading-destroyed-argb", no_argument, NULL, 315}, - {"force-win-blend", no_argument, NULL, 316}, - {"glx-fshader-win", required_argument, NULL, 317}, - {"version", no_argument, NULL, 318}, - {"no-x-selection", no_argument, NULL, 319}, - {"log-level", required_argument, NULL, 321}, - {"log-file", required_argument, NULL, 322}, - {"use-damage", no_argument, NULL, 323}, - {"no-use-damage", no_argument, NULL, 324}, - {"no-vsync", no_argument, NULL, 325}, - {"max-brightness", required_argument, NULL, 326}, - {"transparent-clipping", no_argument, NULL, 327}, - {"blur-method", required_argument, NULL, 328}, - {"blur-size", required_argument, NULL, 329}, - {"blur-deviation", required_argument, NULL, 330}, - {"blur-strength", required_argument, NULL, 331}, - {"shadow-color", required_argument, NULL, 332}, - {"corner-radius", required_argument, NULL, 333}, - {"rounded-corners-exclude", required_argument, NULL, 334}, - {"clip-shadow-above", required_argument, NULL, 335}, - {"experimental-backends", no_argument, NULL, 733}, - {"monitor-repaint", no_argument, NULL, 800}, - {"diagnostics", no_argument, NULL, 801}, - {"debug-mode", no_argument, NULL, 802}, - {"no-ewmh-fullscreen", no_argument, NULL, 803}, - {"animations", no_argument, NULL, 804}, - {"animation-stiffness", required_argument, NULL, 805}, - {"animation-dampening", required_argument, NULL, 806}, - {"animation-window-mass", required_argument, NULL, 807}, - {"animation-clamping", no_argument, NULL, 808}, - {"animation-for-open-window", required_argument, NULL, 809}, - {"animation-for-transient-window", required_argument, NULL, 810}, - {"animation-exclude", required_argument, NULL, 811}, - // Must terminate with a NULL entry - {NULL, 0, NULL, 0}, -}; - -/// Get config options that are needed to parse the rest of the options -/// Return true if we should quit -bool get_early_config(int argc, char *const *argv, char **config_file, bool *all_xerrors, - bool *fork, int *exit_code) { - int o = 0, longopt_idx = -1; - - // Pre-parse the commandline arguments to check for --config and invalid - // switches - // Must reset optind to 0 here in case we reread the commandline - // arguments - optind = 1; - *config_file = NULL; - *exit_code = 0; - while (-1 != (o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) { - if (o == 256) { - *config_file = strdup(optarg); - } else if (o == 'h') { - usage(argv[0], 0); - return true; - - } else if (o == 'b') { - *fork = true; - } else if (o == 314) { - *all_xerrors = true; - } else if (o == 318) { - printf("%s\n", COMPTON_VERSION); - return true; - } else if (o == '?' || o == ':') { - usage(argv[0], 1); - goto err; - } - } - - // Check for abundant positional arguments - if (optind < argc) { - // log is not initialized here yet - fprintf(stderr, "picom doesn't accept positional arguments.\n"); - goto err; - } - - return false; -err: - *exit_code = 1; - return true; -} - -/** - * Process arguments and configuration files. - */ -bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, - bool fading_enable, bool conv_kern_hasneg, win_option_mask_t *winopt_mask) { - - int o = 0, longopt_idx = -1; - - char *lc_numeric_old = strdup(setlocale(LC_NUMERIC, NULL)); - - // Enforce LC_NUMERIC locale "C" here to make sure dots are recognized - // instead of commas in atof(). - setlocale(LC_NUMERIC, "C"); - - // Parse commandline arguments. Range checking will be done later. - - bool failed = false; - const char *deprecation_message attr_unused = - "has been removed. If you encounter problems " - "without this feature, please feel free to " - "open a bug report."; - optind = 1; - while (-1 != (o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) { - switch (o) { -#define P_CASEBOOL(idx, option) \ - case idx: \ - opt->option = true; \ - break -#define P_CASELONG(idx, option) \ - case idx: \ - if (!parse_long(optarg, &opt->option)) { \ - exit(1); \ - } \ - break -#define P_CASEINT(idx, option) \ - case idx: \ - if (!parse_int(optarg, &opt->option)) { \ - exit(1); \ - } \ - break - - // clang-format off - // Short options - case 318: - case 'h': - // These options should cause us to exit early, - // so assert(false) here - assert(false); - break; - case 'b': - case 314: - case 320: - // These options are handled by get_early_config() - break; - P_CASEINT('D', fade_delta); - case 'I': opt->fade_in_step = normalize_d(atof(optarg)); break; - case 'O': opt->fade_out_step = normalize_d(atof(optarg)); break; - case 'c': shadow_enable = true; break; - case 'm':; - log_warn("--menu-opacity is deprecated, and will be removed." - "Please use the wintype option `opacity` of `popup_menu`" - "and `dropdown_menu` instead."); - double tmp; - tmp = normalize_d(atof(optarg)); - winopt_mask[WINTYPE_DROPDOWN_MENU].opacity = true; - winopt_mask[WINTYPE_POPUP_MENU].opacity = true; - opt->wintype_option[WINTYPE_POPUP_MENU].opacity = tmp; - opt->wintype_option[WINTYPE_DROPDOWN_MENU].opacity = tmp; - break; - case 'f': - case 'F': - fading_enable = true; - break; - P_CASEINT('r', shadow_radius); - case 'o': - opt->shadow_opacity = atof(optarg); - break; - P_CASEINT('l', shadow_offset_x); - P_CASEINT('t', shadow_offset_y); - case 'i': - opt->inactive_opacity = normalize_d(atof(optarg)); - break; - case 'e': opt->frame_opacity = atof(optarg); break; - case 'z': - log_warn("clear-shadow is removed, shadows are automatically " - "cleared now. If you want to prevent shadow from been " - "cleared under certain types of windows, you can use " - "the \"full-shadow\" per window type option."); - break; - case 'n': - case 'a': - case 's': - log_error("-n, -a, and -s have been removed."); - failed = true; break; - // Long options - case 256: - // --config - break; - case 332:; - // --shadow-color - struct color rgb; - rgb = hex_to_rgb(optarg); - opt->shadow_red = rgb.red; - opt->shadow_green = rgb.green; - opt->shadow_blue = rgb.blue; - break; - case 257: - // --shadow-red - opt->shadow_red = atof(optarg); - break; - case 258: - // --shadow-green - opt->shadow_green = atof(optarg); - break; - case 259: - // --shadow-blue - opt->shadow_blue = atof(optarg); - break; - P_CASEBOOL(260, inactive_opacity_override); - case 261: - // --inactive-dim - opt->inactive_dim = atof(optarg); - break; - P_CASEBOOL(262, mark_wmwin_focused); - case 263: - // --shadow-exclude - condlst_add(&opt->shadow_blacklist, optarg); - break; - P_CASEBOOL(264, mark_ovredir_focused); - P_CASEBOOL(265, no_fading_openclose); - P_CASEBOOL(266, shadow_ignore_shaped); - P_CASEBOOL(267, detect_rounded_corners); - P_CASEBOOL(268, detect_client_opacity); - case 269: - log_warn("--refresh-rate has been deprecated, please remove it from" - "your command line options"); - break; - case 270: - if (optarg) { - bool parsed_vsync = parse_vsync(optarg); - log_error("--vsync doesn't take argument anymore. \"%s\" " - "should be changed to \"%s\"", - optarg, parsed_vsync ? "true" : "false"); - failed = true; - } else { - opt->vsync = true; - } - break; - case 274: - log_warn("--sw-opti has been deprecated, please remove it from the " - "command line options"); - break; - case 275: - // --vsync-aggressive - log_error("--vsync-aggressive has been removed, please remove it" - " from the command line options"); - failed = true; - break; - P_CASEBOOL(276, use_ewmh_active_win); - case 277: - // --respect-prop-shadow - log_warn("--respect-prop-shadow option has been deprecated, its " - "functionality will always be enabled. Please remove it " - "from the command line options"); - break; - P_CASEBOOL(278, unredir_if_possible); - case 279: - // --focus-exclude - condlst_add(&opt->focus_blacklist, optarg); - break; - P_CASEBOOL(280, inactive_dim_fixed); - P_CASEBOOL(281, detect_transient); - P_CASEBOOL(282, detect_client_leader); - case 283: - // --blur_background - opt->blur_method = BLUR_METHOD_KERNEL; - break; - P_CASEBOOL(284, blur_background_frame); - P_CASEBOOL(285, blur_background_fixed); - P_CASEBOOL(286, dbus); - case 287: - log_warn("Please use --log-file instead of --logpath"); - // fallthrough - case 322: - // --logpath, --log-file - free(opt->logpath); - opt->logpath = strdup(optarg); - break; - case 288: - // --invert-color-include - condlst_add(&opt->invert_color_list, optarg); - break; - case 289: - // --opengl - opt->backend = BKEND_GLX; - break; - case 290: - // --backend - opt->backend = parse_backend(optarg); - if (opt->backend >= NUM_BKEND) - exit(1); - break; - P_CASEBOOL(291, glx_no_stencil); - P_CASEINT(293, benchmark); - case 294: - // --benchmark-wid - opt->benchmark_wid = (xcb_window_t)strtol(optarg, NULL, 0); - break; - case 296: - // --blur-background-exclude - condlst_add(&opt->blur_background_blacklist, optarg); - break; - case 297: - // --active-opacity - opt->active_opacity = normalize_d(atof(optarg)); - break; - P_CASEBOOL(298, glx_no_rebind_pixmap); - case 299: { - // --glx-swap-method - char *endptr; - long tmpval = strtol(optarg, &endptr, 10); - bool should_remove = true; - if (*endptr || !(*optarg)) { - // optarg is not a number, or an empty string - tmpval = -1; - } - if (strcmp(optarg, "undefined") != 0 && tmpval != 0) { - // If not undefined, we will use damage and buffer-age to - // limit the rendering area. - should_remove = false; - } - log_error("--glx-swap-method has been removed, your setting " - "\"%s\" should be %s.", - optarg, - !should_remove ? "replaced by `--use-damage`" : - "removed"); - failed = true; - break; - } - case 300: - // --fade-exclude - condlst_add(&opt->fade_blacklist, optarg); - break; - case 301: - // --blur-kern - opt->blur_kerns = parse_blur_kern_lst(optarg, &conv_kern_hasneg, - &opt->blur_kernel_count); - if (!opt->blur_kerns) { - exit(1); - } - break; - P_CASEINT(302, resize_damage); - case 303: - // --glx-use-gpushader4 - log_error("--glx-use-gpushader4 has been removed." - " Please remove it from command line options."); - failed = true; - break; - case 304: - // --opacity-rule - if (!parse_rule_opacity(&opt->opacity_rules, optarg)) - exit(1); - break; - case 305: - // --shadow-exclude-reg - free(opt->shadow_exclude_reg_str); - opt->shadow_exclude_reg_str = strdup(optarg); - log_warn("--shadow-exclude-reg is deprecated. You are likely " - "better off using --clip-shadow-above anyway"); - break; - case 306: - // --paint-exclude - condlst_add(&opt->paint_blacklist, optarg); - break; - P_CASEBOOL(307, xinerama_shadow_crop); - case 308: - // --unredir-if-possible-exclude - condlst_add(&opt->unredir_if_possible_blacklist, optarg); - break; - P_CASELONG(309, unredir_if_possible_delay); - case 310: - // --write-pid-path - free(opt->write_pid_path); - opt->write_pid_path = strdup(optarg); - if (*opt->write_pid_path != '/') { - log_warn("--write-pid-path is not an absolute path"); - } - break; - P_CASEBOOL(311, vsync_use_glfinish); - P_CASEBOOL(313, xrender_sync_fence); - P_CASEBOOL(315, no_fading_destroyed_argb); - P_CASEBOOL(316, force_win_blend); - case 317: - opt->glx_fshader_win_str = strdup(optarg); - break; - case 321: { - enum log_level tmp_level = string_to_log_level(optarg); - if (tmp_level == LOG_LEVEL_INVALID) { - log_warn("Invalid log level, defaults to WARN"); - } else { - log_set_level_tls(tmp_level); - } - break; - } - P_CASEBOOL(319, no_x_selection); - P_CASEBOOL(323, use_damage); - case 324: - opt->use_damage = false; - break; - case 325: - opt->vsync = false; - break; - - case 326: - opt->max_brightness = atof(optarg); - break; - P_CASEBOOL(327, transparent_clipping); - case 328: { - // --blur-method - enum blur_method method = parse_blur_method(optarg); - if (method >= BLUR_METHOD_INVALID) { - log_warn("Invalid blur method %s, ignoring.", optarg); - } else { - opt->blur_method = method; - } - break; - } - case 329: - // --blur-size - opt->blur_radius = atoi(optarg); - break; - case 330: - // --blur-deviation - opt->blur_deviation = atof(optarg); - break; - case 331: - // --blur-strength - opt->blur_strength = atoi(optarg); - break; - case 333: - // --cornor-radius - opt->corner_radius = atoi(optarg); - break; - case 334: - // --rounded-corners-exclude - condlst_add(&opt->rounded_corners_blacklist, optarg); - break; - case 335: - // --clip-shadow-above - condlst_add(&opt->shadow_clip_list, optarg); - break; - P_CASEBOOL(733, experimental_backends); - P_CASEBOOL(800, monitor_repaint); - case 801: opt->print_diagnostics = true; break; - P_CASEBOOL(802, debug_mode); - P_CASEBOOL(803, no_ewmh_fullscreen); - P_CASEBOOL(804, animations); - case 805: - // --animation-stiffness - opt->animation_stiffness = atof(optarg); - break; - case 806: - // --animation-dampening - opt->animation_dampening = atof(optarg); - break; - case 807: - // --animation-window-masss - opt->animation_window_mass = atof(optarg); - break; - case 808: - // --animation-clamping - opt->animation_clamping = true; - break; - case 809: { - // --animation-for-open-window - enum open_window_animation animation = parse_open_window_animation(optarg); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_warn("Invalid open-window animation %s, ignoring.", optarg); - } else { - opt->animation_for_open_window = animation; - } - break; - } - case 810: { - // --animation-for-transient-window - enum open_window_animation animation = parse_open_window_animation(optarg); - if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { - log_warn("Invalid transient-window animation %s, ignoring.", optarg); - } else { - opt->animation_for_transient_window = animation; - } - break; - } - case 811: { - // --animation-exclude - condlst_add(&opt->animation_blacklist, optarg); - break; - } - default: usage(argv[0], 1); break; -#undef P_CASEBOOL - } - // clang-format on - - if (failed) { - // Parsing this option has failed, break the loop - break; - } - } - - // Restore LC_NUMERIC - setlocale(LC_NUMERIC, lc_numeric_old); - free(lc_numeric_old); - - if (failed) { - return false; - } - - if (opt->monitor_repaint && opt->backend != BKEND_XRENDER && - !opt->experimental_backends) { - log_warn("--monitor-repaint has no effect when backend is not xrender"); - } - - if (opt->experimental_backends && !backend_list[opt->backend]) { - log_error("Backend \"%s\" is not available as part of the experimental " - "backends.", - BACKEND_STRS[opt->backend]); - return false; - } - - if (opt->debug_mode && !opt->experimental_backends) { - log_error("Debug mode only works with the experimental backends."); - return false; - } - - if (opt->transparent_clipping && !opt->experimental_backends) { - log_error("Transparent clipping only works with the experimental " - "backends"); - return false; - } - - // Range checking and option assignments - opt->fade_delta = max2(opt->fade_delta, 1); - opt->shadow_radius = max2(opt->shadow_radius, 0); - opt->shadow_red = normalize_d(opt->shadow_red); - opt->shadow_green = normalize_d(opt->shadow_green); - opt->shadow_blue = normalize_d(opt->shadow_blue); - opt->inactive_dim = normalize_d(opt->inactive_dim); - opt->frame_opacity = normalize_d(opt->frame_opacity); - opt->shadow_opacity = normalize_d(opt->shadow_opacity); - - opt->max_brightness = normalize_d(opt->max_brightness); - if (opt->max_brightness < 1.0) { - if (opt->use_damage) { - log_warn("--max-brightness requires --no-use-damage. Falling " - "back to 1.0"); - opt->max_brightness = 1.0; - } - - if (!opt->experimental_backends || opt->backend != BKEND_GLX) { - log_warn("--max-brightness requires the experimental glx " - "backend. Falling back to 1.0"); - opt->max_brightness = 1.0; - } - } - - // --blur-background-frame implies --blur-background - if (opt->blur_background_frame && opt->blur_method == BLUR_METHOD_NONE) { - opt->blur_method = BLUR_METHOD_KERNEL; - } - - // Apply default wintype options that are dependent on global options - set_default_winopts(opt, winopt_mask, shadow_enable, fading_enable, - opt->blur_method != BLUR_METHOD_NONE); - - // Other variables determined by options - - // Determine whether we track window grouping - if (opt->detect_transient || opt->detect_client_leader) { - opt->track_leader = true; - } - - // Fill default blur kernel - if (opt->blur_method == BLUR_METHOD_KERNEL && - (!opt->blur_kerns || !opt->blur_kerns[0])) { - opt->blur_kerns = parse_blur_kern_lst("3x3box", &conv_kern_hasneg, - &opt->blur_kernel_count); - CHECK(opt->blur_kerns); - CHECK(opt->blur_kernel_count); - } - - // Sanitize parameters for dual-filter kawase blur - if (opt->blur_method == BLUR_METHOD_DUAL_KAWASE) { - if (opt->blur_strength <= 0 && opt->blur_radius > 500) { - log_warn("Blur radius >500 not supported by dual_kawase method, " - "capping to 500."); - opt->blur_radius = 500; - } - if (opt->blur_strength > 20) { - log_warn("Blur strength >20 not supported by dual_kawase method, " - "capping to 20."); - opt->blur_strength = 20; - } - if (!opt->experimental_backends) { - log_warn("Dual-kawase blur is not implemented by the legacy " - "backends, you must use the `experimental-backends` " - "option."); - } - } - - if (opt->resize_damage < 0) { - log_warn("Negative --resize-damage will not work correctly."); - } - - if (opt->backend == BKEND_XRENDER && conv_kern_hasneg) { - log_warn("A convolution kernel with negative values may not work " - "properly under X Render backend."); - } - - return true; -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/options.h b/dwm/picom/src/options.h deleted file mode 100644 index 08aa15e..0000000 --- a/dwm/picom/src/options.h +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once - -/// Parse command line options - -#include -#include // for xcb_render_fixed_t - -#include "compiler.h" -#include "config.h" -#include "types.h" -#include "win.h" // for wintype_t - -typedef struct session session_t; - -/// Get config options that are needed to parse the rest of the options -/// Return true if we should quit -bool get_early_config(int argc, char *const *argv, char **config_file, bool *all_xerrors, - bool *fork, int *exit_code); - -/** - * Process arguments and configuration files. - * - * Parameters: - * shadow_enable = Carry overs from parse_config - * fading_enable - * conv_kern_hasneg - * winopt_mask - * Returns: - * Whether configuration are processed successfully. - */ -bool must_use get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, - bool fading_enable, bool conv_kern_hasneg, - win_option_mask_t *winopt_mask); - -// vim: set noet sw=8 ts=8: diff --git a/dwm/picom/src/picom.c b/dwm/picom/src/picom.c deleted file mode 100644 index bf6a0c1..0000000 --- a/dwm/picom/src/picom.c +++ /dev/null @@ -1,2665 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Compton - a compositor for X11 - * - * Based on `xcompmgr` - Copyright (c) 2003, Keith Packard - * - * Copyright (c) 2011-2013, Christopher Jeffrey - * See LICENSE-mit for more information. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "err.h" -#include "kernel.h" -#include "picom.h" -#ifdef CONFIG_OPENGL -#include "opengl.h" -#endif -#include "backend/backend.h" -#include "c2.h" -#include "config.h" -#include "diagnostic.h" -#include "log.h" -#include "region.h" -#include "render.h" -#include "types.h" -#include "utils.h" -#include "win.h" -#include "x.h" -#ifdef CONFIG_DBUS -#include "dbus.h" -#endif -#include "atom.h" -#include "event.h" -#include "file_watch.h" -#include "list.h" -#include "options.h" -#include "uthash_extra.h" - -/// Get session_t pointer from a pointer to a member of session_t -#define session_ptr(ptr, member) \ - ({ \ - const __typeof__(((session_t *)0)->member) *__mptr = (ptr); \ - (session_t *)((char *)__mptr - offsetof(session_t, member)); \ - }) - -static bool must_use redirect_start(session_t *ps); - -static void unredirect(session_t *ps); - -// === Global constants === - -/// Name strings for window types. -const char *const WINTYPES[NUM_WINTYPES] = { - "unknown", "desktop", "dock", "toolbar", "menu", - "utility", "splash", "dialog", "normal", "dropdown_menu", - "popup_menu", "tooltip", "notification", "combo", "dnd", -}; - -// clang-format off -/// Names of backends. -const char *const BACKEND_STRS[] = {[BKEND_XRENDER] = "xrender", - [BKEND_GLX] = "glx", - [BKEND_XR_GLX_HYBRID] = "xr_glx_hybrid", - [BKEND_DUMMY] = "dummy", - NULL}; -// clang-format on - -// === Global variables === - -/// Pointer to current session, as a global variable. Only used by -/// xerror(), which could not have a pointer to current session passed in. -/// XXX Limit what xerror can access by not having this pointer -session_t *ps_g = NULL; - -void set_root_flags(session_t *ps, uint64_t flags) { - log_debug("Setting root flags: %" PRIu64, flags); - ps->root_flags |= flags; - ps->pending_updates = true; -} - -void quit(session_t *ps) { - ps->quit = true; - ev_break(ps->loop, EVBREAK_ALL); -} - -/** - * Free Xinerama screen info. - * - * XXX consider moving to x.c - */ -static inline void free_xinerama_info(session_t *ps) { - if (ps->xinerama_scr_regs) { - for (int i = 0; i < ps->xinerama_nscrs; ++i) - pixman_region32_fini(&ps->xinerama_scr_regs[i]); - free(ps->xinerama_scr_regs); - ps->xinerama_scr_regs = NULL; - } - ps->xinerama_nscrs = 0; -} - -/** - * Get current system clock in milliseconds. - */ -static inline int64_t get_time_ms(void) { - struct timespec tp; - clock_gettime(CLOCK_MONOTONIC, &tp); - return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; -} - -// XXX Move to x.c -void cxinerama_upd_scrs(session_t *ps) { - // XXX Consider deprecating Xinerama, switch to RandR when necessary - free_xinerama_info(ps); - - if (!ps->o.xinerama_shadow_crop || !ps->xinerama_exists) - return; - - xcb_xinerama_is_active_reply_t *active = - xcb_xinerama_is_active_reply(ps->c, xcb_xinerama_is_active(ps->c), NULL); - if (!active || !active->state) { - free(active); - return; - } - free(active); - - auto xinerama_scrs = - xcb_xinerama_query_screens_reply(ps->c, xcb_xinerama_query_screens(ps->c), NULL); - if (!xinerama_scrs) { - return; - } - - xcb_xinerama_screen_info_t *scrs = - xcb_xinerama_query_screens_screen_info(xinerama_scrs); - ps->xinerama_nscrs = xcb_xinerama_query_screens_screen_info_length(xinerama_scrs); - - ps->xinerama_scr_regs = ccalloc(ps->xinerama_nscrs, region_t); - for (int i = 0; i < ps->xinerama_nscrs; ++i) { - const xcb_xinerama_screen_info_t *const s = &scrs[i]; - pixman_region32_init_rect(&ps->xinerama_scr_regs[i], s->x_org, s->y_org, - s->width, s->height); - } - free(xinerama_scrs); -} - -/** - * Find matched window. - * - * XXX move to win.c - */ -static inline struct managed_win *find_win_all(session_t *ps, const xcb_window_t wid) { - if (!wid || PointerRoot == wid || wid == ps->root || wid == ps->overlay) - return NULL; - - auto w = find_managed_win(ps, wid); - if (!w) - w = find_toplevel(ps, wid); - if (!w) - w = find_managed_window_or_parent(ps, wid); - return w; -} - -void queue_redraw(session_t *ps) { - // If --benchmark is used, redraw is always queued - if (!ps->redraw_needed && !ps->o.benchmark) { - ev_idle_start(ps->loop, &ps->draw_idle); - } - ps->redraw_needed = true; -} - -/** - * Get a region of the screen size. - */ -static inline void get_screen_region(session_t *ps, region_t *res) { - pixman_box32_t b = {.x1 = 0, .y1 = 0, .x2 = ps->root_width, .y2 = ps->root_height}; - pixman_region32_fini(res); - pixman_region32_init_rects(res, &b, 1); -} - -void add_damage(session_t *ps, const region_t *damage) { - // Ignore damage when screen isn't redirected - if (!ps->redirected) { - return; - } - - if (!damage) { - return; - } - log_trace("Adding damage: "); - dump_region(damage); - pixman_region32_union(ps->damage, ps->damage, (region_t *)damage); -} - -// === Fading === - -/** - * Get the time left before next fading point. - * - * In milliseconds. - */ -static double fade_timeout(session_t *ps) { - auto now = get_time_ms(); - if (ps->o.fade_delta + ps->fade_time < now) - return 0; - - auto diff = ps->o.fade_delta + ps->fade_time - now; - - diff = clamp(diff, 0, ps->o.fade_delta * 2); - - return (double)diff / 1000.0; -} - -/** - * Run fading on a window. - * - * @param steps steps of fading - * @return whether we are still in fading mode - */ -static bool run_fade(session_t *ps, struct managed_win **_w, long long steps) { - auto w = *_w; - if (w->state == WSTATE_MAPPED || w->state == WSTATE_UNMAPPED) { - // We are not fading - assert(w->opacity_target == w->opacity); - return false; - } - - if (!win_should_fade(ps, w)) { - log_debug("Window %#010x %s doesn't need fading", w->base.id, w->name); - w->opacity = w->opacity_target; - } - if (w->opacity == w->opacity_target) { - // We have reached target opacity. - // We don't call win_check_fade_finished here because that could destroy - // the window, but we still need the damage info from this window - log_debug("Fading finished for window %#010x %s", w->base.id, w->name); - return false; - } - - if (steps) { - log_trace("Window %#010x (%s) opacity was: %lf", w->base.id, w->name, - w->opacity); - if (w->opacity < w->opacity_target) { - w->opacity = clamp(w->opacity + ps->o.fade_in_step * (double)steps, - 0.0, w->opacity_target); - } else { - w->opacity = clamp(w->opacity - ps->o.fade_out_step * (double)steps, - w->opacity_target, 1); - } - log_trace("... updated to: %lf", w->opacity); - } - - // Note even if opacity == opacity_target here, we still want to run preprocess - // one last time to finish state transition. So return true in that case too. - return true; -} - -// === Error handling === - -void discard_ignore(session_t *ps, unsigned long sequence) { - while (ps->ignore_head) { - if (sequence > ps->ignore_head->sequence) { - ignore_t *next = ps->ignore_head->next; - free(ps->ignore_head); - ps->ignore_head = next; - if (!ps->ignore_head) { - ps->ignore_tail = &ps->ignore_head; - } - } else { - break; - } - } -} - -static int should_ignore(session_t *ps, unsigned long sequence) { - if (ps == NULL) { - // Do not ignore errors until the session has been initialized - return false; - } - discard_ignore(ps, sequence); - return ps->ignore_head && ps->ignore_head->sequence == sequence; -} - -// === Windows === - -/** - * Determine the event mask for a window. - */ -uint32_t determine_evmask(session_t *ps, xcb_window_t wid, win_evmode_t mode) { - uint32_t evmask = 0; - struct managed_win *w = NULL; - - // Check if it's a mapped frame window - if (mode == WIN_EVMODE_FRAME || - ((w = find_managed_win(ps, wid)) && w->a.map_state == XCB_MAP_STATE_VIEWABLE)) { - evmask |= XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY; - if (!ps->o.use_ewmh_active_win) { - evmask |= XCB_EVENT_MASK_FOCUS_CHANGE; - } - } - - // Check if it's a mapped client window - if (mode == WIN_EVMODE_CLIENT || - ((w = find_toplevel(ps, wid)) && w->a.map_state == XCB_MAP_STATE_VIEWABLE)) { - evmask |= XCB_EVENT_MASK_PROPERTY_CHANGE; - } - - return evmask; -} - -/** - * Update current active window based on EWMH _NET_ACTIVE_WIN. - * - * Does not change anything if we fail to get the attribute or the window - * returned could not be found. - */ -void update_ewmh_active_win(session_t *ps) { - // Search for the window - xcb_window_t wid = - wid_get_prop_window(ps->c, ps->root, ps->atoms->a_NET_ACTIVE_WINDOW); - auto w = find_win_all(ps, wid); - - // Mark the window focused. No need to unfocus the previous one. - if (w) { - win_set_focused(ps, w); - } -} - -/** - * Recheck currently focused window and set its w->focused - * to true. - * - * @param ps current session - * @return struct _win of currently focused window, NULL if not found - */ -static void recheck_focus(session_t *ps) { - // Use EWMH _NET_ACTIVE_WINDOW if enabled - if (ps->o.use_ewmh_active_win) { - update_ewmh_active_win(ps); - return; - } - - // Determine the currently focused window so we can apply appropriate - // opacity on it - xcb_window_t wid = XCB_NONE; - xcb_get_input_focus_reply_t *reply = - xcb_get_input_focus_reply(ps->c, xcb_get_input_focus(ps->c), NULL); - - if (reply) { - wid = reply->focus; - free(reply); - } - - auto w = find_win_all(ps, wid); - - log_trace("%#010" PRIx32 " (%#010lx \"%s\") focused.", wid, - (w ? w->base.id : XCB_NONE), (w ? w->name : NULL)); - - // And we set the focus state here - if (w) { - win_set_focused(ps, w); - return; - } -} - -/** - * Rebuild cached screen_reg. - */ -static void rebuild_screen_reg(session_t *ps) { - get_screen_region(ps, &ps->screen_reg); -} - -/** - * Rebuild shadow_exclude_reg. - */ -static void rebuild_shadow_exclude_reg(session_t *ps) { - bool ret = parse_geometry(ps, ps->o.shadow_exclude_reg_str, &ps->shadow_exclude_reg); - if (!ret) - exit(1); -} - -/// Free up all the images and deinit the backend -static void destroy_backend(session_t *ps) { - win_stack_foreach_managed_safe(w, &ps->window_stack) { - // Wrapping up fading in progress - if (win_skip_fading(ps, w)) { - // `w` is freed by win_skip_fading - continue; - } - - if (ps->backend_data) { - // Unmapped windows could still have shadow images, but not pixmap - // images - assert(!w->win_image || w->state != WSTATE_UNMAPPED); - if (win_check_flags_any(w, WIN_FLAGS_IMAGES_STALE) && - w->state == WSTATE_MAPPED) { - log_warn("Stale flags set for mapped window %#010x " - "during backend destruction", - w->base.id); - assert(false); - } - // Unmapped windows can still have stale flags set, because their - // stale flags aren't handled until they are mapped. - win_clear_flags(w, WIN_FLAGS_IMAGES_STALE); - win_release_images(ps->backend_data, w); - } - free_paint(ps, &w->paint); - } - - if (ps->backend_data && ps->root_image) { - ps->backend_data->ops->release_image(ps->backend_data, ps->root_image); - ps->root_image = NULL; - } - - if (ps->backend_data) { - // deinit backend - if (ps->backend_blur_context) { - ps->backend_data->ops->destroy_blur_context( - ps->backend_data, ps->backend_blur_context); - ps->backend_blur_context = NULL; - } - ps->backend_data->ops->deinit(ps->backend_data); - ps->backend_data = NULL; - } -} - -static bool initialize_blur(session_t *ps) { - struct kernel_blur_args kargs; - struct gaussian_blur_args gargs; - struct box_blur_args bargs; - struct dual_kawase_blur_args dkargs; - - void *args = NULL; - switch (ps->o.blur_method) { - case BLUR_METHOD_BOX: - bargs.size = ps->o.blur_radius; - args = (void *)&bargs; - break; - case BLUR_METHOD_KERNEL: - kargs.kernel_count = ps->o.blur_kernel_count; - kargs.kernels = ps->o.blur_kerns; - args = (void *)&kargs; - break; - case BLUR_METHOD_GAUSSIAN: - gargs.size = ps->o.blur_radius; - gargs.deviation = ps->o.blur_deviation; - args = (void *)&gargs; - break; - case BLUR_METHOD_DUAL_KAWASE: - dkargs.size = ps->o.blur_radius; - dkargs.strength = ps->o.blur_strength; - args = (void *)&dkargs; - break; - default: return true; - } - - ps->backend_blur_context = ps->backend_data->ops->create_blur_context( - ps->backend_data, ps->o.blur_method, args); - return ps->backend_blur_context != NULL; -} - -/// Init the backend and bind all the window pixmap to backend images -static bool initialize_backend(session_t *ps) { - if (ps->o.experimental_backends) { - assert(!ps->backend_data); - // Reinitialize win_data - assert(backend_list[ps->o.backend]); - ps->backend_data = backend_list[ps->o.backend]->init(ps); - if (!ps->backend_data) { - log_fatal("Failed to initialize backend, aborting..."); - quit(ps); - return false; - } - ps->backend_data->ops = backend_list[ps->o.backend]; - - if (!initialize_blur(ps)) { - log_fatal("Failed to prepare for background blur, aborting..."); - ps->backend_data->ops->deinit(ps->backend_data); - ps->backend_data = NULL; - quit(ps); - return false; - } - - // window_stack shouldn't include window that's - // not in the hash table at this point. Since - // there cannot be any fading windows. - HASH_ITER2(ps->windows, _w) { - if (!_w->managed) { - continue; - } - auto w = (struct managed_win *)_w; - assert(w->state == WSTATE_MAPPED || w->state == WSTATE_UNMAPPED); - // We need to reacquire image - log_debug("Marking window %#010x (%s) for update after " - "redirection", - w->base.id, w->name); - win_set_flags(w, WIN_FLAGS_IMAGES_STALE); - ps->pending_updates = true; - } - } - - // The old backends binds pixmap lazily, nothing to do here - return true; -} - -/// Handle configure event of the root window -static void configure_root(session_t *ps) { - auto r = XCB_AWAIT(xcb_get_geometry, ps->c, ps->root); - if (!r) { - log_fatal("Failed to fetch root geometry"); - abort(); - } - - log_info("Root configuration changed, new geometry: %dx%d", r->width, r->height); - bool has_root_change = false; - if (ps->redirected) { - // On root window changes - if (ps->o.experimental_backends) { - assert(ps->backend_data); - has_root_change = ps->backend_data->ops->root_change != NULL; - } else { - // Old backend can handle root change - has_root_change = true; - } - - if (!has_root_change) { - // deinit/reinit backend and free up resources if the backend - // cannot handle root change - destroy_backend(ps); - } - free_paint(ps, &ps->tgt_buffer); - } - - ps->root_width = r->width; - ps->root_height = r->height; - - auto prop = x_get_prop(ps->c, ps->root, ps->atoms->a_NET_CURRENT_DESKTOP, - 1L, XCB_ATOM_CARDINAL, 32); - - ps->root_desktop_switch_direction = 0; - if (prop.nitems) { - ps->root_desktop_num = (int)*prop.c32; - } - - rebuild_screen_reg(ps); - rebuild_shadow_exclude_reg(ps); - - // Invalidate reg_ignore from the top - auto top_w = win_stack_find_next_managed(ps, &ps->window_stack); - if (top_w) { - rc_region_unref(&top_w->reg_ignore); - top_w->reg_ignore_valid = false; - } - - if (ps->redirected) { - for (int i = 0; i < ps->ndamage; i++) { - pixman_region32_clear(&ps->damage_ring[i]); - } - ps->damage = ps->damage_ring + ps->ndamage - 1; -#ifdef CONFIG_OPENGL - // GLX root change callback - if (BKEND_GLX == ps->o.backend && !ps->o.experimental_backends) { - glx_on_root_change(ps); - } -#endif - if (has_root_change) { - if (ps->backend_data != NULL) { - ps->backend_data->ops->root_change(ps->backend_data, ps); - } - // Old backend's root_change is not a specific function - } else { - if (!initialize_backend(ps)) { - log_fatal("Failed to re-initialize backend after root " - "change, aborting..."); - ps->quit = true; - /* TODO(yshui) only event handlers should request - * ev_break, otherwise it's too hard to keep track of what - * can break the event loop */ - ev_break(ps->loop, EVBREAK_ALL); - return; - } - - // Re-acquire the root pixmap. - root_damaged(ps); - } - force_repaint(ps); - } - return; -} - -static void handle_root_flags(session_t *ps) { - if ((ps->root_flags & ROOT_FLAGS_SCREEN_CHANGE) != 0) { - if (ps->o.xinerama_shadow_crop) { - cxinerama_upd_scrs(ps); - } - ps->root_flags &= ~(uint64_t)ROOT_FLAGS_SCREEN_CHANGE; - } - - if ((ps->root_flags & ROOT_FLAGS_CONFIGURED) != 0) { - configure_root(ps); - ps->root_flags &= ~(uint64_t)ROOT_FLAGS_CONFIGURED; - } -} - -static struct managed_win * -paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) { - // XXX need better, more general name for `fade_running`. It really - // means if fade is still ongoing after the current frame is rendered. - // Same goes for `animation_running`. - struct managed_win *bottom = NULL; - *fade_running = false; - *animation_running = false; - auto now = get_time_ms(); - - // Fading step calculation - long steps = 0L; - if (ps->fade_time) { - assert(now >= ps->fade_time); - steps = (now - ps->fade_time) / ps->o.fade_delta; - } else { - // Reset fade_time if unset - ps->fade_time = now; - steps = 0L; - } - ps->fade_time += steps * ps->o.fade_delta; - - double animation_delta = 0; - if (ps->o.animations) { - if (!ps->animation_time) - ps->animation_time = now; - - animation_delta = (double)(now - ps->animation_time) / - (ps->o.animation_delta*100); - - if (ps->o.animation_force_steps) - animation_delta = min2(animation_delta, ps->o.animation_delta/1000); - } - - // First, let's process fading - win_stack_foreach_managed_safe(w, &ps->window_stack) { - const winmode_t mode_old = w->mode; - const bool was_painted = w->to_paint; - const double opacity_old = w->opacity; - - // IMPORTANT: These window animation steps must happen before any other - // [pre]processing. This is because it changes the window's geometry. - if (ps->o.animations && - !isnan(w->animation_progress) && w->animation_progress != 1.0 && - ps->o.wintype_option[w->window_type].animation != 0 && - win_is_mapped_in_x(w)) - { - double neg_displacement_x = - w->animation_dest_center_x - w->animation_center_x; - double neg_displacement_y = - w->animation_dest_center_y - w->animation_center_y; - double neg_displacement_w = w->animation_dest_w - w->animation_w; - double neg_displacement_h = w->animation_dest_h - w->animation_h; - double acceleration_x = - (ps->o.animation_stiffness * neg_displacement_x - - ps->o.animation_dampening * w->animation_velocity_x) / - ps->o.animation_window_mass; - double acceleration_y = - (ps->o.animation_stiffness * neg_displacement_y - - ps->o.animation_dampening * w->animation_velocity_y) / - ps->o.animation_window_mass; - double acceleration_w = - (ps->o.animation_stiffness * neg_displacement_w - - ps->o.animation_dampening * w->animation_velocity_w) / - ps->o.animation_window_mass; - double acceleration_h = - (ps->o.animation_stiffness * neg_displacement_h - - ps->o.animation_dampening * w->animation_velocity_h) / - ps->o.animation_window_mass; - w->animation_velocity_x += acceleration_x * animation_delta; - w->animation_velocity_y += acceleration_y * animation_delta; - w->animation_velocity_w += acceleration_w * animation_delta; - w->animation_velocity_h += acceleration_h * animation_delta; - - // Animate window geometry - double new_animation_x = - w->animation_center_x + w->animation_velocity_x * animation_delta; - double new_animation_y = - w->animation_center_y + w->animation_velocity_y * animation_delta; - double new_animation_w = - w->animation_w + w->animation_velocity_w * animation_delta; - double new_animation_h = - w->animation_h + w->animation_velocity_h * animation_delta; - - // Negative new width/height causes segfault and it can happen - // when clamping disabled and shading a window - if (new_animation_h < 0) - new_animation_h = 0; - - if (new_animation_w < 0) - new_animation_w = 0; - - if (ps->o.animation_clamping) { - w->animation_center_x = clamp( - new_animation_x, - min2(w->animation_center_x, w->animation_dest_center_x), - max2(w->animation_center_x, w->animation_dest_center_x)); - w->animation_center_y = clamp( - new_animation_y, - min2(w->animation_center_y, w->animation_dest_center_y), - max2(w->animation_center_y, w->animation_dest_center_y)); - w->animation_w = - clamp(new_animation_w, - min2(w->animation_w, w->animation_dest_w), - max2(w->animation_w, w->animation_dest_w)); - w->animation_h = - clamp(new_animation_h, - min2(w->animation_h, w->animation_dest_h), - max2(w->animation_h, w->animation_dest_h)); - } else { - w->animation_center_x = new_animation_x; - w->animation_center_y = new_animation_y; - w->animation_w = new_animation_w; - w->animation_h = new_animation_h; - } - - // Now we are done doing the math; we just need to submit our - // changes (if there are any). - - struct win_geometry old_g = w->g; - double old_animation_progress = w->animation_progress; - new_animation_x = round(w->animation_center_x - w->animation_w * 0.5); - new_animation_y = round(w->animation_center_y - w->animation_h * 0.5); - new_animation_w = round(w->animation_w); - new_animation_h = round(w->animation_h); - - bool position_changed = - new_animation_x != old_g.x || new_animation_y != old_g.y; - bool size_changed = - new_animation_w != old_g.width || new_animation_h != old_g.height; - bool geometry_changed = position_changed || size_changed; - - // Mark past window region with damage - if (geometry_changed) - add_damage_from_win(ps, w); - - double x_dist = w->animation_dest_center_x - w->animation_center_x; - double y_dist = w->animation_dest_center_y - w->animation_center_y; - double w_dist = w->animation_dest_w - w->animation_w; - double h_dist = w->animation_dest_h - w->animation_h; - w->animation_progress = - 1.0 - w->animation_inv_og_distance * - sqrt(x_dist * x_dist + y_dist * y_dist + - w_dist * w_dist + h_dist * h_dist); - - // When clamping disabled we don't want the overlayed image to - // fade in again because process is moving to negative value - if (w->animation_progress < old_animation_progress) - w->animation_progress = old_animation_progress; - - w->g.x = (int16_t)new_animation_x; - w->g.y = (int16_t)new_animation_y; - w->g.width = (uint16_t)new_animation_w; - w->g.height = (uint16_t)new_animation_h; - - // Submit window size change - if (size_changed) { - win_on_win_size_change(ps, w); - - pixman_region32_clear(&w->bounding_shape); - pixman_region32_fini(&w->bounding_shape); - pixman_region32_init_rect(&w->bounding_shape, 0, 0, - (uint)w->widthb, (uint)w->heightb); - - if (w->state != WSTATE_DESTROYING) - win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE); - - win_process_image_flags(ps, w); - } - // Mark new window region with damage - if (was_painted && geometry_changed) { - add_damage_from_win(ps, w); - w->reg_ignore_valid = false; - } - - // We can't check for 1 here as sometimes 1 = 0.999999999999999 - // in case of floating numbers - if (w->animation_progress >= 0.999999999) { - w->animation_progress = 1; - w->animation_velocity_x = 0.0; - w->animation_velocity_y = 0.0; - w->animation_velocity_w = 0.0; - w->animation_velocity_h = 0.0; - } - - if (!ps->root_desktop_switch_direction) { - if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) { - steps = 0; - double new_opacity = clamp( - w->opacity_target_old-w->animation_progress, - w->opacity_target, 1); - - if (new_opacity < w->opacity) - w->opacity = new_opacity; - - } else if (w->state == WSTATE_MAPPING) { - steps = 0; - double new_opacity = clamp( - w->animation_progress, - 0.0, w->opacity_target); - - if (new_opacity > w->opacity) - w->opacity = new_opacity; - } - } - - *animation_running = true; - } - - if (win_should_dim(ps, w) != w->dim) { - w->dim = win_should_dim(ps, w); - add_damage_from_win(ps, w); - } - - if (w->opacity != w->opacity_target) { - // Run fading - if (run_fade(ps, &w, steps)) { - *fade_running = true; - } - - // Add window to damaged area if its opacity changes - // If was_painted == false, and to_paint is also false, we don't care - // If was_painted == false, but to_paint is true, damage will be added in - // the loop below - if (was_painted && w->opacity != opacity_old) { - add_damage_from_win(ps, w); - } - - if (win_check_fade_finished(ps, w)) { - // the window has been destroyed because fading finished - continue; - } - - if (win_has_frame(w)) { - w->frame_opacity = ps->o.frame_opacity; - } else { - w->frame_opacity = 1.0; - } - - // Update window mode - w->mode = win_calc_mode(w); - - // Destroy all reg_ignore above when frame opaque state changes on - // SOLID mode - if (was_painted && w->mode != mode_old) { - w->reg_ignore_valid = false; - } - } - } - - if (*animation_running) - ps->animation_time = now; - - // Opacity will not change, from now on. - rc_region_t *last_reg_ignore = rc_region_new(); - - bool unredir_possible = false; - // Track whether it's the highest window to paint - bool is_highest = true; - bool reg_ignore_valid = true; - win_stack_foreach_managed(w, &ps->window_stack) { - __label__ skip_window; - bool to_paint = true; - // w->to_paint remembers whether this window is painted last time - const bool was_painted = w->to_paint; - - // Destroy reg_ignore if some window above us invalidated it - if (!reg_ignore_valid) { - rc_region_unref(&w->reg_ignore); - } - - // log_trace("%d %d %s", w->a.map_state, w->ever_damaged, w->name); - - // Give up if it's not damaged or invisible, or it's unmapped and its - // pixmap is gone (for example due to a ConfigureNotify), or when it's - // excluded - if (w->state == WSTATE_UNMAPPED || - unlikely(w->base.id == ps->debug_window || - w->client_win == ps->debug_window)) { - - if (!*fade_running || w->opacity == w->opacity_target) - to_paint = false; - - } else if (!w->ever_damaged && w->state != WSTATE_UNMAPPING && - w->state != WSTATE_DESTROYING) { - // Unmapping clears w->ever_damaged, but the fact that the window - // is fading out means it must have been damaged when it was still - // mapped (because unmap_win_start will skip fading if it wasn't), - // so we still need to paint it. - log_trace("Window %#010x (%s) will not be painted because it has " - "not received any damages", - w->base.id, w->name); - to_paint = false; - } else if (unlikely(w->g.x + w->g.width < 1 || w->g.y + w->g.height < 1 || - w->g.x >= ps->root_width || w->g.y >= ps->root_height)) { - log_trace("Window %#010x (%s) will not be painted because it is " - "positioned outside of the screen", - w->base.id, w->name); - to_paint = false; - } else if (unlikely((double)w->opacity * MAX_ALPHA < 1 && !w->blur_background)) { - /* TODO(yshui) for consistency, even a window has 0 opacity, we - * still probably need to blur its background, so to_paint - * shouldn't be false for them. */ - log_trace("Window %#010x (%s) will not be painted because it has " - "0 opacity", - w->base.id, w->name); - to_paint = false; - } else if (w->paint_excluded) { - log_trace("Window %#010x (%s) will not be painted because it is " - "excluded from painting", - w->base.id, w->name); - to_paint = false; - } else if (unlikely((w->flags & WIN_FLAGS_IMAGE_ERROR) != 0)) { - log_trace("Window %#010x (%s) will not be painted because it has " - "image errors", - w->base.id, w->name); - to_paint = false; - } - // log_trace("%s %d %d %d", w->name, to_paint, w->opacity, - // w->paint_excluded); - - // Add window to damaged area if its painting status changes - // or opacity changes - if (to_paint != was_painted) { - w->reg_ignore_valid = false; - add_damage_from_win(ps, w); - } - - // to_paint will never change after this point - if (!to_paint) { - goto skip_window; - } - - log_trace("Window %#010x (%s) will be painted", w->base.id, w->name); - - // Calculate shadow opacity - w->shadow_opacity = ps->o.shadow_opacity * w->opacity * ps->o.frame_opacity; - - // Generate ignore region for painting to reduce GPU load - if (!w->reg_ignore) { - w->reg_ignore = rc_region_ref(last_reg_ignore); - } - - // If the window is solid, or we enabled clipping for transparent windows, - // we add the window region to the ignored region - // Otherwise last_reg_ignore shouldn't change - if ((w->mode != WMODE_TRANS && !ps->o.force_win_blend) || - ps->o.transparent_clipping) { - // w->mode == WMODE_SOLID or WMODE_FRAME_TRANS - region_t *tmp = rc_region_new(); - if (w->mode == WMODE_SOLID) { - *tmp = - win_get_bounding_shape_global_without_corners_by_val(w); - } else { - // w->mode == WMODE_FRAME_TRANS - win_get_region_noframe_local_without_corners(w, tmp); - pixman_region32_intersect(tmp, tmp, &w->bounding_shape); - pixman_region32_translate(tmp, w->g.x, w->g.y); - } - - pixman_region32_union(tmp, tmp, last_reg_ignore); - rc_region_unref(&last_reg_ignore); - last_reg_ignore = tmp; - } - - // (Un)redirect screen - // We could definitely unredirect the screen when there's no window to - // paint, but this is typically unnecessary, may cause flickering when - // fading is enabled, and could create inconsistency when the wallpaper - // is not correctly set. - if (ps->o.unredir_if_possible && is_highest) { - if (w->mode == WMODE_SOLID && !ps->o.force_win_blend && - win_is_fullscreen(ps, w) && !w->unredir_if_possible_excluded) { - unredir_possible = true; - } - } - - // Unredirect screen if some window is requesting compositor bypass, even - // if that window is not on the top. - if (ps->o.unredir_if_possible && win_is_bypassing_compositor(ps, w) && - !w->unredir_if_possible_excluded) { - // Here we deviate from EWMH a bit. EWMH says we must not - // unredirect the screen if the window requesting bypassing would - // look different after unredirecting. Instead we always follow - // the request. - unredir_possible = true; - } - - w->prev_trans = bottom; - if (bottom) { - w->stacking_rank = bottom->stacking_rank + 1; - } else { - w->stacking_rank = 0; - } - bottom = w; - - // If the screen is not redirected and the window has redir_ignore set, - // this window should not cause the screen to become redirected - if (!(ps->o.wintype_option[w->window_type].redir_ignore && !ps->redirected)) { - is_highest = false; - } - - skip_window: - reg_ignore_valid = reg_ignore_valid && w->reg_ignore_valid; - w->reg_ignore_valid = true; - - // Avoid setting w->to_paint if w is freed - if (w) { - w->to_paint = to_paint; - } - } - - rc_region_unref(&last_reg_ignore); - - // If possible, unredirect all windows and stop painting - if (ps->o.redirected_force != UNSET) { - unredir_possible = !ps->o.redirected_force; - } else if (ps->o.unredir_if_possible && is_highest && !ps->redirected) { - // If there's no window to paint, and the screen isn't redirected, - // don't redirect it. - unredir_possible = true; - } - if (unredir_possible) { - if (ps->redirected) { - if (!ps->o.unredir_if_possible_delay || ps->tmout_unredir_hit) { - unredirect(ps); - } else if (!ev_is_active(&ps->unredir_timer)) { - ev_timer_set( - &ps->unredir_timer, - (double)ps->o.unredir_if_possible_delay / 1000.0, 0); - ev_timer_start(ps->loop, &ps->unredir_timer); - } - } - } else { - ev_timer_stop(ps->loop, &ps->unredir_timer); - if (!ps->redirected) { - if (!redirect_start(ps)) { - return NULL; - } - } - } - - return bottom; -} - -void root_damaged(session_t *ps) { - if (ps->root_tile_paint.pixmap) { - free_root_tile(ps); - } - - if (!ps->redirected) { - return; - } - - if (ps->backend_data) { - if (ps->root_image) { - ps->backend_data->ops->release_image(ps->backend_data, ps->root_image); - } - auto pixmap = x_get_root_back_pixmap(ps->c, ps->root, ps->atoms); - if (pixmap != XCB_NONE) { - ps->root_image = ps->backend_data->ops->bind_pixmap( - ps->backend_data, pixmap, x_get_visual_info(ps->c, ps->vis), false); - if (ps->root_image) { - ps->backend_data->ops->set_image_property( - ps->backend_data, IMAGE_PROPERTY_EFFECTIVE_SIZE, - ps->root_image, (int[]){ps->root_width, ps->root_height}); - } else { - log_error("Failed to bind root back pixmap"); - } - } - } - - // Mark screen damaged - force_repaint(ps); -} - -/** - * Xlib error handler function. - */ -static int xerror(Display attr_unused *dpy, XErrorEvent *ev) { - if (!should_ignore(ps_g, ev->serial)) { - x_print_error(ev->serial, ev->request_code, ev->minor_code, ev->error_code); - } - return 0; -} - -/** - * XCB error handler function. - */ -void ev_xcb_error(session_t *ps, xcb_generic_error_t *err) { - if (!should_ignore(ps, err->sequence)) { - x_print_error(err->sequence, err->major_code, err->minor_code, err->error_code); - } -} - -/** - * Force a full-screen repaint. - */ -void force_repaint(session_t *ps) { - assert(pixman_region32_not_empty(&ps->screen_reg)); - queue_redraw(ps); - add_damage(ps, &ps->screen_reg); -} - -#ifdef CONFIG_DBUS -/** @name DBus hooks - */ -///@{ - -/** - * Set no_fading_openclose option. - * - * Don't affect fading already in progress - */ -void opts_set_no_fading_openclose(session_t *ps, bool newval) { - ps->o.no_fading_openclose = newval; -} - -//!@} -#endif - -/** - * Setup window properties, then register us with the compositor selection (_NET_WM_CM_S) - * - * @return 0 if success, 1 if compositor already running, -1 if error. - */ -static int register_cm(session_t *ps) { - assert(!ps->reg_win); - - ps->reg_win = x_new_id(ps->c); - auto e = xcb_request_check( - ps->c, xcb_create_window_checked(ps->c, XCB_COPY_FROM_PARENT, ps->reg_win, ps->root, - 0, 0, 1, 1, 0, XCB_NONE, ps->vis, 0, NULL)); - - if (e) { - log_fatal("Failed to create window."); - free(e); - return -1; - } - - const xcb_atom_t prop_atoms[] = { - ps->atoms->aWM_NAME, - ps->atoms->a_NET_WM_NAME, - ps->atoms->aWM_ICON_NAME, - }; - - const bool prop_is_utf8[] = {false, true, false}; - - // Set names and classes - for (size_t i = 0; i < ARR_SIZE(prop_atoms); i++) { - e = xcb_request_check( - ps->c, xcb_change_property_checked( - ps->c, XCB_PROP_MODE_REPLACE, ps->reg_win, prop_atoms[i], - prop_is_utf8[i] ? ps->atoms->aUTF8_STRING : XCB_ATOM_STRING, - 8, strlen("picom"), "picom")); - if (e) { - log_error_x_error(e, "Failed to set window property %d", - prop_atoms[i]); - free(e); - } - } - - const char picom_class[] = "picom\0picom"; - e = xcb_request_check( - ps->c, xcb_change_property_checked(ps->c, XCB_PROP_MODE_REPLACE, ps->reg_win, - ps->atoms->aWM_CLASS, XCB_ATOM_STRING, 8, - ARR_SIZE(picom_class), picom_class)); - if (e) { - log_error_x_error(e, "Failed to set the WM_CLASS property"); - free(e); - } - - // Set WM_CLIENT_MACHINE. As per EWMH, because we set _NET_WM_PID, we must also - // set WM_CLIENT_MACHINE. - { - const auto hostname_max = (unsigned long)sysconf(_SC_HOST_NAME_MAX); - char *hostname = malloc(hostname_max); - - if (gethostname(hostname, hostname_max) == 0) { - e = xcb_request_check( - ps->c, xcb_change_property_checked( - ps->c, XCB_PROP_MODE_REPLACE, ps->reg_win, - ps->atoms->aWM_CLIENT_MACHINE, XCB_ATOM_STRING, 8, - (uint32_t)strlen(hostname), hostname)); - if (e) { - log_error_x_error(e, "Failed to set the WM_CLIENT_MACHINE" - " property"); - free(e); - } - } else { - log_error_errno("Failed to get hostname"); - } - - free(hostname); - } - - // Set _NET_WM_PID - { - auto pid = getpid(); - xcb_change_property(ps->c, XCB_PROP_MODE_REPLACE, ps->reg_win, - ps->atoms->a_NET_WM_PID, XCB_ATOM_CARDINAL, 32, 1, &pid); - } - - // Set COMPTON_VERSION - e = xcb_request_check( - ps->c, xcb_change_property_checked( - ps->c, XCB_PROP_MODE_REPLACE, ps->reg_win, - get_atom(ps->atoms, "COMPTON_VERSION"), XCB_ATOM_STRING, 8, - (uint32_t)strlen(COMPTON_VERSION), COMPTON_VERSION)); - if (e) { - log_error_x_error(e, "Failed to set COMPTON_VERSION."); - free(e); - } - - // Acquire X Selection _NET_WM_CM_S? - if (!ps->o.no_x_selection) { - const char register_prop[] = "_NET_WM_CM_S"; - xcb_atom_t atom; - - char *buf = NULL; - if (asprintf(&buf, "%s%d", register_prop, ps->scr) < 0) { - log_fatal("Failed to allocate memory"); - return -1; - } - atom = get_atom(ps->atoms, buf); - free(buf); - - xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply( - ps->c, xcb_get_selection_owner(ps->c, atom), NULL); - - if (reply && reply->owner != XCB_NONE) { - // Another compositor already running - free(reply); - return 1; - } - free(reply); - xcb_set_selection_owner(ps->c, ps->reg_win, atom, 0); - } - - return 0; -} - -/** - * Write PID to a file. - */ -static inline bool write_pid(session_t *ps) { - if (!ps->o.write_pid_path) { - return true; - } - - FILE *f = fopen(ps->o.write_pid_path, "w"); - if (unlikely(!f)) { - log_error("Failed to write PID to \"%s\".", ps->o.write_pid_path); - return false; - } - - fprintf(f, "%ld\n", (long)getpid()); - fclose(f); - - return true; -} - -/** - * Initialize X composite overlay window. - */ -static bool init_overlay(session_t *ps) { - xcb_composite_get_overlay_window_reply_t *reply = - xcb_composite_get_overlay_window_reply( - ps->c, xcb_composite_get_overlay_window(ps->c, ps->root), NULL); - if (reply) { - ps->overlay = reply->overlay_win; - free(reply); - } else { - ps->overlay = XCB_NONE; - } - if (ps->overlay != XCB_NONE) { - // Set window region of the overlay window, code stolen from - // compiz-0.8.8 - if (!XCB_AWAIT_VOID(xcb_shape_mask, ps->c, XCB_SHAPE_SO_SET, - XCB_SHAPE_SK_BOUNDING, ps->overlay, 0, 0, 0)) { - log_fatal("Failed to set the bounding shape of overlay, giving " - "up."); - return false; - } - if (!XCB_AWAIT_VOID(xcb_shape_rectangles, ps->c, XCB_SHAPE_SO_SET, - XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED, - ps->overlay, 0, 0, 0, NULL)) { - log_fatal("Failed to set the input shape of overlay, giving up."); - return false; - } - - // Listen to Expose events on the overlay - xcb_change_window_attributes(ps->c, ps->overlay, XCB_CW_EVENT_MASK, - (const uint32_t[]){XCB_EVENT_MASK_EXPOSURE}); - - // Retrieve DamageNotify on root window if we are painting on an - // overlay - // root_damage = XDamageCreate(ps->dpy, root, XDamageReportNonEmpty); - - // Unmap the overlay, we will map it when needed in redirect_start - XCB_AWAIT_VOID(xcb_unmap_window, ps->c, ps->overlay); - } else { - log_error("Cannot get X Composite overlay window. Falling " - "back to painting on root window."); - } - log_debug("overlay = %#010x", ps->overlay); - - return true; -} - -static bool init_debug_window(session_t *ps) { - xcb_colormap_t colormap = x_new_id(ps->c); - ps->debug_window = x_new_id(ps->c); - - auto err = xcb_request_check( - ps->c, xcb_create_colormap_checked(ps->c, XCB_COLORMAP_ALLOC_NONE, colormap, - ps->root, ps->vis)); - if (err) { - goto err_out; - } - - err = xcb_request_check( - ps->c, xcb_create_window_checked(ps->c, (uint8_t)ps->depth, ps->debug_window, - ps->root, 0, 0, to_u16_checked(ps->root_width), - to_u16_checked(ps->root_height), 0, - XCB_WINDOW_CLASS_INPUT_OUTPUT, ps->vis, - XCB_CW_COLORMAP, (uint32_t[]){colormap, 0})); - if (err) { - goto err_out; - } - - err = xcb_request_check(ps->c, xcb_map_window(ps->c, ps->debug_window)); - if (err) { - goto err_out; - } - return true; - -err_out: - free(err); - return false; -} - -xcb_window_t session_get_target_window(session_t *ps) { - if (ps->o.debug_mode) { - return ps->debug_window; - } - return ps->overlay != XCB_NONE ? ps->overlay : ps->root; -} - -uint8_t session_redirection_mode(session_t *ps) { - if (ps->o.debug_mode) { - // If the backend is not rendering to the screen, we don't need to - // take over the screen. - assert(ps->o.experimental_backends); - return XCB_COMPOSITE_REDIRECT_AUTOMATIC; - } - if (ps->o.experimental_backends && !backend_list[ps->o.backend]->present) { - // if the backend doesn't render anything, we don't need to take over the - // screen. - return XCB_COMPOSITE_REDIRECT_AUTOMATIC; - } - return XCB_COMPOSITE_REDIRECT_MANUAL; -} - -/** - * Redirect all windows. - * - * @return whether the operation succeeded or not - */ -static bool redirect_start(session_t *ps) { - assert(!ps->redirected); - log_debug("Redirecting the screen."); - - // Map overlay window. Done firstly according to this: - // https://bugzilla.gnome.org/show_bug.cgi?id=597014 - if (ps->overlay != XCB_NONE) { - xcb_map_window(ps->c, ps->overlay); - } - - bool success = XCB_AWAIT_VOID(xcb_composite_redirect_subwindows, ps->c, ps->root, - session_redirection_mode(ps)); - if (!success) { - log_fatal("Another composite manager is already running " - "(and does not handle _NET_WM_CM_Sn correctly)"); - return false; - } - - x_sync(ps->c); - - if (!initialize_backend(ps)) { - return false; - } - - if (ps->o.experimental_backends) { - assert(ps->backend_data); - ps->ndamage = ps->backend_data->ops->max_buffer_age; - } else { - ps->ndamage = maximum_buffer_age(ps); - } - ps->damage_ring = ccalloc(ps->ndamage, region_t); - ps->damage = ps->damage_ring + ps->ndamage - 1; - - for (int i = 0; i < ps->ndamage; i++) { - pixman_region32_init(&ps->damage_ring[i]); - } - - // Must call XSync() here - x_sync(ps->c); - - ps->redirected = true; - ps->first_frame = true; - - // Re-detect driver since we now have a backend - ps->drivers = detect_driver(ps->c, ps->backend_data, ps->root); - apply_driver_workarounds(ps, ps->drivers); - - root_damaged(ps); - - // Repaint the whole screen - force_repaint(ps); - log_debug("Screen redirected."); - return true; -} - -/** - * Unredirect all windows. - */ -static void unredirect(session_t *ps) { - assert(ps->redirected); - log_debug("Unredirecting the screen."); - - destroy_backend(ps); - - xcb_composite_unredirect_subwindows(ps->c, ps->root, session_redirection_mode(ps)); - // Unmap overlay window - if (ps->overlay != XCB_NONE) { - xcb_unmap_window(ps->c, ps->overlay); - } - - // Free the damage ring - for (int i = 0; i < ps->ndamage; ++i) { - pixman_region32_fini(&ps->damage_ring[i]); - } - ps->ndamage = 0; - free(ps->damage_ring); - ps->damage_ring = ps->damage = NULL; - - // Must call XSync() here - x_sync(ps->c); - - ps->redirected = false; - log_debug("Screen unredirected."); -} - -// Handle queued events before we go to sleep -static void handle_queued_x_events(EV_P attr_unused, ev_prepare *w, int revents attr_unused) { - session_t *ps = session_ptr(w, event_check); - xcb_generic_event_t *ev; - while ((ev = xcb_poll_for_queued_event(ps->c))) { - ev_handle(ps, ev); - free(ev); - }; - // Flush because if we go into sleep when there is still - // requests in the outgoing buffer, they will not be sent - // for an indefinite amount of time. - // Use XFlush here too, we might still use some Xlib functions - // because OpenGL. - XFlush(ps->dpy); - xcb_flush(ps->c); - int err = xcb_connection_has_error(ps->c); - if (err) { - log_fatal("X11 server connection broke (error %d)", err); - exit(1); - } -} - -static void handle_new_windows(session_t *ps) { - list_foreach_safe(struct win, w, &ps->window_stack, stack_neighbour) { - if (w->is_new) { - auto new_w = fill_win(ps, w); - if (!new_w->managed) { - continue; - } - auto mw = (struct managed_win *)new_w; - if (mw->a.map_state == XCB_MAP_STATE_VIEWABLE) { - win_set_flags(mw, WIN_FLAGS_MAPPED); - - // This window might be damaged before we called fill_win - // and created the damage handle. And there is no way for - // us to find out. So just blindly mark it damaged - mw->ever_damaged = true; - } - } - } -} - -static void refresh_windows(session_t *ps) { - win_stack_foreach_managed(w, &ps->window_stack) { - win_process_update_flags(ps, w); - } -} - -static void refresh_images(session_t *ps) { - win_stack_foreach_managed(w, &ps->window_stack) { - win_process_image_flags(ps, w); - } -} - -/** - * Unredirection timeout callback. - */ -static void tmout_unredir_callback(EV_P attr_unused, ev_timer *w, int revents attr_unused) { - session_t *ps = session_ptr(w, unredir_timer); - ps->tmout_unredir_hit = true; - queue_redraw(ps); -} - -static void fade_timer_callback(EV_P attr_unused, ev_timer *w, int revents attr_unused) { - session_t *ps = session_ptr(w, fade_timer); - queue_redraw(ps); -} - -static void animation_timer_callback(EV_P attr_unused, ev_timer *w, int revents attr_unused) { - session_t *ps = session_ptr(w, animation_timer); - queue_redraw(ps); -} - -static void handle_pending_updates(EV_P_ struct session *ps) { - if (ps->pending_updates) { - log_debug("Delayed handling of events, entering critical section"); - auto e = xcb_request_check(ps->c, xcb_grab_server_checked(ps->c)); - if (e) { - log_fatal_x_error(e, "failed to grab x server"); - return quit(ps); - } - - ps->server_grabbed = true; - - // Catching up with X server - handle_queued_x_events(EV_A_ & ps->event_check, 0); - - // Call fill_win on new windows - handle_new_windows(ps); - - // Handle screen changes - // This HAS TO be called before refresh_windows, as handle_root_flags - // could call configure_root, which will release images and mark them - // stale. - handle_root_flags(ps); - - // Process window flags (window mapping) - refresh_windows(ps); - - { - auto r = xcb_get_input_focus_reply( - ps->c, xcb_get_input_focus(ps->c), NULL); - if (!ps->active_win || (r && r->focus != ps->active_win->base.id)) { - recheck_focus(ps); - } - free(r); - } - - // Process window flags (stale images) - refresh_images(ps); - - e = xcb_request_check(ps->c, xcb_ungrab_server_checked(ps->c)); - if (e) { - log_fatal_x_error(e, "failed to ungrab x server"); - return quit(ps); - } - - ps->server_grabbed = false; - ps->pending_updates = false; - log_debug("Exited critical section"); - } -} - -static void draw_callback_impl(EV_P_ session_t *ps, int revents attr_unused) { - handle_pending_updates(EV_A_ ps); - - if (ps->first_frame) { - // If we are still rendering the first frame, if some of the windows are - // unmapped/destroyed during the above handle_pending_updates() call, they - // won't have pixmap before we rendered it, causing us to crash. - // But we will only render them if they are in fading. So we just skip - // fading for all windows here. - // - // Using foreach_safe here since skipping fading can cause window to be - // freed if it's destroyed. - win_stack_foreach_managed_safe(w, &ps->window_stack) { - auto _ attr_unused = win_skip_fading(ps, w); - } - } - - if (ps->o.benchmark) { - if (ps->o.benchmark_wid) { - auto w = find_managed_win(ps, ps->o.benchmark_wid); - if (!w) { - log_fatal("Couldn't find specified benchmark window."); - exit(1); - } - add_damage_from_win(ps, w); - } else { - force_repaint(ps); - } - } - - /* TODO(yshui) Have a stripped down version of paint_preprocess that is used when - * screen is not redirected. its sole purpose should be to decide whether the - * screen should be redirected. */ - bool fade_running = false; - bool animation_running = false; - bool was_redirected = ps->redirected; - auto bottom = paint_preprocess(ps, &fade_running, &animation_running); - ps->tmout_unredir_hit = false; - - if (!was_redirected && ps->redirected) { - // paint_preprocess redirected the screen, which might change the state of - // some of the windows (e.g. the window image might become stale). - // so we rerun _draw_callback to make sure the rendering decision we make - // is up-to-date, and all the new flags got handled. - // - // TODO(yshui) This is not ideal, we should try to avoid setting window - // flags in paint_preprocess. - log_debug("Re-run _draw_callback"); - return draw_callback_impl(EV_A_ ps, revents); - } - - // Start/stop fade timer depends on whether window are fading - if (!fade_running && ev_is_active(&ps->fade_timer)) { - ev_timer_stop(EV_A_ & ps->fade_timer); - } else if (fade_running && !ev_is_active(&ps->fade_timer)) { - ev_timer_set(&ps->fade_timer, fade_timeout(ps), 0); - ev_timer_start(EV_A_ & ps->fade_timer); - } - // Start/stop animation timer depends on whether windows are animating - if (!animation_running && ev_is_active(&ps->animation_timer)) { - ev_timer_stop(EV_A_ & ps->animation_timer); - } else if (animation_running && !ev_is_active(&ps->animation_timer)) { - ev_timer_set(&ps->animation_timer, 0, 0); - ev_timer_start(EV_A_ & ps->animation_timer); - } - - // If the screen is unredirected, free all_damage to stop painting - if (ps->redirected && ps->o.stoppaint_force != ON) { - static int paint = 0; - - log_trace("Render start, frame %d", paint); - if (ps->o.experimental_backends) { - paint_all_new(ps, bottom, false); - } else { - paint_all(ps, bottom, false); - } - log_trace("Render end"); - - ps->first_frame = false; - paint++; - if (ps->o.benchmark && paint >= ps->o.benchmark) { - exit(0); - } - } - - if (!fade_running) { - ps->fade_time = 0L; - } - if (!animation_running) { - ps->animation_time = 0L; - ps->root_desktop_switch_direction = 0; - } - - // TODO(yshui) Investigate how big the X critical section needs to be. There are - // suggestions that rendering should be in the critical section as well. - - ps->redraw_needed = false; -} - -static void draw_callback(EV_P_ ev_idle *w, int revents) { - session_t *ps = session_ptr(w, draw_idle); - - draw_callback_impl(EV_A_ ps, revents); - - // Don't do painting non-stop unless we are in benchmark mode - if (!ps->o.benchmark) { - ev_idle_stop(EV_A_ & ps->draw_idle); - } -} - -static void x_event_callback(EV_P attr_unused, ev_io *w, int revents attr_unused) { - session_t *ps = (session_t *)w; - xcb_generic_event_t *ev = xcb_poll_for_event(ps->c); - if (ev) { - ev_handle(ps, ev); - free(ev); - } -} - -/** - * Turn on the program reset flag. - * - * This will result in the compostior resetting itself after next paint. - */ -static void reset_enable(EV_P_ ev_signal *w attr_unused, int revents attr_unused) { - log_info("picom is resetting..."); - ev_break(EV_A_ EVBREAK_ALL); -} - -static void exit_enable(EV_P attr_unused, ev_signal *w, int revents attr_unused) { - session_t *ps = session_ptr(w, int_signal); - log_info("picom is quitting..."); - quit(ps); -} - -static void config_file_change_cb(void *_ps) { - auto ps = (struct session *)_ps; - reset_enable(ps->loop, NULL, 0); -} - -/** - * Initialize a session. - * - * @param argc number of commandline arguments - * @param argv commandline arguments - * @param dpy the X Display - * @param config_file the path to the config file - * @param all_xerros whether we should report all X errors - * @param fork whether we will fork after initialization - */ -static session_t *session_init(int argc, char **argv, Display *dpy, - const char *config_file, bool all_xerrors, bool fork) { - static const session_t s_def = { - .backend_data = NULL, - .dpy = NULL, - .scr = 0, - .c = NULL, - .vis = 0, - .depth = 0, - .root = XCB_NONE, - .root_height = 0, - .root_width = 0, - // .root_damage = XCB_NONE, - .overlay = XCB_NONE, - .root_tile_fill = false, - .root_tile_paint = PAINT_INIT, - .tgt_picture = XCB_NONE, - .tgt_buffer = PAINT_INIT, - .reg_win = XCB_NONE, -#ifdef CONFIG_OPENGL - .glx_prog_win = GLX_PROG_MAIN_INIT, -#endif - .redirected = false, - .alpha_picts = NULL, - .fade_time = 0L, - .animation_time = 0L, - .ignore_head = NULL, - .ignore_tail = NULL, - .quit = false, - - .expose_rects = NULL, - .size_expose = 0, - .n_expose = 0, - - .windows = NULL, - .active_win = NULL, - .active_leader = XCB_NONE, - - .black_picture = XCB_NONE, - .cshadow_picture = XCB_NONE, - .white_picture = XCB_NONE, - .gaussian_map = NULL, - -#ifdef CONFIG_VSYNC_DRM - .drm_fd = -1, -#endif - - .xfixes_event = 0, - .xfixes_error = 0, - .damage_event = 0, - .damage_error = 0, - .render_event = 0, - .render_error = 0, - .composite_event = 0, - .composite_error = 0, - .composite_opcode = 0, - .shape_exists = false, - .shape_event = 0, - .shape_error = 0, - .randr_exists = 0, - .randr_event = 0, - .randr_error = 0, - .glx_exists = false, - .glx_event = 0, - .glx_error = 0, - .xrfilter_convolution_exists = false, - - .atoms_wintypes = {0}, - .track_atom_lst = NULL, - -#ifdef CONFIG_DBUS - .dbus_data = NULL, -#endif - }; - - auto stderr_logger = stderr_logger_new(); - if (stderr_logger) { - // stderr logger might fail to create if we are already - // daemonized. - log_add_target_tls(stderr_logger); - } - - // Allocate a session and copy default values into it - session_t *ps = cmalloc(session_t); - *ps = s_def; - list_init_head(&ps->window_stack); - ps->loop = EV_DEFAULT; - pixman_region32_init(&ps->screen_reg); - - ps->ignore_tail = &ps->ignore_head; - - ps->o.show_all_xerrors = all_xerrors; - - // Use the same Display across reset, primarily for resource leak checking - ps->dpy = dpy; - ps->c = XGetXCBConnection(ps->dpy); - - const xcb_query_extension_reply_t *ext_info; - - ps->previous_xerror_handler = XSetErrorHandler(xerror); - - ps->scr = DefaultScreen(ps->dpy); - - auto screen = x_screen_of_display(ps->c, ps->scr); - ps->vis = screen->root_visual; - ps->depth = screen->root_depth; - ps->root = screen->root; - ps->root_width = screen->width_in_pixels; - ps->root_height = screen->height_in_pixels; - - // Start listening to events on root earlier to catch all possible - // root geometry changes - auto e = xcb_request_check( - ps->c, xcb_change_window_attributes_checked( - ps->c, ps->root, XCB_CW_EVENT_MASK, - (const uint32_t[]){XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | - XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | - XCB_EVENT_MASK_PROPERTY_CHANGE})); - if (e) { - log_error_x_error(e, "Failed to setup root window event mask"); - } - - xcb_prefetch_extension_data(ps->c, &xcb_render_id); - xcb_prefetch_extension_data(ps->c, &xcb_composite_id); - xcb_prefetch_extension_data(ps->c, &xcb_damage_id); - xcb_prefetch_extension_data(ps->c, &xcb_shape_id); - xcb_prefetch_extension_data(ps->c, &xcb_xfixes_id); - xcb_prefetch_extension_data(ps->c, &xcb_randr_id); - xcb_prefetch_extension_data(ps->c, &xcb_xinerama_id); - xcb_prefetch_extension_data(ps->c, &xcb_present_id); - xcb_prefetch_extension_data(ps->c, &xcb_sync_id); - xcb_prefetch_extension_data(ps->c, &xcb_glx_id); - - ext_info = xcb_get_extension_data(ps->c, &xcb_render_id); - if (!ext_info || !ext_info->present) { - log_fatal("No render extension"); - exit(1); - } - ps->render_event = ext_info->first_event; - ps->render_error = ext_info->first_error; - - ext_info = xcb_get_extension_data(ps->c, &xcb_composite_id); - if (!ext_info || !ext_info->present) { - log_fatal("No composite extension"); - exit(1); - } - ps->composite_opcode = ext_info->major_opcode; - ps->composite_event = ext_info->first_event; - ps->composite_error = ext_info->first_error; - - { - xcb_composite_query_version_reply_t *reply = xcb_composite_query_version_reply( - ps->c, - xcb_composite_query_version(ps->c, XCB_COMPOSITE_MAJOR_VERSION, - XCB_COMPOSITE_MINOR_VERSION), - NULL); - - if (!reply || (reply->major_version == 0 && reply->minor_version < 2)) { - log_fatal("Your X server doesn't have Composite >= 0.2 support, " - "we cannot proceed."); - exit(1); - } - free(reply); - } - - ext_info = xcb_get_extension_data(ps->c, &xcb_damage_id); - if (!ext_info || !ext_info->present) { - log_fatal("No damage extension"); - exit(1); - } - ps->damage_event = ext_info->first_event; - ps->damage_error = ext_info->first_error; - xcb_discard_reply(ps->c, xcb_damage_query_version(ps->c, XCB_DAMAGE_MAJOR_VERSION, - XCB_DAMAGE_MINOR_VERSION) - .sequence); - - ext_info = xcb_get_extension_data(ps->c, &xcb_xfixes_id); - if (!ext_info || !ext_info->present) { - log_fatal("No XFixes extension"); - exit(1); - } - ps->xfixes_event = ext_info->first_event; - ps->xfixes_error = ext_info->first_error; - xcb_discard_reply(ps->c, xcb_xfixes_query_version(ps->c, XCB_XFIXES_MAJOR_VERSION, - XCB_XFIXES_MINOR_VERSION) - .sequence); - - ps->damaged_region = x_new_id(ps->c); - if (!XCB_AWAIT_VOID(xcb_xfixes_create_region, ps->c, ps->damaged_region, 0, NULL)) { - log_fatal("Failed to create a XFixes region"); - goto err; - } - - ext_info = xcb_get_extension_data(ps->c, &xcb_glx_id); - if (ext_info && ext_info->present) { - ps->glx_exists = true; - ps->glx_error = ext_info->first_error; - ps->glx_event = ext_info->first_event; - } - - // Parse configuration file - win_option_mask_t winopt_mask[NUM_WINTYPES] = {{0}}; - bool shadow_enabled = false, fading_enable = false, hasneg = false; - char *config_file_to_free = NULL; - config_file = config_file_to_free = parse_config( - &ps->o, config_file, &shadow_enabled, &fading_enable, &hasneg, winopt_mask); - - if (IS_ERR(config_file_to_free)) { - return NULL; - } - - // Parse all of the rest command line options - if (!get_cfg(&ps->o, argc, argv, shadow_enabled, fading_enable, hasneg, winopt_mask)) { - log_fatal("Failed to get configuration, usually mean you have specified " - "invalid options."); - return NULL; - } - - if (ps->o.logpath) { - auto l = file_logger_new(ps->o.logpath); - if (l) { - log_info("Switching to log file: %s", ps->o.logpath); - if (stderr_logger) { - log_remove_target_tls(stderr_logger); - stderr_logger = NULL; - } - log_add_target_tls(l); - stderr_logger = NULL; - } else { - log_error("Failed to setup log file %s, I will keep using stderr", - ps->o.logpath); - } - } - - if (strstr(argv[0], "compton")) { - log_warn("This compositor has been renamed to \"picom\", the \"compton\" " - "binary will not be installed in the future."); - } - - ps->atoms = init_atoms(ps->c); - ps->atoms_wintypes[WINTYPE_UNKNOWN] = 0; -#define SET_WM_TYPE_ATOM(x) \ - ps->atoms_wintypes[WINTYPE_##x] = ps->atoms->a_NET_WM_WINDOW_TYPE_##x - SET_WM_TYPE_ATOM(DESKTOP); - SET_WM_TYPE_ATOM(DOCK); - SET_WM_TYPE_ATOM(TOOLBAR); - SET_WM_TYPE_ATOM(MENU); - SET_WM_TYPE_ATOM(UTILITY); - SET_WM_TYPE_ATOM(SPLASH); - SET_WM_TYPE_ATOM(DIALOG); - SET_WM_TYPE_ATOM(NORMAL); - SET_WM_TYPE_ATOM(DROPDOWN_MENU); - SET_WM_TYPE_ATOM(POPUP_MENU); - SET_WM_TYPE_ATOM(TOOLTIP); - SET_WM_TYPE_ATOM(NOTIFICATION); - SET_WM_TYPE_ATOM(COMBO); - SET_WM_TYPE_ATOM(DND); -#undef SET_WM_TYPE_ATOM - - // Get needed atoms for c2 condition lists - if (!(c2_list_postprocess(ps, ps->o.unredir_if_possible_blacklist) && - c2_list_postprocess(ps, ps->o.paint_blacklist) && - c2_list_postprocess(ps, ps->o.shadow_blacklist) && - c2_list_postprocess(ps, ps->o.shadow_clip_list) && - c2_list_postprocess(ps, ps->o.fade_blacklist) && - c2_list_postprocess(ps, ps->o.blur_background_blacklist) && - c2_list_postprocess(ps, ps->o.invert_color_list) && - c2_list_postprocess(ps, ps->o.opacity_rules) && - c2_list_postprocess(ps, ps->o.animation_blacklist) && - c2_list_postprocess(ps, ps->o.rounded_corners_blacklist) && - c2_list_postprocess(ps, ps->o.focus_blacklist))) { - log_error("Post-processing of conditionals failed, some of your rules " - "might not work"); - } - - ps->gaussian_map = gaussian_kernel_autodetect_deviation(ps->o.shadow_radius); - sum_kernel_preprocess(ps->gaussian_map); - - rebuild_shadow_exclude_reg(ps); - - // Query X Shape - ext_info = xcb_get_extension_data(ps->c, &xcb_shape_id); - if (ext_info && ext_info->present) { - ps->shape_event = ext_info->first_event; - ps->shape_error = ext_info->first_error; - ps->shape_exists = true; - } - - ext_info = xcb_get_extension_data(ps->c, &xcb_randr_id); - if (ext_info && ext_info->present) { - ps->randr_exists = true; - ps->randr_event = ext_info->first_event; - ps->randr_error = ext_info->first_error; - } - - ext_info = xcb_get_extension_data(ps->c, &xcb_present_id); - if (ext_info && ext_info->present) { - auto r = xcb_present_query_version_reply( - ps->c, - xcb_present_query_version(ps->c, XCB_PRESENT_MAJOR_VERSION, - XCB_PRESENT_MINOR_VERSION), - NULL); - if (r) { - ps->present_exists = true; - free(r); - } - } - - // Query X Sync - ext_info = xcb_get_extension_data(ps->c, &xcb_sync_id); - if (ext_info && ext_info->present) { - ps->xsync_error = ext_info->first_error; - ps->xsync_event = ext_info->first_event; - // Need X Sync 3.1 for fences - auto r = xcb_sync_initialize_reply( - ps->c, - xcb_sync_initialize(ps->c, XCB_SYNC_MAJOR_VERSION, XCB_SYNC_MINOR_VERSION), - NULL); - if (r && (r->major_version > 3 || - (r->major_version == 3 && r->minor_version >= 1))) { - ps->xsync_exists = true; - free(r); - } - } - - ps->sync_fence = XCB_NONE; - if (ps->xsync_exists) { - ps->sync_fence = x_new_id(ps->c); - e = xcb_request_check( - ps->c, xcb_sync_create_fence(ps->c, ps->root, ps->sync_fence, 0)); - if (e) { - if (ps->o.xrender_sync_fence) { - log_error_x_error(e, "Failed to create a XSync fence. " - "xrender-sync-fence will be " - "disabled"); - ps->o.xrender_sync_fence = false; - } - ps->sync_fence = XCB_NONE; - free(e); - } - } else if (ps->o.xrender_sync_fence) { - log_error("XSync extension not found. No XSync fence sync is " - "possible. (xrender-sync-fence can't be enabled)"); - ps->o.xrender_sync_fence = false; - } - - // Query X RandR - if (ps->o.xinerama_shadow_crop) { - if (!ps->randr_exists) { - log_fatal("No XRandR extension. xinerama-shadow-crop cannot be " - "enabled."); - goto err; - } - } - - // Query X Xinerama extension - if (ps->o.xinerama_shadow_crop) { - ext_info = xcb_get_extension_data(ps->c, &xcb_xinerama_id); - ps->xinerama_exists = ext_info && ext_info->present; - } - - auto prop = x_get_prop(ps->c, ps->root, ps->atoms->a_NET_CURRENT_DESKTOP, - 1L, XCB_ATOM_CARDINAL, 32); - - if (prop.nitems) { - ps->root_desktop_num = (int)*prop.c32; - } - - rebuild_screen_reg(ps); - - bool compositor_running = false; - if (session_redirection_mode(ps) == XCB_COMPOSITE_REDIRECT_MANUAL) { - // We are running in the manual redirection mode, meaning we are running - // as a proper compositor. So we need to register us as a compositor, etc. - - // We are also here when --diagnostics is set. We want to be here because - // that gives us more diagnostic information. - - // Create registration window - int ret = register_cm(ps); - if (ret == -1) { - exit(1); - } - - compositor_running = ret == 1; - if (compositor_running) { - // Don't take the overlay when there is another compositor - // running, so we don't disrupt it. - - // If we are printing diagnostic, we will continue a bit further - // to get more diagnostic information, otherwise we will exit. - if (!ps->o.print_diagnostics) { - log_fatal("Another composite manager is already running"); - exit(1); - } - } else { - if (!init_overlay(ps)) { - goto err; - } - } - } else { - // We are here if we don't really function as a compositor, so we are not - // taking over the screen, and we don't need to register as a compositor - - // If we are in debug mode, we need to create a window for rendering if - // the backend supports presenting. - - // The old backends doesn't have a automatic redirection mode - log_info("The compositor is started in automatic redirection mode."); - assert(ps->o.experimental_backends); - - if (backend_list[ps->o.backend]->present) { - // If the backend has `present`, we couldn't be in automatic - // redirection mode unless we are in debug mode. - assert(ps->o.debug_mode); - if (!init_debug_window(ps)) { - goto err; - } - } - } - - ps->drivers = detect_driver(ps->c, ps->backend_data, ps->root); - apply_driver_workarounds(ps, ps->drivers); - - // Initialize filters, must be preceded by OpenGL context creation - if (!ps->o.experimental_backends && !init_render(ps)) { - log_fatal("Failed to initialize the backend"); - exit(1); - } - - if (ps->o.print_diagnostics) { - print_diagnostics(ps, config_file, compositor_running); - free(config_file_to_free); - exit(0); - } - - ps->file_watch_handle = file_watch_init(ps->loop); - if (ps->file_watch_handle && config_file) { - file_watch_add(ps->file_watch_handle, config_file, config_file_change_cb, ps); - } - - free(config_file_to_free); - - if (bkend_use_glx(ps) && !ps->o.experimental_backends) { - auto gl_logger = gl_string_marker_logger_new(); - if (gl_logger) { - log_info("Enabling gl string marker"); - log_add_target_tls(gl_logger); - } - } - - if (ps->o.experimental_backends) { - if (ps->o.monitor_repaint && !backend_list[ps->o.backend]->fill) { - log_warn("--monitor-repaint is not supported by the backend, " - "disabling"); - ps->o.monitor_repaint = false; - } - } - - // Monitor screen changes if vsync_sw is enabled and we are using - // an auto-detected refresh rate, or when Xinerama features are enabled - if (ps->randr_exists && ps->o.xinerama_shadow_crop) { - xcb_randr_select_input(ps->c, ps->root, XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE); - } - - cxinerama_upd_scrs(ps); - - { - xcb_render_create_picture_value_list_t pa = { - .subwindowmode = IncludeInferiors, - }; - - ps->root_picture = x_create_picture_with_visual_and_pixmap( - ps->c, ps->vis, ps->root, XCB_RENDER_CP_SUBWINDOW_MODE, &pa); - if (ps->overlay != XCB_NONE) { - ps->tgt_picture = x_create_picture_with_visual_and_pixmap( - ps->c, ps->vis, ps->overlay, XCB_RENDER_CP_SUBWINDOW_MODE, &pa); - } else - ps->tgt_picture = ps->root_picture; - } - - ev_io_init(&ps->xiow, x_event_callback, ConnectionNumber(ps->dpy), EV_READ); - ev_io_start(ps->loop, &ps->xiow); - ev_init(&ps->unredir_timer, tmout_unredir_callback); - ev_idle_init(&ps->draw_idle, draw_callback); - - ev_init(&ps->fade_timer, fade_timer_callback); - ev_init(&ps->animation_timer, animation_timer_callback); - - // Set up SIGUSR1 signal handler to reset program - ev_signal_init(&ps->usr1_signal, reset_enable, SIGUSR1); - ev_signal_init(&ps->int_signal, exit_enable, SIGINT); - ev_signal_start(ps->loop, &ps->usr1_signal); - ev_signal_start(ps->loop, &ps->int_signal); - - // xcb can read multiple events from the socket when a request with reply is - // made. - // - // Use an ev_prepare to make sure we cannot accidentally forget to handle them - // before we go to sleep. - // - // If we don't drain the queue before goes to sleep (i.e. blocking on socket - // input), we will be sleeping with events available in queue. Which might - // cause us to block indefinitely because arrival of new events could be - // dependent on processing of existing events (e.g. if we don't process damage - // event and do damage subtract, new damage event won't be generated). - // - // So we make use of a ev_prepare handle, which is called right before libev - // goes into sleep, to handle all the queued X events. - ev_prepare_init(&ps->event_check, handle_queued_x_events); - // Make sure nothing can cause xcb to read from the X socket after events are - // handled and before we going to sleep. - ev_set_priority(&ps->event_check, EV_MINPRI); - ev_prepare_start(ps->loop, &ps->event_check); - - // Initialize DBus. We need to do this early, because add_win might call dbus - // functions - if (ps->o.dbus) { -#ifdef CONFIG_DBUS - cdbus_init(ps, DisplayString(ps->dpy)); - if (!ps->dbus_data) { - ps->o.dbus = false; - } -#else - log_fatal("DBus support not compiled in!"); - exit(1); -#endif - } - - e = xcb_request_check(ps->c, xcb_grab_server_checked(ps->c)); - if (e) { - log_fatal_x_error(e, "Failed to grab X server"); - free(e); - goto err; - } - - ps->server_grabbed = true; - - // We are going to pull latest information from X server now, events sent by X - // earlier is irrelavant at this point. - // A better solution is probably grabbing the server from the very start. But I - // think there still could be race condition that mandates discarding the events. - x_discard_events(ps->c); - - xcb_query_tree_reply_t *query_tree_reply = - xcb_query_tree_reply(ps->c, xcb_query_tree(ps->c, ps->root), NULL); - - e = xcb_request_check(ps->c, xcb_ungrab_server(ps->c)); - if (e) { - log_fatal_x_error(e, "Failed to ungrab server"); - free(e); - goto err; - } - - ps->server_grabbed = false; - - if (query_tree_reply) { - xcb_window_t *children; - int nchildren; - - children = xcb_query_tree_children(query_tree_reply); - nchildren = xcb_query_tree_children_length(query_tree_reply); - - for (int i = 0; i < nchildren; i++) { - add_win_above(ps, children[i], i ? children[i - 1] : XCB_NONE); - } - free(query_tree_reply); - } - - log_debug("Initial stack:"); - list_foreach(struct win, w, &ps->window_stack, stack_neighbour) { - log_debug("%#010x", w->id); - } - - ps->pending_updates = true; - - write_pid(ps); - - if (fork && stderr_logger) { - // Remove the stderr logger if we will fork - log_remove_target_tls(stderr_logger); - } - return ps; -err: - free(ps); - return NULL; -} - -/** - * Destroy a session. - * - * Does not close the X connection or free the session_t - * structure, though. - * - * @param ps session to destroy - */ -static void session_destroy(session_t *ps) { - if (ps->redirected) { - unredirect(ps); - } - -#ifdef CONFIG_OPENGL - free(ps->argb_fbconfig); - ps->argb_fbconfig = NULL; -#endif - - file_watch_destroy(ps->loop, ps->file_watch_handle); - ps->file_watch_handle = NULL; - - // Stop listening to events on root window - xcb_change_window_attributes(ps->c, ps->root, XCB_CW_EVENT_MASK, - (const uint32_t[]){0}); - -#ifdef CONFIG_DBUS - // Kill DBus connection - if (ps->o.dbus) { - assert(ps->dbus_data); - cdbus_destroy(ps); - } -#endif - - // Free window linked list - - list_foreach_safe(struct win, w, &ps->window_stack, stack_neighbour) { - if (!w->destroyed) { - win_ev_stop(ps, w); - HASH_DEL(ps->windows, w); - } - - if (w->managed) { - auto mw = (struct managed_win *)w; - free_win_res(ps, mw); - } - free(w); - } - list_init_head(&ps->window_stack); - - // Free blacklists - free_wincondlst(&ps->o.shadow_blacklist); - free_wincondlst(&ps->o.shadow_clip_list); - free_wincondlst(&ps->o.fade_blacklist); - free_wincondlst(&ps->o.focus_blacklist); - free_wincondlst(&ps->o.invert_color_list); - free_wincondlst(&ps->o.blur_background_blacklist); - free_wincondlst(&ps->o.opacity_rules); - free_wincondlst(&ps->o.paint_blacklist); - free_wincondlst(&ps->o.unredir_if_possible_blacklist); - free_wincondlst(&ps->o.animation_blacklist); - free_wincondlst(&ps->o.rounded_corners_blacklist); - - // Free tracked atom list - { - latom_t *next = NULL; - for (latom_t *this = ps->track_atom_lst; this; this = next) { - next = this->next; - free(this); - } - - ps->track_atom_lst = NULL; - } - - // Free ignore linked list - { - ignore_t *next = NULL; - for (ignore_t *ign = ps->ignore_head; ign; ign = next) { - next = ign->next; - - free(ign); - } - - // Reset head and tail - ps->ignore_head = NULL; - ps->ignore_tail = &ps->ignore_head; - } - - // Free tgt_{buffer,picture} and root_picture - if (ps->tgt_buffer.pict == ps->tgt_picture) - ps->tgt_buffer.pict = XCB_NONE; - - if (ps->tgt_picture == ps->root_picture) - ps->tgt_picture = XCB_NONE; - else - free_picture(ps->c, &ps->tgt_picture); - - free_picture(ps->c, &ps->root_picture); - free_paint(ps, &ps->tgt_buffer); - - pixman_region32_fini(&ps->screen_reg); - free(ps->expose_rects); - - free(ps->o.write_pid_path); - free(ps->o.logpath); - for (int i = 0; i < ps->o.blur_kernel_count; ++i) { - free(ps->o.blur_kerns[i]); - } - free(ps->o.blur_kerns); - free(ps->o.glx_fshader_win_str); - free_xinerama_info(ps); - -#ifdef CONFIG_VSYNC_DRM - // Close file opened for DRM VSync - if (ps->drm_fd >= 0) { - close(ps->drm_fd); - ps->drm_fd = -1; - } -#endif - - // Release overlay window - if (ps->overlay) { - xcb_composite_release_overlay_window(ps->c, ps->overlay); - ps->overlay = XCB_NONE; - } - - if (ps->sync_fence != XCB_NONE) { - xcb_sync_destroy_fence(ps->c, ps->sync_fence); - ps->sync_fence = XCB_NONE; - } - - // Free reg_win - if (ps->reg_win != XCB_NONE) { - xcb_destroy_window(ps->c, ps->reg_win); - ps->reg_win = XCB_NONE; - } - - if (ps->debug_window != XCB_NONE) { - xcb_destroy_window(ps->c, ps->debug_window); - ps->debug_window = XCB_NONE; - } - - if (ps->damaged_region != XCB_NONE) { - xcb_xfixes_destroy_region(ps->c, ps->damaged_region); - ps->damaged_region = XCB_NONE; - } - - if (ps->o.experimental_backends) { - // backend is deinitialized in unredirect() - assert(ps->backend_data == NULL); - } else { - deinit_render(ps); - } - -#if CONFIG_OPENGL - if (glx_has_context(ps)) { - // GLX context created, but not for rendering - glx_destroy(ps); - } -#endif - - // Flush all events - x_sync(ps->c); - ev_io_stop(ps->loop, &ps->xiow); - free_conv(ps->gaussian_map); - destroy_atoms(ps->atoms); - -#ifdef DEBUG_XRC - // Report about resource leakage - xrc_report_xid(); -#endif - - XSetErrorHandler(ps->previous_xerror_handler); - - // Stop libev event handlers - ev_timer_stop(ps->loop, &ps->unredir_timer); - ev_timer_stop(ps->loop, &ps->fade_timer); - ev_timer_stop(ps->loop, &ps->animation_timer); - ev_idle_stop(ps->loop, &ps->draw_idle); - ev_prepare_stop(ps->loop, &ps->event_check); - ev_signal_stop(ps->loop, &ps->usr1_signal); - ev_signal_stop(ps->loop, &ps->int_signal); -} - -/** - * Do the actual work. - * - * @param ps current session - */ -static void session_run(session_t *ps) { - // In benchmark mode, we want draw_idle handler to always be active - if (ps->o.benchmark) { - ev_idle_start(ps->loop, &ps->draw_idle); - } else { - // Let's draw our first frame! - queue_redraw(ps); - } - ev_run(ps->loop, 0); -} - -/** - * The function that everybody knows. - */ -int main(int argc, char **argv) { - // Set locale so window names with special characters are interpreted - // correctly - setlocale(LC_ALL, ""); - - // Initialize logging system for early logging - log_init_tls(); - - { - auto stderr_logger = stderr_logger_new(); - if (stderr_logger) { - log_add_target_tls(stderr_logger); - } - } - - int exit_code; - char *config_file = NULL; - bool all_xerrors = false, need_fork = false; - if (get_early_config(argc, argv, &config_file, &all_xerrors, &need_fork, &exit_code)) { - return exit_code; - } - - int pfds[2]; - if (need_fork) { - if (pipe2(pfds, O_CLOEXEC)) { - perror("pipe2"); - return 1; - } - auto pid = fork(); - if (pid < 0) { - perror("fork"); - return 1; - } - if (pid > 0) { - // We are the parent - close(pfds[1]); - // We wait for the child to tell us it has finished initialization - // by sending us something via the pipe. - int tmp; - if (read(pfds[0], &tmp, sizeof tmp) <= 0) { - // Failed to read, the child has most likely died - // We can probably waitpid() here. - return 1; - } else { - // We are done - return 0; - } - } - // We are the child - close(pfds[0]); - } - - // Main loop - bool quit = false; - int ret_code = 0; - char *pid_file = NULL; - - do { - Display *dpy = XOpenDisplay(NULL); - if (!dpy) { - log_fatal("Can't open display."); - ret_code = 1; - break; - } - XSetEventQueueOwner(dpy, XCBOwnsEventQueue); - - // Reinit logging system so we don't get leftovers from previous sessions - // or early logging. - log_deinit_tls(); - log_init_tls(); - - ps_g = session_init(argc, argv, dpy, config_file, all_xerrors, need_fork); - if (!ps_g) { - log_fatal("Failed to create new session."); - ret_code = 1; - break; - } - if (need_fork) { - // Finishing up daemonization - // Close files - if (fclose(stdout) || fclose(stderr) || fclose(stdin)) { - log_fatal("Failed to close standard input/output"); - ret_code = 1; - break; - } - // Make us the session and process group leader so we don't get - // killed when our parent die. - setsid(); - // Notify the parent that we are done. This might cause the parent - // to quit, so only do this after setsid() - int tmp = 1; - write(pfds[1], &tmp, sizeof tmp); - close(pfds[1]); - // We only do this once - need_fork = false; - } - session_run(ps_g); - quit = ps_g->quit; - if (quit && ps_g->o.write_pid_path) { - pid_file = strdup(ps_g->o.write_pid_path); - } - session_destroy(ps_g); - free(ps_g); - ps_g = NULL; - if (dpy) { - XCloseDisplay(dpy); - } - } while (!quit); - - free(config_file); - if (pid_file) { - log_trace("remove pid file %s", pid_file); - unlink(pid_file); - free(pid_file); - } - - log_deinit_tls(); - - return ret_code; -} diff --git a/dwm/picom/src/picom.h b/dwm/picom/src/picom.h deleted file mode 100644 index 0ba04dd..0000000 --- a/dwm/picom/src/picom.h +++ /dev/null @@ -1,115 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) - -// Throw everything in here. -// !!! DON'T !!! - -// === Includes === - -#include -#include -#include -#include - -#include -#include "backend/backend.h" -#include "c2.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "log.h" // XXX clean up -#include "region.h" -#include "render.h" -#include "types.h" -#include "utils.h" -#include "win.h" -#include "x.h" - -enum root_flags { - ROOT_FLAGS_SCREEN_CHANGE = 1, // Received RandR screen change notify, we - // use this to track refresh rate changes - ROOT_FLAGS_CONFIGURED = 2 // Received configure notify on the root window -}; - -// == Functions == -// TODO(yshui) move static inline functions that are only used in picom.c, into picom.c - -void add_damage(session_t *ps, const region_t *damage); - -uint32_t determine_evmask(session_t *ps, xcb_window_t wid, win_evmode_t mode); - -void circulate_win(session_t *ps, xcb_circulate_notify_event_t *ce); - -void root_damaged(session_t *ps); - -void cxinerama_upd_scrs(session_t *ps); - -void queue_redraw(session_t *ps); - -void discard_ignore(session_t *ps, unsigned long sequence); - -void set_root_flags(session_t *ps, uint64_t flags); - -void quit(session_t *ps); - -xcb_window_t session_get_target_window(session_t *); - -uint8_t session_redirection_mode(session_t *ps); - -/** - * Set a switch_t array of all unset wintypes to true. - */ -static inline void wintype_arr_enable_unset(switch_t arr[]) { - wintype_t i; - - for (i = 0; i < NUM_WINTYPES; ++i) - if (UNSET == arr[i]) - arr[i] = ON; -} - -/** - * Check if a window ID exists in an array of window IDs. - * - * @param arr the array of window IDs - * @param count amount of elements in the array - * @param wid window ID to search for - */ -static inline bool array_wid_exists(const xcb_window_t *arr, int count, xcb_window_t wid) { - while (count--) { - if (arr[count] == wid) { - return true; - } - } - - return false; -} - -/** - * Destroy a condition list. - */ -static inline void free_wincondlst(c2_lptr_t **pcondlst) { - while ((*pcondlst = c2_free_lptr(*pcondlst))) - continue; -} - -#ifndef CONFIG_OPENGL -static inline void free_paint_glx(session_t *ps attr_unused, paint_t *p attr_unused) { -} -static inline void -free_win_res_glx(session_t *ps attr_unused, struct managed_win *w attr_unused) { -} -#endif - -/** - * Dump an drawable's info. - */ -static inline void dump_drawable(session_t *ps, xcb_drawable_t drawable) { - auto r = xcb_get_geometry_reply(ps->c, xcb_get_geometry(ps->c, drawable), NULL); - if (!r) { - log_trace("Drawable %#010x: Failed", drawable); - return; - } - log_trace("Drawable %#010x: x = %u, y = %u, wid = %u, hei = %d, b = %u, d = %u", - drawable, r->x, r->y, r->width, r->height, r->border_width, r->depth); - free(r); -} diff --git a/dwm/picom/src/picom.modulemap b/dwm/picom/src/picom.modulemap deleted file mode 100644 index 787c4ff..0000000 --- a/dwm/picom/src/picom.modulemap +++ /dev/null @@ -1,214 +0,0 @@ -// modulemap - -module compiler { - header "compiler.h" -} -module string_utils { - header "string_utils.h" -} -module dbus { - header "dbus.h" -} -module kernel { - header "kernel.h" -} -module utils { - // Has macros expands to calloc/malloc - header "utils.h" - export libc.stdlib -} -module region { - header "region.h" -} -module picom { - header "picom.h" -} -module types { - header "types.h" -} -module c2 { - header "c2.h" -} -module render { - header "render.h" -} -module options { - header "options.h" -} -module opengl { - header "opengl.h" -} -module diagnostic { - header "diagnostic.h" -} -module win_defs { - header "win_defs.h" -} -module win { - header "win.h" - export win_defs -} -module log { - header "log.h" - export compiler -} -module x { - header "x.h" -} -module vsync { - header "vsync.h" -} -module common { - header "common.h" -} -module config { - header "config.h" -} -module xrescheck { - header "xrescheck.h" -} -module cache { - header "cache.h" -} -module backend { - module gl { - module gl_common { - header "backend/gl/gl_common.h" - } - module glx { - header "backend/gl/glx.h" - export GL.glx - } - } - module backend { - header "backend/backend.h" - } - module backend_common { - header "backend/backend_common.h" - } -} -module xcb [system] { - module xcb { - header "/usr/include/xcb/xcb.h" - export * - } - module randr { - header "/usr/include/xcb/randr.h" - export * - } - module render { - header "/usr/include/xcb/render.h" - export * - } - module sync { - header "/usr/include/xcb/sync.h" - export * - } - module composite { - header "/usr/include/xcb/composite.h" - export * - } - module xfixes { - header "/usr/include/xcb/xfixes.h" - export * - } - module damage { - header "/usr/include/xcb/damage.h" - export * - } - module xproto { - header "/usr/include/xcb/xproto.h" - export * - } - module present { - header "/usr/include/xcb/present.h" - } - module util { - module render { - header "/usr/include/xcb/xcb_renderutil.h" - export * - } - } -} -module X11 [system] { - module Xlib { - header "/usr/include/X11/Xlib.h" - export * - } - module Xutil { - header "/usr/include/X11/Xutil.h" - export * - } -} -module GL [system] { - module glx { - header "/usr/include/GL/glx.h" - export * - } - module gl { - header "/usr/include/GL/gl.h" - export * - } -} -module libc [system] { - export * - module assert { - export * - textual header "/usr/include/assert.h" - } - module string { - export * - header "/usr/include/string.h" - } - module ctype { - export * - header "/usr/include/ctype.h" - } - module errno { - export * - header "/usr/include/errno.h" - } - module fenv { - export * - header "/usr/include/fenv.h" - } - module inttypes { - export * - header "/usr/include/inttypes.h" - } - module math { - export * - header "/usr/include/math.h" - } - module setjmp { - export * - header "/usr/include/setjmp.h" - } - module stdio { - export * - header "/usr/include/stdio.h" - } - - module stdlib [system] { - export * - header "/usr/include/stdlib.h" - } -} - -// glib specific header. In it's own module because it -// doesn't exist on some systems with unpatched glib 2.26+ -module "xlocale.h" [system] { - export * - header "/usr/include/xlocale.h" -} - -// System header that we have difficult with merging. -module "sys_types.h" [system] { - export * - header "/usr/include/sys/types.h" -} - -module "signal.h" [system] { - export * - header "/usr/include/signal.h" -} diff --git a/dwm/picom/src/region.h b/dwm/picom/src/region.h deleted file mode 100644 index bda66e2..0000000 --- a/dwm/picom/src/region.h +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui -#pragma once -#include -#include -#include -#include - -#include "log.h" -#include "utils.h" - -typedef struct pixman_region32 pixman_region32_t; -typedef struct pixman_box32 pixman_box32_t; -typedef pixman_region32_t region_t; -typedef pixman_box32_t rect_t; - -RC_TYPE(region_t, rc_region, pixman_region32_init, pixman_region32_fini, static inline) - -static inline void dump_region(const region_t *x) { - if (log_get_level_tls() < LOG_LEVEL_TRACE) { - return; - } - int nrects; - const rect_t *rects = pixman_region32_rectangles((region_t *)x, &nrects); - log_trace("nrects: %d", nrects); - for (int i = 0; i < nrects; i++) - log_trace("(%d, %d) - (%d, %d)", rects[i].x1, rects[i].y1, rects[i].x2, - rects[i].y2); -} - -/// Convert one xcb rectangle to our rectangle type -static inline rect_t from_x_rect(const xcb_rectangle_t *rect) { - return (rect_t){ - .x1 = rect->x, - .y1 = rect->y, - .x2 = rect->x + rect->width, - .y2 = rect->y + rect->height, - }; -} - -/// Convert an array of xcb rectangles to our rectangle type -/// Returning an array that needs to be freed -static inline rect_t *from_x_rects(int nrects, const xcb_rectangle_t *rects) { - rect_t *ret = ccalloc(nrects, rect_t); - for (int i = 0; i < nrects; i++) { - ret[i] = from_x_rect(rects + i); - } - return ret; -} - -/** - * Resize a region. - */ -static inline void _resize_region(const region_t *region, region_t *output, int dx, - int dy) { - if (!region || !output) { - return; - } - if (!dx && !dy) { - if (region != output) { - pixman_region32_copy(output, (region_t *)region); - } - return; - } - // Loop through all rectangles - int nrects; - int nnewrects = 0; - const rect_t *rects = pixman_region32_rectangles((region_t *)region, &nrects); - auto newrects = ccalloc(nrects, rect_t); - for (int i = 0; i < nrects; i++) { - int x1 = rects[i].x1 - dx; - int y1 = rects[i].y1 - dy; - int x2 = rects[i].x2 + dx; - int y2 = rects[i].y2 + dy; - int wid = x2 - x1; - int hei = y2 - y1; - if (wid <= 0 || hei <= 0) { - continue; - } - newrects[nnewrects] = - (rect_t){.x1 = x1, .x2 = x2, .y1 = y1, .y2 = y2}; - ++nnewrects; - } - - pixman_region32_fini(output); - pixman_region32_init_rects(output, newrects, nnewrects); - - free(newrects); -} - -static inline region_t resize_region(const region_t *region, int dx, int dy) { - region_t ret; - pixman_region32_init(&ret); - _resize_region(region, &ret, dx, dy); - return ret; -} - -static inline void resize_region_in_place(region_t *region, int dx, int dy) { - return _resize_region(region, region, dx, dy); -} diff --git a/dwm/picom/src/render.c b/dwm/picom/src/render.c deleted file mode 100644 index ac9b40e..0000000 --- a/dwm/picom/src/render.c +++ /dev/null @@ -1,1500 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "options.h" - -#ifdef CONFIG_OPENGL -#include "backend/gl/glx.h" -#include "opengl.h" - -#ifndef GLX_BACK_BUFFER_AGE_EXT -#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 -#endif - -#endif - -#include "compiler.h" -#include "config.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "types.h" -#include "utils.h" -#include "vsync.h" -#include "win.h" -#include "x.h" - -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "render.h" - -#define XRFILTER_CONVOLUTION "convolution" -#define XRFILTER_GAUSSIAN "gaussian" -#define XRFILTER_BINOMIAL "binomial" - -/** - * Bind texture in paint_t if we are using GLX backend. - */ -static inline bool paint_bind_tex(session_t *ps, paint_t *ppaint, int wid, int hei, - bool repeat, int depth, xcb_visualid_t visual, bool force) { -#ifdef CONFIG_OPENGL - // XXX This is a mess. But this will go away after the backend refactor. - if (!ppaint->pixmap) - return false; - - struct glx_fbconfig_info *fbcfg; - if (!visual) { - assert(depth == 32); - if (!ps->argb_fbconfig) { - ps->argb_fbconfig = - glx_find_fbconfig(ps->dpy, ps->scr, - (struct xvisual_info){.red_size = 8, - .green_size = 8, - .blue_size = 8, - .alpha_size = 8, - .visual_depth = 32}); - } - if (!ps->argb_fbconfig) { - log_error("Failed to find appropriate FBConfig for 32 bit depth"); - return false; - } - fbcfg = ps->argb_fbconfig; - } else { - auto m = x_get_visual_info(ps->c, visual); - if (m.visual_depth < 0) { - return false; - } - - if (depth && depth != m.visual_depth) { - log_error("Mismatching visual depth: %d != %d", depth, m.visual_depth); - return false; - } - - if (!ppaint->fbcfg) { - ppaint->fbcfg = glx_find_fbconfig(ps->dpy, ps->scr, m); - } - if (!ppaint->fbcfg) { - log_error("Failed to find appropriate FBConfig for X pixmap"); - return false; - } - fbcfg = ppaint->fbcfg; - } - - if (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap)) - return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, - repeat, fbcfg); -#else - (void)ps; - (void)ppaint; - (void)wid; - (void)hei; - (void)repeat; - (void)depth; - (void)visual; - (void)force; -#endif - return true; -} - -/** - * Check if current backend uses XRender for rendering. - */ -static inline bool bkend_use_xrender(session_t *ps) { - return BKEND_XRENDER == ps->o.backend || BKEND_XR_GLX_HYBRID == ps->o.backend; -} - -int maximum_buffer_age(session_t *ps) { - if (bkend_use_glx(ps) && ps->o.use_damage) { - return CGLX_MAX_BUFFER_AGE; - } - return 1; -} - -static int get_buffer_age(session_t *ps) { -#ifdef CONFIG_OPENGL - if (bkend_use_glx(ps)) { - if (!glxext.has_GLX_EXT_buffer_age && ps->o.use_damage) { - log_warn("GLX_EXT_buffer_age not supported by your driver," - "`use-damage` has to be disabled"); - ps->o.use_damage = false; - } - if (ps->o.use_damage) { - unsigned int val; - glXQueryDrawable(ps->dpy, get_tgt_window(ps), - GLX_BACK_BUFFER_AGE_EXT, &val); - return (int)val ?: -1; - } - return -1; - } -#endif - return ps->o.use_damage ? 1 : -1; -} - -/** - * Reset filter on a Picture. - */ -static inline void xrfilter_reset(session_t *ps, xcb_render_picture_t p) { -#define FILTER "Nearest" - xcb_render_set_picture_filter(ps->c, p, strlen(FILTER), FILTER, 0, NULL); -#undef FILTER -} - -/// Set the input/output clip region of the target buffer (not the actual target!) -static inline void attr_nonnull(1, 2) set_tgt_clip(session_t *ps, region_t *reg) { - switch (ps->o.backend) { - case BKEND_XRENDER: - case BKEND_XR_GLX_HYBRID: - x_set_picture_clip_region(ps->c, ps->tgt_buffer.pict, 0, 0, reg); - break; -#ifdef CONFIG_OPENGL - case BKEND_GLX: glx_set_clip(ps, reg); break; -#endif - default: assert(false); - } -} - -/** - * Destroy a Picture. - */ -void free_picture(xcb_connection_t *c, xcb_render_picture_t *p) { - if (*p) { - xcb_render_free_picture(c, *p); - *p = XCB_NONE; - } -} - -/** - * Free paint_t. - */ -void free_paint(session_t *ps, paint_t *ppaint) { -#ifdef CONFIG_OPENGL - free_paint_glx(ps, ppaint); -#endif - free_picture(ps->c, &ppaint->pict); - if (ppaint->pixmap) - xcb_free_pixmap(ps->c, ppaint->pixmap); - ppaint->pixmap = XCB_NONE; -} - -uint32_t -make_circle(int cx, int cy, int radius, uint32_t max_ntraps, xcb_render_trapezoid_t traps[]) { - uint32_t n = 0, k = 0; - int y1, y2; - double w; - while (k < max_ntraps) { - y1 = (int)(-radius * cos(M_PI * k / max_ntraps)); - traps[n].top = (cy + y1) * 65536; - traps[n].left.p1.y = (cy + y1) * 65536; - traps[n].right.p1.y = (cy + y1) * 65536; - w = sqrt(radius * radius - y1 * y1) * 65536; - traps[n].left.p1.x = (int)((cx * 65536) - w); - traps[n].right.p1.x = (int)((cx * 65536) + w); - - do { - k++; - y2 = (int)(-radius * cos(M_PI * k / max_ntraps)); - } while (y1 == y2); - - traps[n].bottom = (cy + y2) * 65536; - traps[n].left.p2.y = (cy + y2) * 65536; - traps[n].right.p2.y = (cy + y2) * 65536; - w = sqrt(radius * radius - y2 * y2) * 65536; - traps[n].left.p2.x = (int)((cx * 65536) - w); - traps[n].right.p2.x = (int)((cx * 65536) + w); - n++; - } - return n; -} - -uint32_t make_rectangle(int x, int y, int wid, int hei, xcb_render_trapezoid_t traps[]) { - traps[0].top = y * 65536; - traps[0].left.p1.y = y * 65536; - traps[0].left.p1.x = x * 65536; - traps[0].left.p2.y = (y + hei) * 65536; - traps[0].left.p2.x = x * 65536; - traps[0].bottom = (y + hei) * 65536; - traps[0].right.p1.x = (x + wid) * 65536; - traps[0].right.p1.y = y * 65536; - traps[0].right.p2.x = (x + wid) * 65536; - traps[0].right.p2.y = (y + hei) * 65536; - return 1; -} - -uint32_t make_rounded_window_shape(xcb_render_trapezoid_t traps[], uint32_t max_ntraps, - int cr, int wid, int hei) { - uint32_t n = make_circle(cr, cr, cr, max_ntraps, traps); - n += make_circle(wid - cr, cr, cr, max_ntraps, traps + n); - n += make_circle(wid - cr, hei - cr, cr, max_ntraps, traps + n); - n += make_circle(cr, hei - cr, cr, max_ntraps, traps + n); - n += make_rectangle(0, cr, wid, hei - 2 * cr, traps + n); - n += make_rectangle(cr, 0, wid - 2 * cr, cr, traps + n); - n += make_rectangle(cr, hei - cr, wid - 2 * cr, cr, traps + n); - return n; -} - -void render(session_t *ps, int x, int y, int dx, int dy, int wid, int hei, int fullwid, - int fullhei, double opacity, bool argb, bool neg, int cr, - xcb_render_picture_t pict, glx_texture_t *ptex, const region_t *reg_paint, - const glx_prog_main_t *pprogram, clip_t *clip) { - switch (ps->o.backend) { - case BKEND_XRENDER: - case BKEND_XR_GLX_HYBRID: { - auto alpha_step = (int)(opacity * MAX_ALPHA); - xcb_render_picture_t alpha_pict = ps->alpha_picts[alpha_step]; - if (alpha_step != 0) { - if (cr) { - xcb_render_picture_t p_tmp = x_create_picture_with_standard( - ps->c, ps->root, fullwid, fullhei, - XCB_PICT_STANDARD_ARGB_32, 0, 0); - xcb_render_color_t trans = { - .red = 0, .blue = 0, .green = 0, .alpha = 0}; - const xcb_rectangle_t rect = { - .x = 0, - .y = 0, - .width = to_u16_checked(fullwid), - .height = to_u16_checked(fullhei)}; - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_SRC, - p_tmp, trans, 1, &rect); - - uint32_t max_ntraps = to_u32_checked(cr); - xcb_render_trapezoid_t traps[4 * max_ntraps + 3]; - - uint32_t n = make_rounded_window_shape( - traps, max_ntraps, cr, fullwid, fullhei); - - xcb_render_trapezoids( - ps->c, XCB_RENDER_PICT_OP_OVER, alpha_pict, p_tmp, - x_get_pictfmt_for_standard(ps->c, XCB_PICT_STANDARD_A_8), - 0, 0, n, traps); - - xcb_render_composite( - ps->c, XCB_RENDER_PICT_OP_OVER, pict, p_tmp, - ps->tgt_buffer.pict, to_i16_checked(x), - to_i16_checked(y), to_i16_checked(x), to_i16_checked(y), - to_i16_checked(dx), to_i16_checked(dy), - to_u16_checked(wid), to_u16_checked(hei)); - - xcb_render_free_picture(ps->c, p_tmp); - - } else { - xcb_render_picture_t p_tmp = alpha_pict; - if (clip) { - p_tmp = x_create_picture_with_standard( - ps->c, ps->root, wid, hei, - XCB_PICT_STANDARD_ARGB_32, 0, 0); - - xcb_render_color_t black = { - .red = 255, .blue = 255, .green = 255, .alpha = 255}; - const xcb_rectangle_t rect = { - .x = 0, - .y = 0, - .width = to_u16_checked(wid), - .height = to_u16_checked(hei)}; - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_SRC, - p_tmp, black, 1, &rect); - if (alpha_pict) { - xcb_render_composite( - ps->c, XCB_RENDER_PICT_OP_SRC, - alpha_pict, XCB_NONE, p_tmp, 0, 0, 0, - 0, 0, 0, to_u16_checked(wid), - to_u16_checked(hei)); - } - xcb_render_composite( - ps->c, XCB_RENDER_PICT_OP_OUT_REVERSE, - clip->pict, XCB_NONE, p_tmp, 0, 0, 0, 0, - to_i16_checked(clip->x), to_i16_checked(clip->y), - to_u16_checked(wid), to_u16_checked(hei)); - } - uint8_t op = ((!argb && !alpha_pict && !clip) - ? XCB_RENDER_PICT_OP_SRC - : XCB_RENDER_PICT_OP_OVER); - - xcb_render_composite( - ps->c, op, pict, p_tmp, ps->tgt_buffer.pict, - to_i16_checked(x), to_i16_checked(y), 0, 0, - to_i16_checked(dx), to_i16_checked(dy), - to_u16_checked(wid), to_u16_checked(hei)); - if (clip) { - xcb_render_free_picture(ps->c, p_tmp); - } - } - } - break; - } -#ifdef CONFIG_OPENGL - case BKEND_GLX: - glx_render(ps, ptex, x, y, dx, dy, wid, hei, ps->psglx->z, opacity, argb, - neg, reg_paint, pprogram); - ps->psglx->z += 1; - break; -#endif - default: assert(0); - } -#ifndef CONFIG_OPENGL - (void)neg; - (void)ptex; - (void)reg_paint; - (void)pprogram; -#endif -} - -static inline void -paint_region(session_t *ps, const struct managed_win *w, int x, int y, int wid, int hei, - double opacity, const region_t *reg_paint, xcb_render_picture_t pict) { - const int dx = (w ? w->g.x : 0) + x; - const int dy = (w ? w->g.y : 0) + y; - const int fullwid = w ? w->widthb : 0; - const int fullhei = w ? w->heightb : 0; - const bool argb = (w && (win_has_alpha(w) || ps->o.force_win_blend)); - const bool neg = (w && w->invert_color); - - render(ps, x, y, dx, dy, wid, hei, fullwid, fullhei, opacity, argb, neg, - w ? w->corner_radius : 0, pict, - (w ? w->paint.ptex : ps->root_tile_paint.ptex), reg_paint, -#ifdef CONFIG_OPENGL - w ? &ps->glx_prog_win : NULL -#else - NULL -#endif - , - XCB_NONE); -} - -/** - * Check whether a paint_t contains enough data. - */ -static inline bool paint_isvalid(session_t *ps, const paint_t *ppaint) { - // Don't check for presence of Pixmap here, because older X Composite doesn't - // provide it - if (!ppaint) - return false; - - if (bkend_use_xrender(ps) && !ppaint->pict) - return false; - -#ifdef CONFIG_OPENGL - if (BKEND_GLX == ps->o.backend && !glx_tex_binded(ppaint->ptex, XCB_NONE)) - return false; -#endif - - return true; -} - -/** - * Paint a window itself and dim it if asked. - */ -void paint_one(session_t *ps, struct managed_win *w, const region_t *reg_paint) { - // Fetch Pixmap - if (!w->paint.pixmap) { - w->paint.pixmap = x_new_id(ps->c); - set_ignore_cookie(ps, xcb_composite_name_window_pixmap(ps->c, w->base.id, - w->paint.pixmap)); - } - - xcb_drawable_t draw = w->paint.pixmap; - if (!draw) { - log_error("Failed to get pixmap from window %#010x (%s), window won't be " - "visible", - w->base.id, w->name); - return; - } - - // XRender: Build picture - if (bkend_use_xrender(ps) && !w->paint.pict) { - xcb_render_create_picture_value_list_t pa = { - .subwindowmode = XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS, - }; - - w->paint.pict = x_create_picture_with_pictfmt_and_pixmap( - ps->c, w->pictfmt, draw, XCB_RENDER_CP_SUBWINDOW_MODE, &pa); - } - - // GLX: Build texture - // Let glx_bind_pixmap() determine pixmap size, because if the user - // is resizing windows, the width and height we get may not be up-to-date, - // causing the jittering issue M4he reported in #7. - if (!paint_bind_tex(ps, &w->paint, 0, 0, false, 0, w->a.visual, - (!ps->o.glx_no_rebind_pixmap && w->pixmap_damaged))) { - log_error("Failed to bind texture for window %#010x.", w->base.id); - } - w->pixmap_damaged = false; - - if (!paint_isvalid(ps, &w->paint)) { - log_error("Window %#010x is missing painting data.", w->base.id); - return; - } - - const int x = w->g.x; - const int y = w->g.y; - const uint16_t wid = to_u16_checked(w->widthb); - const uint16_t hei = to_u16_checked(w->heightb); - - xcb_render_picture_t pict = w->paint.pict; - - // Invert window color, if required - if (bkend_use_xrender(ps) && w->invert_color) { - xcb_render_picture_t newpict = x_create_picture_with_pictfmt( - ps->c, ps->root, wid, hei, w->pictfmt, 0, NULL); - if (newpict) { - // Apply clipping region to save some CPU - if (reg_paint) { - region_t reg; - pixman_region32_init(®); - pixman_region32_copy(®, (region_t *)reg_paint); - pixman_region32_translate(®, -x, -y); - // FIXME XFixesSetPictureClipRegion(ps->dpy, newpict, 0, - // 0, reg); - pixman_region32_fini(®); - } - - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, pict, XCB_NONE, - newpict, 0, 0, 0, 0, 0, 0, wid, hei); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_DIFFERENCE, - ps->white_picture, XCB_NONE, newpict, 0, 0, - 0, 0, 0, 0, wid, hei); - // We use an extra PictOpInReverse operation to get correct - // pixel alpha. There could be a better solution. - if (win_has_alpha(w)) - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_IN_REVERSE, - pict, XCB_NONE, newpict, 0, 0, 0, 0, - 0, 0, wid, hei); - pict = newpict; - } - } - - if (w->frame_opacity == 1) { - paint_region(ps, w, 0, 0, wid, hei, w->opacity, reg_paint, pict); - } else { - // Painting parameters - const margin_t extents = win_calc_frame_extents(w); - const auto t = extents.top; - const auto l = extents.left; - const auto b = extents.bottom; - const auto r = extents.right; - -#define COMP_BDR(cx, cy, cwid, chei) \ - paint_region(ps, w, (cx), (cy), (cwid), (chei), w->frame_opacity * w->opacity, \ - reg_paint, pict) - - // Sanitize the margins, in case some broken WM makes - // top_width + bottom_width > height in some cases. - - do { - // top - int body_height = hei; - // ctop = checked top - // Make sure top margin is smaller than height - int ctop = min2(body_height, t); - if (ctop > 0) - COMP_BDR(0, 0, wid, ctop); - - body_height -= ctop; - if (body_height <= 0) - break; - - // bottom - // cbot = checked bottom - // Make sure bottom margin is not too large - int cbot = min2(body_height, b); - if (cbot > 0) - COMP_BDR(0, hei - cbot, wid, cbot); - - // Height of window exclude the margin - body_height -= cbot; - if (body_height <= 0) - break; - - // left - int body_width = wid; - int cleft = min2(body_width, l); - if (cleft > 0) - COMP_BDR(0, ctop, cleft, body_height); - - body_width -= cleft; - if (body_width <= 0) - break; - - // right - int cright = min2(body_width, r); - if (cright > 0) - COMP_BDR(wid - cright, ctop, cright, body_height); - - body_width -= cright; - if (body_width <= 0) - break; - - // body - paint_region(ps, w, cleft, ctop, body_width, body_height, - w->opacity, reg_paint, pict); - } while (0); - } - -#undef COMP_BDR - - if (pict != w->paint.pict) - free_picture(ps->c, &pict); - - // Dimming the window if needed - if (w->dim) { - double dim_opacity = ps->o.inactive_dim; - if (!ps->o.inactive_dim_fixed) - dim_opacity *= w->opacity; - - switch (ps->o.backend) { - case BKEND_XRENDER: - case BKEND_XR_GLX_HYBRID: { - auto cval = (uint16_t)(0xffff * dim_opacity); - - // Premultiply color - xcb_render_color_t color = { - .red = 0, - .green = 0, - .blue = 0, - .alpha = cval, - }; - - xcb_rectangle_t rect = { - .x = to_i16_checked(x), - .y = to_i16_checked(y), - .width = wid, - .height = hei, - }; - - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_OVER, - ps->tgt_buffer.pict, color, 1, &rect); - } break; -#ifdef CONFIG_OPENGL - case BKEND_GLX: - glx_dim_dst(ps, x, y, wid, hei, (int)(ps->psglx->z - 0.7), - (float)dim_opacity, reg_paint); - break; -#endif - default: assert(false); - } - } -} - -extern const char *background_props_str[]; - -static bool get_root_tile(session_t *ps) { - /* - if (ps->o.paint_on_overlay) { - return ps->root_picture; - } */ - - assert(!ps->root_tile_paint.pixmap); - ps->root_tile_fill = false; - - bool fill = false; - xcb_pixmap_t pixmap = x_get_root_back_pixmap(ps->c, ps->root, ps->atoms); - - // Make sure the pixmap we got is valid - if (pixmap && !x_validate_pixmap(ps->c, pixmap)) - pixmap = XCB_NONE; - - // Create a pixmap if there isn't any - if (!pixmap) { - pixmap = x_create_pixmap(ps->c, (uint8_t)ps->depth, ps->root, 1, 1); - if (pixmap == XCB_NONE) { - log_error("Failed to create pixmaps for root tile."); - return false; - } - fill = true; - } - - // Create Picture - xcb_render_create_picture_value_list_t pa = { - .repeat = true, - }; - ps->root_tile_paint.pict = x_create_picture_with_visual_and_pixmap( - ps->c, ps->vis, pixmap, XCB_RENDER_CP_REPEAT, &pa); - - // Fill pixmap if needed - if (fill) { - xcb_render_color_t col; - xcb_rectangle_t rect; - - col.red = col.green = col.blue = 0x8080; - col.alpha = 0xffff; - - rect.x = rect.y = 0; - rect.width = rect.height = 1; - - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_SRC, - ps->root_tile_paint.pict, col, 1, &rect); - } - - ps->root_tile_fill = fill; - ps->root_tile_paint.pixmap = pixmap; -#ifdef CONFIG_OPENGL - if (BKEND_GLX == ps->o.backend) - return paint_bind_tex(ps, &ps->root_tile_paint, 0, 0, true, 0, ps->vis, false); -#endif - - return true; -} - -/** - * Paint root window content. - */ -static void paint_root(session_t *ps, const region_t *reg_paint) { - // If there is no root tile pixmap, try getting one. - // If that fails, give up. - if (!ps->root_tile_paint.pixmap && !get_root_tile(ps)) - return; - - paint_region(ps, NULL, 0, 0, ps->root_width, ps->root_height, 1.0, reg_paint, - ps->root_tile_paint.pict); -} - -/** - * Generate shadow Picture for a window. - */ -static bool win_build_shadow(session_t *ps, struct managed_win *w, double opacity) { - const int width = w->widthb; - const int height = w->heightb; - // log_trace("(): building shadow for %s %d %d", w->name, width, height); - - xcb_image_t *shadow_image = NULL; - xcb_pixmap_t shadow_pixmap = XCB_NONE, shadow_pixmap_argb = XCB_NONE; - xcb_render_picture_t shadow_picture = XCB_NONE, shadow_picture_argb = XCB_NONE; - xcb_gcontext_t gc = XCB_NONE; - - shadow_image = make_shadow(ps->c, ps->gaussian_map, opacity, width, height); - if (!shadow_image) { - log_error("failed to make shadow"); - return XCB_NONE; - } - - shadow_pixmap = - x_create_pixmap(ps->c, 8, ps->root, shadow_image->width, shadow_image->height); - shadow_pixmap_argb = - x_create_pixmap(ps->c, 32, ps->root, shadow_image->width, shadow_image->height); - - if (!shadow_pixmap || !shadow_pixmap_argb) { - log_error("failed to create shadow pixmaps"); - goto shadow_picture_err; - } - - shadow_picture = x_create_picture_with_standard_and_pixmap( - ps->c, XCB_PICT_STANDARD_A_8, shadow_pixmap, 0, NULL); - shadow_picture_argb = x_create_picture_with_standard_and_pixmap( - ps->c, XCB_PICT_STANDARD_ARGB_32, shadow_pixmap_argb, 0, NULL); - if (!shadow_picture || !shadow_picture_argb) - goto shadow_picture_err; - - gc = x_new_id(ps->c); - xcb_create_gc(ps->c, gc, shadow_pixmap, 0, NULL); - - xcb_image_put(ps->c, shadow_pixmap, gc, shadow_image, 0, 0, 0); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, ps->cshadow_picture, - shadow_picture, shadow_picture_argb, 0, 0, 0, 0, 0, 0, - shadow_image->width, shadow_image->height); - - assert(!w->shadow_paint.pixmap); - w->shadow_paint.pixmap = shadow_pixmap_argb; - assert(!w->shadow_paint.pict); - w->shadow_paint.pict = shadow_picture_argb; - - xcb_free_gc(ps->c, gc); - xcb_image_destroy(shadow_image); - xcb_free_pixmap(ps->c, shadow_pixmap); - xcb_render_free_picture(ps->c, shadow_picture); - - return true; - -shadow_picture_err: - if (shadow_image) - xcb_image_destroy(shadow_image); - if (shadow_pixmap) - xcb_free_pixmap(ps->c, shadow_pixmap); - if (shadow_pixmap_argb) - xcb_free_pixmap(ps->c, shadow_pixmap_argb); - if (shadow_picture) - xcb_render_free_picture(ps->c, shadow_picture); - if (shadow_picture_argb) - xcb_render_free_picture(ps->c, shadow_picture_argb); - if (gc) - xcb_free_gc(ps->c, gc); - - return false; -} - -/** - * Paint the shadow of a window. - */ -static inline void -win_paint_shadow(session_t *ps, struct managed_win *w, region_t *reg_paint) { - // Bind shadow pixmap to GLX texture if needed - paint_bind_tex(ps, &w->shadow_paint, 0, 0, false, 32, 0, false); - - if (!paint_isvalid(ps, &w->shadow_paint)) { - log_error("Window %#010x is missing shadow data.", w->base.id); - return; - } - - xcb_render_picture_t td = XCB_NONE; - bool should_clip = - (w->corner_radius > 0) && (!ps->o.wintype_option[w->window_type].full_shadow); - if (should_clip) { - if (ps->o.backend == BKEND_XRENDER || ps->o.backend == BKEND_XR_GLX_HYBRID) { - uint32_t max_ntraps = to_u32_checked(w->corner_radius); - xcb_render_trapezoid_t traps[4 * max_ntraps + 3]; - uint32_t n = make_rounded_window_shape( - traps, max_ntraps, w->corner_radius, w->widthb, w->heightb); - - td = x_create_picture_with_standard( - ps->c, ps->root, w->widthb, w->heightb, - XCB_PICT_STANDARD_ARGB_32, 0, 0); - xcb_render_color_t trans = { - .red = 0, .blue = 0, .green = 0, .alpha = 0}; - const xcb_rectangle_t rect = {.x = 0, - .y = 0, - .width = to_u16_checked(w->widthb), - .height = to_u16_checked(w->heightb)}; - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_SRC, td, - trans, 1, &rect); - - auto solid = solid_picture(ps->c, ps->root, false, 1, 0, 0, 0); - xcb_render_trapezoids( - ps->c, XCB_RENDER_PICT_OP_OVER, solid, td, - x_get_pictfmt_for_standard(ps->c, XCB_PICT_STANDARD_A_8), 0, - 0, n, traps); - xcb_render_free_picture(ps->c, solid); - } else { - // Not implemented - } - } - - clip_t clip = { - .pict = td, - .x = -(w->shadow_dx), - .y = -(w->shadow_dy), - }; - render(ps, 0, 0, w->g.x + w->shadow_dx, w->g.y + w->shadow_dy, w->shadow_width, - w->shadow_height, w->widthb, w->heightb, w->shadow_opacity, true, false, 0, - w->shadow_paint.pict, w->shadow_paint.ptex, reg_paint, NULL, - should_clip ? &clip : NULL); - if (td) { - xcb_render_free_picture(ps->c, td); - } -} - -/** - * @brief Blur an area on a buffer. - * - * @param ps current session - * @param tgt_buffer a buffer as both source and destination - * @param x x pos - * @param y y pos - * @param wid width - * @param hei height - * @param blur_kerns blur kernels, ending with a NULL, guaranteed to have at - * least one kernel - * @param reg_clip a clipping region to be applied on intermediate buffers - * - * @return true if successful, false otherwise - */ -static bool -xr_blur_dst(session_t *ps, xcb_render_picture_t tgt_buffer, int16_t x, int16_t y, - uint16_t wid, uint16_t hei, struct x_convolution_kernel **blur_kerns, - int nkernels, const region_t *reg_clip, xcb_render_picture_t rounded) { - assert(blur_kerns); - assert(blur_kerns[0]); - - // Directly copying from tgt_buffer to it does not work, so we create a - // Picture in the middle. - xcb_render_picture_t tmp_picture = - x_create_picture_with_visual(ps->c, ps->root, wid, hei, ps->vis, 0, NULL); - - if (!tmp_picture) { - log_error("Failed to build intermediate Picture."); - return false; - } - - if (reg_clip && tmp_picture) - x_set_picture_clip_region(ps->c, tmp_picture, 0, 0, reg_clip); - - xcb_render_picture_t src_pict = tgt_buffer, dst_pict = tmp_picture; - for (int i = 0; i < nkernels; ++i) { - xcb_render_fixed_t *convolution_blur = blur_kerns[i]->kernel; - // `x / 65536.0` converts from X fixed point to double - int kwid = (int)((double)convolution_blur[0] / 65536.0), - khei = (int)((double)convolution_blur[1] / 65536.0); - bool rd_from_tgt = (tgt_buffer == src_pict); - - // Copy from source picture to destination. The filter must - // be applied on source picture, to get the nearby pixels outside the - // window. - xcb_render_set_picture_filter( - ps->c, src_pict, strlen(XRFILTER_CONVOLUTION), XRFILTER_CONVOLUTION, - (uint32_t)(kwid * khei + 2), convolution_blur); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, src_pict, XCB_NONE, - dst_pict, (rd_from_tgt ? x : 0), - (rd_from_tgt ? y : 0), 0, 0, (rd_from_tgt ? 0 : x), - (rd_from_tgt ? 0 : y), wid, hei); - xrfilter_reset(ps, src_pict); - - { - xcb_render_picture_t tmp = src_pict; - src_pict = dst_pict; - dst_pict = tmp; - } - } - - if (src_pict != tgt_buffer) - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_OVER, src_pict, rounded, - tgt_buffer, 0, 0, 0, 0, x, y, wid, hei); - - free_picture(ps->c, &tmp_picture); - - return true; -} - -/** - * Blur the background of a window. - */ -static inline void -win_blur_background(session_t *ps, struct managed_win *w, xcb_render_picture_t tgt_buffer, - const region_t *reg_paint) { - const int16_t x = w->g.x; - const int16_t y = w->g.y; - const auto wid = to_u16_checked(w->widthb); - const auto hei = to_u16_checked(w->heightb); - const int cr = w ? w->corner_radius : 0; - - double factor_center = 1.0; - // Adjust blur strength according to window opacity, to make it appear - // better during fading - if (!ps->o.blur_background_fixed) { - double pct = 1.0 - w->opacity * (1.0 - 1.0 / 9.0); - factor_center = pct * 8.0 / (1.1 - pct); - } - - switch (ps->o.backend) { - case BKEND_XRENDER: - case BKEND_XR_GLX_HYBRID: { - // Normalize blur kernels - for (int i = 0; i < ps->o.blur_kernel_count; i++) { - // Note: `x * 65536` converts double `x` to a X fixed point - // representation. `x / 65536` is the other way. - auto kern_src = ps->o.blur_kerns[i]; - auto kern_dst = ps->blur_kerns_cache[i]; - - assert(!kern_dst || (kern_src->w == kern_dst->kernel[0] / 65536 && - kern_src->h == kern_dst->kernel[1] / 65536)); - - // Skip for fixed factor_center if the cache exists already - if (ps->o.blur_background_fixed && kern_dst) { - continue; - } - - x_create_convolution_kernel(kern_src, factor_center, - &ps->blur_kerns_cache[i]); - } - - xcb_render_picture_t td = XCB_NONE; - if (cr) { - uint32_t max_ntraps = to_u32_checked(cr); - xcb_render_trapezoid_t traps[4 * max_ntraps + 3]; - uint32_t n = - make_rounded_window_shape(traps, max_ntraps, cr, wid, hei); - - td = x_create_picture_with_standard( - ps->c, ps->root, wid, hei, XCB_PICT_STANDARD_ARGB_32, 0, 0); - xcb_render_color_t trans = { - .red = 0, .blue = 0, .green = 0, .alpha = 0}; - const xcb_rectangle_t rect = {.x = 0, - .y = 0, - .width = to_u16_checked(wid), - .height = to_u16_checked(hei)}; - xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_SRC, td, - trans, 1, &rect); - - auto solid = solid_picture(ps->c, ps->root, false, 1, 0, 0, 0); - - xcb_render_trapezoids( - ps->c, XCB_RENDER_PICT_OP_OVER, solid, td, - x_get_pictfmt_for_standard(ps->c, XCB_PICT_STANDARD_A_8), 0, - 0, n, traps); - xcb_render_free_picture(ps->c, solid); - } - - // Minimize the region we try to blur, if the window itself is not - // opaque, only the frame is. - region_t reg_blur = win_get_bounding_shape_global_by_val(w); - if (w->mode == WMODE_FRAME_TRANS && !ps->o.force_win_blend) { - region_t reg_noframe; - pixman_region32_init(®_noframe); - win_get_region_noframe_local(w, ®_noframe); - pixman_region32_translate(®_noframe, w->g.x, w->g.y); - pixman_region32_subtract(®_blur, ®_blur, ®_noframe); - pixman_region32_fini(®_noframe); - } - - // Translate global coordinates to local ones - pixman_region32_translate(®_blur, -x, -y); - xr_blur_dst(ps, tgt_buffer, x, y, wid, hei, ps->blur_kerns_cache, - ps->o.blur_kernel_count, ®_blur, td); - if (td) { - xcb_render_free_picture(ps->c, td); - } - pixman_region32_clear(®_blur); - } break; -#ifdef CONFIG_OPENGL - case BKEND_GLX: - // TODO(compton) Handle frame opacity - glx_blur_dst(ps, x, y, wid, hei, (float)ps->psglx->z - 0.5f, - (float)factor_center, reg_paint, &w->glx_blur_cache); - break; -#endif - default: assert(0); - } -#ifndef CONFIG_OPENGL - (void)reg_paint; -#endif -} - -/// paint all windows -/// region = ?? -/// region_real = the damage region -void paint_all(session_t *ps, struct managed_win *t, bool ignore_damage) { - if (ps->o.xrender_sync_fence || (ps->drivers & DRIVER_NVIDIA)) { - if (ps->xsync_exists && !x_fence_sync(ps->c, ps->sync_fence)) { - log_error("x_fence_sync failed, xrender-sync-fence will be " - "disabled from now on."); - xcb_sync_destroy_fence(ps->c, ps->sync_fence); - ps->sync_fence = XCB_NONE; - ps->o.xrender_sync_fence = false; - ps->xsync_exists = false; - } - } - - region_t region; - pixman_region32_init(®ion); - int buffer_age = get_buffer_age(ps); - if (buffer_age == -1 || buffer_age > ps->ndamage || ignore_damage) { - pixman_region32_copy(®ion, &ps->screen_reg); - } else { - for (int i = 0; i < get_buffer_age(ps); i++) { - auto curr = ((ps->damage - ps->damage_ring) + i) % ps->ndamage; - pixman_region32_union(®ion, ®ion, &ps->damage_ring[curr]); - } - } - - if (!pixman_region32_not_empty(®ion)) { - return; - } - -#ifdef DEBUG_REPAINT - static struct timespec last_paint = {0}; -#endif - - if (ps->o.resize_damage > 0) { - resize_region_in_place(®ion, ps->o.resize_damage, ps->o.resize_damage); - } - - // Remove the damaged area out of screen - pixman_region32_intersect(®ion, ®ion, &ps->screen_reg); - - if (!paint_isvalid(ps, &ps->tgt_buffer)) { - if (!ps->tgt_buffer.pixmap) { - free_paint(ps, &ps->tgt_buffer); - ps->tgt_buffer.pixmap = - x_create_pixmap(ps->c, (uint8_t)ps->depth, ps->root, - ps->root_width, ps->root_height); - if (ps->tgt_buffer.pixmap == XCB_NONE) { - log_fatal("Failed to allocate a screen-sized pixmap for" - "painting"); - exit(1); - } - } - - if (BKEND_GLX != ps->o.backend) - ps->tgt_buffer.pict = x_create_picture_with_visual_and_pixmap( - ps->c, ps->vis, ps->tgt_buffer.pixmap, 0, 0); - } - - if (BKEND_XRENDER == ps->o.backend) { - x_set_picture_clip_region(ps->c, ps->tgt_picture, 0, 0, ®ion); - } - -#ifdef CONFIG_OPENGL - if (bkend_use_glx(ps)) { - ps->psglx->z = 0.0; - } -#endif - - region_t reg_tmp, *reg_paint; - pixman_region32_init(®_tmp); - if (t) { - // Calculate the region upon which the root window is to be - // painted based on the ignore region of the lowest window, if - // available - pixman_region32_subtract(®_tmp, ®ion, t->reg_ignore); - reg_paint = ®_tmp; - } else { - reg_paint = ®ion; - } - - // Region on screen we don't want any shadows on - region_t reg_shadow_clip; - pixman_region32_init(®_shadow_clip); - - set_tgt_clip(ps, reg_paint); - paint_root(ps, reg_paint); - - // Windows are sorted from bottom to top - // Each window has a reg_ignore, which is the region obscured by all the - // windows on top of that window. This is used to reduce the number of - // pixels painted. - // - // Whether this is beneficial is to be determined XXX - for (auto w = t; w; w = w->prev_trans) { - region_t bshape_no_corners = - win_get_bounding_shape_global_without_corners_by_val(w); - region_t bshape_corners = win_get_bounding_shape_global_by_val(w); - // Painting shadow - if (w->shadow) { - // Lazy shadow building - if (!w->shadow_paint.pixmap) - if (!win_build_shadow(ps, w, 1)) - log_error("build shadow failed"); - - // Shadow doesn't need to be painted underneath the body - // of the windows above. Because no one can see it - pixman_region32_subtract(®_tmp, ®ion, w->reg_ignore); - - // Mask out the region we don't want shadow on - if (pixman_region32_not_empty(&ps->shadow_exclude_reg)) - pixman_region32_subtract(®_tmp, ®_tmp, - &ps->shadow_exclude_reg); - if (pixman_region32_not_empty(®_shadow_clip)) { - pixman_region32_subtract(®_tmp, ®_tmp, ®_shadow_clip); - } - - // Might be worth while to crop the region to shadow - // border - assert(w->shadow_width >= 0 && w->shadow_height >= 0); - pixman_region32_intersect_rect( - ®_tmp, ®_tmp, w->g.x + w->shadow_dx, w->g.y + w->shadow_dy, - (uint)w->shadow_width, (uint)w->shadow_height); - - // Mask out the body of the window from the shadow if - // needed Doing it here instead of in make_shadow() for - // saving GPU power and handling shaped windows (XXX - // unconfirmed) - if (!ps->o.wintype_option[w->window_type].full_shadow) - pixman_region32_subtract(®_tmp, ®_tmp, &bshape_no_corners); - - if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 && - w->xinerama_scr < ps->xinerama_nscrs) - // There can be a window where number of screens - // is updated, but the screen number attached to - // the windows have not. - // - // Window screen number will be updated - // eventually, so here we just check to make sure - // we don't access out of bounds. - pixman_region32_intersect( - ®_tmp, ®_tmp, - &ps->xinerama_scr_regs[w->xinerama_scr]); - - // Detect if the region is empty before painting - if (pixman_region32_not_empty(®_tmp)) { - set_tgt_clip(ps, ®_tmp); - win_paint_shadow(ps, w, ®_tmp); - } - } - - // Only clip shadows above visible windows - if (w->opacity * MAX_ALPHA >= 1) { - if (w->clip_shadow_above) { - // Add window bounds to shadow-clip region - pixman_region32_union(®_shadow_clip, ®_shadow_clip, - &bshape_corners); - } else { - // Remove overlapping window bounds from shadow-clip - // region - pixman_region32_subtract( - ®_shadow_clip, ®_shadow_clip, &bshape_corners); - } - } - - // Calculate the paint region based on the reg_ignore of the current - // window and its bounding region. - // Remember, reg_ignore is the union of all windows above the current - // window. - pixman_region32_subtract(®_tmp, ®ion, w->reg_ignore); - pixman_region32_intersect(®_tmp, ®_tmp, &bshape_corners); - pixman_region32_fini(&bshape_corners); - pixman_region32_fini(&bshape_no_corners); - - if (pixman_region32_not_empty(®_tmp)) { - set_tgt_clip(ps, ®_tmp); - -#ifdef CONFIG_OPENGL - // If rounded corners backup the region first - if (w->corner_radius > 0 && ps->o.backend == BKEND_GLX) { - const int16_t x = w->g.x; - const int16_t y = w->g.y; - const auto wid = to_u16_checked(w->widthb); - const auto hei = to_u16_checked(w->heightb); - glx_bind_texture(ps, &w->glx_texture_bg, x, y, wid, hei); - } -#endif - - // Blur window background - if (w->blur_background && - (w->mode == WMODE_TRANS || - (ps->o.blur_background_frame && w->mode == WMODE_FRAME_TRANS) || - ps->o.force_win_blend)) { - win_blur_background(ps, w, ps->tgt_buffer.pict, ®_tmp); - } - - // Painting the window - paint_one(ps, w, ®_tmp); - -#ifdef CONFIG_OPENGL - // Rounded corners for XRender is implemented inside render() - // Round window corners - if (w->corner_radius > 0 && ps->o.backend == BKEND_GLX) { - const auto wid = to_u16_checked(w->widthb); - const auto hei = to_u16_checked(w->heightb); - glx_round_corners_dst(ps, w, w->glx_texture_bg, w->g.x, - w->g.y, wid, hei, - (float)ps->psglx->z - 0.5F, - (float)w->corner_radius, ®_tmp); - } -#endif - } - } - - // Free up all temporary regions - pixman_region32_fini(®_tmp); - pixman_region32_fini(®_shadow_clip); - - // Move the head of the damage ring - ps->damage = ps->damage - 1; - if (ps->damage < ps->damage_ring) { - ps->damage = ps->damage_ring + ps->ndamage - 1; - } - pixman_region32_clear(ps->damage); - - // Do this as early as possible - set_tgt_clip(ps, &ps->screen_reg); - - if (ps->o.vsync) { - // Make sure all previous requests are processed to achieve best - // effect - x_sync(ps->c); -#ifdef CONFIG_OPENGL - if (glx_has_context(ps)) { - if (ps->o.vsync_use_glfinish) - glFinish(); - else - glFlush(); - glXWaitX(); - } -#endif - } - - if (ps->vsync_wait) { - ps->vsync_wait(ps); - } - - auto rwidth = to_u16_checked(ps->root_width); - auto rheight = to_u16_checked(ps->root_height); - switch (ps->o.backend) { - case BKEND_XRENDER: - if (ps->o.monitor_repaint) { - // Copy the screen content to a new picture, and highlight the - // paint region. This is not very efficient, but since it's for - // debug only, we don't really care - - // First we create a new picture, and copy content from the buffer - // to it - auto pictfmt = x_get_pictform_for_visual(ps->c, ps->vis); - xcb_render_picture_t new_pict = x_create_picture_with_pictfmt( - ps->c, ps->root, rwidth, rheight, pictfmt, 0, NULL); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, - ps->tgt_buffer.pict, XCB_NONE, new_pict, 0, - 0, 0, 0, 0, 0, rwidth, rheight); - - // Next, we set the region of paint and highlight it - x_set_picture_clip_region(ps->c, new_pict, 0, 0, ®ion); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_OVER, ps->white_picture, - ps->alpha_picts[MAX_ALPHA / 2], new_pict, 0, - 0, 0, 0, 0, 0, rwidth, rheight); - - // Finally, clear clip regions of new_pict and the screen, and put - // the whole thing on screen - x_set_picture_clip_region(ps->c, new_pict, 0, 0, &ps->screen_reg); - x_set_picture_clip_region(ps->c, ps->tgt_picture, 0, 0, &ps->screen_reg); - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, new_pict, - XCB_NONE, ps->tgt_picture, 0, 0, 0, 0, 0, 0, - rwidth, rheight); - xcb_render_free_picture(ps->c, new_pict); - } else - xcb_render_composite(ps->c, XCB_RENDER_PICT_OP_SRC, - ps->tgt_buffer.pict, XCB_NONE, ps->tgt_picture, - 0, 0, 0, 0, 0, 0, rwidth, rheight); - break; -#ifdef CONFIG_OPENGL - case BKEND_XR_GLX_HYBRID: - x_sync(ps->c); - if (ps->o.vsync_use_glfinish) - glFinish(); - else - glFlush(); - glXWaitX(); - assert(ps->tgt_buffer.pixmap); - paint_bind_tex(ps, &ps->tgt_buffer, ps->root_width, ps->root_height, - false, ps->depth, ps->vis, !ps->o.glx_no_rebind_pixmap); - if (ps->o.vsync_use_glfinish) - glFinish(); - else - glFlush(); - glXWaitX(); - glx_render(ps, ps->tgt_buffer.ptex, 0, 0, 0, 0, ps->root_width, - ps->root_height, 0, 1.0, false, false, ®ion, NULL); - fallthrough(); - case BKEND_GLX: glXSwapBuffers(ps->dpy, get_tgt_window(ps)); break; -#endif - default: assert(0); - } - - x_sync(ps->c); - -#ifdef CONFIG_OPENGL - if (glx_has_context(ps)) { - glFlush(); - glXWaitX(); - } -#endif - -#ifdef DEBUG_REPAINT - struct timespec now = get_time_timespec(); - struct timespec diff = {0}; - timespec_subtract(&diff, &now, &last_paint); - log_trace("[ %5ld:%09ld ] ", diff.tv_sec, diff.tv_nsec); - last_paint = now; - log_trace("paint:"); - for (win *w = t; w; w = w->prev_trans) - log_trace(" %#010lx", w->id); -#endif - - // Free the paint region - pixman_region32_fini(®ion); -} - -/** - * Query needed X Render / OpenGL filters to check for their existence. - */ -static bool xr_init_blur(session_t *ps) { - // Query filters - xcb_render_query_filters_reply_t *pf = xcb_render_query_filters_reply( - ps->c, xcb_render_query_filters(ps->c, get_tgt_window(ps)), NULL); - if (pf) { - xcb_str_iterator_t iter = xcb_render_query_filters_filters_iterator(pf); - for (; iter.rem; xcb_str_next(&iter)) { - int len = xcb_str_name_length(iter.data); - char *name = xcb_str_name(iter.data); - // Check for the convolution filter - if (strlen(XRFILTER_CONVOLUTION) == len && - !memcmp(XRFILTER_CONVOLUTION, name, strlen(XRFILTER_CONVOLUTION))) - ps->xrfilter_convolution_exists = true; - } - free(pf); - } - - // Turn features off if any required filter is not present - if (!ps->xrfilter_convolution_exists) { - log_error("Xrender convolution filter " - "unsupported by your X server. " - "Background blur is not possible."); - return false; - } - - return true; -} - -/** - * Pregenerate alpha pictures. - */ -static bool init_alpha_picts(session_t *ps) { - ps->alpha_picts = ccalloc(MAX_ALPHA + 1, xcb_render_picture_t); - - for (int i = 0; i <= MAX_ALPHA; ++i) { - double o = (double)i / MAX_ALPHA; - ps->alpha_picts[i] = solid_picture(ps->c, ps->root, false, o, 0, 0, 0); - if (ps->alpha_picts[i] == XCB_NONE) - return false; - } - return true; -} - -bool init_render(session_t *ps) { - if (ps->o.backend == BKEND_DUMMY) { - return false; - } - - // Initialize OpenGL as early as possible -#ifdef CONFIG_OPENGL - glxext_init(ps->dpy, ps->scr); -#endif - if (bkend_use_glx(ps)) { -#ifdef CONFIG_OPENGL - if (!glx_init(ps, true)) - return false; -#else - log_error("GLX backend support not compiled in."); - return false; -#endif - } - - // Initialize VSync - if (!vsync_init(ps)) { - return false; - } - - // Initialize window GL shader - if (BKEND_GLX == ps->o.backend && ps->o.glx_fshader_win_str) { -#ifdef CONFIG_OPENGL - if (!glx_load_prog_main(NULL, ps->o.glx_fshader_win_str, &ps->glx_prog_win)) - return false; -#else - log_error("GLSL supported not compiled in, can't load " - "shader."); - return false; -#endif - } - - if (!init_alpha_picts(ps)) { - log_error("Failed to init alpha pictures."); - return false; - } - - // Blur filter - if (ps->o.blur_method && ps->o.blur_method != BLUR_METHOD_KERNEL) { - log_warn("Old backends only support blur method \"kernel\". Your blur " - "setting will not be applied"); - ps->o.blur_method = BLUR_METHOD_NONE; - } - - if (ps->o.blur_method == BLUR_METHOD_KERNEL) { - ps->blur_kerns_cache = - ccalloc(ps->o.blur_kernel_count, struct x_convolution_kernel *); - - bool ret = false; - if (ps->o.backend == BKEND_GLX) { -#ifdef CONFIG_OPENGL - ret = glx_init_blur(ps); -#else - assert(false); -#endif - } else { - ret = xr_init_blur(ps); - } - if (!ret) { - return ret; - } - } - - ps->black_picture = solid_picture(ps->c, ps->root, true, 1, 0, 0, 0); - ps->white_picture = solid_picture(ps->c, ps->root, true, 1, 1, 1, 1); - - if (ps->black_picture == XCB_NONE || ps->white_picture == XCB_NONE) { - log_error("Failed to create solid xrender pictures."); - return false; - } - - // Generates another Picture for shadows if the color is modified by - // user - if (ps->o.shadow_red == 0 && ps->o.shadow_green == 0 && ps->o.shadow_blue == 0) { - ps->cshadow_picture = ps->black_picture; - } else { - ps->cshadow_picture = solid_picture(ps->c, ps->root, true, 1, ps->o.shadow_red, - ps->o.shadow_green, ps->o.shadow_blue); - if (ps->cshadow_picture == XCB_NONE) { - log_error("Failed to create shadow picture."); - return false; - } - } - - // Initialize our rounded corners fragment shader - if (ps->o.corner_radius > 0 && ps->o.backend == BKEND_GLX) { -#ifdef CONFIG_OPENGL - if (!glx_init_rounded_corners(ps)) { - log_error("Failed to init rounded corners shader."); - return false; - } -#else - assert(false); -#endif - } - return true; -} - -/** - * Free root tile related things. - */ -void free_root_tile(session_t *ps) { - free_picture(ps->c, &ps->root_tile_paint.pict); -#ifdef CONFIG_OPENGL - free_texture(ps, &ps->root_tile_paint.ptex); -#else - assert(!ps->root_tile_paint.ptex); -#endif - if (ps->root_tile_fill) { - xcb_free_pixmap(ps->c, ps->root_tile_paint.pixmap); - ps->root_tile_paint.pixmap = XCB_NONE; - } - ps->root_tile_paint.pixmap = XCB_NONE; - ps->root_tile_fill = false; -} - -void deinit_render(session_t *ps) { - // Free alpha_picts - for (int i = 0; i <= MAX_ALPHA; ++i) - free_picture(ps->c, &ps->alpha_picts[i]); - free(ps->alpha_picts); - ps->alpha_picts = NULL; - - // Free cshadow_picture and black_picture - if (ps->cshadow_picture == ps->black_picture) - ps->cshadow_picture = XCB_NONE; - else - free_picture(ps->c, &ps->cshadow_picture); - - free_picture(ps->c, &ps->black_picture); - free_picture(ps->c, &ps->white_picture); - - // Free other X resources - free_root_tile(ps); - -#ifdef CONFIG_OPENGL - free(ps->root_tile_paint.fbcfg); - if (bkend_use_glx(ps)) { - glx_destroy(ps); - } -#endif - - if (ps->o.blur_method != BLUR_METHOD_NONE) { - for (int i = 0; i < ps->o.blur_kernel_count; i++) { - free(ps->blur_kerns_cache[i]); - } - free(ps->blur_kerns_cache); - } -} - -// vim: set ts=8 sw=8 noet : diff --git a/dwm/picom/src/render.h b/dwm/picom/src/render.h deleted file mode 100644 index 95a46db..0000000 --- a/dwm/picom/src/render.h +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once - -#include -#include -#include -#ifdef CONFIG_OPENGL -#include "backend/gl/glx.h" -#endif -#include "region.h" - -typedef struct _glx_texture glx_texture_t; -typedef struct glx_prog_main glx_prog_main_t; -typedef struct session session_t; - -struct managed_win; - -typedef struct paint { - xcb_pixmap_t pixmap; - xcb_render_picture_t pict; - glx_texture_t *ptex; -#ifdef CONFIG_OPENGL - struct glx_fbconfig_info *fbcfg; -#endif -} paint_t; - -typedef struct clip { - xcb_render_picture_t pict; - int x; - int y; -} clip_t; - -void render(session_t *ps, int x, int y, int dx, int dy, int w, int h, int fullw, - int fullh, double opacity, bool argb, bool neg, int cr, - xcb_render_picture_t pict, glx_texture_t *ptex, const region_t *reg_paint, - const glx_prog_main_t *pprogram, clip_t *clip); -void paint_one(session_t *ps, struct managed_win *w, const region_t *reg_paint); - -void paint_all(session_t *ps, struct managed_win *const t, bool ignore_damage); - -void free_picture(xcb_connection_t *c, xcb_render_picture_t *p); - -void free_paint(session_t *ps, paint_t *ppaint); -void free_root_tile(session_t *ps); - -bool init_render(session_t *ps); -void deinit_render(session_t *ps); - -int maximum_buffer_age(session_t *); diff --git a/dwm/picom/src/string_utils.c b/dwm/picom/src/string_utils.c deleted file mode 100644 index 65af0f2..0000000 --- a/dwm/picom/src/string_utils.c +++ /dev/null @@ -1,129 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -#include - -#include - -#include "compiler.h" -#include "string_utils.h" -#include "utils.h" - -#pragma GCC diagnostic push - -// gcc warns about legitimate strncpy in mstrjoin and mstrextend -// strncpy(str, src1, len1) intentional truncates the null byte from src1. -// strncpy(str+len1, src2, len2) uses bound depends on the source argument, -// but str is allocated with len1+len2+1, so this strncpy can't overflow -#pragma GCC diagnostic ignored "-Wpragmas" -#pragma GCC diagnostic ignored "-Wstringop-truncation" -#pragma GCC diagnostic ignored "-Wstringop-overflow" - -/** - * Allocate the space and join two strings. - */ -char *mstrjoin(const char *src1, const char *src2) { - auto len1 = strlen(src1); - auto len2 = strlen(src2); - auto len = len1 + len2 + 1; - auto str = ccalloc(len, char); - - strncpy(str, src1, len1); - strncpy(str + len1, src2, len2); - str[len - 1] = '\0'; - - return str; -} - -TEST_CASE(mstrjoin) { - char *str = mstrjoin("asdf", "qwer"); - TEST_STREQUAL(str, "asdfqwer"); - free(str); - - str = mstrjoin("", "qwer"); - TEST_STREQUAL(str, "qwer"); - free(str); - - str = mstrjoin("asdf", ""); - TEST_STREQUAL(str, "asdf"); - free(str); -} - -/** - * Concatenate a string on heap with another string. - */ -void mstrextend(char **psrc1, const char *src2) { - if (!*psrc1) { - *psrc1 = strdup(src2); - return; - } - - auto len1 = strlen(*psrc1); - auto len2 = strlen(src2); - auto len = len1 + len2 + 1; - *psrc1 = crealloc(*psrc1, len); - - strncpy(*psrc1 + len1, src2, len2); - (*psrc1)[len - 1] = '\0'; -} - -TEST_CASE(mstrextend) { - char *str1 = NULL; - mstrextend(&str1, "asdf"); - TEST_STREQUAL(str1, "asdf"); - - mstrextend(&str1, "asd"); - TEST_STREQUAL(str1, "asdfasd"); - - mstrextend(&str1, ""); - TEST_STREQUAL(str1, "asdfasd"); - free(str1); -} - -#pragma GCC diagnostic pop - -/// Parse a floating point number of form (+|-)?[0-9]*(\.[0-9]*) -double strtod_simple(const char *src, const char **end) { - double neg = 1; - if (*src == '-') { - neg = -1; - src++; - } else if (*src == '+') { - src++; - } - - double ret = 0; - while (*src >= '0' && *src <= '9') { - ret = ret * 10 + (*src - '0'); - src++; - } - - if (*src == '.') { - double frac = 0, mult = 0.1; - src++; - while (*src >= '0' && *src <= '9') { - frac += mult * (*src - '0'); - mult *= 0.1; - src++; - } - ret += frac; - } - - *end = src; - return ret * neg; -} - -TEST_CASE(strtod_simple) { - const char *end; - double result = strtod_simple("1.0", &end); - TEST_EQUAL(result, 1); - TEST_EQUAL(*end, '\0'); - - result = strtod_simple("-1.0", &end); - TEST_EQUAL(result, -1); - TEST_EQUAL(*end, '\0'); - - result = strtod_simple("+.5", &end); - TEST_EQUAL(result, 0.5); - TEST_EQUAL(*end, '\0'); -} diff --git a/dwm/picom/src/string_utils.h b/dwm/picom/src/string_utils.h deleted file mode 100644 index 38febde..0000000 --- a/dwm/picom/src/string_utils.h +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#pragma once -#include -#include - -#include "compiler.h" - -#define mstrncmp(s1, s2) strncmp((s1), (s2), strlen(s1)) - -char *mstrjoin(const char *src1, const char *src2); -char *mstrjoin3(const char *src1, const char *src2, const char *src3); -void mstrextend(char **psrc1, const char *src2); - -/// Parse a floating point number of form (+|-)?[0-9]*(\.[0-9]*) -double strtod_simple(const char *, const char **); - -static inline int uitostr(unsigned int n, char *buf) { - int ret = 0; - unsigned int tmp = n; - while (tmp > 0) { - tmp /= 10; - ret++; - } - - if (ret == 0) - ret = 1; - - int pos = ret; - while (pos--) { - buf[pos] = (char)(n % 10 + '0'); - n /= 10; - } - return ret; -} - -static inline const char *skip_space_const(const char *src) { - if (!src) - return NULL; - while (*src && isspace((unsigned char)*src)) - src++; - return src; -} - -static inline char *skip_space_mut(char *src) { - if (!src) - return NULL; - while (*src && isspace((unsigned char)*src)) - src++; - return src; -} - -#define skip_space(x) \ - _Generic((x), char * : skip_space_mut, const char * : skip_space_const)(x) diff --git a/dwm/picom/src/types.h b/dwm/picom/src/types.h deleted file mode 100644 index c8d747b..0000000 --- a/dwm/picom/src/types.h +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui - -#pragma once - -/// Some common types - -#include - -/// Enumeration type to represent switches. -typedef enum { - OFF = 0, // false - ON, // true - UNSET -} switch_t; - -/// A structure representing margins around a rectangle. -typedef struct { - int top; - int left; - int bottom; - int right; -} margin_t; - -struct color { - double red, green, blue, alpha; -}; - -typedef uint32_t opacity_t; - -#define MARGIN_INIT \ - { 0, 0, 0, 0 } diff --git a/dwm/picom/src/uthash_extra.h b/dwm/picom/src/uthash_extra.h deleted file mode 100644 index cbc1056..0000000 --- a/dwm/picom/src/uthash_extra.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include - -#define HASH_ITER2(head, el) \ - for (__typeof__(head) el = (head), __tmp = el != NULL ? el->hh.next : NULL; \ - el != NULL; el = __tmp, __tmp = el != NULL ? el->hh.next : NULL) diff --git a/dwm/picom/src/utils.c b/dwm/picom/src/utils.c deleted file mode 100644 index 8a27f39..0000000 --- a/dwm/picom/src/utils.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include - -#include "compiler.h" -#include "string_utils.h" -#include "utils.h" - -/// Report allocation failure without allocating memory -void report_allocation_failure(const char *func, const char *file, unsigned int line) { - // Since memory allocation failed, we try to print this error message without any - // memory allocation. Since logging framework allocates memory (and might even - // have not been initialized yet), so we can't use it. - char buf[11]; - int llen = uitostr(line, buf); - const char msg1[] = " has failed to allocate memory, "; - const char msg2[] = ". Aborting...\n"; - const struct iovec v[] = { - {.iov_base = (void *)func, .iov_len = strlen(func)}, - {.iov_base = "()", .iov_len = 2}, - {.iov_base = (void *)msg1, .iov_len = sizeof(msg1) - 1}, - {.iov_base = "at ", .iov_len = 3}, - {.iov_base = (void *)file, .iov_len = strlen(file)}, - {.iov_base = ":", .iov_len = 1}, - {.iov_base = buf, .iov_len = (size_t)llen}, - {.iov_base = (void *)msg2, .iov_len = sizeof(msg2) - 1}, - }; - - writev(STDERR_FILENO, v, ARR_SIZE(v)); - abort(); - - unreachable; -} - -/// -/// Calculates next closest power of two of 32bit integer n -/// ref: https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 -/// -int next_power_of_two(int n) -{ - n--; - n |= n >> 1; - n |= n >> 2; - n |= n >> 4; - n |= n >> 8; - n |= n >> 16; - n++; - return n; -} - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/utils.h b/dwm/picom/src/utils.h deleted file mode 100644 index 792bc0c..0000000 --- a/dwm/picom/src/utils.h +++ /dev/null @@ -1,310 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include "compiler.h" -#include "types.h" - -#define ARR_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) - -#ifdef __FAST_MATH__ -#warning Use of -ffast-math can cause rendering error or artifacts, \ - therefore it is not recommended. -#endif - -#ifdef __clang__ -__attribute__((optnone)) -#else -__attribute__((optimize("-fno-fast-math"))) -#endif -static inline bool -safe_isnan(double a) { - return __builtin_isnan(a); -} - -/// Same as assert(false), but make sure we abort _even in release builds_. -/// Silence compiler warning caused by release builds making some code paths reachable. -#define BUG() \ - do { \ - assert(false); \ - abort(); \ - } while (0) -#define CHECK_EXPR(...) ((void)0) -/// Same as assert, but evaluates the expression even in release builds -#define CHECK(expr) \ - do { \ - auto _ = (expr); \ - /* make sure the original expression appears in the assertion message */ \ - assert((CHECK_EXPR(expr), _)); \ - (void)_; \ - } while (0) - -/// Asserts that var is within [lower, upper]. Silence compiler warning about expressions -/// being always true or false. -#define ASSERT_IN_RANGE(var, lower, upper) \ - do { \ - auto __tmp attr_unused = (var); \ - _Pragma("GCC diagnostic push"); \ - _Pragma("GCC diagnostic ignored \"-Wtype-limits\""); \ - assert(__tmp >= lower); \ - assert(__tmp <= upper); \ - _Pragma("GCC diagnostic pop"); \ - } while (0) - -/// Asserts that var >= lower. Silence compiler warning about expressions -/// being always true or false. -#define ASSERT_GEQ(var, lower) \ - do { \ - auto __tmp attr_unused = (var); \ - _Pragma("GCC diagnostic push"); \ - _Pragma("GCC diagnostic ignored \"-Wtype-limits\""); \ - assert(__tmp >= lower); \ - _Pragma("GCC diagnostic pop"); \ - } while (0) - -// Some macros for checked cast -// Note these macros are not complete, as in, they won't work for every integer types. But -// they are good enough for our use cases. - -#define to_int_checked(val) \ - ({ \ - int64_t tmp = (val); \ - ASSERT_IN_RANGE(tmp, INT_MIN, INT_MAX); \ - (int)tmp; \ - }) - -#define to_char_checked(val) \ - ({ \ - int64_t tmp = (val); \ - ASSERT_IN_RANGE(tmp, CHAR_MIN, CHAR_MAX); \ - (char)tmp; \ - }) - -#define to_u16_checked(val) \ - ({ \ - auto tmp = (val); \ - ASSERT_IN_RANGE(tmp, 0, UINT16_MAX); \ - (uint16_t) tmp; \ - }) - -#define to_i16_checked(val) \ - ({ \ - int64_t tmp = (val); \ - ASSERT_IN_RANGE(tmp, INT16_MIN, INT16_MAX); \ - (int16_t) tmp; \ - }) - -#define to_u32_checked(val) \ - ({ \ - auto tmp = (val); \ - int64_t max attr_unused = UINT32_MAX; /* silence clang tautological \ - comparison warning*/ \ - ASSERT_IN_RANGE(tmp, 0, max); \ - (uint32_t) tmp; \ - }) -/** - * Normalize an int value to a specific range. - * - * @param i int value to normalize - * @param min minimal value - * @param max maximum value - * @return normalized value - */ -static inline int attr_const normalize_i_range(int i, int min, int max) { - if (i > max) - return max; - if (i < min) - return min; - return i; -} - -/** - * Linearly interpolate from a range into another. - * - * @param a,b first range - * @param c,d second range - * @param value value to interpolate, should be in range [a,b] - * @return interpolated value in range [c,d] - */ -static inline int attr_const lerp_range(int a, int b, int c, int d, int value) { - ASSERT_IN_RANGE(value, a, b); - return (d-c)*(value-a)/(b-a) + c; -} - -#define min2(a, b) ((a) > (b) ? (b) : (a)) -#define max2(a, b) ((a) > (b) ? (a) : (b)) -#define min3(a, b, c) min2(a, min2(b, c)) - -/// clamp `val` into interval [min, max] -#define clamp(val, min, max) max2(min2(val, max), min) - -/** - * Normalize a double value to a specific range. - * - * @param d double value to normalize - * @param min minimal value - * @param max maximum value - * @return normalized value - */ -static inline double attr_const normalize_d_range(double d, double min, double max) { - if (d > max) - return max; - if (d < min) - return min; - return d; -} - -/** - * Normalize a double value to 0.\ 0 - 1.\ 0. - * - * @param d double value to normalize - * @return normalized value - */ -static inline double attr_const normalize_d(double d) { - return normalize_d_range(d, 0.0, 1.0); -} - -/** - * Convert a hex RGB string to RGB - */ -static inline struct color hex_to_rgb(const char *hex) { - struct color rgb; - // Ignore the # in front of the string - const char *sane_hex = hex + 1; - int hex_color = (int)strtol(sane_hex, NULL, 16); - rgb.red = (float)(hex_color >> 16) / 256; - rgb.green = (float)((hex_color & 0x00ff00) >> 8) / 256; - rgb.blue = (float)(hex_color & 0x0000ff) / 256; - - return rgb; -} - -attr_noret void -report_allocation_failure(const char *func, const char *file, unsigned int line); - -/** - * @brief Quit if the passed-in pointer is empty. - */ -static inline void * -allocchk_(const char *func_name, const char *file, unsigned int line, void *ptr) { - if (unlikely(!ptr)) { - report_allocation_failure(func_name, file, line); - } - return ptr; -} - -/// @brief Wrapper of allocchk_(). -#define allocchk(ptr) allocchk_(__func__, __FILE__, __LINE__, ptr) - -/// @brief Wrapper of malloc(). -#define cmalloc(type) ((type *)allocchk(malloc(sizeof(type)))) - -/// @brief Wrapper of malloc() that takes a size -#define cvalloc(size) allocchk(malloc(size)) - -/// @brief Wrapper of calloc(). -#define ccalloc(nmemb, type) \ - ({ \ - auto tmp = (nmemb); \ - ASSERT_GEQ(tmp, 0); \ - ((type *)allocchk(calloc((size_t)tmp, sizeof(type)))); \ - }) - -/// @brief Wrapper of ealloc(). -#define crealloc(ptr, nmemb) \ - ({ \ - auto tmp = (nmemb); \ - ASSERT_GEQ(tmp, 0); \ - ((__typeof__(ptr))allocchk(realloc((ptr), (size_t)tmp * sizeof(*(ptr))))); \ - }) - -/// RC_TYPE generates a reference counted type from `type` -/// -/// parameters: -/// name = the generated type will be called `name`_t. -/// ctor = the constructor of `type`, will be called when -/// a value of `type` is created. should take one -/// argument of `type *`. -/// dtor = the destructor. will be called when all reference -/// is gone. has same signature as ctor -/// Q = function qualifier. this is the qualifier that -/// will be put before generated functions -// -/// functions generated: -/// `name`_new: create a new reference counted object of `type` -/// `name`_ref: increment the reference counter, return a -/// reference to the object -/// `name`_unref: decrement the reference counter. take a `type **` -/// because it needs to nullify the reference. -#define RC_TYPE(type, name, ctor, dtor, Q) \ - typedef struct { \ - type inner; \ - int ref_count; \ - } name##_internal_t; \ - typedef type name##_t; \ - Q type *name##_new(void) { \ - name##_internal_t *ret = cmalloc(name##_internal_t); \ - ctor((type *)ret); \ - ret->ref_count = 1; \ - return (type *)ret; \ - } \ - Q type *name##_ref(type *a) { \ - __auto_type b = (name##_internal_t *)a; \ - b->ref_count++; \ - return a; \ - } \ - Q void name##_unref(type **a) { \ - __auto_type b = (name##_internal_t *)*a; \ - if (!b) \ - return; \ - b->ref_count--; \ - if (!b->ref_count) { \ - dtor((type *)b); \ - free(b); \ - } \ - *a = NULL; \ - } - -/// Generate prototypes for functions generated by RC_TYPE -#define RC_TYPE_PROTO(type, name) \ - typedef type name##_t; \ - type *name##_new(void); \ - void name##_ref(type *a); \ - void name##_unref(type **a); - - -/// -/// Calculates next closest power of two of 32bit integer n -/// ref: https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 -/// -int next_power_of_two(int n); - -// Some versions of the Android libc do not have timespec_get(), use -// clock_gettime() instead. -#ifdef __ANDROID__ - -#ifndef TIME_UTC -#define TIME_UTC 1 -#endif - -static inline int timespec_get(struct timespec *ts, int base) { - assert(base == TIME_UTC); - return clock_gettime(CLOCK_REALTIME, ts); -} -#endif - -// vim: set noet sw=8 ts=8 : diff --git a/dwm/picom/src/vsync.c b/dwm/picom/src/vsync.c deleted file mode 100644 index 5980155..0000000 --- a/dwm/picom/src/vsync.c +++ /dev/null @@ -1,204 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui - -/// Function pointers to init VSync modes. - -#include "common.h" -#include "log.h" - -#ifdef CONFIG_OPENGL -#include "backend/gl/glx.h" -#include "opengl.h" -#endif - -#ifdef CONFIG_VSYNC_DRM -#include -#include -#include -#include -#include -#include -#endif - -#include "config.h" -#include "vsync.h" - -#ifdef CONFIG_VSYNC_DRM -/** - * Wait for next VSync, DRM method. - * - * Stolen from: - * https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/vsync.cpp - */ -static int vsync_drm_wait(session_t *ps) { - int ret = -1; - drm_wait_vblank_t vbl; - - vbl.request.type = _DRM_VBLANK_RELATIVE, vbl.request.sequence = 1; - - do { - ret = ioctl(ps->drm_fd, DRM_IOCTL_WAIT_VBLANK, &vbl); - vbl.request.type &= ~(uint)_DRM_VBLANK_RELATIVE; - } while (ret && errno == EINTR); - - if (ret) - log_error("VBlank ioctl did not work, unimplemented in this drmver?"); - - return ret; -} - -/** - * Initialize DRM VSync. - * - * @return true for success, false otherwise - */ -static bool vsync_drm_init(session_t *ps) { - // Should we always open card0? - if (ps->drm_fd < 0 && (ps->drm_fd = open("/dev/dri/card0", O_RDWR)) < 0) { - log_error("Failed to open device."); - return false; - } - - if (vsync_drm_wait(ps)) - return false; - - return true; -} -#endif - -#ifdef CONFIG_OPENGL -/** - * Initialize OpenGL VSync. - * - * Stolen from: - * http://git.tuxfamily.org/?p=ccm/cairocompmgr.git;a=commitdiff;h=efa4ceb97da501e8630ca7f12c99b1dce853c73e - * Possible original source: http://www.inb.uni-luebeck.de/~boehme/xvideo_sync.html - * - * @return true for success, false otherwise - */ -static bool vsync_opengl_init(session_t *ps) { - if (!ensure_glx_context(ps)) - return false; - - return glxext.has_GLX_SGI_video_sync; -} - -static bool vsync_opengl_oml_init(session_t *ps) { - if (!ensure_glx_context(ps)) - return false; - - return glxext.has_GLX_OML_sync_control; -} - -static inline bool vsync_opengl_swc_swap_interval(session_t *ps, int interval) { - if (glxext.has_GLX_MESA_swap_control) - return glXSwapIntervalMESA((uint)interval) == 0; - else if (glxext.has_GLX_SGI_swap_control) - return glXSwapIntervalSGI(interval) == 0; - else if (glxext.has_GLX_EXT_swap_control) { - GLXDrawable d = glXGetCurrentDrawable(); - if (d == None) { - // We don't have a context?? - return false; - } - glXSwapIntervalEXT(ps->dpy, glXGetCurrentDrawable(), interval); - return true; - } - return false; -} - -static bool vsync_opengl_swc_init(session_t *ps) { - if (!bkend_use_glx(ps)) { - log_error("OpenGL swap control requires the GLX backend."); - return false; - } - - if (!vsync_opengl_swc_swap_interval(ps, 1)) { - log_error("Failed to load a swap control extension."); - return false; - } - - return true; -} - -/** - * Wait for next VSync, OpenGL method. - */ -static int vsync_opengl_wait(session_t *ps attr_unused) { - unsigned vblank_count = 0; - - glXGetVideoSyncSGI(&vblank_count); - glXWaitVideoSyncSGI(2, (vblank_count + 1) % 2, &vblank_count); - return 0; -} - -/** - * Wait for next VSync, OpenGL OML method. - * - * https://mail.gnome.org/archives/clutter-list/2012-November/msg00031.html - */ -static int vsync_opengl_oml_wait(session_t *ps) { - int64_t ust = 0, msc = 0, sbc = 0; - - glXGetSyncValuesOML(ps->dpy, ps->reg_win, &ust, &msc, &sbc); - glXWaitForMscOML(ps->dpy, ps->reg_win, 0, 2, (msc + 1) % 2, &ust, &msc, &sbc); - return 0; -} -#endif - -/** - * Initialize current VSync method. - */ -bool vsync_init(session_t *ps) { -#ifdef CONFIG_OPENGL - if (bkend_use_glx(ps)) { - // Mesa turns on swap control by default, undo that - vsync_opengl_swc_swap_interval(ps, 0); - } -#endif -#ifdef CONFIG_VSYNC_DRM - log_warn("The DRM vsync method is deprecated, please don't enable it."); -#endif - - if (!ps->o.vsync) { - return true; - } - -#ifdef CONFIG_OPENGL - if (bkend_use_glx(ps)) { - if (!vsync_opengl_swc_init(ps)) { - return false; - } - ps->vsync_wait = NULL; // glXSwapBuffers will automatically wait - // for vsync, we don't need to do anything. - return true; - } -#endif - - // Oh no, we are not using glx backend. - // Throwing things at wall. -#ifdef CONFIG_OPENGL - if (vsync_opengl_oml_init(ps)) { - log_info("Using the opengl-oml vsync method"); - ps->vsync_wait = vsync_opengl_oml_wait; - return true; - } - - if (vsync_opengl_init(ps)) { - log_info("Using the opengl vsync method"); - ps->vsync_wait = vsync_opengl_wait; - return true; - } -#endif - -#ifdef CONFIG_VSYNC_DRM - if (vsync_drm_init(ps)) { - log_info("Using the drm vsync method"); - ps->vsync_wait = vsync_drm_wait; - return true; - } -#endif - - log_error("No supported vsync method found for this backend"); - return false; -} diff --git a/dwm/picom/src/vsync.h b/dwm/picom/src/vsync.h deleted file mode 100644 index 076bc26..0000000 --- a/dwm/picom/src/vsync.h +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) Yuxuan Shui -#include - -typedef struct session session_t; - -bool vsync_init(session_t *ps); diff --git a/dwm/picom/src/win.c b/dwm/picom/src/win.c deleted file mode 100644 index e7911ac..0000000 --- a/dwm/picom/src/win.c +++ /dev/null @@ -1,3147 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2011-2013, Christopher Jeffrey -// Copyright (c) 2013 Richard Grenville - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "atom.h" -#include "backend/backend.h" -#include "backend/backend_common.h" -#include "c2.h" -#include "common.h" -#include "compiler.h" -#include "config.h" -#include "list.h" -#include "log.h" -#include "picom.h" -#include "region.h" -#include "render.h" -#include "string_utils.h" -#include "types.h" -#include "uthash_extra.h" -#include "utils.h" -#include "x.h" - -#ifdef CONFIG_DBUS -#include "dbus.h" -#endif - -#ifdef CONFIG_OPENGL -// TODO(yshui) Get rid of this include -#include "opengl.h" -#endif - -#include "win.h" - -// TODO(yshui) Make more window states internal -struct managed_win_internal { - struct managed_win base; -}; - -#define OPAQUE (0xffffffff) -static const int WIN_GET_LEADER_MAX_RECURSION = 20; -static const int ROUNDED_PIXELS = 1; -static const double ROUNDED_PERCENT = 0.05; - -/** - * Retrieve the WM_CLASS of a window and update its - * win structure. - */ -static bool win_update_class(session_t *ps, struct managed_win *w); -static int win_update_role(session_t *ps, struct managed_win *w); -static void win_update_wintype(session_t *ps, struct managed_win *w); -static int win_update_name(session_t *ps, struct managed_win *w); -/** - * Reread opacity property of a window. - */ -static void win_update_opacity_prop(session_t *ps, struct managed_win *w); -static void win_update_opacity_target(session_t *ps, struct managed_win *w); -/** - * Retrieve frame extents from a window. - */ -static void -win_update_frame_extents(session_t *ps, struct managed_win *w, xcb_window_t client); -static void win_update_prop_shadow_raw(session_t *ps, struct managed_win *w); -static void win_update_prop_shadow(session_t *ps, struct managed_win *w); -/** - * Update leader of a window. - */ -static void win_update_leader(session_t *ps, struct managed_win *w); - -/// Generate a "no corners" region function, from a function that returns the -/// region via a region_t pointer argument. Corners of the window will be removed from -/// the returned region. -/// Function signature has to be (win *, region_t *) -#define gen_without_corners(fun) \ - void fun##_without_corners(const struct managed_win *w, region_t *res) { \ - fun(w, res); \ - win_region_remove_corners(w, res); \ - } - -/// Generate a "return by value" function, from a function that returns the -/// region via a region_t pointer argument. -/// Function signature has to be (win *) -#define gen_by_val(fun) \ - region_t fun##_by_val(const struct managed_win *w) { \ - region_t ret; \ - pixman_region32_init(&ret); \ - fun(w, &ret); \ - return ret; \ - } - -/** - * Clear leader cache of all windows. - */ -static inline void clear_cache_win_leaders(session_t *ps) { - win_stack_foreach_managed(w, &ps->window_stack) { - w->cache_leader = XCB_NONE; - } -} - -static xcb_window_t win_get_leader_raw(session_t *ps, struct managed_win *w, int recursions); - -/** - * Get the leader of a window. - * - * This function updates w->cache_leader if necessary. - */ -static inline xcb_window_t win_get_leader(session_t *ps, struct managed_win *w) { - return win_get_leader_raw(ps, w, 0); -} - -/** - * Whether the real content of the window is visible. - * - * A window is not considered "real" visible if it's fading out. Because in that case a - * cached version of the window is displayed. - */ -static inline bool attr_pure win_is_real_visible(const struct managed_win *w) { - return w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && - w->state != WSTATE_UNMAPPING; -} - -/** - * Update focused state of a window. - */ -static void win_update_focused(session_t *ps, struct managed_win *w) { - if (UNSET != w->focused_force) { - w->focused = w->focused_force; - } else { - w->focused = win_is_focused_raw(ps, w); - - // Use wintype_focus, and treat WM windows and override-redirected - // windows specially - if (ps->o.wintype_option[w->window_type].focus || - (ps->o.mark_wmwin_focused && w->wmwin) || - (ps->o.mark_ovredir_focused && w->base.id == w->client_win && !w->wmwin) || - (w->a.map_state == XCB_MAP_STATE_VIEWABLE && - c2_match(ps, w, ps->o.focus_blacklist, NULL))) { - w->focused = true; - } - - // If window grouping detection is enabled, mark the window active if - // its group is - if (ps->o.track_leader && ps->active_leader && - win_get_leader(ps, w) == ps->active_leader) { - w->focused = true; - } - } -} - -/** - * Run win_on_factor_change() on all windows with the same leader window. - * - * @param leader leader window ID - */ -static inline void group_on_factor_change(session_t *ps, xcb_window_t leader) { - if (!leader) { - return; - } - - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - if (!w->managed) { - continue; - } - auto mw = (struct managed_win *)w; - if (win_get_leader(ps, mw) == leader) { - win_on_factor_change(ps, mw); - } - } -} - -static inline const char *win_get_name_if_managed(const struct win *w) { - if (!w->managed) { - return "(unmanaged)"; - } - auto mw = (struct managed_win *)w; - return mw->name; -} - -/** - * Return whether a window group is really focused. - * - * @param leader leader window ID - * @return true if the window group is focused, false otherwise - */ -static inline bool group_is_focused(session_t *ps, xcb_window_t leader) { - if (!leader) { - return false; - } - - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - if (!w->managed) { - continue; - } - auto mw = (struct managed_win *)w; - if (win_get_leader(ps, mw) == leader && win_is_focused_raw(ps, mw)) { - return true; - } - } - - return false; -} - -/** - * Get a rectangular region a window occupies, excluding shadow. - */ -static void win_get_region_local(const struct managed_win *w, region_t *res) { - assert(w->widthb >= 0 && w->heightb >= 0); - pixman_region32_fini(res); - pixman_region32_init_rect(res, 0, 0, (uint)w->widthb, (uint)w->heightb); -} - -/** - * Get a rectangular region a window occupies, excluding frame and shadow. - */ -void win_get_region_noframe_local(const struct managed_win *w, region_t *res) { - const margin_t extents = win_calc_frame_extents(w); - - int x = extents.left; - int y = extents.top; - int width = max2(w->widthb - (extents.left + extents.right), 0); - int height = max2(w->heightb - (extents.top + extents.bottom), 0); - - pixman_region32_fini(res); - if (width > 0 && height > 0) { - pixman_region32_init_rect(res, x, y, (uint)width, (uint)height); - } else { - pixman_region32_init(res); - } -} - -gen_without_corners(win_get_region_noframe_local); - -void win_get_region_frame_local(const struct managed_win *w, region_t *res) { - const margin_t extents = win_calc_frame_extents(w); - auto outer_width = w->widthb; - auto outer_height = w->heightb; - - pixman_region32_fini(res); - pixman_region32_init_rects( - res, - (rect_t[]){ - // top - {.x1 = 0, .y1 = 0, .x2 = outer_width, .y2 = extents.top}, - // bottom - {.x1 = 0, .y1 = outer_height - extents.bottom, .x2 = outer_width, .y2 = outer_height}, - // left - {.x1 = 0, .y1 = 0, .x2 = extents.left, .y2 = outer_height}, - // right - {.x1 = outer_width - extents.right, .y1 = 0, .x2 = outer_width, .y2 = outer_height}, - }, - 4); - - // limit the frame region to inside the window - region_t reg_win; - pixman_region32_init_rects(®_win, (rect_t[]){{0, 0, outer_width, outer_height}}, 1); - pixman_region32_intersect(res, ®_win, res); - pixman_region32_fini(®_win); -} - -gen_by_val(win_get_region_frame_local); - -/** - * Add a window to damaged area. - * - * @param ps current session - * @param w struct _win element representing the window - */ -void add_damage_from_win(session_t *ps, const struct managed_win *w) { - // XXX there was a cached extents region, investigate - // if that's better - - // TODO(yshui) use the bounding shape when the window is shaped, otherwise the - // damage would be excessive - region_t extents; - pixman_region32_init(&extents); - win_extents(w, &extents); - add_damage(ps, &extents); - pixman_region32_fini(&extents); -} - -/// Release the images attached to this window -static inline void win_release_pixmap(backend_t *base, struct managed_win *w) { - log_debug("Releasing pixmap of window %#010x (%s)", w->base.id, w->name); - assert(w->win_image); - if (w->win_image) { - base->ops->release_image(base, w->win_image); - w->win_image = NULL; - // Bypassing win_set_flags, because `w` might have been destroyed - w->flags |= WIN_FLAGS_PIXMAP_NONE; - } -} -static inline void win_release_oldpixmap(backend_t *base, struct managed_win *w) { - log_debug("Releasing old_pixmap of window %#010x (%s)", w->base.id, w->name); - if (w->old_win_image) { - base->ops->release_image(base, w->old_win_image); - w->old_win_image = NULL; - } -} -static inline void win_release_shadow(backend_t *base, struct managed_win *w) { - log_debug("Releasing shadow of window %#010x (%s)", w->base.id, w->name); - assert(w->shadow_image); - if (w->shadow_image) { - base->ops->release_image(base, w->shadow_image); - w->shadow_image = NULL; - // Bypassing win_set_flags, because `w` might have been destroyed - w->flags |= WIN_FLAGS_SHADOW_NONE; - } -} - -static inline bool win_bind_pixmap(struct backend_base *b, struct managed_win *w) { - assert(!w->win_image); - auto pixmap = x_new_id(b->c); - auto e = xcb_request_check( - b->c, xcb_composite_name_window_pixmap_checked(b->c, w->base.id, pixmap)); - if (e) { - log_error("Failed to get named pixmap for window %#010x(%s)", w->base.id, - w->name); - free(e); - return false; - } - log_debug("New named pixmap for %#010x (%s) : %#010x", w->base.id, w->name, pixmap); - w->win_image = - b->ops->bind_pixmap(b, pixmap, x_get_visual_info(b->c, w->a.visual), true); - if (!w->win_image) { - log_error("Failed to bind pixmap"); - win_set_flags(w, WIN_FLAGS_IMAGE_ERROR); - return false; - } - - win_clear_flags(w, WIN_FLAGS_PIXMAP_NONE); - return true; -} - -bool win_bind_shadow(struct backend_base *b, struct managed_win *w, struct color c, - struct conv *kernel) { - assert(!w->shadow_image); - assert(w->shadow); - w->shadow_image = b->ops->render_shadow(b, w->widthb, w->heightb, kernel, c.red, - c.green, c.blue, c.alpha); - if (!w->shadow_image) { - log_error("Failed to bind shadow image, shadow will be disabled for " - "%#010x (%s)", - w->base.id, w->name); - win_set_flags(w, WIN_FLAGS_SHADOW_NONE); - w->shadow = false; - return false; - } - - log_debug("New shadow for %#010x (%s)", w->base.id, w->name); - win_clear_flags(w, WIN_FLAGS_SHADOW_NONE); - return true; -} - -void win_release_images(struct backend_base *backend, struct managed_win *w) { - // We don't want to decide what we should do if the image we want to release is - // stale (do we clear the stale flags or not?) - // But if we are not releasing any images anyway, we don't care about the stale - // flags. - - if (!win_check_flags_all(w, WIN_FLAGS_PIXMAP_NONE)) { - assert(!win_check_flags_all(w, WIN_FLAGS_PIXMAP_STALE)); - win_release_pixmap(backend, w); - win_release_oldpixmap(backend, w); - } - - if (!win_check_flags_all(w, WIN_FLAGS_SHADOW_NONE)) { - assert(!win_check_flags_all(w, WIN_FLAGS_SHADOW_STALE)); - win_release_shadow(backend, w); - } -} - -/// Returns true if the `prop` property is stale, as well as clears the stale flag. -static bool win_fetch_and_unset_property_stale(struct managed_win *w, xcb_atom_t prop); -/// Returns true if any of the properties are stale, as well as clear all the stale flags. -static void win_clear_all_properties_stale(struct managed_win *w); - -/// Fetch new window properties from the X server, and run appropriate updates. Might set -/// WIN_FLAGS_FACTOR_CHANGED -static void win_update_properties(session_t *ps, struct managed_win *w) { - if (win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_WM_WINDOW_TYPE)) { - win_update_wintype(ps, w); - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_WM_WINDOW_OPACITY)) { - win_update_opacity_prop(ps, w); - // we cannot receive OPACITY change when window has been destroyed - assert(w->state != WSTATE_DESTROYING); - win_update_opacity_target(ps, w); - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_FRAME_EXTENTS)) { - win_update_frame_extents(ps, w, w->client_win); - add_damage_from_win(ps, w); - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->aWM_NAME) || - win_fetch_and_unset_property_stale(w, ps->atoms->a_NET_WM_NAME)) { - if (win_update_name(ps, w) == 1) { - win_set_flags(w, WIN_FLAGS_FACTOR_CHANGED); - } - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->aWM_CLASS)) { - if (win_update_class(ps, w)) { - win_set_flags(w, WIN_FLAGS_FACTOR_CHANGED); - } - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->aWM_WINDOW_ROLE)) { - if (win_update_role(ps, w) == 1) { - win_set_flags(w, WIN_FLAGS_FACTOR_CHANGED); - } - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->a_COMPTON_SHADOW)) { - win_update_prop_shadow(ps, w); - } - - if (win_fetch_and_unset_property_stale(w, ps->atoms->aWM_CLIENT_LEADER) || - win_fetch_and_unset_property_stale(w, ps->atoms->aWM_TRANSIENT_FOR)) { - win_update_leader(ps, w); - } - - win_clear_all_properties_stale(w); -} - -static void init_animation(session_t *ps, struct managed_win *w) { - enum open_window_animation animation = ps->o.animation_for_open_window; - - w->animation_ignore = c2_match(ps, w, ps->o.animation_blacklist, NULL); - w->animation_transient = wid_has_prop(ps, w->client_win, ps->atoms->aWM_TRANSIENT_FOR); - - if (w->window_type != WINTYPE_TOOLTIP && w->animation_transient) - animation = ps->o.animation_for_transient_window; - - if (ps->o.wintype_option[w->window_type].animation < OPEN_WINDOW_ANIMATION_INVALID) - animation = ps->o.wintype_option[w->window_type].animation; - - if (ps->root_desktop_switch_direction != 0) { - w->opacity = w->opacity_target; - - if (ps->o.animation_for_workspace_switch_in == OPEN_WINDOW_ANIMATION_AUTO) - animation = OPEN_WINDOW_ANIMATION_SLIDE_IN; - else - animation = ps->o.animation_for_workspace_switch_in; - } - - if (w->animation_ignore) - animation = OPEN_WINDOW_ANIMATION_NONE; - - switch (animation) { - case OPEN_WINDOW_ANIMATION_AUTO: - case OPEN_WINDOW_ANIMATION_NONE: { // No animation - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = w->pending_g.width; - w->animation_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_FLYIN: { // Fly-in from a random point outside the screen - // Compute random point off screen - double angle = 2 * M_PI * ((double)rand() / RAND_MAX); - const double radius = - sqrt(ps->root_width * ps->root_width + ps->root_height * ps->root_height); - - // Set animation - w->animation_center_x = ps->root_width * 0.5 + radius * cos(angle); - w->animation_center_y = ps->root_height * 0.5 + radius * sin(angle); - w->animation_w = 0; - w->animation_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_ZOOM: { // Zoom-in the image, without changing its location - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = 0; - w->animation_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SQUEEZE: { //Squeeze up like old tv turn on, without changing its location - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = w->pending_g.width; - w->animation_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_UP: { // Slide up the image, without changing its location - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height; - w->animation_w = w->pending_g.width; - w->animation_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_DOWN: { // Slide down the image, without changing its location - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y; - w->animation_w = w->pending_g.width; - w->animation_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_LEFT: { // Slide left the image, without changing its location - w->animation_center_x = w->pending_g.x + w->pending_g.width; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = 0; - w->animation_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_RIGHT: { // Slide right the image, without changing its location - w->animation_center_x = w->pending_g.x; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = 0; - w->animation_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_IN: { - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 - - ps->root_height * - ((ps->root_desktop_switch_direction < 0 && - ps->root_desktop_switch_direction >= -1) || - ps->root_desktop_switch_direction > 1?1:-1); - w->animation_w = w->pending_g.width; - w->animation_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_OUT: { - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5 - - ps->root_height * - ((ps->root_desktop_switch_direction < 0 && - ps->root_desktop_switch_direction >= -1) || - ps->root_desktop_switch_direction > 1?-1:1); - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_INVALID: assert(false); break; - } -} - -static void init_animation_unmap(session_t *ps, struct managed_win *w) { - enum open_window_animation animation; - - if (ps->o.animation_for_unmap_window == OPEN_WINDOW_ANIMATION_AUTO) { - animation = ps->o.animation_for_open_window; - - if (w->window_type != WINTYPE_TOOLTIP && w->animation_transient) - animation = ps->o.animation_for_transient_window; - - if (ps->o.wintype_option[w->window_type].animation < OPEN_WINDOW_ANIMATION_INVALID) - animation = ps->o.wintype_option[w->window_type].animation; - - if (animation == OPEN_WINDOW_ANIMATION_SLIDE_UP) - animation = OPEN_WINDOW_ANIMATION_SLIDE_DOWN; - else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_DOWN) - animation = OPEN_WINDOW_ANIMATION_SLIDE_UP; - else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_LEFT) - animation = OPEN_WINDOW_ANIMATION_SLIDE_RIGHT; - else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_RIGHT) - animation = OPEN_WINDOW_ANIMATION_SLIDE_LEFT; - else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_IN) - animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT; - else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_OUT) - animation = OPEN_WINDOW_ANIMATION_SLIDE_IN; - - } else { - animation = ps->o.animation_for_unmap_window; - - if (ps->o.wintype_option[w->window_type].animation_unmap < OPEN_WINDOW_ANIMATION_INVALID) - animation = ps->o.wintype_option[w->window_type].animation_unmap; - } - - if (ps->root_desktop_switch_direction != 0) { - if (ps->o.animation_for_workspace_switch_out == OPEN_WINDOW_ANIMATION_AUTO) - animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT; - else - animation = ps->o.animation_for_workspace_switch_out; - } - - if (w->animation_ignore) - animation = OPEN_WINDOW_ANIMATION_NONE; - - switch (animation) { - case OPEN_WINDOW_ANIMATION_AUTO: - case OPEN_WINDOW_ANIMATION_NONE: { // No animation - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_FLYIN: { // Fly-out from a random point outside the screen - // Compute random point off screen - double angle = 2 * M_PI * ((double)rand() / RAND_MAX); - const double radius = - sqrt(ps->root_width * ps->root_width + ps->root_height * ps->root_height); - - // Set animation - w->animation_dest_center_x = ps->root_width * 0.5 + radius * cos(angle); - w->animation_dest_center_y = ps->root_height * 0.5 + radius * sin(angle); - w->animation_dest_w = 0; - w->animation_dest_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_ZOOM: { // Zoom-out the image, without changing its location - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = 0; - w->animation_dest_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SQUEEZE: { //Squeeze down like old tv turn off, without changing its location - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_UP: { // Slide up the image, without changing its location - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_DOWN: { // Slide down the image, without changing its location - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = 0; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_LEFT: { // Slide left the image, without changing its location - w->animation_dest_center_x = w->pending_g.x; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = 0; - w->animation_dest_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_RIGHT: { // Slide right the image, without changing its location - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = 0; - w->animation_dest_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_IN: { - w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 - - ps->root_height * - ((ps->root_desktop_switch_direction < 0 && - ps->root_desktop_switch_direction >= -1) || - ps->root_desktop_switch_direction > 1?1:-1); - w->animation_w = w->pending_g.width; - w->animation_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_SLIDE_OUT: { - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5 - - ps->root_height * - ((ps->root_desktop_switch_direction < 0 && - ps->root_desktop_switch_direction >= -1) || - ps->root_desktop_switch_direction > 1?-1:1); - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = w->pending_g.height; - break; - } - case OPEN_WINDOW_ANIMATION_INVALID: assert(false); break; - } -} - -/// Handle non-image flags. This phase might set IMAGES_STALE flags -void win_process_update_flags(session_t *ps, struct managed_win *w) { - // Whether the window was visible before we process the mapped flag. i.e. is the - // window just mapped. - bool was_visible = win_is_real_visible(w); - log_trace("Processing flags for window %#010x (%s), was visible: %d", w->base.id, - w->name, was_visible); - - if (win_check_flags_all(w, WIN_FLAGS_MAPPED)) { - map_win_start(ps, w); - win_clear_flags(w, WIN_FLAGS_MAPPED); - } - - if (!win_is_real_visible(w)) { - // Flags of invisible windows are processed when they are mapped - return; - } - - // Check client first, because later property updates need accurate client window - // information - if (win_check_flags_all(w, WIN_FLAGS_CLIENT_STALE)) { - win_recheck_client(ps, w); - win_clear_flags(w, WIN_FLAGS_CLIENT_STALE); - } - - bool damaged = false; - if (win_check_flags_any(w, WIN_FLAGS_SIZE_STALE | WIN_FLAGS_POSITION_STALE)) { - if (was_visible) { - // Mark the old extents of this window as damaged. The new extents - // will be marked damaged below, after the window extents are - // updated. - // - // If the window is just mapped, we don't need to mark the old - // extent as damaged. (It's possible that the window was in fading - // and is interrupted by being mapped. In that case, the fading - // window will be added to damage by map_win_start, so we don't - // need to do it here) - add_damage_from_win(ps, w); - } - - // Update window geometry if animations enabled, window isn't set to NOT animate - // and picom isn't just starting up or restarting - if (ps->o.animations && ps->o.wintype_option[w->window_type].animation != 0) { - if (w->state == WSTATE_MAPPED) { - init_animation(ps, w); - - w->animation_center_x = w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_center_y = w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_w = w->animation_dest_w = w->pending_g.width; - w->animation_h = w->animation_dest_h = w->pending_g.height; - - w->state = WSTATE_FADING; - w->g = w->pending_g; - - } else if (!was_visible) { - // Set window-open animation - init_animation(ps, w); - - w->animation_dest_center_x = w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = w->pending_g.height; - - w->g.x = (int16_t)round(w->animation_center_x - - w->animation_w * 0.5); - w->g.y = (int16_t)round(w->animation_center_y - - w->animation_h * 0.5); - w->g.width = (uint16_t)round(w->animation_w); - w->g.height = (uint16_t)round(w->animation_h); - - } else { - w->animation_dest_center_x = - w->pending_g.x + w->pending_g.width * 0.5; - w->animation_dest_center_y = - w->pending_g.y + w->pending_g.height * 0.5; - w->animation_dest_w = w->pending_g.width; - w->animation_dest_h = w->pending_g.height; - } - - w->g.border_width = w->pending_g.border_width; - - double x_dist = w->animation_dest_center_x - w->animation_center_x; - double y_dist = w->animation_dest_center_y - w->animation_center_y; - double w_dist = w->animation_dest_w - w->animation_w; - double h_dist = w->animation_dest_h - w->animation_h; - w->animation_inv_og_distance = - 1.0 / sqrt(x_dist * x_dist + y_dist * y_dist + - w_dist * w_dist + h_dist * h_dist); - - if (isinf(w->animation_inv_og_distance)) - w->animation_inv_og_distance = 0; - - // We only grab images if w->reg_ignore_valid is true as - // there's an ev_shape_notify() event fired quickly on new windows - // for e.g. in case of Firefox main menu and ev_shape_notify() - // sets the win_set_flags(w, WIN_FLAGS_SIZE_STALE); which - // brakes the new image captured and because this same event - // also sets w->reg_ignore_valid = false; too we check for it - if (w->reg_ignore_valid) { - if (w->old_win_image) { - ps->backend_data->ops->release_image(ps->backend_data, - w->old_win_image); - w->old_win_image = NULL; - } - - // We only grab - if (w->win_image) { - w->old_win_image = ps->backend_data->ops->clone_image( - ps->backend_data, w->win_image, &w->bounding_shape); - } - } - - w->animation_progress = 0.0; - - } else { - w->g = w->pending_g; - } - - if (win_check_flags_all(w, WIN_FLAGS_SIZE_STALE)) { - win_on_win_size_change(ps, w); - win_update_bounding_shape(ps, w); - damaged = true; - win_clear_flags(w, WIN_FLAGS_SIZE_STALE); - } - - if (win_check_flags_all(w, WIN_FLAGS_POSITION_STALE)) { - damaged = true; - win_clear_flags(w, WIN_FLAGS_POSITION_STALE); - } - - win_update_screen(ps->xinerama_nscrs, ps->xinerama_scr_regs, w); - } - - if (win_check_flags_all(w, WIN_FLAGS_PROPERTY_STALE)) { - win_update_properties(ps, w); - win_clear_flags(w, WIN_FLAGS_PROPERTY_STALE); - } - - // Factor change flags could be set by previous stages, so must be handled last - if (win_check_flags_all(w, WIN_FLAGS_FACTOR_CHANGED)) { - win_on_factor_change(ps, w); - win_clear_flags(w, WIN_FLAGS_FACTOR_CHANGED); - } - - // Add damage, has to be done last so the window has the latest geometry - // information. - if (damaged) { - add_damage_from_win(ps, w); - } -} - -void win_process_image_flags(session_t *ps, struct managed_win *w) { - assert(!win_check_flags_all(w, WIN_FLAGS_MAPPED)); - - if (w->state == WSTATE_UNMAPPED || w->state == WSTATE_DESTROYING || - w->state == WSTATE_UNMAPPING) { - // Flags of invisible windows are processed when they are mapped - return; - } - - // Not a loop - while (win_check_flags_any(w, WIN_FLAGS_IMAGES_STALE) && - !win_check_flags_all(w, WIN_FLAGS_IMAGE_ERROR)) { - // Image needs to be updated, update it. - if (!ps->backend_data) { - // We are using legacy backend, nothing to do here. - break; - } - - if (win_check_flags_all(w, WIN_FLAGS_PIXMAP_STALE)) { - // Check to make sure the window is still mapped, otherwise we - // won't be able to rebind pixmap after releasing it, yet we might - // still need the pixmap for rendering. - assert(w->state != WSTATE_UNMAPPING && w->state != WSTATE_DESTROYING); - if (!win_check_flags_all(w, WIN_FLAGS_PIXMAP_NONE)) { - // Must release images first, otherwise breaks - // NVIDIA driver - win_release_pixmap(ps->backend_data, w); - } - win_bind_pixmap(ps->backend_data, w); - } - - if (win_check_flags_all(w, WIN_FLAGS_SHADOW_STALE)) { - if (!win_check_flags_all(w, WIN_FLAGS_SHADOW_NONE)) { - win_release_shadow(ps->backend_data, w); - } - if (w->shadow) { - win_bind_shadow(ps->backend_data, w, - (struct color){.red = ps->o.shadow_red, - .green = ps->o.shadow_green, - .blue = ps->o.shadow_blue, - .alpha = ps->o.shadow_opacity}, - ps->gaussian_map); - } - } - - // break here, loop always run only once - break; - } - - // Clear stale image flags - if (win_check_flags_any(w, WIN_FLAGS_IMAGES_STALE)) { - win_clear_flags(w, WIN_FLAGS_IMAGES_STALE); - } -} - -/** - * Check if a window has rounded corners. - * XXX This is really dumb - */ -static bool attr_pure win_has_rounded_corners(const struct managed_win *w) { - if (!w->bounding_shaped) { - return false; - } - - // Quit if border_size() returns XCB_NONE - if (!pixman_region32_not_empty((region_t *)&w->bounding_shape)) { - return false; - } - - // Determine the minimum width/height of a rectangle that could mark - // a window as having rounded corners - auto minwidth = - (uint16_t)max2(w->widthb * (1 - ROUNDED_PERCENT), w->widthb - ROUNDED_PIXELS); - auto minheight = - (uint16_t)max2(w->heightb * (1 - ROUNDED_PERCENT), w->heightb - ROUNDED_PIXELS); - - // Get the rectangles in the bounding region - int nrects = 0; - const rect_t *rects = - pixman_region32_rectangles((region_t *)&w->bounding_shape, &nrects); - - // Look for a rectangle large enough for this window be considered - // having rounded corners - for (int i = 0; i < nrects; ++i) { - if (rects[i].x2 - rects[i].x1 >= minwidth && - rects[i].y2 - rects[i].y1 >= minheight) { - return true; - } - } - return false; -} - -int win_update_name(session_t *ps, struct managed_win *w) { - char **strlst = NULL; - int nstr = 0; - - if (!w->client_win) { - return 0; - } - - if (!(wid_get_text_prop(ps, w->client_win, ps->atoms->a_NET_WM_NAME, &strlst, &nstr))) { - log_debug("(%#010x): _NET_WM_NAME unset, falling back to WM_NAME.", - w->client_win); - - if (!wid_get_text_prop(ps, w->client_win, ps->atoms->aWM_NAME, &strlst, &nstr)) { - log_debug("Unsetting window name for %#010x", w->client_win); - free(w->name); - w->name = NULL; - return -1; - } - } - - int ret = 0; - if (!w->name || strcmp(w->name, strlst[0]) != 0) { - ret = 1; - free(w->name); - w->name = strdup(strlst[0]); - } - - free(strlst); - - log_debug("(%#010x): client = %#010x, name = \"%s\", " - "ret = %d", - w->base.id, w->client_win, w->name, ret); - return ret; -} - -static int win_update_role(session_t *ps, struct managed_win *w) { - char **strlst = NULL; - int nstr = 0; - - if (!wid_get_text_prop(ps, w->client_win, ps->atoms->aWM_WINDOW_ROLE, &strlst, &nstr)) { - return -1; - } - - int ret = 0; - if (!w->role || strcmp(w->role, strlst[0]) != 0) { - ret = 1; - free(w->role); - w->role = strdup(strlst[0]); - } - - free(strlst); - - log_trace("(%#010x): client = %#010x, role = \"%s\", " - "ret = %d", - w->base.id, w->client_win, w->role, ret); - return ret; -} - -/** - * Check if a window is bounding-shaped. - */ -static inline bool win_bounding_shaped(const session_t *ps, xcb_window_t wid) { - if (ps->shape_exists) { - xcb_shape_query_extents_reply_t *reply; - Bool bounding_shaped; - - reply = xcb_shape_query_extents_reply( - ps->c, xcb_shape_query_extents(ps->c, wid), NULL); - bounding_shaped = reply && reply->bounding_shaped; - free(reply); - - return bounding_shaped; - } - - return false; -} - -static wintype_t wid_get_prop_wintype(session_t *ps, xcb_window_t wid) { - winprop_t prop = - x_get_prop(ps->c, wid, ps->atoms->a_NET_WM_WINDOW_TYPE, 32L, XCB_ATOM_ATOM, 32); - - for (unsigned i = 0; i < prop.nitems; ++i) { - for (wintype_t j = 1; j < NUM_WINTYPES; ++j) { - if (ps->atoms_wintypes[j] == (xcb_atom_t)prop.p32[i]) { - free_winprop(&prop); - return j; - } - } - } - - free_winprop(&prop); - - return WINTYPE_UNKNOWN; -} - -static bool -wid_get_opacity_prop(session_t *ps, xcb_window_t wid, opacity_t def, opacity_t *out) { - bool ret = false; - *out = def; - - winprop_t prop = x_get_prop(ps->c, wid, ps->atoms->a_NET_WM_WINDOW_OPACITY, 1L, - XCB_ATOM_CARDINAL, 32); - - if (prop.nitems) { - *out = *prop.c32; - ret = true; - } - - free_winprop(&prop); - - return ret; -} - -// XXX should distinguish between frame has alpha and window body has alpha -bool win_has_alpha(const struct managed_win *w) { - return w->pictfmt && w->pictfmt->type == XCB_RENDER_PICT_TYPE_DIRECT && - w->pictfmt->direct.alpha_mask; -} - -bool win_client_has_alpha(const struct managed_win *w) { - return w->client_pictfmt && w->client_pictfmt->type == XCB_RENDER_PICT_TYPE_DIRECT && - w->client_pictfmt->direct.alpha_mask; -} - -winmode_t win_calc_mode(const struct managed_win *w) { - if (w->opacity < 1.0) { - return WMODE_TRANS; - } - - if (win_has_alpha(w)) { - if (w->client_win == XCB_NONE) { - // This is a window not managed by the WM, and it has alpha, - // so it's transparent. No need to check WM frame. - return WMODE_TRANS; - } - // The WM window has alpha - if (win_client_has_alpha(w)) { - // The client window also has alpha, the entire window is - // transparent - return WMODE_TRANS; - } - if (win_has_frame(w)) { - // The client window doesn't have alpha, but we have a WM frame - // window, which has alpha. - return WMODE_FRAME_TRANS; - } - // Although the WM window has alpha, the frame window has 0 size, so - // consider the window solid - } - - if (w->frame_opacity != 1.0 && win_has_frame(w)) { - return WMODE_FRAME_TRANS; - } - - // log_trace("Window %#010x(%s) is solid", w->client_win, w->name); - return WMODE_SOLID; -} - -/** - * Calculate and return the opacity target of a window. - * - * The priority of opacity settings are: - * - * inactive_opacity_override (if set, and unfocused) > _NET_WM_WINDOW_OPACITY (if set) > - * opacity-rules (if matched) > window type default opacity > active/inactive opacity - * - * @param ps current session - * @param w struct _win object representing the window - * - * @return target opacity - */ -double win_calc_opacity_target(session_t *ps, const struct managed_win *w) { - double opacity = 1; - - if (w->state == WSTATE_UNMAPPED) { - // be consistent - return 0; - } - if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) { - if (ps->root_desktop_switch_direction) - return w->opacity; - - return 0; - } - // Try obeying opacity property and window type opacity firstly - if (w->has_opacity_prop) { - opacity = ((double)w->opacity_prop) / OPAQUE; - } else if (w->opacity_is_set) { - opacity = w->opacity_set; - } else if (!safe_isnan(ps->o.wintype_option[w->window_type].opacity)) { - opacity = ps->o.wintype_option[w->window_type].opacity; - } else { - // Respect active_opacity only when the window is physically focused - if (win_is_focused_raw(ps, w)) - opacity = ps->o.active_opacity; - else if (!w->focused) - // Respect inactive_opacity in some cases - opacity = ps->o.inactive_opacity; - } - - // respect inactive override - if (ps->o.inactive_opacity_override && !w->focused) { - opacity = ps->o.inactive_opacity; - } - - return opacity; -} - -/** - * Determine whether a window is to be dimmed. - */ -bool win_should_dim(session_t *ps, const struct managed_win *w) { - // Make sure we do nothing if the window is unmapped / being destroyed - if (w->state == WSTATE_UNMAPPED) { - return false; - } - - if (ps->o.inactive_dim > 0 && !(w->focused)) { - return true; - } else { - return false; - } -} - -/** - * Determine if a window should fade on opacity change. - */ -bool win_should_fade(session_t *ps, const struct managed_win *w) { - // To prevent it from being overwritten by last-paint value if the window is - if (w->fade_force != UNSET) { - return w->fade_force; - } - if (ps->o.no_fading_openclose && w->in_openclose) { - return false; - } - if (ps->o.no_fading_destroyed_argb && w->state == WSTATE_DESTROYING && - win_has_alpha(w) && w->client_win && w->client_win != w->base.id) { - // deprecated - return false; - } - if (w->fade_excluded) { - return false; - } - return ps->o.wintype_option[w->window_type].fade; -} - -/** - * Reread _COMPTON_SHADOW property from a window. - * - * The property must be set on the outermost window, usually the WM frame. - */ -void win_update_prop_shadow_raw(session_t *ps, struct managed_win *w) { - winprop_t prop = x_get_prop(ps->c, w->base.id, ps->atoms->a_COMPTON_SHADOW, 1, - XCB_ATOM_CARDINAL, 32); - - if (!prop.nitems) { - w->prop_shadow = -1; - } else { - w->prop_shadow = *prop.c32; - } - - free_winprop(&prop); -} - -static void win_set_shadow(session_t *ps, struct managed_win *w, bool shadow_new) { - if (w->shadow == shadow_new) { - return; - } - - log_debug("Updating shadow property of window %#010x (%s) to %d", w->base.id, - w->name, shadow_new); - - // We don't handle property updates of non-visible windows until they are mapped. - assert(w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && - w->state != WSTATE_UNMAPPING); - - // Keep a copy of window extent before the shadow change. Will be used for - // calculation of damaged region - region_t extents; - pixman_region32_init(&extents); - win_extents(w, &extents); - - // Apply the shadow change - w->shadow = shadow_new; - - if (ps->redirected) { - // Add damage for shadow change - - // Window extents need update on shadow state change - // Shadow geometry currently doesn't change on shadow state change - // calc_shadow_geometry(ps, w); - - // Note: because the release and creation of the shadow images are - // delayed. When multiple shadow changes happen in a row, without - // rendering phase between them, there could be a stale shadow image - // attached to the window even if w->shadow was previously false. And vice - // versa. So we check the STALE flag before asserting the existence of the - // shadow image. - if (w->shadow) { - // Mark the new extents as damaged if the shadow is added - assert(!w->shadow_image || - win_check_flags_all(w, WIN_FLAGS_SHADOW_STALE) || - !ps->o.experimental_backends); - pixman_region32_clear(&extents); - win_extents(w, &extents); - add_damage_from_win(ps, w); - } else { - // Mark the old extents as damaged if the shadow is removed - assert(w->shadow_image || - win_check_flags_all(w, WIN_FLAGS_SHADOW_STALE) || - !ps->o.experimental_backends); - add_damage(ps, &extents); - } - - // Delayed update of shadow image - // By setting WIN_FLAGS_SHADOW_STALE, we ask win_process_flags to - // re-create or release the shaodw in based on whether w->shadow is set. - win_set_flags(w, WIN_FLAGS_SHADOW_STALE); - - // Only set pending_updates if we are redirected. Otherwise change of a - // shadow won't have influence on whether we should redirect. - ps->pending_updates = true; - } - - pixman_region32_fini(&extents); -} - -/** - * Determine if a window should have shadow, and update things depending - * on shadow state. - */ -static void win_determine_shadow(session_t *ps, struct managed_win *w) { - log_debug("Determining shadow of window %#010x (%s)", w->base.id, w->name); - bool shadow_new = w->shadow; - - if (w->shadow_force != UNSET) { - shadow_new = w->shadow_force; - } else if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) { - shadow_new = true; - if (!ps->o.wintype_option[w->window_type].shadow) { - log_debug("Shadow disabled by wintypes"); - shadow_new = false; - } else if (c2_match(ps, w, ps->o.shadow_blacklist, NULL)) { - log_debug("Shadow disabled by shadow-exclude"); - shadow_new = false; - } else if (ps->o.shadow_ignore_shaped && w->bounding_shaped && - !w->rounded_corners) { - log_debug("Shadow disabled by shadow-ignore-shaped"); - shadow_new = false; - } else if (w->prop_shadow == 0) { - log_debug("Shadow disabled by shadow property"); - shadow_new = false; - } - } - - win_set_shadow(ps, w, shadow_new); -} - -/** - * Reread _COMPTON_SHADOW property from a window and update related - * things. - */ -void win_update_prop_shadow(session_t *ps, struct managed_win *w) { - long long attr_shadow_old = w->prop_shadow; - - win_update_prop_shadow_raw(ps, w); - - if (w->prop_shadow != attr_shadow_old) { - win_determine_shadow(ps, w); - } -} - -static void win_determine_clip_shadow_above(session_t *ps, struct managed_win *w) { - bool should_crop = (ps->o.wintype_option[w->window_type].clip_shadow_above || - c2_match(ps, w, ps->o.shadow_clip_list, NULL)); - w->clip_shadow_above = should_crop; -} - -static void win_set_invert_color(session_t *ps, struct managed_win *w, bool invert_color_new) { - if (w->invert_color == invert_color_new) { - return; - } - - w->invert_color = invert_color_new; - - add_damage_from_win(ps, w); -} - -/** - * Determine if a window should have color inverted. - */ -static void win_determine_invert_color(session_t *ps, struct managed_win *w) { - bool invert_color_new = w->invert_color; - - if (UNSET != w->invert_color_force) { - invert_color_new = w->invert_color_force; - } else if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) { - invert_color_new = c2_match(ps, w, ps->o.invert_color_list, NULL); - } - - win_set_invert_color(ps, w, invert_color_new); -} - -/** - * Set w->invert_color_force of a window. - */ -void win_set_invert_color_force(session_t *ps, struct managed_win *w, switch_t val) { - if (val != w->invert_color_force) { - w->invert_color_force = val; - win_determine_invert_color(ps, w); - queue_redraw(ps); - } -} - -/** - * Set w->fade_force of a window. - * - * Doesn't affect fading already in progress - */ -void win_set_fade_force(struct managed_win *w, switch_t val) { - w->fade_force = val; -} - -/** - * Set w->focused_force of a window. - */ -void win_set_focused_force(session_t *ps, struct managed_win *w, switch_t val) { - if (val != w->focused_force) { - w->focused_force = val; - win_on_factor_change(ps, w); - queue_redraw(ps); - } -} - -/** - * Set w->shadow_force of a window. - */ -void win_set_shadow_force(session_t *ps, struct managed_win *w, switch_t val) { - if (val != w->shadow_force) { - w->shadow_force = val; - win_determine_shadow(ps, w); - queue_redraw(ps); - } -} - -static void -win_set_blur_background(session_t *ps, struct managed_win *w, bool blur_background_new) { - if (w->blur_background == blur_background_new) - return; - - w->blur_background = blur_background_new; - - // This damage might not be absolutely necessary (e.g. when the window is opaque), - // but blur_background changes should be rare, so this should be fine. - add_damage_from_win(ps, w); -} - -/** - * Determine if a window should have background blurred. - */ -static void win_determine_blur_background(session_t *ps, struct managed_win *w) { - log_debug("Determining blur-background of window %#010x (%s)", w->base.id, w->name); - if (w->a.map_state != XCB_MAP_STATE_VIEWABLE) { - return; - } - - bool blur_background_new = ps->o.blur_method != BLUR_METHOD_NONE; - if (blur_background_new) { - if (!ps->o.wintype_option[w->window_type].blur_background) { - log_debug("Blur background disabled by wintypes"); - blur_background_new = false; - } else if (c2_match(ps, w, ps->o.blur_background_blacklist, NULL)) { - log_debug("Blur background disabled by blur-background-exclude"); - blur_background_new = false; - } - } - - win_set_blur_background(ps, w, blur_background_new); -} - -/** - * Determine if a window should have rounded corners. - */ -static void win_determine_rounded_corners(session_t *ps, struct managed_win *w) { - if (ps->o.corner_radius == 0) { - w->corner_radius = 0; - return; - } - - // Don't round full screen windows & excluded windows - if ((w && win_is_fullscreen(ps, w)) || - c2_match(ps, w, ps->o.rounded_corners_blacklist, NULL)) { - w->corner_radius = 0; - log_debug("Not rounding corners for window %#010x", w->base.id); - } else { - w->corner_radius = ps->o.corner_radius; - log_debug("Rounding corners for window %#010x", w->base.id); - // Initialize the border color to an invalid value - w->border_col[0] = w->border_col[1] = w->border_col[2] = - w->border_col[3] = -1.0F; - } -} - -/** - * Update window opacity according to opacity rules. - */ -void win_update_opacity_rule(session_t *ps, struct managed_win *w) { - if (w->a.map_state != XCB_MAP_STATE_VIEWABLE) { - return; - } - - double opacity = 1.0; - bool is_set = false; - void *val = NULL; - if (c2_match(ps, w, ps->o.opacity_rules, &val)) { - opacity = ((double)(long)val) / 100.0; - is_set = true; - } - - w->opacity_set = opacity; - w->opacity_is_set = is_set; -} - -/** - * Function to be called on window data changes. - * - * TODO(yshui) need better name - */ -void win_on_factor_change(session_t *ps, struct managed_win *w) { - log_debug("Window %#010x (%s) factor change", w->base.id, w->name); - // Focus needs to be updated first, as other rules might depend on the focused - // state of the window - win_update_focused(ps, w); - - win_determine_shadow(ps, w); - win_determine_clip_shadow_above(ps, w); - win_determine_invert_color(ps, w); - win_determine_blur_background(ps, w); - win_determine_rounded_corners(ps, w); - w->mode = win_calc_mode(w); - log_debug("Window mode changed to %d", w->mode); - win_update_opacity_rule(ps, w); - if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) { - w->paint_excluded = c2_match(ps, w, ps->o.paint_blacklist, NULL); - } - if (w->a.map_state == XCB_MAP_STATE_VIEWABLE) { - w->unredir_if_possible_excluded = - c2_match(ps, w, ps->o.unredir_if_possible_blacklist, NULL); - } - - w->fade_excluded = c2_match(ps, w, ps->o.fade_blacklist, NULL); - - win_update_opacity_target(ps, w); - - w->reg_ignore_valid = false; -} - -/** - * Update cache data in struct _win that depends on window size. - */ -void win_on_win_size_change(session_t *ps, struct managed_win *w) { - w->widthb = w->g.width + w->g.border_width * 2; - w->heightb = w->g.height + w->g.border_width * 2; - w->shadow_dx = ps->o.shadow_offset_x; - w->shadow_dy = ps->o.shadow_offset_y; - w->shadow_width = w->widthb + ps->o.shadow_radius * 2; - w->shadow_height = w->heightb + ps->o.shadow_radius * 2; - - // We don't handle property updates of non-visible windows until they are mapped. - assert(w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && - w->state != WSTATE_UNMAPPING); - - // Invalidate the shadow we built - if (w->state != WSTATE_DESTROYING) - win_set_flags(w, WIN_FLAGS_IMAGES_STALE); - - ps->pending_updates = true; - free_paint(ps, &w->shadow_paint); -} - -/** - * Update window type. - */ -void win_update_wintype(session_t *ps, struct managed_win *w) { - const wintype_t wtype_old = w->window_type; - - // Detect window type here - w->window_type = wid_get_prop_wintype(ps, w->client_win); - - // Conform to EWMH standard, if _NET_WM_WINDOW_TYPE is not present, take - // override-redirect windows or windows without WM_TRANSIENT_FOR as - // _NET_WM_WINDOW_TYPE_NORMAL, otherwise as _NET_WM_WINDOW_TYPE_DIALOG. - if (WINTYPE_UNKNOWN == w->window_type) { - if (w->a.override_redirect || - !wid_has_prop(ps, w->client_win, ps->atoms->aWM_TRANSIENT_FOR)) - w->window_type = WINTYPE_NORMAL; - else - w->window_type = WINTYPE_DIALOG; - } - - if (w->window_type != wtype_old) { - win_on_factor_change(ps, w); - } -} - -/** - * Mark a window as the client window of another. - * - * @param ps current session - * @param w struct _win of the parent window - * @param client window ID of the client window - */ -void win_mark_client(session_t *ps, struct managed_win *w, xcb_window_t client) { - w->client_win = client; - - // If the window isn't mapped yet, stop here, as the function will be - // called in map_win() - if (w->a.map_state != XCB_MAP_STATE_VIEWABLE) { - return; - } - - auto e = xcb_request_check( - ps->c, xcb_change_window_attributes( - ps->c, client, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask(ps, client, WIN_EVMODE_CLIENT)})); - if (e) { - log_error("Failed to change event mask of window %#010x", client); - free(e); - } - - win_update_wintype(ps, w); - - // Get frame widths. The window is in damaged area already. - win_update_frame_extents(ps, w, client); - - // Get window group - if (ps->o.track_leader) { - win_update_leader(ps, w); - } - - // Get window name and class if we are tracking them - win_update_name(ps, w); - win_update_class(ps, w); - win_update_role(ps, w); - - // Update everything related to conditions - win_on_factor_change(ps, w); - - auto r = xcb_get_window_attributes_reply( - ps->c, xcb_get_window_attributes(ps->c, w->client_win), &e); - if (!r) { - log_error_x_error(e, "Failed to get client window attributes"); - return; - } - - w->client_pictfmt = x_get_pictform_for_visual(ps->c, r->visual); - free(r); -} - -/** - * Unmark current client window of a window. - * - * @param ps current session - * @param w struct _win of the parent window - */ -void win_unmark_client(session_t *ps, struct managed_win *w) { - xcb_window_t client = w->client_win; - log_debug("Detaching client window %#010x from frame %#010x (%s)", client, - w->base.id, w->name); - - w->client_win = XCB_NONE; - - // Recheck event mask - xcb_change_window_attributes( - ps->c, client, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask(ps, client, WIN_EVMODE_UNKNOWN)}); -} - -/** - * Look for the client window of a particular window. - */ -static xcb_window_t find_client_win(session_t *ps, xcb_window_t w) { - if (wid_has_prop(ps, w, ps->atoms->aWM_STATE)) { - return w; - } - - xcb_query_tree_reply_t *reply = - xcb_query_tree_reply(ps->c, xcb_query_tree(ps->c, w), NULL); - if (!reply) { - return 0; - } - - xcb_window_t *children = xcb_query_tree_children(reply); - int nchildren = xcb_query_tree_children_length(reply); - int i; - xcb_window_t ret = 0; - - for (i = 0; i < nchildren; ++i) { - if ((ret = find_client_win(ps, children[i]))) { - break; - } - } - - free(reply); - - return ret; -} - -/** - * Recheck client window of a window. - * - * @param ps current session - * @param w struct _win of the parent window - */ -void win_recheck_client(session_t *ps, struct managed_win *w) { - assert(ps->server_grabbed); - // Initialize wmwin to false - w->wmwin = false; - - // Look for the client window - - // Always recursively look for a window with WM_STATE, as Fluxbox - // sets override-redirect flags on all frame windows. - xcb_window_t cw = find_client_win(ps, w->base.id); - if (cw) { - log_debug("(%#010x): client %#010x", w->base.id, cw); - } - // Set a window's client window to itself if we couldn't find a - // client window - if (!cw) { - cw = w->base.id; - w->wmwin = !w->a.override_redirect; - log_debug("(%#010x): client self (%s)", w->base.id, - (w->wmwin ? "wmwin" : "override-redirected")); - } - - // Unmark the old one - if (w->client_win && w->client_win != cw) { - win_unmark_client(ps, w); - } - - // Mark the new one - win_mark_client(ps, w, cw); -} - -/** - * Free all resources in a struct _win. - */ -void free_win_res(session_t *ps, struct managed_win *w) { - // No need to call backend release_image here because - // finish_unmap_win should've done that for us. - // XXX unless we are called by session_destroy - // assert(w->win_data == NULL); - free_win_res_glx(ps, w); - free_paint(ps, &w->paint); - free_paint(ps, &w->shadow_paint); - // Above should be done during unmapping - // Except when we are called by session_destroy - - pixman_region32_fini(&w->bounding_shape); - // BadDamage may be thrown if the window is destroyed - set_ignore_cookie(ps, xcb_damage_destroy(ps->c, w->damage)); - rc_region_unref(&w->reg_ignore); - free(w->name); - free(w->class_instance); - free(w->class_general); - free(w->role); - - free(w->stale_props); - w->stale_props = NULL; - w->stale_props_capacity = 0; -} - -/// Insert a new window after list_node `prev` -/// New window will be in unmapped state -static struct win *add_win(session_t *ps, xcb_window_t id, struct list_node *prev) { - log_debug("Adding window %#010x", id); - struct win *old_w = NULL; - HASH_FIND_INT(ps->windows, &id, old_w); - assert(old_w == NULL); - - auto new_w = cmalloc(struct win); - list_insert_after(prev, &new_w->stack_neighbour); - new_w->id = id; - new_w->managed = false; - new_w->is_new = true; - new_w->destroyed = false; - - HASH_ADD_INT(ps->windows, id, new_w); - ps->pending_updates = true; - return new_w; -} - -/// Insert a new win entry at the top of the stack -struct win *add_win_top(session_t *ps, xcb_window_t id) { - return add_win(ps, id, &ps->window_stack); -} - -/// Insert a new window above window with id `below`, if there is no window, add to top -/// New window will be in unmapped state -struct win *add_win_above(session_t *ps, xcb_window_t id, xcb_window_t below) { - struct win *w = NULL; - HASH_FIND_INT(ps->windows, &below, w); - if (!w) { - if (!list_is_empty(&ps->window_stack)) { - // `below` window is not found even if the window stack is not - // empty - return NULL; - } - return add_win_top(ps, id); - } else { - // we found something from the hash table, so if the stack is empty, - // we are in an inconsistent state. - assert(!list_is_empty(&ps->window_stack)); - return add_win(ps, id, w->stack_neighbour.prev); - } -} - -/// Query the Xorg for information about window `win` -/// `win` pointer might become invalid after this function returns -/// Returns the pointer to the window, might be different from `w` -struct win *fill_win(session_t *ps, struct win *w) { - static const struct managed_win win_def = { - // No need to initialize. (or, you can think that - // they are initialized right here). - // The following ones are updated during paint or paint preprocess - .shadow_opacity = 0.0, - .to_paint = false, - .frame_opacity = 1.0, - .dim = false, - .invert_color = false, - .blur_background = false, - .reg_ignore = NULL, - // The following ones are updated for other reasons - .pixmap_damaged = false, // updated by damage events - .state = WSTATE_UNMAPPED, // updated by window state changes - .in_openclose = true, // set to false after first map is done, - // true here because window is just created - .animation_velocity_x = 0.0, // updated by window geometry changes - .animation_velocity_y = 0.0, // updated by window geometry changes - .animation_velocity_w = 0.0, // updated by window geometry changes - .animation_velocity_h = 0.0, // updated by window geometry changes - .animation_progress = 1.0, // updated by window geometry changes - .animation_inv_og_distance = NAN, // updated by window geometry changes - .reg_ignore_valid = false, // set to true when damaged - .flags = WIN_FLAGS_IMAGES_NONE, // updated by property/attributes/etc - // change - .stale_props = NULL, - .stale_props_capacity = 0, - - // Runtime variables, updated by dbus - .fade_force = UNSET, - .shadow_force = UNSET, - .focused_force = UNSET, - .invert_color_force = UNSET, - - // Initialized in this function - .a = {0}, - .pictfmt = NULL, - .client_pictfmt = NULL, - .widthb = 0, - .heightb = 0, - .shadow_dx = 0, - .shadow_dy = 0, - .shadow_width = 0, - .shadow_height = 0, - .damage = XCB_NONE, - - // Not initialized until mapped, this variables - // have no meaning or have no use until the window - // is mapped - .win_image = NULL, - .old_win_image = NULL, - .shadow_image = NULL, - .prev_trans = NULL, - .shadow = false, - .clip_shadow_above = false, - .xinerama_scr = -1, - .mode = WMODE_TRANS, - .ever_damaged = false, - .client_win = XCB_NONE, - .leader = XCB_NONE, - .cache_leader = XCB_NONE, - .window_type = WINTYPE_UNKNOWN, - .wmwin = false, - .focused = false, - .opacity = 0, - .opacity_target = 0, - .has_opacity_prop = false, - .opacity_prop = OPAQUE, - .opacity_is_set = false, - .opacity_set = 1, - .frame_extents = MARGIN_INIT, // in win_mark_client - .bounding_shaped = false, - .bounding_shape = {0}, - .rounded_corners = false, - .paint_excluded = false, - .fade_excluded = false, - .unredir_if_possible_excluded = false, - .prop_shadow = -1, - // following 4 are set in win_mark_client - .name = NULL, - .class_instance = NULL, - .class_general = NULL, - .role = NULL, - - // Initialized during paint - .paint = PAINT_INIT, - .shadow_paint = PAINT_INIT, - - .corner_radius = 0, - }; - - assert(!w->destroyed); - assert(w->is_new); - - w->is_new = false; - - // Reject overlay window and already added windows - if (w->id == ps->overlay) { - return w; - } - - auto duplicated_win = find_managed_win(ps, w->id); - if (duplicated_win) { - log_debug("Window %#010x (recorded name: %s) added multiple times", w->id, - duplicated_win->name); - return &duplicated_win->base; - } - - log_debug("Managing window %#010x", w->id); - xcb_get_window_attributes_cookie_t acookie = xcb_get_window_attributes(ps->c, w->id); - xcb_get_window_attributes_reply_t *a = - xcb_get_window_attributes_reply(ps->c, acookie, NULL); - if (!a || a->map_state == XCB_MAP_STATE_UNVIEWABLE) { - // Failed to get window attributes or geometry probably means - // the window is gone already. Unviewable means the window is - // already reparented elsewhere. - // BTW, we don't care about Input Only windows, except for stacking - // proposes, so we need to keep track of them still. - free(a); - return w; - } - - if (a->_class == XCB_WINDOW_CLASS_INPUT_ONLY) { - // No need to manage this window, but we still keep it on the window stack - w->managed = false; - free(a); - return w; - } - - // Allocate and initialize the new win structure - auto new_internal = cmalloc(struct managed_win_internal); - auto new = (struct managed_win *)new_internal; - - // Fill structure - // We only need to initialize the part that are not initialized - // by map_win - *new = win_def; - new->base = *w; - new->base.managed = true; - new->a = *a; - pixman_region32_init(&new->bounding_shape); - - free(a); - - xcb_generic_error_t *e; - auto g = xcb_get_geometry_reply(ps->c, xcb_get_geometry(ps->c, w->id), &e); - if (!g) { - log_error_x_error(e, "Failed to get geometry of window %#010x", w->id); - free(e); - free(new); - return w; - } - new->pending_g = (struct win_geometry){ - .x = g->x, - .y = g->y, - .width = g->width, - .height = g->height, - .border_width = g->border_width, - }; - - free(g); - - // Create Damage for window (if not Input Only) - new->damage = x_new_id(ps->c); - e = xcb_request_check( - ps->c, xcb_damage_create_checked(ps->c, new->damage, w->id, - XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY)); - if (e) { - log_error_x_error(e, "Failed to create damage"); - free(e); - free(new); - return w; - } - - // Set window event mask - xcb_change_window_attributes( - ps->c, new->base.id, XCB_CW_EVENT_MASK, - (const uint32_t[]){determine_evmask(ps, new->base.id, WIN_EVMODE_FRAME)}); - - // Get notification when the shape of a window changes - if (ps->shape_exists) { - xcb_shape_select_input(ps->c, new->base.id, 1); - } - - new->pictfmt = x_get_pictform_for_visual(ps->c, new->a.visual); - new->client_pictfmt = NULL; - - list_replace(&w->stack_neighbour, &new->base.stack_neighbour); - struct win *replaced = NULL; - HASH_REPLACE_INT(ps->windows, id, &new->base, replaced); - assert(replaced == w); - free(w); - - // Set all the stale flags on this new window, so it's properties will get updated - // when it's mapped - win_set_flags(new, WIN_FLAGS_CLIENT_STALE | WIN_FLAGS_SIZE_STALE | - WIN_FLAGS_POSITION_STALE | WIN_FLAGS_PROPERTY_STALE | - WIN_FLAGS_FACTOR_CHANGED); - xcb_atom_t init_stale_props[] = { - ps->atoms->a_NET_WM_WINDOW_TYPE, ps->atoms->a_NET_WM_WINDOW_OPACITY, - ps->atoms->a_NET_FRAME_EXTENTS, ps->atoms->aWM_NAME, - ps->atoms->a_NET_WM_NAME, ps->atoms->aWM_CLASS, - ps->atoms->aWM_WINDOW_ROLE, ps->atoms->a_COMPTON_SHADOW, - ps->atoms->aWM_CLIENT_LEADER, ps->atoms->aWM_TRANSIENT_FOR, - }; - win_set_properties_stale(new, init_stale_props, ARR_SIZE(init_stale_props)); - -#ifdef CONFIG_DBUS - // Send D-Bus signal - if (ps->o.dbus) { - cdbus_ev_win_added(ps, &new->base); - } -#endif - return &new->base; -} - -/** - * Set leader of a window. - */ -static inline void win_set_leader(session_t *ps, struct managed_win *w, xcb_window_t nleader) { - // If the leader changes - if (w->leader != nleader) { - xcb_window_t cache_leader_old = win_get_leader(ps, w); - - w->leader = nleader; - - // Forcefully do this to deal with the case when a child window - // gets mapped before parent, or when the window is a waypoint - clear_cache_win_leaders(ps); - - // Update the old and new window group and active_leader if the window - // could affect their state. - xcb_window_t cache_leader = win_get_leader(ps, w); - if (win_is_focused_raw(ps, w) && cache_leader_old != cache_leader) { - ps->active_leader = cache_leader; - - group_on_factor_change(ps, cache_leader_old); - group_on_factor_change(ps, cache_leader); - } - - // Update everything related to conditions - win_on_factor_change(ps, w); - } -} - -/** - * Update leader of a window. - */ -void win_update_leader(session_t *ps, struct managed_win *w) { - xcb_window_t leader = XCB_NONE; - - // Read the leader properties - if (ps->o.detect_transient && !leader) { - leader = - wid_get_prop_window(ps->c, w->client_win, ps->atoms->aWM_TRANSIENT_FOR); - } - - if (ps->o.detect_client_leader && !leader) { - leader = - wid_get_prop_window(ps->c, w->client_win, ps->atoms->aWM_CLIENT_LEADER); - } - - win_set_leader(ps, w, leader); - - log_trace("(%#010x): client %#010x, leader %#010x, cache %#010x", w->base.id, - w->client_win, w->leader, win_get_leader(ps, w)); -} - -/** - * Internal function of win_get_leader(). - */ -static xcb_window_t win_get_leader_raw(session_t *ps, struct managed_win *w, int recursions) { - // Rebuild the cache if needed - if (!w->cache_leader && (w->client_win || w->leader)) { - // Leader defaults to client window - if (!(w->cache_leader = w->leader)) - w->cache_leader = w->client_win; - - // If the leader of this window isn't itself, look for its ancestors - if (w->cache_leader && w->cache_leader != w->client_win) { - auto wp = find_toplevel(ps, w->cache_leader); - if (wp) { - // Dead loop? - if (recursions > WIN_GET_LEADER_MAX_RECURSION) - return XCB_NONE; - - w->cache_leader = win_get_leader_raw(ps, wp, recursions + 1); - } - } - } - - return w->cache_leader; -} - -/** - * Retrieve the WM_CLASS of a window and update its - * win structure. - */ -bool win_update_class(session_t *ps, struct managed_win *w) { - char **strlst = NULL; - int nstr = 0; - - // Can't do anything if there's no client window - if (!w->client_win) - return false; - - // Free and reset old strings - free(w->class_instance); - free(w->class_general); - w->class_instance = NULL; - w->class_general = NULL; - - // Retrieve the property string list - if (!wid_get_text_prop(ps, w->client_win, ps->atoms->aWM_CLASS, &strlst, &nstr)) { - return false; - } - - // Copy the strings if successful - w->class_instance = strdup(strlst[0]); - - if (nstr > 1) { - w->class_general = strdup(strlst[1]); - } - - free(strlst); - - log_trace("(%#010x): client = %#010x, " - "instance = \"%s\", general = \"%s\"", - w->base.id, w->client_win, w->class_instance, w->class_general); - - return true; -} - -/** - * Handle window focus change. - */ -static void win_on_focus_change(session_t *ps, struct managed_win *w) { - // If window grouping detection is enabled - if (ps->o.track_leader) { - xcb_window_t leader = win_get_leader(ps, w); - - // If the window gets focused, replace the old active_leader - if (win_is_focused_raw(ps, w) && leader != ps->active_leader) { - xcb_window_t active_leader_old = ps->active_leader; - - ps->active_leader = leader; - - group_on_factor_change(ps, active_leader_old); - group_on_factor_change(ps, leader); - } - // If the group get unfocused, remove it from active_leader - else if (!win_is_focused_raw(ps, w) && leader && - leader == ps->active_leader && !group_is_focused(ps, leader)) { - ps->active_leader = XCB_NONE; - group_on_factor_change(ps, leader); - } - } - - // Update everything related to conditions - win_on_factor_change(ps, w); - -#ifdef CONFIG_DBUS - // Send D-Bus signal - if (ps->o.dbus) { - if (win_is_focused_raw(ps, w)) { - cdbus_ev_win_focusin(ps, &w->base); - } else { - cdbus_ev_win_focusout(ps, &w->base); - } - } -#endif -} - -/** - * Set real focused state of a window. - */ -void win_set_focused(session_t *ps, struct managed_win *w) { - // Unmapped windows will have their focused state reset on map - if (w->a.map_state != XCB_MAP_STATE_VIEWABLE) { - return; - } - - if (win_is_focused_raw(ps, w)) { - return; - } - - auto old_active_win = ps->active_win; - ps->active_win = w; - assert(win_is_focused_raw(ps, w)); - - if (old_active_win) { - win_on_focus_change(ps, old_active_win); - } - win_on_focus_change(ps, w); -} - -/** - * Get a rectangular region a window (and possibly its shadow) occupies. - * - * Note w->shadow and shadow geometry must be correct before calling this - * function. - */ -void win_extents(const struct managed_win *w, region_t *res) { - pixman_region32_clear(res); - pixman_region32_union_rect(res, res, w->g.x, w->g.y, (uint)w->widthb, (uint)w->heightb); - - if (w->shadow) { - assert(w->shadow_width >= 0 && w->shadow_height >= 0); - pixman_region32_union_rect(res, res, w->g.x + w->shadow_dx, - w->g.y + w->shadow_dy, (uint)w->shadow_width, - (uint)w->shadow_height); - } -} - -gen_by_val(win_extents); - -/** - * Update the out-dated bounding shape of a window. - * - * Mark the window shape as updated - */ -void win_update_bounding_shape(session_t *ps, struct managed_win *w) { - if (ps->shape_exists) { - w->bounding_shaped = win_bounding_shaped(ps, w->base.id); - } - - // We don't handle property updates of non-visible windows until they are mapped. - assert(w->state != WSTATE_UNMAPPED && w->state != WSTATE_DESTROYING && - w->state != WSTATE_UNMAPPING); - - pixman_region32_clear(&w->bounding_shape); - // Start with the window rectangular region - win_get_region_local(w, &w->bounding_shape); - - // Only request for a bounding region if the window is shaped - // (while loop is used to avoid goto, not an actual loop) - while (w->bounding_shaped) { - /* - * if window doesn't exist anymore, this will generate an error - * as well as not generate a region. - */ - - xcb_shape_get_rectangles_reply_t *r = xcb_shape_get_rectangles_reply( - ps->c, - xcb_shape_get_rectangles(ps->c, w->base.id, XCB_SHAPE_SK_BOUNDING), NULL); - - if (!r) { - break; - } - - xcb_rectangle_t *xrects = xcb_shape_get_rectangles_rectangles(r); - int nrects = xcb_shape_get_rectangles_rectangles_length(r); - rect_t *rects = from_x_rects(nrects, xrects); - free(r); - - region_t br; - pixman_region32_init_rects(&br, rects, nrects); - free(rects); - - // Add border width because we are using a different origin. - // X thinks the top left of the inner window is the origin - // (for the bounding shape, althought xcb_get_geometry thinks - // the outer top left (outer means outside of the window - // border) is the origin), - // We think the top left of the border is the origin - pixman_region32_translate(&br, w->g.border_width, w->g.border_width); - - // Intersect the bounding region we got with the window rectangle, to - // make sure the bounding region is not bigger than the window - // rectangle - pixman_region32_intersect(&w->bounding_shape, &w->bounding_shape, &br); - pixman_region32_fini(&br); - break; - } - - if (w->bounding_shaped && ps->o.detect_rounded_corners) { - w->rounded_corners = win_has_rounded_corners(w); - } - - // Window shape changed, we should free old wpaint and shadow pict - // log_trace("free out dated pict"); - win_set_flags(w, WIN_FLAGS_IMAGES_STALE); - ps->pending_updates = true; - - free_paint(ps, &w->paint); - free_paint(ps, &w->shadow_paint); - - win_on_factor_change(ps, w); -} - -/** - * Reread opacity property of a window. - */ -void win_update_opacity_prop(session_t *ps, struct managed_win *w) { - // get frame opacity first - w->has_opacity_prop = wid_get_opacity_prop(ps, w->base.id, OPAQUE, &w->opacity_prop); - - if (w->has_opacity_prop) { - // opacity found - return; - } - - if (ps->o.detect_client_opacity && w->client_win && w->base.id == w->client_win) { - // checking client opacity not allowed - return; - } - - // get client opacity - w->has_opacity_prop = - wid_get_opacity_prop(ps, w->client_win, OPAQUE, &w->opacity_prop); -} - -/** - * Retrieve frame extents from a window. - */ -void win_update_frame_extents(session_t *ps, struct managed_win *w, xcb_window_t client) { - winprop_t prop = x_get_prop(ps->c, client, ps->atoms->a_NET_FRAME_EXTENTS, 4L, - XCB_ATOM_CARDINAL, 32); - - if (prop.nitems == 4) { - int extents[4]; - for (int i = 0; i < 4; i++) { - if (prop.c32[i] > (uint32_t)INT_MAX) { - log_warn("Your window manager sets a absurd " - "_NET_FRAME_EXTENTS value (%u), ignoring it.", - prop.c32[i]); - memset(extents, 0, sizeof(extents)); - break; - } - extents[i] = (int)prop.c32[i]; - } - - const bool changed = w->frame_extents.left != extents[0] || - w->frame_extents.right != extents[1] || - w->frame_extents.top != extents[2] || - w->frame_extents.bottom != extents[3]; - w->frame_extents.left = extents[0]; - w->frame_extents.right = extents[1]; - w->frame_extents.top = extents[2]; - w->frame_extents.bottom = extents[3]; - - // If frame_opacity != 1, then frame of this window - // is not included in reg_ignore of underneath windows - if (ps->o.frame_opacity == 1 && changed) { - w->reg_ignore_valid = false; - } - } - - log_trace("(%#010x): %d, %d, %d, %d", w->base.id, w->frame_extents.left, - w->frame_extents.right, w->frame_extents.top, w->frame_extents.bottom); - - free_winprop(&prop); -} - -bool win_is_region_ignore_valid(session_t *ps, const struct managed_win *w) { - win_stack_foreach_managed(i, &ps->window_stack) { - if (i == w) { - break; - } - if (!i->reg_ignore_valid) { - return false; - } - } - return true; -} - -/** - * Stop listening for events on a particular window. - */ -void win_ev_stop(session_t *ps, const struct win *w) { - xcb_change_window_attributes(ps->c, w->id, XCB_CW_EVENT_MASK, (const uint32_t[]){0}); - - if (!w->managed) { - return; - } - - auto mw = (struct managed_win *)w; - if (mw->client_win) { - xcb_change_window_attributes(ps->c, mw->client_win, XCB_CW_EVENT_MASK, - (const uint32_t[]){0}); - } - - if (ps->shape_exists) { - xcb_shape_select_input(ps->c, w->id, 0); - } -} - -/// Finish the unmapping of a window (e.g. after fading has finished). -/// Doesn't free `w` -static void unmap_win_finish(session_t *ps, struct managed_win *w) { - w->reg_ignore_valid = false; - w->state = WSTATE_UNMAPPED; - - // We are in unmap_win, this window definitely was viewable - if (ps->backend_data) { - // Only the pixmap needs to be freed and reacquired when mapping. - // Shadow image can be preserved. - if (!win_check_flags_all(w, WIN_FLAGS_PIXMAP_NONE)) { - win_release_pixmap(ps->backend_data, w); - win_release_oldpixmap(ps->backend_data, w); - } - } else { - assert(!w->win_image); - assert(!w->old_win_image); - assert(!w->shadow_image); - } - - // Force animation to completed position - w->animation_velocity_x = 0; - w->animation_velocity_y = 0; - w->animation_velocity_w = 0; - w->animation_velocity_h = 0; - w->animation_progress = 1.0; - - free_paint(ps, &w->paint); - free_paint(ps, &w->shadow_paint); - - // Try again at binding images when the window is mapped next time - win_clear_flags(w, WIN_FLAGS_IMAGE_ERROR); - - // Flag window so that it gets animated when it reapears - // in case it wasn't destroyed - win_set_flags(w, WIN_FLAGS_POSITION_STALE); - win_set_flags(w, WIN_FLAGS_SIZE_STALE); -} - -/// Finish the destruction of a window (e.g. after fading has finished). -/// Frees `w` -static void destroy_win_finish(session_t *ps, struct win *w) { - log_trace("Trying to finish destroying (%#010x)", w->id); - - auto next_w = win_stack_find_next_managed(ps, &w->stack_neighbour); - list_remove(&w->stack_neighbour); - - if (w->managed) { - auto mw = (struct managed_win *)w; - - if (mw->state != WSTATE_UNMAPPED) { - // Only UNMAPPED state has window resources freed, otherwise - // we need to call unmap_win_finish to free them. - // XXX actually we unmap_win_finish only frees the rendering - // resources, we still need to call free_win_res. will fix - // later. - unmap_win_finish(ps, mw); - } - - // Unmapping preserves the shadow image, so free it here - if (!win_check_flags_all(mw, WIN_FLAGS_SHADOW_NONE)) { - assert(mw->shadow_image != NULL); - win_release_shadow(ps->backend_data, mw); - } - - // Invalidate reg_ignore of windows below this one - // TODO(yshui) what if next_w is not mapped?? - /* TODO(yshui) seriously figure out how reg_ignore behaves. - * I think if `w` is unmapped, and destroyed after - * paint happened at least once, w->reg_ignore_valid would - * be true, and there is no need to invalid w->next->reg_ignore - * when w is destroyed. */ - if (next_w) { - rc_region_unref(&next_w->reg_ignore); - next_w->reg_ignore_valid = false; - } - - if (mw == ps->active_win) { - // Usually, the window cannot be the focused at destruction. - // FocusOut should be generated before the window is destroyed. We - // do this check just to be completely sure we don't have dangling - // references. - log_debug("window %#010x (%s) is destroyed while being focused", - w->id, mw->name); - ps->active_win = NULL; - } - - free_win_res(ps, mw); - - // Drop w from all prev_trans to avoid accessing freed memory in - // repair_win() - // TODO(yshui) there can only be one prev_trans pointing to w - win_stack_foreach_managed(w2, &ps->window_stack) { - if (mw == w2->prev_trans) { - w2->prev_trans = NULL; - } - } - } - - free(w); -} - -static void map_win_finish(struct managed_win *w) { - w->in_openclose = false; - w->state = WSTATE_MAPPED; -} - -/// Move window `w` so it's before `next` in the list -static inline void restack_win(session_t *ps, struct win *w, struct list_node *next) { - struct managed_win *mw = NULL; - if (w->managed) { - mw = (struct managed_win *)w; - } - - if (mw) { - // This invalidates all reg_ignore below the new stack position of `w` - mw->reg_ignore_valid = false; - rc_region_unref(&mw->reg_ignore); - - // This invalidates all reg_ignore below the old stack position of `w` - auto next_w = win_stack_find_next_managed(ps, &w->stack_neighbour); - if (next_w) { - next_w->reg_ignore_valid = false; - rc_region_unref(&next_w->reg_ignore); - } - } - - list_move_before(&w->stack_neighbour, next); - - // add damage for this window - if (mw) { - add_damage_from_win(ps, mw); - } - -#ifdef DEBUG_RESTACK - log_trace("Window stack modified. Current stack:"); - for (auto c = ps->list; c; c = c->next) { - const char *desc = ""; - if (c->state == WSTATE_DESTROYING) { - desc = "(D) "; - } - log_trace("%#010x \"%s\" %s", c->id, c->name, desc); - } -#endif -} - -/// Move window `w` so it's right above `below` -void restack_above(session_t *ps, struct win *w, xcb_window_t below) { - xcb_window_t old_below; - - if (!list_node_is_last(&ps->window_stack, &w->stack_neighbour)) { - old_below = list_next_entry(w, stack_neighbour)->id; - } else { - old_below = XCB_NONE; - } - log_debug("Restack %#010x (%s), old_below: %#010x, new_below: %#010x", w->id, - win_get_name_if_managed(w), old_below, below); - - if (old_below != below) { - struct list_node *new_next; - if (!below) { - new_next = &ps->window_stack; - } else { - struct win *tmp_w = NULL; - HASH_FIND_INT(ps->windows, &below, tmp_w); - - if (!tmp_w) { - log_error("Failed to found new below window %#010x.", below); - return; - } - - new_next = &tmp_w->stack_neighbour; - } - restack_win(ps, w, new_next); - } -} - -void restack_bottom(session_t *ps, struct win *w) { - restack_above(ps, w, 0); -} - -void restack_top(session_t *ps, struct win *w) { - log_debug("Restack %#010x (%s) to top", w->id, win_get_name_if_managed(w)); - if (&w->stack_neighbour == ps->window_stack.next) { - // already at top - return; - } - restack_win(ps, w, ps->window_stack.next); -} - -/// Start destroying a window. Windows cannot always be destroyed immediately -/// because of fading and such. -/// -/// @return whether the window has finished destroying and is freed -bool destroy_win_start(session_t *ps, struct win *w) { - auto mw = (struct managed_win *)w; - assert(w); - - log_debug("Destroying %#010x \"%s\", managed = %d", w->id, - (w->managed ? mw->name : NULL), w->managed); - - // Delete destroyed window from the hash table, even though the window might still - // be rendered for a while. We need to make sure future window with the same - // window id won't confuse us. Keep the window in the window stack if it's managed - // and mapped, since we might still need to render it (e.g. fading out). Window - // will be removed from the stack when it finishes destroying. - HASH_DEL(ps->windows, w); - - if (!w->managed || mw->state == WSTATE_UNMAPPED) { - // Window is already unmapped, or is an unmanged window, just destroy it - destroy_win_finish(ps, w); - return true; - } - - if (w->managed) { - // Clear IMAGES_STALE flags since the window is destroyed: Clear - // PIXMAP_STALE as there is no pixmap available anymore, so STALE doesn't - // make sense. - // XXX Clear SHADOW_STALE as setting/clearing flags on a destroyed window - // doesn't work leading to an inconsistent state where the shadow is - // refreshed but the flags are stuck in STALE. - // Do this before changing the window state to destroying - win_clear_flags(mw, WIN_FLAGS_IMAGES_STALE); - - // If size/shape/position information is stale, win_process_update_flags - // will update them and add the new window extents to damage. Since the - // window has been destroyed, we cannot get the complete information at - // this point, so we just add what we currently have to the damage. - if (win_check_flags_any(mw, WIN_FLAGS_SIZE_STALE | WIN_FLAGS_POSITION_STALE)) { - add_damage_from_win(ps, mw); - } - - // Clear some flags about stale window information. Because now the window - // is destroyed, we can't update them anyway. - win_clear_flags(mw, WIN_FLAGS_SIZE_STALE | WIN_FLAGS_POSITION_STALE | - WIN_FLAGS_PROPERTY_STALE | - WIN_FLAGS_FACTOR_CHANGED | WIN_FLAGS_CLIENT_STALE); - - // Update state flags of a managed window - mw->state = WSTATE_DESTROYING; - mw->a.map_state = XCB_MAP_STATE_UNMAPPED; - mw->in_openclose = true; - } - - // don't need win_ev_stop because the window is gone anyway -#ifdef CONFIG_DBUS - // Send D-Bus signal - if (ps->o.dbus) { - cdbus_ev_win_destroyed(ps, w); - } -#endif - - if (!ps->redirected) { - // Skip transition if we are not rendering - return win_skip_fading(ps, mw); - } - - return false; -} - -void unmap_win_start(session_t *ps, struct managed_win *w) { - assert(w); - assert(w->base.managed); - assert(w->a._class != XCB_WINDOW_CLASS_INPUT_ONLY); - - log_debug("Unmapping %#010x \"%s\"", w->base.id, w->name); - - if (unlikely(w->state == WSTATE_DESTROYING)) { - log_warn("Trying to undestroy a window?"); - assert(false); - } - - bool was_damaged = w->ever_damaged; - w->ever_damaged = false; - - if (unlikely(w->state == WSTATE_UNMAPPING || w->state == WSTATE_UNMAPPED)) { - if (win_check_flags_all(w, WIN_FLAGS_MAPPED)) { - // Clear the pending map as this window is now unmapped - win_clear_flags(w, WIN_FLAGS_MAPPED); - } else { - log_warn("Trying to unmapping an already unmapped window %#010x " - "\"%s\"", - w->base.id, w->name); - assert(false); - } - return; - } - - // Note we don't update focused window here. This will either be - // triggered by subsequence Focus{In, Out} event, or by recheck_focus - - w->a.map_state = XCB_MAP_STATE_UNMAPPED; - w->state = WSTATE_UNMAPPING; - w->opacity_target_old = fmax(w->opacity_target, w->opacity_target_old); - w->opacity_target = win_calc_opacity_target(ps, w); - - if (ps->o.animations && - ps->o.animation_for_unmap_window != OPEN_WINDOW_ANIMATION_NONE && - ps->o.wintype_option[w->window_type].animation != 0) - { - init_animation_unmap(ps, w); - - double x_dist = w->animation_dest_center_x - w->animation_center_x; - double y_dist = w->animation_dest_center_y - w->animation_center_y; - double w_dist = w->animation_dest_w - w->animation_w; - double h_dist = w->animation_dest_h - w->animation_h; - w->animation_inv_og_distance = - 1.0 / sqrt(x_dist * x_dist + y_dist * y_dist + - w_dist * w_dist + h_dist * h_dist); - - if (isinf(w->animation_inv_og_distance)) - w->animation_inv_og_distance = 0; - - w->animation_progress = 0.0; - - if (w->old_win_image) { - ps->backend_data->ops->release_image(ps->backend_data, - w->old_win_image); - w->old_win_image = NULL; - } - } - -#ifdef CONFIG_DBUS - // Send D-Bus signal - if (ps->o.dbus) { - cdbus_ev_win_unmapped(ps, &w->base); - } -#endif - - if (!ps->redirected || !was_damaged) { - // If we are not redirected, we skip fading because we aren't rendering - // anything anyway. - // If the window wasn't ever damaged, it shouldn't be painted either. But - // a fading out window is always painted, so we have to skip fading here. - CHECK(!win_skip_fading(ps, w)); - } -} - -/** - * Execute fade callback of a window if fading finished. - * - * @return whether the window is destroyed and freed - */ -bool win_check_fade_finished(session_t *ps, struct managed_win *w) { - if (w->state == WSTATE_MAPPED || w->state == WSTATE_UNMAPPED) { - // No fading in progress - assert(w->opacity_target == w->opacity); - return false; - } - - if (w->opacity == w->opacity_target) { - switch (w->state) { - case WSTATE_UNMAPPING: unmap_win_finish(ps, w); return false; - case WSTATE_DESTROYING: destroy_win_finish(ps, &w->base); return true; - case WSTATE_MAPPING: map_win_finish(w); return false; - case WSTATE_FADING: w->state = WSTATE_MAPPED; break; - default: unreachable; - } - } - - return false; -} - -/// Skip the current in progress fading of window, -/// transition the window straight to its end state -/// -/// @return whether the window is destroyed and freed -bool win_skip_fading(session_t *ps, struct managed_win *w) { - if (w->state == WSTATE_MAPPED || w->state == WSTATE_UNMAPPED) { - assert(w->opacity_target == w->opacity); - return false; - } - log_debug("Skipping fading process of window %#010x (%s)", w->base.id, w->name); - w->opacity = w->opacity_target; - - if (w->animation_progress < 1) { - w->animation_progress = 1; - w->g.x = w->pending_g.x; - w->g.y = w->pending_g.y; - w->g.width = w->pending_g.width; - w->g.height = w->pending_g.height; - } - - return win_check_fade_finished(ps, w); -} - -/** - * Get the Xinerama screen a window is on. - * - * Return an index >= 0, or -1 if not found. - * - * TODO(yshui) move to x.c - * TODO(yshui) use xrandr - */ -void win_update_screen(int nscreens, region_t *screens, struct managed_win *w) { - w->xinerama_scr = -1; - - for (int i = 0; i < nscreens; i++) { - auto e = pixman_region32_extents(&screens[i]); - if (e->x1 <= w->g.x && e->y1 <= w->g.y && e->x2 >= w->g.x + w->widthb && - e->y2 >= w->g.y + w->heightb) { - w->xinerama_scr = i; - log_debug("Window %#010x (%s), %dx%d+%dx%d, is on screen %d " - "(%dx%d+%dx%d)", - w->base.id, w->name, w->g.x, w->g.y, w->widthb, w->heightb, - i, e->x1, e->y1, e->x2 - e->x1, e->y2 - e->y1); - return; - } - } - log_debug("Window %#010x (%s), %dx%d+%dx%d, is not contained by any screen", - w->base.id, w->name, w->g.x, w->g.y, w->g.width, w->g.height); -} - -/// Map an already registered window -void map_win_start(session_t *ps, struct managed_win *w) { - assert(ps->server_grabbed); - assert(w); - - // Don't care about window mapping if it's an InputOnly window - // Also, try avoiding mapping a window twice - if (w->a._class == XCB_WINDOW_CLASS_INPUT_ONLY) { - return; - } - - log_debug("Mapping (%#010x \"%s\")", w->base.id, w->name); - - assert(w->state != WSTATE_DESTROYING); - if (w->state != WSTATE_UNMAPPED && w->state != WSTATE_UNMAPPING) { - log_warn("Mapping an already mapped window"); - return; - } - - if (w->state == WSTATE_UNMAPPING) { - CHECK(!win_skip_fading(ps, w)); - // We skipped the unmapping process, the window was rendered, now it is - // not anymore. So we need to mark the then unmapping window as damaged. - // - // Solves problem when, for example, a window is unmapped then mapped in a - // different location - add_damage_from_win(ps, w); - assert(w); - } - - assert(w->state == WSTATE_UNMAPPED); - - // Rant: window size could change after we queried its geometry here and before - // we get its pixmap. Later, when we get back to the event processing loop, we - // will get the notification about size change from Xserver and try to refresh the - // pixmap, while the pixmap is actually already up-to-date (i.e. the notification - // is stale). There is basically no real way to prevent this, aside from grabbing - // the server. - - // XXX Can we assume map_state is always viewable? - w->a.map_state = XCB_MAP_STATE_VIEWABLE; - - // Update window mode here to check for ARGB windows - w->mode = win_calc_mode(w); - - log_debug("Window (%#010x) has type %s", w->base.id, WINTYPES[w->window_type]); - - // XXX We need to make sure that win_data is available - // iff `state` is MAPPED - w->state = WSTATE_MAPPING; - w->opacity_target_old = 0; - w->opacity_target = win_calc_opacity_target(ps, w); - - log_debug("Window %#010x has opacity %f, opacity target is %f", w->base.id, - w->opacity, w->opacity_target); - - // Cannot set w->ever_damaged = false here, since window mapping could be - // delayed, so a damage event might have already arrived before this function - // is called. But this should be unnecessary in the first place, since - // ever_damaged is set to false in unmap_win_finish anyway. - - // Sets the WIN_FLAGS_IMAGES_STALE flag so later in the critical section - // the window's image will be bound - - win_set_flags(w, WIN_FLAGS_PIXMAP_STALE); - -#ifdef CONFIG_DBUS - // Send D-Bus signal - if (ps->o.dbus) { - cdbus_ev_win_mapped(ps, &w->base); - } -#endif - - if (!ps->redirected) { - CHECK(!win_skip_fading(ps, w)); - } -} - -/** - * Update target window opacity depending on the current state. - */ -void win_update_opacity_target(session_t *ps, struct managed_win *w) { - auto opacity_target_old = w->opacity_target; - w->opacity_target = win_calc_opacity_target(ps, w); - - if (opacity_target_old == w->opacity_target) { - return; - } - - if (w->state == WSTATE_MAPPED) { - // Opacity target changed while MAPPED. Transition to FADING. - assert(w->opacity == opacity_target_old); - w->opacity_target_old = opacity_target_old; - w->state = WSTATE_FADING; - log_debug("Window %#010x (%s) opacity %f, opacity target %f, set " - "old target %f", - w->base.id, w->name, w->opacity, w->opacity_target, - w->opacity_target_old); - } else if (w->state == WSTATE_MAPPING) { - // Opacity target changed while fading in. - if (w->opacity >= w->opacity_target) { - // Already reached new target opacity. Transition to - // FADING. - map_win_finish(w); - w->opacity_target_old = fmax(opacity_target_old, w->opacity); - w->state = WSTATE_FADING; - log_debug("Window %#010x (%s) opacity %f already reached " - "new opacity target %f while mapping, set old " - "target %f", - w->base.id, w->name, w->opacity, w->opacity_target, - w->opacity_target_old); - } - } else if (w->state == WSTATE_FADING) { - // Opacity target changed while FADING. - if ((w->opacity < opacity_target_old && w->opacity > w->opacity_target) || - (w->opacity > opacity_target_old && w->opacity < w->opacity_target)) { - // Changed while fading in and will fade out or while - // fading out and will fade in. - w->opacity_target_old = opacity_target_old; - log_debug("Window %#010x (%s) opacity %f already reached " - "new opacity target %f while fading, set " - "old target %f", - w->base.id, w->name, w->opacity, w->opacity_target, - w->opacity_target_old); - } - } - - if (!ps->redirected) { - CHECK(!win_skip_fading(ps, w)); - } -} - -/** - * Find a managed window from window id in window linked list of the session. - */ -struct win *find_win(session_t *ps, xcb_window_t id) { - if (!id) { - return NULL; - } - - struct win *w = NULL; - HASH_FIND_INT(ps->windows, &id, w); - assert(w == NULL || !w->destroyed); - return w; -} - -/** - * Find a managed window from window id in window linked list of the session. - */ -struct managed_win *find_managed_win(session_t *ps, xcb_window_t id) { - struct win *w = find_win(ps, id); - if (!w || !w->managed) { - return NULL; - } - - auto mw = (struct managed_win *)w; - assert(mw->state != WSTATE_DESTROYING); - return mw; -} - -/** - * Find out the WM frame of a client window using existing data. - * - * @param id window ID - * @return struct win object of the found window, NULL if not found - */ -struct managed_win *find_toplevel(session_t *ps, xcb_window_t id) { - if (!id) { - return NULL; - } - - HASH_ITER2(ps->windows, w) { - assert(!w->destroyed); - if (!w->managed) { - continue; - } - - auto mw = (struct managed_win *)w; - if (mw->client_win == id) { - return mw; - } - } - - return NULL; -} - -/** - * Find a managed window that is, or is a parent of `wid`. - * - * @param ps current session - * @param wid window ID - * @return struct _win object of the found window, NULL if not found - */ -struct managed_win *find_managed_window_or_parent(session_t *ps, xcb_window_t wid) { - // TODO(yshui) this should probably be an "update tree", then find_toplevel. - // current approach is a bit more "racy", as the server state might be ahead of - // our state - struct win *w = NULL; - - // We traverse through its ancestors to find out the frame - // Using find_win here because if we found a unmanaged window we know about, we - // can stop early. - while (wid && wid != ps->root && !(w = find_win(ps, wid))) { - // xcb_query_tree probably fails if you run picom when X is somehow - // initializing (like add it in .xinitrc). In this case - // just leave it alone. - auto reply = xcb_query_tree_reply(ps->c, xcb_query_tree(ps->c, wid), NULL); - if (reply == NULL) { - break; - } - - wid = reply->parent; - free(reply); - } - - if (w == NULL || !w->managed) { - return NULL; - } - - return (struct managed_win *)w; -} - -/** - * Check if a rectangle includes the whole screen. - */ -static inline bool rect_is_fullscreen(const session_t *ps, int x, int y, int wid, int hei) { - return (x <= 0 && y <= 0 && (x + wid) >= ps->root_width && (y + hei) >= ps->root_height); -} - -/** - * Check if a window is fulscreen using EWMH - * - * TODO(yshui) cache this property - */ -static inline bool -win_is_fullscreen_xcb(xcb_connection_t *c, const struct atom *a, const xcb_window_t w) { - xcb_get_property_cookie_t prop = - xcb_get_property(c, 0, w, a->a_NET_WM_STATE, XCB_ATOM_ATOM, 0, 12); - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, prop, NULL); - if (!reply) { - return false; - } - - if (reply->length) { - xcb_atom_t *val = xcb_get_property_value(reply); - for (uint32_t i = 0; i < reply->length; i++) { - if (val[i] != a->a_NET_WM_STATE_FULLSCREEN) { - continue; - } - free(reply); - return true; - } - } - free(reply); - return false; -} - -/// Set flags on a window. Some sanity checks are performed -void win_set_flags(struct managed_win *w, uint64_t flags) { - log_debug("Set flags %" PRIu64 " to window %#010x (%s)", flags, w->base.id, w->name); - if (unlikely(w->state == WSTATE_DESTROYING)) { - log_error("Flags set on a destroyed window %#010x (%s)", w->base.id, w->name); - return; - } - - w->flags |= flags; -} - -/// Clear flags on a window. Some sanity checks are performed -void win_clear_flags(struct managed_win *w, uint64_t flags) { - log_debug("Clear flags %" PRIu64 " from window %#010x (%s)", flags, w->base.id, - w->name); - if (unlikely(w->state == WSTATE_DESTROYING)) { - log_warn("Flags cleared on a destroyed window %#010x (%s)", w->base.id, - w->name); - return; - } - - w->flags = w->flags & (~flags); -} - -void win_set_properties_stale(struct managed_win *w, const xcb_atom_t *props, int nprops) { - const auto bits_per_element = sizeof(*w->stale_props) * 8; - size_t new_capacity = w->stale_props_capacity; - - // Calculate the new capacity of the properties array - for (int i = 0; i < nprops; i++) { - if (props[i] >= new_capacity * bits_per_element) { - new_capacity = props[i] / bits_per_element + 1; - } - } - - // Reallocate if necessary - if (new_capacity > w->stale_props_capacity) { - w->stale_props = - realloc(w->stale_props, new_capacity * sizeof(*w->stale_props)); - - // Clear the content of the newly allocated bytes - memset(w->stale_props + w->stale_props_capacity, 0, - (new_capacity - w->stale_props_capacity) * sizeof(*w->stale_props)); - w->stale_props_capacity = new_capacity; - } - - // Set the property bits - for (int i = 0; i < nprops; i++) { - w->stale_props[props[i] / bits_per_element] |= - 1UL << (props[i] % bits_per_element); - } - win_set_flags(w, WIN_FLAGS_PROPERTY_STALE); -} - -static void win_clear_all_properties_stale(struct managed_win *w) { - memset(w->stale_props, 0, w->stale_props_capacity * sizeof(*w->stale_props)); - win_clear_flags(w, WIN_FLAGS_PROPERTY_STALE); -} - -static bool win_fetch_and_unset_property_stale(struct managed_win *w, xcb_atom_t prop) { - const auto bits_per_element = sizeof(*w->stale_props) * 8; - if (prop >= w->stale_props_capacity * bits_per_element) { - return false; - } - - const auto mask = 1UL << (prop % bits_per_element); - bool ret = w->stale_props[prop / bits_per_element] & mask; - w->stale_props[prop / bits_per_element] &= ~mask; - return ret; -} - -bool win_check_flags_any(struct managed_win *w, uint64_t flags) { - return (w->flags & flags) != 0; -} - -bool win_check_flags_all(struct managed_win *w, uint64_t flags) { - return (w->flags & flags) == flags; -} - -/** - * Check if a window is a fullscreen window. - * - * It's not using w->border_size for performance measures. - */ -bool win_is_fullscreen(const session_t *ps, const struct managed_win *w) { - if (!ps->o.no_ewmh_fullscreen && - win_is_fullscreen_xcb(ps->c, ps->atoms, w->client_win)) { - return true; - } - return rect_is_fullscreen(ps, w->g.x, w->g.y, w->widthb, w->heightb) && - (!w->bounding_shaped || w->rounded_corners); -} - -/** - * Check if a window has BYPASS_COMPOSITOR property set - * - * TODO(yshui) cache this property - */ -bool win_is_bypassing_compositor(const session_t *ps, const struct managed_win *w) { - bool ret = false; - - auto prop = x_get_prop(ps->c, w->client_win, ps->atoms->a_NET_WM_BYPASS_COMPOSITOR, - 1L, XCB_ATOM_CARDINAL, 32); - - if (prop.nitems && *prop.c32 == 1) { - ret = true; - } - - free_winprop(&prop); - return ret; -} - -/** - * Check if a window is focused, without using any focus rules or forced focus settings - */ -bool win_is_focused_raw(const session_t *ps, const struct managed_win *w) { - return w->a.map_state == XCB_MAP_STATE_VIEWABLE && ps->active_win == w; -} - -// Find the managed window immediately below `i` in the window stack -struct managed_win * -win_stack_find_next_managed(const session_t *ps, const struct list_node *i) { - while (!list_node_is_last(&ps->window_stack, i)) { - auto next = list_entry(i->next, struct win, stack_neighbour); - if (next->managed) { - return (struct managed_win *)next; - } - i = &next->stack_neighbour; - } - return NULL; -} - -/// Return whether this window is mapped on the X server side -bool win_is_mapped_in_x(const struct managed_win *w) { - return w->state == WSTATE_MAPPING || w->state == WSTATE_FADING || - w->state == WSTATE_MAPPED || w->state == WSTATE_UNMAPPING || - w->state == WSTATE_DESTROYING || (w->flags & WIN_FLAGS_MAPPED); -} diff --git a/dwm/picom/src/win.h b/dwm/picom/src/win.h deleted file mode 100644 index 3cd2ed7..0000000 --- a/dwm/picom/src/win.h +++ /dev/null @@ -1,533 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2011-2013, Christopher Jeffrey -// Copyright (c) 2013 Richard Grenville -#pragma once -#include -#include -#include -#include - -#include "uthash_extra.h" - -// FIXME shouldn't need this -#ifdef CONFIG_OPENGL -#include -#endif - -#include "c2.h" -#include "compiler.h" -#include "list.h" -#include "region.h" -#include "render.h" -#include "types.h" -#include "utils.h" -#include "win_defs.h" -#include "x.h" - -struct backend_base; -typedef struct session session_t; -typedef struct _glx_texture glx_texture_t; - -#define win_stack_foreach_managed(w, win_stack) \ - list_foreach(struct managed_win, w, win_stack, base.stack_neighbour) if (w->base.managed) - -#define win_stack_foreach_managed_safe(w, win_stack) \ - list_foreach_safe(struct managed_win, w, win_stack, \ - base.stack_neighbour) if (w->base.managed) - -#ifdef CONFIG_OPENGL -// FIXME this type should be in opengl.h -// it is very unideal for it to be here -typedef struct { - /// Framebuffer used for blurring. - GLuint fbo; - /// Textures used for blurring. - GLuint textures[2]; - /// Width of the textures. - int width; - /// Height of the textures. - int height; -} glx_blur_cache_t; -#endif - -/// An entry in the window stack. May or may not correspond to a window we know about. -struct window_stack_entry { - struct list_node stack_neighbour; - /// The actual window correspond to this stack entry. NULL if we didn't know about - /// this window (e.g. an InputOnly window, or we haven't handled the window - /// creation yet) - struct win *win; - /// The window id. Might not be unique in the stack, because there might be - /// destroyed window still fading out in the stack. - xcb_window_t id; -}; - -/** - * About coordinate systems - * - * In general, X is the horizontal axis, Y is the vertical axis. - * X goes from left to right, Y goes downwards. - * - * Global: the origin is the top left corner of the Xorg screen. - * Local: the origin is the top left corner of the window, border is - * considered part of the window. - */ - -/// Structure representing a top-level managed window. -typedef struct win win; -struct win { - UT_hash_handle hh; - struct list_node stack_neighbour; - /// ID of the top-level frame window. - xcb_window_t id; - /// Whether the window is destroyed from Xorg's perspective - bool destroyed : 1; - /// True if we just received CreateNotify, and haven't queried X for any info - /// about the window - bool is_new : 1; - /// True if this window is managed, i.e. this struct is actually a `managed_win`. - /// Always false if `is_new` is true. - bool managed : 1; -}; - -struct win_geometry { - int16_t x; - int16_t y; - uint16_t width; - uint16_t height; - uint16_t border_width; -}; - -struct managed_win { - struct win base; - /// backend data attached to this window. Only available when - /// `state` is not UNMAPPED - void *win_image; - void *old_win_image; // Old window image for interpolating window contents during animations - void *shadow_image; - /// Pointer to the next higher window to paint. - struct managed_win *prev_trans; - /// Number of windows above this window - int stacking_rank; - // TODO(yshui) rethink reg_ignore - - // Core members - /// The "mapped state" of this window, doesn't necessary - /// match X mapped state, because of fading. - winstate_t state; - /// Window attributes. - xcb_get_window_attributes_reply_t a; - /// The geometry of the window body, excluding the window border region. - struct win_geometry g; - /// Updated geometry received in events - struct win_geometry pending_g; - /// Xinerama screen this window is on. - int xinerama_scr; - /// Window visual pict format - const xcb_render_pictforminfo_t *pictfmt; - /// Client window visual pict format - const xcb_render_pictforminfo_t *client_pictfmt; - /// Window painting mode. - winmode_t mode; - /// Whether the window has been damaged at least once. - bool ever_damaged; - /// Whether the window was damaged after last paint. - bool pixmap_damaged; - /// Damage of the window. - xcb_damage_damage_t damage; - /// Paint info of the window. - paint_t paint; - /// bitmap for properties which needs to be updated - uint64_t *stale_props; - /// number of uint64_ts that has been allocated for stale_props - size_t stale_props_capacity; - - /// Bounding shape of the window. In local coordinates. - /// See above about coordinate systems. - region_t bounding_shape; - /// Window flags. Definitions above. - uint64_t flags; - /// The region of screen that will be obscured when windows above is painted, - /// in global coordinates. - /// We use this to reduce the pixels that needed to be paint when painting - /// this window and anything underneath. Depends on window frame - /// opacity state, window geometry, window mapped/unmapped state, - /// window mode of the windows above. DOES NOT INCLUDE the body of THIS WINDOW. - /// NULL means reg_ignore has not been calculated for this window. - rc_region_t *reg_ignore; - /// Whether the reg_ignore of all windows beneath this window are valid - bool reg_ignore_valid; - /// Cached width/height of the window including border. - int widthb, heightb; - /// Whether the window is bounding-shaped. - bool bounding_shaped; - /// Whether the window just have rounded corners. - bool rounded_corners; - /// Whether this window is to be painted. - bool to_paint; - /// Whether the window is painting excluded. - bool paint_excluded; - /// Whether the window is unredirect-if-possible excluded. - bool unredir_if_possible_excluded; - /// Whether this window is in open/close state. - bool in_openclose; - /// Whether this window should ignore all animations - bool animation_ignore; - /// Whether this window was transient when animated on open - bool animation_transient; - /// Current position and destination, for animation - double animation_center_x, animation_center_y; - double animation_dest_center_x, animation_dest_center_y; - double animation_w, animation_h; - double animation_dest_w, animation_dest_h; - /// Spring animation velocity - double animation_velocity_x, animation_velocity_y; - double animation_velocity_w, animation_velocity_h; - /// Track animation progress; goes from 0 to 1 - double animation_progress; - /// Inverse of the window distance at the start of animation, for - /// tracking animation progress - double animation_inv_og_distance; - - // Client window related members - /// ID of the top-level client window of the window. - xcb_window_t client_win; - /// Type of the window. - wintype_t window_type; - /// Whether it looks like a WM window. We consider a window WM window if - /// it does not have a decedent with WM_STATE and it is not override- - /// redirected itself. - bool wmwin; - /// Leader window ID of the window. - xcb_window_t leader; - /// Cached topmost window ID of the window. - xcb_window_t cache_leader; - - // Focus-related members - /// Whether the window is to be considered focused. - bool focused; - /// Override value of window focus state. Set by D-Bus method calls. - switch_t focused_force; - - // Blacklist related members - /// Name of the window. - char *name; - /// Window instance class of the window. - char *class_instance; - /// Window general class of the window. - char *class_general; - /// WM_WINDOW_ROLE value of the window. - char *role; - - // Opacity-related members - /// Current window opacity. - double opacity; - /// Target window opacity. - double opacity_target; - /// Previous window opacity. - double opacity_target_old; - /// true if window (or client window, for broken window managers - /// not transferring client window's _NET_WM_WINDOW_OPACITY value) has opacity prop - bool has_opacity_prop; - /// Cached value of opacity window attribute. - opacity_t opacity_prop; - /// true if opacity is set by some rules - bool opacity_is_set; - /// Last window opacity value set by the rules. - double opacity_set; - - /// Radius of rounded window corners - int corner_radius; - float border_col[4]; - - // Fading-related members - /// Override value of window fade state. Set by D-Bus method calls. - switch_t fade_force; - /// Whether fading is excluded by the rules. Calculated. - bool fade_excluded; - - // Frame-opacity-related members - /// Current window frame opacity. Affected by window opacity. - double frame_opacity; - /// Frame extents. Acquired from _NET_FRAME_EXTENTS. - margin_t frame_extents; - - // Shadow-related members - /// Whether a window has shadow. Calculated. - bool shadow; - /// Override value of window shadow state. Set by D-Bus method calls. - switch_t shadow_force; - /// Opacity of the shadow. Affected by window opacity and frame opacity. - double shadow_opacity; - /// X offset of shadow. Affected by commandline argument. - int shadow_dx; - /// Y offset of shadow. Affected by commandline argument. - int shadow_dy; - /// Width of shadow. Affected by window size and commandline argument. - int shadow_width; - /// Height of shadow. Affected by window size and commandline argument. - int shadow_height; - /// Picture to render shadow. Affected by window size. - paint_t shadow_paint; - /// The value of _COMPTON_SHADOW attribute of the window. Below 0 for - /// none. - long long prop_shadow; - /// Do not paint shadow over this window. - bool clip_shadow_above; - - // Dim-related members - /// Whether the window is to be dimmed. - bool dim; - - /// Whether to invert window color. - bool invert_color; - /// Override value of window color inversion state. Set by D-Bus method - /// calls. - switch_t invert_color_force; - - /// Whether to blur window background. - bool blur_background; - -#ifdef CONFIG_OPENGL - /// Textures and FBO background blur use. - glx_blur_cache_t glx_blur_cache; - /// Background texture of the window - glx_texture_t *glx_texture_bg; -#endif -}; - -/// Process pending updates/images flags on a window. Has to be called in X critical -/// section -void win_process_update_flags(session_t *ps, struct managed_win *w); -void win_process_image_flags(session_t *ps, struct managed_win *w); -/// Bind a shadow to the window, with color `c` and shadow kernel `kernel` -bool win_bind_shadow(struct backend_base *b, struct managed_win *w, struct color c, - struct conv *kernel); - -/// Start the unmap of a window. We cannot unmap immediately since we might need to fade -/// the window out. -void unmap_win_start(struct session *, struct managed_win *); - -/// Start the mapping of a window. We cannot map immediately since we might need to fade -/// the window in. -void map_win_start(struct session *, struct managed_win *); - -/// Start the destroying of a window. Windows cannot always be destroyed immediately -/// because of fading and such. -bool must_use destroy_win_start(session_t *ps, struct win *w); - -/// Release images bound with a window, set the *_NONE flags on the window. Only to be -/// used when de-initializing the backend outside of win.c -void win_release_images(struct backend_base *base, struct managed_win *w); -winmode_t attr_pure win_calc_mode(const struct managed_win *w); -void win_set_shadow_force(session_t *ps, struct managed_win *w, switch_t val); -void win_set_fade_force(struct managed_win *w, switch_t val); -void win_set_focused_force(session_t *ps, struct managed_win *w, switch_t val); -void win_set_invert_color_force(session_t *ps, struct managed_win *w, switch_t val); -/** - * Set real focused state of a window. - */ -void win_set_focused(session_t *ps, struct managed_win *w); -bool attr_pure win_should_fade(session_t *ps, const struct managed_win *w); -void win_on_factor_change(session_t *ps, struct managed_win *w); -/** - * Update cache data in struct _win that depends on window size. - */ -void win_on_win_size_change(session_t *ps, struct managed_win *w); -void win_unmark_client(session_t *ps, struct managed_win *w); -void win_recheck_client(session_t *ps, struct managed_win *w); - -/** - * Calculate and return the opacity target of a window. - * - * The priority of opacity settings are: - * - * inactive_opacity_override (if set, and unfocused) > _NET_WM_WINDOW_OPACITY (if set) > - * opacity-rules (if matched) > window type default opacity > active/inactive opacity - * - * @param ps current session - * @param w struct _win object representing the window - * - * @return target opacity - */ -double attr_pure win_calc_opacity_target(session_t *ps, const struct managed_win *w); -bool attr_pure win_should_dim(session_t *ps, const struct managed_win *w); -void win_update_screen(int nscreens, region_t *screens, struct managed_win *w); -/** - * Retrieve the bounding shape of a window. - */ -// XXX was win_border_size -void win_update_bounding_shape(session_t *ps, struct managed_win *w); -/** - * Check if a window has BYPASS_COMPOSITOR property set - */ -bool win_is_bypassing_compositor(const session_t *ps, const struct managed_win *w); -/** - * Get a rectangular region in global coordinates a window (and possibly - * its shadow) occupies. - * - * Note w->shadow and shadow geometry must be correct before calling this - * function. - */ -void win_extents(const struct managed_win *w, region_t *res); -region_t win_extents_by_val(const struct managed_win *w); -/** - * Add a window to damaged area. - * - * @param ps current session - * @param w struct _win element representing the window - */ -void add_damage_from_win(session_t *ps, const struct managed_win *w); -/** - * Get a rectangular region a window occupies, excluding frame and shadow. - * - * Return region in global coordinates. - */ -void win_get_region_noframe_local(const struct managed_win *w, region_t *); -void win_get_region_noframe_local_without_corners(const struct managed_win *w, region_t *); - -/// Get the region for the frame of the window -void win_get_region_frame_local(const struct managed_win *w, region_t *res); -/// Get the region for the frame of the window, by value -region_t win_get_region_frame_local_by_val(const struct managed_win *w); -/// Insert a new window above window with id `below`, if there is no window, add to top -/// New window will be in unmapped state -struct win *add_win_above(session_t *ps, xcb_window_t id, xcb_window_t below); -/// Insert a new win entry at the top of the stack -struct win *add_win_top(session_t *ps, xcb_window_t id); -/// Query the Xorg for information about window `win` -/// `win` pointer might become invalid after this function returns -struct win *fill_win(session_t *ps, struct win *win); -/// Move window `w` to be right above `below` -void restack_above(session_t *ps, struct win *w, xcb_window_t below); -/// Move window `w` to the bottom of the stack -void restack_bottom(session_t *ps, struct win *w); -/// Move window `w` to the top of the stack -void restack_top(session_t *ps, struct win *w); - -/** - * Execute fade callback of a window if fading finished. - */ -bool must_use win_check_fade_finished(session_t *ps, struct managed_win *w); - -// Stop receiving events (except ConfigureNotify, XXX why?) from a window -void win_ev_stop(session_t *ps, const struct win *w); - -/// Skip the current in progress fading of window, -/// transition the window straight to its end state -/// -/// @return whether the window is destroyed and freed -bool must_use win_skip_fading(session_t *ps, struct managed_win *w); -/** - * Find a managed window from window id in window linked list of the session. - */ -struct managed_win *find_managed_win(session_t *ps, xcb_window_t id); -struct win *find_win(session_t *ps, xcb_window_t id); -struct managed_win *find_toplevel(session_t *ps, xcb_window_t id); -/** - * Find a managed window that is, or is a parent of `wid`. - * - * @param ps current session - * @param wid window ID - * @return struct _win object of the found window, NULL if not found - */ -struct managed_win *find_managed_window_or_parent(session_t *ps, xcb_window_t wid); - -/** - * Check if a window is a fullscreen window. - * - * It's not using w->border_size for performance measures. - */ -bool attr_pure win_is_fullscreen(const session_t *ps, const struct managed_win *w); - -/** - * Check if a window is focused, without using any focus rules or forced focus settings - */ -bool attr_pure win_is_focused_raw(const session_t *ps, const struct managed_win *w); - -/// check if window has ARGB visual -bool attr_pure win_has_alpha(const struct managed_win *w); - -/// check if reg_ignore_valid is true for all windows above us -bool attr_pure win_is_region_ignore_valid(session_t *ps, const struct managed_win *w); - -/// Whether a given window is mapped on the X server side -bool win_is_mapped_in_x(const struct managed_win *w); - -// Find the managed window immediately below `w` in the window stack -struct managed_win *attr_pure win_stack_find_next_managed(const session_t *ps, - const struct list_node *w); -/// Set flags on a window. Some sanity checks are performed -void win_set_flags(struct managed_win *w, uint64_t flags); -/// Clear flags on a window. Some sanity checks are performed -void win_clear_flags(struct managed_win *w, uint64_t flags); -/// Returns true if any of the flags in `flags` is set -bool win_check_flags_any(struct managed_win *w, uint64_t flags); -/// Returns true if all of the flags in `flags` are set -bool win_check_flags_all(struct managed_win *w, uint64_t flags); -/// Mark properties as stale for a window -void win_set_properties_stale(struct managed_win *w, const xcb_atom_t *prop, int nprops); - -static inline attr_unused void win_set_property_stale(struct managed_win *w, xcb_atom_t prop) { - return win_set_properties_stale(w, (xcb_atom_t[]){prop}, 1); -} - -/// Free all resources in a struct win -void free_win_res(session_t *ps, struct managed_win *w); - -static inline void win_region_remove_corners(const struct managed_win *w, region_t *res) { - region_t corners; - pixman_region32_init_rects( - &corners, - (rect_t[]){ - {.x1 = 0, .y1 = 0, .x2 = w->corner_radius, .y2 = w->corner_radius}, - {.x1 = 0, .y1 = w->heightb - w->corner_radius, .x2 = w->corner_radius, .y2 = w->heightb}, - {.x1 = w->widthb - w->corner_radius, .y1 = 0, .x2 = w->widthb, .y2 = w->corner_radius}, - {.x1 = w->widthb - w->corner_radius, - .y1 = w->heightb - w->corner_radius, - .x2 = w->widthb, - .y2 = w->heightb}, - }, - 4); - pixman_region32_subtract(res, res, &corners); - pixman_region32_fini(&corners); -} - -static inline region_t attr_unused win_get_bounding_shape_global_by_val(struct managed_win *w) { - region_t ret; - pixman_region32_init(&ret); - pixman_region32_copy(&ret, &w->bounding_shape); - pixman_region32_translate(&ret, w->g.x, w->g.y); - return ret; -} - -static inline region_t -win_get_bounding_shape_global_without_corners_by_val(struct managed_win *w) { - region_t ret; - pixman_region32_init(&ret); - pixman_region32_copy(&ret, &w->bounding_shape); - win_region_remove_corners(w, &ret); - pixman_region32_translate(&ret, w->g.x, w->g.y); - return ret; -} - -/** - * Calculate the extents of the frame of the given window based on EWMH - * _NET_FRAME_EXTENTS and the X window border width. - */ -static inline margin_t attr_pure attr_unused win_calc_frame_extents(const struct managed_win *w) { - margin_t result = w->frame_extents; - result.top = max2(result.top, w->g.border_width); - result.left = max2(result.left, w->g.border_width); - result.bottom = max2(result.bottom, w->g.border_width); - result.right = max2(result.right, w->g.border_width); - return result; -} - -/** - * Check whether a window has WM frames. - */ -static inline bool attr_pure attr_unused win_has_frame(const struct managed_win *w) { - return w->g.border_width || w->frame_extents.top || w->frame_extents.left || - w->frame_extents.right || w->frame_extents.bottom; -} diff --git a/dwm/picom/src/win_defs.h b/dwm/picom/src/win_defs.h deleted file mode 100644 index e032bc7..0000000 --- a/dwm/picom/src/win_defs.h +++ /dev/null @@ -1,102 +0,0 @@ -#pragma once -#include - -typedef enum { - WINTYPE_UNKNOWN, - WINTYPE_DESKTOP, - WINTYPE_DOCK, - WINTYPE_TOOLBAR, - WINTYPE_MENU, - WINTYPE_UTILITY, - WINTYPE_SPLASH, - WINTYPE_DIALOG, - WINTYPE_NORMAL, - WINTYPE_DROPDOWN_MENU, - WINTYPE_POPUP_MENU, - WINTYPE_TOOLTIP, - WINTYPE_NOTIFICATION, - WINTYPE_COMBO, - WINTYPE_DND, - NUM_WINTYPES -} wintype_t; - -/// Enumeration type of window painting mode. -typedef enum { - WMODE_TRANS, // The window body is (potentially) transparent - WMODE_FRAME_TRANS, // The window body is opaque, but the frame is not - WMODE_SOLID, // The window is opaque including the frame -} winmode_t; - -/// Transition table: -/// (DESTROYED is when the win struct is destroyed and freed) -/// ('o' means in all other cases) -/// (Window is created in the UNMAPPED state) -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | |UNMAPPING|DESTROYING|MAPPING|FADING |UNMAPPED| MAPPED |DESTROYED| -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | UNMAPPING | o | Window |Window | - | Fading | - | - | -/// | | |destroyed |mapped | |finished| | | -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | DESTROYING | - | o | - | - | - | - | Fading | -/// | | | | | | | |finished | -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | MAPPING | Window | Window | o |Opacity| - | Fading | - | -/// | |unmapped |destroyed | |change | |finished| | -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | FADING | Window | Window | - | o | - | Fading | - | -/// | |unmapped |destroyed | | | |finished| | -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | UNMAPPED | - | - |Window | - | o | - | Window | -/// | | | |mapped | | | |destroyed| -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -/// | MAPPED | Window | Window | - |Opacity| - | o | - | -/// | |unmapped |destroyed | |change | | | | -/// +-------------+---------+----------+-------+-------+--------+--------+---------+ -typedef enum { - // The window is being faded out because it's unmapped. - WSTATE_UNMAPPING, - // The window is being faded out because it's destroyed, - WSTATE_DESTROYING, - // The window is being faded in - WSTATE_MAPPING, - // Window opacity is not at the target level - WSTATE_FADING, - // The window is mapped, no fading is in progress. - WSTATE_MAPPED, - // The window is unmapped, no fading is in progress. - WSTATE_UNMAPPED, -} winstate_t; - -enum win_flags { - // Note: *_NONE flags are mostly redudant and meant for detecting logical errors - // in the code - - /// pixmap is out of date, will be update in win_process_flags - WIN_FLAGS_PIXMAP_STALE = 1, - /// window does not have pixmap bound - WIN_FLAGS_PIXMAP_NONE = 2, - /// there was an error trying to bind the images - WIN_FLAGS_IMAGE_ERROR = 4, - /// shadow is out of date, will be updated in win_process_flags - WIN_FLAGS_SHADOW_STALE = 8, - /// shadow has not been generated - WIN_FLAGS_SHADOW_NONE = 16, - /// the client window needs to be updated - WIN_FLAGS_CLIENT_STALE = 32, - /// the window is mapped by X, we need to call map_win_start for it - WIN_FLAGS_MAPPED = 64, - /// this window has properties which needs to be updated - WIN_FLAGS_PROPERTY_STALE = 128, - // TODO(yshui) _maybe_ split SIZE_STALE into SIZE_STALE and SHAPE_STALE - /// this window has an unhandled size/shape change - WIN_FLAGS_SIZE_STALE = 256, - /// this window has an unhandled position (i.e. x and y) change - WIN_FLAGS_POSITION_STALE = 512, - /// need better name for this, is set when some aspects of the window changed - WIN_FLAGS_FACTOR_CHANGED = 1024, -}; - -static const uint64_t WIN_FLAGS_IMAGES_STALE = - WIN_FLAGS_PIXMAP_STALE | WIN_FLAGS_SHADOW_STALE; - -#define WIN_FLAGS_IMAGES_NONE (WIN_FLAGS_PIXMAP_NONE | WIN_FLAGS_SHADOW_NONE) diff --git a/dwm/picom/src/x.c b/dwm/picom/src/x.c deleted file mode 100644 index 795211d..0000000 --- a/dwm/picom/src/x.c +++ /dev/null @@ -1,744 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "atom.h" -#ifdef CONFIG_OPENGL -#include "backend/gl/glx.h" -#endif -#include "common.h" -#include "compiler.h" -#include "kernel.h" -#include "log.h" -#include "region.h" -#include "utils.h" -#include "x.h" - -/** - * Get a specific attribute of a window. - * - * Returns a blank structure if the returned type and format does not - * match the requested type and format. - * - * @param ps current session - * @param w window - * @param atom atom of attribute to fetch - * @param length length to read - * @param rtype atom of the requested type - * @param rformat requested format - * @return a winprop_t structure containing the attribute - * and number of items. A blank one on failure. - */ -winprop_t x_get_prop_with_offset(xcb_connection_t *c, xcb_window_t w, xcb_atom_t atom, - int offset, int length, xcb_atom_t rtype, int rformat) { - xcb_get_property_reply_t *r = xcb_get_property_reply( - c, - xcb_get_property(c, 0, w, atom, rtype, to_u32_checked(offset), - to_u32_checked(length)), - NULL); - - if (r && xcb_get_property_value_length(r) && - (rtype == XCB_GET_PROPERTY_TYPE_ANY || r->type == rtype) && - (!rformat || r->format == rformat) && - (r->format == 8 || r->format == 16 || r->format == 32)) { - auto len = xcb_get_property_value_length(r); - return (winprop_t){ - .ptr = xcb_get_property_value(r), - .nitems = (ulong)(len / (r->format / 8)), - .type = r->type, - .format = r->format, - .r = r, - }; - } - - free(r); - return (winprop_t){ - .ptr = NULL, .nitems = 0, .type = XCB_GET_PROPERTY_TYPE_ANY, .format = 0}; -} - -/// Get the type, format and size in bytes of a window's specific attribute. -winprop_info_t x_get_prop_info(xcb_connection_t *c, xcb_window_t w, xcb_atom_t atom) { - xcb_generic_error_t *e = NULL; - auto r = xcb_get_property_reply( - c, xcb_get_property(c, 0, w, atom, XCB_ATOM_ANY, 0, 0), &e); - if (!r) { - log_debug_x_error(e, "Failed to get property info for window %#010x", w); - free(e); - return (winprop_info_t){ - .type = XCB_GET_PROPERTY_TYPE_ANY, .format = 0, .length = 0}; - } - - winprop_info_t winprop_info = { - .type = r->type, .format = r->format, .length = r->bytes_after}; - free(r); - - return winprop_info; -} - -/** - * Get the value of a type-xcb_window_t property of a window. - * - * @return the value if successful, 0 otherwise - */ -xcb_window_t wid_get_prop_window(xcb_connection_t *c, xcb_window_t wid, xcb_atom_t aprop) { - // Get the attribute - xcb_window_t p = XCB_NONE; - winprop_t prop = x_get_prop(c, wid, aprop, 1L, XCB_ATOM_WINDOW, 32); - - // Return it - if (prop.nitems) { - p = (xcb_window_t)*prop.p32; - } - - free_winprop(&prop); - - return p; -} - -/** - * Get the value of a text property of a window. - */ -bool wid_get_text_prop(session_t *ps, xcb_window_t wid, xcb_atom_t prop, char ***pstrlst, - int *pnstr) { - assert(ps->server_grabbed); - auto prop_info = x_get_prop_info(ps->c, wid, prop); - auto type = prop_info.type; - auto format = prop_info.format; - auto length = prop_info.length; - - if (type == XCB_ATOM_NONE) { - return false; - } - - if (type != XCB_ATOM_STRING && type != ps->atoms->aUTF8_STRING && - type != ps->atoms->aC_STRING) { - log_warn("Text property %d of window %#010x has unsupported type: %d", - prop, wid, type); - return false; - } - - if (format != 8) { - log_warn("Text property %d of window %#010x has unexpected format: %d", - prop, wid, format); - return false; - } - - xcb_generic_error_t *e = NULL; - auto word_count = (length + 4 - 1) / 4; - auto r = xcb_get_property_reply( - ps->c, xcb_get_property(ps->c, 0, wid, prop, type, 0, word_count), &e); - if (!r) { - log_debug_x_error(e, "Failed to get window property for %#010x", wid); - free(e); - return false; - } - - assert(length == (uint32_t)xcb_get_property_value_length(r)); - - void *data = xcb_get_property_value(r); - unsigned int nstr = 0; - uint32_t current_offset = 0; - while (current_offset < length) { - current_offset += - (uint32_t)strnlen(data + current_offset, length - current_offset) + 1; - nstr += 1; - } - - if (nstr == 0) { - // The property is set to an empty string, in that case, we return one - // string - char **strlst = malloc(sizeof(char *)); - strlst[0] = ""; - *pnstr = 1; - *pstrlst = strlst; - free(r); - return true; - } - - // Allocate the pointers and the strings together - void *buf = NULL; - if (posix_memalign(&buf, alignof(char *), length + sizeof(char *) * nstr + 1) != 0) { - abort(); - } - - char *strlst = buf + sizeof(char *) * nstr; - memcpy(strlst, xcb_get_property_value(r), length); - strlst[length] = '\0'; // X strings aren't guaranteed to be null terminated - - char **ret = buf; - current_offset = 0; - nstr = 0; - while (current_offset < length) { - ret[nstr] = strlst + current_offset; - current_offset += (uint32_t)strlen(strlst + current_offset) + 1; - nstr += 1; - } - - *pnstr = to_int_checked(nstr); - *pstrlst = ret; - free(r); - return true; -} - -// A cache of pict formats. We assume they don't change during the lifetime -// of this program -static thread_local xcb_render_query_pict_formats_reply_t *g_pictfmts = NULL; - -static inline void x_get_server_pictfmts(xcb_connection_t *c) { - if (g_pictfmts) { - return; - } - xcb_generic_error_t *e = NULL; - // Get window picture format - g_pictfmts = - xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), &e); - if (e || !g_pictfmts) { - log_fatal("failed to get pict formats\n"); - abort(); - } -} - -const xcb_render_pictforminfo_t * -x_get_pictform_for_visual(xcb_connection_t *c, xcb_visualid_t visual) { - x_get_server_pictfmts(c); - - xcb_render_pictvisual_t *pv = xcb_render_util_find_visual_format(g_pictfmts, visual); - for (xcb_render_pictforminfo_iterator_t i = - xcb_render_query_pict_formats_formats_iterator(g_pictfmts); - i.rem; xcb_render_pictforminfo_next(&i)) { - if (i.data->id == pv->format) { - return i.data; - } - } - return NULL; -} - -static xcb_visualid_t attr_pure x_get_visual_for_pictfmt(xcb_render_query_pict_formats_reply_t *r, - xcb_render_pictformat_t fmt) { - for (auto screen = xcb_render_query_pict_formats_screens_iterator(r); screen.rem; - xcb_render_pictscreen_next(&screen)) { - for (auto depth = xcb_render_pictscreen_depths_iterator(screen.data); - depth.rem; xcb_render_pictdepth_next(&depth)) { - for (auto pv = xcb_render_pictdepth_visuals_iterator(depth.data); - pv.rem; xcb_render_pictvisual_next(&pv)) { - if (pv.data->format == fmt) { - return pv.data->visual; - } - } - } - } - return XCB_NONE; -} - -xcb_visualid_t x_get_visual_for_standard(xcb_connection_t *c, xcb_pict_standard_t std) { - x_get_server_pictfmts(c); - - auto pictfmt = xcb_render_util_find_standard_format(g_pictfmts, std); - - return x_get_visual_for_pictfmt(g_pictfmts, pictfmt->id); -} - -xcb_render_pictformat_t -x_get_pictfmt_for_standard(xcb_connection_t *c, xcb_pict_standard_t std) { - x_get_server_pictfmts(c); - - auto pictfmt = xcb_render_util_find_standard_format(g_pictfmts, std); - - return pictfmt->id; -} - -int x_get_visual_depth(xcb_connection_t *c, xcb_visualid_t visual) { - auto setup = xcb_get_setup(c); - for (auto screen = xcb_setup_roots_iterator(setup); screen.rem; - xcb_screen_next(&screen)) { - for (auto depth = xcb_screen_allowed_depths_iterator(screen.data); - depth.rem; xcb_depth_next(&depth)) { - const int len = xcb_depth_visuals_length(depth.data); - const xcb_visualtype_t *visuals = xcb_depth_visuals(depth.data); - for (int i = 0; i < len; i++) { - if (visual == visuals[i].visual_id) { - return depth.data->depth; - } - } - } - } - return -1; -} - -xcb_render_picture_t -x_create_picture_with_pictfmt_and_pixmap(xcb_connection_t *c, - const xcb_render_pictforminfo_t *pictfmt, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - void *buf = NULL; - if (attr) { - xcb_render_create_picture_value_list_serialize(&buf, valuemask, attr); - if (!buf) { - log_error("failed to serialize picture attributes"); - return XCB_NONE; - } - } - - xcb_render_picture_t tmp_picture = x_new_id(c); - xcb_generic_error_t *e = - xcb_request_check(c, xcb_render_create_picture_checked( - c, tmp_picture, pixmap, pictfmt->id, valuemask, buf)); - free(buf); - if (e) { - log_error_x_error(e, "failed to create picture"); - return XCB_NONE; - } - return tmp_picture; -} - -xcb_render_picture_t -x_create_picture_with_visual_and_pixmap(xcb_connection_t *c, xcb_visualid_t visual, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - const xcb_render_pictforminfo_t *pictfmt = x_get_pictform_for_visual(c, visual); - return x_create_picture_with_pictfmt_and_pixmap(c, pictfmt, pixmap, valuemask, attr); -} - -xcb_render_picture_t -x_create_picture_with_standard_and_pixmap(xcb_connection_t *c, xcb_pict_standard_t standard, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - x_get_server_pictfmts(c); - - auto pictfmt = xcb_render_util_find_standard_format(g_pictfmts, standard); - assert(pictfmt); - return x_create_picture_with_pictfmt_and_pixmap(c, pictfmt, pixmap, valuemask, attr); -} - -xcb_render_picture_t -x_create_picture_with_standard(xcb_connection_t *c, xcb_drawable_t d, int w, int h, - xcb_pict_standard_t standard, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - x_get_server_pictfmts(c); - - auto pictfmt = xcb_render_util_find_standard_format(g_pictfmts, standard); - assert(pictfmt); - return x_create_picture_with_pictfmt(c, d, w, h, pictfmt, valuemask, attr); -} - -/** - * Create an picture. - */ -xcb_render_picture_t -x_create_picture_with_pictfmt(xcb_connection_t *c, xcb_drawable_t d, int w, int h, - const xcb_render_pictforminfo_t *pictfmt, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - uint8_t depth = pictfmt->depth; - - xcb_pixmap_t tmp_pixmap = x_create_pixmap(c, depth, d, w, h); - if (!tmp_pixmap) { - return XCB_NONE; - } - - xcb_render_picture_t picture = x_create_picture_with_pictfmt_and_pixmap( - c, pictfmt, tmp_pixmap, valuemask, attr); - - xcb_free_pixmap(c, tmp_pixmap); - - return picture; -} - -xcb_render_picture_t -x_create_picture_with_visual(xcb_connection_t *c, xcb_drawable_t d, int w, int h, - xcb_visualid_t visual, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) { - auto pictfmt = x_get_pictform_for_visual(c, visual); - return x_create_picture_with_pictfmt(c, d, w, h, pictfmt, valuemask, attr); -} - -bool x_fetch_region(xcb_connection_t *c, xcb_xfixes_region_t r, pixman_region32_t *res) { - xcb_generic_error_t *e = NULL; - xcb_xfixes_fetch_region_reply_t *xr = - xcb_xfixes_fetch_region_reply(c, xcb_xfixes_fetch_region(c, r), &e); - if (!xr) { - log_error_x_error(e, "Failed to fetch rectangles"); - return false; - } - - int nrect = xcb_xfixes_fetch_region_rectangles_length(xr); - auto b = ccalloc(nrect, pixman_box32_t); - xcb_rectangle_t *xrect = xcb_xfixes_fetch_region_rectangles(xr); - for (int i = 0; i < nrect; i++) { - b[i] = (pixman_box32_t){.x1 = xrect[i].x, - .y1 = xrect[i].y, - .x2 = xrect[i].x + xrect[i].width, - .y2 = xrect[i].y + xrect[i].height}; - } - bool ret = pixman_region32_init_rects(res, b, nrect); - free(b); - free(xr); - return ret; -} - -void x_set_picture_clip_region(xcb_connection_t *c, xcb_render_picture_t pict, - int16_t clip_x_origin, int16_t clip_y_origin, - const region_t *reg) { - int nrects; - const rect_t *rects = pixman_region32_rectangles((region_t *)reg, &nrects); - auto xrects = ccalloc(nrects, xcb_rectangle_t); - for (int i = 0; i < nrects; i++) { - xrects[i] = (xcb_rectangle_t){ - .x = to_i16_checked(rects[i].x1), - .y = to_i16_checked(rects[i].y1), - .width = to_u16_checked(rects[i].x2 - rects[i].x1), - .height = to_u16_checked(rects[i].y2 - rects[i].y1), - }; - } - - xcb_generic_error_t *e = xcb_request_check( - c, xcb_render_set_picture_clip_rectangles_checked( - c, pict, clip_x_origin, clip_y_origin, to_u32_checked(nrects), xrects)); - if (e) { - log_error_x_error(e, "Failed to set clip region"); - free(e); - } - free(xrects); -} - -void x_clear_picture_clip_region(xcb_connection_t *c, xcb_render_picture_t pict) { - xcb_render_change_picture_value_list_t v = {.clipmask = XCB_NONE}; - xcb_generic_error_t *e = xcb_request_check( - c, xcb_render_change_picture(c, pict, XCB_RENDER_CP_CLIP_MASK, &v)); - if (e) { - log_error_x_error(e, "failed to clear clip region"); - free(e); - } -} - -enum { - XSyncBadCounter = 0, - XSyncBadAlarm = 1, - XSyncBadFence = 2, -}; - -/** - * Convert a X11 error to string - * - * @return a pointer to a string. this pointer shouldn NOT be freed, same buffer is used - * for multiple calls to this function, - */ -static const char * -_x_strerror(unsigned long serial, uint8_t major, uint16_t minor, uint8_t error_code) { - session_t *const ps = ps_g; - - int o = 0; - const char *name = "Unknown"; - -#define CASESTRRET(s) \ - case s: \ - name = #s; \ - break - -#define CASESTRRET2(s) \ - case XCB_##s: name = #s; break - - // TODO(yshui) separate error code out from session_t - o = error_code - ps->xfixes_error; - switch (o) { CASESTRRET2(XFIXES_BAD_REGION); } - - o = error_code - ps->damage_error; - switch (o) { CASESTRRET2(DAMAGE_BAD_DAMAGE); } - - o = error_code - ps->render_error; - switch (o) { - CASESTRRET2(RENDER_PICT_FORMAT); - CASESTRRET2(RENDER_PICTURE); - CASESTRRET2(RENDER_PICT_OP); - CASESTRRET2(RENDER_GLYPH_SET); - CASESTRRET2(RENDER_GLYPH); - } - - if (ps->glx_exists) { - o = error_code - ps->glx_error; - switch (o) { - CASESTRRET2(GLX_BAD_CONTEXT); - CASESTRRET2(GLX_BAD_CONTEXT_STATE); - CASESTRRET2(GLX_BAD_DRAWABLE); - CASESTRRET2(GLX_BAD_PIXMAP); - CASESTRRET2(GLX_BAD_CONTEXT_TAG); - CASESTRRET2(GLX_BAD_CURRENT_WINDOW); - CASESTRRET2(GLX_BAD_RENDER_REQUEST); - CASESTRRET2(GLX_BAD_LARGE_REQUEST); - CASESTRRET2(GLX_UNSUPPORTED_PRIVATE_REQUEST); - CASESTRRET2(GLX_BAD_FB_CONFIG); - CASESTRRET2(GLX_BAD_PBUFFER); - CASESTRRET2(GLX_BAD_CURRENT_DRAWABLE); - CASESTRRET2(GLX_BAD_WINDOW); - CASESTRRET2(GLX_GLX_BAD_PROFILE_ARB); - } - } - - if (ps->xsync_exists) { - o = error_code - ps->xsync_error; - switch (o) { - CASESTRRET(XSyncBadCounter); - CASESTRRET(XSyncBadAlarm); - CASESTRRET(XSyncBadFence); - } - } - - switch (error_code) { - CASESTRRET2(ACCESS); - CASESTRRET2(ALLOC); - CASESTRRET2(ATOM); - CASESTRRET2(COLORMAP); - CASESTRRET2(CURSOR); - CASESTRRET2(DRAWABLE); - CASESTRRET2(FONT); - CASESTRRET2(G_CONTEXT); - CASESTRRET2(ID_CHOICE); - CASESTRRET2(IMPLEMENTATION); - CASESTRRET2(LENGTH); - CASESTRRET2(MATCH); - CASESTRRET2(NAME); - CASESTRRET2(PIXMAP); - CASESTRRET2(REQUEST); - CASESTRRET2(VALUE); - CASESTRRET2(WINDOW); - } - -#undef CASESTRRET -#undef CASESTRRET2 - - thread_local static char buffer[256]; - snprintf(buffer, sizeof(buffer), "X error %d %s request %d minor %d serial %lu", - error_code, name, major, minor, serial); - return buffer; -} - -/** - * Log a X11 error - */ -void x_print_error(unsigned long serial, uint8_t major, uint16_t minor, uint8_t error_code) { - log_debug("%s", _x_strerror(serial, major, minor, error_code)); -} - -/* - * Convert a xcb_generic_error_t to a string that describes the error - * - * @return a pointer to a string. this pointer shouldn NOT be freed, same buffer is used - * for multiple calls to this function, - */ -const char *x_strerror(xcb_generic_error_t *e) { - if (!e) { - return "No error"; - } - return _x_strerror(e->full_sequence, e->major_code, e->minor_code, e->error_code); -} - -/** - * Create a pixmap and check that creation succeeded. - */ -xcb_pixmap_t x_create_pixmap(xcb_connection_t *c, uint8_t depth, xcb_drawable_t drawable, - int width, int height) { - xcb_pixmap_t pix = x_new_id(c); - xcb_void_cookie_t cookie = xcb_create_pixmap_checked( - c, depth, pix, drawable, to_u16_checked(width), to_u16_checked(height)); - xcb_generic_error_t *err = xcb_request_check(c, cookie); - if (err == NULL) { - return pix; - } - - log_error_x_error(err, "Failed to create pixmap"); - free(err); - return XCB_NONE; -} - -/** - * Validate a pixmap. - * - * Detect whether the pixmap is valid with XGetGeometry. Well, maybe there - * are better ways. - */ -bool x_validate_pixmap(xcb_connection_t *c, xcb_pixmap_t pixmap) { - if (pixmap == XCB_NONE) { - return false; - } - - auto r = xcb_get_geometry_reply(c, xcb_get_geometry(c, pixmap), NULL); - if (!r) { - return false; - } - - bool ret = r->width && r->height; - free(r); - return ret; -} -/// Names of root window properties that could point to a pixmap of -/// background. -static const char *background_props_str[] = { - "_XROOTPMAP_ID", - "_XSETROOT_ID", - 0, -}; - -xcb_pixmap_t -x_get_root_back_pixmap(xcb_connection_t *c, xcb_window_t root, struct atom *atoms) { - xcb_pixmap_t pixmap = XCB_NONE; - - // Get the values of background attributes - for (int p = 0; background_props_str[p]; p++) { - xcb_atom_t prop_atom = get_atom(atoms, background_props_str[p]); - winprop_t prop = x_get_prop(c, root, prop_atom, 1, XCB_ATOM_PIXMAP, 32); - if (prop.nitems) { - pixmap = (xcb_pixmap_t)*prop.p32; - free_winprop(&prop); - break; - } - free_winprop(&prop); - } - - return pixmap; -} - -bool x_is_root_back_pixmap_atom(struct atom *atoms, xcb_atom_t atom) { - for (int p = 0; background_props_str[p]; p++) { - xcb_atom_t prop_atom = get_atom(atoms, background_props_str[p]); - if (prop_atom == atom) { - return true; - } - } - return false; -} - -/** - * Synchronizes a X Render drawable to ensure all pending painting requests - * are completed. - */ -bool x_fence_sync(xcb_connection_t *c, xcb_sync_fence_t f) { - // TODO(richardgv): If everybody just follows the rules stated in X Sync - // prototype, we need only one fence per screen, but let's stay a bit - // cautious right now - - auto e = xcb_request_check(c, xcb_sync_trigger_fence_checked(c, f)); - if (e) { - log_error_x_error(e, "Failed to trigger the fence"); - goto err; - } - - e = xcb_request_check(c, xcb_sync_await_fence_checked(c, 1, &f)); - if (e) { - log_error_x_error(e, "Failed to await on a fence"); - goto err; - } - - e = xcb_request_check(c, xcb_sync_reset_fence_checked(c, f)); - if (e) { - log_error_x_error(e, "Failed to reset the fence"); - goto err; - } - return true; - -err: - free(e); - return false; -} - -/** - * Convert a struct conv to a X picture convolution filter, normalizing the kernel - * in the process. Allow the caller to specify the element at the center of the kernel, - * for compatibility with legacy code. - * - * @param[in] kernel the convolution kernel - * @param[in] center the element to put at the center of the matrix - * @param[inout] ret pointer to an array of `size`, if `size` is too small, more space - * will be allocated, and `*ret` will be updated - * @param[inout] size size of the array pointed to by `ret`, in number of elements - * @return number of elements filled into `*ret` - */ -void x_create_convolution_kernel(const conv *kernel, double center, - struct x_convolution_kernel **ret) { - assert(ret); - if (!*ret || (*ret)->capacity < kernel->w * kernel->h + 2) { - free(*ret); - *ret = - cvalloc(sizeof(struct x_convolution_kernel) + - (size_t)(kernel->w * kernel->h + 2) * sizeof(xcb_render_fixed_t)); - (*ret)->capacity = kernel->w * kernel->h + 2; - } - - (*ret)->size = kernel->w * kernel->h + 2; - - auto buf = (*ret)->kernel; - buf[0] = DOUBLE_TO_XFIXED(kernel->w); - buf[1] = DOUBLE_TO_XFIXED(kernel->h); - - double sum = center; - for (int i = 0; i < kernel->w * kernel->h; i++) { - if (i == kernel->w * kernel->h / 2) { - continue; - } - sum += kernel->data[i]; - } - - // Note for floating points a / b != a * (1 / b), but this shouldn't have any real - // impact on the result - double factor = sum != 0 ? 1.0 / sum : 1; - for (int i = 0; i < kernel->w * kernel->h; i++) { - buf[i + 2] = DOUBLE_TO_XFIXED(kernel->data[i] * factor); - } - - buf[kernel->h / 2 * kernel->w + kernel->w / 2 + 2] = - DOUBLE_TO_XFIXED(center * factor); -} - -/// Generate a search criteria for fbconfig from a X visual. -/// Returns {-1, -1, -1, -1, -1, 0} on failure -struct xvisual_info x_get_visual_info(xcb_connection_t *c, xcb_visualid_t visual) { - auto pictfmt = x_get_pictform_for_visual(c, visual); - auto depth = x_get_visual_depth(c, visual); - if (!pictfmt || depth == -1) { - log_error("Invalid visual %#03x", visual); - return (struct xvisual_info){-1, -1, -1, -1, -1, 0}; - } - if (pictfmt->type != XCB_RENDER_PICT_TYPE_DIRECT) { - log_error("We cannot handle non-DirectColor visuals. Report an " - "issue if you see this error message."); - return (struct xvisual_info){-1, -1, -1, -1, -1, 0}; - } - - int red_size = popcntul(pictfmt->direct.red_mask), - blue_size = popcntul(pictfmt->direct.blue_mask), - green_size = popcntul(pictfmt->direct.green_mask), - alpha_size = popcntul(pictfmt->direct.alpha_mask); - - return (struct xvisual_info){ - .red_size = red_size, - .green_size = green_size, - .blue_size = blue_size, - .alpha_size = alpha_size, - .visual_depth = depth, - .visual = visual, - }; -} - -xcb_screen_t *x_screen_of_display(xcb_connection_t *c, int screen) { - xcb_screen_iterator_t iter; - - iter = xcb_setup_roots_iterator(xcb_get_setup(c)); - for (; iter.rem; --screen, xcb_screen_next(&iter)) { - if (screen == 0) { - return iter.data; - } - } - - return NULL; -} diff --git a/dwm/picom/src/x.h b/dwm/picom/src/x.h deleted file mode 100644 index 3b8787c..0000000 --- a/dwm/picom/src/x.h +++ /dev/null @@ -1,297 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 -// Copyright (c) 2018 Yuxuan Shui -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include - -#include "compiler.h" -#include "kernel.h" -#include "log.h" -#include "region.h" - -typedef struct session session_t; -struct atom; - -/// Structure representing Window property value. -typedef struct winprop { - union { - void *ptr; - int8_t *p8; - int16_t *p16; - int32_t *p32; - uint32_t *c32; // 32bit cardinal - }; - unsigned long nitems; - xcb_atom_t type; - int format; - - xcb_get_property_reply_t *r; -} winprop_t; - -typedef struct winprop_info { - xcb_atom_t type; - uint8_t format; - uint32_t length; -} winprop_info_t; - -struct xvisual_info { - /// Bit depth of the red component - int red_size; - /// Bit depth of the green component - int green_size; - /// Bit depth of the blue component - int blue_size; - /// Bit depth of the alpha component - int alpha_size; - /// The depth of X visual - int visual_depth; - - xcb_visualid_t visual; -}; - -#define XCB_AWAIT_VOID(func, c, ...) \ - ({ \ - bool __success = true; \ - __auto_type __e = xcb_request_check(c, func##_checked(c, __VA_ARGS__)); \ - if (__e) { \ - x_print_error(__e->sequence, __e->major_code, __e->minor_code, \ - __e->error_code); \ - free(__e); \ - __success = false; \ - } \ - __success; \ - }) - -#define XCB_AWAIT(func, c, ...) \ - ({ \ - xcb_generic_error_t *__e = NULL; \ - __auto_type __r = func##_reply(c, func(c, __VA_ARGS__), &__e); \ - if (__e) { \ - x_print_error(__e->sequence, __e->major_code, __e->minor_code, \ - __e->error_code); \ - free(__e); \ - } \ - __r; \ - }) - -#define log_debug_x_error(e, fmt, ...) \ - LOG(DEBUG, fmt " (%s)", ##__VA_ARGS__, x_strerror(e)) -#define log_error_x_error(e, fmt, ...) \ - LOG(ERROR, fmt " (%s)", ##__VA_ARGS__, x_strerror(e)) -#define log_fatal_x_error(e, fmt, ...) \ - LOG(FATAL, fmt " (%s)", ##__VA_ARGS__, x_strerror(e)) - -// xcb-render specific macros -#define XFIXED_TO_DOUBLE(value) (((double)(value)) / 65536) -#define DOUBLE_TO_XFIXED(value) ((xcb_render_fixed_t)(((double)(value)) * 65536)) - -/// Wraps x_new_id. abort the program if x_new_id returns error -static inline uint32_t x_new_id(xcb_connection_t *c) { - auto ret = xcb_generate_id(c); - if (ret == (uint32_t)-1) { - log_fatal("We seems to have run of XIDs. This is either a bug in the X " - "server, or a resource leakage in the compositor. Please open " - "an issue about this problem. The compositor will die."); - abort(); - } - return ret; -} - -/** - * Send a request to X server and get the reply to make sure all previous - * requests are processed, and their replies received - * - * xcb_get_input_focus is used here because it is the same request used by - * libX11 - */ -static inline void x_sync(xcb_connection_t *c) { - free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL)); -} - -/** - * Get a specific attribute of a window. - * - * Returns a blank structure if the returned type and format does not - * match the requested type and format. - * - * @param ps current session - * @param w window - * @param atom atom of attribute to fetch - * @param length length to read - * @param rtype atom of the requested type - * @param rformat requested format - * @return a winprop_t structure containing the attribute - * and number of items. A blank one on failure. - */ -winprop_t x_get_prop_with_offset(xcb_connection_t *c, xcb_window_t w, xcb_atom_t atom, - int offset, int length, xcb_atom_t rtype, int rformat); - -/** - * Wrapper of wid_get_prop_adv(). - */ -static inline winprop_t x_get_prop(xcb_connection_t *c, xcb_window_t wid, xcb_atom_t atom, - int length, xcb_atom_t rtype, int rformat) { - return x_get_prop_with_offset(c, wid, atom, 0L, length, rtype, rformat); -} - -/// Get the type, format and size in bytes of a window's specific attribute. -winprop_info_t x_get_prop_info(xcb_connection_t *c, xcb_window_t w, xcb_atom_t atom); - -/// Discard all X events in queue or in flight. Should only be used when the server is -/// grabbed -static inline void x_discard_events(xcb_connection_t *c) { - xcb_generic_event_t *e; - while ((e = xcb_poll_for_event(c))) { - free(e); - } -} - -/** - * Get the value of a type-xcb_window_t property of a window. - * - * @return the value if successful, 0 otherwise - */ -xcb_window_t wid_get_prop_window(xcb_connection_t *c, xcb_window_t wid, xcb_atom_t aprop); - -/** - * Get the value of a text property of a window. - * - * @param[out] pstrlst Out parameter for an array of strings, caller needs to free this - * array - * @param[out] pnstr Number of strings in the array - */ -bool wid_get_text_prop(session_t *ps, xcb_window_t wid, xcb_atom_t prop, char ***pstrlst, - int *pnstr); - -const xcb_render_pictforminfo_t * -x_get_pictform_for_visual(xcb_connection_t *, xcb_visualid_t); -int x_get_visual_depth(xcb_connection_t *, xcb_visualid_t); - -xcb_render_picture_t -x_create_picture_with_pictfmt_and_pixmap(xcb_connection_t *, - const xcb_render_pictforminfo_t *pictfmt, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1, 2); - -xcb_render_picture_t -x_create_picture_with_visual_and_pixmap(xcb_connection_t *, xcb_visualid_t visual, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1); - -xcb_render_picture_t -x_create_picture_with_standard_and_pixmap(xcb_connection_t *, xcb_pict_standard_t standard, - xcb_pixmap_t pixmap, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1); - -xcb_render_picture_t -x_create_picture_with_standard(xcb_connection_t *c, xcb_drawable_t d, int w, int h, - xcb_pict_standard_t standard, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1); - -/** - * Create an picture. - */ -xcb_render_picture_t -x_create_picture_with_pictfmt(xcb_connection_t *, xcb_drawable_t, int w, int h, - const xcb_render_pictforminfo_t *pictfmt, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1, 5); - -xcb_render_picture_t -x_create_picture_with_visual(xcb_connection_t *, xcb_drawable_t, int w, int h, - xcb_visualid_t visual, uint32_t valuemask, - const xcb_render_create_picture_value_list_t *attr) - attr_nonnull(1); - -/// Fetch a X region and store it in a pixman region -bool x_fetch_region(xcb_connection_t *, xcb_xfixes_region_t r, region_t *res); - -void x_set_picture_clip_region(xcb_connection_t *, xcb_render_picture_t, int16_t clip_x_origin, - int16_t clip_y_origin, const region_t *); - -void x_clear_picture_clip_region(xcb_connection_t *, xcb_render_picture_t pict); - -/** - * Log a X11 error - */ -void x_print_error(unsigned long serial, uint8_t major, uint16_t minor, uint8_t error_code); - -/* - * Convert a xcb_generic_error_t to a string that describes the error - * - * @return a pointer to a string. this pointer shouldn NOT be freed, same buffer is used - * for multiple calls to this function, - */ -const char *x_strerror(xcb_generic_error_t *e); - -xcb_pixmap_t x_create_pixmap(xcb_connection_t *, uint8_t depth, xcb_drawable_t drawable, - int width, int height); - -bool x_validate_pixmap(xcb_connection_t *, xcb_pixmap_t pxmap); - -/** - * Free a winprop_t. - * - * @param pprop pointer to the winprop_t to free. - */ -static inline void free_winprop(winprop_t *pprop) { - // Empty the whole structure to avoid possible issues - if (pprop->r) - free(pprop->r); - pprop->ptr = NULL; - pprop->r = NULL; - pprop->nitems = 0; -} - -/// Get the back pixmap of the root window -xcb_pixmap_t -x_get_root_back_pixmap(xcb_connection_t *c, xcb_window_t root, struct atom *atoms); - -/// Return true if the atom refers to a property name that is used for the -/// root window background pixmap -bool x_is_root_back_pixmap_atom(struct atom *atoms, xcb_atom_t atom); - -bool x_fence_sync(xcb_connection_t *, xcb_sync_fence_t); - -struct x_convolution_kernel { - int size; - int capacity; - xcb_render_fixed_t kernel[]; -}; - -/** - * Convert a struct conv to a X picture convolution filter, normalizing the kernel - * in the process. Allow the caller to specify the element at the center of the kernel, - * for compatibility with legacy code. - * - * @param[in] kernel the convolution kernel - * @param[in] center the element to put at the center of the matrix - * @param[inout] ret pointer to an array of `size`, if `size` is too small, more space - * will be allocated, and `*ret` will be updated. - * @param[inout] size size of the array pointed to by `ret`. - */ -void attr_nonnull(1, 3) x_create_convolution_kernel(const conv *kernel, double center, - struct x_convolution_kernel **ret); - -/// Generate a search criteria for fbconfig from a X visual. -/// Returns {-1, -1, -1, -1, -1, -1} on failure -struct xvisual_info x_get_visual_info(xcb_connection_t *c, xcb_visualid_t visual); - -xcb_visualid_t x_get_visual_for_standard(xcb_connection_t *c, xcb_pict_standard_t std); - -xcb_render_pictformat_t -x_get_pictfmt_for_standard(xcb_connection_t *c, xcb_pict_standard_t std); - -xcb_screen_t *x_screen_of_display(xcb_connection_t *c, int screen); - -uint32_t attr_deprecated xcb_generate_id(xcb_connection_t *c); diff --git a/dwm/picom/src/xrescheck.c b/dwm/picom/src/xrescheck.c deleted file mode 100644 index 1785fc8..0000000 --- a/dwm/picom/src/xrescheck.c +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2014 Richard Grenville - -#include "compiler.h" -#include "log.h" - -#include "xrescheck.h" - -static xrc_xid_record_t *gs_xid_records = NULL; - -#define HASH_ADD_XID(head, xidfield, add) HASH_ADD(hh, head, xidfield, sizeof(xid), add) - -#define HASH_FIND_XID(head, findxid, out) HASH_FIND(hh, head, findxid, sizeof(xid), out) - -#define M_CPY_POS_DATA(prec) \ - prec->file = file; \ - prec->func = func; \ - prec->line = line; - -/** - * @brief Add a record of given XID to the allocation table. - */ -void xrc_add_xid_(XID xid, const char *type, M_POS_DATA_PARAMS) { - auto prec = ccalloc(1, xrc_xid_record_t); - prec->xid = xid; - prec->type = type; - M_CPY_POS_DATA(prec); - - HASH_ADD_XID(gs_xid_records, xid, prec); -} - -/** - * @brief Delete a record of given XID in the allocation table. - */ -void xrc_delete_xid_(XID xid, M_POS_DATA_PARAMS) { - xrc_xid_record_t *prec = NULL; - HASH_FIND_XID(gs_xid_records, &xid, prec); - if (!prec) { - log_error("XRC: %s:%d %s(): Can't find XID %#010lx we want to delete.", - file, line, func, xid); - return; - } - HASH_DEL(gs_xid_records, prec); - free(prec); -} - -/** - * @brief Report about issues found in the XID allocation table. - */ -void xrc_report_xid(void) { - for (xrc_xid_record_t *prec = gs_xid_records; prec; prec = prec->hh.next) - log_trace("XRC: %s:%d %s(): %#010lx (%s) not freed.\n", prec->file, - prec->line, prec->func, prec->xid, prec->type); -} - -/** - * @brief Clear the XID allocation table. - */ -void xrc_clear_xid(void) { - xrc_xid_record_t *prec = NULL, *ptmp = NULL; - HASH_ITER(hh, gs_xid_records, prec, ptmp) { - HASH_DEL(gs_xid_records, prec); - free(prec); - } -} diff --git a/dwm/picom/src/xrescheck.h b/dwm/picom/src/xrescheck.h deleted file mode 100644 index 5ad5c46..0000000 --- a/dwm/picom/src/xrescheck.h +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: MIT -// Copyright (c) 2014 Richard Grenville -#pragma once - -#include "common.h" -#include "uthash.h" - -typedef struct { - XID xid; - const char *type; - const char *file; - const char *func; - int line; - UT_hash_handle hh; -} xrc_xid_record_t; - -#define M_POS_DATA_PARAMS const char *file, int line, const char *func -#define M_POS_DATA_PASSTHROUGH file, line, func -#define M_POS_DATA __FILE__, __LINE__, __func__ - -void xrc_add_xid_(XID xid, const char *type, M_POS_DATA_PARAMS); - -#define xrc_add_xid(xid, type) xrc_add_xid_(xid, type, M_POS_DATA) - -void xrc_delete_xid_(XID xid, M_POS_DATA_PARAMS); - -#define xrc_delete_xid(xid) xrc_delete_xid_(xid, M_POS_DATA) - -void xrc_report_xid(void); - -void xrc_clear_xid(void); - -// Pixmap - -static inline void xcb_create_pixmap_(xcb_connection_t *c, uint8_t depth, - xcb_pixmap_t pixmap, xcb_drawable_t drawable, - uint16_t width, uint16_t height, M_POS_DATA_PARAMS) { - xcb_create_pixmap(c, depth, pixmap, drawable, width, height); - xrc_add_xid_(pixmap, "Pixmap", M_POS_DATA_PASSTHROUGH); -} - -#define xcb_create_pixmap(c, depth, pixmap, drawable, width, height) \ - xcb_create_pixmap_(c, depth, pixmap, drawable, width, height, M_POS_DATA) - -static inline xcb_void_cookie_t -xcb_composite_name_window_pixmap_(xcb_connection_t *c, xcb_window_t window, - xcb_pixmap_t pixmap, M_POS_DATA_PARAMS) { - xcb_void_cookie_t ret = xcb_composite_name_window_pixmap(c, window, pixmap); - xrc_add_xid_(pixmap, "PixmapC", M_POS_DATA_PASSTHROUGH); - return ret; -} - -#define xcb_composite_name_window_pixmap(dpy, window, pixmap) \ - xcb_composite_name_window_pixmap_(dpy, window, pixmap, M_POS_DATA) - -static inline void -xcb_free_pixmap_(xcb_connection_t *c, xcb_pixmap_t pixmap, M_POS_DATA_PARAMS) { - xcb_free_pixmap(c, pixmap); - xrc_delete_xid_(pixmap, M_POS_DATA_PASSTHROUGH); -} - -#define xcb_free_pixmap(c, pixmap) xcb_free_pixmap_(c, pixmap, M_POS_DATA); diff --git a/dwm/picom/subprojects/test.h/meson.build b/dwm/picom/subprojects/test.h/meson.build deleted file mode 100644 index 042e5d5..0000000 --- a/dwm/picom/subprojects/test.h/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -project('test.h', 'c') -test_h_dep = declare_dependency(include_directories: include_directories('.')) diff --git a/dwm/picom/subprojects/test.h/test.h b/dwm/picom/subprojects/test.h/test.h deleted file mode 100644 index fd8dc22..0000000 --- a/dwm/picom/subprojects/test.h/test.h +++ /dev/null @@ -1,185 +0,0 @@ -// SPDX-License-Identifier: MIT -#pragma once - -#ifdef UNIT_TEST - -#include -#include -#include -#include - -#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || defined(__OpenBSD__) -#define USE_SYSCTL_FOR_ARGS 1 -// clang-format off -#include -#include -// clang-format on -#include // getpid -#endif - -struct test_file_metadata; - -struct test_failure { - bool present; - const char *message; - const char *file; - int line; -}; - -struct test_case_metadata { - void (*fn)(struct test_case_metadata *, struct test_file_metadata *); - struct test_failure failure; - const char *name; - struct test_case_metadata *next; -}; - -struct test_file_metadata { - bool registered; - const char *name; - struct test_file_metadata *next; - struct test_case_metadata *tests; -}; - -struct test_file_metadata __attribute__((weak)) * test_file_head; - -#define SET_FAILURE(_message) \ - metadata->failure = (struct test_failure) { \ - .message = _message, .file = __FILE__, .line = __LINE__, .present = true, \ - } - -#define TEST_EQUAL(a, b) \ - do { \ - if ((a) != (b)) { \ - SET_FAILURE(#a " != " #b); \ - return; \ - } \ - } while (0) - -#define TEST_TRUE(a) \ - do { \ - if (!(a)) { \ - SET_FAILURE(#a " is not true"); \ - return; \ - } \ - } while (0) - -#define TEST_STREQUAL(a, b) \ - do { \ - if (strcmp(a, b) != 0) { \ - SET_FAILURE(#a " != " #b); \ - return; \ - } \ - } while (0) - -#define TEST_CASE(_name) \ - static void __test_h_##_name(struct test_case_metadata *, \ - struct test_file_metadata *); \ - static struct test_file_metadata __test_h_file; \ - static struct test_case_metadata __test_h_meta_##_name = { \ - .name = #_name, \ - .fn = __test_h_##_name, \ - }; \ - static void __attribute__((constructor(101))) __test_h_##_name##_register(void) { \ - __test_h_meta_##_name.next = __test_h_file.tests; \ - __test_h_file.tests = &__test_h_meta_##_name; \ - if (!__test_h_file.registered) { \ - __test_h_file.name = __FILE__; \ - __test_h_file.next = test_file_head; \ - test_file_head = &__test_h_file; \ - __test_h_file.registered = true; \ - } \ - } \ - static void __test_h_##_name( \ - struct test_case_metadata *metadata __attribute__((unused)), \ - struct test_file_metadata *file_metadata __attribute__((unused))) - -extern void __attribute__((weak)) (*test_h_unittest_setup)(void); -/// Run defined tests, return true if all tests succeeds -/// @param[out] tests_run if not NULL, set to whether tests were run -static inline void __attribute__((constructor(102))) run_tests(void) { - bool should_run = false; -#ifdef USE_SYSCTL_FOR_ARGS - int mib[] = { - CTL_KERN, -#if defined(__NetBSD__) || defined(__OpenBSD__) - KERN_PROC_ARGS, - getpid(), - KERN_PROC_ARGV, -#else - KERN_PROC, - KERN_PROC_ARGS, - getpid(), -#endif - }; - char *arg = NULL; - size_t arglen; - sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &arglen, NULL, 0); - arg = malloc(arglen); - sysctl(mib, sizeof(mib) / sizeof(mib[0]), arg, &arglen, NULL, 0); -#else - FILE *cmdlinef = fopen("/proc/self/cmdline", "r"); - char *arg = NULL; - int arglen; - fscanf(cmdlinef, "%ms%n", &arg, &arglen); - fclose(cmdlinef); -#endif - for (char *pos = arg; pos < arg + arglen; pos += strlen(pos) + 1) { - if (strcmp(pos, "--unittest") == 0) { - should_run = true; - break; - } - } - free(arg); - - if (!should_run) { - return; - } - - if (&test_h_unittest_setup) { - test_h_unittest_setup(); - } - - struct test_file_metadata *i = test_file_head; - int failed = 0, success = 0; - while (i) { - fprintf(stderr, "Running tests from %s:\n", i->name); - struct test_case_metadata *j = i->tests; - while (j) { - fprintf(stderr, "\t%s ... ", j->name); - j->failure.present = false; - j->fn(j, i); - if (j->failure.present) { - fprintf(stderr, "failed (%s at %s:%d)\n", j->failure.message, - j->failure.file, j->failure.line); - failed++; - } else { - fprintf(stderr, "passed\n"); - success++; - } - j = j->next; - } - fprintf(stderr, "\n"); - i = i->next; - } - int total = failed + success; - fprintf(stderr, "Test results: passed %d/%d, failed %d/%d\n", success, total, - failed, total); - exit(failed == 0 ? EXIT_SUCCESS : EXIT_FAILURE); -} - -#else - -#include - -#define TEST_CASE(name) static void __attribute__((unused)) __test_h_##name(void) - -#define TEST_EQUAL(a, b) \ - (void)(a); \ - (void)(b) -#define TEST_TRUE(a) (void)(a) -#define TEST_STREQUAL(a, b) \ - (void)(a); \ - (void)(b) - -#endif diff --git a/dwm/picom/tests/configs/clear_shadow_unredirected.conf b/dwm/picom/tests/configs/clear_shadow_unredirected.conf deleted file mode 100644 index f70b461..0000000 --- a/dwm/picom/tests/configs/clear_shadow_unredirected.conf +++ /dev/null @@ -1,5 +0,0 @@ -shadow = true; -shadow-exclude = [ -"name = 'NoShadow'" -] -unredir-if-possible = true; diff --git a/dwm/picom/tests/configs/empty.conf b/dwm/picom/tests/configs/empty.conf deleted file mode 100644 index e69de29..0000000 diff --git a/dwm/picom/tests/configs/issue239.conf b/dwm/picom/tests/configs/issue239.conf deleted file mode 100644 index 23a4c80..0000000 --- a/dwm/picom/tests/configs/issue239.conf +++ /dev/null @@ -1,7 +0,0 @@ -fading = true; -fade-in-step = 1; -fade-out-step = 0.01; -shadow = true; -shadow-exclude = [ -"name = 'NoShadow'" -] diff --git a/dwm/picom/tests/configs/issue239_2.conf b/dwm/picom/tests/configs/issue239_2.conf deleted file mode 100644 index 5f89f47..0000000 --- a/dwm/picom/tests/configs/issue239_2.conf +++ /dev/null @@ -1,8 +0,0 @@ -fading = true; -fade-in-step = 1; -fade-out-step = 0.01; -shadow = true; -shadow-exclude = [ -"name = 'NoShadow'" -] -unredir-if-possible = true; diff --git a/dwm/picom/tests/configs/issue239_3.conf b/dwm/picom/tests/configs/issue239_3.conf deleted file mode 100644 index b8a1d69..0000000 --- a/dwm/picom/tests/configs/issue239_3.conf +++ /dev/null @@ -1,4 +0,0 @@ -shadow = true; -shadow-exclude = [ -"name = 'NoShadow'" -] diff --git a/dwm/picom/tests/configs/issue314.conf b/dwm/picom/tests/configs/issue314.conf deleted file mode 100644 index bb3c4cb..0000000 --- a/dwm/picom/tests/configs/issue314.conf +++ /dev/null @@ -1,6 +0,0 @@ -fading = true -fade-in-step = 0.01 -fade-out-step = 0.01 -inactive-opacity = 0 -blur-background = true -force-win-blend = true diff --git a/dwm/picom/tests/configs/issue357.conf b/dwm/picom/tests/configs/issue357.conf deleted file mode 100644 index 00c3ba6..0000000 --- a/dwm/picom/tests/configs/issue357.conf +++ /dev/null @@ -1,3 +0,0 @@ -fading = true; -fade-in-step = 1; -fade-out-step = 0.01; diff --git a/dwm/picom/tests/configs/issue394.conf b/dwm/picom/tests/configs/issue394.conf deleted file mode 100644 index 0e33a1c..0000000 --- a/dwm/picom/tests/configs/issue394.conf +++ /dev/null @@ -1,4 +0,0 @@ -fading = true; -fade-in-step = 1; -fade-out-step = 0.01; -shadow = true; diff --git a/dwm/picom/tests/configs/issue465.conf b/dwm/picom/tests/configs/issue465.conf deleted file mode 100644 index 313371d..0000000 --- a/dwm/picom/tests/configs/issue465.conf +++ /dev/null @@ -1,4 +0,0 @@ -shadow = true; -shadow-exclude = [ - "focused != 1" -]; diff --git a/dwm/picom/tests/run_one_test.sh b/dwm/picom/tests/run_one_test.sh deleted file mode 100755 index 4619359..0000000 --- a/dwm/picom/tests/run_one_test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -xe -if [ -z $DISPLAY ]; then - exec xvfb-run -s "+extension composite" -a $0 $1 $2 $3 -fi - -echo "Running test $2" - -# TODO keep the log file, and parse it to see if test is successful -($1 --dbus --experimental-backends --backend dummy --log-level=debug --log-file=$PWD/log --config=$2) & -main_pid=$! -$3 - -kill -INT $main_pid || true -cat log -rm log -wait $main_pid - - diff --git a/dwm/picom/tests/run_tests.sh b/dwm/picom/tests/run_tests.sh deleted file mode 100755 index 6a5a6b3..0000000 --- a/dwm/picom/tests/run_tests.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -set -e -exe=$(realpath $1) -cd $(dirname $0) - -eval `dbus-launch --sh-syntax` - -./run_one_test.sh $exe configs/empty.conf testcases/basic.py -./run_one_test.sh $exe configs/issue357.conf testcases/issue357.py -./run_one_test.sh $exe configs/issue239.conf testcases/issue239.py -./run_one_test.sh $exe configs/issue239_2.conf testcases/issue239_2.py -./run_one_test.sh $exe configs/issue239_3.conf testcases/issue239_3.py -./run_one_test.sh $exe configs/issue239_3.conf testcases/issue239_3_norefresh.py -./run_one_test.sh $exe configs/issue314.conf testcases/issue314.py -./run_one_test.sh $exe configs/issue314.conf testcases/issue314_2.py -./run_one_test.sh $exe configs/issue314.conf testcases/issue314_3.py -./run_one_test.sh $exe /dev/null testcases/issue299.py -./run_one_test.sh $exe configs/issue465.conf testcases/issue465.py -./run_one_test.sh $exe configs/clear_shadow_unredirected.conf testcases/clear_shadow_unredirected.py -./run_one_test.sh $exe configs/clear_shadow_unredirected.conf testcases/redirect_when_unmapped_window_has_shadow.py -./run_one_test.sh $exe configs/issue394.conf testcases/issue394.py -./run_one_test.sh $exe configs/issue239.conf testcases/issue525.py diff --git a/dwm/picom/tests/testcases/basic.py b/dwm/picom/tests/testcases/basic.py deleted file mode 100755 index 78a6136..0000000 --- a/dwm/picom/tests/testcases/basic.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -wid = conn.generate_id() -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() -conn.core.MapWindowChecked(wid).check() -conn.core.UnmapWindowChecked(wid).check() -conn.core.DestroyWindowChecked(wid).check() - - diff --git a/dwm/picom/tests/testcases/clear_shadow_unredirected.py b/dwm/picom/tests/testcases/clear_shadow_unredirected.py deleted file mode 100755 index 360a522..0000000 --- a/dwm/picom/tests/testcases/clear_shadow_unredirected.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -name = "_NET_WM_STATE" -name_atom = conn.core.InternAtom(False, len(name), name).reply().atom -atom = "ATOM" -atom_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom -fs = "_NET_WM_STATE_FULLSCREEN" -fs_atom = conn.core.InternAtom(False, len(fs), fs).reply().atom - -# making sure disabling shadow while screen is unredirected doesn't cause assertion failure -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name so it does get a shadow -set_window_name(conn, wid, "YesShadow") - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -# Set fullscreen property, causing screen to be unredirected -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, name_atom, atom_atom, 32, 1, [fs_atom]).check() - -time.sleep(0.5) - -# Set the Window name so it loses its shadow -print("set new name") -set_window_name(conn, wid, "NoShadow") - -# Unmap the window -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.5) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/common.py b/dwm/picom/tests/testcases/common.py deleted file mode 100644 index 8214aff..0000000 --- a/dwm/picom/tests/testcases/common.py +++ /dev/null @@ -1,85 +0,0 @@ -import xcffib.xproto as xproto -import xcffib.randr as randr -import xcffib -import time -import random -import string - -def to_atom(conn, string): - return conn.core.InternAtom(False, len(string), string).reply().atom - -def set_window_name(conn, wid, name): - prop_name = to_atom(conn, "_NET_WM_NAME") - str_type = to_atom(conn, "UTF8_STRING") - conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check() - prop_name = to_atom(conn, "WM_NAME") - str_type = to_atom(conn, "STRING") - conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check() - -def set_window_state(conn, wid, state): - prop_name = to_atom(conn, "WM_STATE") - conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, prop_name, 32, 2, [state, 0]).check() - -def set_window_class(conn, wid, name): - if not isinstance(name, bytearray): - name = name.encode() - name = name+b"\0"+name+b"\0" - prop_name = to_atom(conn, "WM_CLASS") - str_type = to_atom(conn, "STRING") - conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, prop_name, str_type, 8, len(name), name).check() - -def set_window_size_async(conn, wid, width, height): - value_mask = xproto.ConfigWindow.Width | xproto.ConfigWindow.Height - value_list = [width, height] - return conn.core.ConfigureWindowChecked(wid, value_mask, value_list) - -def find_picom_window(conn): - prop_name = to_atom(conn, "WM_NAME") - setup = conn.get_setup() - root = setup.roots[0].root - windows = conn.core.QueryTree(root).reply() - - ext = xproto.xprotoExtension(conn) - for w in windows.children: - name = ext.GetProperty(False, w, prop_name, xproto.GetPropertyType.Any, 0, (2 ** 32) - 1).reply() - if name.value.buf() == b"picom": - return w - -def prepare_root_configure(conn): - setup = conn.get_setup() - root = setup.roots[0].root - # Xorg sends root ConfigureNotify when we add a new mode to an output - rr = conn(randr.key) - name = ''.join([random.choice(string.ascii_letters + string.digits) for n in range(0, 32)]) - mode_info = randr.ModeInfo.synthetic(id = 0, width = 1000, height = 1000, dot_clock = 0, - hsync_start = 0, hsync_end = 0, htotal = 0, hskew = 0, vsync_start = 0, vsync_end = 0, - vtotal = 0, name_len = len(name), mode_flags = 0) - - reply = rr.CreateMode(root, mode_info, len(name), name).reply() - mode = reply.mode - reply = rr.GetScreenResourcesCurrent(root).reply() - # our xvfb is setup to only have 1 output - output = reply.outputs[0] - rr.AddOutputModeChecked(output, mode).check() - return reply, mode, output - -def trigger_root_configure(conn, reply, mode, output): - rr = conn(randr.key) - return rr.SetCrtcConfig(reply.crtcs[0], reply.timestamp, reply.config_timestamp, 0, 0, mode, randr.Rotation.Rotate_0, 1, [output]) - -def find_32bit_visual(conn): - setup = conn.get_setup() - render = conn(xcffib.render.key) - r = render.QueryPictFormats().reply() - pictfmt_ids = set() - for pictform in r.formats: - if (pictform.depth == 32 and - pictform.type == xcffib.render.PictType.Direct and - pictform.direct.alpha_mask != 0): - pictfmt_ids.add(pictform.id) - print(pictfmt_ids) - for screen in r.screens: - for depth in screen.depths: - for pv in depth.visuals: - if pv.format in pictfmt_ids: - return pv.visual diff --git a/dwm/picom/tests/testcases/issue239.py b/dwm/picom/tests/testcases/issue239.py deleted file mode 100755 index 3b5b058..0000000 --- a/dwm/picom/tests/testcases/issue239.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 239 is caused by a window gaining a shadow during its fade-out transition -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name so it doesn't get a shadow -set_window_name(conn, wid, "NoShadow") - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -# Set the Window name so it gets a shadow -print("set new name") -set_window_name(conn, wid, "YesShadow") - -# Unmap the window -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.5) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/issue239_2.py b/dwm/picom/tests/testcases/issue239_2.py deleted file mode 100755 index 6ce7cf7..0000000 --- a/dwm/picom/tests/testcases/issue239_2.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 239 is caused by a window gaining a shadow during its fade-out transition -wid = conn.generate_id() -print("Window ids are ", hex(wid)) - -# Create a window -mask = xproto.CW.BackPixel -value = [ setup.roots[0].white_pixel ] -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, mask, value).check() - -name = "_NET_WM_STATE" -name_atom = conn.core.InternAtom(False, len(name), name).reply().atom -atom = "ATOM" -atom_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom -fs = "_NET_WM_STATE_FULLSCREEN" -fs_atom = conn.core.InternAtom(False, len(fs), fs).reply().atom - - -# Map the window, causing screen to be redirected -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -# Set fullscreen property, causing screen to be unredirected -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, name_atom, atom_atom, 32, 1, [fs_atom]).check() - -time.sleep(0.5) - -# Clear fullscreen property, causing screen to be redirected -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid, name_atom, atom_atom, 32, 0, []).check() - -# Do a round trip to X server so the compositor has a chance to start the rerun of _draw_callback -conn.core.GetInputFocus().reply() - -# Unmap the window, triggers the bug -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.5) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/issue239_3.py b/dwm/picom/tests/testcases/issue239_3.py deleted file mode 100755 index 41d58c4..0000000 --- a/dwm/picom/tests/testcases/issue239_3.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 239 is caused by a window gaining a shadow during its fade-out transition -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name so it gets a shadow -set_window_name(conn, wid, "YesShadow") - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -print("set new name") -set_window_name(conn, wid, "NoShadow") - -time.sleep(0.5) - -# Set the Window name so it gets a shadow -print("set new name") -set_window_name(conn, wid, "YesShadow") - -time.sleep(0.5) - -# Unmap the window -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.5) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/issue239_3_norefresh.py b/dwm/picom/tests/testcases/issue239_3_norefresh.py deleted file mode 100755 index f87e2da..0000000 --- a/dwm/picom/tests/testcases/issue239_3_norefresh.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 239 is caused by a window gaining a shadow during its fade-out transition -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name so it gets a shadow -set_window_name(conn, wid, "YesShadow") - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -print("set new name") -set_window_name(conn, wid, "NoShadow") - -# Set the Window name so it gets a shadow -print("set new name") -set_window_name(conn, wid, "YesShadow") - -time.sleep(0.5) - -# Unmap the window -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.5) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/issue299.py b/dwm/picom/tests/testcases/issue299.py deleted file mode 100755 index 83a88cb..0000000 --- a/dwm/picom/tests/testcases/issue299.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -import os -import subprocess -import asyncio -from dbus_next.aio import MessageBus -from dbus_next.message import Message, MessageType -from common import * - -display = os.environ["DISPLAY"].replace(":", "_") -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth -x = xproto.xprotoExtension(conn) -visual32 = find_32bit_visual(conn) - -async def get_client_win_async(wid): - message = await bus.call(Message(destination='com.github.chjj.compton.'+display, - path='/com/github/chjj/compton', - interface='com.github.chjj.compton', - member='win_get', - signature='us', - body=[wid, 'client_win'])) - return message.body[0] - -def get_client_win(wid): - return loop.run_until_complete(get_client_win_async(wid)) - -def wait(): - time.sleep(0.5) - -def create_client_window(name): - client_win = conn.generate_id() - print("Window : ", hex(client_win)) - conn.core.CreateWindowChecked(depth, client_win, root, 0, 0, 100, 100, 0, - xproto.WindowClass.InputOutput, visual, 0, []).check() - set_window_name(conn, client_win, "Test window "+name) - set_window_class(conn, client_win, "Test windows") - set_window_state(conn, client_win, 1) - conn.core.MapWindowChecked(client_win).check() - return client_win - -loop = asyncio.get_event_loop() -bus = loop.run_until_complete(MessageBus().connect()) - -cmid = conn.generate_id() -colormap = conn.core.CreateColormapChecked(xproto.ColormapAlloc._None, cmid, root, visual32).check() - -# Create window -client_wins = [] -for i in range(0,2): - client_wins.append(create_client_window(str(i))) - -# Create frame window -frame_win = conn.generate_id() -print("Window : ", hex(frame_win)) -conn.core.CreateWindowChecked(depth, frame_win, root, 0, 0, 200, 200, 0, - xproto.WindowClass.InputOutput, visual, 0, []).check() -set_window_name(conn, frame_win, "Frame") -conn.core.MapWindowChecked(frame_win).check() - -# Scenario 1.1 -# 1. reparent placeholder to frame -conn.core.ReparentWindowChecked(client_wins[0], frame_win, 0, 0).check() -wait() -# 2. reparent real client to frame -conn.core.ReparentWindowChecked(client_wins[1], frame_win, 0, 0).check() -wait() -# 3. detach the placeholder -conn.core.ReparentWindowChecked(client_wins[0], root, 0, 0).check() -wait() -assert get_client_win(frame_win) == client_wins[1] - -# Scenario 1.2 -# 1. reparent placeholder to frame -conn.core.ReparentWindowChecked(client_wins[0], frame_win, 0, 0).check() -wait() -# 2. reparent real client to frame -conn.core.ReparentWindowChecked(client_wins[1], frame_win, 0, 0).check() -wait() -# 3. destroy the placeholder -conn.core.DestroyWindowChecked(client_wins[0]).check() -wait() -assert get_client_win(frame_win) == client_wins[1] - -client_wins[0] = create_client_window("0") - -# Scenario 2 -# 1. frame is unmapped -conn.core.UnmapWindowChecked(frame_win).check() -wait() -# 2. reparent placeholder to frame -conn.core.ReparentWindowChecked(client_wins[0], frame_win, 0, 0).check() -wait() -# 3. destroy placeholder, map frame and reparent real client to frame -conn.core.DestroyWindowChecked(client_wins[0]).check() -conn.core.MapWindowChecked(frame_win).check() -conn.core.ReparentWindowChecked(client_wins[1], frame_win, 0, 0).check() -wait() -assert get_client_win(frame_win) == client_wins[1] - -client_wins[0] = create_client_window("0") - -# Destroy the windows -for wid in client_wins: - conn.core.DestroyWindowChecked(wid).check() -conn.core.DestroyWindowChecked(frame_win).check() diff --git a/dwm/picom/tests/testcases/issue314.py b/dwm/picom/tests/testcases/issue314.py deleted file mode 100755 index d10b953..0000000 --- a/dwm/picom/tests/testcases/issue314.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name, trigger_root_configure - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth -x = xproto.xprotoExtension(conn) - -# issue 314 is caused by changing a windows target opacity during its fade-in/-out transition -wid1 = conn.generate_id() -print("Window 1: ", hex(wid1)) -wid2 = conn.generate_id() -print("Window 2: ", hex(wid2)) - -# Create windows -conn.core.CreateWindowChecked(depth, wid1, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() -conn.core.CreateWindowChecked(depth, wid2, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window names -set_window_name(conn, wid1, "Test window 1") -set_window_name(conn, wid2, "Test window 2") - -# Check updating opacity while UNMAPPING/DESTROYING windows -print("Mapping 1") -conn.core.MapWindowChecked(wid1).check() -print("Mapping 2") -conn.core.MapWindowChecked(wid2).check() -time.sleep(0.5) - -x.SetInputFocusChecked(0, wid1, xproto.Time.CurrentTime).check() -time.sleep(0.5) - -# Destroy the windows -print("Destroy 1 while fading out") -conn.core.DestroyWindowChecked(wid1).check() -x.SetInputFocusChecked(0, wid2, xproto.Time.CurrentTime).check() -time.sleep(1) -conn.core.DestroyWindowChecked(wid2).check() diff --git a/dwm/picom/tests/testcases/issue314_2.py b/dwm/picom/tests/testcases/issue314_2.py deleted file mode 100755 index 3fd9579..0000000 --- a/dwm/picom/tests/testcases/issue314_2.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth -x = xproto.xprotoExtension(conn) - -opacity_80 = [int(0xffffffff * 0.8), ] -opacity_single = [int(0xffffffff * 0.002), ] - -# issue 314 is caused by changing a windows target opacity during its fade-in/-out transition -wid1 = conn.generate_id() -print("Window 1: ", hex(wid1)) - -atom = "_NET_WM_WINDOW_OPACITY" -opacity_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom - -# Create windows -conn.core.CreateWindowChecked(depth, wid1, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window names -set_window_name(conn, wid1, "Test window 1") - -# Check updating opacity while MAPPING windows -print("Mapping window") -conn.core.MapWindowChecked(wid1).check() -time.sleep(0.5) - -print("Update opacity while fading in") -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_80).check() -time.sleep(0.2) -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_single).check() -time.sleep(1) - -conn.core.DeletePropertyChecked(wid1, opacity_atom).check() -time.sleep(0.5) - -# Destroy the windows -conn.core.DestroyWindowChecked(wid1).check() diff --git a/dwm/picom/tests/testcases/issue314_3.py b/dwm/picom/tests/testcases/issue314_3.py deleted file mode 100755 index 0fb1880..0000000 --- a/dwm/picom/tests/testcases/issue314_3.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth -x = xproto.xprotoExtension(conn) - -opacity_100 = [0xffffffff, ] -opacity_80 = [int(0xffffffff * 0.8), ] -opacity_single = [int(0xffffffff * 0.002), ] -opacity_0 = [0, ] - -# issue 314 is caused by changing a windows target opacity during its fade-in/-out transition -wid1 = conn.generate_id() -print("Window 1: ", hex(wid1)) - -atom = "_NET_WM_WINDOW_OPACITY" -opacity_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom - -# Create windows -conn.core.CreateWindowChecked(depth, wid1, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window names -set_window_name(conn, wid1, "Test window 1") - -# Check updating opacity while FADING windows -print("Mapping window") -conn.core.MapWindowChecked(wid1).check() -time.sleep(1.2) - -print("Update opacity while fading out") -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_single).check() -time.sleep(0.2) -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_0).check() -time.sleep(1) - -print("Change from fading in to fading out") -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_80).check() -time.sleep(0.5) -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_0).check() -time.sleep(1) - -print("Update opacity while fading in") -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_80).check() -time.sleep(0.2) -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_100).check() -time.sleep(1) - -print("Change from fading out to fading in") -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_0).check() -time.sleep(0.5) -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid1, opacity_atom, xproto.Atom.CARDINAL, 32, 1, opacity_80).check() -time.sleep(1) - -# Destroy the windows -conn.core.DestroyWindowChecked(wid1).check() diff --git a/dwm/picom/tests/testcases/issue357.py b/dwm/picom/tests/testcases/issue357.py deleted file mode 100755 index cd74c8c..0000000 --- a/dwm/picom/tests/testcases/issue357.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name, trigger_root_configure, prepare_root_configure - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 357 is triggered when a window is destroyed right after configure_root -wid = conn.generate_id() -print("Window 1: ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name -set_window_name(conn, wid, "Test window 1") - -print("mapping 1") -conn.core.MapWindowChecked(wid).check() -time.sleep(0.5) - -reply, mode, output = prepare_root_configure(conn) -trigger_root_configure(conn, reply, mode, output).reply() - -# Destroy the windows -conn.core.DestroyWindowChecked(wid).check() - -time.sleep(1) diff --git a/dwm/picom/tests/testcases/issue394.py b/dwm/picom/tests/testcases/issue394.py deleted file mode 100755 index e0918ef..0000000 --- a/dwm/picom/tests/testcases/issue394.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name, set_window_size_async - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 394 is caused by a window getting a size update just before destroying leading to a shadow update on destroyed window. -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name so it doesn't get a shadow -set_window_name(conn, wid, "Test Window") - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -# Resize the window and destroy -print("resize and destroy") -set_window_size_async(conn, wid, 150, 150) -conn.core.DestroyWindowChecked(wid).check() - -time.sleep(0.5) diff --git a/dwm/picom/tests/testcases/issue465.py b/dwm/picom/tests/testcases/issue465.py deleted file mode 100755 index fc33a6d..0000000 --- a/dwm/picom/tests/testcases/issue465.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth -x = xproto.xprotoExtension(conn) - -# issue 465 is triggered when focusing a new window with a shadow-exclude rule for unfocused windows. -wid1 = conn.generate_id() -print("Window 1: ", hex(wid1)) -wid2 = conn.generate_id() -print("Window 2: ", hex(wid2)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid1, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() -conn.core.CreateWindowChecked(depth, wid2, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Set Window name -set_window_name(conn, wid1, "Test window 1") -set_window_name(conn, wid2, "Test window 2") - -print("mapping 1") -conn.core.MapWindowChecked(wid1).check() -print("mapping 2") -conn.core.MapWindowChecked(wid2).check() -time.sleep(0.5) - -x.SetInputFocusChecked(0, wid1, xproto.Time.CurrentTime).check() -time.sleep(0.5) - -# Destroy the windows -conn.core.DestroyWindowChecked(wid1).check() -time.sleep(1) diff --git a/dwm/picom/tests/testcases/issue525.py b/dwm/picom/tests/testcases/issue525.py deleted file mode 100755 index 50dd32c..0000000 --- a/dwm/picom/tests/testcases/issue525.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -# issue 525 happens when a window is unmapped with pixmap stale flag set -wid = conn.generate_id() -print("Window id is ", hex(wid)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Map the window -print("mapping") -conn.core.MapWindowChecked(wid).check() - -time.sleep(0.5) - -# change window size, invalidate the pixmap -conn.core.ConfigureWindow(wid, xproto.ConfigWindow.X | xproto.ConfigWindow.Width, [100, 200]) - -# unmap the window immediately after -conn.core.UnmapWindowChecked(wid).check() - -time.sleep(0.1) - -# Destroy the window -conn.core.DestroyWindowChecked(wid).check() diff --git a/dwm/picom/tests/testcases/redirect_when_unmapped_window_has_shadow.py b/dwm/picom/tests/testcases/redirect_when_unmapped_window_has_shadow.py deleted file mode 100755 index 7488340..0000000 --- a/dwm/picom/tests/testcases/redirect_when_unmapped_window_has_shadow.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python3 - -import xcffib.xproto as xproto -import xcffib -import time -from common import set_window_name - -conn = xcffib.connect() -setup = conn.get_setup() -root = setup.roots[0].root -visual = setup.roots[0].root_visual -depth = setup.roots[0].root_depth - -name = "_NET_WM_STATE" -name_atom = conn.core.InternAtom(False, len(name), name).reply().atom -atom = "ATOM" -atom_atom = conn.core.InternAtom(False, len(atom), atom).reply().atom -fs = "_NET_WM_STATE_FULLSCREEN" -fs_atom = conn.core.InternAtom(False, len(fs), fs).reply().atom - -wid1 = conn.generate_id() -print("Window 1 id is ", hex(wid1)) - -# Create a window -conn.core.CreateWindowChecked(depth, wid1, root, 0, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() - -# Map the window -print("mapping 1") -conn.core.MapWindowChecked(wid1).check() - -time.sleep(0.5) - -print("unmapping 1") -# Unmap the window -conn.core.UnmapWindowChecked(wid1).check() - -time.sleep(0.5) - -# create and map a second window -wid2 = conn.generate_id() -print("Window 2 id is ", hex(wid2)) -conn.core.CreateWindowChecked(depth, wid2, root, 200, 0, 100, 100, 0, xproto.WindowClass.InputOutput, visual, 0, []).check() -print("mapping 2") -conn.core.MapWindowChecked(wid2).check() -time.sleep(0.5) - -# Set fullscreen property on the second window, causing screen to be unredirected -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid2, name_atom, atom_atom, 32, 1, [fs_atom]).check() - -time.sleep(0.5) - -# Unset fullscreen property on the second window, causing screen to be redirected -conn.core.ChangePropertyChecked(xproto.PropMode.Replace, wid2, name_atom, atom_atom, 32, 0, []).check() - -time.sleep(0.5) - -# map the first window again -print("mapping 1") -conn.core.MapWindowChecked(wid1).check() - -time.sleep(0.5) - -# Destroy the windows -conn.core.DestroyWindowChecked(wid1).check() -conn.core.DestroyWindowChecked(wid2).check() diff --git a/dwm/slstatus/LICENSE b/dwm/slstatus/LICENSE deleted file mode 100644 index 8bee9c8..0000000 --- a/dwm/slstatus/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -ISC License - -Copyright 2016-2022 Aaron Marcher - -Copyright 2016 Roy Freytag -Copyright 2016 Vincent Loupmon -Copyright 2016 Daniel Walter -Copyright 2016-2018 Ali H. Fardan -Copyright 2016 Jody Leonard -Copyright 2016-2018 Quentin Rameau -Copyright 2016 Mike Coddington -Copyright 2016-2018 Ivan J. -Copyright 2017 Tobias Stoeckmann -Copyright 2017-2018 Laslo Hunhold -Copyright 2018 Darron Anderson -Copyright 2018 Josuah Demangeon -Copyright 2018 Tobias Tschinkowitz -Copyright 2018 David Demelier -Copyright 2018-2012 Michael Buch -Copyright 2018 Ian Remmler -Copyright 2016-2019 Joerg Jung -Copyright 2019 Ryan Kes -Copyright 2019 Cem Keylan -Copyright 2019 Dimitris Papastamos -Copyright 2019-2022 Ingo Feinerer -Copyright 2020 Alexandre Ratchov -Copyright 2020 Mart Lubbers -Copyright 2020 Daniel Moch -Copyright 2022 Nickolas Raymond Kaczynski -Copyright 2022 Patrick Iacob -Copyright 2021-2022 Steven Ward - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/dwm/slstatus/Makefile b/dwm/slstatus/Makefile deleted file mode 100644 index c27f7fb..0000000 --- a/dwm/slstatus/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# See LICENSE file for copyright and license details -# slstatus - suckless status monitor -.POSIX: - -include config.mk - -REQ = util -COM =\ - components/battery\ - components/cat\ - components/cpu\ - components/datetime\ - components/disk\ - components/entropy\ - components/hostname\ - components/ip\ - components/kernel_release\ - components/keyboard_indicators\ - components/keymap\ - components/load_avg\ - components/netspeeds\ - components/num_files\ - components/ram\ - components/run_command\ - components/swap\ - components/temperature\ - components/uptime\ - components/user\ - components/volume\ - components/wifi\ - components/weather - -all: slstatus - -$(COM:=.o): config.mk $(REQ:=.h) slstatus.h -slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h) - -.c.o: - $(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< - -config.h: - cp config.def.h $@ - -slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) - $(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS) - -clean: - rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o) slstatus-${VERSION}.tar.gz - -dist: - rm -rf "slstatus-$(VERSION)" - mkdir -p "slstatus-$(VERSION)/components" - cp -R LICENSE Makefile README config.mk config.def.h \ - arg.h slstatus.h slstatus.c $(REQ:=.c) $(REQ:=.h) \ - slstatus.1 "slstatus-$(VERSION)" - cp -R $(COM:=.c) "slstatus-$(VERSION)/components" - tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz" - rm -rf "slstatus-$(VERSION)" - -install: all - mkdir -p "$(DESTDIR)$(PREFIX)/bin" - cp -f slstatus "$(DESTDIR)$(PREFIX)/bin" - chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus" - mkdir -p "$(DESTDIR)$(MANPREFIX)/man1" - cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1" - chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1" - -uninstall: - rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus" - rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1" diff --git a/dwm/slstatus/README b/dwm/slstatus/README deleted file mode 100644 index 12d38bf..0000000 --- a/dwm/slstatus/README +++ /dev/null @@ -1,65 +0,0 @@ -slstatus - suckless status -========================== -slstatus is a small tool for providing system status information to other -programs over the EWMH property of the root window (used by dwm(1)) or -standard input/output. It is designed to be as efficient as possible by -only issuing the minimum of system calls required. - - -Features --------- -- Battery percentage/state/time left -- Cat (read file) -- CPU usage -- CPU frequency -- Custom shell commands -- Date and time -- Disk status (free storage, percentage, total storage and used storage) -- Available entropy -- Username/GID/UID -- Hostname -- IP address (IPv4 and IPv6) -- Kernel version -- Keyboard indicators -- Keymap -- Load average -- Network speeds (RX and TX) -- Number of files in a directory (hint: Maildir) -- Memory status (free memory, percentage, total memory and used memory) -- Swap status (free swap, percentage, total swap and used swap) -- Temperature -- Uptime -- Volume percentage -- WiFi signal percentage and ESSID - - -Requirements ------------- -Currently slstatus works on FreeBSD, Linux and OpenBSD. -In order to build slstatus you need the Xlib header files. - -- For volume percentage on Linux the kernel module `snd-mixer-oss` must be - loaded. -- For volume percentage on FreeBSD, `sndio` must be installed. - - -Installation ------------- -Edit config.mk to match your local setup (slstatus is installed into the -/usr/local namespace by default). - -Afterwards enter the following command to build and install slstatus (if -necessary as root): - - make clean install - - -Running slstatus ----------------- -See the man page for details. - - -Configuration -------------- -slstatus can be customized by creating a custom config.h and (re)compiling the -source code. This keeps it fast, secure and simple. diff --git a/dwm/slstatus/arg.h b/dwm/slstatus/arg.h deleted file mode 100644 index 5f1f408..0000000 --- a/dwm/slstatus/arg.h +++ /dev/null @@ -1,33 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#ifndef ARG_H -#define ARG_H - -extern char *argv0; - -/* int main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) : ((void *)0); \ - *argv && (*argv)[0] == '-' && (*argv)[1]; argc--, argv++) { \ - int i_, argused_; \ - if ((*argv)[1] == '-' && !(*argv)[2]) { \ - argc--, argv++; \ - break; \ - } \ - for (i_ = 1, argused_ = 0; (*argv)[i_]; i_++) { \ - switch ((*argv)[i_]) -#define ARGEND if (argused_) { \ - if ((*argv)[i_ + 1]) { \ - break; \ - } else { \ - argc--, argv++; \ - break; \ - } \ - } \ - } \ - } -#define ARGC() ((*argv)[i_]) -#define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1, &((*argv)[i_ + 1])) : \ - (*(argv + 1)) ? (argused_ = 1, *(argv + 1)) : (x)) -#define EARGF(x) ARGF_(((x), exit(1), (char *)0)) -#define ARGF() ARGF_((char *)0) - -#endif diff --git a/dwm/slstatus/components/battery.c b/dwm/slstatus/components/battery.c deleted file mode 100644 index 1c753f9..0000000 --- a/dwm/slstatus/components/battery.c +++ /dev/null @@ -1,247 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__linux__) -/* - * https://www.kernel.org/doc/html/latest/power/power_supply_class.html - */ - #include - #include - #include - - #define POWER_SUPPLY_CAPACITY "/sys/class/power_supply/%s/capacity" - #define POWER_SUPPLY_STATUS "/sys/class/power_supply/%s/status" - #define POWER_SUPPLY_CHARGE "/sys/class/power_supply/%s/charge_now" - #define POWER_SUPPLY_ENERGY "/sys/class/power_supply/%s/energy_now" - #define POWER_SUPPLY_CURRENT "/sys/class/power_supply/%s/current_now" - #define POWER_SUPPLY_POWER "/sys/class/power_supply/%s/power_now" - - static const char * - pick(const char *bat, const char *f1, const char *f2, char *path, - size_t length) - { - if (esnprintf(path, length, f1, bat) > 0 && - access(path, R_OK) == 0) - return f1; - - if (esnprintf(path, length, f2, bat) > 0 && - access(path, R_OK) == 0) - return f2; - - return NULL; - } - - const char * - battery_perc(const char *bat) - { - int cap_perc; - char path[PATH_MAX]; - - if (esnprintf(path, sizeof(path), POWER_SUPPLY_CAPACITY, bat) < 0) - return NULL; - if (pscanf(path, "%d", &cap_perc) != 1) - return NULL; - - return bprintf("%d", cap_perc); - } - - const char * - battery_state(const char *bat) - { - static struct { - char *state; - char *symbol; - } map[] = { - { "Charging", "+" }, - { "Discharging", "-" }, - { "Full", "o" }, - { "Not charging", "o" }, - }; - size_t i; - char path[PATH_MAX], state[12]; - - if (esnprintf(path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0) - return NULL; - if (pscanf(path, "%12[a-zA-Z ]", state) != 1) - return NULL; - - for (i = 0; i < LEN(map); i++) - if (!strcmp(map[i].state, state)) - break; - - return (i == LEN(map)) ? "?" : map[i].symbol; - } - - const char * - battery_remaining(const char *bat) - { - uintmax_t charge_now, current_now, m, h; - double timeleft; - char path[PATH_MAX], state[12]; - - if (esnprintf(path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0) - return NULL; - if (pscanf(path, "%12[a-zA-Z ]", state) != 1) - return NULL; - - if (!pick(bat, POWER_SUPPLY_CHARGE, POWER_SUPPLY_ENERGY, path, - sizeof(path)) || - pscanf(path, "%ju", &charge_now) < 0) - return NULL; - - if (!strcmp(state, "Discharging")) { - if (!pick(bat, POWER_SUPPLY_CURRENT, POWER_SUPPLY_POWER, path, - sizeof(path)) || - pscanf(path, "%ju", ¤t_now) < 0) - return NULL; - - if (current_now == 0) - return NULL; - - timeleft = (double)charge_now / (double)current_now; - h = timeleft; - m = (timeleft - (double)h) * 60; - - return bprintf("%juh %jum", h, m); - } - - return ""; - } -#elif defined(__OpenBSD__) - #include - #include - #include - #include - - static int - load_apm_power_info(struct apm_power_info *apm_info) - { - int fd; - - fd = open("/dev/apm", O_RDONLY); - if (fd < 0) { - warn("open '/dev/apm':"); - return 0; - } - - memset(apm_info, 0, sizeof(struct apm_power_info)); - if (ioctl(fd, APM_IOC_GETPOWER, apm_info) < 0) { - warn("ioctl 'APM_IOC_GETPOWER':"); - close(fd); - return 0; - } - return close(fd), 1; - } - - const char * - battery_perc(const char *unused) - { - struct apm_power_info apm_info; - - if (load_apm_power_info(&apm_info)) - return bprintf("%d", apm_info.battery_life); - - return NULL; - } - - const char * - battery_state(const char *unused) - { - struct { - unsigned int state; - char *symbol; - } map[] = { - { APM_AC_ON, "+" }, - { APM_AC_OFF, "-" }, - }; - struct apm_power_info apm_info; - size_t i; - - if (load_apm_power_info(&apm_info)) { - for (i = 0; i < LEN(map); i++) - if (map[i].state == apm_info.ac_state) - break; - - return (i == LEN(map)) ? "?" : map[i].symbol; - } - - return NULL; - } - - const char * - battery_remaining(const char *unused) - { - struct apm_power_info apm_info; - unsigned int h, m; - - if (load_apm_power_info(&apm_info)) { - if (apm_info.ac_state != APM_AC_ON) { - h = apm_info.minutes_left / 60; - m = apm_info.minutes_left % 60; - return bprintf("%uh %02um", h, m); - } else { - return ""; - } - } - - return NULL; - } -#elif defined(__FreeBSD__) - #include - - #define BATTERY_LIFE "hw.acpi.battery.life" - #define BATTERY_STATE "hw.acpi.battery.state" - #define BATTERY_TIME "hw.acpi.battery.time" - - const char * - battery_perc(const char *unused) - { - int cap_perc; - size_t len; - - len = sizeof(cap_perc); - if (sysctlbyname(BATTERY_LIFE, &cap_perc, &len, NULL, 0) < 0 || !len) - return NULL; - - return bprintf("%d", cap_perc); - } - - const char * - battery_state(const char *unused) - { - int state; - size_t len; - - len = sizeof(state); - if (sysctlbyname(BATTERY_STATE, &state, &len, NULL, 0) < 0 || !len) - return NULL; - - switch (state) { - case 0: /* FALLTHROUGH */ - case 2: - return "+"; - case 1: - return "-"; - default: - return "?"; - } - } - - const char * - battery_remaining(const char *unused) - { - int rem; - size_t len; - - len = sizeof(rem); - if (sysctlbyname(BATTERY_TIME, &rem, &len, NULL, 0) < 0 || !len - || rem < 0) - return NULL; - - return bprintf("%uh %02um", rem / 60, rem % 60); - } -#endif diff --git a/dwm/slstatus/components/battery.o b/dwm/slstatus/components/battery.o deleted file mode 100644 index 83c2f8b..0000000 Binary files a/dwm/slstatus/components/battery.o and /dev/null differ diff --git a/dwm/slstatus/components/cat.c b/dwm/slstatus/components/cat.c deleted file mode 100644 index 07944cc..0000000 --- a/dwm/slstatus/components/cat.c +++ /dev/null @@ -1,32 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -cat(const char *path) -{ - char *f; - FILE *fp; - - if (!(fp = fopen(path, "r"))) { - warn("fopen '%s':", path); - return NULL; - } - - f = fgets(buf, sizeof(buf) - 1, fp); - if (fclose(fp) < 0) { - warn("fclose '%s':", path); - return NULL; - } - if (!f) - return NULL; - - if ((f = strrchr(buf, '\n'))) - f[0] = '\0'; - - return buf[0] ? buf : NULL; -} - diff --git a/dwm/slstatus/components/cat.o b/dwm/slstatus/components/cat.o deleted file mode 100644 index cd1dc42..0000000 Binary files a/dwm/slstatus/components/cat.o and /dev/null differ diff --git a/dwm/slstatus/components/cpu.c b/dwm/slstatus/components/cpu.c deleted file mode 100644 index d0d03c7..0000000 --- a/dwm/slstatus/components/cpu.c +++ /dev/null @@ -1,157 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__linux__) - #define CPU_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" - - const char * - cpu_freq(const char *unused) - { - uintmax_t freq; - - /* in kHz */ - if (pscanf(CPU_FREQ, "%ju", &freq) != 1) - return NULL; - - return fmt_human(freq * 1000, 1000); - } - - const char * - cpu_perc(const char *unused) - { - static long double a[7]; - long double b[7], sum; - - memcpy(b, a, sizeof(b)); - /* cpu user nice system idle iowait irq softirq */ - if (pscanf("/proc/stat", "%*s %Lf %Lf %Lf %Lf %Lf %Lf %Lf", - &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6]) - != 7) - return NULL; - - if (b[0] == 0) - return NULL; - - sum = (b[0] + b[1] + b[2] + b[3] + b[4] + b[5] + b[6]) - - (a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6]); - - if (sum == 0) - return NULL; - - return bprintf("%d", (int)(100 * - ((b[0] + b[1] + b[2] + b[5] + b[6]) - - (a[0] + a[1] + a[2] + a[5] + a[6])) / sum)); - } -#elif defined(__OpenBSD__) - #include - #include - #include - - const char * - cpu_freq(const char *unused) - { - int freq, mib[2]; - size_t size; - - mib[0] = CTL_HW; - mib[1] = HW_CPUSPEED; - - size = sizeof(freq); - - /* in MHz */ - if (sysctl(mib, 2, &freq, &size, NULL, 0) < 0) { - warn("sysctl 'HW_CPUSPEED':"); - return NULL; - } - - return fmt_human(freq * 1E6, 1000); - } - - const char * - cpu_perc(const char *unused) - { - int mib[2]; - static uintmax_t a[CPUSTATES]; - uintmax_t b[CPUSTATES], sum; - size_t size; - - mib[0] = CTL_KERN; - mib[1] = KERN_CPTIME; - - size = sizeof(a); - - memcpy(b, a, sizeof(b)); - if (sysctl(mib, 2, &a, &size, NULL, 0) < 0) { - warn("sysctl 'KERN_CPTIME':"); - return NULL; - } - if (b[0] == 0) - return NULL; - - sum = (a[CP_USER] + a[CP_NICE] + a[CP_SYS] + a[CP_INTR] + a[CP_IDLE]) - - (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + b[CP_INTR] + b[CP_IDLE]); - - if (sum == 0) - return NULL; - - return bprintf("%d", 100 * - ((a[CP_USER] + a[CP_NICE] + a[CP_SYS] + - a[CP_INTR]) - - (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + - b[CP_INTR])) / sum); - } -#elif defined(__FreeBSD__) - #include - #include - #include - - const char * - cpu_freq(const char *unused) - { - int freq; - size_t size; - - size = sizeof(freq); - /* in MHz */ - if (sysctlbyname("hw.clockrate", &freq, &size, NULL, 0) < 0 || !size) { - warn("sysctlbyname 'hw.clockrate':"); - return NULL; - } - - return fmt_human(freq * 1E6, 1000); - } - - const char * - cpu_perc(const char *unused) - { - size_t size; - static long a[CPUSTATES]; - long b[CPUSTATES], sum; - - size = sizeof(a); - memcpy(b, a, sizeof(b)); - if (sysctlbyname("kern.cp_time", &a, &size, NULL, 0) < 0 || !size) { - warn("sysctlbyname 'kern.cp_time':"); - return NULL; - } - if (b[0] == 0) - return NULL; - - sum = (a[CP_USER] + a[CP_NICE] + a[CP_SYS] + a[CP_INTR] + a[CP_IDLE]) - - (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + b[CP_INTR] + b[CP_IDLE]); - - if (sum == 0) - return NULL; - - return bprintf("%d", 100 * - ((a[CP_USER] + a[CP_NICE] + a[CP_SYS] + - a[CP_INTR]) - - (b[CP_USER] + b[CP_NICE] + b[CP_SYS] + - b[CP_INTR])) / sum); - } -#endif diff --git a/dwm/slstatus/components/cpu.o b/dwm/slstatus/components/cpu.o deleted file mode 100644 index 10c6e85..0000000 Binary files a/dwm/slstatus/components/cpu.o and /dev/null differ diff --git a/dwm/slstatus/components/datetime.c b/dwm/slstatus/components/datetime.c deleted file mode 100644 index 5b10daf..0000000 --- a/dwm/slstatus/components/datetime.c +++ /dev/null @@ -1,20 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -datetime(const char *fmt) -{ - time_t t; - - t = time(NULL); - if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) { - warn("strftime: Result string exceeds buffer size"); - return NULL; - } - - return buf; -} diff --git a/dwm/slstatus/components/datetime.o b/dwm/slstatus/components/datetime.o deleted file mode 100644 index adabec1..0000000 Binary files a/dwm/slstatus/components/datetime.o and /dev/null differ diff --git a/dwm/slstatus/components/disk.c b/dwm/slstatus/components/disk.c deleted file mode 100644 index e19a693..0000000 --- a/dwm/slstatus/components/disk.c +++ /dev/null @@ -1,59 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -disk_free(const char *path) -{ - struct statvfs fs; - - if (statvfs(path, &fs) < 0) { - warn("statvfs '%s':", path); - return NULL; - } - - return fmt_human(fs.f_frsize * fs.f_bavail, 1024); -} - -const char * -disk_perc(const char *path) -{ - struct statvfs fs; - - if (statvfs(path, &fs) < 0) { - warn("statvfs '%s':", path); - return NULL; - } - - return bprintf("%d", (int)(100 * - (1 - ((double)fs.f_bavail / (double)fs.f_blocks)))); -} - -const char * -disk_total(const char *path) -{ - struct statvfs fs; - - if (statvfs(path, &fs) < 0) { - warn("statvfs '%s':", path); - return NULL; - } - - return fmt_human(fs.f_frsize * fs.f_blocks, 1024); -} - -const char * -disk_used(const char *path) -{ - struct statvfs fs; - - if (statvfs(path, &fs) < 0) { - warn("statvfs '%s':", path); - return NULL; - } - - return fmt_human(fs.f_frsize * (fs.f_blocks - fs.f_bfree), 1024); -} diff --git a/dwm/slstatus/components/disk.o b/dwm/slstatus/components/disk.o deleted file mode 100644 index 5490988..0000000 Binary files a/dwm/slstatus/components/disk.o and /dev/null differ diff --git a/dwm/slstatus/components/entropy.c b/dwm/slstatus/components/entropy.c deleted file mode 100644 index 65010b0..0000000 --- a/dwm/slstatus/components/entropy.c +++ /dev/null @@ -1,29 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include "../slstatus.h" -#if defined(__linux__) - #include - #include - - #include "../util.h" - - #define ENTROPY_AVAIL "/proc/sys/kernel/random/entropy_avail" - - const char * - entropy(const char *unused) - { - uintmax_t num; - - if (pscanf(ENTROPY_AVAIL, "%ju", &num) != 1) - return NULL; - - return bprintf("%ju", num); - } -#elif defined(__OpenBSD__) | defined(__FreeBSD__) - const char * - entropy(const char *unused) - { - // https://www.unicode.org/charts/PDF/U2200.pdf - /* Unicode Character 'INFINITY' (U+221E) */ - return "\u221E"; - } -#endif diff --git a/dwm/slstatus/components/entropy.o b/dwm/slstatus/components/entropy.o deleted file mode 100644 index b818ab3..0000000 Binary files a/dwm/slstatus/components/entropy.o and /dev/null differ diff --git a/dwm/slstatus/components/hostname.c b/dwm/slstatus/components/hostname.c deleted file mode 100644 index dab8b63..0000000 --- a/dwm/slstatus/components/hostname.c +++ /dev/null @@ -1,17 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -hostname(const char *unused) -{ - if (gethostname(buf, sizeof(buf)) < 0) { - warn("gethostbyname:"); - return NULL; - } - - return buf; -} diff --git a/dwm/slstatus/components/hostname.o b/dwm/slstatus/components/hostname.o deleted file mode 100644 index e4352d0..0000000 Binary files a/dwm/slstatus/components/hostname.o and /dev/null differ diff --git a/dwm/slstatus/components/ip.c b/dwm/slstatus/components/ip.c deleted file mode 100644 index 9476549..0000000 --- a/dwm/slstatus/components/ip.c +++ /dev/null @@ -1,61 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#if defined(__OpenBSD__) - #include - #include -#elif defined(__FreeBSD__) - #include - #include -#endif - -#include "../slstatus.h" -#include "../util.h" - -static const char * -ip(const char *interface, unsigned short sa_family) -{ - struct ifaddrs *ifaddr, *ifa; - int s; - char host[NI_MAXHOST]; - - if (getifaddrs(&ifaddr) < 0) { - warn("getifaddrs:"); - return NULL; - } - - for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { - if (!ifa->ifa_addr) - continue; - - s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6), - host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); - if (!strcmp(ifa->ifa_name, interface) && - (ifa->ifa_addr->sa_family == sa_family)) { - freeifaddrs(ifaddr); - if (s != 0) { - warn("getnameinfo: %s", gai_strerror(s)); - return NULL; - } - return bprintf("%s", host); - } - } - - freeifaddrs(ifaddr); - - return NULL; -} - -const char * -ipv4(const char *interface) -{ - return ip(interface, AF_INET); -} - -const char * -ipv6(const char *interface) -{ - return ip(interface, AF_INET6); -} diff --git a/dwm/slstatus/components/ip.o b/dwm/slstatus/components/ip.o deleted file mode 100644 index afb0530..0000000 Binary files a/dwm/slstatus/components/ip.o and /dev/null differ diff --git a/dwm/slstatus/components/kernel_release.c b/dwm/slstatus/components/kernel_release.c deleted file mode 100644 index 36a6a44..0000000 --- a/dwm/slstatus/components/kernel_release.c +++ /dev/null @@ -1,19 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -kernel_release(const char *unused) -{ - struct utsname udata; - - if (uname(&udata) < 0) { - warn("uname:"); - return NULL; - } - - return bprintf("%s", udata.release); -} diff --git a/dwm/slstatus/components/kernel_release.o b/dwm/slstatus/components/kernel_release.o deleted file mode 100644 index 7c306b5..0000000 Binary files a/dwm/slstatus/components/kernel_release.o and /dev/null differ diff --git a/dwm/slstatus/components/keyboard_indicators.c b/dwm/slstatus/components/keyboard_indicators.c deleted file mode 100644 index 5f62bb7..0000000 --- a/dwm/slstatus/components/keyboard_indicators.c +++ /dev/null @@ -1,50 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -/* - * fmt consists of uppercase or lowercase 'c' for caps lock and/or 'n' for num - * lock, each optionally followed by '?', in the order of indicators desired. - * If followed by '?', the letter with case preserved is included in the output - * if the corresponding indicator is on. Otherwise, the letter is always - * included, lowercase when off and uppercase when on. - */ -const char * -keyboard_indicators(const char *fmt) -{ - Display *dpy; - XKeyboardState state; - size_t fmtlen, i, n; - int togglecase, isset; - char key; - - if (!(dpy = XOpenDisplay(NULL))) { - warn("XOpenDisplay: Failed to open display"); - return NULL; - } - XGetKeyboardControl(dpy, &state); - XCloseDisplay(dpy); - - fmtlen = strnlen(fmt, 4); - for (i = n = 0; i < fmtlen; i++) { - key = tolower(fmt[i]); - if (key != 'c' && key != 'n') - continue; - - togglecase = (i + 1 >= fmtlen || fmt[i + 1] != '?'); - isset = (state.led_mask & (1 << (key == 'n'))); - - if (togglecase) - buf[n++] = isset ? toupper(key) : key; - else if (isset) - buf[n++] = fmt[i]; - } - - buf[n] = 0; - return buf; -} diff --git a/dwm/slstatus/components/keyboard_indicators.o b/dwm/slstatus/components/keyboard_indicators.o deleted file mode 100644 index 61c3ec5..0000000 Binary files a/dwm/slstatus/components/keyboard_indicators.o and /dev/null differ diff --git a/dwm/slstatus/components/keymap.c b/dwm/slstatus/components/keymap.c deleted file mode 100644 index f8a2a47..0000000 --- a/dwm/slstatus/components/keymap.c +++ /dev/null @@ -1,86 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -static int -valid_layout_or_variant(char *sym) -{ - size_t i; - /* invalid symbols from xkb rules config */ - static const char *invalid[] = { "evdev", "inet", "pc", "base" }; - - for (i = 0; i < LEN(invalid); i++) - if (!strncmp(sym, invalid[i], strlen(invalid[i]))) - return 0; - - return 1; -} - -static char * -get_layout(char *syms, int grp_num) -{ - char *tok, *layout; - int grp; - - layout = NULL; - tok = strtok(syms, "+:"); - for (grp = 0; tok && grp <= grp_num; tok = strtok(NULL, "+:")) { - if (!valid_layout_or_variant(tok)) { - continue; - } else if (strlen(tok) == 1 && isdigit(tok[0])) { - /* ignore :2, :3, :4 (additional layout groups) */ - continue; - } - layout = tok; - grp++; - } - - return layout; -} - -const char * -keymap(const char *unused) -{ - Display *dpy; - XkbDescRec *desc; - XkbStateRec state; - char *symbols; - const char *layout; - - layout = NULL; - - if (!(dpy = XOpenDisplay(NULL))) { - warn("XOpenDisplay: Failed to open display"); - return NULL; - } - if (!(desc = XkbAllocKeyboard())) { - warn("XkbAllocKeyboard: Failed to allocate keyboard"); - goto end; - } - if (XkbGetNames(dpy, XkbSymbolsNameMask, desc)) { - warn("XkbGetNames: Failed to retrieve key symbols"); - goto end; - } - if (XkbGetState(dpy, XkbUseCoreKbd, &state)) { - warn("XkbGetState: Failed to retrieve keyboard state"); - goto end; - } - if (!(symbols = XGetAtomName(dpy, desc->names->symbols))) { - warn("XGetAtomName: Failed to get atom name"); - goto end; - } - layout = bprintf("%s", get_layout(symbols, state.group)); - XFree(symbols); -end: - XkbFreeKeyboard(desc, XkbSymbolsNameMask, 1); - if (XCloseDisplay(dpy)) - warn("XCloseDisplay: Failed to close display"); - - return layout; -} diff --git a/dwm/slstatus/components/keymap.o b/dwm/slstatus/components/keymap.o deleted file mode 100644 index a44a5cb..0000000 Binary files a/dwm/slstatus/components/keymap.o and /dev/null differ diff --git a/dwm/slstatus/components/load_avg.c b/dwm/slstatus/components/load_avg.c deleted file mode 100644 index f278a40..0000000 --- a/dwm/slstatus/components/load_avg.c +++ /dev/null @@ -1,19 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -load_avg(const char *unused) -{ - double avgs[3]; - - if (getloadavg(avgs, 3) < 0) { - warn("getloadavg: Failed to obtain load average"); - return NULL; - } - - return bprintf("%.2f %.2f %.2f", avgs[0], avgs[1], avgs[2]); -} diff --git a/dwm/slstatus/components/load_avg.o b/dwm/slstatus/components/load_avg.o deleted file mode 100644 index 9122b5c..0000000 Binary files a/dwm/slstatus/components/load_avg.o and /dev/null differ diff --git a/dwm/slstatus/components/netspeeds.c b/dwm/slstatus/components/netspeeds.c deleted file mode 100644 index cde6fa9..0000000 --- a/dwm/slstatus/components/netspeeds.c +++ /dev/null @@ -1,129 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__linux__) - #include - - #define NET_RX_BYTES "/sys/class/net/%s/statistics/rx_bytes" - #define NET_TX_BYTES "/sys/class/net/%s/statistics/tx_bytes" - - const char * - netspeed_rx(const char *interface) - { - uintmax_t oldrxbytes; - static uintmax_t rxbytes; - extern const unsigned int interval; - char path[PATH_MAX]; - - oldrxbytes = rxbytes; - - if (esnprintf(path, sizeof(path), NET_RX_BYTES, interface) < 0) - return NULL; - if (pscanf(path, "%ju", &rxbytes) != 1) - return NULL; - if (oldrxbytes == 0) - return NULL; - - return fmt_human((rxbytes - oldrxbytes) * 1000 / interval, - 1024); - } - - const char * - netspeed_tx(const char *interface) - { - uintmax_t oldtxbytes; - static uintmax_t txbytes; - extern const unsigned int interval; - char path[PATH_MAX]; - - oldtxbytes = txbytes; - - if (esnprintf(path, sizeof(path), NET_TX_BYTES, interface) < 0) - return NULL; - if (pscanf(path, "%ju", &txbytes) != 1) - return NULL; - if (oldtxbytes == 0) - return NULL; - - return fmt_human((txbytes - oldtxbytes) * 1000 / interval, - 1024); - } -#elif defined(__OpenBSD__) | defined(__FreeBSD__) - #include - #include - #include - #include - #include - - const char * - netspeed_rx(const char *interface) - { - struct ifaddrs *ifal, *ifa; - struct if_data *ifd; - uintmax_t oldrxbytes; - static uintmax_t rxbytes; - extern const unsigned int interval; - int if_ok = 0; - - oldrxbytes = rxbytes; - - if (getifaddrs(&ifal) < 0) { - warn("getifaddrs failed"); - return NULL; - } - rxbytes = 0; - for (ifa = ifal; ifa; ifa = ifa->ifa_next) - if (!strcmp(ifa->ifa_name, interface) && - (ifd = (struct if_data *)ifa->ifa_data)) - rxbytes += ifd->ifi_ibytes, if_ok = 1; - - freeifaddrs(ifal); - if (!if_ok) { - warn("reading 'if_data' failed"); - return NULL; - } - if (oldrxbytes == 0) - return NULL; - - return fmt_human((rxbytes - oldrxbytes) * 1000 / interval, - 1024); - } - - const char * - netspeed_tx(const char *interface) - { - struct ifaddrs *ifal, *ifa; - struct if_data *ifd; - uintmax_t oldtxbytes; - static uintmax_t txbytes; - extern const unsigned int interval; - int if_ok = 0; - - oldtxbytes = txbytes; - - if (getifaddrs(&ifal) < 0) { - warn("getifaddrs failed"); - return NULL; - } - txbytes = 0; - for (ifa = ifal; ifa; ifa = ifa->ifa_next) - if (!strcmp(ifa->ifa_name, interface) && - (ifd = (struct if_data *)ifa->ifa_data)) - txbytes += ifd->ifi_obytes, if_ok = 1; - - freeifaddrs(ifal); - if (!if_ok) { - warn("reading 'if_data' failed"); - return NULL; - } - if (oldtxbytes == 0) - return NULL; - - return fmt_human((txbytes - oldtxbytes) * 1000 / interval, - 1024); - } -#endif diff --git a/dwm/slstatus/components/netspeeds.o b/dwm/slstatus/components/netspeeds.o deleted file mode 100644 index 6be69d5..0000000 Binary files a/dwm/slstatus/components/netspeeds.o and /dev/null differ diff --git a/dwm/slstatus/components/num_files.c b/dwm/slstatus/components/num_files.c deleted file mode 100644 index df0acd1..0000000 --- a/dwm/slstatus/components/num_files.c +++ /dev/null @@ -1,32 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -num_files(const char *path) -{ - struct dirent *dp; - DIR *dir; - int num; - - if (!(dir = opendir(path))) { - warn("opendir '%s':", path); - return NULL; - } - - num = 0; - while ((dp = readdir(dir))) { - if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) - continue; /* skip self and parent */ - - num++; - } - - closedir(dir); - - return bprintf("%d", num); -} diff --git a/dwm/slstatus/components/num_files.o b/dwm/slstatus/components/num_files.o deleted file mode 100644 index 0de353a..0000000 Binary files a/dwm/slstatus/components/num_files.o and /dev/null differ diff --git a/dwm/slstatus/components/ram.c b/dwm/slstatus/components/ram.c deleted file mode 100644 index 15c4b74..0000000 --- a/dwm/slstatus/components/ram.c +++ /dev/null @@ -1,212 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__linux__) - #include - - const char * - ram_free(const char *unused) - { - uintmax_t free; - - if (pscanf("/proc/meminfo", - "MemTotal: %ju kB\n" - "MemFree: %ju kB\n" - "MemAvailable: %ju kB\n", - &free, &free, &free) != 3) - return NULL; - - return fmt_human(free * 1024, 1024); - } - - const char * - ram_perc(const char *unused) - { - uintmax_t total, free, buffers, cached; - int percent; - - if (pscanf("/proc/meminfo", - "MemTotal: %ju kB\n" - "MemFree: %ju kB\n" - "MemAvailable: %ju kB\n" - "Buffers: %ju kB\n" - "Cached: %ju kB\n", - &total, &free, &buffers, &buffers, &cached) != 5) - return NULL; - - if (total == 0) - return NULL; - - percent = 100 * ((total - free) - (buffers + cached)) / total; - return bprintf("%d", percent); - } - - const char * - ram_total(const char *unused) - { - uintmax_t total; - - if (pscanf("/proc/meminfo", "MemTotal: %ju kB\n", &total) - != 1) - return NULL; - - return fmt_human(total * 1024, 1024); - } - - const char * - ram_used(const char *unused) - { - uintmax_t total, free, buffers, cached, used; - - if (pscanf("/proc/meminfo", - "MemTotal: %ju kB\n" - "MemFree: %ju kB\n" - "MemAvailable: %ju kB\n" - "Buffers: %ju kB\n" - "Cached: %ju kB\n", - &total, &free, &buffers, &buffers, &cached) != 5) - return NULL; - - used = (total - free - buffers - cached); - return fmt_human(used * 1024, 1024); - } -#elif defined(__OpenBSD__) - #include - #include - #include - #include - - #define LOG1024 10 - #define pagetok(size, pageshift) (size_t)(size << (pageshift - LOG1024)) - - inline int - load_uvmexp(struct uvmexp *uvmexp) - { - int uvmexp_mib[] = {CTL_VM, VM_UVMEXP}; - size_t size; - - size = sizeof(*uvmexp); - - if (sysctl(uvmexp_mib, 2, uvmexp, &size, NULL, 0) >= 0) - return 1; - - return 0; - } - - const char * - ram_free(const char *unused) - { - struct uvmexp uvmexp; - int free_pages; - - if (!load_uvmexp(&uvmexp)) - return NULL; - - free_pages = uvmexp.npages - uvmexp.active; - return fmt_human(pagetok(free_pages, uvmexp.pageshift) * - 1024, 1024); - } - - const char * - ram_perc(const char *unused) - { - struct uvmexp uvmexp; - int percent; - - if (!load_uvmexp(&uvmexp)) - return NULL; - - percent = uvmexp.active * 100 / uvmexp.npages; - return bprintf("%d", percent); - } - - const char * - ram_total(const char *unused) - { - struct uvmexp uvmexp; - - if (!load_uvmexp(&uvmexp)) - return NULL; - - return fmt_human(pagetok(uvmexp.npages, - uvmexp.pageshift) * 1024, 1024); - } - - const char * - ram_used(const char *unused) - { - struct uvmexp uvmexp; - - if (!load_uvmexp(&uvmexp)) - return NULL; - - return fmt_human(pagetok(uvmexp.active, - uvmexp.pageshift) * 1024, 1024); - } -#elif defined(__FreeBSD__) - #include - #include - #include - #include - - const char * - ram_free(const char *unused) { - struct vmtotal vm_stats; - int mib[] = {CTL_VM, VM_TOTAL}; - size_t len; - - len = sizeof(struct vmtotal); - if (sysctl(mib, 2, &vm_stats, &len, NULL, 0) < 0 - || !len) - return NULL; - - return fmt_human(vm_stats.t_free * getpagesize(), 1024); - } - - const char * - ram_total(const char *unused) { - unsigned int npages; - size_t len; - - len = sizeof(npages); - if (sysctlbyname("vm.stats.vm.v_page_count", - &npages, &len, NULL, 0) < 0 || !len) - return NULL; - - return fmt_human(npages * getpagesize(), 1024); - } - - const char * - ram_perc(const char *unused) { - unsigned int npages; - unsigned int active; - size_t len; - - len = sizeof(npages); - if (sysctlbyname("vm.stats.vm.v_page_count", - &npages, &len, NULL, 0) < 0 || !len) - return NULL; - - if (sysctlbyname("vm.stats.vm.v_active_count", - &active, &len, NULL, 0) < 0 || !len) - return NULL; - - return bprintf("%d", active * 100 / npages); - } - - const char * - ram_used(const char *unused) { - unsigned int active; - size_t len; - - len = sizeof(active); - if (sysctlbyname("vm.stats.vm.v_active_count", - &active, &len, NULL, 0) < 0 || !len) - return NULL; - - return fmt_human(active * getpagesize(), 1024); - } -#endif diff --git a/dwm/slstatus/components/ram.o b/dwm/slstatus/components/ram.o deleted file mode 100644 index cab3b22..0000000 Binary files a/dwm/slstatus/components/ram.o and /dev/null differ diff --git a/dwm/slstatus/components/run_command.c b/dwm/slstatus/components/run_command.c deleted file mode 100644 index 93bf6da..0000000 --- a/dwm/slstatus/components/run_command.c +++ /dev/null @@ -1,31 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -run_command(const char *cmd) -{ - char *p; - FILE *fp; - - if (!(fp = popen(cmd, "r"))) { - warn("popen '%s':", cmd); - return NULL; - } - - p = fgets(buf, sizeof(buf) - 1, fp); - if (pclose(fp) < 0) { - warn("pclose '%s':", cmd); - return NULL; - } - if (!p) - return NULL; - - if ((p = strrchr(buf, '\n'))) - p[0] = '\0'; - - return buf[0] ? buf : NULL; -} diff --git a/dwm/slstatus/components/run_command.o b/dwm/slstatus/components/run_command.o deleted file mode 100644 index 608e2d5..0000000 Binary files a/dwm/slstatus/components/run_command.o and /dev/null differ diff --git a/dwm/slstatus/components/swap.c b/dwm/slstatus/components/swap.c deleted file mode 100644 index f270d93..0000000 --- a/dwm/slstatus/components/swap.c +++ /dev/null @@ -1,274 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__linux__) - static int - get_swap_info(long *s_total, long *s_free, long *s_cached) - { - FILE *fp; - struct { - const char *name; - const size_t len; - long *var; - } ent[] = { - { "SwapTotal", sizeof("SwapTotal") - 1, s_total }, - { "SwapFree", sizeof("SwapFree") - 1, s_free }, - { "SwapCached", sizeof("SwapCached") - 1, s_cached }, - }; - size_t line_len = 0, i, left; - char *line = NULL; - - /* get number of fields we want to extract */ - for (i = 0, left = 0; i < LEN(ent); i++) - if (ent[i].var) - left++; - - if (!(fp = fopen("/proc/meminfo", "r"))) { - warn("fopen '/proc/meminfo':"); - return 1; - } - - /* read file line by line and extract field information */ - while (left > 0 && getline(&line, &line_len, fp) >= 0) { - for (i = 0; i < LEN(ent); i++) { - if (ent[i].var && - !strncmp(line, ent[i].name, ent[i].len)) { - sscanf(line + ent[i].len + 1, - "%ld kB\n", ent[i].var); - left--; - break; - } - } - } - free(line); - if (ferror(fp)) { - warn("getline '/proc/meminfo':"); - return 1; - } - - fclose(fp); - return 0; - } - - const char * - swap_free(const char *unused) - { - long free; - - if (get_swap_info(NULL, &free, NULL)) - return NULL; - - return fmt_human(free * 1024, 1024); - } - - const char * - swap_perc(const char *unused) - { - long total, free, cached; - - if (get_swap_info(&total, &free, &cached) || total == 0) - return NULL; - - return bprintf("%d", 100 * (total - free - cached) / total); - } - - const char * - swap_total(const char *unused) - { - long total; - - if (get_swap_info(&total, NULL, NULL)) - return NULL; - - return fmt_human(total * 1024, 1024); - } - - const char * - swap_used(const char *unused) - { - long total, free, cached; - - if (get_swap_info(&total, &free, &cached)) - return NULL; - - return fmt_human((total - free - cached) * 1024, 1024); - } -#elif defined(__OpenBSD__) - #include - #include - #include - #include - - static int - getstats(int *total, int *used) - { - struct swapent *sep, *fsep; - int rnswap, nswap, i; - - if ((nswap = swapctl(SWAP_NSWAP, 0, 0)) < 1) { - warn("swaptctl 'SWAP_NSWAP':"); - return 1; - } - if (!(fsep = sep = calloc(nswap, sizeof(*sep)))) { - warn("calloc 'nswap':"); - return 1; - } - if ((rnswap = swapctl(SWAP_STATS, (void *)sep, nswap)) < 0) { - warn("swapctl 'SWAP_STATA':"); - return 1; - } - if (nswap != rnswap) { - warn("getstats: SWAP_STATS != SWAP_NSWAP"); - return 1; - } - - *total = 0; - *used = 0; - - for (i = 0; i < rnswap; i++) { - *total += sep->se_nblks >> 1; - *used += sep->se_inuse >> 1; - } - - free(fsep); - - return 0; - } - - const char * - swap_free(const char *unused) - { - int total, used; - - if (getstats(&total, &used)) - return NULL; - - return fmt_human((total - used) * 1024, 1024); - } - - const char * - swap_perc(const char *unused) - { - int total, used; - - if (getstats(&total, &used)) - return NULL; - - if (total == 0) - return NULL; - - return bprintf("%d", 100 * used / total); - } - - const char * - swap_total(const char *unused) - { - int total, used; - - if (getstats(&total, &used)) - return NULL; - - return fmt_human(total * 1024, 1024); - } - - const char * - swap_used(const char *unused) - { - int total, used; - - if (getstats(&total, &used)) - return NULL; - - return fmt_human(used * 1024, 1024); - } -#elif defined(__FreeBSD__) - #include - #include - #include - #include - #include - - static int getswapinfo(struct kvm_swap *swap_info, size_t size) - { - kvm_t *kd; - - kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, NULL); - if (kd == NULL) { - warn("kvm_openfiles '/dev/null':"); - return 0; - } - - if (kvm_getswapinfo(kd, swap_info, size, 0 /* Unused flags */) < 0) { - warn("kvm_getswapinfo:"); - kvm_close(kd); - return 0; - } - - kvm_close(kd); - return 1; - } - - const char * - swap_free(const char *unused) - { - struct kvm_swap swap_info[1]; - long used, total; - - if (!getswapinfo(swap_info, 1)) - return NULL; - - total = swap_info[0].ksw_total; - used = swap_info[0].ksw_used; - - return fmt_human((total - used) * getpagesize(), 1024); - } - - const char * - swap_perc(const char *unused) - { - struct kvm_swap swap_info[1]; - long used, total; - - if (!getswapinfo(swap_info, 1)) - return NULL; - - total = swap_info[0].ksw_total; - used = swap_info[0].ksw_used; - - return bprintf("%d", used * 100 / total); - } - - const char * - swap_total(const char *unused) - { - struct kvm_swap swap_info[1]; - long total; - - if (!getswapinfo(swap_info, 1)) - return NULL; - - total = swap_info[0].ksw_total; - - return fmt_human(total * getpagesize(), 1024); - } - - const char * - swap_used(const char *unused) - { - struct kvm_swap swap_info[1]; - long used; - - if (!getswapinfo(swap_info, 1)) - return NULL; - - used = swap_info[0].ksw_used; - - return fmt_human(used * getpagesize(), 1024); - } -#endif diff --git a/dwm/slstatus/components/swap.o b/dwm/slstatus/components/swap.o deleted file mode 100644 index a40a8a4..0000000 Binary files a/dwm/slstatus/components/swap.o and /dev/null differ diff --git a/dwm/slstatus/components/temperature.c b/dwm/slstatus/components/temperature.c deleted file mode 100644 index 7cf1394..0000000 --- a/dwm/slstatus/components/temperature.c +++ /dev/null @@ -1,73 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include - -#include "../slstatus.h" -#include "../util.h" - - -#if defined(__linux__) - #include - - const char * - temp(const char *file) - { - uintmax_t temp; - - if (pscanf(file, "%ju", &temp) != 1) - return NULL; - - return bprintf("%ju", temp / 1000); - } -#elif defined(__OpenBSD__) - #include - #include /* before for struct timeval */ - #include - #include - - const char * - temp(const char *unused) - { - int mib[5]; - size_t size; - struct sensor temp; - - mib[0] = CTL_HW; - mib[1] = HW_SENSORS; - mib[2] = 0; /* cpu0 */ - mib[3] = SENSOR_TEMP; - mib[4] = 0; /* temp0 */ - - size = sizeof(temp); - - if (sysctl(mib, 5, &temp, &size, NULL, 0) < 0) { - warn("sysctl 'SENSOR_TEMP':"); - return NULL; - } - - /* kelvin to celsius */ - return bprintf("%d", (int)((float)(temp.value-273150000) / 1E6)); - } -#elif defined(__FreeBSD__) - #include - #include - #include - - #define ACPI_TEMP "hw.acpi.thermal.%s.temperature" - - const char * - temp(const char *zone) - { - char buf[256]; - int temp; - size_t len; - - len = sizeof(temp); - snprintf(buf, sizeof(buf), ACPI_TEMP, zone); - if (sysctlbyname(buf, &temp, &len, NULL, 0) < 0 - || !len) - return NULL; - - /* kelvin to decimal celcius */ - return bprintf("%d.%d", (temp - 2731) / 10, abs((temp - 2731) % 10)); - } -#endif diff --git a/dwm/slstatus/components/temperature.o b/dwm/slstatus/components/temperature.o deleted file mode 100644 index 43933ff..0000000 Binary files a/dwm/slstatus/components/temperature.o and /dev/null differ diff --git a/dwm/slstatus/components/uptime.c b/dwm/slstatus/components/uptime.c deleted file mode 100644 index 6227f73..0000000 --- a/dwm/slstatus/components/uptime.c +++ /dev/null @@ -1,34 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(CLOCK_BOOTTIME) - #define UPTIME_FLAG CLOCK_BOOTTIME -#elif defined(CLOCK_UPTIME) - #define UPTIME_FLAG CLOCK_UPTIME -#else - #define UPTIME_FLAG CLOCK_MONOTONIC -#endif - -const char * -uptime(const char *unused) -{ - char warn_buf[256]; - uintmax_t h, m; - struct timespec uptime; - - if (clock_gettime(UPTIME_FLAG, &uptime) < 0) { - snprintf(warn_buf, sizeof(warn_buf), "clock_gettime %d", UPTIME_FLAG); - warn(warn_buf); - return NULL; - } - - h = uptime.tv_sec / 3600; - m = uptime.tv_sec % 3600 / 60; - - return bprintf("%juh %jum", h, m); -} diff --git a/dwm/slstatus/components/uptime.o b/dwm/slstatus/components/uptime.o deleted file mode 100644 index e927127..0000000 Binary files a/dwm/slstatus/components/uptime.o and /dev/null differ diff --git a/dwm/slstatus/components/user.c b/dwm/slstatus/components/user.c deleted file mode 100644 index 3517495..0000000 --- a/dwm/slstatus/components/user.c +++ /dev/null @@ -1,33 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -const char * -gid(const char *unused) -{ - return bprintf("%d", getgid()); -} - -const char * -username(const char *unused) -{ - struct passwd *pw; - - if (!(pw = getpwuid(geteuid()))) { - warn("getpwuid '%d':", geteuid()); - return NULL; - } - - return bprintf("%s", pw->pw_name); -} - -const char * -uid(const char *unused) -{ - return bprintf("%d", geteuid()); -} diff --git a/dwm/slstatus/components/user.o b/dwm/slstatus/components/user.o deleted file mode 100644 index c0005b1..0000000 Binary files a/dwm/slstatus/components/user.o and /dev/null differ diff --git a/dwm/slstatus/components/volume.c b/dwm/slstatus/components/volume.c deleted file mode 100644 index 6cec556..0000000 --- a/dwm/slstatus/components/volume.c +++ /dev/null @@ -1,219 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#if defined(__OpenBSD__) | defined(__FreeBSD__) - #include - #include - #include - #include - - struct control { - LIST_ENTRY(control) next; - unsigned int addr; - #define CTRL_NONE 0 - #define CTRL_LEVEL 1 - #define CTRL_MUTE 2 - unsigned int type; - unsigned int maxval; - unsigned int val; - }; - - static LIST_HEAD(, control) controls = LIST_HEAD_INITIALIZER(controls); - static struct pollfd *pfds; - static struct sioctl_hdl *hdl; - static int initialized; - - /* - * Call-back to obtain the description of all audio controls. - */ - static void - ondesc(void *unused, struct sioctl_desc *desc, int val) - { - struct control *c, *ctmp; - unsigned int type = CTRL_NONE; - - if (desc == NULL) - return; - - /* Delete existing audio control with the same address. */ - LIST_FOREACH_SAFE(c, &controls, next, ctmp) { - if (desc->addr == c->addr) { - LIST_REMOVE(c, next); - free(c); - break; - } - } - - /* Only match output.level and output.mute audio controls. */ - if (desc->group[0] != 0 || - strcmp(desc->node0.name, "output") != 0) - return; - if (desc->type == SIOCTL_NUM && - strcmp(desc->func, "level") == 0) - type = CTRL_LEVEL; - else if (desc->type == SIOCTL_SW && - strcmp(desc->func, "mute") == 0) - type = CTRL_MUTE; - else - return; - - c = malloc(sizeof(struct control)); - if (c == NULL) { - warn("sndio: failed to allocate audio control\n"); - return; - } - - c->addr = desc->addr; - c->type = type; - c->maxval = desc->maxval; - c->val = val; - LIST_INSERT_HEAD(&controls, c, next); - } - - /* - * Call-back invoked whenever an audio control changes. - */ - static void - onval(void *unused, unsigned int addr, unsigned int val) - { - struct control *c; - - LIST_FOREACH(c, &controls, next) { - if (c->addr == addr) - break; - } - c->val = val; - } - - static void - cleanup(void) - { - struct control *c; - - if (hdl) { - sioctl_close(hdl); - hdl = NULL; - } - - free(pfds); - pfds = NULL; - - while (!LIST_EMPTY(&controls)) { - c = LIST_FIRST(&controls); - LIST_REMOVE(c, next); - free(c); - } - } - - static int - init(void) - { - hdl = sioctl_open(SIO_DEVANY, SIOCTL_READ, 0); - if (hdl == NULL) { - warn("sndio: cannot open device"); - goto failed; - } - - if (!sioctl_ondesc(hdl, ondesc, NULL)) { - warn("sndio: cannot set control description call-back"); - goto failed; - } - - if (!sioctl_onval(hdl, onval, NULL)) { - warn("sndio: cannot set control values call-back"); - goto failed; - } - - pfds = calloc(sioctl_nfds(hdl), sizeof(struct pollfd)); - if (pfds == NULL) { - warn("sndio: cannot allocate pollfd structures"); - goto failed; - } - - return 1; - failed: - cleanup(); - return 0; - } - - const char * - vol_perc(const char *unused) - { - struct control *c; - int n, v, value; - - if (!initialized) - initialized = init(); - - if (hdl == NULL) - return NULL; - - n = sioctl_pollfd(hdl, pfds, POLLIN); - if (n > 0) { - n = poll(pfds, n, 0); - if (n > 0) { - if (sioctl_revents(hdl, pfds) & POLLHUP) { - warn("sndio: disconnected"); - cleanup(); - initialized = 0; - return NULL; - } - } - } - - value = 100; - LIST_FOREACH(c, &controls, next) { - if (c->type == CTRL_MUTE && c->val == 1) - value = 0; - else if (c->type == CTRL_LEVEL) { - v = (c->val * 100 + c->maxval / 2) / c->maxval; - /* For multiple channels return the minimum. */ - if (v < value) - value = v; - } - } - - return bprintf("%d", value); - } -#else - #include - - const char * - vol_perc(const char *card) - { - size_t i; - int v, afd, devmask; - char *vnames[] = SOUND_DEVICE_NAMES; - - if ((afd = open(card, O_RDONLY | O_NONBLOCK)) < 0) { - warn("open '%s':", card); - return NULL; - } - - if (ioctl(afd, (int)SOUND_MIXER_READ_DEVMASK, &devmask) < 0) { - warn("ioctl 'SOUND_MIXER_READ_DEVMASK':"); - close(afd); - return NULL; - } - for (i = 0; i < LEN(vnames); i++) { - if (devmask & (1 << i) && !strcmp("vol", vnames[i])) { - if (ioctl(afd, MIXER_READ(i), &v) < 0) { - warn("ioctl 'MIXER_READ(%ld)':", i); - close(afd); - return NULL; - } - } - } - - close(afd); - - return bprintf("%d", v & 0xff); - } -#endif diff --git a/dwm/slstatus/components/volume.o b/dwm/slstatus/components/volume.o deleted file mode 100644 index eed8142..0000000 Binary files a/dwm/slstatus/components/volume.o and /dev/null differ diff --git a/dwm/slstatus/components/weather.c b/dwm/slstatus/components/weather.c deleted file mode 100644 index a19662b..0000000 --- a/dwm/slstatus/components/weather.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#define WTTR_TEMP "/tmp/wttr" - -const char *weather() -{ - FILE *wttr = fopen(WTTR_TEMP, "r"); - char temp[10]; - memset(&temp, '\0', 10); - - fgets(temp, 10, wttr); - fclose(wttr); - - temp[strlen(temp)-1] = '\0'; - - return bprintf("%s", temp); -} diff --git a/dwm/slstatus/components/weather.o b/dwm/slstatus/components/weather.o deleted file mode 100644 index 24fd4ff..0000000 Binary files a/dwm/slstatus/components/weather.o and /dev/null differ diff --git a/dwm/slstatus/components/wifi.c b/dwm/slstatus/components/wifi.c deleted file mode 100644 index 4543d32..0000000 --- a/dwm/slstatus/components/wifi.c +++ /dev/null @@ -1,267 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include -#include - -#include "../slstatus.h" -#include "../util.h" - -#define RSSI_TO_PERC(rssi) \ - rssi >= -50 ? 100 : \ - (rssi <= -100 ? 0 : \ - (2 * (rssi + 100))) - -#if defined(__linux__) - #include - #include - - #define NET_OPERSTATE "/sys/class/net/%s/operstate" - - const char * - wifi_perc(const char *interface) - { - int cur; - size_t i; - char *p, *datastart; - char path[PATH_MAX]; - char status[5]; - FILE *fp; - - if (esnprintf(path, sizeof(path), NET_OPERSTATE, interface) < 0) - return NULL; - if (!(fp = fopen(path, "r"))) { - warn("fopen '%s':", path); - return NULL; - } - p = fgets(status, 5, fp); - fclose(fp); - if (!p || strcmp(status, "up\n") != 0) - return NULL; - - if (!(fp = fopen("/proc/net/wireless", "r"))) { - warn("fopen '/proc/net/wireless':"); - return NULL; - } - - for (i = 0; i < 3; i++) - if (!(p = fgets(buf, sizeof(buf) - 1, fp))) - break; - - fclose(fp); - if (i < 2 || !p) - return NULL; - - if (!(datastart = strstr(buf, interface))) - return NULL; - - datastart = (datastart+(strlen(interface)+1)); - sscanf(datastart + 1, " %*d %d %*d %*d\t\t %*d\t " - "%*d\t\t%*d\t\t %*d\t %*d\t\t %*d", &cur); - - /* 70 is the max of /proc/net/wireless */ - return bprintf("%d", (int)((float)cur / 70 * 100)); - } - - const char * - wifi_essid(const char *interface) - { - static char id[IW_ESSID_MAX_SIZE+1]; - int sockfd; - struct iwreq wreq; - - memset(&wreq, 0, sizeof(struct iwreq)); - wreq.u.essid.length = IW_ESSID_MAX_SIZE+1; - if (esnprintf(wreq.ifr_name, sizeof(wreq.ifr_name), "%s", - interface) < 0) - return NULL; - - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - warn("socket 'AF_INET':"); - return NULL; - } - wreq.u.essid.pointer = id; - if (ioctl(sockfd,SIOCGIWESSID, &wreq) < 0) { - warn("ioctl 'SIOCGIWESSID':"); - close(sockfd); - return NULL; - } - - close(sockfd); - - if (!strcmp(id, "")) - return NULL; - - return id; - } -#elif defined(__OpenBSD__) - #include - #include - #include - #include /* before for NBBY */ - #include - #include - #include - - static int - load_ieee80211_nodereq(const char *interface, struct ieee80211_nodereq *nr) - { - struct ieee80211_bssid bssid; - int sockfd; - uint8_t zero_bssid[IEEE80211_ADDR_LEN]; - - memset(&bssid, 0, sizeof(bssid)); - memset(nr, 0, sizeof(struct ieee80211_nodereq)); - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - warn("socket 'AF_INET':"); - return 0; - } - strlcpy(bssid.i_name, interface, sizeof(bssid.i_name)); - if ((ioctl(sockfd, SIOCG80211BSSID, &bssid)) < 0) { - warn("ioctl 'SIOCG80211BSSID':"); - close(sockfd); - return 0; - } - memset(&zero_bssid, 0, sizeof(zero_bssid)); - if (memcmp(bssid.i_bssid, zero_bssid, - IEEE80211_ADDR_LEN) == 0) { - close(sockfd); - return 0; - } - strlcpy(nr->nr_ifname, interface, sizeof(nr->nr_ifname)); - memcpy(&nr->nr_macaddr, bssid.i_bssid, sizeof(nr->nr_macaddr)); - if ((ioctl(sockfd, SIOCG80211NODE, nr)) < 0 && nr->nr_rssi) { - warn("ioctl 'SIOCG80211NODE':"); - close(sockfd); - return 0; - } - - return close(sockfd), 1; - } - - const char * - wifi_perc(const char *interface) - { - struct ieee80211_nodereq nr; - int q; - - if (load_ieee80211_nodereq(interface, &nr)) { - if (nr.nr_max_rssi) - q = IEEE80211_NODEREQ_RSSI(&nr); - else - q = RSSI_TO_PERC(nr.nr_rssi); - - return bprintf("%d", q); - } - - return NULL; - } - - const char * - wifi_essid(const char *interface) - { - struct ieee80211_nodereq nr; - - if (load_ieee80211_nodereq(interface, &nr)) - return bprintf("%s", nr.nr_nwid); - - return NULL; - } -#elif defined(__FreeBSD__) - #include - #include - - int - load_ieee80211req(int sock, const char *interface, void *data, int type, size_t *len) - { - char warn_buf[256]; - struct ieee80211req ireq; - memset(&ireq, 0, sizeof(ireq)); - ireq.i_type = type; - ireq.i_data = (caddr_t) data; - ireq.i_len = *len; - - strlcpy(ireq.i_name, interface, sizeof(ireq.i_name)); - if (ioctl(sock, SIOCG80211, &ireq) < 0) { - snprintf(warn_buf, sizeof(warn_buf), - "ioctl: 'SIOCG80211': %d", type); - warn(warn_buf); - return 0; - } - - *len = ireq.i_len; - return 1; - } - - const char * - wifi_perc(const char *interface) - { - union { - struct ieee80211req_sta_req sta; - uint8_t buf[24 * 1024]; - } info; - uint8_t bssid[IEEE80211_ADDR_LEN]; - int rssi_dbm; - int sockfd; - size_t len; - const char *fmt; - - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - warn("socket 'AF_INET':"); - return NULL; - } - - /* Retreive MAC address of interface */ - len = IEEE80211_ADDR_LEN; - fmt = NULL; - if (load_ieee80211req(sockfd, interface, &bssid, IEEE80211_IOC_BSSID, &len)) - { - /* Retrieve info on station with above BSSID */ - memset(&info, 0, sizeof(info)); - memcpy(info.sta.is_u.macaddr, bssid, sizeof(bssid)); - - len = sizeof(info); - if (load_ieee80211req(sockfd, interface, &info, IEEE80211_IOC_STA_INFO, &len)) { - rssi_dbm = info.sta.info[0].isi_noise + - info.sta.info[0].isi_rssi / 2; - - fmt = bprintf("%d", RSSI_TO_PERC(rssi_dbm)); - } - } - - close(sockfd); - return fmt; - } - - const char * - wifi_essid(const char *interface) - { - char ssid[IEEE80211_NWID_LEN + 1]; - size_t len; - int sockfd; - const char *fmt; - - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - warn("socket 'AF_INET':"); - return NULL; - } - - fmt = NULL; - len = sizeof(ssid); - memset(&ssid, 0, len); - if (load_ieee80211req(sockfd, interface, &ssid, IEEE80211_IOC_SSID, &len)) { - if (len < sizeof(ssid)) - len += 1; - else - len = sizeof(ssid); - - ssid[len - 1] = '\0'; - fmt = bprintf("%s", ssid); - } - - close(sockfd); - return fmt; - } -#endif diff --git a/dwm/slstatus/components/wifi.o b/dwm/slstatus/components/wifi.o deleted file mode 100644 index 2533fbf..0000000 Binary files a/dwm/slstatus/components/wifi.o and /dev/null differ diff --git a/dwm/slstatus/components/wttr.sh b/dwm/slstatus/components/wttr.sh deleted file mode 100755 index c3175be..0000000 --- a/dwm/slstatus/components/wttr.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# This function checks if wttr.in is available before the weather info is fetched -ck_curl() { - curl -sf ru.wttr.in > /dev/null -} - -ck_curl -if [ $? -eq 0 ] # $? means "output of the last command" -then - curl -s v2.wttr.in/tomsk?format="%t\n" > /tmp/wttr - wttr_net=1 -else # Non-zero output would appear both when the site \ - for (( cntr = 0; cntr < 3; cntr++ )) # is down and when you're physically offline - do - echo "Probing. " > /tmp/wttr - sleep 0.5 - echo "Probing.. " > /tmp/wttr - sleep 0.5 - echo "Probing..." > /tmp/wttr - sleep 0.5 # A wee bit of animation - done - ck_curl # Online check is rerun only once, if the first check fails. -fi # In case you're using wifi, and the cron job runs before \ - # it authenticates -if ! [ $wttr_net ] -then echo "Offline fr :'( " > /tmp/wttr -fi \ No newline at end of file diff --git a/dwm/slstatus/config.def.h b/dwm/slstatus/config.def.h deleted file mode 100644 index d805331..0000000 --- a/dwm/slstatus/config.def.h +++ /dev/null @@ -1,69 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* interval between updates (in ms) */ -const unsigned int interval = 1000; - -/* text to show if no value can be retrieved */ -static const char unknown_str[] = "n/a"; - -/* maximum output string length */ -#define MAXLEN 2048 - -/* - * function description argument (example) - * - * battery_perc battery percentage battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * battery_remaining battery remaining HH:MM battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * battery_state battery charging state battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * cat read arbitrary file path - * cpu_freq cpu frequency in MHz NULL - * cpu_perc cpu usage in percent NULL - * datetime date and time format string (%F %T) - * disk_free free disk space in GB mountpoint path (/) - * disk_perc disk usage in percent mountpoint path (/) - * disk_total total disk space in GB mountpoint path (/) - * disk_used used disk space in GB mountpoint path (/) - * entropy available entropy NULL - * gid GID of current user NULL - * hostname hostname NULL - * ipv4 IPv4 address interface name (eth0) - * ipv6 IPv6 address interface name (eth0) - * kernel_release `uname -r` NULL - * keyboard_indicators caps/num lock indicators format string (c?n?) - * see keyboard_indicators.c - * keymap layout (variant) of current NULL - * keymap - * load_avg load average NULL - * netspeed_rx receive network speed interface name (wlan0) - * netspeed_tx transfer network speed interface name (wlan0) - * num_files number of files in a directory path - * (/home/foo/Inbox/cur) - * ram_free free memory in GB NULL - * ram_perc memory usage in percent NULL - * ram_total total memory size in GB NULL - * ram_used used memory in GB NULL - * run_command custom shell command command (echo foo) - * swap_free free swap in GB NULL - * swap_perc swap usage in percent NULL - * swap_total total swap size in GB NULL - * swap_used used swap in GB NULL - * temp temperature in degree celsius sensor file - * (/sys/class/thermal/...) - * NULL on OpenBSD - * thermal zone on FreeBSD - * (tz0, tz1, etc.) - * uid UID of current user NULL - * uptime system uptime NULL - * username username of current user NULL - * vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer) - * NULL on OpenBSD/FreeBSD - * wifi_essid WiFi ESSID interface name (wlan0) - * wifi_perc WiFi signal in percent interface name (wlan0) - */ -static const struct arg args[] = { - /* function format argument */ - { datetime, "%s", "%F %T" }, -}; diff --git a/dwm/slstatus/config.h b/dwm/slstatus/config.h deleted file mode 100644 index 0a94baf..0000000 --- a/dwm/slstatus/config.h +++ /dev/null @@ -1,79 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* interval between updates (in ms) */ -const unsigned int interval = 500; - -/* text to show if no value can be retrieved */ -static const char unknown_str[] = "n/a"; - -/* maximum output string length */ -#define MAXLEN 2048 - -/* - * function description argument (example) - * - * battery_perc battery percentage battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * battery_remaining battery remaining HH:MM battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * battery_state battery charging state battery name (BAT0) - * NULL on OpenBSD/FreeBSD - * cat read arbitrary file path - * cpu_freq cpu frequency in MHz NULL - * cpu_perc cpu usage in percent NULL - * datetime date and time format string (%F %T) - * disk_free free disk space in GB mountpoint path (/) - * disk_perc disk usage in percent mountpoint path (/) - * disk_total total disk space in GB mountpoint path (/) - * disk_used used disk space in GB mountpoint path (/) - * entropy available entropy NULL - * gid GID of current user NULL - * hostname hostname NULL - * ipv4 IPv4 address interface name (eth0) - * ipv6 IPv6 address interface name (eth0) - * kernel_release `uname -r` NULL - * keyboard_indicators caps/num lock indicators format string (c?n?) - * see keyboard_indicators.c - * keymap layout (variant) of current NULL - * keymap - * load_avg load average NULL - * netspeed_rx receive network speed interface name (wlan0) - * netspeed_tx transfer network speed interface name (wlan0) - * num_files number of files in a directory path - * (/home/foo/Inbox/cur) - * ram_free free memory in GB NULL - * ram_perc memory usage in percent NULL - * ram_total total memory size in GB NULL - * ram_used used memory in GB NULL - * run_command custom shell command command (echo foo) - * swap_free free swap in GB NULL - * swap_perc swap usage in percent NULL - * swap_total total swap size in GB NULL - * swap_used used swap in GB NULL - * temp temperature in degree celsius sensor file - * (/sys/class/thermal/...) - * NULL on OpenBSD - * thermal zone on FreeBSD - * (tz0, tz1, etc.) - * uid UID of current user NULL - * uptime system uptime NULL - * username username of current user NULL - * vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer) - * NULL on OpenBSD/FreeBSD - * wifi_essid WiFi ESSID interface name (wlan0) - * wifi_perc WiFi signal in percent interface name (wlan0) - */ -static const struct arg args[] = { - /* function format argument */ - // { battery_perc, "|  %s ", "BAT0" }, - { weather, "| %s | ", NULL }, - { datetime, "%s | ", "%F %T" }, - { cpu_perc, " %s% | ", NULL }, - { ram_used, "󰘚 %s/", NULL }, - { ram_total, "%s | ", NULL }, - { disk_used, " %s/", "/" }, - { disk_total, "%s | ", "/" }, - { keymap, "%s | ", NULL }, - // { wifi_essid, " %s/", "wlan0" }, - // { wifi_perc, "%s | ", "wlan0" }, -}; diff --git a/dwm/slstatus/config.mk b/dwm/slstatus/config.mk deleted file mode 100644 index 07af883..0000000 --- a/dwm/slstatus/config.mk +++ /dev/null @@ -1,22 +0,0 @@ -# slstatus version -VERSION = 1.0 - -# customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# flags -CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" -CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Os -LDFLAGS = -L$(X11LIB) -s -# OpenBSD: add -lsndio -# FreeBSD: add -lkvm -lsndio -LDLIBS = -lX11 - -# compiler and linker -CC = cc diff --git a/dwm/slstatus/slstatus b/dwm/slstatus/slstatus deleted file mode 100755 index 1fcc60e..0000000 Binary files a/dwm/slstatus/slstatus and /dev/null differ diff --git a/dwm/slstatus/slstatus.1 b/dwm/slstatus/slstatus.1 deleted file mode 100644 index 73e7a60..0000000 --- a/dwm/slstatus/slstatus.1 +++ /dev/null @@ -1,47 +0,0 @@ -.Dd 2023-04-23 -.Dt SLSTATUS 1 -.Os -.Sh NAME -.Nm slstatus -.Nd suckless status -.Sh SYNOPSIS -.Nm -.Op Fl s -.Op Fl 1 -.Sh DESCRIPTION -.Nm -is a small tool for providing system status information to other programs -over the EWMH -.Em WM_NAME -property of the root window (used by -.Xr dwm 1 ) or standard input/output. It is designed to be as efficient as possible by -only issuing the minimum of system calls required. -.P -By default, -.Nm -outputs to WM_NAME. -.Sh OPTIONS -.Bl -tag -width Ds -.It Fl v -Print version information to stderr, then exit. -.It Fl s -Write to stdout instead of WM_NAME. -.It Fl 1 -Write once to stdout and quit. -.El -.Sh CUSTOMIZATION -.Nm -can be customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.Sh SIGNALS -.Nm -responds to the following signals: -.Pp -.Bl -tag -width TERM -compact -.It USR1 -Triggers an instant redraw. -.El -.Sh AUTHORS -See the LICENSE file for the authors. -.Sh SEE ALSO -.Xr dwm 1 diff --git a/dwm/slstatus/slstatus.c b/dwm/slstatus/slstatus.c deleted file mode 100644 index fd31313..0000000 --- a/dwm/slstatus/slstatus.c +++ /dev/null @@ -1,134 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include -#include -#include - -#include "arg.h" -#include "slstatus.h" -#include "util.h" - -struct arg { - const char *(*func)(const char *); - const char *fmt; - const char *args; -}; - -char buf[1024]; -static volatile sig_atomic_t done; -static Display *dpy; - -#include "config.h" - -static void -terminate(const int signo) -{ - if (signo != SIGUSR1) - done = 1; -} - -static void -difftimespec(struct timespec *res, struct timespec *a, struct timespec *b) -{ - res->tv_sec = a->tv_sec - b->tv_sec - (a->tv_nsec < b->tv_nsec); - res->tv_nsec = a->tv_nsec - b->tv_nsec + - (a->tv_nsec < b->tv_nsec) * 1E9; -} - -static void -usage(void) -{ - die("usage: %s [-v] [-s] [-1]", argv0); -} - -int -main(int argc, char *argv[]) -{ - struct sigaction act; - struct timespec start, current, diff, intspec, wait; - size_t i, len; - int sflag, ret; - char status[MAXLEN]; - const char *res; - - sflag = 0; - ARGBEGIN { - case 'v': - die("slstatus-"VERSION); - case '1': - done = 1; - /* FALLTHROUGH */ - case 's': - sflag = 1; - break; - default: - usage(); - } ARGEND - - if (argc) - usage(); - - memset(&act, 0, sizeof(act)); - act.sa_handler = terminate; - sigaction(SIGINT, &act, NULL); - sigaction(SIGTERM, &act, NULL); - act.sa_flags |= SA_RESTART; - sigaction(SIGUSR1, &act, NULL); - - if (!sflag && !(dpy = XOpenDisplay(NULL))) - die("XOpenDisplay: Failed to open display"); - - do { - if (clock_gettime(CLOCK_MONOTONIC, &start) < 0) - die("clock_gettime:"); - - status[0] = '\0'; - for (i = len = 0; i < LEN(args); i++) { - if (!(res = args[i].func(args[i].args))) - res = unknown_str; - - if ((ret = esnprintf(status + len, sizeof(status) - len, - args[i].fmt, res)) < 0) - break; - - len += ret; - } - - if (sflag) { - puts(status); - fflush(stdout); - if (ferror(stdout)) - die("puts:"); - } else { - if (XStoreName(dpy, DefaultRootWindow(dpy), status) < 0) - die("XStoreName: Allocation failed"); - XFlush(dpy); - } - - if (!done) { - if (clock_gettime(CLOCK_MONOTONIC, ¤t) < 0) - die("clock_gettime:"); - difftimespec(&diff, ¤t, &start); - - intspec.tv_sec = interval / 1000; - intspec.tv_nsec = (interval % 1000) * 1E6; - difftimespec(&wait, &intspec, &diff); - - if (wait.tv_sec >= 0 && - nanosleep(&wait, NULL) < 0 && - errno != EINTR) - die("nanosleep:"); - } - } while (!done); - - if (!sflag) { - XStoreName(dpy, DefaultRootWindow(dpy), NULL); - if (XCloseDisplay(dpy) < 0) - die("XCloseDisplay: Failed to close display"); - } - - return 0; -} diff --git a/dwm/slstatus/slstatus.h b/dwm/slstatus/slstatus.h deleted file mode 100644 index 5dbc979..0000000 --- a/dwm/slstatus/slstatus.h +++ /dev/null @@ -1,86 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* battery */ -const char *battery_perc(const char *); -const char *battery_remaining(const char *); -const char *battery_state(const char *); - -/* cat */ -const char *cat(const char *path); - -/* cpu */ -const char *cpu_freq(const char *unused); -const char *cpu_perc(const char *unused); - -/* datetime */ -const char *datetime(const char *fmt); - -/* disk */ -const char *disk_free(const char *path); -const char *disk_perc(const char *path); -const char *disk_total(const char *path); -const char *disk_used(const char *path); - -/* entropy */ -const char *entropy(const char *unused); - -/* hostname */ -const char *hostname(const char *unused); - -/* ip */ -const char *ipv4(const char *interface); -const char *ipv6(const char *interface); - -/* kernel_release */ -const char *kernel_release(const char *unused); - -/* keyboard_indicators */ -const char *keyboard_indicators(const char *fmt); - -/* keymap */ -const char *keymap(const char *unused); - -/* load_avg */ -const char *load_avg(const char *unused); - -/* netspeeds */ -const char *netspeed_rx(const char *interface); -const char *netspeed_tx(const char *interface); - -/* num_files */ -const char *num_files(const char *path); - -/* ram */ -const char *ram_free(const char *unused); -const char *ram_perc(const char *unused); -const char *ram_total(const char *unused); -const char *ram_used(const char *unused); - -/* run_command */ -const char *run_command(const char *cmd); - -/* swap */ -const char *swap_free(const char *unused); -const char *swap_perc(const char *unused); -const char *swap_total(const char *unused); -const char *swap_used(const char *unused); - -/* temperature */ -const char *temp(const char *); - -/* uptime */ -const char *uptime(const char *unused); - -/* user */ -const char *gid(const char *unused); -const char *uid(const char *unused); -const char *username(const char *unused); - -/* volume */ -const char *vol_perc(const char *card); - -/* wifi */ -const char *wifi_essid(const char *interface); -const char *wifi_perc(const char *interface); - -const char *weather(); diff --git a/dwm/slstatus/slstatus.o b/dwm/slstatus/slstatus.o deleted file mode 100644 index 32a9f42..0000000 Binary files a/dwm/slstatus/slstatus.o and /dev/null differ diff --git a/dwm/slstatus/util.c b/dwm/slstatus/util.c deleted file mode 100644 index bca9b2e..0000000 --- a/dwm/slstatus/util.c +++ /dev/null @@ -1,141 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include -#include - -#include "util.h" - -char *argv0; - -static void -verr(const char *fmt, va_list ap) -{ - vfprintf(stderr, fmt, ap); - - if (fmt[0] && fmt[strlen(fmt) - 1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } -} - -void -warn(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - verr(fmt, ap); - va_end(ap); -} - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - verr(fmt, ap); - va_end(ap); - - exit(1); -} - -static int -evsnprintf(char *str, size_t size, const char *fmt, va_list ap) -{ - int ret; - - ret = vsnprintf(str, size, fmt, ap); - - if (ret < 0) { - warn("vsnprintf:"); - return -1; - } else if ((size_t)ret >= size) { - warn("vsnprintf: Output truncated"); - return -1; - } - - return ret; -} - -int -esnprintf(char *str, size_t size, const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = evsnprintf(str, size, fmt, ap); - va_end(ap); - - return ret; -} - -const char * -bprintf(const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = evsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - - return (ret < 0) ? NULL : buf; -} - -const char * -fmt_human(uintmax_t num, int base) -{ - double scaled; - size_t i, prefixlen; - const char **prefix; - const char *prefix_1000[] = { "", "k", "M", "G", "T", "P", "E", "Z", - "Y" }; - const char *prefix_1024[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", - "Zi", "Yi" }; - - switch (base) { - case 1000: - prefix = prefix_1000; - prefixlen = LEN(prefix_1000); - break; - case 1024: - prefix = prefix_1024; - prefixlen = LEN(prefix_1024); - break; - default: - warn("fmt_human: Invalid base"); - return NULL; - } - - scaled = num; - for (i = 0; i < prefixlen && scaled >= base; i++) - scaled /= base; - - return bprintf("%.1f %s", scaled, prefix[i]); -} - -int -pscanf(const char *path, const char *fmt, ...) -{ - FILE *fp; - va_list ap; - int n; - - if (!(fp = fopen(path, "r"))) { - warn("fopen '%s':", path); - return -1; - } - va_start(ap, fmt); - n = vfscanf(fp, fmt, ap); - va_end(ap); - fclose(fp); - - return (n == EOF) ? -1 : n; -} diff --git a/dwm/slstatus/util.h b/dwm/slstatus/util.h deleted file mode 100644 index cf4b027..0000000 --- a/dwm/slstatus/util.h +++ /dev/null @@ -1,16 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include - -extern char buf[1024]; - -#define LEN(x) (sizeof(x) / sizeof((x)[0])) - -extern char *argv0; - -void warn(const char *, ...); -void die(const char *, ...); - -int esnprintf(char *str, size_t size, const char *fmt, ...); -const char *bprintf(const char *fmt, ...); -const char *fmt_human(uintmax_t num, int base); -int pscanf(const char *path, const char *fmt, ...); diff --git a/dwm/slstatus/util.o b/dwm/slstatus/util.o deleted file mode 100644 index 8255b32..0000000 Binary files a/dwm/slstatus/util.o and /dev/null differ diff --git a/dwm/st/FAQ b/dwm/st/FAQ deleted file mode 100644 index 6287a27..0000000 --- a/dwm/st/FAQ +++ /dev/null @@ -1,253 +0,0 @@ -## Why does st not handle utmp entries? - -Use the excellent tool of [utmp](https://git.suckless.org/utmp/) for this task. - - -## Some _random program_ complains that st is unknown/not recognised/unsupported/whatever! - -It means that st doesn’t have any terminfo entry on your system. Chances are -you did not `make install`. If you just want to test it without installing it, -you can manually run `tic -sx st.info`. - - -## Nothing works, and nothing is said about an unknown terminal! - -* Some programs just assume they’re running in xterm i.e. they don’t rely on - terminfo. What you see is the current state of the “xterm compliance”. -* Some programs don’t complain about the lacking st description and default to - another terminal. In that case see the question about terminfo. - - -## How do I scroll back up? - -* Using a terminal multiplexer. - * `st -e tmux` using C-b [ - * `st -e screen` using C-a ESC -* Using the excellent tool of [scroll](https://git.suckless.org/scroll/). -* Using the scrollback [patch](https://st.suckless.org/patches/scrollback/). - - -## I would like to have utmp and/or scroll functionality by default - -You can add the absolute path of both programs in your config.h file. You only -have to modify the value of utmp and scroll variables. - - -## Why doesn't the Del key work in some programs? - -Taken from the terminfo manpage: - - If the terminal has a keypad that transmits codes when the keys - are pressed, this information can be given. Note that it is not - possible to handle terminals where the keypad only works in - local (this applies, for example, to the unshifted HP 2621 keys). - If the keypad can be set to transmit or not transmit, give these - codes as smkx and rmkx. Otherwise the keypad is assumed to - always transmit. - -In the st case smkx=E[?1hE= and rmkx=E[?1lE>, so it is mandatory that -applications which want to test against keypad keys send these -sequences. - -But buggy applications (like bash and irssi, for example) don't do this. A fast -solution for them is to use the following command: - - $ printf '\033[?1h\033=' >/dev/tty - -or - $ tput smkx - -In the case of bash, readline is used. Readline has a different note in its -manpage about this issue: - - enable-keypad (Off) - When set to On, readline will try to enable the - application keypad when it is called. Some systems - need this to enable arrow keys. - -Adding this option to your .inputrc will fix the keypad problem for all -applications using readline. - -If you are using zsh, then read the zsh FAQ -: - - It should be noted that the O / [ confusion can occur with other keys - such as Home and End. Some systems let you query the key sequences - sent by these keys from the system's terminal database, terminfo. - Unfortunately, the key sequences given there typically apply to the - mode that is not the one zsh uses by default (it's the "application" - mode rather than the "raw" mode). Explaining the use of terminfo is - outside of the scope of this FAQ, but if you wish to use the key - sequences given there you can tell the line editor to turn on - "application" mode when it starts and turn it off when it stops: - - function zle-line-init () { echoti smkx } - function zle-line-finish () { echoti rmkx } - zle -N zle-line-init - zle -N zle-line-finish - -Putting these lines into your .zshrc will fix the problems. - - -## How can I use meta in 8bit mode? - -St supports meta in 8bit mode, but the default terminfo entry doesn't -use this capability. If you want it, you have to use the 'st-meta' value -in TERM. - - -## I cannot compile st in OpenBSD - -OpenBSD lacks librt, despite it being mandatory in POSIX -. -If you want to compile st for OpenBSD you have to remove -lrt from config.mk, and -st will compile without any loss of functionality, because all the functions are -included in libc on this platform. - - -## The Backspace Case - -St is emulating the Linux way of handling backspace being delete and delete being -backspace. - -This is an issue that was discussed in suckless mailing list -. Here is why some old grumpy -terminal users wants its backspace to be how he feels it: - - Well, I am going to comment why I want to change the behaviour - of this key. When ASCII was defined in 1968, communication - with computers was done using punched cards, or hardcopy - terminals (basically a typewriter machine connected with the - computer using a serial port). ASCII defines DELETE as 7F, - because, in punched-card terms, it means all the holes of the - card punched; it is thus a kind of 'physical delete'. In the - same way, the BACKSPACE key was a non-destructive backspace, - as on a typewriter. So, if you wanted to delete a character, - you had to BACKSPACE and then DELETE. Another use of BACKSPACE - was to type accented characters, for example 'a BACKSPACE `'. - The VT100 had no BACKSPACE key; it was generated using the - CONTROL key as another control character (CONTROL key sets to - 0 b7 b6 b5, so it converts H (code 0x48) into BACKSPACE (code - 0x08)), but it had a DELETE key in a similar position where - the BACKSPACE key is located today on common PC keyboards. - All the terminal emulators emulated the difference between - these keys correctly: the backspace key generated a BACKSPACE - (^H) and delete key generated a DELETE (^?). - - But a problem arose when Linus Torvalds wrote Linux. Unlike - earlier terminals, the Linux virtual terminal (the terminal - emulator integrated in the kernel) returned a DELETE when - backspace was pressed, due to the VT100 having a DELETE key in - the same position. This created a lot of problems (see [1] - and [2]). Since Linux has become the king, a lot of terminal - emulators today generate a DELETE when the backspace key is - pressed in order to avoid problems with Linux. The result is - that the only way of generating a BACKSPACE on these systems - is by using CONTROL + H. (I also think that emacs had an - important point here because the CONTROL + H prefix is used - in emacs in some commands (help commands).) - - From point of view of the kernel, you can change the key - for deleting a previous character with stty erase. When you - connect a real terminal into a machine you describe the type - of terminal, so getty configures the correct value of stty - erase for this terminal. In the case of terminal emulators, - however, you don't have any getty that can set the correct - value of stty erase, so you always get the default value. - For this reason, it is necessary to add 'stty erase ^H' to your - profile if you have changed the value of the backspace key. - Of course, another solution is for st itself to modify the - value of stty erase. I usually have the inverse problem: - when I connect to non-Unix machines, I have to press CONTROL + - h to get a BACKSPACE. The inverse problem occurs when a user - connects to my Unix machines from a different system with a - correct backspace key. - - [1] http://www.ibb.net/~anne/keyboard.html - [2] http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html - - -## But I really want the old grumpy behaviour of my terminal - -Apply [1]. - -[1] https://st.suckless.org/patches/delkey - - -## Why do images not work in st using the w3m image hack? - -w3mimg uses a hack that draws an image on top of the terminal emulator Drawable -window. The hack relies on the terminal to use a single buffer to draw its -contents directly. - -st uses double-buffered drawing so the image is quickly replaced and may show a -short flicker effect. - -Below is a patch example to change st double-buffering to a single Drawable -buffer. - -diff --git a/x.c b/x.c ---- a/x.c -+++ b/x.c -@@ -732,10 +732,6 @@ xresize(int col, int row) - win.tw = col * win.cw; - win.th = row * win.ch; - -- XFreePixmap(xw.dpy, xw.buf); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -- XftDrawChange(xw.draw, xw.buf); - xclear(0, 0, win.w, win.h); - - /* resize to new width */ -@@ -1148,8 +1144,7 @@ xinit(int cols, int rows) - gcvalues.graphics_exposures = False; - dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, - &gcvalues); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -+ xw.buf = xw.win; - XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); - -@@ -1632,8 +1627,6 @@ xdrawline(Line line, int x1, int y1, int x2) - void - xfinishdraw(void) - { -- XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, -- win.h, 0, 0); - XSetForeground(xw.dpy, dc.gc, - dc.col[IS_SET(MODE_REVERSE)? - defaultfg : defaultbg].pixel); - - -## BadLength X error in Xft when trying to render emoji - -Xft makes st crash when rendering color emojis with the following error: - -"X Error of failed request: BadLength (poly request too large or internal Xlib length error)" - Major opcode of failed request: 139 (RENDER) - Minor opcode of failed request: 20 (RenderAddGlyphs) - Serial number of failed request: 1595 - Current serial number in output stream: 1818" - -This is a known bug in Xft (not st) which happens on some platforms and -combination of particular fonts and fontconfig settings. - -See also: -https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6 -https://bugs.freedesktop.org/show_bug.cgi?id=107534 -https://bugzilla.redhat.com/show_bug.cgi?id=1498269 - -The solution is to remove color emoji fonts or disable this in the fontconfig -XML configuration. As an ugly workaround (which may work only on newer -fontconfig versions (FC_COLOR)), the following code can be used to mask color -fonts: - - FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); - -Please don't bother reporting this bug to st, but notify the upstream Xft -developers about fixing this bug. - -As of 2022-09-05 this now seems to be finally fixed in libXft 2.3.5: -https://gitlab.freedesktop.org/xorg/lib/libxft/-/blob/libXft-2.3.5/NEWS diff --git a/dwm/st/LEGACY b/dwm/st/LEGACY deleted file mode 100644 index bf28b1e..0000000 --- a/dwm/st/LEGACY +++ /dev/null @@ -1,17 +0,0 @@ -A STATEMENT ON LEGACY SUPPORT - -In the terminal world there is much cruft that comes from old and unsup‐ -ported terminals that inherit incompatible modes and escape sequences -which noone is able to know, except when he/she comes from that time and -developed a graphical vt100 emulator at that time. - -One goal of st is to only support what is really needed. When you en‐ -counter a sequence which you really need, implement it. But while you -are at it, do not add the other cruft you might encounter while sneek‐ -ing at other terminal emulators. History has bloated them and there is -no real evidence that most of the sequences are used today. - - -Christoph Lohmann <20h@r-36.net> -2012-09-13T07:00:36.081271045+02:00 - diff --git a/dwm/st/LICENSE b/dwm/st/LICENSE deleted file mode 100644 index 3cbf420..0000000 --- a/dwm/st/LICENSE +++ /dev/null @@ -1,34 +0,0 @@ -MIT/X Consortium License - -© 2014-2022 Hiltjo Posthuma -© 2018 Devin J. Pohly -© 2014-2017 Quentin Rameau -© 2009-2012 Aurélien APTEL -© 2008-2017 Anselm R Garbe -© 2012-2017 Roberto E. Vargas Caballero -© 2012-2016 Christoph Lohmann <20h at r-36 dot net> -© 2013 Eon S. Jeon -© 2013 Alexander Sedov -© 2013 Mark Edgar -© 2013-2014 Eric Pruitt -© 2013 Michael Forney -© 2013-2014 Markus Teich -© 2014-2015 Laslo Hunhold - -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 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. diff --git a/dwm/st/Makefile b/dwm/st/Makefile deleted file mode 100644 index 4d49649..0000000 --- a/dwm/st/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# st - simple terminal -# See LICENSE file for copyright and license details. -.POSIX: - -include config.mk - -SRC = st.c x.c -OBJ = $(SRC:.c=.o) - -all: options st - -options: - @echo st build options: - @echo "CFLAGS = $(STCFLAGS)" - @echo "LDFLAGS = $(STLDFLAGS)" - @echo "CC = $(CC)" - -config.h: - cp config.def.h config.h - -.c.o: - $(CC) $(STCFLAGS) -c $< - -st.o: config.h st.h win.h -x.o: arg.h config.h st.h win.h - -$(OBJ): config.h config.mk - -st: $(OBJ) - $(CC) -o $@ $(OBJ) $(STLDFLAGS) - -clean: - rm -f st $(OBJ) st-$(VERSION).tar.gz config.h - -dist: clean - mkdir -p st-$(VERSION) - cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\ - config.def.h st.info st.1 arg.h st.h win.h $(SRC)\ - st-$(VERSION) - tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz - rm -rf st-$(VERSION) - -install: st - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f st $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/st - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1 - chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1 - tic -sx st.info - @echo Please see the README file regarding the terminfo entry of st. - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/st - rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1 - -.PHONY: all options clean dist install uninstall diff --git a/dwm/st/README.md b/dwm/st/README.md deleted file mode 100644 index 15e4ec1..0000000 --- a/dwm/st/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# st - simple terminal - -st is a simple terminal emulator for X which sucks less. - -## Notes about this fork - -This is a fork of st, the original repo can be found here: [https://git.suckless.org/st/](https://git.suckless.org/st/) - -The original st webpage is here: [https://st.suckless.org/](https://st.suckless.org/) - -### Available patches - -* [Alpha](https://st.suckless.org/patches/alpha/) : This patch allows users to change the opacity of the background. Note that you need an X composite manager (e.g. compton, xcompmgr) to make this patch effective. -* [Clipboard](https://st.suckless.org/patches/clipboard/) : This trivial patch sets CLIPBOARD on selection. -* [font2](https://st.suckless.org/patches/font2/) : This patch allows to add spare font besides default. -* [Wide glyph](https://st.suckless.org/patches/glyph_wide_support/) : This patch allows to display the full glyph instead of it being cut off. See also [here](https://github.com/LukeSmithxyz/st/pull/349) - -#### Colorscheme patch -The colorscheme patch is a custom patch, it is not the ones from [colorscheme](https://st.suckless.org/patches/colorschemes/) -It is `solarized.dark` exported from https://terminal.sexy with a different bg and fg color. -Also the `defaultfg`, `defaultbg` and `defaultcs` are not `static`s, otherwise it won't compile. - -### Previous available patches - -* [Fix Keyboard Input](https://st.suckless.org/patches/fix_keyboard_input/) : Add a few previously undefined keys. -Removed as this was used for additional keys for zooming. - -### Applying/Removing Patches -Applying patches from this repository use: - -- applied all at once without committing: -``` -git apply patches/* -``` - -- applied as individual commits -``` -git am patches/* -``` - -Applying patches from https://st.suckless.org/patches/ use: -``` -# Add custom patch -patch -Np1 -i patches/custom.diff -or -patch < patch.diff - -# Remove st-alpha-201806-16-0.81 patch -patch -R patches/st-alpha-20180616-0.8.1.diff -``` - -## Requirements - -In order to build st you need the Xlib header files. - -## Installation - -Edit config.mk to match your local setup (st is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install st (if -necessary as root): - -```bash -make clean install -``` - -## Running st - -Start `st` from a launcher like dmenu or rofi. - -If you did not install st with make clean install, you must compile -the st terminfo entry with the following command: - -```bash -tic -sx st.info -``` - -See the man page for additional details. - -### Keyboard Shortcuts -Action | Key Combination ---- | --- -Copy | `ctrl` + `shift` + `c` -Paste | `ctrl` + `shift` + `v` -Zoom In | `ctrl` + `shift` + `PageUp` -Zoom Out | `ctrl` + `shift` + `PageDown` -Reset Zoom | `ctrl` + `shift` + `Home` - -## Credits - -* Forked from [https://st.suckless.org/](https://st.suckless.org/) -* Based on Aurélien APTEL aurelien.aptel@gmail.com bt source code. diff --git a/dwm/st/TODO b/dwm/st/TODO deleted file mode 100644 index 5f74cd5..0000000 --- a/dwm/st/TODO +++ /dev/null @@ -1,28 +0,0 @@ -vt emulation ------------- - -* double-height support - -code & interface ----------------- - -* add a simple way to do multiplexing - -drawing -------- -* add diacritics support to xdraws() - * switch to a suckless font drawing library -* make the font cache simpler -* add better support for brightening of the upper colors - -bugs ----- - -* fix shift up/down (shift selection in emacs) -* remove DEC test sequence when appropriate - -misc ----- - - $ grep -nE 'XXX|TODO' st.c - diff --git a/dwm/st/arg.h b/dwm/st/arg.h deleted file mode 100644 index a22e019..0000000 --- a/dwm/st/arg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef ARG_H__ -#define ARG_H__ - -extern char *argv0; - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][0] == '-'\ - && argv[0][1];\ - argc--, argv++) {\ - char argc_;\ - char **argv_;\ - int brk_;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - int i_;\ - for (i_ = 1, brk_ = 0, argv_ = argv;\ - argv[0][i_] && !brk_;\ - i_++) {\ - if (argv_ != argv)\ - break;\ - argc_ = argv[0][i_];\ - switch (argc_) - -#define ARGEND }\ - } - -#define ARGC() argc_ - -#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk_ = 1, (argv[0][i_+1] != '\0')?\ - (&argv[0][i_+1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk_ = 1, (argv[0][i_+1] != '\0')?\ - (&argv[0][i_+1]) :\ - (argc--, argv++, argv[0]))) - -#endif diff --git a/dwm/st/config.def.h b/dwm/st/config.def.h deleted file mode 100644 index 671ed01..0000000 --- a/dwm/st/config.def.h +++ /dev/null @@ -1,484 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* - * appearance - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ -static char *font = "JetbrainsMono Nerd Font Mono:pixelsize=18:antialias=true:autohint=true"; -/* Spare fonts */ -static char *font2[] = { - "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true", - "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true", -}; - -static int borderpx = 2; - -/* - * What program is execed by st depends of these precedence rules: - * 1: program passed with -e - * 2: scroll and/or utmp - * 3: SHELL environment variable - * 4: value of shell in /etc/passwd - * 5: value of shell in config.h - */ -static char *shell = "/bin/sh"; -char *utmp = NULL; -/* scroll program: to enable use a string like "scroll" */ -char *scroll = NULL; -char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; - -/* identification sequence returned in DA and DECID */ -char *vtiden = "\033[?6c"; - -/* Kerning / character bounding-box multipliers */ -static float cwscale = 1.0; -static float chscale = 1.0; - -/* - * word delimiter string - * - * More advanced example: L" `'\"()[]{}" - */ -wchar_t *worddelimiters = L" "; - -/* selection timeouts (in milliseconds) */ -static unsigned int doubleclicktimeout = 300; -static unsigned int tripleclicktimeout = 600; - -/* alt screens */ -int allowaltscreen = 1; - -/* allow certain non-interactive (insecure) window operations such as: - setting the clipboard text */ -int allowwindowops = 0; - -/* - * draw latency range in ms - from new content/keypress/etc until drawing. - * within this range, st draws when content stops arriving (idle). mostly it's - * near minlatency, but it waits longer for slow updates to avoid partial draw. - * low minlatency will tear/flicker more, as it can "detect" idle too early. - */ -static double minlatency = 8; -static double maxlatency = 33; - -/* - * blinking timeout (set to 0 to disable blinking) for the terminal blinking - * attribute. - */ -static unsigned int blinktimeout = 800; - -/* - * thickness of underline and bar cursors - */ -static unsigned int cursorthickness = 2; - -/* - * bell volume. It must be a value between -100 and 100. Use 0 for disabling - * it - */ -static int bellvolume = 0; - -/* default TERM value */ -char *termname = "st-256color"; - -/* - * spaces per tab - * - * When you are changing this value, don't forget to adapt the »it« value in - * the st.info and appropriately install the st.info in the environment where - * you use this st version. - * - * it#$tabspaces, - * - * Secondly make sure your kernel is not expanding tabs. When running `stty - * -a` »tab0« should appear. You can tell the terminal to not expand tabs by - * running following command: - * - * stty tabs - */ -unsigned int tabspaces = 8; - -/* bg opacity */ -float alpha = 0.7; - -/* Terminal colors (16 first used in escape sequence) */ -static const char *colorname[] = { - - /* 8 normal colors */ - [0] = "#002b36", /* black */ - [1] = "#dc322f", /* red */ - [2] = "#859900", /* green */ - [3] = "#b58900", /* yellow */ - [4] = "#268bd2", /* blue */ - [5] = "#6c71c4", /* magenta */ - [6] = "#2aa198", /* cyan */ - [7] = "#93a1a1", /* white */ - - /* 8 bright colors */ - [8] = "#657b83", /* black */ - [9] = "#dc322f", /* red */ - [10] = "#859900", /* green */ - [11] = "#b58900", /* yellow */ - [12] = "#268bd2", /* blue */ - [13] = "#6c71c4", /* magenta */ - [14] = "#2aa198", /* cyan */ - [15] = "#fdf6e3", /* white */ - - /* special colors */ - [256] = "#000000", /* background */ - [257] = "#ffffff", /* foreground */ -}; - - -/* - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ -unsigned int defaultfg = 257; -unsigned int defaultbg = 256; -unsigned int defaultcs = 257; -static unsigned int defaultrcs = 257; - -/* - * Default shape of cursor - * 2: Block ("█") - * 4: Underline ("_") - * 6: Bar ("|") - * 7: Snowman ("☃") - */ -static unsigned int cursorshape = 6; - -/* - * Default columns and rows numbers - */ - -static unsigned int cols = 80; -static unsigned int rows = 24; - -/* - * Default colour and shape of the mouse cursor - */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; - -/* - * Color used to display font attributes when fontconfig selected a font which - * doesn't match the ones requested. - */ -static unsigned int defaultattr = 11; - -/* - * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). - * Note that if you want to use ShiftMask with selmasks, set this to an other - * modifier, set to 0 to not use it. - */ -static uint forcemousemod = ShiftMask; - -/* - * Internal mouse shortcuts. - * Beware that overloading Button1 will disable the selection. - */ -static MouseShortcut mshortcuts[] = { - /* mask button function argument release */ - { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, - { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, - { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, - { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, -}; - -/* Internal keyboard shortcuts. */ -#define MODKEY Mod1Mask -#define TERMMOD (ControlMask|ShiftMask) - -static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD, XK_Prior, zoom, {.f = +1} }, - { TERMMOD, XK_Next, zoom, {.f = -1} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, - { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, - { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, -}; - -/* - * Special keys (change & recompile st.info accordingly) - * - * Mask value: - * * Use XK_ANY_MOD to match the key no matter modifiers state - * * Use XK_NO_MOD to match the key alone (no modifiers) - * appkey value: - * * 0: no value - * * > 0: keypad application mode enabled - * * = 2: term.numlock = 1 - * * < 0: keypad application mode disabled - * appcursor value: - * * 0: no value - * * > 0: cursor application mode enabled - * * < 0: cursor application mode disabled - * - * Be careful with the order of the definitions because st searches in - * this table sequentially, so any XK_ANY_MOD must be in the last - * position for a key. - */ - -/* - * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) - * to be mapped below, add them to this array. - */ -static KeySym mappedkeys[] = { -1 }; - -/* - * State bits to ignore when matching key or button events. By default, - * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. - */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - -/* - * This is the huge key array which defines all compatibility to the Linux - * world. Please decide about changes wisely. - */ -static Key key[] = { - /* keysym mask string appkey appcursor */ - { XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, - { XK_KP_End, ControlMask, "\033[J", -1, 0}, - { XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_KP_End, ShiftMask, "\033[K", -1, 0}, - { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[L", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_KP_Delete, ControlMask, "\033[M", -1, 0}, - { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, - { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, - { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, - { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, - { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, - { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, - { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, - { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, - { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, - { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, - { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, - { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, - { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, - { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, - { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, - { XK_Up, ShiftMask, "\033[1;2A", 0, 0}, - { XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, - { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, - { XK_Up, ControlMask, "\033[1;5A", 0, 0}, - { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, - { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, - { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, - { XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_Down, ShiftMask, "\033[1;2B", 0, 0}, - { XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, - { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, - { XK_Down, ControlMask, "\033[1;5B", 0, 0}, - { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, - { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, - { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, - { XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_Left, ShiftMask, "\033[1;2D", 0, 0}, - { XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, - { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, - { XK_Left, ControlMask, "\033[1;5D", 0, 0}, - { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, - { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, - { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, - { XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_Right, ShiftMask, "\033[1;2C", 0, 0}, - { XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, - { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, - { XK_Right, ControlMask, "\033[1;5C", 0, 0}, - { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, - { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, - { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, - { XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, - { XK_Return, Mod1Mask, "\033\r", 0, 0}, - { XK_Return, XK_ANY_MOD, "\r", 0, 0}, - { XK_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_Insert, ControlMask, "\033[L", -1, 0}, - { XK_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_Delete, ControlMask, "\033[M", -1, 0}, - { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, - { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, - { XK_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_End, ControlMask, "\033[J", -1, 0}, - { XK_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_End, ShiftMask, "\033[K", -1, 0}, - { XK_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_Prior, ControlMask, "\033[5;5~", 0, 0}, - { XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_Next, ControlMask, "\033[6;5~", 0, 0}, - { XK_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, - { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, - { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, - { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, - { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, - { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, - { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, - { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, - { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, - { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, - { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, - { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, - { XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, - { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, - { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, - { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, - { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, - { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, - { XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, - { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, - { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, - { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, - { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, - { XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, - { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, - { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, - { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, - { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, - { XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, - { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, - { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, - { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, - { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, - { XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, - { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, - { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, - { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, - { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, - { XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, - { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, - { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, - { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, - { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, - { XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, - { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, - { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, - { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, - { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, - { XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, - { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, - { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, - { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, - { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, - { XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, - { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, - { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, - { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, - { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, - { XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, - { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, - { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, - { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, - { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, - { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, - { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, - { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, - { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, - { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, - { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, - { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, - { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, - { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, - { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, - { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, - { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, - { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, - { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, - { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, - { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, - { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, - { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, - { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, - { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, - { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, - { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, - { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, -}; - -/* - * Selection types' masks. - * Use the same masks as usual. - * Button1Mask is always unset, to make masks match between ButtonPress. - * ButtonRelease and MotionNotify. - * If no match is found, regular selection is used. - */ -static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, -}; - -/* - * Printable characters in ASCII, used to estimate the advance width - * of single wide characters. - */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/dwm/st/config.def.h.orig b/dwm/st/config.def.h.orig deleted file mode 100644 index 1e92958..0000000 --- a/dwm/st/config.def.h.orig +++ /dev/null @@ -1,482 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* - * appearance - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ -static char *font = "Jetbrains Mono:pixelsize=16:antialias=true:autohint=true"; -/* Spare fonts */ -static char *font2[] = { - "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true", - "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true", -}; - -static int borderpx = 2; - -/* - * What program is execed by st depends of these precedence rules: - * 1: program passed with -e - * 2: scroll and/or utmp - * 3: SHELL environment variable - * 4: value of shell in /etc/passwd - * 5: value of shell in config.h - */ -static char *shell = "/bin/sh"; -char *utmp = NULL; -/* scroll program: to enable use a string like "scroll" */ -char *scroll = NULL; -char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; - -/* identification sequence returned in DA and DECID */ -char *vtiden = "\033[?6c"; - -/* Kerning / character bounding-box multipliers */ -static float cwscale = 1.0; -static float chscale = 1.0; - -/* - * word delimiter string - * - * More advanced example: L" `'\"()[]{}" - */ -wchar_t *worddelimiters = L" "; - -/* selection timeouts (in milliseconds) */ -static unsigned int doubleclicktimeout = 300; -static unsigned int tripleclicktimeout = 600; - -/* alt screens */ -int allowaltscreen = 1; - -/* allow certain non-interactive (insecure) window operations such as: - setting the clipboard text */ -int allowwindowops = 0; - -/* - * draw latency range in ms - from new content/keypress/etc until drawing. - * within this range, st draws when content stops arriving (idle). mostly it's - * near minlatency, but it waits longer for slow updates to avoid partial draw. - * low minlatency will tear/flicker more, as it can "detect" idle too early. - */ -static double minlatency = 8; -static double maxlatency = 33; - -/* - * blinking timeout (set to 0 to disable blinking) for the terminal blinking - * attribute. - */ -static unsigned int blinktimeout = 800; - -/* - * thickness of underline and bar cursors - */ -static unsigned int cursorthickness = 2; - -/* - * bell volume. It must be a value between -100 and 100. Use 0 for disabling - * it - */ -static int bellvolume = 0; - -/* default TERM value */ -char *termname = "st-256color"; - -/* - * spaces per tab - * - * When you are changing this value, don't forget to adapt the »it« value in - * the st.info and appropriately install the st.info in the environment where - * you use this st version. - * - * it#$tabspaces, - * - * Secondly make sure your kernel is not expanding tabs. When running `stty - * -a` »tab0« should appear. You can tell the terminal to not expand tabs by - * running following command: - * - * stty tabs - */ -unsigned int tabspaces = 8; - -/* bg opacity */ -float alpha = 0.7; - -/* Terminal colors (16 first used in escape sequence) */ -static const char *colorname[] = { - - /* 8 normal colors */ - [0] = "#002b36", /* black */ - [1] = "#dc322f", /* red */ - [2] = "#859900", /* green */ - [3] = "#b58900", /* yellow */ - [4] = "#268bd2", /* blue */ - [5] = "#6c71c4", /* magenta */ - [6] = "#2aa198", /* cyan */ - [7] = "#93a1a1", /* white */ - - /* 8 bright colors */ - [8] = "#657b83", /* black */ - [9] = "#dc322f", /* red */ - [10] = "#859900", /* green */ - [11] = "#b58900", /* yellow */ - [12] = "#268bd2", /* blue */ - [13] = "#6c71c4", /* magenta */ - [14] = "#2aa198", /* cyan */ - [15] = "#fdf6e3", /* white */ - - /* special colors */ - [256] = "#000000", /* background */ - [257] = "#ffffff", /* foreground */ -}; - - -/* - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ -unsigned int defaultfg = 257; -unsigned int defaultbg = 256; -unsigned int defaultcs = 257; -static unsigned int defaultrcs = 257; - -/* - * Default shape of cursor - * 2: Block ("█") - * 4: Underline ("_") - * 6: Bar ("|") - * 7: Snowman ("☃") - */ -static unsigned int cursorshape = 6; - -/* - * Default columns and rows numbers - */ - -static unsigned int cols = 80; -static unsigned int rows = 24; - -/* - * Default colour and shape of the mouse cursor - */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; - -/* - * Color used to display font attributes when fontconfig selected a font which - * doesn't match the ones requested. - */ -static unsigned int defaultattr = 11; - -/* - * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). - * Note that if you want to use ShiftMask with selmasks, set this to an other - * modifier, set to 0 to not use it. - */ -static uint forcemousemod = ShiftMask; - -/* - * Internal mouse shortcuts. - * Beware that overloading Button1 will disable the selection. - */ -static MouseShortcut mshortcuts[] = { - /* mask button function argument release */ - { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, - { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, - { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, - { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, -}; - -/* Internal keyboard shortcuts. */ -#define MODKEY Mod1Mask -#define TERMMOD (ControlMask|ShiftMask) - -static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD, XK_Prior, zoom, {.f = +1} }, - { TERMMOD, XK_Next, zoom, {.f = -1} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, -}; - -/* - * Special keys (change & recompile st.info accordingly) - * - * Mask value: - * * Use XK_ANY_MOD to match the key no matter modifiers state - * * Use XK_NO_MOD to match the key alone (no modifiers) - * appkey value: - * * 0: no value - * * > 0: keypad application mode enabled - * * = 2: term.numlock = 1 - * * < 0: keypad application mode disabled - * appcursor value: - * * 0: no value - * * > 0: cursor application mode enabled - * * < 0: cursor application mode disabled - * - * Be careful with the order of the definitions because st searches in - * this table sequentially, so any XK_ANY_MOD must be in the last - * position for a key. - */ - -/* - * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) - * to be mapped below, add them to this array. - */ -static KeySym mappedkeys[] = { -1 }; - -/* - * State bits to ignore when matching key or button events. By default, - * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. - */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - -/* - * This is the huge key array which defines all compatibility to the Linux - * world. Please decide about changes wisely. - */ -static Key key[] = { - /* keysym mask string appkey appcursor */ - { XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, - { XK_KP_End, ControlMask, "\033[J", -1, 0}, - { XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_KP_End, ShiftMask, "\033[K", -1, 0}, - { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[L", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_KP_Delete, ControlMask, "\033[M", -1, 0}, - { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, - { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, - { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, - { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, - { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, - { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, - { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, - { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, - { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, - { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, - { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, - { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, - { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, - { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, - { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, - { XK_Up, ShiftMask, "\033[1;2A", 0, 0}, - { XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, - { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, - { XK_Up, ControlMask, "\033[1;5A", 0, 0}, - { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, - { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, - { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, - { XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_Down, ShiftMask, "\033[1;2B", 0, 0}, - { XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, - { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, - { XK_Down, ControlMask, "\033[1;5B", 0, 0}, - { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, - { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, - { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, - { XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_Left, ShiftMask, "\033[1;2D", 0, 0}, - { XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, - { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, - { XK_Left, ControlMask, "\033[1;5D", 0, 0}, - { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, - { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, - { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, - { XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_Right, ShiftMask, "\033[1;2C", 0, 0}, - { XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, - { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, - { XK_Right, ControlMask, "\033[1;5C", 0, 0}, - { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, - { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, - { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, - { XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, - { XK_Return, Mod1Mask, "\033\r", 0, 0}, - { XK_Return, XK_ANY_MOD, "\r", 0, 0}, - { XK_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_Insert, ControlMask, "\033[L", -1, 0}, - { XK_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_Delete, ControlMask, "\033[M", -1, 0}, - { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, - { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, - { XK_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_End, ControlMask, "\033[J", -1, 0}, - { XK_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_End, ShiftMask, "\033[K", -1, 0}, - { XK_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_Prior, ControlMask, "\033[5;5~", 0, 0}, - { XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_Next, ControlMask, "\033[6;5~", 0, 0}, - { XK_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, - { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, - { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, - { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, - { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, - { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, - { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, - { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, - { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, - { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, - { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, - { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, - { XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, - { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, - { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, - { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, - { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, - { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, - { XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, - { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, - { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, - { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, - { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, - { XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, - { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, - { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, - { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, - { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, - { XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, - { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, - { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, - { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, - { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, - { XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, - { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, - { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, - { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, - { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, - { XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, - { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, - { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, - { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, - { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, - { XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, - { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, - { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, - { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, - { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, - { XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, - { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, - { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, - { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, - { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, - { XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, - { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, - { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, - { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, - { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, - { XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, - { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, - { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, - { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, - { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, - { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, - { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, - { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, - { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, - { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, - { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, - { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, - { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, - { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, - { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, - { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, - { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, - { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, - { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, - { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, - { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, - { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, - { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, - { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, - { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, - { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, - { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, - { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, -}; - -/* - * Selection types' masks. - * Use the same masks as usual. - * Button1Mask is always unset, to make masks match between ButtonPress. - * ButtonRelease and MotionNotify. - * If no match is found, regular selection is used. - */ -static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, -}; - -/* - * Printable characters in ASCII, used to estimate the advance width - * of single wide characters. - */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/dwm/st/config.h b/dwm/st/config.h deleted file mode 100644 index 671ed01..0000000 --- a/dwm/st/config.h +++ /dev/null @@ -1,484 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* - * appearance - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ -static char *font = "JetbrainsMono Nerd Font Mono:pixelsize=18:antialias=true:autohint=true"; -/* Spare fonts */ -static char *font2[] = { - "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true", - "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true", - "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true", -}; - -static int borderpx = 2; - -/* - * What program is execed by st depends of these precedence rules: - * 1: program passed with -e - * 2: scroll and/or utmp - * 3: SHELL environment variable - * 4: value of shell in /etc/passwd - * 5: value of shell in config.h - */ -static char *shell = "/bin/sh"; -char *utmp = NULL; -/* scroll program: to enable use a string like "scroll" */ -char *scroll = NULL; -char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; - -/* identification sequence returned in DA and DECID */ -char *vtiden = "\033[?6c"; - -/* Kerning / character bounding-box multipliers */ -static float cwscale = 1.0; -static float chscale = 1.0; - -/* - * word delimiter string - * - * More advanced example: L" `'\"()[]{}" - */ -wchar_t *worddelimiters = L" "; - -/* selection timeouts (in milliseconds) */ -static unsigned int doubleclicktimeout = 300; -static unsigned int tripleclicktimeout = 600; - -/* alt screens */ -int allowaltscreen = 1; - -/* allow certain non-interactive (insecure) window operations such as: - setting the clipboard text */ -int allowwindowops = 0; - -/* - * draw latency range in ms - from new content/keypress/etc until drawing. - * within this range, st draws when content stops arriving (idle). mostly it's - * near minlatency, but it waits longer for slow updates to avoid partial draw. - * low minlatency will tear/flicker more, as it can "detect" idle too early. - */ -static double minlatency = 8; -static double maxlatency = 33; - -/* - * blinking timeout (set to 0 to disable blinking) for the terminal blinking - * attribute. - */ -static unsigned int blinktimeout = 800; - -/* - * thickness of underline and bar cursors - */ -static unsigned int cursorthickness = 2; - -/* - * bell volume. It must be a value between -100 and 100. Use 0 for disabling - * it - */ -static int bellvolume = 0; - -/* default TERM value */ -char *termname = "st-256color"; - -/* - * spaces per tab - * - * When you are changing this value, don't forget to adapt the »it« value in - * the st.info and appropriately install the st.info in the environment where - * you use this st version. - * - * it#$tabspaces, - * - * Secondly make sure your kernel is not expanding tabs. When running `stty - * -a` »tab0« should appear. You can tell the terminal to not expand tabs by - * running following command: - * - * stty tabs - */ -unsigned int tabspaces = 8; - -/* bg opacity */ -float alpha = 0.7; - -/* Terminal colors (16 first used in escape sequence) */ -static const char *colorname[] = { - - /* 8 normal colors */ - [0] = "#002b36", /* black */ - [1] = "#dc322f", /* red */ - [2] = "#859900", /* green */ - [3] = "#b58900", /* yellow */ - [4] = "#268bd2", /* blue */ - [5] = "#6c71c4", /* magenta */ - [6] = "#2aa198", /* cyan */ - [7] = "#93a1a1", /* white */ - - /* 8 bright colors */ - [8] = "#657b83", /* black */ - [9] = "#dc322f", /* red */ - [10] = "#859900", /* green */ - [11] = "#b58900", /* yellow */ - [12] = "#268bd2", /* blue */ - [13] = "#6c71c4", /* magenta */ - [14] = "#2aa198", /* cyan */ - [15] = "#fdf6e3", /* white */ - - /* special colors */ - [256] = "#000000", /* background */ - [257] = "#ffffff", /* foreground */ -}; - - -/* - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ -unsigned int defaultfg = 257; -unsigned int defaultbg = 256; -unsigned int defaultcs = 257; -static unsigned int defaultrcs = 257; - -/* - * Default shape of cursor - * 2: Block ("█") - * 4: Underline ("_") - * 6: Bar ("|") - * 7: Snowman ("☃") - */ -static unsigned int cursorshape = 6; - -/* - * Default columns and rows numbers - */ - -static unsigned int cols = 80; -static unsigned int rows = 24; - -/* - * Default colour and shape of the mouse cursor - */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; - -/* - * Color used to display font attributes when fontconfig selected a font which - * doesn't match the ones requested. - */ -static unsigned int defaultattr = 11; - -/* - * Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set). - * Note that if you want to use ShiftMask with selmasks, set this to an other - * modifier, set to 0 to not use it. - */ -static uint forcemousemod = ShiftMask; - -/* - * Internal mouse shortcuts. - * Beware that overloading Button1 will disable the selection. - */ -static MouseShortcut mshortcuts[] = { - /* mask button function argument release */ - { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, - { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, - { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, - { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, -}; - -/* Internal keyboard shortcuts. */ -#define MODKEY Mod1Mask -#define TERMMOD (ControlMask|ShiftMask) - -static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD, XK_Prior, zoom, {.f = +1} }, - { TERMMOD, XK_Next, zoom, {.f = -1} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, - { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, - { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, -}; - -/* - * Special keys (change & recompile st.info accordingly) - * - * Mask value: - * * Use XK_ANY_MOD to match the key no matter modifiers state - * * Use XK_NO_MOD to match the key alone (no modifiers) - * appkey value: - * * 0: no value - * * > 0: keypad application mode enabled - * * = 2: term.numlock = 1 - * * < 0: keypad application mode disabled - * appcursor value: - * * 0: no value - * * > 0: cursor application mode enabled - * * < 0: cursor application mode disabled - * - * Be careful with the order of the definitions because st searches in - * this table sequentially, so any XK_ANY_MOD must be in the last - * position for a key. - */ - -/* - * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) - * to be mapped below, add them to this array. - */ -static KeySym mappedkeys[] = { -1 }; - -/* - * State bits to ignore when matching key or button events. By default, - * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. - */ -static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; - -/* - * This is the huge key array which defines all compatibility to the Linux - * world. Please decide about changes wisely. - */ -static Key key[] = { - /* keysym mask string appkey appcursor */ - { XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, - { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, - { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, - { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, - { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, - { XK_KP_End, ControlMask, "\033[J", -1, 0}, - { XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_KP_End, ShiftMask, "\033[K", -1, 0}, - { XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[L", -1, 0}, - { XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_KP_Delete, ControlMask, "\033[M", -1, 0}, - { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, - { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, - { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, - { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, - { XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, - { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, - { XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, - { XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, - { XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, - { XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, - { XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, - { XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, - { XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, - { XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, - { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, - { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, - { XK_Up, ShiftMask, "\033[1;2A", 0, 0}, - { XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, - { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, - { XK_Up, ControlMask, "\033[1;5A", 0, 0}, - { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, - { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, - { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, - { XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, - { XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, - { XK_Down, ShiftMask, "\033[1;2B", 0, 0}, - { XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, - { XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, - { XK_Down, ControlMask, "\033[1;5B", 0, 0}, - { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, - { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, - { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, - { XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, - { XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, - { XK_Left, ShiftMask, "\033[1;2D", 0, 0}, - { XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, - { XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, - { XK_Left, ControlMask, "\033[1;5D", 0, 0}, - { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, - { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, - { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, - { XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, - { XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, - { XK_Right, ShiftMask, "\033[1;2C", 0, 0}, - { XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, - { XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, - { XK_Right, ControlMask, "\033[1;5C", 0, 0}, - { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, - { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, - { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, - { XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, - { XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, - { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, - { XK_Return, Mod1Mask, "\033\r", 0, 0}, - { XK_Return, XK_ANY_MOD, "\r", 0, 0}, - { XK_Insert, ShiftMask, "\033[4l", -1, 0}, - { XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, - { XK_Insert, ControlMask, "\033[L", -1, 0}, - { XK_Insert, ControlMask, "\033[2;5~", +1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, - { XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, - { XK_Delete, ControlMask, "\033[M", -1, 0}, - { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, - { XK_Delete, ShiftMask, "\033[2K", -1, 0}, - { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, - { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, - { XK_Home, ShiftMask, "\033[2J", 0, -1}, - { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, - { XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, - { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, - { XK_End, ControlMask, "\033[J", -1, 0}, - { XK_End, ControlMask, "\033[1;5F", +1, 0}, - { XK_End, ShiftMask, "\033[K", -1, 0}, - { XK_End, ShiftMask, "\033[1;2F", +1, 0}, - { XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, - { XK_Prior, ControlMask, "\033[5;5~", 0, 0}, - { XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, - { XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, - { XK_Next, ControlMask, "\033[6;5~", 0, 0}, - { XK_Next, ShiftMask, "\033[6;2~", 0, 0}, - { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, - { XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, - { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, - { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, - { XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, - { XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, - { XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, - { XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, - { XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, - { XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, - { XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, - { XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, - { XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, - { XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, - { XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, - { XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, - { XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, - { XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, - { XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, - { XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, - { XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, - { XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, - { XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, - { XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, - { XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, - { XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, - { XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, - { XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, - { XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, - { XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, - { XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, - { XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, - { XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, - { XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, - { XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, - { XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, - { XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, - { XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, - { XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, - { XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, - { XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, - { XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, - { XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, - { XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, - { XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, - { XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, - { XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, - { XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, - { XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, - { XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, - { XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, - { XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, - { XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, - { XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, - { XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, - { XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, - { XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, - { XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, - { XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, - { XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, - { XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, - { XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, - { XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, - { XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, - { XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, - { XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, - { XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, - { XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, - { XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, - { XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, - { XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, - { XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, - { XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, - { XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, - { XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, - { XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, - { XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, - { XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, - { XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, - { XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, - { XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, - { XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, - { XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, - { XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, - { XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, - { XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, - { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, -}; - -/* - * Selection types' masks. - * Use the same masks as usual. - * Button1Mask is always unset, to make masks match between ButtonPress. - * ButtonRelease and MotionNotify. - * If no match is found, regular selection is used. - */ -static uint selmasks[] = { - [SEL_RECTANGULAR] = Mod1Mask, -}; - -/* - * Printable characters in ASCII, used to estimate the advance width - * of single wide characters. - */ -static char ascii_printable[] = - " !\"#$%&'()*+,-./0123456789:;<=>?" - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" - "`abcdefghijklmnopqrstuvwxyz{|}~"; diff --git a/dwm/st/config.mk b/dwm/st/config.mk deleted file mode 100644 index 47c615e..0000000 --- a/dwm/st/config.mk +++ /dev/null @@ -1,36 +0,0 @@ -# st version -VERSION = 0.9 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -PKG_CONFIG = pkg-config - -# includes and libs -INCS = -I$(X11INC) \ - `$(PKG_CONFIG) --cflags fontconfig` \ - `$(PKG_CONFIG) --cflags freetype2` -LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\ - `$(PKG_CONFIG) --libs fontconfig` \ - `$(PKG_CONFIG) --libs freetype2` - -# flags -STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) -STLDFLAGS = $(LIBS) $(LDFLAGS) - -# OpenBSD: -#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \ -# `$(PKG_CONFIG) --libs fontconfig` \ -# `$(PKG_CONFIG) --libs freetype2` -#MANPREFIX = ${PREFIX}/man - -# compiler and linker -# CC = c99 diff --git a/dwm/st/patches/0001-Apply-alpha-on-st-version-0.9.patch b/dwm/st/patches/0001-Apply-alpha-on-st-version-0.9.patch deleted file mode 100644 index 3ae019a..0000000 --- a/dwm/st/patches/0001-Apply-alpha-on-st-version-0.9.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 307b030a02f8bfda47600acc881fdd4876767204 Mon Sep 17 00:00:00 2001 -From: Shourai <10200748+Shourai@users.noreply.github.com> -Date: Tue, 8 Nov 2022 19:30:52 +0100 -Subject: Apply alpha on st version 0.9 - ---- - config.def.h | 3 +++ - config.mk | 2 +- - st.h | 1 + - x.c | 40 ++++++++++++++++++++++++++++++---------- - 4 files changed, 35 insertions(+), 11 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 91ab8ca..38e5154 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -93,6 +93,9 @@ char *termname = "st-256color"; - */ - unsigned int tabspaces = 8; - -+/* bg opacity */ -+float alpha = 0.7; -+ - /* Terminal colors (16 first used in escape sequence) */ - static const char *colorname[] = { - /* 8 normal colors */ -diff --git a/config.mk b/config.mk -index 1e306f8..47c615e 100644 ---- a/config.mk -+++ b/config.mk -@@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config - INCS = -I$(X11INC) \ - `$(PKG_CONFIG) --cflags fontconfig` \ - `$(PKG_CONFIG) --cflags freetype2` --LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ -+LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\ - `$(PKG_CONFIG) --libs fontconfig` \ - `$(PKG_CONFIG) --libs freetype2` - -diff --git a/st.h b/st.h -index fd3b0d8..9f91e2a 100644 ---- a/st.h -+++ b/st.h -@@ -124,3 +124,4 @@ extern unsigned int tabspaces; - extern unsigned int defaultfg; - extern unsigned int defaultbg; - extern unsigned int defaultcs; -+extern float alpha; -diff --git a/x.c b/x.c -index aa09997..8a65792 100644 ---- a/x.c -+++ b/x.c -@@ -105,6 +105,7 @@ typedef struct { - XSetWindowAttributes attrs; - int scr; - int isfixed; /* is fixed geometry? */ -+ int depth; /* bit depth */ - int l, t; /* left and top offset */ - int gm; /* geometry mask */ - } XWindow; -@@ -243,6 +244,7 @@ static char *usedfont = NULL; - static double usedfontsize = 0; - static double defaultfontsize = 0; - -+static char *opt_alpha = NULL; - static char *opt_class = NULL; - static char **opt_cmd = NULL; - static char *opt_embed = NULL; -@@ -752,7 +754,7 @@ xresize(int col, int row) - - XFreePixmap(xw.dpy, xw.buf); - xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -+ xw.depth); - XftDrawChange(xw.draw, xw.buf); - xclear(0, 0, win.w, win.h); - -@@ -812,6 +814,13 @@ xloadcols(void) - else - die("could not allocate color %d\n", i); - } -+ -+ /* set alpha value of bg color */ -+ if (opt_alpha) -+ alpha = strtof(opt_alpha, NULL); -+ dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); -+ dc.col[defaultbg].pixel &= 0x00FFFFFF; -+ dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; - loaded = 1; - } - -@@ -1134,11 +1143,23 @@ xinit(int cols, int rows) - Window parent; - pid_t thispid = getpid(); - XColor xmousefg, xmousebg; -+ XWindowAttributes attr; -+ XVisualInfo vis; - - if (!(xw.dpy = XOpenDisplay(NULL))) - die("can't open display\n"); - xw.scr = XDefaultScreen(xw.dpy); -- xw.vis = XDefaultVisual(xw.dpy, xw.scr); -+ -+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { -+ parent = XRootWindow(xw.dpy, xw.scr); -+ xw.depth = 32; -+ } else { -+ XGetWindowAttributes(xw.dpy, parent, &attr); -+ xw.depth = attr.depth; -+ } -+ -+ XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis); -+ xw.vis = vis.visual; - - /* font */ - if (!FcInit()) -@@ -1148,7 +1169,7 @@ xinit(int cols, int rows) - xloadfonts(usedfont, 0); - - /* colors */ -- xw.cmap = XDefaultColormap(xw.dpy, xw.scr); -+ xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); - xloadcols(); - - /* adjust fixed window geometry */ -@@ -1168,19 +1189,15 @@ xinit(int cols, int rows) - | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; - xw.attrs.colormap = xw.cmap; - -- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) -- parent = XRootWindow(xw.dpy, xw.scr); - xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, -- win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, -+ win.w, win.h, 0, xw.depth, InputOutput, - xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity - | CWEventMask | CWColormap, &xw.attrs); - - memset(&gcvalues, 0, sizeof(gcvalues)); - gcvalues.graphics_exposures = False; -- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, -- &gcvalues); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -+ xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth); -+ dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues); - XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); - -@@ -2038,6 +2055,9 @@ main(int argc, char *argv[]) - case 'a': - allowaltscreen = 0; - break; -+ case 'A': -+ opt_alpha = EARGF(usage()); -+ break; - case 'c': - opt_class = EARGF(usage()); - break; --- -2.38.1 - diff --git a/dwm/st/patches/0002-Apply-font2-on-st-version-0.9.patch b/dwm/st/patches/0002-Apply-font2-on-st-version-0.9.patch deleted file mode 100644 index 16bda74..0000000 --- a/dwm/st/patches/0002-Apply-font2-on-st-version-0.9.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 2898f59f9b446b9ca748e544e61407e832ce5361 Mon Sep 17 00:00:00 2001 -From: Shourai <10200748+Shourai@users.noreply.github.com> -Date: Tue, 8 Nov 2022 19:35:52 +0100 -Subject: Apply font2 on st version 0.9 - ---- - config.def.h | 10 ++++- - x.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 110 insertions(+), 1 deletion(-) - -diff --git a/config.def.h b/config.def.h -index 38e5154..2ac0781 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -5,7 +5,15 @@ - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ --static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -+static char *font = "Jetbrains Mono:pixelsize=14:antialias=true:autohint=true"; -+/* Spare fonts */ -+static char *font2[] = { -+ "Droid Sans Mono:style=Regular:pixelsize=14:antialias=true:autohint=true", -+ "Menlo:style=Regular:pixelsize=14:antialias=true:autohint=true", -+ "Inconsolata for Powerline:pixelsize=14:antialias=true:autohint=true", -+ "Hack Nerd Font Mono:pixelsize=14:antialias=true:autohint=true", -+}; -+ - static int borderpx = 2; - - /* -diff --git a/x.c b/x.c -index 8a65792..db17dcf 100644 ---- a/x.c -+++ b/x.c -@@ -158,6 +158,8 @@ static void xhints(void); - static int xloadcolor(int, const char *, Color *); - static int xloadfont(Font *, FcPattern *); - static void xloadfonts(const char *, double); -+static int xloadsparefont(FcPattern *, int); -+static void xloadsparefonts(void); - static void xunloadfont(Font *); - static void xunloadfonts(void); - static void xsetenv(void); -@@ -308,6 +310,7 @@ zoomabs(const Arg *arg) - { - xunloadfonts(); - xloadfonts(usedfont, arg->f); -+ xloadsparefonts(); - cresize(0, 0); - redraw(); - xhints(); -@@ -1059,6 +1062,101 @@ xloadfonts(const char *fontstr, double fontsize) - FcPatternDestroy(pattern); - } - -+int -+xloadsparefont(FcPattern *pattern, int flags) -+{ -+ FcPattern *match; -+ FcResult result; -+ -+ match = FcFontMatch(NULL, pattern, &result); -+ if (!match) { -+ return 1; -+ } -+ -+ if (!(frc[frclen].font = XftFontOpenPattern(xw.dpy, match))) { -+ FcPatternDestroy(match); -+ return 1; -+ } -+ -+ frc[frclen].flags = flags; -+ /* Believe U+0000 glyph will present in each default font */ -+ frc[frclen].unicodep = 0; -+ frclen++; -+ -+ return 0; -+} -+ -+void -+xloadsparefonts(void) -+{ -+ FcPattern *pattern; -+ double sizeshift, fontval; -+ int fc; -+ char **fp; -+ -+ if (frclen != 0) -+ die("can't embed spare fonts. cache isn't empty"); -+ -+ /* Calculate count of spare fonts */ -+ fc = sizeof(font2) / sizeof(*font2); -+ if (fc == 0) -+ return; -+ -+ /* Allocate memory for cache entries. */ -+ if (frccap < 4 * fc) { -+ frccap += 4 * fc - frccap; -+ frc = xrealloc(frc, frccap * sizeof(Fontcache)); -+ } -+ -+ for (fp = font2; fp - font2 < fc; ++fp) { -+ -+ if (**fp == '-') -+ pattern = XftXlfdParse(*fp, False, False); -+ else -+ pattern = FcNameParse((FcChar8 *)*fp); -+ -+ if (!pattern) -+ die("can't open spare font %s\n", *fp); -+ -+ if (defaultfontsize > 0) { -+ sizeshift = usedfontsize - defaultfontsize; -+ if (sizeshift != 0 && -+ FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == -+ FcResultMatch) { -+ fontval += sizeshift; -+ FcPatternDel(pattern, FC_PIXEL_SIZE); -+ FcPatternDel(pattern, FC_SIZE); -+ FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); -+ } -+ } -+ -+ FcPatternAddBool(pattern, FC_SCALABLE, 1); -+ -+ FcConfigSubstitute(NULL, pattern, FcMatchPattern); -+ XftDefaultSubstitute(xw.dpy, xw.scr, pattern); -+ -+ if (xloadsparefont(pattern, FRC_NORMAL)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); -+ if (xloadsparefont(pattern, FRC_ITALIC)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_WEIGHT); -+ FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); -+ if (xloadsparefont(pattern, FRC_ITALICBOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); -+ if (xloadsparefont(pattern, FRC_BOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDestroy(pattern); -+ } -+} -+ - void - xunloadfont(Font *f) - { -@@ -1168,6 +1266,9 @@ xinit(int cols, int rows) - usedfont = (opt_font == NULL)? font : opt_font; - xloadfonts(usedfont, 0); - -+ /* spare fonts */ -+ xloadsparefonts(); -+ - /* colors */ - xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); - xloadcols(); --- -2.38.1 - diff --git a/dwm/st/patches/0003-Apply-colorscheme-on-st-version-0.9.patch b/dwm/st/patches/0003-Apply-colorscheme-on-st-version-0.9.patch deleted file mode 100644 index 1a18754..0000000 --- a/dwm/st/patches/0003-Apply-colorscheme-on-st-version-0.9.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 66e82b1d4db5c6ad7d62f809c38ff6f27773238a Mon Sep 17 00:00:00 2001 -From: Shourai <10200748+Shourai@users.noreply.github.com> -Date: Tue, 8 Nov 2022 19:45:28 +0100 -Subject: Apply colorscheme on st version 0.9 - -Apply colorscheme on st version 0.9 ---- - config.def.h | 57 +++++++++++++++++++++++++--------------------------- - 1 file changed, 27 insertions(+), 30 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 2ac0781..21a5b0a 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -106,33 +106,30 @@ float alpha = 0.7; - - /* Terminal colors (16 first used in escape sequence) */ - static const char *colorname[] = { -- /* 8 normal colors */ -- "black", -- "red3", -- "green3", -- "yellow3", -- "blue2", -- "magenta3", -- "cyan3", -- "gray90", -- -- /* 8 bright colors */ -- "gray50", -- "red", -- "green", -- "yellow", -- "#5c5cff", -- "magenta", -- "cyan", -- "white", -- -- [255] = 0, -- -- /* more colors can be added after 255 to use with DefaultXX */ -- "#cccccc", -- "#555555", -- "gray90", /* default foreground colour */ -- "black", /* default background colour */ -+ -+ /* 8 normal colors */ -+ [0] = "#002b36", /* black */ -+ [1] = "#dc322f", /* red */ -+ [2] = "#859900", /* green */ -+ [3] = "#b58900", /* yellow */ -+ [4] = "#268bd2", /* blue */ -+ [5] = "#6c71c4", /* magenta */ -+ [6] = "#2aa198", /* cyan */ -+ [7] = "#93a1a1", /* white */ -+ -+ /* 8 bright colors */ -+ [8] = "#657b83", /* black */ -+ [9] = "#dc322f", /* red */ -+ [10] = "#859900", /* green */ -+ [11] = "#b58900", /* yellow */ -+ [12] = "#268bd2", /* blue */ -+ [13] = "#6c71c4", /* magenta */ -+ [14] = "#2aa198", /* cyan */ -+ [15] = "#fdf6e3", /* white */ -+ -+ /* special colors */ -+ [256] = "#272727", /* background */ -+ [257] = "#ffffff", /* foreground */ - }; - - -@@ -140,9 +137,9 @@ static const char *colorname[] = { - * Default colors (colorname index) - * foreground, background, cursor, reverse cursor - */ --unsigned int defaultfg = 258; --unsigned int defaultbg = 259; --unsigned int defaultcs = 256; -+unsigned int defaultfg = 257; -+unsigned int defaultbg = 256; -+unsigned int defaultcs = 257; - static unsigned int defaultrcs = 257; - - /* --- -2.38.1 - diff --git a/dwm/st/patches/0004-Apply-clipboard-on-st-version-0.9.patch b/dwm/st/patches/0004-Apply-clipboard-on-st-version-0.9.patch deleted file mode 100644 index 8ed2ae3..0000000 --- a/dwm/st/patches/0004-Apply-clipboard-on-st-version-0.9.patch +++ /dev/null @@ -1,24 +0,0 @@ -From a248b1eedb9de154751faf9760f15edca141c353 Mon Sep 17 00:00:00 2001 -From: Shourai <10200748+Shourai@users.noreply.github.com> -Date: Tue, 8 Nov 2022 19:49:03 +0100 -Subject: Apply clipboard on st version 0.9 - ---- - x.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/x.c b/x.c -index db17dcf..c7ef7fc 100644 ---- a/x.c -+++ b/x.c -@@ -691,6 +691,7 @@ setsel(char *str, Time t) - XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t); - if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win) - selclear(); -+ clipcopy(NULL); - } - - void --- -2.38.1 - diff --git a/dwm/st/patches/0005-Apply-wide-glyph-support-on-st-version-0.9.patch b/dwm/st/patches/0005-Apply-wide-glyph-support-on-st-version-0.9.patch deleted file mode 100644 index 74ded71..0000000 --- a/dwm/st/patches/0005-Apply-wide-glyph-support-on-st-version-0.9.patch +++ /dev/null @@ -1,206 +0,0 @@ -From fbe883a76d35524c678ab4c0e5e89fb606a4fe71 Mon Sep 17 00:00:00 2001 -From: Shourai <10200748+Shourai@users.noreply.github.com> -Date: Fri, 10 Nov 2023 11:14:12 +0100 -Subject: [PATCH] Apply wide glyph support on st version 0.9 - ---- - st.h | 6 +++ - x.c | 134 +++++++++++++++++++++++++++++------------------------------ - 2 files changed, 73 insertions(+), 67 deletions(-) - -diff --git a/st.h b/st.h -index 9f91e2a..0a3fa6d 100644 ---- a/st.h -+++ b/st.h -@@ -36,6 +36,12 @@ enum glyph_attribute { - ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, - }; - -+enum drawing_mode { -+ DRAW_NONE = 0, -+ DRAW_BG = 1 << 0, -+ DRAW_FG = 1 << 1, -+}; -+ - enum selection_mode { - SEL_IDLE = 0, - SEL_EMPTY = 1, -diff --git a/x.c b/x.c -index c7ef7fc..48adbb1 100644 ---- a/x.c -+++ b/x.c -@@ -143,7 +143,7 @@ typedef struct { - - static inline ushort sixd_to_16bit(int); - static int xmakeglyphfontspecs(XftGlyphFontSpec *, const Glyph *, int, int, int); --static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int); -+static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int, int); - static void xdrawglyph(Glyph, int, int); - static void xclear(int, int, int, int); - static int xgeommasktogravity(int); -@@ -1491,7 +1491,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x - } - - void --xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y) -+xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y, int dmode) - { - int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1); - int winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, -@@ -1582,47 +1582,40 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i - if (base.mode & ATTR_INVISIBLE) - fg = bg; - -- /* Intelligent cleaning up of the borders. */ -- if (x == 0) { -- xclear(0, (y == 0)? 0 : winy, borderpx, -- winy + win.ch + -- ((winy + win.ch >= borderpx + win.th)? win.h : 0)); -- } -- if (winx + width >= borderpx + win.tw) { -- xclear(winx + width, (y == 0)? 0 : winy, win.w, -- ((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch))); -- } -- if (y == 0) -- xclear(winx, 0, winx + width, borderpx); -- if (winy + win.ch >= borderpx + win.th) -- xclear(winx, winy + win.ch, winx + width, win.h); -- -- /* Clean up the region we want to draw to. */ -- XftDrawRect(xw.draw, bg, winx, winy, width, win.ch); -- -- /* Set the clip region because Xft is sometimes dirty. */ -- r.x = 0; -- r.y = 0; -- r.height = win.ch; -- r.width = width; -- XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); -- -- /* Render the glyphs. */ -- XftDrawGlyphFontSpec(xw.draw, fg, specs, len); -- -- /* Render underline and strikethrough. */ -- if (base.mode & ATTR_UNDERLINE) { -- XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent * chscale + 1, -- width, 1); -- } -- -- if (base.mode & ATTR_STRUCK) { -- XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent * chscale / 3, -- width, 1); -- } -- -- /* Reset clip to none. */ -- XftDrawSetClip(xw.draw, 0); -+ if (dmode & DRAW_BG) { -+ /* Intelligent cleaning up of the borders. */ -+ if (x == 0) { -+ xclear(0, (y == 0)? 0 : winy, borderpx, -+ winy + win.ch + -+ ((winy + win.ch >= borderpx + win.th)? win.h : 0)); -+ } -+ if (winx + width >= borderpx + win.tw) { -+ xclear(winx + width, (y == 0)? 0 : winy, win.w, -+ ((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch))); -+ } -+ if (y == 0) -+ xclear(winx, 0, winx + width, borderpx); -+ if (winy + win.ch >= borderpx + win.th) -+ xclear(winx, winy + win.ch, winx + width, win.h); -+ /* Fill the background */ -+ XftDrawRect(xw.draw, bg, winx, winy, width, win.ch); -+ } -+ -+ if (dmode & DRAW_FG) { -+ /* Render the glyphs. */ -+ XftDrawGlyphFontSpec(xw.draw, fg, specs, len); -+ -+ /* Render underline and strikethrough. */ -+ if (base.mode & ATTR_UNDERLINE) { -+ XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1, -+ width, 1); -+ } -+ -+ if (base.mode & ATTR_STRUCK) { -+ XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3, -+ width, 1); -+ } -+ } - } - - void -@@ -1632,7 +1625,7 @@ xdrawglyph(Glyph g, int x, int y) - XftGlyphFontSpec spec; - - numspecs = xmakeglyphfontspecs(&spec, &g, 1, x, y); -- xdrawglyphfontspecs(&spec, g, numspecs, x, y); -+ xdrawglyphfontspecs(&spec, g, numspecs, x, y, DRAW_BG | DRAW_FG); - } - - void -@@ -1767,32 +1760,39 @@ xstartdraw(void) - void - xdrawline(Line line, int x1, int y1, int x2) - { -- int i, x, ox, numspecs; -+ int i, x, ox, numspecs, numspecs_cached; - Glyph base, new; -- XftGlyphFontSpec *specs = xw.specbuf; -- -- numspecs = xmakeglyphfontspecs(specs, &line[x1], x2 - x1, x1, y1); -- i = ox = 0; -- for (x = x1; x < x2 && i < numspecs; x++) { -- new = line[x]; -- if (new.mode == ATTR_WDUMMY) -- continue; -- if (selected(x, y1)) -- new.mode ^= ATTR_REVERSE; -- if (i > 0 && ATTRCMP(base, new)) { -- xdrawglyphfontspecs(specs, base, i, ox, y1); -- specs += i; -- numspecs -= i; -- i = 0; -- } -- if (i == 0) { -- ox = x; -- base = new; -+ XftGlyphFontSpec *specs; -+ -+ numspecs_cached = xmakeglyphfontspecs(xw.specbuf, &line[x1], x2 - x1, x1, y1); -+ -+ /* Draw line in 2 passes: background and foreground. This way wide glyphs -+ won't get truncated (#223) */ -+ for (int dmode = DRAW_BG; dmode <= DRAW_FG; dmode <<= 1) { -+ specs = xw.specbuf; -+ numspecs = numspecs_cached; -+ i = ox = 0; -+ for (x = x1; x < x2 && i < numspecs; x++) { -+ new = line[x]; -+ if (new.mode == ATTR_WDUMMY) -+ continue; -+ if (selected(x, y1)) -+ new.mode ^= ATTR_REVERSE; -+ if (i > 0 && ATTRCMP(base, new)) { -+ xdrawglyphfontspecs(specs, base, i, ox, y1, dmode); -+ specs += i; -+ numspecs -= i; -+ i = 0; -+ } -+ if (i == 0) { -+ ox = x; -+ base = new; -+ } -+ i++; - } -- i++; -+ if (i > 0) -+ xdrawglyphfontspecs(specs, base, i, ox, y1, dmode); - } -- if (i > 0) -- xdrawglyphfontspecs(specs, base, i, ox, y1); - } - - void --- -2.42.1 - diff --git a/dwm/st/patches/st-scrollback-ringbuffer-0.8.5.diff b/dwm/st/patches/st-scrollback-ringbuffer-0.8.5.diff deleted file mode 100644 index 7c060c5..0000000 --- a/dwm/st/patches/st-scrollback-ringbuffer-0.8.5.diff +++ /dev/null @@ -1,730 +0,0 @@ -commit 0663bdf11a409961da5b1120741a69814da8ce65 -Author: Timo Röhling -Date: Tue Nov 23 19:45:33 2021 +0100 - - Terminal scrollback with ring buffer - - This patch adds a ring buffer for scrollback to the terminal. The - advantage of using a ring buffer is that the common case, scrolling with - no static screen content, can be achieved very efficiently by - incrementing and decrementing the starting line (modulo buffer size). - - The scrollback buffer is limited to HISTSIZE lines in order to bound - memory usage. As the lines are allocated on demand, it is possible to - implement unlimited scrollback with few changes. If the terminal is - reset, the scroll back buffer is reset, too. - -diff --git a/config.def.h b/config.def.h -index 91ab8ca..e3b469b 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -201,6 +201,8 @@ static Shortcut shortcuts[] = { - { TERMMOD, XK_Y, selpaste, {.i = 0} }, - { ShiftMask, XK_Insert, selpaste, {.i = 0} }, - { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, -+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, -+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, - }; - - /* -diff --git a/st.c b/st.c -index 51049ba..f9e24ba 100644 ---- a/st.c -+++ b/st.c -@@ -43,6 +43,10 @@ - #define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) - #define ISDELIM(u) (u && wcschr(worddelimiters, u)) - -+#define TSCREEN term.screen[IS_SET(MODE_ALTSCREEN)] -+#define TLINEOFFSET(y) (((y) + TSCREEN.cur - TSCREEN.off + TSCREEN.size) % TSCREEN.size) -+#define TLINE(y) (TSCREEN.buffer[TLINEOFFSET(y)]) -+ - enum term_mode { - MODE_WRAP = 1 << 0, - MODE_INSERT = 1 << 1, -@@ -109,12 +113,21 @@ typedef struct { - int alt; - } Selection; - -+/* Screen lines */ -+typedef struct { -+ Line* buffer; /* ring buffer */ -+ int size; /* size of buffer */ -+ int cur; /* start of active screen */ -+ int off; /* scrollback line offset */ -+ TCursor sc; /* saved cursor */ -+} LineBuffer; -+ - /* Internal representation of the screen */ - typedef struct { - int row; /* nb row */ - int col; /* nb col */ -- Line *line; /* screen */ -- Line *alt; /* alternate screen */ -+ LineBuffer screen[2]; /* screen and alternate screen */ -+ int linelen; /* allocated line length */ - int *dirty; /* dirtyness of lines */ - TCursor c; /* cursor */ - int ocx; /* old cursor col */ -@@ -202,6 +215,8 @@ static void tdeftran(char); - static void tstrsequence(uchar); - - static void drawregion(int, int, int, int); -+static void clearline(Line, Glyph, int, int); -+static Line ensureline(Line); - - static void selnormalize(void); - static void selscroll(int, int); -@@ -415,11 +430,12 @@ int - tlinelen(int y) - { - int i = term.col; -+ Line line = TLINE(y); - -- if (term.line[y][i - 1].mode & ATTR_WRAP) -+ if (line[i - 1].mode & ATTR_WRAP) - return i; - -- while (i > 0 && term.line[y][i - 1].u == ' ') -+ while (i > 0 && line[i - 1].u == ' ') - --i; - - return i; -@@ -528,7 +544,7 @@ selsnap(int *x, int *y, int direction) - * Snap around if the word wraps around at the end or - * beginning of a line. - */ -- prevgp = &term.line[*y][*x]; -+ prevgp = &TLINE(*y)[*x]; - prevdelim = ISDELIM(prevgp->u); - for (;;) { - newx = *x + direction; -@@ -543,14 +559,14 @@ selsnap(int *x, int *y, int direction) - yt = *y, xt = *x; - else - yt = newy, xt = newx; -- if (!(term.line[yt][xt].mode & ATTR_WRAP)) -+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) - break; - } - - if (newx >= tlinelen(newy)) - break; - -- gp = &term.line[newy][newx]; -+ gp = &TLINE(newy)[newx]; - delim = ISDELIM(gp->u); - if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim - || (delim && gp->u != prevgp->u))) -@@ -571,14 +587,14 @@ selsnap(int *x, int *y, int direction) - *x = (direction < 0) ? 0 : term.col - 1; - if (direction < 0) { - for (; *y > 0; *y += direction) { -- if (!(term.line[*y-1][term.col-1].mode -+ if (!(TLINE(*y-1)[term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } else if (direction > 0) { - for (; *y < term.row-1; *y += direction) { -- if (!(term.line[*y][term.col-1].mode -+ if (!(TLINE(*y)[term.col-1].mode - & ATTR_WRAP)) { - break; - } -@@ -609,13 +625,13 @@ getsel(void) - } - - if (sel.type == SEL_RECTANGULAR) { -- gp = &term.line[y][sel.nb.x]; -+ gp = &TLINE(y)[sel.nb.x]; - lastx = sel.ne.x; - } else { -- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; -+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; - lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; - } -- last = &term.line[y][MIN(lastx, linelen-1)]; -+ last = &TLINE(y)[MIN(lastx, linelen-1)]; - while (last >= gp && last->u == ' ') - --last; - -@@ -956,12 +972,15 @@ int - tattrset(int attr) - { - int i, j; -+ int y = TLINEOFFSET(0); - - for (i = 0; i < term.row-1; i++) { -+ Line line = TSCREEN.buffer[y]; - for (j = 0; j < term.col-1; j++) { -- if (term.line[i][j].mode & attr) -+ if (line[j].mode & attr) - return 1; - } -+ y = (y+1) % TSCREEN.size; - } - - return 0; -@@ -983,14 +1002,17 @@ void - tsetdirtattr(int attr) - { - int i, j; -+ int y = TLINEOFFSET(0); - - for (i = 0; i < term.row-1; i++) { -+ Line line = TSCREEN.buffer[y]; - for (j = 0; j < term.col-1; j++) { -- if (term.line[i][j].mode & attr) { -+ if (line[j].mode & attr) { - tsetdirt(i, i); - break; - } - } -+ y = (y+1) % TSCREEN.size; - } - } - -@@ -1003,27 +1025,19 @@ tfulldirt(void) - void - tcursor(int mode) - { -- static TCursor c[2]; -- int alt = IS_SET(MODE_ALTSCREEN); -- - if (mode == CURSOR_SAVE) { -- c[alt] = term.c; -+ TSCREEN.sc = term.c; - } else if (mode == CURSOR_LOAD) { -- term.c = c[alt]; -- tmoveto(c[alt].x, c[alt].y); -+ term.c = TSCREEN.sc; -+ tmoveto(term.c.x, term.c.y); - } - } - - void - treset(void) - { -- uint i; -- -- term.c = (TCursor){{ -- .mode = ATTR_NULL, -- .fg = defaultfg, -- .bg = defaultbg -- }, .x = 0, .y = 0, .state = CURSOR_DEFAULT}; -+ int i, j; -+ Glyph g = (Glyph){ .fg = defaultfg, .bg = defaultbg}; - - memset(term.tabs, 0, term.col * sizeof(*term.tabs)); - for (i = tabspaces; i < term.col; i += tabspaces) -@@ -1035,17 +1049,37 @@ treset(void) - term.charset = 0; - - for (i = 0; i < 2; i++) { -- tmoveto(0, 0); -- tcursor(CURSOR_SAVE); -- tclearregion(0, 0, term.col-1, term.row-1); -- tswapscreen(); -+ term.screen[i].sc = (TCursor){{ -+ .fg = defaultfg, -+ .bg = defaultbg -+ }}; -+ term.screen[i].cur = 0; -+ term.screen[i].off = 0; -+ for (j = 0; j < term.row; ++j) { -+ if (term.col != term.linelen) -+ term.screen[i].buffer[j] = xrealloc(term.screen[i].buffer[j], term.col * sizeof(Glyph)); -+ clearline(term.screen[i].buffer[j], g, 0, term.col); -+ } -+ for (j = term.row; j < term.screen[i].size; ++j) { -+ free(term.screen[i].buffer[j]); -+ term.screen[i].buffer[j] = NULL; -+ } - } -+ tcursor(CURSOR_LOAD); -+ term.linelen = term.col; -+ tfulldirt(); - } - - void - tnew(int col, int row) - { -- term = (Term){ .c = { .attr = { .fg = defaultfg, .bg = defaultbg } } }; -+ int i; -+ term = (Term){}; -+ term.screen[0].buffer = xmalloc(HISTSIZE * sizeof(Line)); -+ term.screen[0].size = HISTSIZE; -+ term.screen[1].buffer = NULL; -+ for (i = 0; i < HISTSIZE; ++i) term.screen[0].buffer[i] = NULL; -+ - tresize(col, row); - treset(); - } -@@ -1053,14 +1087,42 @@ tnew(int col, int row) - void - tswapscreen(void) - { -- Line *tmp = term.line; -- -- term.line = term.alt; -- term.alt = tmp; - term.mode ^= MODE_ALTSCREEN; - tfulldirt(); - } - -+void -+kscrollup(const Arg *a) -+{ -+ int n = a->i; -+ -+ if (IS_SET(MODE_ALTSCREEN)) -+ return; -+ -+ if (n < 0) n = (-n) * term.row; -+ if (n > TSCREEN.size - term.row - TSCREEN.off) n = TSCREEN.size - term.row - TSCREEN.off; -+ while (!TLINE(-n)) --n; -+ TSCREEN.off += n; -+ selscroll(0, n); -+ tfulldirt(); -+} -+ -+void -+kscrolldown(const Arg *a) -+{ -+ -+ int n = a->i; -+ -+ if (IS_SET(MODE_ALTSCREEN)) -+ return; -+ -+ if (n < 0) n = (-n) * term.row; -+ if (n > TSCREEN.off) n = TSCREEN.off; -+ TSCREEN.off -= n; -+ selscroll(0, -n); -+ tfulldirt(); -+} -+ - void - tscrolldown(int orig, int n) - { -@@ -1069,15 +1131,29 @@ tscrolldown(int orig, int n) - - LIMIT(n, 0, term.bot-orig+1); - -- tsetdirt(orig, term.bot-n); -- tclearregion(0, term.bot-n+1, term.col-1, term.bot); -+ /* Ensure that lines are allocated */ -+ for (i = -n; i < 0; i++) { -+ TLINE(i) = ensureline(TLINE(i)); -+ } - -- for (i = term.bot; i >= orig+n; i--) { -- temp = term.line[i]; -- term.line[i] = term.line[i-n]; -- term.line[i-n] = temp; -+ /* Shift non-scrolling areas in ring buffer */ -+ for (i = term.bot+1; i < term.row; i++) { -+ temp = TLINE(i); -+ TLINE(i) = TLINE(i-n); -+ TLINE(i-n) = temp; -+ } -+ for (i = 0; i < orig; i++) { -+ temp = TLINE(i); -+ TLINE(i) = TLINE(i-n); -+ TLINE(i-n) = temp; - } - -+ /* Scroll buffer */ -+ TSCREEN.cur = (TSCREEN.cur + TSCREEN.size - n) % TSCREEN.size; -+ /* Clear lines that have entered the view */ -+ tclearregion(0, orig, term.linelen-1, orig+n-1); -+ /* Redraw portion of the screen that has scrolled */ -+ tsetdirt(orig+n-1, term.bot); - selscroll(orig, n); - } - -@@ -1089,15 +1165,29 @@ tscrollup(int orig, int n) - - LIMIT(n, 0, term.bot-orig+1); - -- tclearregion(0, orig, term.col-1, orig+n-1); -- tsetdirt(orig+n, term.bot); -+ /* Ensure that lines are allocated */ -+ for (i = term.row; i < term.row + n; i++) { -+ TLINE(i) = ensureline(TLINE(i)); -+ } - -- for (i = orig; i <= term.bot-n; i++) { -- temp = term.line[i]; -- term.line[i] = term.line[i+n]; -- term.line[i+n] = temp; -+ /* Shift non-scrolling areas in ring buffer */ -+ for (i = orig-1; i >= 0; i--) { -+ temp = TLINE(i); -+ TLINE(i) = TLINE(i+n); -+ TLINE(i+n) = temp; -+ } -+ for (i = term.row-1; i >term.bot; i--) { -+ temp = TLINE(i); -+ TLINE(i) = TLINE(i+n); -+ TLINE(i+n) = temp; - } - -+ /* Scroll buffer */ -+ TSCREEN.cur = (TSCREEN.cur + n) % TSCREEN.size; -+ /* Clear lines that have entered the view */ -+ tclearregion(0, term.bot-n+1, term.linelen-1, term.bot); -+ /* Redraw portion of the screen that has scrolled */ -+ tsetdirt(orig, term.bot-n+1); - selscroll(orig, -n); - } - -@@ -1201,6 +1291,7 @@ tsetchar(Rune u, const Glyph *attr, int x, int y) - "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", /* p - w */ - "│", "≤", "≥", "π", "≠", "£", "·", /* x - ~ */ - }; -+ Line line = TLINE(y); - - /* - * The table is proudly stolen from rxvt. -@@ -1209,25 +1300,25 @@ tsetchar(Rune u, const Glyph *attr, int x, int y) - BETWEEN(u, 0x41, 0x7e) && vt100_0[u - 0x41]) - utf8decode(vt100_0[u - 0x41], &u, UTF_SIZ); - -- if (term.line[y][x].mode & ATTR_WIDE) { -+ if (line[x].mode & ATTR_WIDE) { - if (x+1 < term.col) { -- term.line[y][x+1].u = ' '; -- term.line[y][x+1].mode &= ~ATTR_WDUMMY; -+ line[x+1].u = ' '; -+ line[x+1].mode &= ~ATTR_WDUMMY; - } -- } else if (term.line[y][x].mode & ATTR_WDUMMY) { -- term.line[y][x-1].u = ' '; -- term.line[y][x-1].mode &= ~ATTR_WIDE; -+ } else if (line[x].mode & ATTR_WDUMMY) { -+ line[x-1].u = ' '; -+ line[x-1].mode &= ~ATTR_WIDE; - } - - term.dirty[y] = 1; -- term.line[y][x] = *attr; -- term.line[y][x].u = u; -+ line[x] = *attr; -+ line[x].u = u; - } - - void - tclearregion(int x1, int y1, int x2, int y2) - { -- int x, y, temp; -+ int x, y, L, S, temp; - Glyph *gp; - - if (x1 > x2) -@@ -1235,15 +1326,16 @@ tclearregion(int x1, int y1, int x2, int y2) - if (y1 > y2) - temp = y1, y1 = y2, y2 = temp; - -- LIMIT(x1, 0, term.col-1); -- LIMIT(x2, 0, term.col-1); -+ LIMIT(x1, 0, term.linelen-1); -+ LIMIT(x2, 0, term.linelen-1); - LIMIT(y1, 0, term.row-1); - LIMIT(y2, 0, term.row-1); - -+ L = TLINEOFFSET(y1); - for (y = y1; y <= y2; y++) { - term.dirty[y] = 1; - for (x = x1; x <= x2; x++) { -- gp = &term.line[y][x]; -+ gp = &TSCREEN.buffer[L][x]; - if (selected(x, y)) - selclear(); - gp->fg = term.c.attr.fg; -@@ -1251,6 +1343,7 @@ tclearregion(int x1, int y1, int x2, int y2) - gp->mode = 0; - gp->u = ' '; - } -+ L = (L + 1) % TSCREEN.size; - } - } - -@@ -1265,7 +1358,7 @@ tdeletechar(int n) - dst = term.c.x; - src = term.c.x + n; - size = term.col - src; -- line = term.line[term.c.y]; -+ line = TLINE(term.c.y); - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); -@@ -1282,7 +1375,7 @@ tinsertblank(int n) - dst = term.c.x + n; - src = term.c.x; - size = term.col - dst; -- line = term.line[term.c.y]; -+ line = TLINE(term.c.y); - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(src, term.c.y, dst - 1, term.c.y); -@@ -2103,7 +2196,7 @@ tdumpline(int n) - char buf[UTF_SIZ]; - const Glyph *bp, *end; - -- bp = &term.line[n][0]; -+ bp = &TLINE(n)[0]; - end = &bp[MIN(tlinelen(n), term.col) - 1]; - if (bp != end || bp->u != ' ') { - for ( ; bp <= end; ++bp) -@@ -2486,11 +2579,11 @@ check_control_code: - if (selected(term.c.x, term.c.y)) - selclear(); - -- gp = &term.line[term.c.y][term.c.x]; -+ gp = &TLINE(term.c.y)[term.c.x]; - if (IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) { - gp->mode |= ATTR_WRAP; - tnewline(1); -- gp = &term.line[term.c.y][term.c.x]; -+ gp = &TLINE(term.c.y)[term.c.x]; - } - - if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) -@@ -2498,7 +2591,7 @@ check_control_code: - - if (term.c.x+width > term.col) { - tnewline(1); -- gp = &term.line[term.c.y][term.c.x]; -+ gp = &TLINE(term.c.y)[term.c.x]; - } - - tsetchar(u, &term.c.attr, term.c.x, term.c.y); -@@ -2529,6 +2622,11 @@ twrite(const char *buf, int buflen, int show_ctrl) - Rune u; - int n; - -+ if (TSCREEN.off) { -+ TSCREEN.off = 0; -+ tfulldirt(); -+ } -+ - for (n = 0; n < buflen; n += charsize) { - if (IS_SET(MODE_UTF8)) { - /* process a complete utf8 char */ -@@ -2555,56 +2653,85 @@ twrite(const char *buf, int buflen, int show_ctrl) - } - - void --tresize(int col, int row) -+clearline(Line line, Glyph g, int x, int xend) - { - int i; -+ g.mode = 0; -+ g.u = ' '; -+ for (i = x; i < xend; ++i) { -+ line[i] = g; -+ } -+} -+ -+Line -+ensureline(Line line) -+{ -+ if (!line) { -+ line = xmalloc(term.linelen * sizeof(Glyph)); -+ } -+ return line; -+} -+ -+void -+tresize(int col, int row) -+{ -+ int i, j; - int minrow = MIN(row, term.row); - int mincol = MIN(col, term.col); -+ int linelen = MAX(col, term.linelen); - int *bp; -- TCursor c; - -- if (col < 1 || row < 1) { -+ if (col < 1 || row < 1 || row > HISTSIZE) { - fprintf(stderr, - "tresize: error resizing to %dx%d\n", col, row); - return; - } - -- /* -- * slide screen to keep cursor where we expect it - -- * tscrollup would work here, but we can optimize to -- * memmove because we're freeing the earlier lines -- */ -- for (i = 0; i <= term.c.y - row; i++) { -- free(term.line[i]); -- free(term.alt[i]); -+ /* Shift buffer to keep the cursor where we expect it */ -+ if (row <= term.c.y) { -+ term.screen[0].cur = (term.screen[0].cur - row + term.c.y + 1) % term.screen[0].size; -+ } -+ -+ /* Resize and clear line buffers as needed */ -+ if (linelen > term.linelen) { -+ for (i = 0; i < term.screen[0].size; ++i) { -+ if (term.screen[0].buffer[i]) { -+ term.screen[0].buffer[i] = xrealloc(term.screen[0].buffer[i], linelen * sizeof(Glyph)); -+ clearline(term.screen[0].buffer[i], term.c.attr, term.linelen, linelen); -+ } -+ } -+ for (i = 0; i < minrow; ++i) { -+ term.screen[1].buffer[i] = xrealloc(term.screen[1].buffer[i], linelen * sizeof(Glyph)); -+ clearline(term.screen[1].buffer[i], term.c.attr, term.linelen, linelen); -+ } - } -- /* ensure that both src and dst are not NULL */ -- if (i > 0) { -- memmove(term.line, term.line + i, row * sizeof(Line)); -- memmove(term.alt, term.alt + i, row * sizeof(Line)); -+ /* Allocate all visible lines for regular line buffer */ -+ for (j = term.screen[0].cur, i = 0; i < row; ++i, j = (j + 1) % term.screen[0].size) -+ { -+ if (!term.screen[0].buffer[j]) { -+ term.screen[0].buffer[j] = xmalloc(linelen * sizeof(Glyph)); -+ } -+ if (i >= term.row) { -+ clearline(term.screen[0].buffer[j], term.c.attr, 0, linelen); -+ } - } -- for (i += row; i < term.row; i++) { -- free(term.line[i]); -- free(term.alt[i]); -+ /* Resize alt screen */ -+ term.screen[1].cur = 0; -+ term.screen[1].size = row; -+ for (i = row; i < term.row; ++i) { -+ free(term.screen[1].buffer[i]); -+ } -+ term.screen[1].buffer = xrealloc(term.screen[1].buffer, row * sizeof(Line)); -+ for (i = term.row; i < row; ++i) { -+ term.screen[1].buffer[i] = xmalloc(linelen * sizeof(Glyph)); -+ clearline(term.screen[1].buffer[i], term.c.attr, 0, linelen); - } - - /* resize to new height */ -- term.line = xrealloc(term.line, row * sizeof(Line)); -- term.alt = xrealloc(term.alt, row * sizeof(Line)); - term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); - term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); - -- /* resize each row to new width, zero-pad if needed */ -- for (i = 0; i < minrow; i++) { -- term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); -- term.alt[i] = xrealloc(term.alt[i], col * sizeof(Glyph)); -- } -- -- /* allocate any new rows */ -- for (/* i = minrow */; i < row; i++) { -- term.line[i] = xmalloc(col * sizeof(Glyph)); -- term.alt[i] = xmalloc(col * sizeof(Glyph)); -- } -+ /* fix tabstops */ - if (col > term.col) { - bp = term.tabs + term.col; - -@@ -2614,26 +2741,16 @@ tresize(int col, int row) - for (bp += tabspaces; bp < term.tabs + col; bp += tabspaces) - *bp = 1; - } -+ - /* update terminal size */ - term.col = col; - term.row = row; -+ term.linelen = linelen; - /* reset scrolling region */ - tsetscroll(0, row-1); - /* make use of the LIMIT in tmoveto */ - tmoveto(term.c.x, term.c.y); -- /* Clearing both screens (it makes dirty all lines) */ -- c = term.c; -- for (i = 0; i < 2; i++) { -- if (mincol < col && 0 < minrow) { -- tclearregion(mincol, 0, col - 1, minrow - 1); -- } -- if (0 < col && minrow < row) { -- tclearregion(0, minrow, col - 1, row - 1); -- } -- tswapscreen(); -- tcursor(CURSOR_LOAD); -- } -- term.c = c; -+ tfulldirt(); - } - - void -@@ -2645,14 +2762,15 @@ resettitle(void) - void - drawregion(int x1, int y1, int x2, int y2) - { -- int y; -+ int y, L; - -+ L = TLINEOFFSET(y1); - for (y = y1; y < y2; y++) { -- if (!term.dirty[y]) -- continue; -- -- term.dirty[y] = 0; -- xdrawline(term.line[y], x1, y, x2); -+ if (term.dirty[y]) { -+ term.dirty[y] = 0; -+ xdrawline(TSCREEN.buffer[L], x1, y, x2); -+ } -+ L = (L + 1) % TSCREEN.size; - } - } - -@@ -2667,14 +2785,15 @@ draw(void) - /* adjust cursor position */ - LIMIT(term.ocx, 0, term.col-1); - LIMIT(term.ocy, 0, term.row-1); -- if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY) -+ if (TLINE(term.ocy)[term.ocx].mode & ATTR_WDUMMY) - term.ocx--; -- if (term.line[term.c.y][cx].mode & ATTR_WDUMMY) -+ if (TLINE(term.c.y)[cx].mode & ATTR_WDUMMY) - cx--; - - drawregion(0, 0, term.col, term.row); -- xdrawcursor(cx, term.c.y, term.line[term.c.y][cx], -- term.ocx, term.ocy, term.line[term.ocy][term.ocx]); -+ if (TSCREEN.off == 0) -+ xdrawcursor(cx, term.c.y, TLINE(term.c.y)[cx], -+ term.ocx, term.ocy, TLINE(term.ocy)[term.ocx]); - term.ocx = cx; - term.ocy = term.c.y; - xfinishdraw(); -diff --git a/st.h b/st.h -index 519b9bd..b48e810 100644 ---- a/st.h -+++ b/st.h -@@ -19,6 +19,7 @@ - - #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) - #define IS_TRUECOL(x) (1 << 24 & (x)) -+#define HISTSIZE 2000 - - enum glyph_attribute { - ATTR_NULL = 0, -diff --git a/x.c b/x.c -index 8a16faa..1bb5853 100644 ---- a/x.c -+++ b/x.c -@@ -59,6 +59,8 @@ static void zoom(const Arg *); - static void zoomabs(const Arg *); - static void zoomreset(const Arg *); - static void ttysend(const Arg *); -+void kscrollup(const Arg *); -+void kscrolldown(const Arg *); - - /* config.h for applying patches and the configuration. */ - #include "config.h" diff --git a/dwm/st/st b/dwm/st/st deleted file mode 100755 index 2a9e424..0000000 Binary files a/dwm/st/st and /dev/null differ diff --git a/dwm/st/st.1 b/dwm/st/st.1 deleted file mode 100644 index 39120b4..0000000 --- a/dwm/st/st.1 +++ /dev/null @@ -1,177 +0,0 @@ -.TH ST 1 st\-VERSION -.SH NAME -st \- simple terminal -.SH SYNOPSIS -.B st -.RB [ \-aiv ] -.RB [ \-c -.IR class ] -.RB [ \-f -.IR font ] -.RB [ \-g -.IR geometry ] -.RB [ \-n -.IR name ] -.RB [ \-o -.IR iofile ] -.RB [ \-T -.IR title ] -.RB [ \-t -.IR title ] -.RB [ \-l -.IR line ] -.RB [ \-w -.IR windowid ] -.RB [[ \-e ] -.IR command -.RI [ arguments ...]] -.PP -.B st -.RB [ \-aiv ] -.RB [ \-c -.IR class ] -.RB [ \-f -.IR font ] -.RB [ \-g -.IR geometry ] -.RB [ \-n -.IR name ] -.RB [ \-o -.IR iofile ] -.RB [ \-T -.IR title ] -.RB [ \-t -.IR title ] -.RB [ \-w -.IR windowid ] -.RB \-l -.IR line -.RI [ stty_args ...] -.SH DESCRIPTION -.B st -is a simple terminal emulator. -.SH OPTIONS -.TP -.B \-a -disable alternate screens in terminal -.TP -.BI \-c " class" -defines the window class (default $TERM). -.TP -.BI \-f " font" -defines the -.I font -to use when st is run. -.TP -.BI \-g " geometry" -defines the X11 geometry string. -The form is [=][{xX}][{+-}{+-}]. See -.BR XParseGeometry (3) -for further details. -.TP -.B \-i -will fixate the position given with the -g option. -.TP -.BI \-n " name" -defines the window instance name (default $TERM). -.TP -.BI \-o " iofile" -writes all the I/O to -.I iofile. -This feature is useful when recording st sessions. A value of "-" means -standard output. -.TP -.BI \-T " title" -defines the window title (default 'st'). -.TP -.BI \-t " title" -defines the window title (default 'st'). -.TP -.BI \-w " windowid" -embeds st within the window identified by -.I windowid -.TP -.BI \-l " line" -use a tty -.I line -instead of a pseudo terminal. -.I line -should be a (pseudo-)serial device (e.g. /dev/ttyS0 on Linux for serial port -0). -When this flag is given -remaining arguments are used as flags for -.BR stty(1). -By default st initializes the serial line to 8 bits, no parity, 1 stop bit -and a 38400 baud rate. The speed is set by appending it as last argument -(e.g. 'st -l /dev/ttyS0 115200'). Arguments before the last one are -.BR stty(1) -flags. If you want to set odd parity on 115200 baud use for example 'st -l -/dev/ttyS0 parenb parodd 115200'. Set the number of bits by using for -example 'st -l /dev/ttyS0 cs7 115200'. See -.BR stty(1) -for more arguments and cases. -.TP -.B \-v -prints version information to stderr, then exits. -.TP -.BI \-e " command " [ " arguments " "... ]" -st executes -.I command -instead of the shell. If this is used it -.B must be the last option -on the command line, as in xterm / rxvt. -This option is only intended for compatibility, -and all the remaining arguments are used as a command -even without it. -.SH SHORTCUTS -.TP -.B Break -Send a break in the serial line. -Break key is obtained in PC keyboards -pressing at the same time control and pause. -.TP -.B Ctrl-Print Screen -Toggle if st should print to the -.I iofile. -.TP -.B Shift-Print Screen -Print the full screen to the -.I iofile. -.TP -.B Print Screen -Print the selection to the -.I iofile. -.TP -.B Ctrl-Shift-Page Up -Increase font size. -.TP -.B Ctrl-Shift-Page Down -Decrease font size. -.TP -.B Ctrl-Shift-Home -Reset to default font size. -.TP -.B Ctrl-Shift-y -Paste from primary selection (middle mouse button). -.TP -.B Ctrl-Shift-c -Copy the selected text to the clipboard selection. -.TP -.B Ctrl-Shift-v -Paste from the clipboard selection. -.SH CUSTOMIZATION -.B st -can be customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH AUTHORS -See the LICENSE file for the authors. -.SH LICENSE -See the LICENSE file for the terms of redistribution. -.SH SEE ALSO -.BR tabbed (1), -.BR utmp (1), -.BR stty (1), -.BR scroll (1) -.SH BUGS -See the TODO file in the distribution. - diff --git a/dwm/st/st.c b/dwm/st/st.c deleted file mode 100644 index c44797b..0000000 --- a/dwm/st/st.c +++ /dev/null @@ -1,2775 +0,0 @@ -/* See LICENSE for license details. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "st.h" -#include "win.h" - -#if defined(__linux) - #include -#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) - #include -#elif defined(__FreeBSD__) || defined(__DragonFly__) - #include -#endif - -/* Arbitrary sizes */ -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 -#define ESC_BUF_SIZ (128*UTF_SIZ) -#define ESC_ARG_SIZ 16 -#define STR_BUF_SIZ ESC_BUF_SIZ -#define STR_ARG_SIZ ESC_ARG_SIZ - -/* macros */ -#define IS_SET(flag) ((term.mode & (flag)) != 0) -#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == 0x7f) -#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) -#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) -#define ISDELIM(u) (u && wcschr(worddelimiters, u)) - -#define TSCREEN term.screen[IS_SET(MODE_ALTSCREEN)] -#define TLINEOFFSET(y) (((y) + TSCREEN.cur - TSCREEN.off + TSCREEN.size) % TSCREEN.size) -#define TLINE(y) (TSCREEN.buffer[TLINEOFFSET(y)]) - -enum term_mode { - MODE_WRAP = 1 << 0, - MODE_INSERT = 1 << 1, - MODE_ALTSCREEN = 1 << 2, - MODE_CRLF = 1 << 3, - MODE_ECHO = 1 << 4, - MODE_PRINT = 1 << 5, - MODE_UTF8 = 1 << 6, -}; - -enum cursor_movement { - CURSOR_SAVE, - CURSOR_LOAD -}; - -enum cursor_state { - CURSOR_DEFAULT = 0, - CURSOR_WRAPNEXT = 1, - CURSOR_ORIGIN = 2 -}; - -enum charset { - CS_GRAPHIC0, - CS_GRAPHIC1, - CS_UK, - CS_USA, - CS_MULTI, - CS_GER, - CS_FIN -}; - -enum escape_state { - ESC_START = 1, - ESC_CSI = 2, - ESC_STR = 4, /* DCS, OSC, PM, APC */ - ESC_ALTCHARSET = 8, - ESC_STR_END = 16, /* a final string was encountered */ - ESC_TEST = 32, /* Enter in test mode */ - ESC_UTF8 = 64, -}; - -typedef struct { - Glyph attr; /* current char attributes */ - int x; - int y; - char state; -} TCursor; - -typedef struct { - int mode; - int type; - int snap; - /* - * Selection variables: - * nb – normalized coordinates of the beginning of the selection - * ne – normalized coordinates of the end of the selection - * ob – original coordinates of the beginning of the selection - * oe – original coordinates of the end of the selection - */ - struct { - int x, y; - } nb, ne, ob, oe; - - int alt; -} Selection; - -/* Screen lines */ -typedef struct { - Line* buffer; /* ring buffer */ - int size; /* size of buffer */ - int cur; /* start of active screen */ - int off; /* scrollback line offset */ - TCursor sc; /* saved cursor */ -} LineBuffer; - -/* Internal representation of the screen */ -typedef struct { - int row; /* nb row */ - int col; /* nb col */ - LineBuffer screen[2]; /* screen and alternate screen */ - int linelen; /* allocated line length */ - int *dirty; /* dirtyness of lines */ - TCursor c; /* cursor */ - int ocx; /* old cursor col */ - int ocy; /* old cursor row */ - int top; /* top scroll limit */ - int bot; /* bottom scroll limit */ - int mode; /* terminal mode flags */ - int esc; /* escape state flags */ - char trantbl[4]; /* charset table translation */ - int charset; /* current charset */ - int icharset; /* selected charset for sequence */ - int *tabs; - Rune lastc; /* last printed char outside of sequence, 0 if control */ -} Term; - -/* CSI Escape sequence structs */ -/* ESC '[' [[ [] [;]] []] */ -typedef struct { - char buf[ESC_BUF_SIZ]; /* raw string */ - size_t len; /* raw string length */ - char priv; - int arg[ESC_ARG_SIZ]; - int narg; /* nb of args */ - char mode[2]; -} CSIEscape; - -/* STR Escape sequence structs */ -/* ESC type [[ [] [;]] ] ESC '\' */ -typedef struct { - char type; /* ESC type ... */ - char *buf; /* allocated raw string */ - size_t siz; /* allocation size */ - size_t len; /* raw string length */ - char *args[STR_ARG_SIZ]; - int narg; /* nb of args */ -} STREscape; - -static void execsh(char *, char **); -static void stty(char **); -static void sigchld(int); -static void ttywriteraw(const char *, size_t); - -static void csidump(void); -static void csihandle(void); -static void csiparse(void); -static void csireset(void); -static void osc_color_response(int, int, int); -static int eschandle(uchar); -static void strdump(void); -static void strhandle(void); -static void strparse(void); -static void strreset(void); - -static void tprinter(char *, size_t); -static void tdumpsel(void); -static void tdumpline(int); -static void tdump(void); -static void tclearregion(int, int, int, int); -static void tcursor(int); -static void tdeletechar(int); -static void tdeleteline(int); -static void tinsertblank(int); -static void tinsertblankline(int); -static int tlinelen(int); -static void tmoveto(int, int); -static void tmoveato(int, int); -static void tnewline(int); -static void tputtab(int); -static void tputc(Rune); -static void treset(void); -static void tscrollup(int, int); -static void tscrolldown(int, int); -static void tsetattr(const int *, int); -static void tsetchar(Rune, const Glyph *, int, int); -static void tsetdirt(int, int); -static void tsetscroll(int, int); -static void tswapscreen(void); -static void tsetmode(int, int, const int *, int); -static int twrite(const char *, int, int); -static void tfulldirt(void); -static void tcontrolcode(uchar ); -static void tdectest(char ); -static void tdefutf8(char); -static int32_t tdefcolor(const int *, int *, int); -static void tdeftran(char); -static void tstrsequence(uchar); - -static void drawregion(int, int, int, int); -static void clearline(Line, Glyph, int, int); -static Line ensureline(Line); - -static void selnormalize(void); -static void selscroll(int, int); -static void selsnap(int *, int *, int); - -static size_t utf8decode(const char *, Rune *, size_t); -static Rune utf8decodebyte(char, size_t *); -static char utf8encodebyte(Rune, size_t); -static size_t utf8validate(Rune *, size_t); - -static char *base64dec(const char *); -static char base64dec_getc(const char **); - -static ssize_t xwrite(int, const char *, size_t); - -/* Globals */ -static Term term; -static Selection sel; -static CSIEscape csiescseq; -static STREscape strescseq; -static int iofd = 1; -static int cmdfd; -static pid_t pid; - -static const uchar utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const uchar utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const Rune utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -ssize_t -xwrite(int fd, const char *s, size_t len) -{ - size_t aux = len; - ssize_t r; - - while (len > 0) { - r = write(fd, s, len); - if (r < 0) - return r; - len -= r; - s += r; - } - - return aux; -} - -void * -xmalloc(size_t len) -{ - void *p; - - if (!(p = malloc(len))) - die("malloc: %s\n", strerror(errno)); - - return p; -} - -void * -xrealloc(void *p, size_t len) -{ - if ((p = realloc(p, len)) == NULL) - die("realloc: %s\n", strerror(errno)); - - return p; -} - -char * -xstrdup(const char *s) -{ - char *p; - - if ((p = strdup(s)) == NULL) - die("strdup: %s\n", strerror(errno)); - - return p; -} - -size_t -utf8decode(const char *c, Rune *u, size_t clen) -{ - size_t i, j, len, type; - Rune udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type != 0) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Rune -utf8decodebyte(char c, size_t *i) -{ - for (*i = 0; *i < LEN(utfmask); ++(*i)) - if (((uchar)c & utfmask[*i]) == utfbyte[*i]) - return (uchar)c & ~utfmask[*i]; - - return 0; -} - -size_t -utf8encode(Rune u, char *c) -{ - size_t len, i; - - len = utf8validate(&u, 0); - if (len > UTF_SIZ) - return 0; - - for (i = len - 1; i != 0; --i) { - c[i] = utf8encodebyte(u, 0); - u >>= 6; - } - c[0] = utf8encodebyte(u, len); - - return len; -} - -char -utf8encodebyte(Rune u, size_t i) -{ - return utfbyte[i] | (u & ~utfmask[i]); -} - -size_t -utf8validate(Rune *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - - return i; -} - -char -base64dec_getc(const char **src) -{ - while (**src && !isprint((unsigned char)**src)) - (*src)++; - return **src ? *((*src)++) : '='; /* emulate padding if string ends */ -} - -char * -base64dec(const char *src) -{ - size_t in_len = strlen(src); - char *result, *dst; - static const char base64_digits[256] = { - [43] = 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, - 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 - }; - - if (in_len % 4) - in_len += 4 - (in_len % 4); - result = dst = xmalloc(in_len / 4 * 3 + 1); - while (*src) { - int a = base64_digits[(unsigned char) base64dec_getc(&src)]; - int b = base64_digits[(unsigned char) base64dec_getc(&src)]; - int c = base64_digits[(unsigned char) base64dec_getc(&src)]; - int d = base64_digits[(unsigned char) base64dec_getc(&src)]; - - /* invalid input. 'a' can be -1, e.g. if src is "\n" (c-str) */ - if (a == -1 || b == -1) - break; - - *dst++ = (a << 2) | ((b & 0x30) >> 4); - if (c == -1) - break; - *dst++ = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); - if (d == -1) - break; - *dst++ = ((c & 0x03) << 6) | d; - } - *dst = '\0'; - return result; -} - -void -selinit(void) -{ - sel.mode = SEL_IDLE; - sel.snap = 0; - sel.ob.x = -1; -} - -int -tlinelen(int y) -{ - int i = term.col; - Line line = TLINE(y); - - if (line[i - 1].mode & ATTR_WRAP) - return i; - - while (i > 0 && line[i - 1].u == ' ') - --i; - - return i; -} - -void -selstart(int col, int row, int snap) -{ - selclear(); - sel.mode = SEL_EMPTY; - sel.type = SEL_REGULAR; - sel.alt = IS_SET(MODE_ALTSCREEN); - sel.snap = snap; - sel.oe.x = sel.ob.x = col; - sel.oe.y = sel.ob.y = row; - selnormalize(); - - if (sel.snap != 0) - sel.mode = SEL_READY; - tsetdirt(sel.nb.y, sel.ne.y); -} - -void -selextend(int col, int row, int type, int done) -{ - int oldey, oldex, oldsby, oldsey, oldtype; - - if (sel.mode == SEL_IDLE) - return; - if (done && sel.mode == SEL_EMPTY) { - selclear(); - return; - } - - oldey = sel.oe.y; - oldex = sel.oe.x; - oldsby = sel.nb.y; - oldsey = sel.ne.y; - oldtype = sel.type; - - sel.oe.x = col; - sel.oe.y = row; - selnormalize(); - sel.type = type; - - if (oldey != sel.oe.y || oldex != sel.oe.x || oldtype != sel.type || sel.mode == SEL_EMPTY) - tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey)); - - sel.mode = done ? SEL_IDLE : SEL_READY; -} - -void -selnormalize(void) -{ - int i; - - if (sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) { - sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x; - sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x; - } else { - sel.nb.x = MIN(sel.ob.x, sel.oe.x); - sel.ne.x = MAX(sel.ob.x, sel.oe.x); - } - sel.nb.y = MIN(sel.ob.y, sel.oe.y); - sel.ne.y = MAX(sel.ob.y, sel.oe.y); - - selsnap(&sel.nb.x, &sel.nb.y, -1); - selsnap(&sel.ne.x, &sel.ne.y, +1); - - /* expand selection over line breaks */ - if (sel.type == SEL_RECTANGULAR) - return; - i = tlinelen(sel.nb.y); - if (i < sel.nb.x) - sel.nb.x = i; - if (tlinelen(sel.ne.y) <= sel.ne.x) - sel.ne.x = term.col - 1; -} - -int -selected(int x, int y) -{ - if (sel.mode == SEL_EMPTY || sel.ob.x == -1 || - sel.alt != IS_SET(MODE_ALTSCREEN)) - return 0; - - if (sel.type == SEL_RECTANGULAR) - return BETWEEN(y, sel.nb.y, sel.ne.y) - && BETWEEN(x, sel.nb.x, sel.ne.x); - - return BETWEEN(y, sel.nb.y, sel.ne.y) - && (y != sel.nb.y || x >= sel.nb.x) - && (y != sel.ne.y || x <= sel.ne.x); -} - -void -selsnap(int *x, int *y, int direction) -{ - int newx, newy, xt, yt; - int delim, prevdelim; - const Glyph *gp, *prevgp; - - switch (sel.snap) { - case SNAP_WORD: - /* - * Snap around if the word wraps around at the end or - * beginning of a line. - */ - prevgp = &TLINE(*y)[*x]; - prevdelim = ISDELIM(prevgp->u); - for (;;) { - newx = *x + direction; - newy = *y; - if (!BETWEEN(newx, 0, term.col - 1)) { - newy += direction; - newx = (newx + term.col) % term.col; - if (!BETWEEN(newy, 0, term.row - 1)) - break; - - if (direction > 0) - yt = *y, xt = *x; - else - yt = newy, xt = newx; - if (!(TLINE(yt)[xt].mode & ATTR_WRAP)) - break; - } - - if (newx >= tlinelen(newy)) - break; - - gp = &TLINE(newy)[newx]; - delim = ISDELIM(gp->u); - if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim - || (delim && gp->u != prevgp->u))) - break; - - *x = newx; - *y = newy; - prevgp = gp; - prevdelim = delim; - } - break; - case SNAP_LINE: - /* - * Snap around if the the previous line or the current one - * has set ATTR_WRAP at its end. Then the whole next or - * previous line will be selected. - */ - *x = (direction < 0) ? 0 : term.col - 1; - if (direction < 0) { - for (; *y > 0; *y += direction) { - if (!(TLINE(*y-1)[term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } else if (direction > 0) { - for (; *y < term.row-1; *y += direction) { - if (!(TLINE(*y)[term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } - break; - } -} - -char * -getsel(void) -{ - char *str, *ptr; - int y, bufsize, lastx, linelen; - const Glyph *gp, *last; - - if (sel.ob.x == -1) - return NULL; - - bufsize = (term.col+1) * (sel.ne.y-sel.nb.y+1) * UTF_SIZ; - ptr = str = xmalloc(bufsize); - - /* append every set & selected glyph to the selection */ - for (y = sel.nb.y; y <= sel.ne.y; y++) { - if ((linelen = tlinelen(y)) == 0) { - *ptr++ = '\n'; - continue; - } - - if (sel.type == SEL_RECTANGULAR) { - gp = &TLINE(y)[sel.nb.x]; - lastx = sel.ne.x; - } else { - gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0]; - lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; - } - last = &TLINE(y)[MIN(lastx, linelen-1)]; - while (last >= gp && last->u == ' ') - --last; - - for ( ; gp <= last; ++gp) { - if (gp->mode & ATTR_WDUMMY) - continue; - - ptr += utf8encode(gp->u, ptr); - } - - /* - * Copy and pasting of line endings is inconsistent - * in the inconsistent terminal and GUI world. - * The best solution seems like to produce '\n' when - * something is copied from st and convert '\n' to - * '\r', when something to be pasted is received by - * st. - * FIXME: Fix the computer world. - */ - if ((y < sel.ne.y || lastx >= linelen) && - (!(last->mode & ATTR_WRAP) || sel.type == SEL_RECTANGULAR)) - *ptr++ = '\n'; - } - *ptr = 0; - return str; -} - -void -selclear(void) -{ - if (sel.ob.x == -1) - return; - sel.mode = SEL_IDLE; - sel.ob.x = -1; - tsetdirt(sel.nb.y, sel.ne.y); -} - -void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -void -execsh(char *cmd, char **args) -{ - char *sh, *prog, *arg; - const struct passwd *pw; - - errno = 0; - if ((pw = getpwuid(getuid())) == NULL) { - if (errno) - die("getpwuid: %s\n", strerror(errno)); - else - die("who are you?\n"); - } - - if ((sh = getenv("SHELL")) == NULL) - sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd; - - if (args) { - prog = args[0]; - arg = NULL; - } else if (scroll) { - prog = scroll; - arg = utmp ? utmp : sh; - } else if (utmp) { - prog = utmp; - arg = NULL; - } else { - prog = sh; - arg = NULL; - } - DEFAULT(args, ((char *[]) {prog, arg, NULL})); - - unsetenv("COLUMNS"); - unsetenv("LINES"); - unsetenv("TERMCAP"); - setenv("LOGNAME", pw->pw_name, 1); - setenv("USER", pw->pw_name, 1); - setenv("SHELL", sh, 1); - setenv("HOME", pw->pw_dir, 1); - setenv("TERM", termname, 1); - - signal(SIGCHLD, SIG_DFL); - signal(SIGHUP, SIG_DFL); - signal(SIGINT, SIG_DFL); - signal(SIGQUIT, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGALRM, SIG_DFL); - - execvp(prog, args); - _exit(1); -} - -void -sigchld(int a) -{ - int stat; - pid_t p; - - if ((p = waitpid(pid, &stat, WNOHANG)) < 0) - die("waiting for pid %hd failed: %s\n", pid, strerror(errno)); - - if (pid != p) - return; - - if (WIFEXITED(stat) && WEXITSTATUS(stat)) - die("child exited with status %d\n", WEXITSTATUS(stat)); - else if (WIFSIGNALED(stat)) - die("child terminated due to signal %d\n", WTERMSIG(stat)); - _exit(0); -} - -void -stty(char **args) -{ - char cmd[_POSIX_ARG_MAX], **p, *q, *s; - size_t n, siz; - - if ((n = strlen(stty_args)) > sizeof(cmd)-1) - die("incorrect stty parameters\n"); - memcpy(cmd, stty_args, n); - q = cmd + n; - siz = sizeof(cmd) - n; - for (p = args; p && (s = *p); ++p) { - if ((n = strlen(s)) > siz-1) - die("stty parameter length too long\n"); - *q++ = ' '; - memcpy(q, s, n); - q += n; - siz -= n + 1; - } - *q = '\0'; - if (system(cmd) != 0) - perror("Couldn't call stty"); -} - -int -ttynew(const char *line, char *cmd, const char *out, char **args) -{ - int m, s; - - if (out) { - term.mode |= MODE_PRINT; - iofd = (!strcmp(out, "-")) ? - 1 : open(out, O_WRONLY | O_CREAT, 0666); - if (iofd < 0) { - fprintf(stderr, "Error opening %s:%s\n", - out, strerror(errno)); - } - } - - if (line) { - if ((cmdfd = open(line, O_RDWR)) < 0) - die("open line '%s' failed: %s\n", - line, strerror(errno)); - dup2(cmdfd, 0); - stty(args); - return cmdfd; - } - - /* seems to work fine on linux, openbsd and freebsd */ - if (openpty(&m, &s, NULL, NULL, NULL) < 0) - die("openpty failed: %s\n", strerror(errno)); - - switch (pid = fork()) { - case -1: - die("fork failed: %s\n", strerror(errno)); - break; - case 0: - close(iofd); - close(m); - setsid(); /* create a new process group */ - dup2(s, 0); - dup2(s, 1); - dup2(s, 2); - if (ioctl(s, TIOCSCTTY, NULL) < 0) - die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); - if (s > 2) - close(s); -#ifdef __OpenBSD__ - if (pledge("stdio getpw proc exec", NULL) == -1) - die("pledge\n"); -#endif - execsh(cmd, args); - break; - default: -#ifdef __OpenBSD__ - if (pledge("stdio rpath tty proc", NULL) == -1) - die("pledge\n"); -#endif - close(s); - cmdfd = m; - signal(SIGCHLD, sigchld); - break; - } - return cmdfd; -} - -size_t -ttyread(void) -{ - static char buf[BUFSIZ]; - static int buflen = 0; - int ret, written; - - /* append read bytes to unprocessed bytes */ - ret = read(cmdfd, buf+buflen, LEN(buf)-buflen); - - switch (ret) { - case 0: - exit(0); - case -1: - die("couldn't read from shell: %s\n", strerror(errno)); - default: - buflen += ret; - written = twrite(buf, buflen, 0); - buflen -= written; - /* keep any incomplete UTF-8 byte sequence for the next call */ - if (buflen > 0) - memmove(buf, buf + written, buflen); - return ret; - } -} - -void -ttywrite(const char *s, size_t n, int may_echo) -{ - const char *next; - - if (may_echo && IS_SET(MODE_ECHO)) - twrite(s, n, 1); - - if (!IS_SET(MODE_CRLF)) { - ttywriteraw(s, n); - return; - } - - /* This is similar to how the kernel handles ONLCR for ttys */ - while (n > 0) { - if (*s == '\r') { - next = s + 1; - ttywriteraw("\r\n", 2); - } else { - next = memchr(s, '\r', n); - DEFAULT(next, s + n); - ttywriteraw(s, next - s); - } - n -= next - s; - s = next; - } -} - -void -ttywriteraw(const char *s, size_t n) -{ - fd_set wfd, rfd; - ssize_t r; - size_t lim = 256; - - /* - * Remember that we are using a pty, which might be a modem line. - * Writing too much will clog the line. That's why we are doing this - * dance. - * FIXME: Migrate the world to Plan 9. - */ - while (n > 0) { - FD_ZERO(&wfd); - FD_ZERO(&rfd); - FD_SET(cmdfd, &wfd); - FD_SET(cmdfd, &rfd); - - /* Check if we can write. */ - if (pselect(cmdfd+1, &rfd, &wfd, NULL, NULL, NULL) < 0) { - if (errno == EINTR) - continue; - die("select failed: %s\n", strerror(errno)); - } - if (FD_ISSET(cmdfd, &wfd)) { - /* - * Only write the bytes written by ttywrite() or the - * default of 256. This seems to be a reasonable value - * for a serial line. Bigger values might clog the I/O. - */ - if ((r = write(cmdfd, s, (n < lim)? n : lim)) < 0) - goto write_error; - if (r < n) { - /* - * We weren't able to write out everything. - * This means the buffer is getting full - * again. Empty it. - */ - if (n < lim) - lim = ttyread(); - n -= r; - s += r; - } else { - /* All bytes have been written. */ - break; - } - } - if (FD_ISSET(cmdfd, &rfd)) - lim = ttyread(); - } - return; - -write_error: - die("write error on tty: %s\n", strerror(errno)); -} - -void -ttyresize(int tw, int th) -{ - struct winsize w; - - w.ws_row = term.row; - w.ws_col = term.col; - w.ws_xpixel = tw; - w.ws_ypixel = th; - if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0) - fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno)); -} - -void -ttyhangup(void) -{ - /* Send SIGHUP to shell */ - kill(pid, SIGHUP); -} - -int -tattrset(int attr) -{ - int i, j; - int y = TLINEOFFSET(0); - - for (i = 0; i < term.row-1; i++) { - Line line = TSCREEN.buffer[y]; - for (j = 0; j < term.col-1; j++) { - if (line[j].mode & attr) - return 1; - } - y = (y+1) % TSCREEN.size; - } - - return 0; -} - -void -tsetdirt(int top, int bot) -{ - int i; - - LIMIT(top, 0, term.row-1); - LIMIT(bot, 0, term.row-1); - - for (i = top; i <= bot; i++) - term.dirty[i] = 1; -} - -void -tsetdirtattr(int attr) -{ - int i, j; - int y = TLINEOFFSET(0); - - for (i = 0; i < term.row-1; i++) { - Line line = TSCREEN.buffer[y]; - for (j = 0; j < term.col-1; j++) { - if (line[j].mode & attr) { - tsetdirt(i, i); - break; - } - } - y = (y+1) % TSCREEN.size; - } -} - -void -tfulldirt(void) -{ - tsetdirt(0, term.row-1); -} - -void -tcursor(int mode) -{ - if (mode == CURSOR_SAVE) { - TSCREEN.sc = term.c; - } else if (mode == CURSOR_LOAD) { - term.c = TSCREEN.sc; - tmoveto(term.c.x, term.c.y); - } -} - -void -treset(void) -{ - int i, j; - Glyph g = (Glyph){ .fg = defaultfg, .bg = defaultbg}; - - memset(term.tabs, 0, term.col * sizeof(*term.tabs)); - for (i = tabspaces; i < term.col; i += tabspaces) - term.tabs[i] = 1; - term.top = 0; - term.bot = term.row - 1; - term.mode = MODE_WRAP|MODE_UTF8; - memset(term.trantbl, CS_USA, sizeof(term.trantbl)); - term.charset = 0; - - for (i = 0; i < 2; i++) { - term.screen[i].sc = (TCursor){{ - .fg = defaultfg, - .bg = defaultbg - }}; - term.screen[i].cur = 0; - term.screen[i].off = 0; - for (j = 0; j < term.row; ++j) { - if (term.col != term.linelen) - term.screen[i].buffer[j] = xrealloc(term.screen[i].buffer[j], term.col * sizeof(Glyph)); - clearline(term.screen[i].buffer[j], g, 0, term.col); - } - for (j = term.row; j < term.screen[i].size; ++j) { - free(term.screen[i].buffer[j]); - term.screen[i].buffer[j] = NULL; - } - } - tcursor(CURSOR_LOAD); - term.linelen = term.col; - tfulldirt(); -} - -void -tnew(int col, int row) -{ - int i; - term = (Term){}; - term.screen[0].buffer = xmalloc(HISTSIZE * sizeof(Line)); - term.screen[0].size = HISTSIZE; - term.screen[1].buffer = NULL; - for (i = 0; i < HISTSIZE; ++i) term.screen[0].buffer[i] = NULL; - - tresize(col, row); - treset(); -} - -void -tswapscreen(void) -{ - term.mode ^= MODE_ALTSCREEN; - tfulldirt(); -} - -void -kscrollup(const Arg *a) -{ - int n = a->i; - - if (IS_SET(MODE_ALTSCREEN)) - return; - - if (n < 0) n = (-n) * term.row; - if (n > TSCREEN.size - term.row - TSCREEN.off) n = TSCREEN.size - term.row - TSCREEN.off; - while (!TLINE(-n)) --n; - TSCREEN.off += n; - selscroll(0, n); - tfulldirt(); -} - -void -kscrolldown(const Arg *a) -{ - - int n = a->i; - - if (IS_SET(MODE_ALTSCREEN)) - return; - - if (n < 0) n = (-n) * term.row; - if (n > TSCREEN.off) n = TSCREEN.off; - TSCREEN.off -= n; - selscroll(0, -n); - tfulldirt(); -} - -void -tscrolldown(int orig, int n) -{ - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - - /* Ensure that lines are allocated */ - for (i = -n; i < 0; i++) { - TLINE(i) = ensureline(TLINE(i)); - } - - /* Shift non-scrolling areas in ring buffer */ - for (i = term.bot+1; i < term.row; i++) { - temp = TLINE(i); - TLINE(i) = TLINE(i-n); - TLINE(i-n) = temp; - } - for (i = 0; i < orig; i++) { - temp = TLINE(i); - TLINE(i) = TLINE(i-n); - TLINE(i-n) = temp; - } - - /* Scroll buffer */ - TSCREEN.cur = (TSCREEN.cur + TSCREEN.size - n) % TSCREEN.size; - /* Clear lines that have entered the view */ - tclearregion(0, orig, term.linelen-1, orig+n-1); - /* Redraw portion of the screen that has scrolled */ - tsetdirt(orig+n-1, term.bot); - selscroll(orig, n); -} - -void -tscrollup(int orig, int n) -{ - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - - /* Ensure that lines are allocated */ - for (i = term.row; i < term.row + n; i++) { - TLINE(i) = ensureline(TLINE(i)); - } - - /* Shift non-scrolling areas in ring buffer */ - for (i = orig-1; i >= 0; i--) { - temp = TLINE(i); - TLINE(i) = TLINE(i+n); - TLINE(i+n) = temp; - } - for (i = term.row-1; i >term.bot; i--) { - temp = TLINE(i); - TLINE(i) = TLINE(i+n); - TLINE(i+n) = temp; - } - - /* Scroll buffer */ - TSCREEN.cur = (TSCREEN.cur + n) % TSCREEN.size; - /* Clear lines that have entered the view */ - tclearregion(0, term.bot-n+1, term.linelen-1, term.bot); - /* Redraw portion of the screen that has scrolled */ - tsetdirt(orig, term.bot-n+1); - selscroll(orig, -n); -} - -void -selscroll(int orig, int n) -{ - if (sel.ob.x == -1) - return; - - if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) { - selclear(); - } else if (BETWEEN(sel.nb.y, orig, term.bot)) { - sel.ob.y += n; - sel.oe.y += n; - if (sel.ob.y < term.top || sel.ob.y > term.bot || - sel.oe.y < term.top || sel.oe.y > term.bot) { - selclear(); - } else { - selnormalize(); - } - } -} - -void -tnewline(int first_col) -{ - int y = term.c.y; - - if (y == term.bot) { - tscrollup(term.top, 1); - } else { - y++; - } - tmoveto(first_col ? 0 : term.c.x, y); -} - -void -csiparse(void) -{ - char *p = csiescseq.buf, *np; - long int v; - - csiescseq.narg = 0; - if (*p == '?') { - csiescseq.priv = 1; - p++; - } - - csiescseq.buf[csiescseq.len] = '\0'; - while (p < csiescseq.buf+csiescseq.len) { - np = NULL; - v = strtol(p, &np, 10); - if (np == p) - v = 0; - if (v == LONG_MAX || v == LONG_MIN) - v = -1; - csiescseq.arg[csiescseq.narg++] = v; - p = np; - if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) - break; - p++; - } - csiescseq.mode[0] = *p++; - csiescseq.mode[1] = (p < csiescseq.buf+csiescseq.len) ? *p : '\0'; -} - -/* for absolute user moves, when decom is set */ -void -tmoveato(int x, int y) -{ - tmoveto(x, y + ((term.c.state & CURSOR_ORIGIN) ? term.top: 0)); -} - -void -tmoveto(int x, int y) -{ - int miny, maxy; - - if (term.c.state & CURSOR_ORIGIN) { - miny = term.top; - maxy = term.bot; - } else { - miny = 0; - maxy = term.row - 1; - } - term.c.state &= ~CURSOR_WRAPNEXT; - term.c.x = LIMIT(x, 0, term.col-1); - term.c.y = LIMIT(y, miny, maxy); -} - -void -tsetchar(Rune u, const Glyph *attr, int x, int y) -{ - static const char *vt100_0[62] = { /* 0x41 - 0x7e */ - "↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */ - 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ - 0, 0, 0, 0, 0, 0, 0, 0, /* P - W */ - 0, 0, 0, 0, 0, 0, 0, " ", /* X - _ */ - "◆", "▒", "␉", "␌", "␍", "␊", "°", "±", /* ` - g */ - "␤", "␋", "┘", "┐", "┌", "└", "┼", "⎺", /* h - o */ - "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", /* p - w */ - "│", "≤", "≥", "π", "≠", "£", "·", /* x - ~ */ - }; - Line line = TLINE(y); - - /* - * The table is proudly stolen from rxvt. - */ - if (term.trantbl[term.charset] == CS_GRAPHIC0 && - BETWEEN(u, 0x41, 0x7e) && vt100_0[u - 0x41]) - utf8decode(vt100_0[u - 0x41], &u, UTF_SIZ); - - if (line[x].mode & ATTR_WIDE) { - if (x+1 < term.col) { - line[x+1].u = ' '; - line[x+1].mode &= ~ATTR_WDUMMY; - } - } else if (line[x].mode & ATTR_WDUMMY) { - line[x-1].u = ' '; - line[x-1].mode &= ~ATTR_WIDE; - } - - term.dirty[y] = 1; - line[x] = *attr; - line[x].u = u; -} - -void -tclearregion(int x1, int y1, int x2, int y2) -{ - int x, y, L, S, temp; - Glyph *gp; - - if (x1 > x2) - temp = x1, x1 = x2, x2 = temp; - if (y1 > y2) - temp = y1, y1 = y2, y2 = temp; - - LIMIT(x1, 0, term.linelen-1); - LIMIT(x2, 0, term.linelen-1); - LIMIT(y1, 0, term.row-1); - LIMIT(y2, 0, term.row-1); - - L = TLINEOFFSET(y1); - for (y = y1; y <= y2; y++) { - term.dirty[y] = 1; - for (x = x1; x <= x2; x++) { - gp = &TSCREEN.buffer[L][x]; - if (selected(x, y)) - selclear(); - gp->fg = term.c.attr.fg; - gp->bg = term.c.attr.bg; - gp->mode = 0; - gp->u = ' '; - } - L = (L + 1) % TSCREEN.size; - } -} - -void -tdeletechar(int n) -{ - int dst, src, size; - Glyph *line; - - LIMIT(n, 0, term.col - term.c.x); - - dst = term.c.x; - src = term.c.x + n; - size = term.col - src; - line = TLINE(term.c.y); - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); -} - -void -tinsertblank(int n) -{ - int dst, src, size; - Glyph *line; - - LIMIT(n, 0, term.col - term.c.x); - - dst = term.c.x + n; - src = term.c.x; - size = term.col - dst; - line = TLINE(term.c.y); - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(src, term.c.y, dst - 1, term.c.y); -} - -void -tinsertblankline(int n) -{ - if (BETWEEN(term.c.y, term.top, term.bot)) - tscrolldown(term.c.y, n); -} - -void -tdeleteline(int n) -{ - if (BETWEEN(term.c.y, term.top, term.bot)) - tscrollup(term.c.y, n); -} - -int32_t -tdefcolor(const int *attr, int *npar, int l) -{ - int32_t idx = -1; - uint r, g, b; - - switch (attr[*npar + 1]) { - case 2: /* direct color in RGB space */ - if (*npar + 4 >= l) { - fprintf(stderr, - "erresc(38): Incorrect number of parameters (%d)\n", - *npar); - break; - } - r = attr[*npar + 2]; - g = attr[*npar + 3]; - b = attr[*npar + 4]; - *npar += 4; - if (!BETWEEN(r, 0, 255) || !BETWEEN(g, 0, 255) || !BETWEEN(b, 0, 255)) - fprintf(stderr, "erresc: bad rgb color (%u,%u,%u)\n", - r, g, b); - else - idx = TRUECOLOR(r, g, b); - break; - case 5: /* indexed color */ - if (*npar + 2 >= l) { - fprintf(stderr, - "erresc(38): Incorrect number of parameters (%d)\n", - *npar); - break; - } - *npar += 2; - if (!BETWEEN(attr[*npar], 0, 255)) - fprintf(stderr, "erresc: bad fgcolor %d\n", attr[*npar]); - else - idx = attr[*npar]; - break; - case 0: /* implemented defined (only foreground) */ - case 1: /* transparent */ - case 3: /* direct color in CMY space */ - case 4: /* direct color in CMYK space */ - default: - fprintf(stderr, - "erresc(38): gfx attr %d unknown\n", attr[*npar]); - break; - } - - return idx; -} - -void -tsetattr(const int *attr, int l) -{ - int i; - int32_t idx; - - for (i = 0; i < l; i++) { - switch (attr[i]) { - case 0: - term.c.attr.mode &= ~( - ATTR_BOLD | - ATTR_FAINT | - ATTR_ITALIC | - ATTR_UNDERLINE | - ATTR_BLINK | - ATTR_REVERSE | - ATTR_INVISIBLE | - ATTR_STRUCK ); - term.c.attr.fg = defaultfg; - term.c.attr.bg = defaultbg; - break; - case 1: - term.c.attr.mode |= ATTR_BOLD; - break; - case 2: - term.c.attr.mode |= ATTR_FAINT; - break; - case 3: - term.c.attr.mode |= ATTR_ITALIC; - break; - case 4: - term.c.attr.mode |= ATTR_UNDERLINE; - break; - case 5: /* slow blink */ - /* FALLTHROUGH */ - case 6: /* rapid blink */ - term.c.attr.mode |= ATTR_BLINK; - break; - case 7: - term.c.attr.mode |= ATTR_REVERSE; - break; - case 8: - term.c.attr.mode |= ATTR_INVISIBLE; - break; - case 9: - term.c.attr.mode |= ATTR_STRUCK; - break; - case 22: - term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT); - break; - case 23: - term.c.attr.mode &= ~ATTR_ITALIC; - break; - case 24: - term.c.attr.mode &= ~ATTR_UNDERLINE; - break; - case 25: - term.c.attr.mode &= ~ATTR_BLINK; - break; - case 27: - term.c.attr.mode &= ~ATTR_REVERSE; - break; - case 28: - term.c.attr.mode &= ~ATTR_INVISIBLE; - break; - case 29: - term.c.attr.mode &= ~ATTR_STRUCK; - break; - case 38: - if ((idx = tdefcolor(attr, &i, l)) >= 0) - term.c.attr.fg = idx; - break; - case 39: - term.c.attr.fg = defaultfg; - break; - case 48: - if ((idx = tdefcolor(attr, &i, l)) >= 0) - term.c.attr.bg = idx; - break; - case 49: - term.c.attr.bg = defaultbg; - break; - default: - if (BETWEEN(attr[i], 30, 37)) { - term.c.attr.fg = attr[i] - 30; - } else if (BETWEEN(attr[i], 40, 47)) { - term.c.attr.bg = attr[i] - 40; - } else if (BETWEEN(attr[i], 90, 97)) { - term.c.attr.fg = attr[i] - 90 + 8; - } else if (BETWEEN(attr[i], 100, 107)) { - term.c.attr.bg = attr[i] - 100 + 8; - } else { - fprintf(stderr, - "erresc(default): gfx attr %d unknown\n", - attr[i]); - csidump(); - } - break; - } - } -} - -void -tsetscroll(int t, int b) -{ - int temp; - - LIMIT(t, 0, term.row-1); - LIMIT(b, 0, term.row-1); - if (t > b) { - temp = t; - t = b; - b = temp; - } - term.top = t; - term.bot = b; -} - -void -tsetmode(int priv, int set, const int *args, int narg) -{ - int alt; const int *lim; - - for (lim = args + narg; args < lim; ++args) { - if (priv) { - switch (*args) { - case 1: /* DECCKM -- Cursor key */ - xsetmode(set, MODE_APPCURSOR); - break; - case 5: /* DECSCNM -- Reverse video */ - xsetmode(set, MODE_REVERSE); - break; - case 6: /* DECOM -- Origin */ - MODBIT(term.c.state, set, CURSOR_ORIGIN); - tmoveato(0, 0); - break; - case 7: /* DECAWM -- Auto wrap */ - MODBIT(term.mode, set, MODE_WRAP); - break; - case 0: /* Error (IGNORED) */ - case 2: /* DECANM -- ANSI/VT52 (IGNORED) */ - case 3: /* DECCOLM -- Column (IGNORED) */ - case 4: /* DECSCLM -- Scroll (IGNORED) */ - case 8: /* DECARM -- Auto repeat (IGNORED) */ - case 18: /* DECPFF -- Printer feed (IGNORED) */ - case 19: /* DECPEX -- Printer extent (IGNORED) */ - case 42: /* DECNRCM -- National characters (IGNORED) */ - case 12: /* att610 -- Start blinking cursor (IGNORED) */ - break; - case 25: /* DECTCEM -- Text Cursor Enable Mode */ - xsetmode(!set, MODE_HIDE); - break; - case 9: /* X10 mouse compatibility mode */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEX10); - break; - case 1000: /* 1000: report button press */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEBTN); - break; - case 1002: /* 1002: report motion on button press */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEMOTION); - break; - case 1003: /* 1003: enable all mouse motions */ - xsetpointermotion(set); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEMANY); - break; - case 1004: /* 1004: send focus events to tty */ - xsetmode(set, MODE_FOCUS); - break; - case 1006: /* 1006: extended reporting mode */ - xsetmode(set, MODE_MOUSESGR); - break; - case 1034: - xsetmode(set, MODE_8BIT); - break; - case 1049: /* swap screen & set/restore cursor as xterm */ - if (!allowaltscreen) - break; - tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); - /* FALLTHROUGH */ - case 47: /* swap screen */ - case 1047: - if (!allowaltscreen) - break; - alt = IS_SET(MODE_ALTSCREEN); - if (alt) { - tclearregion(0, 0, term.col-1, - term.row-1); - } - if (set ^ alt) /* set is always 1 or 0 */ - tswapscreen(); - if (*args != 1049) - break; - /* FALLTHROUGH */ - case 1048: - tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); - break; - case 2004: /* 2004: bracketed paste mode */ - xsetmode(set, MODE_BRCKTPASTE); - break; - /* Not implemented mouse modes. See comments there. */ - case 1001: /* mouse highlight mode; can hang the - terminal by design when implemented. */ - case 1005: /* UTF-8 mouse mode; will confuse - applications not supporting UTF-8 - and luit. */ - case 1015: /* urxvt mangled mouse mode; incompatible - and can be mistaken for other control - codes. */ - break; - default: - fprintf(stderr, - "erresc: unknown private set/reset mode %d\n", - *args); - break; - } - } else { - switch (*args) { - case 0: /* Error (IGNORED) */ - break; - case 2: - xsetmode(set, MODE_KBDLOCK); - break; - case 4: /* IRM -- Insertion-replacement */ - MODBIT(term.mode, set, MODE_INSERT); - break; - case 12: /* SRM -- Send/Receive */ - MODBIT(term.mode, !set, MODE_ECHO); - break; - case 20: /* LNM -- Linefeed/new line */ - MODBIT(term.mode, set, MODE_CRLF); - break; - default: - fprintf(stderr, - "erresc: unknown set/reset mode %d\n", - *args); - break; - } - } - } -} - -void -csihandle(void) -{ - char buf[40]; - int len; - - switch (csiescseq.mode[0]) { - default: - unknown: - fprintf(stderr, "erresc: unknown csi "); - csidump(); - /* die(""); */ - break; - case '@': /* ICH -- Insert blank char */ - DEFAULT(csiescseq.arg[0], 1); - tinsertblank(csiescseq.arg[0]); - break; - case 'A': /* CUU -- Cursor Up */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x, term.c.y-csiescseq.arg[0]); - break; - case 'B': /* CUD -- Cursor Down */ - case 'e': /* VPR --Cursor Down */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x, term.c.y+csiescseq.arg[0]); - break; - case 'i': /* MC -- Media Copy */ - switch (csiescseq.arg[0]) { - case 0: - tdump(); - break; - case 1: - tdumpline(term.c.y); - break; - case 2: - tdumpsel(); - break; - case 4: - term.mode &= ~MODE_PRINT; - break; - case 5: - term.mode |= MODE_PRINT; - break; - } - break; - case 'c': /* DA -- Device Attributes */ - if (csiescseq.arg[0] == 0) - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 'b': /* REP -- if last char is printable print it more times */ - DEFAULT(csiescseq.arg[0], 1); - if (term.lastc) - while (csiescseq.arg[0]-- > 0) - tputc(term.lastc); - break; - case 'C': /* CUF -- Cursor Forward */ - case 'a': /* HPR -- Cursor Forward */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x+csiescseq.arg[0], term.c.y); - break; - case 'D': /* CUB -- Cursor Backward */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x-csiescseq.arg[0], term.c.y); - break; - case 'E': /* CNL -- Cursor Down and first col */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(0, term.c.y+csiescseq.arg[0]); - break; - case 'F': /* CPL -- Cursor Up and first col */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(0, term.c.y-csiescseq.arg[0]); - break; - case 'g': /* TBC -- Tabulation clear */ - switch (csiescseq.arg[0]) { - case 0: /* clear current tab stop */ - term.tabs[term.c.x] = 0; - break; - case 3: /* clear all the tabs */ - memset(term.tabs, 0, term.col * sizeof(*term.tabs)); - break; - default: - goto unknown; - } - break; - case 'G': /* CHA -- Move to */ - case '`': /* HPA */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(csiescseq.arg[0]-1, term.c.y); - break; - case 'H': /* CUP -- Move to */ - case 'f': /* HVP */ - DEFAULT(csiescseq.arg[0], 1); - DEFAULT(csiescseq.arg[1], 1); - tmoveato(csiescseq.arg[1]-1, csiescseq.arg[0]-1); - break; - case 'I': /* CHT -- Cursor Forward Tabulation tab stops */ - DEFAULT(csiescseq.arg[0], 1); - tputtab(csiescseq.arg[0]); - break; - case 'J': /* ED -- Clear screen */ - switch (csiescseq.arg[0]) { - case 0: /* below */ - tclearregion(term.c.x, term.c.y, term.col-1, term.c.y); - if (term.c.y < term.row-1) { - tclearregion(0, term.c.y+1, term.col-1, - term.row-1); - } - break; - case 1: /* above */ - if (term.c.y > 1) - tclearregion(0, 0, term.col-1, term.c.y-1); - tclearregion(0, term.c.y, term.c.x, term.c.y); - break; - case 2: /* all */ - tclearregion(0, 0, term.col-1, term.row-1); - break; - default: - goto unknown; - } - break; - case 'K': /* EL -- Clear line */ - switch (csiescseq.arg[0]) { - case 0: /* right */ - tclearregion(term.c.x, term.c.y, term.col-1, - term.c.y); - break; - case 1: /* left */ - tclearregion(0, term.c.y, term.c.x, term.c.y); - break; - case 2: /* all */ - tclearregion(0, term.c.y, term.col-1, term.c.y); - break; - } - break; - case 'S': /* SU -- Scroll line up */ - DEFAULT(csiescseq.arg[0], 1); - tscrollup(term.top, csiescseq.arg[0]); - break; - case 'T': /* SD -- Scroll line down */ - DEFAULT(csiescseq.arg[0], 1); - tscrolldown(term.top, csiescseq.arg[0]); - break; - case 'L': /* IL -- Insert blank lines */ - DEFAULT(csiescseq.arg[0], 1); - tinsertblankline(csiescseq.arg[0]); - break; - case 'l': /* RM -- Reset Mode */ - tsetmode(csiescseq.priv, 0, csiescseq.arg, csiescseq.narg); - break; - case 'M': /* DL -- Delete lines */ - DEFAULT(csiescseq.arg[0], 1); - tdeleteline(csiescseq.arg[0]); - break; - case 'X': /* ECH -- Erase char */ - DEFAULT(csiescseq.arg[0], 1); - tclearregion(term.c.x, term.c.y, - term.c.x + csiescseq.arg[0] - 1, term.c.y); - break; - case 'P': /* DCH -- Delete char */ - DEFAULT(csiescseq.arg[0], 1); - tdeletechar(csiescseq.arg[0]); - break; - case 'Z': /* CBT -- Cursor Backward Tabulation tab stops */ - DEFAULT(csiescseq.arg[0], 1); - tputtab(-csiescseq.arg[0]); - break; - case 'd': /* VPA -- Move to */ - DEFAULT(csiescseq.arg[0], 1); - tmoveato(term.c.x, csiescseq.arg[0]-1); - break; - case 'h': /* SM -- Set terminal mode */ - tsetmode(csiescseq.priv, 1, csiescseq.arg, csiescseq.narg); - break; - case 'm': /* SGR -- Terminal attribute (color) */ - tsetattr(csiescseq.arg, csiescseq.narg); - break; - case 'n': /* DSR – Device Status Report (cursor position) */ - if (csiescseq.arg[0] == 6) { - len = snprintf(buf, sizeof(buf), "\033[%i;%iR", - term.c.y+1, term.c.x+1); - ttywrite(buf, len, 0); - } - break; - case 'r': /* DECSTBM -- Set Scrolling Region */ - if (csiescseq.priv) { - goto unknown; - } else { - DEFAULT(csiescseq.arg[0], 1); - DEFAULT(csiescseq.arg[1], term.row); - tsetscroll(csiescseq.arg[0]-1, csiescseq.arg[1]-1); - tmoveato(0, 0); - } - break; - case 's': /* DECSC -- Save cursor position (ANSI.SYS) */ - tcursor(CURSOR_SAVE); - break; - case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ - tcursor(CURSOR_LOAD); - break; - case ' ': - switch (csiescseq.mode[1]) { - case 'q': /* DECSCUSR -- Set Cursor Style */ - if (xsetcursor(csiescseq.arg[0])) - goto unknown; - break; - default: - goto unknown; - } - break; - } -} - -void -csidump(void) -{ - size_t i; - uint c; - - fprintf(stderr, "ESC["); - for (i = 0; i < csiescseq.len; i++) { - c = csiescseq.buf[i] & 0xff; - if (isprint(c)) { - putc(c, stderr); - } else if (c == '\n') { - fprintf(stderr, "(\\n)"); - } else if (c == '\r') { - fprintf(stderr, "(\\r)"); - } else if (c == 0x1b) { - fprintf(stderr, "(\\e)"); - } else { - fprintf(stderr, "(%02x)", c); - } - } - putc('\n', stderr); -} - -void -csireset(void) -{ - memset(&csiescseq, 0, sizeof(csiescseq)); -} - -void -osc_color_response(int num, int index, int is_osc4) -{ - int n; - char buf[32]; - unsigned char r, g, b; - - if (xgetcolor(is_osc4 ? num : index, &r, &g, &b)) { - fprintf(stderr, "erresc: failed to fetch %s color %d\n", - is_osc4 ? "osc4" : "osc", - is_osc4 ? num : index); - return; - } - - n = snprintf(buf, sizeof buf, "\033]%s%d;rgb:%02x%02x/%02x%02x/%02x%02x\007", - is_osc4 ? "4;" : "", num, r, r, g, g, b, b); - if (n < 0 || n >= sizeof(buf)) { - fprintf(stderr, "error: %s while printing %s response\n", - n < 0 ? "snprintf failed" : "truncation occurred", - is_osc4 ? "osc4" : "osc"); - } else { - ttywrite(buf, n, 1); - } -} - -void -strhandle(void) -{ - char *p = NULL, *dec; - int j, narg, par; - const struct { int idx; char *str; } osc_table[] = { - { defaultfg, "foreground" }, - { defaultbg, "background" }, - { defaultcs, "cursor" } - }; - - term.esc &= ~(ESC_STR_END|ESC_STR); - strparse(); - par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0; - - switch (strescseq.type) { - case ']': /* OSC -- Operating System Command */ - switch (par) { - case 0: - if (narg > 1) { - xsettitle(strescseq.args[1]); - xseticontitle(strescseq.args[1]); - } - return; - case 1: - if (narg > 1) - xseticontitle(strescseq.args[1]); - return; - case 2: - if (narg > 1) - xsettitle(strescseq.args[1]); - return; - case 52: - if (narg > 2 && allowwindowops) { - dec = base64dec(strescseq.args[2]); - if (dec) { - xsetsel(dec); - xclipcopy(); - } else { - fprintf(stderr, "erresc: invalid base64\n"); - } - } - return; - case 10: - case 11: - case 12: - if (narg < 2) - break; - p = strescseq.args[1]; - if ((j = par - 10) < 0 || j >= LEN(osc_table)) - break; /* shouldn't be possible */ - - if (!strcmp(p, "?")) { - osc_color_response(par, osc_table[j].idx, 0); - } else if (xsetcolorname(osc_table[j].idx, p)) { - fprintf(stderr, "erresc: invalid %s color: %s\n", - osc_table[j].str, p); - } else { - tfulldirt(); - } - return; - case 4: /* color set */ - if (narg < 3) - break; - p = strescseq.args[2]; - /* FALLTHROUGH */ - case 104: /* color reset */ - j = (narg > 1) ? atoi(strescseq.args[1]) : -1; - - if (p && !strcmp(p, "?")) { - osc_color_response(j, 0, 1); - } else if (xsetcolorname(j, p)) { - if (par == 104 && narg <= 1) - return; /* color reset without parameter */ - fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", - j, p ? p : "(null)"); - } else { - /* - * TODO if defaultbg color is changed, borders - * are dirty - */ - tfulldirt(); - } - return; - } - break; - case 'k': /* old title set compatibility */ - xsettitle(strescseq.args[0]); - return; - case 'P': /* DCS -- Device Control String */ - case '_': /* APC -- Application Program Command */ - case '^': /* PM -- Privacy Message */ - return; - } - - fprintf(stderr, "erresc: unknown str "); - strdump(); -} - -void -strparse(void) -{ - int c; - char *p = strescseq.buf; - - strescseq.narg = 0; - strescseq.buf[strescseq.len] = '\0'; - - if (*p == '\0') - return; - - while (strescseq.narg < STR_ARG_SIZ) { - strescseq.args[strescseq.narg++] = p; - while ((c = *p) != ';' && c != '\0') - ++p; - if (c == '\0') - return; - *p++ = '\0'; - } -} - -void -strdump(void) -{ - size_t i; - uint c; - - fprintf(stderr, "ESC%c", strescseq.type); - for (i = 0; i < strescseq.len; i++) { - c = strescseq.buf[i] & 0xff; - if (c == '\0') { - putc('\n', stderr); - return; - } else if (isprint(c)) { - putc(c, stderr); - } else if (c == '\n') { - fprintf(stderr, "(\\n)"); - } else if (c == '\r') { - fprintf(stderr, "(\\r)"); - } else if (c == 0x1b) { - fprintf(stderr, "(\\e)"); - } else { - fprintf(stderr, "(%02x)", c); - } - } - fprintf(stderr, "ESC\\\n"); -} - -void -strreset(void) -{ - strescseq = (STREscape){ - .buf = xrealloc(strescseq.buf, STR_BUF_SIZ), - .siz = STR_BUF_SIZ, - }; -} - -void -sendbreak(const Arg *arg) -{ - if (tcsendbreak(cmdfd, 0)) - perror("Error sending break"); -} - -void -tprinter(char *s, size_t len) -{ - if (iofd != -1 && xwrite(iofd, s, len) < 0) { - perror("Error writing to output file"); - close(iofd); - iofd = -1; - } -} - -void -toggleprinter(const Arg *arg) -{ - term.mode ^= MODE_PRINT; -} - -void -printscreen(const Arg *arg) -{ - tdump(); -} - -void -printsel(const Arg *arg) -{ - tdumpsel(); -} - -void -tdumpsel(void) -{ - char *ptr; - - if ((ptr = getsel())) { - tprinter(ptr, strlen(ptr)); - free(ptr); - } -} - -void -tdumpline(int n) -{ - char buf[UTF_SIZ]; - const Glyph *bp, *end; - - bp = &TLINE(n)[0]; - end = &bp[MIN(tlinelen(n), term.col) - 1]; - if (bp != end || bp->u != ' ') { - for ( ; bp <= end; ++bp) - tprinter(buf, utf8encode(bp->u, buf)); - } - tprinter("\n", 1); -} - -void -tdump(void) -{ - int i; - - for (i = 0; i < term.row; ++i) - tdumpline(i); -} - -void -tputtab(int n) -{ - uint x = term.c.x; - - if (n > 0) { - while (x < term.col && n--) - for (++x; x < term.col && !term.tabs[x]; ++x) - /* nothing */ ; - } else if (n < 0) { - while (x > 0 && n++) - for (--x; x > 0 && !term.tabs[x]; --x) - /* nothing */ ; - } - term.c.x = LIMIT(x, 0, term.col-1); -} - -void -tdefutf8(char ascii) -{ - if (ascii == 'G') - term.mode |= MODE_UTF8; - else if (ascii == '@') - term.mode &= ~MODE_UTF8; -} - -void -tdeftran(char ascii) -{ - static char cs[] = "0B"; - static int vcs[] = {CS_GRAPHIC0, CS_USA}; - char *p; - - if ((p = strchr(cs, ascii)) == NULL) { - fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii); - } else { - term.trantbl[term.icharset] = vcs[p - cs]; - } -} - -void -tdectest(char c) -{ - int x, y; - - if (c == '8') { /* DEC screen alignment test. */ - for (x = 0; x < term.col; ++x) { - for (y = 0; y < term.row; ++y) - tsetchar('E', &term.c.attr, x, y); - } - } -} - -void -tstrsequence(uchar c) -{ - switch (c) { - case 0x90: /* DCS -- Device Control String */ - c = 'P'; - break; - case 0x9f: /* APC -- Application Program Command */ - c = '_'; - break; - case 0x9e: /* PM -- Privacy Message */ - c = '^'; - break; - case 0x9d: /* OSC -- Operating System Command */ - c = ']'; - break; - } - strreset(); - strescseq.type = c; - term.esc |= ESC_STR; -} - -void -tcontrolcode(uchar ascii) -{ - switch (ascii) { - case '\t': /* HT */ - tputtab(1); - return; - case '\b': /* BS */ - tmoveto(term.c.x-1, term.c.y); - return; - case '\r': /* CR */ - tmoveto(0, term.c.y); - return; - case '\f': /* LF */ - case '\v': /* VT */ - case '\n': /* LF */ - /* go to first col if the mode is set */ - tnewline(IS_SET(MODE_CRLF)); - return; - case '\a': /* BEL */ - if (term.esc & ESC_STR_END) { - /* backwards compatibility to xterm */ - strhandle(); - } else { - xbell(); - } - break; - case '\033': /* ESC */ - csireset(); - term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST); - term.esc |= ESC_START; - return; - case '\016': /* SO (LS1 -- Locking shift 1) */ - case '\017': /* SI (LS0 -- Locking shift 0) */ - term.charset = 1 - (ascii - '\016'); - return; - case '\032': /* SUB */ - tsetchar('?', &term.c.attr, term.c.x, term.c.y); - /* FALLTHROUGH */ - case '\030': /* CAN */ - csireset(); - break; - case '\005': /* ENQ (IGNORED) */ - case '\000': /* NUL (IGNORED) */ - case '\021': /* XON (IGNORED) */ - case '\023': /* XOFF (IGNORED) */ - case 0177: /* DEL (IGNORED) */ - return; - case 0x80: /* TODO: PAD */ - case 0x81: /* TODO: HOP */ - case 0x82: /* TODO: BPH */ - case 0x83: /* TODO: NBH */ - case 0x84: /* TODO: IND */ - break; - case 0x85: /* NEL -- Next line */ - tnewline(1); /* always go to first col */ - break; - case 0x86: /* TODO: SSA */ - case 0x87: /* TODO: ESA */ - break; - case 0x88: /* HTS -- Horizontal tab stop */ - term.tabs[term.c.x] = 1; - break; - case 0x89: /* TODO: HTJ */ - case 0x8a: /* TODO: VTS */ - case 0x8b: /* TODO: PLD */ - case 0x8c: /* TODO: PLU */ - case 0x8d: /* TODO: RI */ - case 0x8e: /* TODO: SS2 */ - case 0x8f: /* TODO: SS3 */ - case 0x91: /* TODO: PU1 */ - case 0x92: /* TODO: PU2 */ - case 0x93: /* TODO: STS */ - case 0x94: /* TODO: CCH */ - case 0x95: /* TODO: MW */ - case 0x96: /* TODO: SPA */ - case 0x97: /* TODO: EPA */ - case 0x98: /* TODO: SOS */ - case 0x99: /* TODO: SGCI */ - break; - case 0x9a: /* DECID -- Identify Terminal */ - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 0x9b: /* TODO: CSI */ - case 0x9c: /* TODO: ST */ - break; - case 0x90: /* DCS -- Device Control String */ - case 0x9d: /* OSC -- Operating System Command */ - case 0x9e: /* PM -- Privacy Message */ - case 0x9f: /* APC -- Application Program Command */ - tstrsequence(ascii); - return; - } - /* only CAN, SUB, \a and C1 chars interrupt a sequence */ - term.esc &= ~(ESC_STR_END|ESC_STR); -} - -/* - * returns 1 when the sequence is finished and it hasn't to read - * more characters for this sequence, otherwise 0 - */ -int -eschandle(uchar ascii) -{ - switch (ascii) { - case '[': - term.esc |= ESC_CSI; - return 0; - case '#': - term.esc |= ESC_TEST; - return 0; - case '%': - term.esc |= ESC_UTF8; - return 0; - case 'P': /* DCS -- Device Control String */ - case '_': /* APC -- Application Program Command */ - case '^': /* PM -- Privacy Message */ - case ']': /* OSC -- Operating System Command */ - case 'k': /* old title set compatibility */ - tstrsequence(ascii); - return 0; - case 'n': /* LS2 -- Locking shift 2 */ - case 'o': /* LS3 -- Locking shift 3 */ - term.charset = 2 + (ascii - 'n'); - break; - case '(': /* GZD4 -- set primary charset G0 */ - case ')': /* G1D4 -- set secondary charset G1 */ - case '*': /* G2D4 -- set tertiary charset G2 */ - case '+': /* G3D4 -- set quaternary charset G3 */ - term.icharset = ascii - '('; - term.esc |= ESC_ALTCHARSET; - return 0; - case 'D': /* IND -- Linefeed */ - if (term.c.y == term.bot) { - tscrollup(term.top, 1); - } else { - tmoveto(term.c.x, term.c.y+1); - } - break; - case 'E': /* NEL -- Next line */ - tnewline(1); /* always go to first col */ - break; - case 'H': /* HTS -- Horizontal tab stop */ - term.tabs[term.c.x] = 1; - break; - case 'M': /* RI -- Reverse index */ - if (term.c.y == term.top) { - tscrolldown(term.top, 1); - } else { - tmoveto(term.c.x, term.c.y-1); - } - break; - case 'Z': /* DECID -- Identify Terminal */ - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 'c': /* RIS -- Reset to initial state */ - treset(); - resettitle(); - xloadcols(); - break; - case '=': /* DECPAM -- Application keypad */ - xsetmode(1, MODE_APPKEYPAD); - break; - case '>': /* DECPNM -- Normal keypad */ - xsetmode(0, MODE_APPKEYPAD); - break; - case '7': /* DECSC -- Save Cursor */ - tcursor(CURSOR_SAVE); - break; - case '8': /* DECRC -- Restore Cursor */ - tcursor(CURSOR_LOAD); - break; - case '\\': /* ST -- String Terminator */ - if (term.esc & ESC_STR_END) - strhandle(); - break; - default: - fprintf(stderr, "erresc: unknown sequence ESC 0x%02X '%c'\n", - (uchar) ascii, isprint(ascii)? ascii:'.'); - break; - } - return 1; -} - -void -tputc(Rune u) -{ - char c[UTF_SIZ]; - int control; - int width, len; - Glyph *gp; - - control = ISCONTROL(u); - if (u < 127 || !IS_SET(MODE_UTF8)) { - c[0] = u; - width = len = 1; - } else { - len = utf8encode(u, c); - if (!control && (width = wcwidth(u)) == -1) - width = 1; - } - - if (IS_SET(MODE_PRINT)) - tprinter(c, len); - - /* - * STR sequence must be checked before anything else - * because it uses all following characters until it - * receives a ESC, a SUB, a ST or any other C1 control - * character. - */ - if (term.esc & ESC_STR) { - if (u == '\a' || u == 030 || u == 032 || u == 033 || - ISCONTROLC1(u)) { - term.esc &= ~(ESC_START|ESC_STR); - term.esc |= ESC_STR_END; - goto check_control_code; - } - - if (strescseq.len+len >= strescseq.siz) { - /* - * Here is a bug in terminals. If the user never sends - * some code to stop the str or esc command, then st - * will stop responding. But this is better than - * silently failing with unknown characters. At least - * then users will report back. - * - * In the case users ever get fixed, here is the code: - */ - /* - * term.esc = 0; - * strhandle(); - */ - if (strescseq.siz > (SIZE_MAX - UTF_SIZ) / 2) - return; - strescseq.siz *= 2; - strescseq.buf = xrealloc(strescseq.buf, strescseq.siz); - } - - memmove(&strescseq.buf[strescseq.len], c, len); - strescseq.len += len; - return; - } - -check_control_code: - /* - * Actions of control codes must be performed as soon they arrive - * because they can be embedded inside a control sequence, and - * they must not cause conflicts with sequences. - */ - if (control) { - tcontrolcode(u); - /* - * control codes are not shown ever - */ - if (!term.esc) - term.lastc = 0; - return; - } else if (term.esc & ESC_START) { - if (term.esc & ESC_CSI) { - csiescseq.buf[csiescseq.len++] = u; - if (BETWEEN(u, 0x40, 0x7E) - || csiescseq.len >= \ - sizeof(csiescseq.buf)-1) { - term.esc = 0; - csiparse(); - csihandle(); - } - return; - } else if (term.esc & ESC_UTF8) { - tdefutf8(u); - } else if (term.esc & ESC_ALTCHARSET) { - tdeftran(u); - } else if (term.esc & ESC_TEST) { - tdectest(u); - } else { - if (!eschandle(u)) - return; - /* sequence already finished */ - } - term.esc = 0; - /* - * All characters which form part of a sequence are not - * printed - */ - return; - } - if (selected(term.c.x, term.c.y)) - selclear(); - - gp = &TLINE(term.c.y)[term.c.x]; - if (IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) { - gp->mode |= ATTR_WRAP; - tnewline(1); - gp = &TLINE(term.c.y)[term.c.x]; - } - - if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) - memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph)); - - if (term.c.x+width > term.col) { - tnewline(1); - gp = &TLINE(term.c.y)[term.c.x]; - } - - tsetchar(u, &term.c.attr, term.c.x, term.c.y); - term.lastc = u; - - if (width == 2) { - gp->mode |= ATTR_WIDE; - if (term.c.x+1 < term.col) { - if (gp[1].mode == ATTR_WIDE && term.c.x+2 < term.col) { - gp[2].u = ' '; - gp[2].mode &= ~ATTR_WDUMMY; - } - gp[1].u = '\0'; - gp[1].mode = ATTR_WDUMMY; - } - } - if (term.c.x+width < term.col) { - tmoveto(term.c.x+width, term.c.y); - } else { - term.c.state |= CURSOR_WRAPNEXT; - } -} - -int -twrite(const char *buf, int buflen, int show_ctrl) -{ - int charsize; - Rune u; - int n; - - if (TSCREEN.off) { - TSCREEN.off = 0; - tfulldirt(); - } - - for (n = 0; n < buflen; n += charsize) { - if (IS_SET(MODE_UTF8)) { - /* process a complete utf8 char */ - charsize = utf8decode(buf + n, &u, buflen - n); - if (charsize == 0) - break; - } else { - u = buf[n] & 0xFF; - charsize = 1; - } - if (show_ctrl && ISCONTROL(u)) { - if (u & 0x80) { - u &= 0x7f; - tputc('^'); - tputc('['); - } else if (u != '\n' && u != '\r' && u != '\t') { - u ^= 0x40; - tputc('^'); - } - } - tputc(u); - } - return n; -} - -void -clearline(Line line, Glyph g, int x, int xend) -{ - int i; - g.mode = 0; - g.u = ' '; - for (i = x; i < xend; ++i) { - line[i] = g; - } -} - -Line -ensureline(Line line) -{ - if (!line) { - line = xmalloc(term.linelen * sizeof(Glyph)); - } - return line; -} - -void -tresize(int col, int row) -{ - int i, j; - int minrow = MIN(row, term.row); - int mincol = MIN(col, term.col); - int linelen = MAX(col, term.linelen); - int *bp; - - if (col < 1 || row < 1 || row > HISTSIZE) { - fprintf(stderr, - "tresize: error resizing to %dx%d\n", col, row); - return; - } - - /* Shift buffer to keep the cursor where we expect it */ - if (row <= term.c.y) { - term.screen[0].cur = (term.screen[0].cur - row + term.c.y + 1) % term.screen[0].size; - } - - /* Resize and clear line buffers as needed */ - if (linelen > term.linelen) { - for (i = 0; i < term.screen[0].size; ++i) { - if (term.screen[0].buffer[i]) { - term.screen[0].buffer[i] = xrealloc(term.screen[0].buffer[i], linelen * sizeof(Glyph)); - clearline(term.screen[0].buffer[i], term.c.attr, term.linelen, linelen); - } - } - for (i = 0; i < minrow; ++i) { - term.screen[1].buffer[i] = xrealloc(term.screen[1].buffer[i], linelen * sizeof(Glyph)); - clearline(term.screen[1].buffer[i], term.c.attr, term.linelen, linelen); - } - } - /* Allocate all visible lines for regular line buffer */ - for (j = term.screen[0].cur, i = 0; i < row; ++i, j = (j + 1) % term.screen[0].size) - { - if (!term.screen[0].buffer[j]) { - term.screen[0].buffer[j] = xmalloc(linelen * sizeof(Glyph)); - } - if (i >= term.row) { - clearline(term.screen[0].buffer[j], term.c.attr, 0, linelen); - } - } - /* Resize alt screen */ - term.screen[1].cur = 0; - term.screen[1].size = row; - for (i = row; i < term.row; ++i) { - free(term.screen[1].buffer[i]); - } - term.screen[1].buffer = xrealloc(term.screen[1].buffer, row * sizeof(Line)); - for (i = term.row; i < row; ++i) { - term.screen[1].buffer[i] = xmalloc(linelen * sizeof(Glyph)); - clearline(term.screen[1].buffer[i], term.c.attr, 0, linelen); - } - - /* resize to new height */ - term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); - term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); - - /* fix tabstops */ - if (col > term.col) { - bp = term.tabs + term.col; - - memset(bp, 0, sizeof(*term.tabs) * (col - term.col)); - while (--bp > term.tabs && !*bp) - /* nothing */ ; - for (bp += tabspaces; bp < term.tabs + col; bp += tabspaces) - *bp = 1; - } - - /* update terminal size */ - term.col = col; - term.row = row; - term.linelen = linelen; - /* reset scrolling region */ - tsetscroll(0, row-1); - /* make use of the LIMIT in tmoveto */ - tmoveto(term.c.x, term.c.y); - tfulldirt(); -} - -void -resettitle(void) -{ - xsettitle(NULL); -} - -void -drawregion(int x1, int y1, int x2, int y2) -{ - int y, L; - - L = TLINEOFFSET(y1); - for (y = y1; y < y2; y++) { - if (term.dirty[y]) { - term.dirty[y] = 0; - xdrawline(TSCREEN.buffer[L], x1, y, x2); - } - L = (L + 1) % TSCREEN.size; - } -} - -void -draw(void) -{ - int cx = term.c.x, ocx = term.ocx, ocy = term.ocy; - - if (!xstartdraw()) - return; - - /* adjust cursor position */ - LIMIT(term.ocx, 0, term.col-1); - LIMIT(term.ocy, 0, term.row-1); - if (TLINE(term.ocy)[term.ocx].mode & ATTR_WDUMMY) - term.ocx--; - if (TLINE(term.c.y)[cx].mode & ATTR_WDUMMY) - cx--; - - drawregion(0, 0, term.col, term.row); - if (TSCREEN.off == 0) - xdrawcursor(cx, term.c.y, TLINE(term.c.y)[cx], - term.ocx, term.ocy, TLINE(term.ocy)[term.ocx]); - term.ocx = cx; - term.ocy = term.c.y; - xfinishdraw(); - if (ocx != term.ocx || ocy != term.ocy) - xximspot(term.ocx, term.ocy); -} - -void -redraw(void) -{ - tfulldirt(); - draw(); -} diff --git a/dwm/st/st.c.orig b/dwm/st/st.c.orig deleted file mode 100644 index 62def59..0000000 --- a/dwm/st/st.c.orig +++ /dev/null @@ -1,2656 +0,0 @@ -/* See LICENSE for license details. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "st.h" -#include "win.h" - -#if defined(__linux) - #include -#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) - #include -#elif defined(__FreeBSD__) || defined(__DragonFly__) - #include -#endif - -/* Arbitrary sizes */ -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 -#define ESC_BUF_SIZ (128*UTF_SIZ) -#define ESC_ARG_SIZ 16 -#define STR_BUF_SIZ ESC_BUF_SIZ -#define STR_ARG_SIZ ESC_ARG_SIZ - -/* macros */ -#define IS_SET(flag) ((term.mode & (flag)) != 0) -#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == 0x7f) -#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) -#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) -#define ISDELIM(u) (u && wcschr(worddelimiters, u)) - -enum term_mode { - MODE_WRAP = 1 << 0, - MODE_INSERT = 1 << 1, - MODE_ALTSCREEN = 1 << 2, - MODE_CRLF = 1 << 3, - MODE_ECHO = 1 << 4, - MODE_PRINT = 1 << 5, - MODE_UTF8 = 1 << 6, -}; - -enum cursor_movement { - CURSOR_SAVE, - CURSOR_LOAD -}; - -enum cursor_state { - CURSOR_DEFAULT = 0, - CURSOR_WRAPNEXT = 1, - CURSOR_ORIGIN = 2 -}; - -enum charset { - CS_GRAPHIC0, - CS_GRAPHIC1, - CS_UK, - CS_USA, - CS_MULTI, - CS_GER, - CS_FIN -}; - -enum escape_state { - ESC_START = 1, - ESC_CSI = 2, - ESC_STR = 4, /* DCS, OSC, PM, APC */ - ESC_ALTCHARSET = 8, - ESC_STR_END = 16, /* a final string was encountered */ - ESC_TEST = 32, /* Enter in test mode */ - ESC_UTF8 = 64, -}; - -typedef struct { - Glyph attr; /* current char attributes */ - int x; - int y; - char state; -} TCursor; - -typedef struct { - int mode; - int type; - int snap; - /* - * Selection variables: - * nb – normalized coordinates of the beginning of the selection - * ne – normalized coordinates of the end of the selection - * ob – original coordinates of the beginning of the selection - * oe – original coordinates of the end of the selection - */ - struct { - int x, y; - } nb, ne, ob, oe; - - int alt; -} Selection; - -/* Internal representation of the screen */ -typedef struct { - int row; /* nb row */ - int col; /* nb col */ - Line *line; /* screen */ - Line *alt; /* alternate screen */ - int *dirty; /* dirtyness of lines */ - TCursor c; /* cursor */ - int ocx; /* old cursor col */ - int ocy; /* old cursor row */ - int top; /* top scroll limit */ - int bot; /* bottom scroll limit */ - int mode; /* terminal mode flags */ - int esc; /* escape state flags */ - char trantbl[4]; /* charset table translation */ - int charset; /* current charset */ - int icharset; /* selected charset for sequence */ - int *tabs; - Rune lastc; /* last printed char outside of sequence, 0 if control */ -} Term; - -/* CSI Escape sequence structs */ -/* ESC '[' [[ [] [;]] []] */ -typedef struct { - char buf[ESC_BUF_SIZ]; /* raw string */ - size_t len; /* raw string length */ - char priv; - int arg[ESC_ARG_SIZ]; - int narg; /* nb of args */ - char mode[2]; -} CSIEscape; - -/* STR Escape sequence structs */ -/* ESC type [[ [] [;]] ] ESC '\' */ -typedef struct { - char type; /* ESC type ... */ - char *buf; /* allocated raw string */ - size_t siz; /* allocation size */ - size_t len; /* raw string length */ - char *args[STR_ARG_SIZ]; - int narg; /* nb of args */ -} STREscape; - -static void execsh(char *, char **); -static void stty(char **); -static void sigchld(int); -static void ttywriteraw(const char *, size_t); - -static void csidump(void); -static void csihandle(void); -static void csiparse(void); -static void csireset(void); -static void osc_color_response(int, int, int); -static int eschandle(uchar); -static void strdump(void); -static void strhandle(void); -static void strparse(void); -static void strreset(void); - -static void tprinter(char *, size_t); -static void tdumpsel(void); -static void tdumpline(int); -static void tdump(void); -static void tclearregion(int, int, int, int); -static void tcursor(int); -static void tdeletechar(int); -static void tdeleteline(int); -static void tinsertblank(int); -static void tinsertblankline(int); -static int tlinelen(int); -static void tmoveto(int, int); -static void tmoveato(int, int); -static void tnewline(int); -static void tputtab(int); -static void tputc(Rune); -static void treset(void); -static void tscrollup(int, int); -static void tscrolldown(int, int); -static void tsetattr(const int *, int); -static void tsetchar(Rune, const Glyph *, int, int); -static void tsetdirt(int, int); -static void tsetscroll(int, int); -static void tswapscreen(void); -static void tsetmode(int, int, const int *, int); -static int twrite(const char *, int, int); -static void tfulldirt(void); -static void tcontrolcode(uchar ); -static void tdectest(char ); -static void tdefutf8(char); -static int32_t tdefcolor(const int *, int *, int); -static void tdeftran(char); -static void tstrsequence(uchar); - -static void drawregion(int, int, int, int); - -static void selnormalize(void); -static void selscroll(int, int); -static void selsnap(int *, int *, int); - -static size_t utf8decode(const char *, Rune *, size_t); -static Rune utf8decodebyte(char, size_t *); -static char utf8encodebyte(Rune, size_t); -static size_t utf8validate(Rune *, size_t); - -static char *base64dec(const char *); -static char base64dec_getc(const char **); - -static ssize_t xwrite(int, const char *, size_t); - -/* Globals */ -static Term term; -static Selection sel; -static CSIEscape csiescseq; -static STREscape strescseq; -static int iofd = 1; -static int cmdfd; -static pid_t pid; - -static const uchar utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const uchar utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const Rune utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -ssize_t -xwrite(int fd, const char *s, size_t len) -{ - size_t aux = len; - ssize_t r; - - while (len > 0) { - r = write(fd, s, len); - if (r < 0) - return r; - len -= r; - s += r; - } - - return aux; -} - -void * -xmalloc(size_t len) -{ - void *p; - - if (!(p = malloc(len))) - die("malloc: %s\n", strerror(errno)); - - return p; -} - -void * -xrealloc(void *p, size_t len) -{ - if ((p = realloc(p, len)) == NULL) - die("realloc: %s\n", strerror(errno)); - - return p; -} - -char * -xstrdup(const char *s) -{ - char *p; - - if ((p = strdup(s)) == NULL) - die("strdup: %s\n", strerror(errno)); - - return p; -} - -size_t -utf8decode(const char *c, Rune *u, size_t clen) -{ - size_t i, j, len, type; - Rune udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type != 0) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Rune -utf8decodebyte(char c, size_t *i) -{ - for (*i = 0; *i < LEN(utfmask); ++(*i)) - if (((uchar)c & utfmask[*i]) == utfbyte[*i]) - return (uchar)c & ~utfmask[*i]; - - return 0; -} - -size_t -utf8encode(Rune u, char *c) -{ - size_t len, i; - - len = utf8validate(&u, 0); - if (len > UTF_SIZ) - return 0; - - for (i = len - 1; i != 0; --i) { - c[i] = utf8encodebyte(u, 0); - u >>= 6; - } - c[0] = utf8encodebyte(u, len); - - return len; -} - -char -utf8encodebyte(Rune u, size_t i) -{ - return utfbyte[i] | (u & ~utfmask[i]); -} - -size_t -utf8validate(Rune *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - - return i; -} - -char -base64dec_getc(const char **src) -{ - while (**src && !isprint((unsigned char)**src)) - (*src)++; - return **src ? *((*src)++) : '='; /* emulate padding if string ends */ -} - -char * -base64dec(const char *src) -{ - size_t in_len = strlen(src); - char *result, *dst; - static const char base64_digits[256] = { - [43] = 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, - 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 - }; - - if (in_len % 4) - in_len += 4 - (in_len % 4); - result = dst = xmalloc(in_len / 4 * 3 + 1); - while (*src) { - int a = base64_digits[(unsigned char) base64dec_getc(&src)]; - int b = base64_digits[(unsigned char) base64dec_getc(&src)]; - int c = base64_digits[(unsigned char) base64dec_getc(&src)]; - int d = base64_digits[(unsigned char) base64dec_getc(&src)]; - - /* invalid input. 'a' can be -1, e.g. if src is "\n" (c-str) */ - if (a == -1 || b == -1) - break; - - *dst++ = (a << 2) | ((b & 0x30) >> 4); - if (c == -1) - break; - *dst++ = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); - if (d == -1) - break; - *dst++ = ((c & 0x03) << 6) | d; - } - *dst = '\0'; - return result; -} - -void -selinit(void) -{ - sel.mode = SEL_IDLE; - sel.snap = 0; - sel.ob.x = -1; -} - -int -tlinelen(int y) -{ - int i = term.col; - - if (term.line[y][i - 1].mode & ATTR_WRAP) - return i; - - while (i > 0 && term.line[y][i - 1].u == ' ') - --i; - - return i; -} - -void -selstart(int col, int row, int snap) -{ - selclear(); - sel.mode = SEL_EMPTY; - sel.type = SEL_REGULAR; - sel.alt = IS_SET(MODE_ALTSCREEN); - sel.snap = snap; - sel.oe.x = sel.ob.x = col; - sel.oe.y = sel.ob.y = row; - selnormalize(); - - if (sel.snap != 0) - sel.mode = SEL_READY; - tsetdirt(sel.nb.y, sel.ne.y); -} - -void -selextend(int col, int row, int type, int done) -{ - int oldey, oldex, oldsby, oldsey, oldtype; - - if (sel.mode == SEL_IDLE) - return; - if (done && sel.mode == SEL_EMPTY) { - selclear(); - return; - } - - oldey = sel.oe.y; - oldex = sel.oe.x; - oldsby = sel.nb.y; - oldsey = sel.ne.y; - oldtype = sel.type; - - sel.oe.x = col; - sel.oe.y = row; - selnormalize(); - sel.type = type; - - if (oldey != sel.oe.y || oldex != sel.oe.x || oldtype != sel.type || sel.mode == SEL_EMPTY) - tsetdirt(MIN(sel.nb.y, oldsby), MAX(sel.ne.y, oldsey)); - - sel.mode = done ? SEL_IDLE : SEL_READY; -} - -void -selnormalize(void) -{ - int i; - - if (sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) { - sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x; - sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x; - } else { - sel.nb.x = MIN(sel.ob.x, sel.oe.x); - sel.ne.x = MAX(sel.ob.x, sel.oe.x); - } - sel.nb.y = MIN(sel.ob.y, sel.oe.y); - sel.ne.y = MAX(sel.ob.y, sel.oe.y); - - selsnap(&sel.nb.x, &sel.nb.y, -1); - selsnap(&sel.ne.x, &sel.ne.y, +1); - - /* expand selection over line breaks */ - if (sel.type == SEL_RECTANGULAR) - return; - i = tlinelen(sel.nb.y); - if (i < sel.nb.x) - sel.nb.x = i; - if (tlinelen(sel.ne.y) <= sel.ne.x) - sel.ne.x = term.col - 1; -} - -int -selected(int x, int y) -{ - if (sel.mode == SEL_EMPTY || sel.ob.x == -1 || - sel.alt != IS_SET(MODE_ALTSCREEN)) - return 0; - - if (sel.type == SEL_RECTANGULAR) - return BETWEEN(y, sel.nb.y, sel.ne.y) - && BETWEEN(x, sel.nb.x, sel.ne.x); - - return BETWEEN(y, sel.nb.y, sel.ne.y) - && (y != sel.nb.y || x >= sel.nb.x) - && (y != sel.ne.y || x <= sel.ne.x); -} - -void -selsnap(int *x, int *y, int direction) -{ - int newx, newy, xt, yt; - int delim, prevdelim; - const Glyph *gp, *prevgp; - - switch (sel.snap) { - case SNAP_WORD: - /* - * Snap around if the word wraps around at the end or - * beginning of a line. - */ - prevgp = &term.line[*y][*x]; - prevdelim = ISDELIM(prevgp->u); - for (;;) { - newx = *x + direction; - newy = *y; - if (!BETWEEN(newx, 0, term.col - 1)) { - newy += direction; - newx = (newx + term.col) % term.col; - if (!BETWEEN(newy, 0, term.row - 1)) - break; - - if (direction > 0) - yt = *y, xt = *x; - else - yt = newy, xt = newx; - if (!(term.line[yt][xt].mode & ATTR_WRAP)) - break; - } - - if (newx >= tlinelen(newy)) - break; - - gp = &term.line[newy][newx]; - delim = ISDELIM(gp->u); - if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim - || (delim && gp->u != prevgp->u))) - break; - - *x = newx; - *y = newy; - prevgp = gp; - prevdelim = delim; - } - break; - case SNAP_LINE: - /* - * Snap around if the the previous line or the current one - * has set ATTR_WRAP at its end. Then the whole next or - * previous line will be selected. - */ - *x = (direction < 0) ? 0 : term.col - 1; - if (direction < 0) { - for (; *y > 0; *y += direction) { - if (!(term.line[*y-1][term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } else if (direction > 0) { - for (; *y < term.row-1; *y += direction) { - if (!(term.line[*y][term.col-1].mode - & ATTR_WRAP)) { - break; - } - } - } - break; - } -} - -char * -getsel(void) -{ - char *str, *ptr; - int y, bufsize, lastx, linelen; - const Glyph *gp, *last; - - if (sel.ob.x == -1) - return NULL; - - bufsize = (term.col+1) * (sel.ne.y-sel.nb.y+1) * UTF_SIZ; - ptr = str = xmalloc(bufsize); - - /* append every set & selected glyph to the selection */ - for (y = sel.nb.y; y <= sel.ne.y; y++) { - if ((linelen = tlinelen(y)) == 0) { - *ptr++ = '\n'; - continue; - } - - if (sel.type == SEL_RECTANGULAR) { - gp = &term.line[y][sel.nb.x]; - lastx = sel.ne.x; - } else { - gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; - lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; - } - last = &term.line[y][MIN(lastx, linelen-1)]; - while (last >= gp && last->u == ' ') - --last; - - for ( ; gp <= last; ++gp) { - if (gp->mode & ATTR_WDUMMY) - continue; - - ptr += utf8encode(gp->u, ptr); - } - - /* - * Copy and pasting of line endings is inconsistent - * in the inconsistent terminal and GUI world. - * The best solution seems like to produce '\n' when - * something is copied from st and convert '\n' to - * '\r', when something to be pasted is received by - * st. - * FIXME: Fix the computer world. - */ - if ((y < sel.ne.y || lastx >= linelen) && - (!(last->mode & ATTR_WRAP) || sel.type == SEL_RECTANGULAR)) - *ptr++ = '\n'; - } - *ptr = 0; - return str; -} - -void -selclear(void) -{ - if (sel.ob.x == -1) - return; - sel.mode = SEL_IDLE; - sel.ob.x = -1; - tsetdirt(sel.nb.y, sel.ne.y); -} - -void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -void -execsh(char *cmd, char **args) -{ - char *sh, *prog, *arg; - const struct passwd *pw; - - errno = 0; - if ((pw = getpwuid(getuid())) == NULL) { - if (errno) - die("getpwuid: %s\n", strerror(errno)); - else - die("who are you?\n"); - } - - if ((sh = getenv("SHELL")) == NULL) - sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd; - - if (args) { - prog = args[0]; - arg = NULL; - } else if (scroll) { - prog = scroll; - arg = utmp ? utmp : sh; - } else if (utmp) { - prog = utmp; - arg = NULL; - } else { - prog = sh; - arg = NULL; - } - DEFAULT(args, ((char *[]) {prog, arg, NULL})); - - unsetenv("COLUMNS"); - unsetenv("LINES"); - unsetenv("TERMCAP"); - setenv("LOGNAME", pw->pw_name, 1); - setenv("USER", pw->pw_name, 1); - setenv("SHELL", sh, 1); - setenv("HOME", pw->pw_dir, 1); - setenv("TERM", termname, 1); - - signal(SIGCHLD, SIG_DFL); - signal(SIGHUP, SIG_DFL); - signal(SIGINT, SIG_DFL); - signal(SIGQUIT, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGALRM, SIG_DFL); - - execvp(prog, args); - _exit(1); -} - -void -sigchld(int a) -{ - int stat; - pid_t p; - - if ((p = waitpid(pid, &stat, WNOHANG)) < 0) - die("waiting for pid %hd failed: %s\n", pid, strerror(errno)); - - if (pid != p) - return; - - if (WIFEXITED(stat) && WEXITSTATUS(stat)) - die("child exited with status %d\n", WEXITSTATUS(stat)); - else if (WIFSIGNALED(stat)) - die("child terminated due to signal %d\n", WTERMSIG(stat)); - _exit(0); -} - -void -stty(char **args) -{ - char cmd[_POSIX_ARG_MAX], **p, *q, *s; - size_t n, siz; - - if ((n = strlen(stty_args)) > sizeof(cmd)-1) - die("incorrect stty parameters\n"); - memcpy(cmd, stty_args, n); - q = cmd + n; - siz = sizeof(cmd) - n; - for (p = args; p && (s = *p); ++p) { - if ((n = strlen(s)) > siz-1) - die("stty parameter length too long\n"); - *q++ = ' '; - memcpy(q, s, n); - q += n; - siz -= n + 1; - } - *q = '\0'; - if (system(cmd) != 0) - perror("Couldn't call stty"); -} - -int -ttynew(const char *line, char *cmd, const char *out, char **args) -{ - int m, s; - - if (out) { - term.mode |= MODE_PRINT; - iofd = (!strcmp(out, "-")) ? - 1 : open(out, O_WRONLY | O_CREAT, 0666); - if (iofd < 0) { - fprintf(stderr, "Error opening %s:%s\n", - out, strerror(errno)); - } - } - - if (line) { - if ((cmdfd = open(line, O_RDWR)) < 0) - die("open line '%s' failed: %s\n", - line, strerror(errno)); - dup2(cmdfd, 0); - stty(args); - return cmdfd; - } - - /* seems to work fine on linux, openbsd and freebsd */ - if (openpty(&m, &s, NULL, NULL, NULL) < 0) - die("openpty failed: %s\n", strerror(errno)); - - switch (pid = fork()) { - case -1: - die("fork failed: %s\n", strerror(errno)); - break; - case 0: - close(iofd); - close(m); - setsid(); /* create a new process group */ - dup2(s, 0); - dup2(s, 1); - dup2(s, 2); - if (ioctl(s, TIOCSCTTY, NULL) < 0) - die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); - if (s > 2) - close(s); -#ifdef __OpenBSD__ - if (pledge("stdio getpw proc exec", NULL) == -1) - die("pledge\n"); -#endif - execsh(cmd, args); - break; - default: -#ifdef __OpenBSD__ - if (pledge("stdio rpath tty proc", NULL) == -1) - die("pledge\n"); -#endif - close(s); - cmdfd = m; - signal(SIGCHLD, sigchld); - break; - } - return cmdfd; -} - -size_t -ttyread(void) -{ - static char buf[BUFSIZ]; - static int buflen = 0; - int ret, written; - - /* append read bytes to unprocessed bytes */ - ret = read(cmdfd, buf+buflen, LEN(buf)-buflen); - - switch (ret) { - case 0: - exit(0); - case -1: - die("couldn't read from shell: %s\n", strerror(errno)); - default: - buflen += ret; - written = twrite(buf, buflen, 0); - buflen -= written; - /* keep any incomplete UTF-8 byte sequence for the next call */ - if (buflen > 0) - memmove(buf, buf + written, buflen); - return ret; - } -} - -void -ttywrite(const char *s, size_t n, int may_echo) -{ - const char *next; - - if (may_echo && IS_SET(MODE_ECHO)) - twrite(s, n, 1); - - if (!IS_SET(MODE_CRLF)) { - ttywriteraw(s, n); - return; - } - - /* This is similar to how the kernel handles ONLCR for ttys */ - while (n > 0) { - if (*s == '\r') { - next = s + 1; - ttywriteraw("\r\n", 2); - } else { - next = memchr(s, '\r', n); - DEFAULT(next, s + n); - ttywriteraw(s, next - s); - } - n -= next - s; - s = next; - } -} - -void -ttywriteraw(const char *s, size_t n) -{ - fd_set wfd, rfd; - ssize_t r; - size_t lim = 256; - - /* - * Remember that we are using a pty, which might be a modem line. - * Writing too much will clog the line. That's why we are doing this - * dance. - * FIXME: Migrate the world to Plan 9. - */ - while (n > 0) { - FD_ZERO(&wfd); - FD_ZERO(&rfd); - FD_SET(cmdfd, &wfd); - FD_SET(cmdfd, &rfd); - - /* Check if we can write. */ - if (pselect(cmdfd+1, &rfd, &wfd, NULL, NULL, NULL) < 0) { - if (errno == EINTR) - continue; - die("select failed: %s\n", strerror(errno)); - } - if (FD_ISSET(cmdfd, &wfd)) { - /* - * Only write the bytes written by ttywrite() or the - * default of 256. This seems to be a reasonable value - * for a serial line. Bigger values might clog the I/O. - */ - if ((r = write(cmdfd, s, (n < lim)? n : lim)) < 0) - goto write_error; - if (r < n) { - /* - * We weren't able to write out everything. - * This means the buffer is getting full - * again. Empty it. - */ - if (n < lim) - lim = ttyread(); - n -= r; - s += r; - } else { - /* All bytes have been written. */ - break; - } - } - if (FD_ISSET(cmdfd, &rfd)) - lim = ttyread(); - } - return; - -write_error: - die("write error on tty: %s\n", strerror(errno)); -} - -void -ttyresize(int tw, int th) -{ - struct winsize w; - - w.ws_row = term.row; - w.ws_col = term.col; - w.ws_xpixel = tw; - w.ws_ypixel = th; - if (ioctl(cmdfd, TIOCSWINSZ, &w) < 0) - fprintf(stderr, "Couldn't set window size: %s\n", strerror(errno)); -} - -void -ttyhangup(void) -{ - /* Send SIGHUP to shell */ - kill(pid, SIGHUP); -} - -int -tattrset(int attr) -{ - int i, j; - - for (i = 0; i < term.row-1; i++) { - for (j = 0; j < term.col-1; j++) { - if (term.line[i][j].mode & attr) - return 1; - } - } - - return 0; -} - -void -tsetdirt(int top, int bot) -{ - int i; - - LIMIT(top, 0, term.row-1); - LIMIT(bot, 0, term.row-1); - - for (i = top; i <= bot; i++) - term.dirty[i] = 1; -} - -void -tsetdirtattr(int attr) -{ - int i, j; - - for (i = 0; i < term.row-1; i++) { - for (j = 0; j < term.col-1; j++) { - if (term.line[i][j].mode & attr) { - tsetdirt(i, i); - break; - } - } - } -} - -void -tfulldirt(void) -{ - tsetdirt(0, term.row-1); -} - -void -tcursor(int mode) -{ - static TCursor c[2]; - int alt = IS_SET(MODE_ALTSCREEN); - - if (mode == CURSOR_SAVE) { - c[alt] = term.c; - } else if (mode == CURSOR_LOAD) { - term.c = c[alt]; - tmoveto(c[alt].x, c[alt].y); - } -} - -void -treset(void) -{ - uint i; - - term.c = (TCursor){{ - .mode = ATTR_NULL, - .fg = defaultfg, - .bg = defaultbg - }, .x = 0, .y = 0, .state = CURSOR_DEFAULT}; - - memset(term.tabs, 0, term.col * sizeof(*term.tabs)); - for (i = tabspaces; i < term.col; i += tabspaces) - term.tabs[i] = 1; - term.top = 0; - term.bot = term.row - 1; - term.mode = MODE_WRAP|MODE_UTF8; - memset(term.trantbl, CS_USA, sizeof(term.trantbl)); - term.charset = 0; - - for (i = 0; i < 2; i++) { - tmoveto(0, 0); - tcursor(CURSOR_SAVE); - tclearregion(0, 0, term.col-1, term.row-1); - tswapscreen(); - } -} - -void -tnew(int col, int row) -{ - term = (Term){ .c = { .attr = { .fg = defaultfg, .bg = defaultbg } } }; - tresize(col, row); - treset(); -} - -void -tswapscreen(void) -{ - Line *tmp = term.line; - - term.line = term.alt; - term.alt = tmp; - term.mode ^= MODE_ALTSCREEN; - tfulldirt(); -} - -void -tscrolldown(int orig, int n) -{ - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - - tsetdirt(orig, term.bot-n); - tclearregion(0, term.bot-n+1, term.col-1, term.bot); - - for (i = term.bot; i >= orig+n; i--) { - temp = term.line[i]; - term.line[i] = term.line[i-n]; - term.line[i-n] = temp; - } - - selscroll(orig, n); -} - -void -tscrollup(int orig, int n) -{ - int i; - Line temp; - - LIMIT(n, 0, term.bot-orig+1); - - tclearregion(0, orig, term.col-1, orig+n-1); - tsetdirt(orig+n, term.bot); - - for (i = orig; i <= term.bot-n; i++) { - temp = term.line[i]; - term.line[i] = term.line[i+n]; - term.line[i+n] = temp; - } - - selscroll(orig, -n); -} - -void -selscroll(int orig, int n) -{ - if (sel.ob.x == -1) - return; - - if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) { - selclear(); - } else if (BETWEEN(sel.nb.y, orig, term.bot)) { - sel.ob.y += n; - sel.oe.y += n; - if (sel.ob.y < term.top || sel.ob.y > term.bot || - sel.oe.y < term.top || sel.oe.y > term.bot) { - selclear(); - } else { - selnormalize(); - } - } -} - -void -tnewline(int first_col) -{ - int y = term.c.y; - - if (y == term.bot) { - tscrollup(term.top, 1); - } else { - y++; - } - tmoveto(first_col ? 0 : term.c.x, y); -} - -void -csiparse(void) -{ - char *p = csiescseq.buf, *np; - long int v; - - csiescseq.narg = 0; - if (*p == '?') { - csiescseq.priv = 1; - p++; - } - - csiescseq.buf[csiescseq.len] = '\0'; - while (p < csiescseq.buf+csiescseq.len) { - np = NULL; - v = strtol(p, &np, 10); - if (np == p) - v = 0; - if (v == LONG_MAX || v == LONG_MIN) - v = -1; - csiescseq.arg[csiescseq.narg++] = v; - p = np; - if (*p != ';' || csiescseq.narg == ESC_ARG_SIZ) - break; - p++; - } - csiescseq.mode[0] = *p++; - csiescseq.mode[1] = (p < csiescseq.buf+csiescseq.len) ? *p : '\0'; -} - -/* for absolute user moves, when decom is set */ -void -tmoveato(int x, int y) -{ - tmoveto(x, y + ((term.c.state & CURSOR_ORIGIN) ? term.top: 0)); -} - -void -tmoveto(int x, int y) -{ - int miny, maxy; - - if (term.c.state & CURSOR_ORIGIN) { - miny = term.top; - maxy = term.bot; - } else { - miny = 0; - maxy = term.row - 1; - } - term.c.state &= ~CURSOR_WRAPNEXT; - term.c.x = LIMIT(x, 0, term.col-1); - term.c.y = LIMIT(y, miny, maxy); -} - -void -tsetchar(Rune u, const Glyph *attr, int x, int y) -{ - static const char *vt100_0[62] = { /* 0x41 - 0x7e */ - "↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */ - 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ - 0, 0, 0, 0, 0, 0, 0, 0, /* P - W */ - 0, 0, 0, 0, 0, 0, 0, " ", /* X - _ */ - "◆", "▒", "␉", "␌", "␍", "␊", "°", "±", /* ` - g */ - "␤", "␋", "┘", "┐", "┌", "└", "┼", "⎺", /* h - o */ - "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", /* p - w */ - "│", "≤", "≥", "π", "≠", "£", "·", /* x - ~ */ - }; - - /* - * The table is proudly stolen from rxvt. - */ - if (term.trantbl[term.charset] == CS_GRAPHIC0 && - BETWEEN(u, 0x41, 0x7e) && vt100_0[u - 0x41]) - utf8decode(vt100_0[u - 0x41], &u, UTF_SIZ); - - if (term.line[y][x].mode & ATTR_WIDE) { - if (x+1 < term.col) { - term.line[y][x+1].u = ' '; - term.line[y][x+1].mode &= ~ATTR_WDUMMY; - } - } else if (term.line[y][x].mode & ATTR_WDUMMY) { - term.line[y][x-1].u = ' '; - term.line[y][x-1].mode &= ~ATTR_WIDE; - } - - term.dirty[y] = 1; - term.line[y][x] = *attr; - term.line[y][x].u = u; -} - -void -tclearregion(int x1, int y1, int x2, int y2) -{ - int x, y, temp; - Glyph *gp; - - if (x1 > x2) - temp = x1, x1 = x2, x2 = temp; - if (y1 > y2) - temp = y1, y1 = y2, y2 = temp; - - LIMIT(x1, 0, term.col-1); - LIMIT(x2, 0, term.col-1); - LIMIT(y1, 0, term.row-1); - LIMIT(y2, 0, term.row-1); - - for (y = y1; y <= y2; y++) { - term.dirty[y] = 1; - for (x = x1; x <= x2; x++) { - gp = &term.line[y][x]; - if (selected(x, y)) - selclear(); - gp->fg = term.c.attr.fg; - gp->bg = term.c.attr.bg; - gp->mode = 0; - gp->u = ' '; - } - } -} - -void -tdeletechar(int n) -{ - int dst, src, size; - Glyph *line; - - LIMIT(n, 0, term.col - term.c.x); - - dst = term.c.x; - src = term.c.x + n; - size = term.col - src; - line = term.line[term.c.y]; - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); -} - -void -tinsertblank(int n) -{ - int dst, src, size; - Glyph *line; - - LIMIT(n, 0, term.col - term.c.x); - - dst = term.c.x + n; - src = term.c.x; - size = term.col - dst; - line = term.line[term.c.y]; - - memmove(&line[dst], &line[src], size * sizeof(Glyph)); - tclearregion(src, term.c.y, dst - 1, term.c.y); -} - -void -tinsertblankline(int n) -{ - if (BETWEEN(term.c.y, term.top, term.bot)) - tscrolldown(term.c.y, n); -} - -void -tdeleteline(int n) -{ - if (BETWEEN(term.c.y, term.top, term.bot)) - tscrollup(term.c.y, n); -} - -int32_t -tdefcolor(const int *attr, int *npar, int l) -{ - int32_t idx = -1; - uint r, g, b; - - switch (attr[*npar + 1]) { - case 2: /* direct color in RGB space */ - if (*npar + 4 >= l) { - fprintf(stderr, - "erresc(38): Incorrect number of parameters (%d)\n", - *npar); - break; - } - r = attr[*npar + 2]; - g = attr[*npar + 3]; - b = attr[*npar + 4]; - *npar += 4; - if (!BETWEEN(r, 0, 255) || !BETWEEN(g, 0, 255) || !BETWEEN(b, 0, 255)) - fprintf(stderr, "erresc: bad rgb color (%u,%u,%u)\n", - r, g, b); - else - idx = TRUECOLOR(r, g, b); - break; - case 5: /* indexed color */ - if (*npar + 2 >= l) { - fprintf(stderr, - "erresc(38): Incorrect number of parameters (%d)\n", - *npar); - break; - } - *npar += 2; - if (!BETWEEN(attr[*npar], 0, 255)) - fprintf(stderr, "erresc: bad fgcolor %d\n", attr[*npar]); - else - idx = attr[*npar]; - break; - case 0: /* implemented defined (only foreground) */ - case 1: /* transparent */ - case 3: /* direct color in CMY space */ - case 4: /* direct color in CMYK space */ - default: - fprintf(stderr, - "erresc(38): gfx attr %d unknown\n", attr[*npar]); - break; - } - - return idx; -} - -void -tsetattr(const int *attr, int l) -{ - int i; - int32_t idx; - - for (i = 0; i < l; i++) { - switch (attr[i]) { - case 0: - term.c.attr.mode &= ~( - ATTR_BOLD | - ATTR_FAINT | - ATTR_ITALIC | - ATTR_UNDERLINE | - ATTR_BLINK | - ATTR_REVERSE | - ATTR_INVISIBLE | - ATTR_STRUCK ); - term.c.attr.fg = defaultfg; - term.c.attr.bg = defaultbg; - break; - case 1: - term.c.attr.mode |= ATTR_BOLD; - break; - case 2: - term.c.attr.mode |= ATTR_FAINT; - break; - case 3: - term.c.attr.mode |= ATTR_ITALIC; - break; - case 4: - term.c.attr.mode |= ATTR_UNDERLINE; - break; - case 5: /* slow blink */ - /* FALLTHROUGH */ - case 6: /* rapid blink */ - term.c.attr.mode |= ATTR_BLINK; - break; - case 7: - term.c.attr.mode |= ATTR_REVERSE; - break; - case 8: - term.c.attr.mode |= ATTR_INVISIBLE; - break; - case 9: - term.c.attr.mode |= ATTR_STRUCK; - break; - case 22: - term.c.attr.mode &= ~(ATTR_BOLD | ATTR_FAINT); - break; - case 23: - term.c.attr.mode &= ~ATTR_ITALIC; - break; - case 24: - term.c.attr.mode &= ~ATTR_UNDERLINE; - break; - case 25: - term.c.attr.mode &= ~ATTR_BLINK; - break; - case 27: - term.c.attr.mode &= ~ATTR_REVERSE; - break; - case 28: - term.c.attr.mode &= ~ATTR_INVISIBLE; - break; - case 29: - term.c.attr.mode &= ~ATTR_STRUCK; - break; - case 38: - if ((idx = tdefcolor(attr, &i, l)) >= 0) - term.c.attr.fg = idx; - break; - case 39: - term.c.attr.fg = defaultfg; - break; - case 48: - if ((idx = tdefcolor(attr, &i, l)) >= 0) - term.c.attr.bg = idx; - break; - case 49: - term.c.attr.bg = defaultbg; - break; - default: - if (BETWEEN(attr[i], 30, 37)) { - term.c.attr.fg = attr[i] - 30; - } else if (BETWEEN(attr[i], 40, 47)) { - term.c.attr.bg = attr[i] - 40; - } else if (BETWEEN(attr[i], 90, 97)) { - term.c.attr.fg = attr[i] - 90 + 8; - } else if (BETWEEN(attr[i], 100, 107)) { - term.c.attr.bg = attr[i] - 100 + 8; - } else { - fprintf(stderr, - "erresc(default): gfx attr %d unknown\n", - attr[i]); - csidump(); - } - break; - } - } -} - -void -tsetscroll(int t, int b) -{ - int temp; - - LIMIT(t, 0, term.row-1); - LIMIT(b, 0, term.row-1); - if (t > b) { - temp = t; - t = b; - b = temp; - } - term.top = t; - term.bot = b; -} - -void -tsetmode(int priv, int set, const int *args, int narg) -{ - int alt; const int *lim; - - for (lim = args + narg; args < lim; ++args) { - if (priv) { - switch (*args) { - case 1: /* DECCKM -- Cursor key */ - xsetmode(set, MODE_APPCURSOR); - break; - case 5: /* DECSCNM -- Reverse video */ - xsetmode(set, MODE_REVERSE); - break; - case 6: /* DECOM -- Origin */ - MODBIT(term.c.state, set, CURSOR_ORIGIN); - tmoveato(0, 0); - break; - case 7: /* DECAWM -- Auto wrap */ - MODBIT(term.mode, set, MODE_WRAP); - break; - case 0: /* Error (IGNORED) */ - case 2: /* DECANM -- ANSI/VT52 (IGNORED) */ - case 3: /* DECCOLM -- Column (IGNORED) */ - case 4: /* DECSCLM -- Scroll (IGNORED) */ - case 8: /* DECARM -- Auto repeat (IGNORED) */ - case 18: /* DECPFF -- Printer feed (IGNORED) */ - case 19: /* DECPEX -- Printer extent (IGNORED) */ - case 42: /* DECNRCM -- National characters (IGNORED) */ - case 12: /* att610 -- Start blinking cursor (IGNORED) */ - break; - case 25: /* DECTCEM -- Text Cursor Enable Mode */ - xsetmode(!set, MODE_HIDE); - break; - case 9: /* X10 mouse compatibility mode */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEX10); - break; - case 1000: /* 1000: report button press */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEBTN); - break; - case 1002: /* 1002: report motion on button press */ - xsetpointermotion(0); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEMOTION); - break; - case 1003: /* 1003: enable all mouse motions */ - xsetpointermotion(set); - xsetmode(0, MODE_MOUSE); - xsetmode(set, MODE_MOUSEMANY); - break; - case 1004: /* 1004: send focus events to tty */ - xsetmode(set, MODE_FOCUS); - break; - case 1006: /* 1006: extended reporting mode */ - xsetmode(set, MODE_MOUSESGR); - break; - case 1034: - xsetmode(set, MODE_8BIT); - break; - case 1049: /* swap screen & set/restore cursor as xterm */ - if (!allowaltscreen) - break; - tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); - /* FALLTHROUGH */ - case 47: /* swap screen */ - case 1047: - if (!allowaltscreen) - break; - alt = IS_SET(MODE_ALTSCREEN); - if (alt) { - tclearregion(0, 0, term.col-1, - term.row-1); - } - if (set ^ alt) /* set is always 1 or 0 */ - tswapscreen(); - if (*args != 1049) - break; - /* FALLTHROUGH */ - case 1048: - tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); - break; - case 2004: /* 2004: bracketed paste mode */ - xsetmode(set, MODE_BRCKTPASTE); - break; - /* Not implemented mouse modes. See comments there. */ - case 1001: /* mouse highlight mode; can hang the - terminal by design when implemented. */ - case 1005: /* UTF-8 mouse mode; will confuse - applications not supporting UTF-8 - and luit. */ - case 1015: /* urxvt mangled mouse mode; incompatible - and can be mistaken for other control - codes. */ - break; - default: - fprintf(stderr, - "erresc: unknown private set/reset mode %d\n", - *args); - break; - } - } else { - switch (*args) { - case 0: /* Error (IGNORED) */ - break; - case 2: - xsetmode(set, MODE_KBDLOCK); - break; - case 4: /* IRM -- Insertion-replacement */ - MODBIT(term.mode, set, MODE_INSERT); - break; - case 12: /* SRM -- Send/Receive */ - MODBIT(term.mode, !set, MODE_ECHO); - break; - case 20: /* LNM -- Linefeed/new line */ - MODBIT(term.mode, set, MODE_CRLF); - break; - default: - fprintf(stderr, - "erresc: unknown set/reset mode %d\n", - *args); - break; - } - } - } -} - -void -csihandle(void) -{ - char buf[40]; - int len; - - switch (csiescseq.mode[0]) { - default: - unknown: - fprintf(stderr, "erresc: unknown csi "); - csidump(); - /* die(""); */ - break; - case '@': /* ICH -- Insert blank char */ - DEFAULT(csiescseq.arg[0], 1); - tinsertblank(csiescseq.arg[0]); - break; - case 'A': /* CUU -- Cursor Up */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x, term.c.y-csiescseq.arg[0]); - break; - case 'B': /* CUD -- Cursor Down */ - case 'e': /* VPR --Cursor Down */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x, term.c.y+csiescseq.arg[0]); - break; - case 'i': /* MC -- Media Copy */ - switch (csiescseq.arg[0]) { - case 0: - tdump(); - break; - case 1: - tdumpline(term.c.y); - break; - case 2: - tdumpsel(); - break; - case 4: - term.mode &= ~MODE_PRINT; - break; - case 5: - term.mode |= MODE_PRINT; - break; - } - break; - case 'c': /* DA -- Device Attributes */ - if (csiescseq.arg[0] == 0) - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 'b': /* REP -- if last char is printable print it more times */ - DEFAULT(csiescseq.arg[0], 1); - if (term.lastc) - while (csiescseq.arg[0]-- > 0) - tputc(term.lastc); - break; - case 'C': /* CUF -- Cursor Forward */ - case 'a': /* HPR -- Cursor Forward */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x+csiescseq.arg[0], term.c.y); - break; - case 'D': /* CUB -- Cursor Backward */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(term.c.x-csiescseq.arg[0], term.c.y); - break; - case 'E': /* CNL -- Cursor Down and first col */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(0, term.c.y+csiescseq.arg[0]); - break; - case 'F': /* CPL -- Cursor Up and first col */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(0, term.c.y-csiescseq.arg[0]); - break; - case 'g': /* TBC -- Tabulation clear */ - switch (csiescseq.arg[0]) { - case 0: /* clear current tab stop */ - term.tabs[term.c.x] = 0; - break; - case 3: /* clear all the tabs */ - memset(term.tabs, 0, term.col * sizeof(*term.tabs)); - break; - default: - goto unknown; - } - break; - case 'G': /* CHA -- Move to */ - case '`': /* HPA */ - DEFAULT(csiescseq.arg[0], 1); - tmoveto(csiescseq.arg[0]-1, term.c.y); - break; - case 'H': /* CUP -- Move to */ - case 'f': /* HVP */ - DEFAULT(csiescseq.arg[0], 1); - DEFAULT(csiescseq.arg[1], 1); - tmoveato(csiescseq.arg[1]-1, csiescseq.arg[0]-1); - break; - case 'I': /* CHT -- Cursor Forward Tabulation tab stops */ - DEFAULT(csiescseq.arg[0], 1); - tputtab(csiescseq.arg[0]); - break; - case 'J': /* ED -- Clear screen */ - switch (csiescseq.arg[0]) { - case 0: /* below */ - tclearregion(term.c.x, term.c.y, term.col-1, term.c.y); - if (term.c.y < term.row-1) { - tclearregion(0, term.c.y+1, term.col-1, - term.row-1); - } - break; - case 1: /* above */ - if (term.c.y > 1) - tclearregion(0, 0, term.col-1, term.c.y-1); - tclearregion(0, term.c.y, term.c.x, term.c.y); - break; - case 2: /* all */ - tclearregion(0, 0, term.col-1, term.row-1); - break; - default: - goto unknown; - } - break; - case 'K': /* EL -- Clear line */ - switch (csiescseq.arg[0]) { - case 0: /* right */ - tclearregion(term.c.x, term.c.y, term.col-1, - term.c.y); - break; - case 1: /* left */ - tclearregion(0, term.c.y, term.c.x, term.c.y); - break; - case 2: /* all */ - tclearregion(0, term.c.y, term.col-1, term.c.y); - break; - } - break; - case 'S': /* SU -- Scroll line up */ - DEFAULT(csiescseq.arg[0], 1); - tscrollup(term.top, csiescseq.arg[0]); - break; - case 'T': /* SD -- Scroll line down */ - DEFAULT(csiescseq.arg[0], 1); - tscrolldown(term.top, csiescseq.arg[0]); - break; - case 'L': /* IL -- Insert blank lines */ - DEFAULT(csiescseq.arg[0], 1); - tinsertblankline(csiescseq.arg[0]); - break; - case 'l': /* RM -- Reset Mode */ - tsetmode(csiescseq.priv, 0, csiescseq.arg, csiescseq.narg); - break; - case 'M': /* DL -- Delete lines */ - DEFAULT(csiescseq.arg[0], 1); - tdeleteline(csiescseq.arg[0]); - break; - case 'X': /* ECH -- Erase char */ - DEFAULT(csiescseq.arg[0], 1); - tclearregion(term.c.x, term.c.y, - term.c.x + csiescseq.arg[0] - 1, term.c.y); - break; - case 'P': /* DCH -- Delete char */ - DEFAULT(csiescseq.arg[0], 1); - tdeletechar(csiescseq.arg[0]); - break; - case 'Z': /* CBT -- Cursor Backward Tabulation tab stops */ - DEFAULT(csiescseq.arg[0], 1); - tputtab(-csiescseq.arg[0]); - break; - case 'd': /* VPA -- Move to */ - DEFAULT(csiescseq.arg[0], 1); - tmoveato(term.c.x, csiescseq.arg[0]-1); - break; - case 'h': /* SM -- Set terminal mode */ - tsetmode(csiescseq.priv, 1, csiescseq.arg, csiescseq.narg); - break; - case 'm': /* SGR -- Terminal attribute (color) */ - tsetattr(csiescseq.arg, csiescseq.narg); - break; - case 'n': /* DSR – Device Status Report (cursor position) */ - if (csiescseq.arg[0] == 6) { - len = snprintf(buf, sizeof(buf), "\033[%i;%iR", - term.c.y+1, term.c.x+1); - ttywrite(buf, len, 0); - } - break; - case 'r': /* DECSTBM -- Set Scrolling Region */ - if (csiescseq.priv) { - goto unknown; - } else { - DEFAULT(csiescseq.arg[0], 1); - DEFAULT(csiescseq.arg[1], term.row); - tsetscroll(csiescseq.arg[0]-1, csiescseq.arg[1]-1); - tmoveato(0, 0); - } - break; - case 's': /* DECSC -- Save cursor position (ANSI.SYS) */ - tcursor(CURSOR_SAVE); - break; - case 'u': /* DECRC -- Restore cursor position (ANSI.SYS) */ - tcursor(CURSOR_LOAD); - break; - case ' ': - switch (csiescseq.mode[1]) { - case 'q': /* DECSCUSR -- Set Cursor Style */ - if (xsetcursor(csiescseq.arg[0])) - goto unknown; - break; - default: - goto unknown; - } - break; - } -} - -void -csidump(void) -{ - size_t i; - uint c; - - fprintf(stderr, "ESC["); - for (i = 0; i < csiescseq.len; i++) { - c = csiescseq.buf[i] & 0xff; - if (isprint(c)) { - putc(c, stderr); - } else if (c == '\n') { - fprintf(stderr, "(\\n)"); - } else if (c == '\r') { - fprintf(stderr, "(\\r)"); - } else if (c == 0x1b) { - fprintf(stderr, "(\\e)"); - } else { - fprintf(stderr, "(%02x)", c); - } - } - putc('\n', stderr); -} - -void -csireset(void) -{ - memset(&csiescseq, 0, sizeof(csiescseq)); -} - -void -osc_color_response(int num, int index, int is_osc4) -{ - int n; - char buf[32]; - unsigned char r, g, b; - - if (xgetcolor(is_osc4 ? num : index, &r, &g, &b)) { - fprintf(stderr, "erresc: failed to fetch %s color %d\n", - is_osc4 ? "osc4" : "osc", - is_osc4 ? num : index); - return; - } - - n = snprintf(buf, sizeof buf, "\033]%s%d;rgb:%02x%02x/%02x%02x/%02x%02x\007", - is_osc4 ? "4;" : "", num, r, r, g, g, b, b); - if (n < 0 || n >= sizeof(buf)) { - fprintf(stderr, "error: %s while printing %s response\n", - n < 0 ? "snprintf failed" : "truncation occurred", - is_osc4 ? "osc4" : "osc"); - } else { - ttywrite(buf, n, 1); - } -} - -void -strhandle(void) -{ - char *p = NULL, *dec; - int j, narg, par; - const struct { int idx; char *str; } osc_table[] = { - { defaultfg, "foreground" }, - { defaultbg, "background" }, - { defaultcs, "cursor" } - }; - - term.esc &= ~(ESC_STR_END|ESC_STR); - strparse(); - par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0; - - switch (strescseq.type) { - case ']': /* OSC -- Operating System Command */ - switch (par) { - case 0: - if (narg > 1) { - xsettitle(strescseq.args[1]); - xseticontitle(strescseq.args[1]); - } - return; - case 1: - if (narg > 1) - xseticontitle(strescseq.args[1]); - return; - case 2: - if (narg > 1) - xsettitle(strescseq.args[1]); - return; - case 52: - if (narg > 2 && allowwindowops) { - dec = base64dec(strescseq.args[2]); - if (dec) { - xsetsel(dec); - xclipcopy(); - } else { - fprintf(stderr, "erresc: invalid base64\n"); - } - } - return; - case 10: - case 11: - case 12: - if (narg < 2) - break; - p = strescseq.args[1]; - if ((j = par - 10) < 0 || j >= LEN(osc_table)) - break; /* shouldn't be possible */ - - if (!strcmp(p, "?")) { - osc_color_response(par, osc_table[j].idx, 0); - } else if (xsetcolorname(osc_table[j].idx, p)) { - fprintf(stderr, "erresc: invalid %s color: %s\n", - osc_table[j].str, p); - } else { - tfulldirt(); - } - return; - case 4: /* color set */ - if (narg < 3) - break; - p = strescseq.args[2]; - /* FALLTHROUGH */ - case 104: /* color reset */ - j = (narg > 1) ? atoi(strescseq.args[1]) : -1; - - if (p && !strcmp(p, "?")) { - osc_color_response(j, 0, 1); - } else if (xsetcolorname(j, p)) { - if (par == 104 && narg <= 1) - return; /* color reset without parameter */ - fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", - j, p ? p : "(null)"); - } else { - /* - * TODO if defaultbg color is changed, borders - * are dirty - */ - tfulldirt(); - } - return; - } - break; - case 'k': /* old title set compatibility */ - xsettitle(strescseq.args[0]); - return; - case 'P': /* DCS -- Device Control String */ - case '_': /* APC -- Application Program Command */ - case '^': /* PM -- Privacy Message */ - return; - } - - fprintf(stderr, "erresc: unknown str "); - strdump(); -} - -void -strparse(void) -{ - int c; - char *p = strescseq.buf; - - strescseq.narg = 0; - strescseq.buf[strescseq.len] = '\0'; - - if (*p == '\0') - return; - - while (strescseq.narg < STR_ARG_SIZ) { - strescseq.args[strescseq.narg++] = p; - while ((c = *p) != ';' && c != '\0') - ++p; - if (c == '\0') - return; - *p++ = '\0'; - } -} - -void -strdump(void) -{ - size_t i; - uint c; - - fprintf(stderr, "ESC%c", strescseq.type); - for (i = 0; i < strescseq.len; i++) { - c = strescseq.buf[i] & 0xff; - if (c == '\0') { - putc('\n', stderr); - return; - } else if (isprint(c)) { - putc(c, stderr); - } else if (c == '\n') { - fprintf(stderr, "(\\n)"); - } else if (c == '\r') { - fprintf(stderr, "(\\r)"); - } else if (c == 0x1b) { - fprintf(stderr, "(\\e)"); - } else { - fprintf(stderr, "(%02x)", c); - } - } - fprintf(stderr, "ESC\\\n"); -} - -void -strreset(void) -{ - strescseq = (STREscape){ - .buf = xrealloc(strescseq.buf, STR_BUF_SIZ), - .siz = STR_BUF_SIZ, - }; -} - -void -sendbreak(const Arg *arg) -{ - if (tcsendbreak(cmdfd, 0)) - perror("Error sending break"); -} - -void -tprinter(char *s, size_t len) -{ - if (iofd != -1 && xwrite(iofd, s, len) < 0) { - perror("Error writing to output file"); - close(iofd); - iofd = -1; - } -} - -void -toggleprinter(const Arg *arg) -{ - term.mode ^= MODE_PRINT; -} - -void -printscreen(const Arg *arg) -{ - tdump(); -} - -void -printsel(const Arg *arg) -{ - tdumpsel(); -} - -void -tdumpsel(void) -{ - char *ptr; - - if ((ptr = getsel())) { - tprinter(ptr, strlen(ptr)); - free(ptr); - } -} - -void -tdumpline(int n) -{ - char buf[UTF_SIZ]; - const Glyph *bp, *end; - - bp = &term.line[n][0]; - end = &bp[MIN(tlinelen(n), term.col) - 1]; - if (bp != end || bp->u != ' ') { - for ( ; bp <= end; ++bp) - tprinter(buf, utf8encode(bp->u, buf)); - } - tprinter("\n", 1); -} - -void -tdump(void) -{ - int i; - - for (i = 0; i < term.row; ++i) - tdumpline(i); -} - -void -tputtab(int n) -{ - uint x = term.c.x; - - if (n > 0) { - while (x < term.col && n--) - for (++x; x < term.col && !term.tabs[x]; ++x) - /* nothing */ ; - } else if (n < 0) { - while (x > 0 && n++) - for (--x; x > 0 && !term.tabs[x]; --x) - /* nothing */ ; - } - term.c.x = LIMIT(x, 0, term.col-1); -} - -void -tdefutf8(char ascii) -{ - if (ascii == 'G') - term.mode |= MODE_UTF8; - else if (ascii == '@') - term.mode &= ~MODE_UTF8; -} - -void -tdeftran(char ascii) -{ - static char cs[] = "0B"; - static int vcs[] = {CS_GRAPHIC0, CS_USA}; - char *p; - - if ((p = strchr(cs, ascii)) == NULL) { - fprintf(stderr, "esc unhandled charset: ESC ( %c\n", ascii); - } else { - term.trantbl[term.icharset] = vcs[p - cs]; - } -} - -void -tdectest(char c) -{ - int x, y; - - if (c == '8') { /* DEC screen alignment test. */ - for (x = 0; x < term.col; ++x) { - for (y = 0; y < term.row; ++y) - tsetchar('E', &term.c.attr, x, y); - } - } -} - -void -tstrsequence(uchar c) -{ - switch (c) { - case 0x90: /* DCS -- Device Control String */ - c = 'P'; - break; - case 0x9f: /* APC -- Application Program Command */ - c = '_'; - break; - case 0x9e: /* PM -- Privacy Message */ - c = '^'; - break; - case 0x9d: /* OSC -- Operating System Command */ - c = ']'; - break; - } - strreset(); - strescseq.type = c; - term.esc |= ESC_STR; -} - -void -tcontrolcode(uchar ascii) -{ - switch (ascii) { - case '\t': /* HT */ - tputtab(1); - return; - case '\b': /* BS */ - tmoveto(term.c.x-1, term.c.y); - return; - case '\r': /* CR */ - tmoveto(0, term.c.y); - return; - case '\f': /* LF */ - case '\v': /* VT */ - case '\n': /* LF */ - /* go to first col if the mode is set */ - tnewline(IS_SET(MODE_CRLF)); - return; - case '\a': /* BEL */ - if (term.esc & ESC_STR_END) { - /* backwards compatibility to xterm */ - strhandle(); - } else { - xbell(); - } - break; - case '\033': /* ESC */ - csireset(); - term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST); - term.esc |= ESC_START; - return; - case '\016': /* SO (LS1 -- Locking shift 1) */ - case '\017': /* SI (LS0 -- Locking shift 0) */ - term.charset = 1 - (ascii - '\016'); - return; - case '\032': /* SUB */ - tsetchar('?', &term.c.attr, term.c.x, term.c.y); - /* FALLTHROUGH */ - case '\030': /* CAN */ - csireset(); - break; - case '\005': /* ENQ (IGNORED) */ - case '\000': /* NUL (IGNORED) */ - case '\021': /* XON (IGNORED) */ - case '\023': /* XOFF (IGNORED) */ - case 0177: /* DEL (IGNORED) */ - return; - case 0x80: /* TODO: PAD */ - case 0x81: /* TODO: HOP */ - case 0x82: /* TODO: BPH */ - case 0x83: /* TODO: NBH */ - case 0x84: /* TODO: IND */ - break; - case 0x85: /* NEL -- Next line */ - tnewline(1); /* always go to first col */ - break; - case 0x86: /* TODO: SSA */ - case 0x87: /* TODO: ESA */ - break; - case 0x88: /* HTS -- Horizontal tab stop */ - term.tabs[term.c.x] = 1; - break; - case 0x89: /* TODO: HTJ */ - case 0x8a: /* TODO: VTS */ - case 0x8b: /* TODO: PLD */ - case 0x8c: /* TODO: PLU */ - case 0x8d: /* TODO: RI */ - case 0x8e: /* TODO: SS2 */ - case 0x8f: /* TODO: SS3 */ - case 0x91: /* TODO: PU1 */ - case 0x92: /* TODO: PU2 */ - case 0x93: /* TODO: STS */ - case 0x94: /* TODO: CCH */ - case 0x95: /* TODO: MW */ - case 0x96: /* TODO: SPA */ - case 0x97: /* TODO: EPA */ - case 0x98: /* TODO: SOS */ - case 0x99: /* TODO: SGCI */ - break; - case 0x9a: /* DECID -- Identify Terminal */ - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 0x9b: /* TODO: CSI */ - case 0x9c: /* TODO: ST */ - break; - case 0x90: /* DCS -- Device Control String */ - case 0x9d: /* OSC -- Operating System Command */ - case 0x9e: /* PM -- Privacy Message */ - case 0x9f: /* APC -- Application Program Command */ - tstrsequence(ascii); - return; - } - /* only CAN, SUB, \a and C1 chars interrupt a sequence */ - term.esc &= ~(ESC_STR_END|ESC_STR); -} - -/* - * returns 1 when the sequence is finished and it hasn't to read - * more characters for this sequence, otherwise 0 - */ -int -eschandle(uchar ascii) -{ - switch (ascii) { - case '[': - term.esc |= ESC_CSI; - return 0; - case '#': - term.esc |= ESC_TEST; - return 0; - case '%': - term.esc |= ESC_UTF8; - return 0; - case 'P': /* DCS -- Device Control String */ - case '_': /* APC -- Application Program Command */ - case '^': /* PM -- Privacy Message */ - case ']': /* OSC -- Operating System Command */ - case 'k': /* old title set compatibility */ - tstrsequence(ascii); - return 0; - case 'n': /* LS2 -- Locking shift 2 */ - case 'o': /* LS3 -- Locking shift 3 */ - term.charset = 2 + (ascii - 'n'); - break; - case '(': /* GZD4 -- set primary charset G0 */ - case ')': /* G1D4 -- set secondary charset G1 */ - case '*': /* G2D4 -- set tertiary charset G2 */ - case '+': /* G3D4 -- set quaternary charset G3 */ - term.icharset = ascii - '('; - term.esc |= ESC_ALTCHARSET; - return 0; - case 'D': /* IND -- Linefeed */ - if (term.c.y == term.bot) { - tscrollup(term.top, 1); - } else { - tmoveto(term.c.x, term.c.y+1); - } - break; - case 'E': /* NEL -- Next line */ - tnewline(1); /* always go to first col */ - break; - case 'H': /* HTS -- Horizontal tab stop */ - term.tabs[term.c.x] = 1; - break; - case 'M': /* RI -- Reverse index */ - if (term.c.y == term.top) { - tscrolldown(term.top, 1); - } else { - tmoveto(term.c.x, term.c.y-1); - } - break; - case 'Z': /* DECID -- Identify Terminal */ - ttywrite(vtiden, strlen(vtiden), 0); - break; - case 'c': /* RIS -- Reset to initial state */ - treset(); - resettitle(); - xloadcols(); - break; - case '=': /* DECPAM -- Application keypad */ - xsetmode(1, MODE_APPKEYPAD); - break; - case '>': /* DECPNM -- Normal keypad */ - xsetmode(0, MODE_APPKEYPAD); - break; - case '7': /* DECSC -- Save Cursor */ - tcursor(CURSOR_SAVE); - break; - case '8': /* DECRC -- Restore Cursor */ - tcursor(CURSOR_LOAD); - break; - case '\\': /* ST -- String Terminator */ - if (term.esc & ESC_STR_END) - strhandle(); - break; - default: - fprintf(stderr, "erresc: unknown sequence ESC 0x%02X '%c'\n", - (uchar) ascii, isprint(ascii)? ascii:'.'); - break; - } - return 1; -} - -void -tputc(Rune u) -{ - char c[UTF_SIZ]; - int control; - int width, len; - Glyph *gp; - - control = ISCONTROL(u); - if (u < 127 || !IS_SET(MODE_UTF8)) { - c[0] = u; - width = len = 1; - } else { - len = utf8encode(u, c); - if (!control && (width = wcwidth(u)) == -1) - width = 1; - } - - if (IS_SET(MODE_PRINT)) - tprinter(c, len); - - /* - * STR sequence must be checked before anything else - * because it uses all following characters until it - * receives a ESC, a SUB, a ST or any other C1 control - * character. - */ - if (term.esc & ESC_STR) { - if (u == '\a' || u == 030 || u == 032 || u == 033 || - ISCONTROLC1(u)) { - term.esc &= ~(ESC_START|ESC_STR); - term.esc |= ESC_STR_END; - goto check_control_code; - } - - if (strescseq.len+len >= strescseq.siz) { - /* - * Here is a bug in terminals. If the user never sends - * some code to stop the str or esc command, then st - * will stop responding. But this is better than - * silently failing with unknown characters. At least - * then users will report back. - * - * In the case users ever get fixed, here is the code: - */ - /* - * term.esc = 0; - * strhandle(); - */ - if (strescseq.siz > (SIZE_MAX - UTF_SIZ) / 2) - return; - strescseq.siz *= 2; - strescseq.buf = xrealloc(strescseq.buf, strescseq.siz); - } - - memmove(&strescseq.buf[strescseq.len], c, len); - strescseq.len += len; - return; - } - -check_control_code: - /* - * Actions of control codes must be performed as soon they arrive - * because they can be embedded inside a control sequence, and - * they must not cause conflicts with sequences. - */ - if (control) { - tcontrolcode(u); - /* - * control codes are not shown ever - */ - if (!term.esc) - term.lastc = 0; - return; - } else if (term.esc & ESC_START) { - if (term.esc & ESC_CSI) { - csiescseq.buf[csiescseq.len++] = u; - if (BETWEEN(u, 0x40, 0x7E) - || csiescseq.len >= \ - sizeof(csiescseq.buf)-1) { - term.esc = 0; - csiparse(); - csihandle(); - } - return; - } else if (term.esc & ESC_UTF8) { - tdefutf8(u); - } else if (term.esc & ESC_ALTCHARSET) { - tdeftran(u); - } else if (term.esc & ESC_TEST) { - tdectest(u); - } else { - if (!eschandle(u)) - return; - /* sequence already finished */ - } - term.esc = 0; - /* - * All characters which form part of a sequence are not - * printed - */ - return; - } - if (selected(term.c.x, term.c.y)) - selclear(); - - gp = &term.line[term.c.y][term.c.x]; - if (IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) { - gp->mode |= ATTR_WRAP; - tnewline(1); - gp = &term.line[term.c.y][term.c.x]; - } - - if (IS_SET(MODE_INSERT) && term.c.x+width < term.col) - memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Glyph)); - - if (term.c.x+width > term.col) { - tnewline(1); - gp = &term.line[term.c.y][term.c.x]; - } - - tsetchar(u, &term.c.attr, term.c.x, term.c.y); - term.lastc = u; - - if (width == 2) { - gp->mode |= ATTR_WIDE; - if (term.c.x+1 < term.col) { - if (gp[1].mode == ATTR_WIDE && term.c.x+2 < term.col) { - gp[2].u = ' '; - gp[2].mode &= ~ATTR_WDUMMY; - } - gp[1].u = '\0'; - gp[1].mode = ATTR_WDUMMY; - } - } - if (term.c.x+width < term.col) { - tmoveto(term.c.x+width, term.c.y); - } else { - term.c.state |= CURSOR_WRAPNEXT; - } -} - -int -twrite(const char *buf, int buflen, int show_ctrl) -{ - int charsize; - Rune u; - int n; - - for (n = 0; n < buflen; n += charsize) { - if (IS_SET(MODE_UTF8)) { - /* process a complete utf8 char */ - charsize = utf8decode(buf + n, &u, buflen - n); - if (charsize == 0) - break; - } else { - u = buf[n] & 0xFF; - charsize = 1; - } - if (show_ctrl && ISCONTROL(u)) { - if (u & 0x80) { - u &= 0x7f; - tputc('^'); - tputc('['); - } else if (u != '\n' && u != '\r' && u != '\t') { - u ^= 0x40; - tputc('^'); - } - } - tputc(u); - } - return n; -} - -void -tresize(int col, int row) -{ - int i; - int minrow = MIN(row, term.row); - int mincol = MIN(col, term.col); - int *bp; - TCursor c; - - if (col < 1 || row < 1) { - fprintf(stderr, - "tresize: error resizing to %dx%d\n", col, row); - return; - } - - /* - * slide screen to keep cursor where we expect it - - * tscrollup would work here, but we can optimize to - * memmove because we're freeing the earlier lines - */ - for (i = 0; i <= term.c.y - row; i++) { - free(term.line[i]); - free(term.alt[i]); - } - /* ensure that both src and dst are not NULL */ - if (i > 0) { - memmove(term.line, term.line + i, row * sizeof(Line)); - memmove(term.alt, term.alt + i, row * sizeof(Line)); - } - for (i += row; i < term.row; i++) { - free(term.line[i]); - free(term.alt[i]); - } - - /* resize to new height */ - term.line = xrealloc(term.line, row * sizeof(Line)); - term.alt = xrealloc(term.alt, row * sizeof(Line)); - term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); - term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); - - /* resize each row to new width, zero-pad if needed */ - for (i = 0; i < minrow; i++) { - term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); - term.alt[i] = xrealloc(term.alt[i], col * sizeof(Glyph)); - } - - /* allocate any new rows */ - for (/* i = minrow */; i < row; i++) { - term.line[i] = xmalloc(col * sizeof(Glyph)); - term.alt[i] = xmalloc(col * sizeof(Glyph)); - } - if (col > term.col) { - bp = term.tabs + term.col; - - memset(bp, 0, sizeof(*term.tabs) * (col - term.col)); - while (--bp > term.tabs && !*bp) - /* nothing */ ; - for (bp += tabspaces; bp < term.tabs + col; bp += tabspaces) - *bp = 1; - } - /* update terminal size */ - term.col = col; - term.row = row; - /* reset scrolling region */ - tsetscroll(0, row-1); - /* make use of the LIMIT in tmoveto */ - tmoveto(term.c.x, term.c.y); - /* Clearing both screens (it makes dirty all lines) */ - c = term.c; - for (i = 0; i < 2; i++) { - if (mincol < col && 0 < minrow) { - tclearregion(mincol, 0, col - 1, minrow - 1); - } - if (0 < col && minrow < row) { - tclearregion(0, minrow, col - 1, row - 1); - } - tswapscreen(); - tcursor(CURSOR_LOAD); - } - term.c = c; -} - -void -resettitle(void) -{ - xsettitle(NULL); -} - -void -drawregion(int x1, int y1, int x2, int y2) -{ - int y; - - for (y = y1; y < y2; y++) { - if (!term.dirty[y]) - continue; - - term.dirty[y] = 0; - xdrawline(term.line[y], x1, y, x2); - } -} - -void -draw(void) -{ - int cx = term.c.x, ocx = term.ocx, ocy = term.ocy; - - if (!xstartdraw()) - return; - - /* adjust cursor position */ - LIMIT(term.ocx, 0, term.col-1); - LIMIT(term.ocy, 0, term.row-1); - if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY) - term.ocx--; - if (term.line[term.c.y][cx].mode & ATTR_WDUMMY) - cx--; - - drawregion(0, 0, term.col, term.row); - xdrawcursor(cx, term.c.y, term.line[term.c.y][cx], - term.ocx, term.ocy, term.line[term.ocy][term.ocx]); - term.ocx = cx; - term.ocy = term.c.y; - xfinishdraw(); - if (ocx != term.ocx || ocy != term.ocy) - xximspot(term.ocx, term.ocy); -} - -void -redraw(void) -{ - tfulldirt(); - draw(); -} diff --git a/dwm/st/st.h b/dwm/st/st.h deleted file mode 100644 index 1ea0062..0000000 --- a/dwm/st/st.h +++ /dev/null @@ -1,134 +0,0 @@ -/* See LICENSE for license details. */ - -#include -#include - -/* macros */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define MAX(a, b) ((a) < (b) ? (b) : (a)) -#define LEN(a) (sizeof(a) / sizeof(a)[0]) -#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) -#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) -#define DEFAULT(a, b) (a) = (a) ? (a) : (b) -#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) -#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ - (a).bg != (b).bg) -#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ - (t1.tv_nsec-t2.tv_nsec)/1E6) -#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) - -#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) -#define IS_TRUECOL(x) (1 << 24 & (x)) -#define HISTSIZE 2000 - -enum glyph_attribute { - ATTR_NULL = 0, - ATTR_BOLD = 1 << 0, - ATTR_FAINT = 1 << 1, - ATTR_ITALIC = 1 << 2, - ATTR_UNDERLINE = 1 << 3, - ATTR_BLINK = 1 << 4, - ATTR_REVERSE = 1 << 5, - ATTR_INVISIBLE = 1 << 6, - ATTR_STRUCK = 1 << 7, - ATTR_WRAP = 1 << 8, - ATTR_WIDE = 1 << 9, - ATTR_WDUMMY = 1 << 10, - ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, -}; - -enum drawing_mode { - DRAW_NONE = 0, - DRAW_BG = 1 << 0, - DRAW_FG = 1 << 1, -}; - -enum selection_mode { - SEL_IDLE = 0, - SEL_EMPTY = 1, - SEL_READY = 2 -}; - -enum selection_type { - SEL_REGULAR = 1, - SEL_RECTANGULAR = 2 -}; - -enum selection_snap { - SNAP_WORD = 1, - SNAP_LINE = 2 -}; - -typedef unsigned char uchar; -typedef unsigned int uint; -typedef unsigned long ulong; -typedef unsigned short ushort; - -typedef uint_least32_t Rune; - -#define Glyph Glyph_ -typedef struct { - Rune u; /* character code */ - ushort mode; /* attribute flags */ - uint32_t fg; /* foreground */ - uint32_t bg; /* background */ -} Glyph; - -typedef Glyph *Line; - -typedef union { - int i; - uint ui; - float f; - const void *v; - const char *s; -} Arg; - -void die(const char *, ...); -void redraw(void); -void draw(void); - -void printscreen(const Arg *); -void printsel(const Arg *); -void sendbreak(const Arg *); -void toggleprinter(const Arg *); - -int tattrset(int); -void tnew(int, int); -void tresize(int, int); -void tsetdirtattr(int); -void ttyhangup(void); -int ttynew(const char *, char *, const char *, char **); -size_t ttyread(void); -void ttyresize(int, int); -void ttywrite(const char *, size_t, int); - -void resettitle(void); - -void selclear(void); -void selinit(void); -void selstart(int, int, int); -void selextend(int, int, int, int); -int selected(int, int); -char *getsel(void); - -size_t utf8encode(Rune, char *); - -void *xmalloc(size_t); -void *xrealloc(void *, size_t); -char *xstrdup(const char *); - -/* config.h globals */ -extern char *utmp; -extern char *scroll; -extern char *stty_args; -extern char *vtiden; -extern wchar_t *worddelimiters; -extern int allowaltscreen; -extern int allowwindowops; -extern char *termname; -extern unsigned int tabspaces; -extern unsigned int defaultfg; -extern unsigned int defaultbg; -extern unsigned int defaultcs; -extern float alpha; diff --git a/dwm/st/st.info b/dwm/st/st.info deleted file mode 100644 index 8201ad6..0000000 --- a/dwm/st/st.info +++ /dev/null @@ -1,239 +0,0 @@ -st-mono| simpleterm monocolor, - acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, - am, - bce, - bel=^G, - blink=\E[5m, - bold=\E[1m, - cbt=\E[Z, - cvvis=\E[?25h, - civis=\E[?25l, - clear=\E[H\E[2J, - cnorm=\E[?12l\E[?25h, - colors#2, - cols#80, - cr=^M, - csr=\E[%i%p1%d;%p2%dr, - cub=\E[%p1%dD, - cub1=^H, - cud1=^J, - cud=\E[%p1%dB, - cuf1=\E[C, - cuf=\E[%p1%dC, - cup=\E[%i%p1%d;%p2%dH, - cuu1=\E[A, - cuu=\E[%p1%dA, - dch=\E[%p1%dP, - dch1=\E[P, - dim=\E[2m, - dl=\E[%p1%dM, - dl1=\E[M, - ech=\E[%p1%dX, - ed=\E[J, - el=\E[K, - el1=\E[1K, - enacs=\E)0, - flash=\E[?5h$<80/>\E[?5l, - fsl=^G, - home=\E[H, - hpa=\E[%i%p1%dG, - hs, - ht=^I, - hts=\EH, - ich=\E[%p1%d@, - il1=\E[L, - il=\E[%p1%dL, - ind=^J, - indn=\E[%p1%dS, - invis=\E[8m, - is2=\E[4l\E>\E[?1034l, - it#8, - kel=\E[1;2F, - ked=\E[1;5F, - ka1=\E[1~, - ka3=\E[5~, - kc1=\E[4~, - kc3=\E[6~, - kbs=\177, - kcbt=\E[Z, - kb2=\EOu, - kcub1=\EOD, - kcud1=\EOB, - kcuf1=\EOC, - kcuu1=\EOA, - kDC=\E[3;2~, - kent=\EOM, - kEND=\E[1;2F, - kIC=\E[2;2~, - kNXT=\E[6;2~, - kPRV=\E[5;2~, - kHOM=\E[1;2H, - kLFT=\E[1;2D, - kRIT=\E[1;2C, - kind=\E[1;2B, - kri=\E[1;2A, - kclr=\E[3;5~, - kdl1=\E[3;2~, - kdch1=\E[3~, - kich1=\E[2~, - kend=\E[4~, - kf1=\EOP, - kf2=\EOQ, - kf3=\EOR, - kf4=\EOS, - kf5=\E[15~, - kf6=\E[17~, - kf7=\E[18~, - kf8=\E[19~, - kf9=\E[20~, - kf10=\E[21~, - kf11=\E[23~, - kf12=\E[24~, - kf13=\E[1;2P, - kf14=\E[1;2Q, - kf15=\E[1;2R, - kf16=\E[1;2S, - kf17=\E[15;2~, - kf18=\E[17;2~, - kf19=\E[18;2~, - kf20=\E[19;2~, - kf21=\E[20;2~, - kf22=\E[21;2~, - kf23=\E[23;2~, - kf24=\E[24;2~, - kf25=\E[1;5P, - kf26=\E[1;5Q, - kf27=\E[1;5R, - kf28=\E[1;5S, - kf29=\E[15;5~, - kf30=\E[17;5~, - kf31=\E[18;5~, - kf32=\E[19;5~, - kf33=\E[20;5~, - kf34=\E[21;5~, - kf35=\E[23;5~, - kf36=\E[24;5~, - kf37=\E[1;6P, - kf38=\E[1;6Q, - kf39=\E[1;6R, - kf40=\E[1;6S, - kf41=\E[15;6~, - kf42=\E[17;6~, - kf43=\E[18;6~, - kf44=\E[19;6~, - kf45=\E[20;6~, - kf46=\E[21;6~, - kf47=\E[23;6~, - kf48=\E[24;6~, - kf49=\E[1;3P, - kf50=\E[1;3Q, - kf51=\E[1;3R, - kf52=\E[1;3S, - kf53=\E[15;3~, - kf54=\E[17;3~, - kf55=\E[18;3~, - kf56=\E[19;3~, - kf57=\E[20;3~, - kf58=\E[21;3~, - kf59=\E[23;3~, - kf60=\E[24;3~, - kf61=\E[1;4P, - kf62=\E[1;4Q, - kf63=\E[1;4R, - khome=\E[1~, - kil1=\E[2;5~, - krmir=\E[2;2~, - knp=\E[6~, - kmous=\E[M, - kpp=\E[5~, - lines#24, - mir, - msgr, - npc, - op=\E[39;49m, - pairs#64, - mc0=\E[i, - mc4=\E[4i, - mc5=\E[5i, - rc=\E8, - rev=\E[7m, - ri=\EM, - rin=\E[%p1%dT, - ritm=\E[23m, - rmacs=\E(B, - rmcup=\E[?1049l, - rmir=\E[4l, - rmkx=\E[?1l\E>, - rmso=\E[27m, - rmul=\E[24m, - rs1=\Ec, - rs2=\E[4l\E>\E[?1034l, - sc=\E7, - sitm=\E[3m, - sgr0=\E[0m, - smacs=\E(0, - smcup=\E[?1049h, - smir=\E[4h, - smkx=\E[?1h\E=, - smso=\E[7m, - smul=\E[4m, - tbc=\E[3g, - tsl=\E]0;, - xenl, - vpa=\E[%i%p1%dd, -# XTerm extensions - rmxx=\E[29m, - smxx=\E[9m, -# disabled rep for now: causes some issues with older ncurses versions. -# rep=%p1%c\E[%p2%{1}%-%db, -# tmux extensions, see TERMINFO EXTENSIONS in tmux(1) - Tc, - Ms=\E]52;%p1%s;%p2%s\007, - Se=\E[2 q, - Ss=\E[%p1%d q, - -st| simpleterm, - use=st-mono, - colors#8, - setab=\E[4%p1%dm, - setaf=\E[3%p1%dm, - setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, - -st-256color| simpleterm with 256 colors, - use=st, - ccc, - colors#256, - oc=\E]104\007, - pairs#32767, -# Nicked from xterm-256color - initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, - setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, - setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, - -st-meta| simpleterm with meta key, - use=st, - km, - rmm=\E[?1034l, - smm=\E[?1034h, - rs2=\E[4l\E>\E[?1034h, - is2=\E[4l\E>\E[?1034h, - -st-meta-256color| simpleterm with meta key and 256 colors, - use=st-256color, - km, - rmm=\E[?1034l, - smm=\E[?1034h, - rs2=\E[4l\E>\E[?1034h, - is2=\E[4l\E>\E[?1034h, - -st-bs| simpleterm with backspace as backspace, - use=st, - kbs=\010, - kdch1=\177, - -st-bs-256color| simpleterm with backspace as backspace and 256colors, - use=st-256color, - kbs=\010, - kdch1=\177, diff --git a/dwm/st/st.o b/dwm/st/st.o deleted file mode 100644 index e600250..0000000 Binary files a/dwm/st/st.o and /dev/null differ diff --git a/dwm/st/win.h b/dwm/st/win.h deleted file mode 100644 index 6de960d..0000000 --- a/dwm/st/win.h +++ /dev/null @@ -1,41 +0,0 @@ -/* See LICENSE for license details. */ - -enum win_mode { - MODE_VISIBLE = 1 << 0, - MODE_FOCUSED = 1 << 1, - MODE_APPKEYPAD = 1 << 2, - MODE_MOUSEBTN = 1 << 3, - MODE_MOUSEMOTION = 1 << 4, - MODE_REVERSE = 1 << 5, - MODE_KBDLOCK = 1 << 6, - MODE_HIDE = 1 << 7, - MODE_APPCURSOR = 1 << 8, - MODE_MOUSESGR = 1 << 9, - MODE_8BIT = 1 << 10, - MODE_BLINK = 1 << 11, - MODE_FBLINK = 1 << 12, - MODE_FOCUS = 1 << 13, - MODE_MOUSEX10 = 1 << 14, - MODE_MOUSEMANY = 1 << 15, - MODE_BRCKTPASTE = 1 << 16, - MODE_NUMLOCK = 1 << 17, - MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\ - |MODE_MOUSEMANY, -}; - -void xbell(void); -void xclipcopy(void); -void xdrawcursor(int, int, Glyph, int, int, Glyph); -void xdrawline(Line, int, int, int); -void xfinishdraw(void); -void xloadcols(void); -int xsetcolorname(int, const char *); -int xgetcolor(int, unsigned char *, unsigned char *, unsigned char *); -void xseticontitle(char *); -void xsettitle(char *); -int xsetcursor(int); -void xsetmode(int, unsigned int); -void xsetpointermotion(int); -void xsetsel(char *); -int xstartdraw(void); -void xximspot(int, int); diff --git a/dwm/st/x.c b/dwm/st/x.c deleted file mode 100644 index 50c9560..0000000 --- a/dwm/st/x.c +++ /dev/null @@ -1,2223 +0,0 @@ -/* See LICENSE for license details. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -char *argv0; -#include "arg.h" -#include "st.h" -#include "win.h" - -/* types used in config.h */ -typedef struct { - uint mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Shortcut; - -typedef struct { - uint mod; - uint button; - void (*func)(const Arg *); - const Arg arg; - uint release; -} MouseShortcut; - -typedef struct { - KeySym k; - uint mask; - char *s; - /* three-valued logic variables: 0 indifferent, 1 on, -1 off */ - signed char appkey; /* application keypad */ - signed char appcursor; /* application cursor */ -} Key; - -/* X modifiers */ -#define XK_ANY_MOD UINT_MAX -#define XK_NO_MOD 0 -#define XK_SWITCH_MOD (1<<13|1<<14) - -/* function definitions used in config.h */ -static void clipcopy(const Arg *); -static void clippaste(const Arg *); -static void numlock(const Arg *); -static void selpaste(const Arg *); -static void zoom(const Arg *); -static void zoomabs(const Arg *); -static void zoomreset(const Arg *); -static void ttysend(const Arg *); -void kscrollup(const Arg *); -void kscrolldown(const Arg *); - -/* config.h for applying patches and the configuration. */ -#include "config.h" - -/* XEMBED messages */ -#define XEMBED_FOCUS_IN 4 -#define XEMBED_FOCUS_OUT 5 - -/* macros */ -#define IS_SET(flag) ((win.mode & (flag)) != 0) -#define TRUERED(x) (((x) & 0xff0000) >> 8) -#define TRUEGREEN(x) (((x) & 0xff00)) -#define TRUEBLUE(x) (((x) & 0xff) << 8) - -typedef XftDraw *Draw; -typedef XftColor Color; -typedef XftGlyphFontSpec GlyphFontSpec; - -/* Purely graphic info */ -typedef struct { - int tw, th; /* tty width and height */ - int w, h; /* window width and height */ - int ch; /* char height */ - int cw; /* char width */ - int mode; /* window state/mode flags */ - int cursor; /* cursor style */ -} TermWindow; - -typedef struct { - Display *dpy; - Colormap cmap; - Window win; - Drawable buf; - GlyphFontSpec *specbuf; /* font spec buffer used for rendering */ - Atom xembed, wmdeletewin, netwmname, netwmiconname, netwmpid; - struct { - XIM xim; - XIC xic; - XPoint spot; - XVaNestedList spotlist; - } ime; - Draw draw; - Visual *vis; - XSetWindowAttributes attrs; - int scr; - int isfixed; /* is fixed geometry? */ - int depth; /* bit depth */ - int l, t; /* left and top offset */ - int gm; /* geometry mask */ -} XWindow; - -typedef struct { - Atom xtarget; - char *primary, *clipboard; - struct timespec tclick1; - struct timespec tclick2; -} XSelection; - -/* Font structure */ -#define Font Font_ -typedef struct { - int height; - int width; - int ascent; - int descent; - int badslant; - int badweight; - short lbearing; - short rbearing; - XftFont *match; - FcFontSet *set; - FcPattern *pattern; -} Font; - -/* Drawing Context */ -typedef struct { - Color *col; - size_t collen; - Font font, bfont, ifont, ibfont; - GC gc; -} DC; - -static inline ushort sixd_to_16bit(int); -static int xmakeglyphfontspecs(XftGlyphFontSpec *, const Glyph *, int, int, int); -static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int, int); -static void xdrawglyph(Glyph, int, int); -static void xclear(int, int, int, int); -static int xgeommasktogravity(int); -static int ximopen(Display *); -static void ximinstantiate(Display *, XPointer, XPointer); -static void ximdestroy(XIM, XPointer, XPointer); -static int xicdestroy(XIC, XPointer, XPointer); -static void xinit(int, int); -static void cresize(int, int); -static void xresize(int, int); -static void xhints(void); -static int xloadcolor(int, const char *, Color *); -static int xloadfont(Font *, FcPattern *); -static void xloadfonts(const char *, double); -static int xloadsparefont(FcPattern *, int); -static void xloadsparefonts(void); -static void xunloadfont(Font *); -static void xunloadfonts(void); -static void xsetenv(void); -static void xseturgency(int); -static int evcol(XEvent *); -static int evrow(XEvent *); - -static void expose(XEvent *); -static void visibility(XEvent *); -static void unmap(XEvent *); -static void kpress(XEvent *); -static void cmessage(XEvent *); -static void resize(XEvent *); -static void focus(XEvent *); -static uint buttonmask(uint); -static int mouseaction(XEvent *, uint); -static void brelease(XEvent *); -static void bpress(XEvent *); -static void bmotion(XEvent *); -static void propnotify(XEvent *); -static void selnotify(XEvent *); -static void selclear_(XEvent *); -static void selrequest(XEvent *); -static void setsel(char *, Time); -static void mousesel(XEvent *, int); -static void mousereport(XEvent *); -static char *kmap(KeySym, uint); -static int match(uint, uint); - -static void run(void); -static void usage(void); - -static void (*handler[LASTEvent])(XEvent *) = { - [KeyPress] = kpress, - [ClientMessage] = cmessage, - [ConfigureNotify] = resize, - [VisibilityNotify] = visibility, - [UnmapNotify] = unmap, - [Expose] = expose, - [FocusIn] = focus, - [FocusOut] = focus, - [MotionNotify] = bmotion, - [ButtonPress] = bpress, - [ButtonRelease] = brelease, -/* - * Uncomment if you want the selection to disappear when you select something - * different in another window. - */ -/* [SelectionClear] = selclear_, */ - [SelectionNotify] = selnotify, -/* - * PropertyNotify is only turned on when there is some INCR transfer happening - * for the selection retrieval. - */ - [PropertyNotify] = propnotify, - [SelectionRequest] = selrequest, -}; - -/* Globals */ -static DC dc; -static XWindow xw; -static XSelection xsel; -static TermWindow win; - -/* Font Ring Cache */ -enum { - FRC_NORMAL, - FRC_ITALIC, - FRC_BOLD, - FRC_ITALICBOLD -}; - -typedef struct { - XftFont *font; - int flags; - Rune unicodep; -} Fontcache; - -/* Fontcache is an array now. A new font will be appended to the array. */ -static Fontcache *frc = NULL; -static int frclen = 0; -static int frccap = 0; -static char *usedfont = NULL; -static double usedfontsize = 0; -static double defaultfontsize = 0; - -static char *opt_alpha = NULL; -static char *opt_class = NULL; -static char **opt_cmd = NULL; -static char *opt_embed = NULL; -static char *opt_font = NULL; -static char *opt_io = NULL; -static char *opt_line = NULL; -static char *opt_name = NULL; -static char *opt_title = NULL; - -static uint buttons; /* bit field of pressed buttons */ - -void -clipcopy(const Arg *dummy) -{ - Atom clipboard; - - free(xsel.clipboard); - xsel.clipboard = NULL; - - if (xsel.primary != NULL) { - xsel.clipboard = xstrdup(xsel.primary); - clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); - XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime); - } -} - -void -clippaste(const Arg *dummy) -{ - Atom clipboard; - - clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); - XConvertSelection(xw.dpy, clipboard, xsel.xtarget, clipboard, - xw.win, CurrentTime); -} - -void -selpaste(const Arg *dummy) -{ - XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY, - xw.win, CurrentTime); -} - -void -numlock(const Arg *dummy) -{ - win.mode ^= MODE_NUMLOCK; -} - -void -zoom(const Arg *arg) -{ - Arg larg; - - larg.f = usedfontsize + arg->f; - zoomabs(&larg); -} - -void -zoomabs(const Arg *arg) -{ - xunloadfonts(); - xloadfonts(usedfont, arg->f); - xloadsparefonts(); - cresize(0, 0); - redraw(); - xhints(); -} - -void -zoomreset(const Arg *arg) -{ - Arg larg; - - if (defaultfontsize > 0) { - larg.f = defaultfontsize; - zoomabs(&larg); - } -} - -void -ttysend(const Arg *arg) -{ - ttywrite(arg->s, strlen(arg->s), 1); -} - -int -evcol(XEvent *e) -{ - int x = e->xbutton.x - borderpx; - LIMIT(x, 0, win.tw - 1); - return x / win.cw; -} - -int -evrow(XEvent *e) -{ - int y = e->xbutton.y - borderpx; - LIMIT(y, 0, win.th - 1); - return y / win.ch; -} - -void -mousesel(XEvent *e, int done) -{ - int type, seltype = SEL_REGULAR; - uint state = e->xbutton.state & ~(Button1Mask | forcemousemod); - - for (type = 1; type < LEN(selmasks); ++type) { - if (match(selmasks[type], state)) { - seltype = type; - break; - } - } - selextend(evcol(e), evrow(e), seltype, done); - if (done) - setsel(getsel(), e->xbutton.time); -} - -void -mousereport(XEvent *e) -{ - int len, btn, code; - int x = evcol(e), y = evrow(e); - int state = e->xbutton.state; - char buf[40]; - static int ox, oy; - - if (e->type == MotionNotify) { - if (x == ox && y == oy) - return; - if (!IS_SET(MODE_MOUSEMOTION) && !IS_SET(MODE_MOUSEMANY)) - return; - /* MODE_MOUSEMOTION: no reporting if no button is pressed */ - if (IS_SET(MODE_MOUSEMOTION) && buttons == 0) - return; - /* Set btn to lowest-numbered pressed button, or 12 if no - * buttons are pressed. */ - for (btn = 1; btn <= 11 && !(buttons & (1<<(btn-1))); btn++) - ; - code = 32; - } else { - btn = e->xbutton.button; - /* Only buttons 1 through 11 can be encoded */ - if (btn < 1 || btn > 11) - return; - if (e->type == ButtonRelease) { - /* MODE_MOUSEX10: no button release reporting */ - if (IS_SET(MODE_MOUSEX10)) - return; - /* Don't send release events for the scroll wheel */ - if (btn == 4 || btn == 5) - return; - } - code = 0; - } - - ox = x; - oy = y; - - /* Encode btn into code. If no button is pressed for a motion event in - * MODE_MOUSEMANY, then encode it as a release. */ - if ((!IS_SET(MODE_MOUSESGR) && e->type == ButtonRelease) || btn == 12) - code += 3; - else if (btn >= 8) - code += 128 + btn - 8; - else if (btn >= 4) - code += 64 + btn - 4; - else - code += btn - 1; - - if (!IS_SET(MODE_MOUSEX10)) { - code += ((state & ShiftMask ) ? 4 : 0) - + ((state & Mod1Mask ) ? 8 : 0) /* meta key: alt */ - + ((state & ControlMask) ? 16 : 0); - } - - if (IS_SET(MODE_MOUSESGR)) { - len = snprintf(buf, sizeof(buf), "\033[<%d;%d;%d%c", - code, x+1, y+1, - e->type == ButtonRelease ? 'm' : 'M'); - } else if (x < 223 && y < 223) { - len = snprintf(buf, sizeof(buf), "\033[M%c%c%c", - 32+code, 32+x+1, 32+y+1); - } else { - return; - } - - ttywrite(buf, len, 0); -} - -uint -buttonmask(uint button) -{ - return button == Button1 ? Button1Mask - : button == Button2 ? Button2Mask - : button == Button3 ? Button3Mask - : button == Button4 ? Button4Mask - : button == Button5 ? Button5Mask - : 0; -} - -int -mouseaction(XEvent *e, uint release) -{ - MouseShortcut *ms; - - /* ignore Buttonmask for Button - it's set on release */ - uint state = e->xbutton.state & ~buttonmask(e->xbutton.button); - - for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) { - if (ms->release == release && - ms->button == e->xbutton.button && - (match(ms->mod, state) || /* exact or forced */ - match(ms->mod, state & ~forcemousemod))) { - ms->func(&(ms->arg)); - return 1; - } - } - - return 0; -} - -void -bpress(XEvent *e) -{ - int btn = e->xbutton.button; - struct timespec now; - int snap; - - if (1 <= btn && btn <= 11) - buttons |= 1 << (btn-1); - - if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { - mousereport(e); - return; - } - - if (mouseaction(e, 0)) - return; - - if (btn == Button1) { - /* - * If the user clicks below predefined timeouts specific - * snapping behaviour is exposed. - */ - clock_gettime(CLOCK_MONOTONIC, &now); - if (TIMEDIFF(now, xsel.tclick2) <= tripleclicktimeout) { - snap = SNAP_LINE; - } else if (TIMEDIFF(now, xsel.tclick1) <= doubleclicktimeout) { - snap = SNAP_WORD; - } else { - snap = 0; - } - xsel.tclick2 = xsel.tclick1; - xsel.tclick1 = now; - - selstart(evcol(e), evrow(e), snap); - } -} - -void -propnotify(XEvent *e) -{ - XPropertyEvent *xpev; - Atom clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); - - xpev = &e->xproperty; - if (xpev->state == PropertyNewValue && - (xpev->atom == XA_PRIMARY || - xpev->atom == clipboard)) { - selnotify(e); - } -} - -void -selnotify(XEvent *e) -{ - ulong nitems, ofs, rem; - int format; - uchar *data, *last, *repl; - Atom type, incratom, property = None; - - incratom = XInternAtom(xw.dpy, "INCR", 0); - - ofs = 0; - if (e->type == SelectionNotify) - property = e->xselection.property; - else if (e->type == PropertyNotify) - property = e->xproperty.atom; - - if (property == None) - return; - - do { - if (XGetWindowProperty(xw.dpy, xw.win, property, ofs, - BUFSIZ/4, False, AnyPropertyType, - &type, &format, &nitems, &rem, - &data)) { - fprintf(stderr, "Clipboard allocation failed\n"); - return; - } - - if (e->type == PropertyNotify && nitems == 0 && rem == 0) { - /* - * If there is some PropertyNotify with no data, then - * this is the signal of the selection owner that all - * data has been transferred. We won't need to receive - * PropertyNotify events anymore. - */ - MODBIT(xw.attrs.event_mask, 0, PropertyChangeMask); - XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, - &xw.attrs); - } - - if (type == incratom) { - /* - * Activate the PropertyNotify events so we receive - * when the selection owner does send us the next - * chunk of data. - */ - MODBIT(xw.attrs.event_mask, 1, PropertyChangeMask); - XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, - &xw.attrs); - - /* - * Deleting the property is the transfer start signal. - */ - XDeleteProperty(xw.dpy, xw.win, (int)property); - continue; - } - - /* - * As seen in getsel: - * Line endings are inconsistent in the terminal and GUI world - * copy and pasting. When receiving some selection data, - * replace all '\n' with '\r'. - * FIXME: Fix the computer world. - */ - repl = data; - last = data + nitems * format / 8; - while ((repl = memchr(repl, '\n', last - repl))) { - *repl++ = '\r'; - } - - if (IS_SET(MODE_BRCKTPASTE) && ofs == 0) - ttywrite("\033[200~", 6, 0); - ttywrite((char *)data, nitems * format / 8, 1); - if (IS_SET(MODE_BRCKTPASTE) && rem == 0) - ttywrite("\033[201~", 6, 0); - XFree(data); - /* number of 32-bit chunks returned */ - ofs += nitems * format / 32; - } while (rem > 0); - - /* - * Deleting the property again tells the selection owner to send the - * next data chunk in the property. - */ - XDeleteProperty(xw.dpy, xw.win, (int)property); -} - -void -xclipcopy(void) -{ - clipcopy(NULL); -} - -void -selclear_(XEvent *e) -{ - selclear(); -} - -void -selrequest(XEvent *e) -{ - XSelectionRequestEvent *xsre; - XSelectionEvent xev; - Atom xa_targets, string, clipboard; - char *seltext; - - xsre = (XSelectionRequestEvent *) e; - xev.type = SelectionNotify; - xev.requestor = xsre->requestor; - xev.selection = xsre->selection; - xev.target = xsre->target; - xev.time = xsre->time; - if (xsre->property == None) - xsre->property = xsre->target; - - /* reject */ - xev.property = None; - - xa_targets = XInternAtom(xw.dpy, "TARGETS", 0); - if (xsre->target == xa_targets) { - /* respond with the supported type */ - string = xsel.xtarget; - XChangeProperty(xsre->display, xsre->requestor, xsre->property, - XA_ATOM, 32, PropModeReplace, - (uchar *) &string, 1); - xev.property = xsre->property; - } else if (xsre->target == xsel.xtarget || xsre->target == XA_STRING) { - /* - * xith XA_STRING non ascii characters may be incorrect in the - * requestor. It is not our problem, use utf8. - */ - clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); - if (xsre->selection == XA_PRIMARY) { - seltext = xsel.primary; - } else if (xsre->selection == clipboard) { - seltext = xsel.clipboard; - } else { - fprintf(stderr, - "Unhandled clipboard selection 0x%lx\n", - xsre->selection); - return; - } - if (seltext != NULL) { - XChangeProperty(xsre->display, xsre->requestor, - xsre->property, xsre->target, - 8, PropModeReplace, - (uchar *)seltext, strlen(seltext)); - xev.property = xsre->property; - } - } - - /* all done, send a notification to the listener */ - if (!XSendEvent(xsre->display, xsre->requestor, 1, 0, (XEvent *) &xev)) - fprintf(stderr, "Error sending SelectionNotify event\n"); -} - -void -setsel(char *str, Time t) -{ - if (!str) - return; - - free(xsel.primary); - xsel.primary = str; - - XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t); - if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win) - selclear(); - clipcopy(NULL); -} - -void -xsetsel(char *str) -{ - setsel(str, CurrentTime); -} - -void -brelease(XEvent *e) -{ - int btn = e->xbutton.button; - - if (1 <= btn && btn <= 11) - buttons &= ~(1 << (btn-1)); - - if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { - mousereport(e); - return; - } - - if (mouseaction(e, 1)) - return; - if (btn == Button1) - mousesel(e, 1); -} - -void -bmotion(XEvent *e) -{ - if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) { - mousereport(e); - return; - } - - mousesel(e, 0); -} - -void -cresize(int width, int height) -{ - int col, row; - - if (width != 0) - win.w = width; - if (height != 0) - win.h = height; - - col = (win.w - 2 * borderpx) / win.cw; - row = (win.h - 2 * borderpx) / win.ch; - col = MAX(1, col); - row = MAX(1, row); - - tresize(col, row); - xresize(col, row); - ttyresize(win.tw, win.th); -} - -void -xresize(int col, int row) -{ - win.tw = col * win.cw; - win.th = row * win.ch; - - XFreePixmap(xw.dpy, xw.buf); - xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, - xw.depth); - XftDrawChange(xw.draw, xw.buf); - xclear(0, 0, win.w, win.h); - - /* resize to new width */ - xw.specbuf = xrealloc(xw.specbuf, col * sizeof(GlyphFontSpec)); -} - -ushort -sixd_to_16bit(int x) -{ - return x == 0 ? 0 : 0x3737 + 0x2828 * x; -} - -int -xloadcolor(int i, const char *name, Color *ncolor) -{ - XRenderColor color = { .alpha = 0xffff }; - - if (!name) { - if (BETWEEN(i, 16, 255)) { /* 256 color */ - if (i < 6*6*6+16) { /* same colors as xterm */ - color.red = sixd_to_16bit( ((i-16)/36)%6 ); - color.green = sixd_to_16bit( ((i-16)/6) %6 ); - color.blue = sixd_to_16bit( ((i-16)/1) %6 ); - } else { /* greyscale */ - color.red = 0x0808 + 0x0a0a * (i - (6*6*6+16)); - color.green = color.blue = color.red; - } - return XftColorAllocValue(xw.dpy, xw.vis, - xw.cmap, &color, ncolor); - } else - name = colorname[i]; - } - - return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); -} - -void -xloadcols(void) -{ - int i; - static int loaded; - Color *cp; - - if (loaded) { - for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) - XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); - } else { - dc.collen = MAX(LEN(colorname), 256); - dc.col = xmalloc(dc.collen * sizeof(Color)); - } - - for (i = 0; i < dc.collen; i++) - if (!xloadcolor(i, NULL, &dc.col[i])) { - if (colorname[i]) - die("could not allocate color '%s'\n", colorname[i]); - else - die("could not allocate color %d\n", i); - } - - /* set alpha value of bg color */ - if (opt_alpha) - alpha = strtof(opt_alpha, NULL); - dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); - dc.col[defaultbg].pixel &= 0x00FFFFFF; - dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; - loaded = 1; -} - -int -xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b) -{ - if (!BETWEEN(x, 0, dc.collen)) - return 1; - - *r = dc.col[x].color.red >> 8; - *g = dc.col[x].color.green >> 8; - *b = dc.col[x].color.blue >> 8; - - return 0; -} - -int -xsetcolorname(int x, const char *name) -{ - Color ncolor; - - if (!BETWEEN(x, 0, dc.collen)) - return 1; - - if (!xloadcolor(x, name, &ncolor)) - return 1; - - XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]); - dc.col[x] = ncolor; - - return 0; -} - -/* - * Absolute coordinates. - */ -void -xclear(int x1, int y1, int x2, int y2) -{ - XftDrawRect(xw.draw, - &dc.col[IS_SET(MODE_REVERSE)? defaultfg : defaultbg], - x1, y1, x2-x1, y2-y1); -} - -void -xhints(void) -{ - XClassHint class = {opt_name ? opt_name : termname, - opt_class ? opt_class : termname}; - XWMHints wm = {.flags = InputHint, .input = 1}; - XSizeHints *sizeh; - - sizeh = XAllocSizeHints(); - - sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize; - sizeh->height = win.h; - sizeh->width = win.w; - sizeh->height_inc = win.ch; - sizeh->width_inc = win.cw; - sizeh->base_height = 2 * borderpx; - sizeh->base_width = 2 * borderpx; - sizeh->min_height = win.ch + 2 * borderpx; - sizeh->min_width = win.cw + 2 * borderpx; - if (xw.isfixed) { - sizeh->flags |= PMaxSize; - sizeh->min_width = sizeh->max_width = win.w; - sizeh->min_height = sizeh->max_height = win.h; - } - if (xw.gm & (XValue|YValue)) { - sizeh->flags |= USPosition | PWinGravity; - sizeh->x = xw.l; - sizeh->y = xw.t; - sizeh->win_gravity = xgeommasktogravity(xw.gm); - } - - XSetWMProperties(xw.dpy, xw.win, NULL, NULL, NULL, 0, sizeh, &wm, - &class); - XFree(sizeh); -} - -int -xgeommasktogravity(int mask) -{ - switch (mask & (XNegative|YNegative)) { - case 0: - return NorthWestGravity; - case XNegative: - return NorthEastGravity; - case YNegative: - return SouthWestGravity; - } - - return SouthEastGravity; -} - -int -xloadfont(Font *f, FcPattern *pattern) -{ - FcPattern *configured; - FcPattern *match; - FcResult result; - XGlyphInfo extents; - int wantattr, haveattr; - - /* - * Manually configure instead of calling XftMatchFont - * so that we can use the configured pattern for - * "missing glyph" lookups. - */ - configured = FcPatternDuplicate(pattern); - if (!configured) - return 1; - - FcConfigSubstitute(NULL, configured, FcMatchPattern); - XftDefaultSubstitute(xw.dpy, xw.scr, configured); - - match = FcFontMatch(NULL, configured, &result); - if (!match) { - FcPatternDestroy(configured); - return 1; - } - - if (!(f->match = XftFontOpenPattern(xw.dpy, match))) { - FcPatternDestroy(configured); - FcPatternDestroy(match); - return 1; - } - - if ((XftPatternGetInteger(pattern, "slant", 0, &wantattr) == - XftResultMatch)) { - /* - * Check if xft was unable to find a font with the appropriate - * slant but gave us one anyway. Try to mitigate. - */ - if ((XftPatternGetInteger(f->match->pattern, "slant", 0, - &haveattr) != XftResultMatch) || haveattr < wantattr) { - f->badslant = 1; - fputs("font slant does not match\n", stderr); - } - } - - if ((XftPatternGetInteger(pattern, "weight", 0, &wantattr) == - XftResultMatch)) { - if ((XftPatternGetInteger(f->match->pattern, "weight", 0, - &haveattr) != XftResultMatch) || haveattr != wantattr) { - f->badweight = 1; - fputs("font weight does not match\n", stderr); - } - } - - XftTextExtentsUtf8(xw.dpy, f->match, - (const FcChar8 *) ascii_printable, - strlen(ascii_printable), &extents); - - f->set = NULL; - f->pattern = configured; - - f->ascent = f->match->ascent; - f->descent = f->match->descent; - f->lbearing = 0; - f->rbearing = f->match->max_advance_width; - - f->height = f->ascent + f->descent; - f->width = DIVCEIL(extents.xOff, strlen(ascii_printable)); - - return 0; -} - -void -xloadfonts(const char *fontstr, double fontsize) -{ - FcPattern *pattern; - double fontval; - - if (fontstr[0] == '-') - pattern = XftXlfdParse(fontstr, False, False); - else - pattern = FcNameParse((const FcChar8 *)fontstr); - - if (!pattern) - die("can't open font %s\n", fontstr); - - if (fontsize > 1) { - FcPatternDel(pattern, FC_PIXEL_SIZE); - FcPatternDel(pattern, FC_SIZE); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)fontsize); - usedfontsize = fontsize; - } else { - if (FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == - FcResultMatch) { - usedfontsize = fontval; - } else if (FcPatternGetDouble(pattern, FC_SIZE, 0, &fontval) == - FcResultMatch) { - usedfontsize = -1; - } else { - /* - * Default font size is 12, if none given. This is to - * have a known usedfontsize value. - */ - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, 12); - usedfontsize = 12; - } - defaultfontsize = usedfontsize; - } - - if (xloadfont(&dc.font, pattern)) - die("can't open font %s\n", fontstr); - - if (usedfontsize < 0) { - FcPatternGetDouble(dc.font.match->pattern, - FC_PIXEL_SIZE, 0, &fontval); - usedfontsize = fontval; - if (fontsize == 0) - defaultfontsize = fontval; - } - - /* Setting character width and height. */ - win.cw = ceilf(dc.font.width * cwscale); - win.ch = ceilf(dc.font.height * chscale); - - FcPatternDel(pattern, FC_SLANT); - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); - if (xloadfont(&dc.ifont, pattern)) - die("can't open font %s\n", fontstr); - - FcPatternDel(pattern, FC_WEIGHT); - FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); - if (xloadfont(&dc.ibfont, pattern)) - die("can't open font %s\n", fontstr); - - FcPatternDel(pattern, FC_SLANT); - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); - if (xloadfont(&dc.bfont, pattern)) - die("can't open font %s\n", fontstr); - - FcPatternDestroy(pattern); -} - -int -xloadsparefont(FcPattern *pattern, int flags) -{ - FcPattern *match; - FcResult result; - - match = FcFontMatch(NULL, pattern, &result); - if (!match) { - return 1; - } - - if (!(frc[frclen].font = XftFontOpenPattern(xw.dpy, match))) { - FcPatternDestroy(match); - return 1; - } - - frc[frclen].flags = flags; - /* Believe U+0000 glyph will present in each default font */ - frc[frclen].unicodep = 0; - frclen++; - - return 0; -} - -void -xloadsparefonts(void) -{ - FcPattern *pattern; - double sizeshift, fontval; - int fc; - char **fp; - - if (frclen != 0) - die("can't embed spare fonts. cache isn't empty"); - - /* Calculate count of spare fonts */ - fc = sizeof(font2) / sizeof(*font2); - if (fc == 0) - return; - - /* Allocate memory for cache entries. */ - if (frccap < 4 * fc) { - frccap += 4 * fc - frccap; - frc = xrealloc(frc, frccap * sizeof(Fontcache)); - } - - for (fp = font2; fp - font2 < fc; ++fp) { - - if (**fp == '-') - pattern = XftXlfdParse(*fp, False, False); - else - pattern = FcNameParse((FcChar8 *)*fp); - - if (!pattern) - die("can't open spare font %s\n", *fp); - - if (defaultfontsize > 0) { - sizeshift = usedfontsize - defaultfontsize; - if (sizeshift != 0 && - FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == - FcResultMatch) { - fontval += sizeshift; - FcPatternDel(pattern, FC_PIXEL_SIZE); - FcPatternDel(pattern, FC_SIZE); - FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); - } - } - - FcPatternAddBool(pattern, FC_SCALABLE, 1); - - FcConfigSubstitute(NULL, pattern, FcMatchPattern); - XftDefaultSubstitute(xw.dpy, xw.scr, pattern); - - if (xloadsparefont(pattern, FRC_NORMAL)) - die("can't open spare font %s\n", *fp); - - FcPatternDel(pattern, FC_SLANT); - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); - if (xloadsparefont(pattern, FRC_ITALIC)) - die("can't open spare font %s\n", *fp); - - FcPatternDel(pattern, FC_WEIGHT); - FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); - if (xloadsparefont(pattern, FRC_ITALICBOLD)) - die("can't open spare font %s\n", *fp); - - FcPatternDel(pattern, FC_SLANT); - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); - if (xloadsparefont(pattern, FRC_BOLD)) - die("can't open spare font %s\n", *fp); - - FcPatternDestroy(pattern); - } -} - -void -xunloadfont(Font *f) -{ - XftFontClose(xw.dpy, f->match); - FcPatternDestroy(f->pattern); - if (f->set) - FcFontSetDestroy(f->set); -} - -void -xunloadfonts(void) -{ - /* Free the loaded fonts in the font cache. */ - while (frclen > 0) - XftFontClose(xw.dpy, frc[--frclen].font); - - xunloadfont(&dc.font); - xunloadfont(&dc.bfont); - xunloadfont(&dc.ifont); - xunloadfont(&dc.ibfont); -} - -int -ximopen(Display *dpy) -{ - XIMCallback imdestroy = { .client_data = NULL, .callback = ximdestroy }; - XICCallback icdestroy = { .client_data = NULL, .callback = xicdestroy }; - - xw.ime.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); - if (xw.ime.xim == NULL) - return 0; - - if (XSetIMValues(xw.ime.xim, XNDestroyCallback, &imdestroy, NULL)) - fprintf(stderr, "XSetIMValues: " - "Could not set XNDestroyCallback.\n"); - - xw.ime.spotlist = XVaCreateNestedList(0, XNSpotLocation, &xw.ime.spot, - NULL); - - if (xw.ime.xic == NULL) { - xw.ime.xic = XCreateIC(xw.ime.xim, XNInputStyle, - XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, xw.win, - XNDestroyCallback, &icdestroy, - NULL); - } - if (xw.ime.xic == NULL) - fprintf(stderr, "XCreateIC: Could not create input context.\n"); - - return 1; -} - -void -ximinstantiate(Display *dpy, XPointer client, XPointer call) -{ - if (ximopen(dpy)) - XUnregisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, - ximinstantiate, NULL); -} - -void -ximdestroy(XIM xim, XPointer client, XPointer call) -{ - xw.ime.xim = NULL; - XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, - ximinstantiate, NULL); - XFree(xw.ime.spotlist); -} - -int -xicdestroy(XIC xim, XPointer client, XPointer call) -{ - xw.ime.xic = NULL; - return 1; -} - -void -xinit(int cols, int rows) -{ - XGCValues gcvalues; - Cursor cursor; - Window parent; - pid_t thispid = getpid(); - XColor xmousefg, xmousebg; - XWindowAttributes attr; - XVisualInfo vis; - - if (!(xw.dpy = XOpenDisplay(NULL))) - die("can't open display\n"); - xw.scr = XDefaultScreen(xw.dpy); - - if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { - parent = XRootWindow(xw.dpy, xw.scr); - xw.depth = 32; - } else { - XGetWindowAttributes(xw.dpy, parent, &attr); - xw.depth = attr.depth; - } - - XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis); - xw.vis = vis.visual; - - /* font */ - if (!FcInit()) - die("could not init fontconfig.\n"); - - usedfont = (opt_font == NULL)? font : opt_font; - xloadfonts(usedfont, 0); - - /* spare fonts */ - xloadsparefonts(); - - /* colors */ - xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); - xloadcols(); - - /* adjust fixed window geometry */ - win.w = 2 * borderpx + cols * win.cw; - win.h = 2 * borderpx + rows * win.ch; - if (xw.gm & XNegative) - xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2; - if (xw.gm & YNegative) - xw.t += DisplayHeight(xw.dpy, xw.scr) - win.h - 2; - - /* Events */ - xw.attrs.background_pixel = dc.col[defaultbg].pixel; - xw.attrs.border_pixel = dc.col[defaultbg].pixel; - xw.attrs.bit_gravity = NorthWestGravity; - xw.attrs.event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask - | ExposureMask | VisibilityChangeMask | StructureNotifyMask - | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; - xw.attrs.colormap = xw.cmap; - - xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, - win.w, win.h, 0, xw.depth, InputOutput, - xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity - | CWEventMask | CWColormap, &xw.attrs); - - memset(&gcvalues, 0, sizeof(gcvalues)); - gcvalues.graphics_exposures = False; - xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth); - dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues); - XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); - - /* font spec buffer */ - xw.specbuf = xmalloc(cols * sizeof(GlyphFontSpec)); - - /* Xft rendering context */ - xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); - - /* input methods */ - if (!ximopen(xw.dpy)) { - XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, - ximinstantiate, NULL); - } - - /* white cursor, black outline */ - cursor = XCreateFontCursor(xw.dpy, mouseshape); - XDefineCursor(xw.dpy, xw.win, cursor); - - if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { - xmousefg.red = 0xffff; - xmousefg.green = 0xffff; - xmousefg.blue = 0xffff; - } - - if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { - xmousebg.red = 0x0000; - xmousebg.green = 0x0000; - xmousebg.blue = 0x0000; - } - - XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); - - xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); - xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); - xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False); - xw.netwmiconname = XInternAtom(xw.dpy, "_NET_WM_ICON_NAME", False); - XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1); - - xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False); - XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32, - PropModeReplace, (uchar *)&thispid, 1); - - win.mode = MODE_NUMLOCK; - resettitle(); - xhints(); - XMapWindow(xw.dpy, xw.win); - XSync(xw.dpy, False); - - clock_gettime(CLOCK_MONOTONIC, &xsel.tclick1); - clock_gettime(CLOCK_MONOTONIC, &xsel.tclick2); - xsel.primary = NULL; - xsel.clipboard = NULL; - xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); - if (xsel.xtarget == None) - xsel.xtarget = XA_STRING; -} - -int -xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x, int y) -{ - float winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, xp, yp; - ushort mode, prevmode = USHRT_MAX; - Font *font = &dc.font; - int frcflags = FRC_NORMAL; - float runewidth = win.cw; - Rune rune; - FT_UInt glyphidx; - FcResult fcres; - FcPattern *fcpattern, *fontpattern; - FcFontSet *fcsets[] = { NULL }; - FcCharSet *fccharset; - int i, f, numspecs = 0; - - for (i = 0, xp = winx, yp = winy + font->ascent; i < len; ++i) { - /* Fetch rune and mode for current glyph. */ - rune = glyphs[i].u; - mode = glyphs[i].mode; - - /* Skip dummy wide-character spacing. */ - if (mode == ATTR_WDUMMY) - continue; - - /* Determine font for glyph if different from previous glyph. */ - if (prevmode != mode) { - prevmode = mode; - font = &dc.font; - frcflags = FRC_NORMAL; - runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f); - if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) { - font = &dc.ibfont; - frcflags = FRC_ITALICBOLD; - } else if (mode & ATTR_ITALIC) { - font = &dc.ifont; - frcflags = FRC_ITALIC; - } else if (mode & ATTR_BOLD) { - font = &dc.bfont; - frcflags = FRC_BOLD; - } - yp = winy + font->ascent; - } - - /* Lookup character index with default font. */ - glyphidx = XftCharIndex(xw.dpy, font->match, rune); - if (glyphidx) { - specs[numspecs].font = font->match; - specs[numspecs].glyph = glyphidx; - specs[numspecs].x = (short)xp; - specs[numspecs].y = (short)yp; - xp += runewidth; - numspecs++; - continue; - } - - /* Fallback on font cache, search the font cache for match. */ - for (f = 0; f < frclen; f++) { - glyphidx = XftCharIndex(xw.dpy, frc[f].font, rune); - /* Everything correct. */ - if (glyphidx && frc[f].flags == frcflags) - break; - /* We got a default font for a not found glyph. */ - if (!glyphidx && frc[f].flags == frcflags - && frc[f].unicodep == rune) { - break; - } - } - - /* Nothing was found. Use fontconfig to find matching font. */ - if (f >= frclen) { - if (!font->set) - font->set = FcFontSort(0, font->pattern, - 1, 0, &fcres); - fcsets[0] = font->set; - - /* - * Nothing was found in the cache. Now use - * some dozen of Fontconfig calls to get the - * font for one single character. - * - * Xft and fontconfig are design failures. - */ - fcpattern = FcPatternDuplicate(font->pattern); - fccharset = FcCharSetCreate(); - - FcCharSetAddChar(fccharset, rune); - FcPatternAddCharSet(fcpattern, FC_CHARSET, - fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, 1); - - FcConfigSubstitute(0, fcpattern, - FcMatchPattern); - FcDefaultSubstitute(fcpattern); - - fontpattern = FcFontSetMatch(0, fcsets, 1, - fcpattern, &fcres); - - /* Allocate memory for the new cache entry. */ - if (frclen >= frccap) { - frccap += 16; - frc = xrealloc(frc, frccap * sizeof(Fontcache)); - } - - frc[frclen].font = XftFontOpenPattern(xw.dpy, - fontpattern); - if (!frc[frclen].font) - die("XftFontOpenPattern failed seeking fallback font: %s\n", - strerror(errno)); - frc[frclen].flags = frcflags; - frc[frclen].unicodep = rune; - - glyphidx = XftCharIndex(xw.dpy, frc[frclen].font, rune); - - f = frclen; - frclen++; - - FcPatternDestroy(fcpattern); - FcCharSetDestroy(fccharset); - } - - specs[numspecs].font = frc[f].font; - specs[numspecs].glyph = glyphidx; - specs[numspecs].x = (short)xp; - specs[numspecs].y = (short)yp; - xp += runewidth; - numspecs++; - } - - return numspecs; -} - -void -xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y, int dmode) -{ - int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1); - int winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, - width = charlen * win.cw; - Color *fg, *bg, *temp, revfg, revbg, truefg, truebg; - XRenderColor colfg, colbg; - XRectangle r; - - /* Fallback on color display for attributes not supported by the font */ - if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) { - if (dc.ibfont.badslant || dc.ibfont.badweight) - base.fg = defaultattr; - } else if ((base.mode & ATTR_ITALIC && dc.ifont.badslant) || - (base.mode & ATTR_BOLD && dc.bfont.badweight)) { - base.fg = defaultattr; - } - - if (IS_TRUECOL(base.fg)) { - colfg.alpha = 0xffff; - colfg.red = TRUERED(base.fg); - colfg.green = TRUEGREEN(base.fg); - colfg.blue = TRUEBLUE(base.fg); - XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &truefg); - fg = &truefg; - } else { - fg = &dc.col[base.fg]; - } - - if (IS_TRUECOL(base.bg)) { - colbg.alpha = 0xffff; - colbg.green = TRUEGREEN(base.bg); - colbg.red = TRUERED(base.bg); - colbg.blue = TRUEBLUE(base.bg); - XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &truebg); - bg = &truebg; - } else { - bg = &dc.col[base.bg]; - } - - /* Change basic system colors [0-7] to bright system colors [8-15] */ - if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) - fg = &dc.col[base.fg + 8]; - - if (IS_SET(MODE_REVERSE)) { - if (fg == &dc.col[defaultfg]) { - fg = &dc.col[defaultbg]; - } else { - colfg.red = ~fg->color.red; - colfg.green = ~fg->color.green; - colfg.blue = ~fg->color.blue; - colfg.alpha = fg->color.alpha; - XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, - &revfg); - fg = &revfg; - } - - if (bg == &dc.col[defaultbg]) { - bg = &dc.col[defaultfg]; - } else { - colbg.red = ~bg->color.red; - colbg.green = ~bg->color.green; - colbg.blue = ~bg->color.blue; - colbg.alpha = bg->color.alpha; - XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, - &revbg); - bg = &revbg; - } - } - - if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) { - colfg.red = fg->color.red / 2; - colfg.green = fg->color.green / 2; - colfg.blue = fg->color.blue / 2; - colfg.alpha = fg->color.alpha; - XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg); - fg = &revfg; - } - - if (base.mode & ATTR_REVERSE) { - temp = fg; - fg = bg; - bg = temp; - } - - if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK) - fg = bg; - - if (base.mode & ATTR_INVISIBLE) - fg = bg; - - if (dmode & DRAW_BG) { - /* Intelligent cleaning up of the borders. */ - if (x == 0) { - xclear(0, (y == 0)? 0 : winy, borderpx, - winy + win.ch + - ((winy + win.ch >= borderpx + win.th)? win.h : 0)); - } - if (winx + width >= borderpx + win.tw) { - xclear(winx + width, (y == 0)? 0 : winy, win.w, - ((winy + win.ch >= borderpx + win.th)? win.h : (winy + win.ch))); - } - if (y == 0) - xclear(winx, 0, winx + width, borderpx); - if (winy + win.ch >= borderpx + win.th) - xclear(winx, winy + win.ch, winx + width, win.h); - /* Fill the background */ - XftDrawRect(xw.draw, bg, winx, winy, width, win.ch); - } - - if (dmode & DRAW_FG) { - /* Render the glyphs. */ - XftDrawGlyphFontSpec(xw.draw, fg, specs, len); - - /* Render underline and strikethrough. */ - if (base.mode & ATTR_UNDERLINE) { - XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1, - width, 1); - } - - if (base.mode & ATTR_STRUCK) { - XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3, - width, 1); - } - } -} - -void -xdrawglyph(Glyph g, int x, int y) -{ - int numspecs; - XftGlyphFontSpec spec; - - numspecs = xmakeglyphfontspecs(&spec, &g, 1, x, y); - xdrawglyphfontspecs(&spec, g, numspecs, x, y, DRAW_BG | DRAW_FG); -} - -void -xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) -{ - Color drawcol; - - /* remove the old cursor */ - if (selected(ox, oy)) - og.mode ^= ATTR_REVERSE; - xdrawglyph(og, ox, oy); - - if (IS_SET(MODE_HIDE)) - return; - - /* - * Select the right color for the right mode. - */ - g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; - - if (IS_SET(MODE_REVERSE)) { - g.mode |= ATTR_REVERSE; - g.bg = defaultfg; - if (selected(cx, cy)) { - drawcol = dc.col[defaultcs]; - g.fg = defaultrcs; - } else { - drawcol = dc.col[defaultrcs]; - g.fg = defaultcs; - } - } else { - if (selected(cx, cy)) { - g.fg = defaultfg; - g.bg = defaultrcs; - } else { - g.fg = defaultbg; - g.bg = defaultcs; - } - drawcol = dc.col[g.bg]; - } - - /* draw the new one */ - if (IS_SET(MODE_FOCUSED)) { - switch (win.cursor) { - case 7: /* st extension */ - g.u = 0x2603; /* snowman (U+2603) */ - /* FALLTHROUGH */ - case 0: /* Blinking Block */ - case 1: /* Blinking Block (Default) */ - case 2: /* Steady Block */ - xdrawglyph(g, cx, cy); - break; - case 3: /* Blinking Underline */ - case 4: /* Steady Underline */ - XftDrawRect(xw.draw, &drawcol, - borderpx + cx * win.cw, - borderpx + (cy + 1) * win.ch - \ - cursorthickness, - win.cw, cursorthickness); - break; - case 5: /* Blinking bar */ - case 6: /* Steady bar */ - XftDrawRect(xw.draw, &drawcol, - borderpx + cx * win.cw, - borderpx + cy * win.ch, - cursorthickness, win.ch); - break; - } - } else { - XftDrawRect(xw.draw, &drawcol, - borderpx + cx * win.cw, - borderpx + cy * win.ch, - win.cw - 1, 1); - XftDrawRect(xw.draw, &drawcol, - borderpx + cx * win.cw, - borderpx + cy * win.ch, - 1, win.ch - 1); - XftDrawRect(xw.draw, &drawcol, - borderpx + (cx + 1) * win.cw - 1, - borderpx + cy * win.ch, - 1, win.ch - 1); - XftDrawRect(xw.draw, &drawcol, - borderpx + cx * win.cw, - borderpx + (cy + 1) * win.ch - 1, - win.cw, 1); - } -} - -void -xsetenv(void) -{ - char buf[sizeof(long) * 8 + 1]; - - snprintf(buf, sizeof(buf), "%lu", xw.win); - setenv("WINDOWID", buf, 1); -} - -void -xseticontitle(char *p) -{ - XTextProperty prop; - DEFAULT(p, opt_title); - - if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, - &prop) != Success) - return; - XSetWMIconName(xw.dpy, xw.win, &prop); - XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmiconname); - XFree(prop.value); -} - -void -xsettitle(char *p) -{ - XTextProperty prop; - DEFAULT(p, opt_title); - - if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, - &prop) != Success) - return; - XSetWMName(xw.dpy, xw.win, &prop); - XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmname); - XFree(prop.value); -} - -int -xstartdraw(void) -{ - return IS_SET(MODE_VISIBLE); -} - -void -xdrawline(Line line, int x1, int y1, int x2) -{ - int i, x, ox, numspecs, numspecs_cached; - Glyph base, new; - XftGlyphFontSpec *specs; - - numspecs_cached = xmakeglyphfontspecs(xw.specbuf, &line[x1], x2 - x1, x1, y1); - - /* Draw line in 2 passes: background and foreground. This way wide glyphs - won't get truncated (#223) */ - for (int dmode = DRAW_BG; dmode <= DRAW_FG; dmode <<= 1) { - specs = xw.specbuf; - numspecs = numspecs_cached; - i = ox = 0; - for (x = x1; x < x2 && i < numspecs; x++) { - new = line[x]; - if (new.mode == ATTR_WDUMMY) - continue; - if (selected(x, y1)) - new.mode ^= ATTR_REVERSE; - if (i > 0 && ATTRCMP(base, new)) { - xdrawglyphfontspecs(specs, base, i, ox, y1, dmode); - specs += i; - numspecs -= i; - i = 0; - } - if (i == 0) { - ox = x; - base = new; - } - i++; - } - if (i > 0) - xdrawglyphfontspecs(specs, base, i, ox, y1, dmode); - } -} - -void -xfinishdraw(void) -{ - XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, - win.h, 0, 0); - XSetForeground(xw.dpy, dc.gc, - dc.col[IS_SET(MODE_REVERSE)? - defaultfg : defaultbg].pixel); -} - -void -xximspot(int x, int y) -{ - if (xw.ime.xic == NULL) - return; - - xw.ime.spot.x = borderpx + x * win.cw; - xw.ime.spot.y = borderpx + (y + 1) * win.ch; - - XSetICValues(xw.ime.xic, XNPreeditAttributes, xw.ime.spotlist, NULL); -} - -void -expose(XEvent *ev) -{ - redraw(); -} - -void -visibility(XEvent *ev) -{ - XVisibilityEvent *e = &ev->xvisibility; - - MODBIT(win.mode, e->state != VisibilityFullyObscured, MODE_VISIBLE); -} - -void -unmap(XEvent *ev) -{ - win.mode &= ~MODE_VISIBLE; -} - -void -xsetpointermotion(int set) -{ - MODBIT(xw.attrs.event_mask, set, PointerMotionMask); - XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); -} - -void -xsetmode(int set, unsigned int flags) -{ - int mode = win.mode; - MODBIT(win.mode, set, flags); - if ((win.mode & MODE_REVERSE) != (mode & MODE_REVERSE)) - redraw(); -} - -int -xsetcursor(int cursor) -{ - if (!BETWEEN(cursor, 0, 7)) /* 7: st extension */ - return 1; - win.cursor = cursor; - return 0; -} - -void -xseturgency(int add) -{ - XWMHints *h = XGetWMHints(xw.dpy, xw.win); - - MODBIT(h->flags, add, XUrgencyHint); - XSetWMHints(xw.dpy, xw.win, h); - XFree(h); -} - -void -xbell(void) -{ - if (!(IS_SET(MODE_FOCUSED))) - xseturgency(1); - if (bellvolume) - XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); -} - -void -focus(XEvent *ev) -{ - XFocusChangeEvent *e = &ev->xfocus; - - if (e->mode == NotifyGrab) - return; - - if (ev->type == FocusIn) { - if (xw.ime.xic) - XSetICFocus(xw.ime.xic); - win.mode |= MODE_FOCUSED; - xseturgency(0); - if (IS_SET(MODE_FOCUS)) - ttywrite("\033[I", 3, 0); - } else { - if (xw.ime.xic) - XUnsetICFocus(xw.ime.xic); - win.mode &= ~MODE_FOCUSED; - if (IS_SET(MODE_FOCUS)) - ttywrite("\033[O", 3, 0); - } -} - -int -match(uint mask, uint state) -{ - return mask == XK_ANY_MOD || mask == (state & ~ignoremod); -} - -char* -kmap(KeySym k, uint state) -{ - Key *kp; - int i; - - /* Check for mapped keys out of X11 function keys. */ - for (i = 0; i < LEN(mappedkeys); i++) { - if (mappedkeys[i] == k) - break; - } - if (i == LEN(mappedkeys)) { - if ((k & 0xFFFF) < 0xFD00) - return NULL; - } - - for (kp = key; kp < key + LEN(key); kp++) { - if (kp->k != k) - continue; - - if (!match(kp->mask, state)) - continue; - - if (IS_SET(MODE_APPKEYPAD) ? kp->appkey < 0 : kp->appkey > 0) - continue; - if (IS_SET(MODE_NUMLOCK) && kp->appkey == 2) - continue; - - if (IS_SET(MODE_APPCURSOR) ? kp->appcursor < 0 : kp->appcursor > 0) - continue; - - return kp->s; - } - - return NULL; -} - -void -kpress(XEvent *ev) -{ - XKeyEvent *e = &ev->xkey; - KeySym ksym = NoSymbol; - char buf[64], *customkey; - int len; - Rune c; - Status status; - Shortcut *bp; - - if (IS_SET(MODE_KBDLOCK)) - return; - - if (xw.ime.xic) { - len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status); - if (status == XBufferOverflow) - return; - } else { - len = XLookupString(e, buf, sizeof buf, &ksym, NULL); - } - /* 1. shortcuts */ - for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) { - if (ksym == bp->keysym && match(bp->mod, e->state)) { - bp->func(&(bp->arg)); - return; - } - } - - /* 2. custom keys from config.h */ - if ((customkey = kmap(ksym, e->state))) { - ttywrite(customkey, strlen(customkey), 1); - return; - } - - /* 3. composed string from input method */ - if (len == 0) - return; - if (len == 1 && e->state & Mod1Mask) { - if (IS_SET(MODE_8BIT)) { - if (*buf < 0177) { - c = *buf | 0x80; - len = utf8encode(c, buf); - } - } else { - buf[1] = buf[0]; - buf[0] = '\033'; - len = 2; - } - } - ttywrite(buf, len, 1); -} - -void -cmessage(XEvent *e) -{ - /* - * See xembed specs - * http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html - */ - if (e->xclient.message_type == xw.xembed && e->xclient.format == 32) { - if (e->xclient.data.l[1] == XEMBED_FOCUS_IN) { - win.mode |= MODE_FOCUSED; - xseturgency(0); - } else if (e->xclient.data.l[1] == XEMBED_FOCUS_OUT) { - win.mode &= ~MODE_FOCUSED; - } - } else if (e->xclient.data.l[0] == xw.wmdeletewin) { - ttyhangup(); - exit(0); - } -} - -void -resize(XEvent *e) -{ - if (e->xconfigure.width == win.w && e->xconfigure.height == win.h) - return; - - cresize(e->xconfigure.width, e->xconfigure.height); -} - -void -run(void) -{ - XEvent ev; - int w = win.w, h = win.h; - fd_set rfd; - int xfd = XConnectionNumber(xw.dpy), ttyfd, xev, drawing; - struct timespec seltv, *tv, now, lastblink, trigger; - double timeout; - - /* Waiting for window mapping */ - do { - XNextEvent(xw.dpy, &ev); - /* - * This XFilterEvent call is required because of XOpenIM. It - * does filter out the key event and some client message for - * the input method too. - */ - if (XFilterEvent(&ev, None)) - continue; - if (ev.type == ConfigureNotify) { - w = ev.xconfigure.width; - h = ev.xconfigure.height; - } - } while (ev.type != MapNotify); - - ttyfd = ttynew(opt_line, shell, opt_io, opt_cmd); - cresize(w, h); - - for (timeout = -1, drawing = 0, lastblink = (struct timespec){0};;) { - FD_ZERO(&rfd); - FD_SET(ttyfd, &rfd); - FD_SET(xfd, &rfd); - - if (XPending(xw.dpy)) - timeout = 0; /* existing events might not set xfd */ - - seltv.tv_sec = timeout / 1E3; - seltv.tv_nsec = 1E6 * (timeout - 1E3 * seltv.tv_sec); - tv = timeout >= 0 ? &seltv : NULL; - - if (pselect(MAX(xfd, ttyfd)+1, &rfd, NULL, NULL, tv, NULL) < 0) { - if (errno == EINTR) - continue; - die("select failed: %s\n", strerror(errno)); - } - clock_gettime(CLOCK_MONOTONIC, &now); - - if (FD_ISSET(ttyfd, &rfd)) - ttyread(); - - xev = 0; - while (XPending(xw.dpy)) { - xev = 1; - XNextEvent(xw.dpy, &ev); - if (XFilterEvent(&ev, None)) - continue; - if (handler[ev.type]) - (handler[ev.type])(&ev); - } - - /* - * To reduce flicker and tearing, when new content or event - * triggers drawing, we first wait a bit to ensure we got - * everything, and if nothing new arrives - we draw. - * We start with trying to wait minlatency ms. If more content - * arrives sooner, we retry with shorter and shorter periods, - * and eventually draw even without idle after maxlatency ms. - * Typically this results in low latency while interacting, - * maximum latency intervals during `cat huge.txt`, and perfect - * sync with periodic updates from animations/key-repeats/etc. - */ - if (FD_ISSET(ttyfd, &rfd) || xev) { - if (!drawing) { - trigger = now; - drawing = 1; - } - timeout = (maxlatency - TIMEDIFF(now, trigger)) \ - / maxlatency * minlatency; - if (timeout > 0) - continue; /* we have time, try to find idle */ - } - - /* idle detected or maxlatency exhausted -> draw */ - timeout = -1; - if (blinktimeout && tattrset(ATTR_BLINK)) { - timeout = blinktimeout - TIMEDIFF(now, lastblink); - if (timeout <= 0) { - if (-timeout > blinktimeout) /* start visible */ - win.mode |= MODE_BLINK; - win.mode ^= MODE_BLINK; - tsetdirtattr(ATTR_BLINK); - lastblink = now; - timeout = blinktimeout; - } - } - - draw(); - XFlush(xw.dpy); - drawing = 0; - } -} - -void -usage(void) -{ - die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" - " [-n name] [-o file]\n" - " [-T title] [-t title] [-w windowid]" - " [[-e] command [args ...]]\n" - " %s [-aiv] [-c class] [-f font] [-g geometry]" - " [-n name] [-o file]\n" - " [-T title] [-t title] [-w windowid] -l line" - " [stty_args ...]\n", argv0, argv0); -} - -int -main(int argc, char *argv[]) -{ - xw.l = xw.t = 0; - xw.isfixed = False; - xsetcursor(cursorshape); - - ARGBEGIN { - case 'a': - allowaltscreen = 0; - break; - case 'A': - opt_alpha = EARGF(usage()); - break; - case 'c': - opt_class = EARGF(usage()); - break; - case 'e': - if (argc > 0) - --argc, ++argv; - goto run; - case 'f': - opt_font = EARGF(usage()); - break; - case 'g': - xw.gm = XParseGeometry(EARGF(usage()), - &xw.l, &xw.t, &cols, &rows); - break; - case 'i': - xw.isfixed = 1; - break; - case 'o': - opt_io = EARGF(usage()); - break; - case 'l': - opt_line = EARGF(usage()); - break; - case 'n': - opt_name = EARGF(usage()); - break; - case 't': - case 'T': - opt_title = EARGF(usage()); - break; - case 'w': - opt_embed = EARGF(usage()); - break; - case 'v': - die("%s " VERSION "\n", argv0); - break; - default: - usage(); - } ARGEND; - -run: - if (argc > 0) /* eat all remaining arguments */ - opt_cmd = argv; - - if (!opt_title) - opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0]; - - setlocale(LC_CTYPE, ""); - XSetLocaleModifiers(""); - cols = MAX(cols, 1); - rows = MAX(rows, 1); - tnew(cols, rows); - xinit(cols, rows); - xsetenv(); - selinit(); - run(); - - return 0; -} diff --git a/dwm/st/x.o b/dwm/st/x.o deleted file mode 100644 index 7130193..0000000 Binary files a/dwm/st/x.o and /dev/null differ diff --git a/dwm/startdwm.sh b/dwm/startdwm.sh deleted file mode 100755 index bf6afc8..0000000 --- a/dwm/startdwm.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -export GTK_THEME=Adwaita:dark -setxkbmap "us,ru" -option 'grp:win_space_toggle' -~/dotfiles/dwm/background.sh & -# dwmbar & -# ~/dotfiles/dwm/bin/picom -~/dotfiles/dwm/bin/startslstatus & -dunst & -~/dotfiles/bin/dpmsdisablexorg - -xrdb -merge ~/dotfiles/dwm/Xresources - -while true; do - dwm 2> ~/.dwm.log -done - diff --git a/dwm/surf/FAQ.md b/dwm/surf/FAQ.md deleted file mode 100644 index 48e6097..0000000 --- a/dwm/surf/FAQ.md +++ /dev/null @@ -1,10 +0,0 @@ -# Frequently Asked Questions - -## Surf is starting up slowly. What might be causing this? - -The first suspect for such behaviour is the plugin handling. Run surf on -the commandline and see if there are errors because of “nspluginwrapper” -or failed RPCs to them. If that is true, go to ~/.mozilla/plugins and -try removing stale links to plugins not on your system anymore. This -will stop surf from trying to load them. - diff --git a/dwm/surf/LICENSE b/dwm/surf/LICENSE deleted file mode 100644 index 809d284..0000000 --- a/dwm/surf/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -MIT/X Consortium License - -© 2009-2010 Enno Boland -© 2009 Thomas Menari -© 2009 Simon Rozet -© 2009 Andrew Antle -© 2010-2011 pancake -© 2011-2013 Anselm R Garbe -© 2011-2012 Troels Henriksen -© 2011 Connor Lane Smith -© 2012-2017 Christoph Lohmann <20h@r-36.net> -© 2013 Shayan Pooya -© 2013 Jens Nyberg -© 2013 Carlos J. Torres -© 2013 Alexander Sedov -© 2013 Nick White -© 2013 David Dufberg -© 2014-2021 Quentin Rameau -© 2014-2016 Markus Teich -© 2015 Jakukyo Friel -© 2015 Ben Woolley -© 2015 Greg Reagle -© 2015 GhostAV -© 2015-2017 Ivan Tham -© 2015 Alexander Huemer -© 2015 Michael Stevens -© 2015 Felix Janda -© 2016 Charles Lehner -© 2016 Dmitry Bogatov -© 2017 Hiltjo Posthuma -© 2017 ssd -© 2017 Constantine Bytensky -© 2017 Eon S. Jeon -© 2017 Jochen Sprickerhof -© 2018 nzl -© 2018 Eddie Thieda -© 2018 Leonardo Taccari -© 2019 efe - -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 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. - diff --git a/dwm/surf/Makefile b/dwm/surf/Makefile deleted file mode 100644 index 1edf820..0000000 --- a/dwm/surf/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# surf - simple browser -# See LICENSE file for copyright and license details. -.POSIX: - -include config.mk - -SRC = surf.c -WSRC = webext-surf.c -OBJ = $(SRC:.c=.o) -WOBJ = $(WSRC:.c=.o) -WLIB = $(WSRC:.c=.so) - -all: options surf $(WLIB) - -options: - @echo surf build options: - @echo "CC = $(CC)" - @echo "CFLAGS = $(SURFCFLAGS) $(CFLAGS)" - @echo "WEBEXTCFLAGS = $(WEBEXTCFLAGS) $(CFLAGS)" - @echo "LDFLAGS = $(LDFLAGS)" - -surf: $(OBJ) - $(CC) $(SURFLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) - -$(OBJ) $(WOBJ): config.h common.h config.mk - -config.h: - cp config.def.h $@ - -$(OBJ): $(SRC) - $(CC) $(SURFCFLAGS) $(CFLAGS) -c $(SRC) - -$(WLIB): $(WOBJ) - $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $? $(WEBEXTLIBS) - -$(WOBJ): $(WSRC) - $(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WSRC) - -clean: - rm -f surf $(OBJ) - rm -f $(WLIB) $(WOBJ) - -distclean: clean - rm -f config.h surf-$(VERSION).tar.gz - -dist: distclean - mkdir -p surf-$(VERSION) - cp -R LICENSE Makefile config.mk config.def.h README \ - surf-open.sh arg.h TODO.md surf.png \ - surf.1 common.h $(SRC) $(WSRC) surf-$(VERSION) - tar -cf surf-$(VERSION).tar surf-$(VERSION) - gzip surf-$(VERSION).tar - rm -rf surf-$(VERSION) - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f surf $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/surf - mkdir -p $(DESTDIR)$(LIBDIR) - cp -f $(WLIB) $(DESTDIR)$(LIBDIR) - for wlib in $(WLIB); do \ - chmod 644 $(DESTDIR)$(LIBDIR)/$$wlib; \ - done - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1 - chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1 - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/surf - rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1 - for wlib in $(WLIB); do \ - rm -f $(DESTDIR)$(LIBDIR)/$$wlib; \ - done - - rmdir $(DESTDIR)$(LIBDIR) - -.PHONY: all options distclean clean dist install uninstall diff --git a/dwm/surf/README b/dwm/surf/README deleted file mode 100644 index da4577f..0000000 --- a/dwm/surf/README +++ /dev/null @@ -1,40 +0,0 @@ -surf - simple webkit-based browser -================================== -surf is a simple Web browser based on WebKit/GTK+. - -Requirements ------------- -In order to build surf you need GTK+ and Webkit/GTK+ header files. - -In order to use the functionality of the url-bar, also install dmenu[0]. - -Installation ------------- -Edit config.mk to match your local setup (surf is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install surf (if -necessary as root): - - make clean install - -Running surf ------------- -run - surf [URI] - -See the manpage for further options. - -Running surf in tabbed ----------------------- -For running surf in tabbed[1] there is a script included in the distribution, -which is run like this: - - surf-open.sh [URI] - -Further invocations of the script will run surf with the specified URI in this -instance of tabbed. - -[0] http://tools.suckless.org/dmenu -[1] http://tools.suckless.org/tabbed - diff --git a/dwm/surf/TODO.md b/dwm/surf/TODO.md deleted file mode 100644 index da5f44d..0000000 --- a/dwm/surf/TODO.md +++ /dev/null @@ -1,10 +0,0 @@ -# TODO - -* suckless adblocking -* replace twitch() with proper gtk calls to make scrollbars reappear -* replace webkit with something sane -* add video player options - * play in plugin - * play in video player - * call command with URI (quvi + cclive) - diff --git a/dwm/surf/arg.h b/dwm/surf/arg.h deleted file mode 100644 index ba3fb3f..0000000 --- a/dwm/surf/arg.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef ARG_H__ -#define ARG_H__ - -extern char *argv0; - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][0] == '-'\ - && argv[0][1];\ - argc--, argv++) {\ - char argc_;\ - char **argv_;\ - int brk_;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - for (brk_ = 0, argv[0]++, argv_ = argv;\ - argv[0][0] && !brk_;\ - argv[0]++) {\ - if (argv_ != argv)\ - break;\ - argc_ = argv[0][0];\ - switch (argc_) -#define ARGEND }\ - } - -#define ARGC() argc_ - -#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#endif diff --git a/dwm/surf/common.h b/dwm/surf/common.h deleted file mode 100644 index 3990c42..0000000 --- a/dwm/surf/common.h +++ /dev/null @@ -1 +0,0 @@ -#define MSGBUFSZ 8 diff --git a/dwm/surf/config.def.h b/dwm/surf/config.def.h deleted file mode 100644 index 8c2e470..0000000 --- a/dwm/surf/config.def.h +++ /dev/null @@ -1,194 +0,0 @@ -/* modifier 0 means no modifier */ -static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */ -static char *fulluseragent = ""; /* Or override the whole user agent string */ -static char *scriptfile = "~/.surf/script.js"; -static char *styledir = "~/.surf/styles/"; -static char *certdir = "~/.surf/certificates/"; -static char *cachedir = "~/.surf/cache/"; -static char *cookiefile = "~/.surf/cookies.txt"; - -/* Webkit default features */ -/* Highest priority value will be used. - * Default parameters are priority 0 - * Per-uri parameters are priority 1 - * Command parameters are priority 2 - */ -static Parameter defconfig[ParameterLast] = { - /* parameter Arg value priority */ - [AccessMicrophone] = { { .i = 0 }, }, - [AccessWebcam] = { { .i = 0 }, }, - [Certificate] = { { .i = 0 }, }, - [CaretBrowsing] = { { .i = 0 }, }, - [CookiePolicies] = { { .v = "@Aa" }, }, - [DarkMode] = { { .i = 0 }, }, - [DefaultCharset] = { { .v = "UTF-8" }, }, - [DiskCache] = { { .i = 1 }, }, - [DNSPrefetch] = { { .i = 0 }, }, - [Ephemeral] = { { .i = 0 }, }, - [FileURLsCrossAccess] = { { .i = 0 }, }, - [FontSize] = { { .i = 12 }, }, - [Geolocation] = { { .i = 0 }, }, - [HideBackground] = { { .i = 0 }, }, - [Inspector] = { { .i = 0 }, }, - [JavaScript] = { { .i = 1 }, }, - [KioskMode] = { { .i = 0 }, }, - [LoadImages] = { { .i = 1 }, }, - [MediaManualPlay] = { { .i = 1 }, }, - [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, - [RunInFullscreen] = { { .i = 0 }, }, - [ScrollBars] = { { .i = 1 }, }, - [ShowIndicators] = { { .i = 1 }, }, - [SiteQuirks] = { { .i = 1 }, }, - [SmoothScrolling] = { { .i = 0 }, }, - [SpellChecking] = { { .i = 0 }, }, - [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, - [StrictTLS] = { { .i = 1 }, }, - [Style] = { { .i = 1 }, }, - [WebGL] = { { .i = 0 }, }, - [ZoomLevel] = { { .f = 1.0 }, }, -}; - -static UriParameters uriparams[] = { - { "(://|\\.)suckless\\.org(/|$)", { - [JavaScript] = { { .i = 0 }, 1 }, - }, }, -}; - -/* default window size: width, height */ -static int winsize[] = { 800, 600 }; - -static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | - WEBKIT_FIND_OPTIONS_WRAP_AROUND; - -#define PROMPT_GO "Go:" -#define PROMPT_FIND "Find:" - -/* SETPROP(readprop, setprop, prompt)*/ -#define SETPROP(r, s, p) { \ - .v = (const char *[]){ "/bin/sh", "-c", \ - "prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \ - "| sed -e 's/^"r"(UTF8_STRING) = \"\\(.*\\)\"/\\1/' " \ - " -e 's/\\\\\\(.\\)/\\1/g')\" " \ - "| dmenu -p '"p"' -w $1)\" " \ - "&& xprop -id $1 -f "s" 8u -set "s" \"$prop\"", \ - "surf-setprop", winid, NULL \ - } \ -} - -/* DOWNLOAD(URI, referer) */ -#define DOWNLOAD(u, r) { \ - .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ - "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ - " -e \"$3\" \"$4\"; read", \ - "surf-download", useragent, cookiefile, r, u, NULL \ - } \ -} - -/* PLUMB(URI) */ -/* This called when some URI which does not begin with "about:", - * "http://" or "https://" should be opened. - */ -#define PLUMB(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "xdg-open \"$0\"", u, NULL \ - } \ -} - -/* VIDEOPLAY(URI) */ -#define VIDEOPLAY(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "mpv --really-quiet \"$0\"", u, NULL \ - } \ -} - -/* styles */ -/* - * The iteration will stop at the first match, beginning at the beginning of - * the list. - */ -static SiteSpecific styles[] = { - /* regexp file in $styledir */ - { ".*", "default.css" }, -}; - -/* certificates */ -/* - * Provide custom certificate for urls - */ -static SiteSpecific certs[] = { - /* regexp file in $certdir */ - { "://suckless\\.org/", "suckless.org.crt" }, -}; - -#define HOMEPAGE "https://google.ru" -#define MODKEY GDK_CONTROL_MASK - -/* hotkeys */ -/* - * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to - * edit the CLEANMASK() macro. - */ -static Key keys[] = { - /* modifier keyval function arg */ - { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - - { 0, GDK_KEY_Escape, stop, { 0 } }, - { MODKEY, GDK_KEY_c, stop, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, - { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, - - { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, - { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, - - /* vertical and horizontal scrolling, in viewport percentage */ - { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, - { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, - { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, - { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, - { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, - { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, - - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, - { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, - { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, - - { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, - { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, - - { MODKEY, GDK_KEY_n, find, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, - { MODKEY, GDK_KEY_t, showcert, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, - { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } }, -}; - -/* button definitions */ -/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ -static Button buttons[] = { - /* target event mask button function argument stop event */ - { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, - { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, - { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, - { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, - { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, - { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, -}; diff --git a/dwm/surf/config.def.h.orig b/dwm/surf/config.def.h.orig deleted file mode 100644 index c5370b9..0000000 --- a/dwm/surf/config.def.h.orig +++ /dev/null @@ -1,193 +0,0 @@ -/* modifier 0 means no modifier */ -static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */ -static char *fulluseragent = ""; /* Or override the whole user agent string */ -static char *scriptfile = "~/.surf/script.js"; -static char *styledir = "~/.surf/styles/"; -static char *certdir = "~/.surf/certificates/"; -static char *cachedir = "~/.surf/cache/"; -static char *cookiefile = "~/.surf/cookies.txt"; - -/* Webkit default features */ -/* Highest priority value will be used. - * Default parameters are priority 0 - * Per-uri parameters are priority 1 - * Command parameters are priority 2 - */ -static Parameter defconfig[ParameterLast] = { - /* parameter Arg value priority */ - [AccessMicrophone] = { { .i = 0 }, }, - [AccessWebcam] = { { .i = 0 }, }, - [Certificate] = { { .i = 0 }, }, - [CaretBrowsing] = { { .i = 0 }, }, - [CookiePolicies] = { { .v = "@Aa" }, }, - [DarkMode] = { { .i = 0 }, }, - [DefaultCharset] = { { .v = "UTF-8" }, }, - [DiskCache] = { { .i = 1 }, }, - [DNSPrefetch] = { { .i = 0 }, }, - [Ephemeral] = { { .i = 0 }, }, - [FileURLsCrossAccess] = { { .i = 0 }, }, - [FontSize] = { { .i = 12 }, }, - [Geolocation] = { { .i = 0 }, }, - [HideBackground] = { { .i = 0 }, }, - [Inspector] = { { .i = 0 }, }, - [JavaScript] = { { .i = 1 }, }, - [KioskMode] = { { .i = 0 }, }, - [LoadImages] = { { .i = 1 }, }, - [MediaManualPlay] = { { .i = 1 }, }, - [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, - [RunInFullscreen] = { { .i = 0 }, }, - [ScrollBars] = { { .i = 1 }, }, - [ShowIndicators] = { { .i = 1 }, }, - [SiteQuirks] = { { .i = 1 }, }, - [SmoothScrolling] = { { .i = 0 }, }, - [SpellChecking] = { { .i = 0 }, }, - [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, - [StrictTLS] = { { .i = 1 }, }, - [Style] = { { .i = 1 }, }, - [WebGL] = { { .i = 0 }, }, - [ZoomLevel] = { { .f = 1.0 }, }, -}; - -static UriParameters uriparams[] = { - { "(://|\\.)suckless\\.org(/|$)", { - [JavaScript] = { { .i = 0 }, 1 }, - }, }, -}; - -/* default window size: width, height */ -static int winsize[] = { 800, 600 }; - -static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | - WEBKIT_FIND_OPTIONS_WRAP_AROUND; - -#define PROMPT_GO "Go:" -#define PROMPT_FIND "Find:" - -/* SETPROP(readprop, setprop, prompt)*/ -#define SETPROP(r, s, p) { \ - .v = (const char *[]){ "/bin/sh", "-c", \ - "prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \ - "| sed -e 's/^"r"(UTF8_STRING) = \"\\(.*\\)\"/\\1/' " \ - " -e 's/\\\\\\(.\\)/\\1/g')\" " \ - "| dmenu -p '"p"' -w $1)\" " \ - "&& xprop -id $1 -f "s" 8u -set "s" \"$prop\"", \ - "surf-setprop", winid, NULL \ - } \ -} - -/* DOWNLOAD(URI, referer) */ -#define DOWNLOAD(u, r) { \ - .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ - "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ - " -e \"$3\" \"$4\"; read", \ - "surf-download", useragent, cookiefile, r, u, NULL \ - } \ -} - -/* PLUMB(URI) */ -/* This called when some URI which does not begin with "about:", - * "http://" or "https://" should be opened. - */ -#define PLUMB(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "xdg-open \"$0\"", u, NULL \ - } \ -} - -/* VIDEOPLAY(URI) */ -#define VIDEOPLAY(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "mpv --really-quiet \"$0\"", u, NULL \ - } \ -} - -/* styles */ -/* - * The iteration will stop at the first match, beginning at the beginning of - * the list. - */ -static SiteSpecific styles[] = { - /* regexp file in $styledir */ - { ".*", "default.css" }, -}; - -/* certificates */ -/* - * Provide custom certificate for urls - */ -static SiteSpecific certs[] = { - /* regexp file in $certdir */ - { "://suckless\\.org/", "suckless.org.crt" }, -}; - -#define MODKEY GDK_CONTROL_MASK - -/* hotkeys */ -/* - * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to - * edit the CLEANMASK() macro. - */ -static Key keys[] = { - /* modifier keyval function arg */ - { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - - { 0, GDK_KEY_Escape, stop, { 0 } }, - { MODKEY, GDK_KEY_c, stop, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, - { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, - - { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, - { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, - - /* vertical and horizontal scrolling, in viewport percentage */ - { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, - { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, - { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, - { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, - { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, - { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, - - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, - { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, - { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, - - { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, - { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, - - { MODKEY, GDK_KEY_n, find, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, - { MODKEY, GDK_KEY_t, showcert, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, - { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } }, -}; - -/* button definitions */ -/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ -static Button buttons[] = { - /* target event mask button function argument stop event */ - { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, - { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, - { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, - { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, - { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, - { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, -}; diff --git a/dwm/surf/config.h b/dwm/surf/config.h deleted file mode 100644 index 8c2e470..0000000 --- a/dwm/surf/config.h +++ /dev/null @@ -1,194 +0,0 @@ -/* modifier 0 means no modifier */ -static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */ -static char *fulluseragent = ""; /* Or override the whole user agent string */ -static char *scriptfile = "~/.surf/script.js"; -static char *styledir = "~/.surf/styles/"; -static char *certdir = "~/.surf/certificates/"; -static char *cachedir = "~/.surf/cache/"; -static char *cookiefile = "~/.surf/cookies.txt"; - -/* Webkit default features */ -/* Highest priority value will be used. - * Default parameters are priority 0 - * Per-uri parameters are priority 1 - * Command parameters are priority 2 - */ -static Parameter defconfig[ParameterLast] = { - /* parameter Arg value priority */ - [AccessMicrophone] = { { .i = 0 }, }, - [AccessWebcam] = { { .i = 0 }, }, - [Certificate] = { { .i = 0 }, }, - [CaretBrowsing] = { { .i = 0 }, }, - [CookiePolicies] = { { .v = "@Aa" }, }, - [DarkMode] = { { .i = 0 }, }, - [DefaultCharset] = { { .v = "UTF-8" }, }, - [DiskCache] = { { .i = 1 }, }, - [DNSPrefetch] = { { .i = 0 }, }, - [Ephemeral] = { { .i = 0 }, }, - [FileURLsCrossAccess] = { { .i = 0 }, }, - [FontSize] = { { .i = 12 }, }, - [Geolocation] = { { .i = 0 }, }, - [HideBackground] = { { .i = 0 }, }, - [Inspector] = { { .i = 0 }, }, - [JavaScript] = { { .i = 1 }, }, - [KioskMode] = { { .i = 0 }, }, - [LoadImages] = { { .i = 1 }, }, - [MediaManualPlay] = { { .i = 1 }, }, - [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, - [RunInFullscreen] = { { .i = 0 }, }, - [ScrollBars] = { { .i = 1 }, }, - [ShowIndicators] = { { .i = 1 }, }, - [SiteQuirks] = { { .i = 1 }, }, - [SmoothScrolling] = { { .i = 0 }, }, - [SpellChecking] = { { .i = 0 }, }, - [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, - [StrictTLS] = { { .i = 1 }, }, - [Style] = { { .i = 1 }, }, - [WebGL] = { { .i = 0 }, }, - [ZoomLevel] = { { .f = 1.0 }, }, -}; - -static UriParameters uriparams[] = { - { "(://|\\.)suckless\\.org(/|$)", { - [JavaScript] = { { .i = 0 }, 1 }, - }, }, -}; - -/* default window size: width, height */ -static int winsize[] = { 800, 600 }; - -static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | - WEBKIT_FIND_OPTIONS_WRAP_AROUND; - -#define PROMPT_GO "Go:" -#define PROMPT_FIND "Find:" - -/* SETPROP(readprop, setprop, prompt)*/ -#define SETPROP(r, s, p) { \ - .v = (const char *[]){ "/bin/sh", "-c", \ - "prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \ - "| sed -e 's/^"r"(UTF8_STRING) = \"\\(.*\\)\"/\\1/' " \ - " -e 's/\\\\\\(.\\)/\\1/g')\" " \ - "| dmenu -p '"p"' -w $1)\" " \ - "&& xprop -id $1 -f "s" 8u -set "s" \"$prop\"", \ - "surf-setprop", winid, NULL \ - } \ -} - -/* DOWNLOAD(URI, referer) */ -#define DOWNLOAD(u, r) { \ - .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ - "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ - " -e \"$3\" \"$4\"; read", \ - "surf-download", useragent, cookiefile, r, u, NULL \ - } \ -} - -/* PLUMB(URI) */ -/* This called when some URI which does not begin with "about:", - * "http://" or "https://" should be opened. - */ -#define PLUMB(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "xdg-open \"$0\"", u, NULL \ - } \ -} - -/* VIDEOPLAY(URI) */ -#define VIDEOPLAY(u) {\ - .v = (const char *[]){ "/bin/sh", "-c", \ - "mpv --really-quiet \"$0\"", u, NULL \ - } \ -} - -/* styles */ -/* - * The iteration will stop at the first match, beginning at the beginning of - * the list. - */ -static SiteSpecific styles[] = { - /* regexp file in $styledir */ - { ".*", "default.css" }, -}; - -/* certificates */ -/* - * Provide custom certificate for urls - */ -static SiteSpecific certs[] = { - /* regexp file in $certdir */ - { "://suckless\\.org/", "suckless.org.crt" }, -}; - -#define HOMEPAGE "https://google.ru" -#define MODKEY GDK_CONTROL_MASK - -/* hotkeys */ -/* - * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to - * edit the CLEANMASK() macro. - */ -static Key keys[] = { - /* modifier keyval function arg */ - { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - - { 0, GDK_KEY_Escape, stop, { 0 } }, - { MODKEY, GDK_KEY_c, stop, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, - { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, - - { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, - { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, - - /* vertical and horizontal scrolling, in viewport percentage */ - { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, - { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, - { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, - { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, - { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, - { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, - - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, - { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, - { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, - - { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, - { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, - - { MODKEY, GDK_KEY_n, find, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, - { MODKEY, GDK_KEY_t, showcert, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, - { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_d, toggle, { .i = DarkMode } }, -}; - -/* button definitions */ -/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ -static Button buttons[] = { - /* target event mask button function argument stop event */ - { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, - { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, - { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, - { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, - { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, - { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, -}; diff --git a/dwm/surf/config.mk b/dwm/surf/config.mk deleted file mode 100644 index 2eb9fb0..0000000 --- a/dwm/surf/config.mk +++ /dev/null @@ -1,32 +0,0 @@ -# surf version -VERSION = 2.1 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/share/man -LIBPREFIX = $(PREFIX)/lib -LIBDIR = $(LIBPREFIX)/surf - -X11INC = `pkg-config --cflags x11` -X11LIB = `pkg-config --libs x11` - -GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0` -WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0` -WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0 gio-2.0` - -# includes and libs -INCS = $(X11INC) $(GTKINC) -LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0 - -# flags -CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \ - -DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \ - -D_DEFAULT_SOURCE -SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS) -WEBEXTCFLAGS = -fPIC $(WEBEXTINC) - -# compiler -#CC = c99 diff --git a/dwm/surf/patches/surf-2.0-homepage.diff b/dwm/surf/patches/surf-2.0-homepage.diff deleted file mode 100644 index f32016f..0000000 --- a/dwm/surf/patches/surf-2.0-homepage.diff +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/config.def.h b/config.def.h ---- a/config.def.h -+++ b/config.def.h -@@ -164,3 +164,5 @@ static Button buttons[] = { - { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, - { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, - }; -+ -+#define HOMEPAGE "https://duckduckgo.com/" -diff --git a/surf.c b/surf.c ---- a/surf.c -+++ b/surf.c -@@ -1751,7 +1751,11 @@ main(int argc, char *argv[]) - if (argc > 0) - arg.v = argv[0]; - else -+#ifdef HOMEPAGE -+ arg.v = HOMEPAGE; -+#else - arg.v = "about:blank"; -+#endif - - setup(); - c = newclient(NULL); diff --git a/dwm/surf/surf b/dwm/surf/surf deleted file mode 100755 index f5a87c7..0000000 Binary files a/dwm/surf/surf and /dev/null differ diff --git a/dwm/surf/surf-open.sh b/dwm/surf/surf-open.sh deleted file mode 100755 index c22edc2..0000000 --- a/dwm/surf/surf-open.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# See the LICENSE file for copyright and license details. -# - -xidfile="$HOME/tmp/tabbed-surf.xid" -uri="" - -if [ "$#" -gt 0 ]; -then - uri="$1" -fi - -runtabbed() { - tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \ - 2>/dev/null & -} - -if [ ! -r "$xidfile" ]; -then - runtabbed -else - xid=$(cat "$xidfile") - xprop -id "$xid" >/dev/null 2>&1 - if [ $? -gt 0 ]; - then - runtabbed - else - surf -e "$xid" "$uri" >/dev/null 2>&1 & - fi -fi - diff --git a/dwm/surf/surf.1 b/dwm/surf/surf.1 deleted file mode 100644 index 23117b1..0000000 --- a/dwm/surf/surf.1 +++ /dev/null @@ -1,305 +0,0 @@ -.TH SURF 1 surf\-VERSION -.SH NAME -surf \- simple webkit-based browser -.SH SYNOPSIS -.B surf -.RB [-bBdDfFgGiIkKmMnNpPsStTvwxX] -.RB [-a\ cookiepolicies] -.RB [-c\ cookiefile] -.RB [-C\ stylefile] -.RB [-e\ xid] -.RB [-r\ scriptfile] -.RB [-u\ useragent] -.RB [-z\ zoomlevel] -.RB [URI] -.SH DESCRIPTION -surf is a simple Web browser based on WebKit/GTK+. It is able -to display websites and follow links. It supports the XEmbed protocol -which makes it possible to embed it in another application. Furthermore, -one can point surf to another URI by setting its XProperties. -.SH OPTIONS -.TP -.B \-a cookiepolicies -Define the order of -.I cookie policies\fR. -The default is "@Aa" but could be -redefined in the -.IR config.h , -with "A" meaning to -accept all cookies, "a" to deny all cookies and "@", which tells surf to -accept no third party cookies. -.TP -.B \-b -Disable Scrollbars. -.TP -.B \-B -Enable Scrollbars. -.TP -.B \-c cookiefile -Specify the -.I cookiefile -to use. -.TP -.B \-C stylefile -Specify the user -.IR stylefile . -This does disable the site-specific styles. -.TP -.B \-d -Disable the disk cache. -.TP -.B \-D -Enable the disk cache. -.TP -.B \-e xid -Reparents to window specified by -.IR xid . -.TP -.B \-f -Start surf in windowed mode (not fullscreen). -.TP -.B \-F -Start surf in fullscreen mode. -.TP -.B \-g -Disable giving the geolocation to websites. -.TP -.B \-G -Enable giving the geolocation to websites. -.TP -.B \-i -Disable Images. -.TP -.B \-I -Enable Images. -.TP -.B \-k -Disable kiosk mode (disable key strokes and right click). -.TP -.B \-K -Enable kiosk mode (disable key strokes and right click). -.TP -.B \-m -Disable application of user style sheets. -.TP -.B \-M -Enable application of user style sheets. -.TP -.B \-n -Disable the Web Inspector (Developer Tools). -.TP -.B \-N -Enable the Web Inspector (Developer Tools). -.TP -.B \-r scriptfile -Specify the user -.IR scriptfile . -.TP -.B \-s -Disable Javascript. -.TP -.B \-S -Enable Javascript. -.TP -.B \-t -Disable strict TLS check. -.TP -.B \-T -Enable strict TLS check. -.TP -.B \-u useragent -Specify the -.I useragent -which surf should use. -.TP -.B \-v -Prints version information to standard output, then exits. -.TP -.B \-w -Prints xid to standard output. This can be used to script the browser in for -example -.BR xdotool(1) . -.TP -.B -x -Disable custom certificates. -.TP -.B -X -Enable custom certificates. -.TP -.B \-z zoomlevel -Specify the -.I zoomlevel -which surf should use. -.SH USAGE -.B Escape -Stops loading current page or stops download. -.TP -.B Ctrl\-h -Walks back the history. -.TP -.B Ctrl\-l -Walks forward the history. -.TP -.B Ctrl\-k -Scrolls page upwards. -.TP -.B Ctrl\-j -Scrolls page downwards. -.TP -.B Ctrl\-b -Scroll up one whole page view. -.TP -.B Ctrl\-Space -Scroll down one whole page view. -.TP -.B Ctrl\-i -Scroll horizontally to the right. -.TP -.B Ctrl\-u -Scroll horizontally to the left. -.TP -.B Ctrl\-Shift\-k or Ctrl\-+ -Zooms page in. -.TP -.B Ctrl\-Shift\-j or Ctrl\-- -Zooms page out. -.TP -.B Ctrl\-Shift\-q -Resets Zoom. -.TP -.B Ctrl\-f and Ctrl\-/ -Opens the search-bar. -.TP -.B Ctrl\-n -Go to next search result. -.TP -.B Ctrl\-Shift\-n -Go to previous search result. -.TP -.B Ctrl\-g -Opens the URL-bar (requires dmenu installed). -.TP -.B Ctrl\-p -Loads URI from primary selection. -.TP -.B Ctrl\-Shift\-p -Calls Printpage Dialog. -.TP -.B Ctrl\-r -Reloads the website. -.TP -.B Ctrl\-Shift\-r -Reloads the website without using the cache. -.TP -.B Ctrl\-y -Copies current URI to primary selection. -.TP -.B Ctrl\-t -Display the current TLS certificate in a popup window. -.TP -.B Ctrl\-Shift\-a -Toggle through the the -.I cookie policies\fR. -This will not reload the page. -.TP -.B Ctrl\-Shift\-b -Toggle scrollbars. This will reload the page. -.TP -.B Ctrl\-Shift\-c -Toggle caret browsing. This will reload the page. -.TP -.B Ctrl\-Shift\-d -Toggle dark mode. -.TP -.B Ctrl\-Shift\-i -Toggle auto-loading of images. This will reload the page. -.TP -.B Ctrl\-Shift\-m -Toggle if the -.I stylefile -file should be loaded. This will reload the page. -.TP -.B Ctrl\-Shift\-o -Open the Web Inspector (Developer Tools) window for the current page. -.TP -.B Ctrl\-Shift\-s -Toggle script execution. This will reload the page. -.TP -.B Ctrl\-Shift\-t -Toggle strict TLS check. This will reload the page. -.TP -.B F11 -Toggle fullscreen mode. -.SH INDICATORS OF OPERATION -Surf is showing indicators of operation in front of the site title. -For all indicators, unless otherwise specified, a lower case letter means disabled and an upper case letter means enabled. -.TP -.B A -all cookies accepted -.TP -.B a -no cookies accepted -.TP -.B @ -all except third-party cookies accepted -.TP -.B c C -caret browsing -.TP -.B g G -geolocation -.TP -.B d D -disk cache -.TP -.B i I -images -.TP -.B s S -scripts -.TP -.B m M -styles -.TP -.B x X -custom certificates -.TP -.B t T -strict TLS -.SH INDICATORS OF WEB PAGE -The second part of the indicators specifies modes of the web page itself. -.SS First character: encryption -.TP -.B - -unencrypted -.TP -.B T -encrypted (TLS) -.TP -.B U -attempted encryption but failed -.SS Second character: proxying -.TP -.B - -no proxy -.TP -.B P -using proxy -.SH ENVIRONMENT -.B SURF_USERAGENT -If this variable is set upon startup, surf will use it as the -.I useragent -string. -.TP -.B http_proxy -If this variable is set and not empty upon startup, surf will use it as the http proxy. -.SH SIGNALS -Surf will reload the current page on -.BR SIGHUP . -.SH SEE ALSO -.BR dmenu(1), -.BR xprop(1), -.BR tabbed(1), -.BR xdotool(1) -.SH BUGS -Please report them! diff --git a/dwm/surf/surf.c b/dwm/surf/surf.c deleted file mode 100644 index 982b724..0000000 --- a/dwm/surf/surf.c +++ /dev/null @@ -1,2135 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * To understand surf, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arg.h" -#include "common.h" - -#define LENGTH(x) (sizeof(x) / sizeof(x[0])) -#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK)) - -enum { AtomFind, AtomGo, AtomUri, AtomUTF8, AtomLast }; - -enum { - OnDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT, - OnLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK, - OnImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE, - OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA, - OnEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE, - OnBar = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR, - OnSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION, - OnAny = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel, -}; - -typedef enum { - AccessMicrophone, - AccessWebcam, - CaretBrowsing, - Certificate, - CookiePolicies, - DarkMode, - DiskCache, - DefaultCharset, - DNSPrefetch, - Ephemeral, - FileURLsCrossAccess, - FontSize, - Geolocation, - HideBackground, - Inspector, - JavaScript, - KioskMode, - LoadImages, - MediaManualPlay, - PreferredLanguages, - RunInFullscreen, - ScrollBars, - ShowIndicators, - SiteQuirks, - SmoothScrolling, - SpellChecking, - SpellLanguages, - StrictTLS, - Style, - WebGL, - ZoomLevel, - ParameterLast -} ParamName; - -typedef union { - int i; - float f; - const void *v; -} Arg; - -typedef struct { - Arg val; - int prio; -} Parameter; - -typedef struct Client { - GtkWidget *win; - WebKitWebView *view; - WebKitSettings *settings; - WebKitWebContext *context; - WebKitWebInspector *inspector; - WebKitFindController *finder; - WebKitHitTestResult *mousepos; - GTlsCertificate *cert, *failedcert; - GTlsCertificateFlags tlserr; - Window xid; - guint64 pageid; - int progress, fullscreen, https, insecure, errorpage; - const char *title, *overtitle, *targeturi; - const char *needle; - struct Client *next; -} Client; - -typedef struct { - guint mod; - guint keyval; - void (*func)(Client *c, const Arg *a); - const Arg arg; -} Key; - -typedef struct { - unsigned int target; - unsigned int mask; - guint button; - void (*func)(Client *c, const Arg *a, WebKitHitTestResult *h); - const Arg arg; - unsigned int stopevent; -} Button; - -typedef struct { - const char *uri; - Parameter config[ParameterLast]; - regex_t re; -} UriParameters; - -typedef struct { - char *regex; - char *file; - regex_t re; -} SiteSpecific; - -/* Surf */ -static void die(const char *errstr, ...); -static void usage(void); -static void setup(void); -static void sigchld(int unused); -static void sighup(int unused); -static char *buildfile(const char *path); -static char *buildpath(const char *path); -static char *untildepath(const char *path); -static const char *getuserhomedir(const char *user); -static const char *getcurrentuserhomedir(void); -static Client *newclient(Client *c); -static void loaduri(Client *c, const Arg *a); -static const char *geturi(Client *c); -static void setatom(Client *c, int a, const char *v); -static const char *getatom(Client *c, int a); -static void updatetitle(Client *c); -static void gettogglestats(Client *c); -static void getpagestats(Client *c); -static WebKitCookieAcceptPolicy cookiepolicy_get(void); -static char cookiepolicy_set(const WebKitCookieAcceptPolicy p); -static void seturiparameters(Client *c, const char *uri, ParamName *params); -static void setparameter(Client *c, int refresh, ParamName p, const Arg *a); -static const char *getcert(const char *uri); -static void setcert(Client *c, const char *file); -static const char *getstyle(const char *uri); -static void setstyle(Client *c, const char *file); -static void runscript(Client *c); -static void evalscript(Client *c, const char *jsstr, ...); -static void updatewinid(Client *c); -static void handleplumb(Client *c, const char *uri); -static void newwindow(Client *c, const Arg *a, int noembed); -static void spawn(Client *c, const Arg *a); -static void msgext(Client *c, char type, const Arg *a); -static void destroyclient(Client *c); -static void cleanup(void); - -/* GTK/WebKit */ -static WebKitWebView *newview(Client *c, WebKitWebView *rv); -static void initwebextensions(WebKitWebContext *wc, Client *c); -static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, - Client *c); -static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c); -static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, - gpointer d); -static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c); -static void showview(WebKitWebView *v, Client *c); -static GtkWidget *createwindow(Client *c); -static gboolean loadfailedtls(WebKitWebView *v, gchar *uri, - GTlsCertificate *cert, - GTlsCertificateFlags err, Client *c); -static void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c); -static void progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c); -static void titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c); -static void mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, - guint modifiers, Client *c); -static gboolean permissionrequested(WebKitWebView *v, - WebKitPermissionRequest *r, Client *c); -static gboolean decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, - WebKitPolicyDecisionType dt, Client *c); -static void decidenavigation(WebKitPolicyDecision *d, Client *c); -static void decidenewwindow(WebKitPolicyDecision *d, Client *c); -static void decideresource(WebKitPolicyDecision *d, Client *c); -static void insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, - Client *c); -static void downloadstarted(WebKitWebContext *wc, WebKitDownload *d, - Client *c); -static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c); -static void download(Client *c, WebKitURIResponse *r); -static gboolean viewusrmsgrcv(WebKitWebView *v, WebKitUserMessage *m, - gpointer u); -static void webprocessterminated(WebKitWebView *v, - WebKitWebProcessTerminationReason r, - Client *c); -static void closeview(WebKitWebView *v, Client *c); -static void destroywin(GtkWidget* w, Client *c); - -/* Hotkeys */ -static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); -static void reload(Client *c, const Arg *a); -static void print(Client *c, const Arg *a); -static void showcert(Client *c, const Arg *a); -static void clipboard(Client *c, const Arg *a); -static void zoom(Client *c, const Arg *a); -static void scrollv(Client *c, const Arg *a); -static void scrollh(Client *c, const Arg *a); -static void navigate(Client *c, const Arg *a); -static void stop(Client *c, const Arg *a); -static void toggle(Client *c, const Arg *a); -static void togglefullscreen(Client *c, const Arg *a); -static void togglecookiepolicy(Client *c, const Arg *a); -static void toggleinspector(Client *c, const Arg *a); -static void find(Client *c, const Arg *a); - -/* Buttons */ -static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); -static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h); -static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h); - -static char winid[64]; -static char togglestats[11]; -static char pagestats[2]; -static Atom atoms[AtomLast]; -static Window embed; -static int showxid; -static int cookiepolicy; -static Display *dpy; -static Client *clients; -static GdkDevice *gdkkb; -static char *stylefile; -static const char *useragent; -static Parameter *curconfig; -static int modparams[ParameterLast]; -static int spair[2]; -char *argv0; - -static ParamName loadtransient[] = { - Certificate, - CookiePolicies, - DiskCache, - DNSPrefetch, - FileURLsCrossAccess, - JavaScript, - LoadImages, - PreferredLanguages, - ShowIndicators, - StrictTLS, - ParameterLast -}; - -static ParamName loadcommitted[] = { -// AccessMicrophone, -// AccessWebcam, - CaretBrowsing, - DarkMode, - DefaultCharset, - FontSize, - Geolocation, - HideBackground, - Inspector, -// KioskMode, - MediaManualPlay, - RunInFullscreen, - ScrollBars, - SiteQuirks, - SmoothScrolling, - SpellChecking, - SpellLanguages, - Style, - ZoomLevel, - ParameterLast -}; - -static ParamName loadfinished[] = { - ParameterLast -}; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -void -usage(void) -{ - die("usage: surf [-bBdDfFgGiIkKmMnNsStTvwxX]\n" - "[-a cookiepolicies ] [-c cookiefile] [-C stylefile] [-e xid]\n" - "[-r scriptfile] [-u useragent] [-z zoomlevel] [uri]\n"); -} - -void -setup(void) -{ - GIOChannel *gchanin; - GdkDisplay *gdpy; - int i, j; - - /* clean up any zombies immediately */ - sigchld(0); - if (signal(SIGHUP, sighup) == SIG_ERR) - die("Can't install SIGHUP handler"); - - if (!(dpy = XOpenDisplay(NULL))) - die("Can't open default display"); - - /* atoms */ - atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); - atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False); - atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False); - atoms[AtomUTF8] = XInternAtom(dpy, "UTF8_STRING", False); - - gtk_init(NULL, NULL); - - gdpy = gdk_display_get_default(); - - curconfig = defconfig; - - /* dirs and files */ - cookiefile = buildfile(cookiefile); - scriptfile = buildfile(scriptfile); - certdir = buildpath(certdir); - if (curconfig[Ephemeral].val.i) - cachedir = NULL; - else - cachedir = buildpath(cachedir); - - gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); - - if (socketpair(AF_UNIX, SOCK_DGRAM, 0, spair) < 0) { - fputs("Unable to create sockets\n", stderr); - spair[0] = spair[1] = -1; - } else { - gchanin = g_io_channel_unix_new(spair[0]); - g_io_channel_set_encoding(gchanin, NULL, NULL); - g_io_channel_set_flags(gchanin, g_io_channel_get_flags(gchanin) - | G_IO_FLAG_NONBLOCK, NULL); - g_io_channel_set_close_on_unref(gchanin, TRUE); - } - - - for (i = 0; i < LENGTH(certs); ++i) { - if (!regcomp(&(certs[i].re), certs[i].regex, REG_EXTENDED)) { - certs[i].file = g_strconcat(certdir, "/", certs[i].file, - NULL); - } else { - fprintf(stderr, "Could not compile regex: %s\n", - certs[i].regex); - certs[i].regex = NULL; - } - } - - if (!stylefile) { - styledir = buildpath(styledir); - for (i = 0; i < LENGTH(styles); ++i) { - if (!regcomp(&(styles[i].re), styles[i].regex, - REG_EXTENDED)) { - styles[i].file = g_strconcat(styledir, "/", - styles[i].file, NULL); - } else { - fprintf(stderr, "Could not compile regex: %s\n", - styles[i].regex); - styles[i].regex = NULL; - } - } - g_free(styledir); - } else { - stylefile = buildfile(stylefile); - } - - for (i = 0; i < LENGTH(uriparams); ++i) { - if (regcomp(&(uriparams[i].re), uriparams[i].uri, - REG_EXTENDED)) { - fprintf(stderr, "Could not compile regex: %s\n", - uriparams[i].uri); - uriparams[i].uri = NULL; - continue; - } - - /* copy default parameters with higher priority */ - for (j = 0; j < ParameterLast; ++j) { - if (defconfig[j].prio >= uriparams[i].config[j].prio) - uriparams[i].config[j] = defconfig[j]; - } - } -} - -void -sigchld(int unused) -{ - if (signal(SIGCHLD, sigchld) == SIG_ERR) - die("Can't install SIGCHLD handler"); - while (waitpid(-1, NULL, WNOHANG) > 0) - ; -} - -void -sighup(int unused) -{ - Arg a = { .i = 0 }; - Client *c; - - for (c = clients; c; c = c->next) - reload(c, &a); -} - -char * -buildfile(const char *path) -{ - char *dname, *bname, *bpath, *fpath; - FILE *f; - - dname = g_path_get_dirname(path); - bname = g_path_get_basename(path); - - bpath = buildpath(dname); - g_free(dname); - - fpath = g_build_filename(bpath, bname, NULL); - g_free(bpath); - g_free(bname); - - if (!(f = fopen(fpath, "a"))) - die("Could not open file: %s\n", fpath); - - g_chmod(fpath, 0600); /* always */ - fclose(f); - - return fpath; -} - -static const char* -getuserhomedir(const char *user) -{ - struct passwd *pw = getpwnam(user); - - if (!pw) - die("Can't get user %s login information.\n", user); - - return pw->pw_dir; -} - -static const char* -getcurrentuserhomedir(void) -{ - const char *homedir; - const char *user; - struct passwd *pw; - - homedir = getenv("HOME"); - if (homedir) - return homedir; - - user = getenv("USER"); - if (user) - return getuserhomedir(user); - - pw = getpwuid(getuid()); - if (!pw) - die("Can't get current user home directory\n"); - - return pw->pw_dir; -} - -char * -buildpath(const char *path) -{ - char *apath, *fpath; - - if (path[0] == '~') - apath = untildepath(path); - else - apath = g_strdup(path); - - /* creating directory */ - if (g_mkdir_with_parents(apath, 0700) < 0) - die("Could not access directory: %s\n", apath); - - fpath = realpath(apath, NULL); - g_free(apath); - - return fpath; -} - -char * -untildepath(const char *path) -{ - char *apath, *name, *p; - const char *homedir; - - if (path[1] == '/' || path[1] == '\0') { - p = (char *)&path[1]; - homedir = getcurrentuserhomedir(); - } else { - if ((p = strchr(path, '/'))) - name = g_strndup(&path[1], p - (path + 1)); - else - name = g_strdup(&path[1]); - - homedir = getuserhomedir(name); - g_free(name); - } - apath = g_build_filename(homedir, p, NULL); - return apath; -} - -Client * -newclient(Client *rc) -{ - Client *c; - - if (!(c = calloc(1, sizeof(Client)))) - die("Cannot malloc!\n"); - - c->next = clients; - clients = c; - - c->progress = 100; - c->view = newview(c, rc ? rc->view : NULL); - - return c; -} - -void -loaduri(Client *c, const Arg *a) -{ - struct stat st; - char *url, *path, *apath; - const char *uri = a->v; - - if (g_strcmp0(uri, "") == 0) - return; - - if (g_str_has_prefix(uri, "http://") || - g_str_has_prefix(uri, "https://") || - g_str_has_prefix(uri, "file://") || - g_str_has_prefix(uri, "webkit://") || - g_str_has_prefix(uri, "about:")) { - url = g_strdup(uri); - } else { - if (uri[0] == '~') - apath = untildepath(uri); - else - apath = (char *)uri; - if (!stat(apath, &st) && (path = realpath(apath, NULL))) { - url = g_strdup_printf("file://%s", path); - free(path); - } else { - url = g_strdup_printf("http://%s", uri); - } - if (apath != uri) - free(apath); - } - - setatom(c, AtomUri, url); - - if (strcmp(url, geturi(c)) == 0) { - reload(c, a); - } else { - webkit_web_view_load_uri(c->view, url); - updatetitle(c); - } - - g_free(url); -} - -const char * -geturi(Client *c) -{ - const char *uri; - - if (!(uri = webkit_web_view_get_uri(c->view))) - uri = "about:blank"; - return uri; -} - -void -setatom(Client *c, int a, const char *v) -{ - XChangeProperty(dpy, c->xid, - atoms[a], atoms[AtomUTF8], 8, PropModeReplace, - (unsigned char *)v, strlen(v) + 1); - XSync(dpy, False); -} - -const char * -getatom(Client *c, int a) -{ - static char buf[BUFSIZ]; - Atom adummy; - int idummy; - unsigned long ldummy; - unsigned char *p = NULL; - - XSync(dpy, False); - XGetWindowProperty(dpy, c->xid, - atoms[a], 0L, BUFSIZ, False, atoms[AtomUTF8], - &adummy, &idummy, &ldummy, &ldummy, &p); - if (p) - strncpy(buf, (char *)p, LENGTH(buf) - 1); - else - buf[0] = '\0'; - XFree(p); - - return buf; -} - -void -updatetitle(Client *c) -{ - char *title; - const char *name = c->overtitle ? c->overtitle : - c->title ? c->title : ""; - - if (curconfig[ShowIndicators].val.i) { - gettogglestats(c); - getpagestats(c); - - if (c->progress != 100) - title = g_strdup_printf("[%i%%] %s:%s | %s", - c->progress, togglestats, pagestats, name); - else - title = g_strdup_printf("%s:%s | %s", - togglestats, pagestats, name); - - gtk_window_set_title(GTK_WINDOW(c->win), title); - g_free(title); - } else { - gtk_window_set_title(GTK_WINDOW(c->win), name); - } -} - -void -gettogglestats(Client *c) -{ - togglestats[0] = cookiepolicy_set(cookiepolicy_get()); - togglestats[1] = curconfig[CaretBrowsing].val.i ? 'C' : 'c'; - togglestats[2] = curconfig[Geolocation].val.i ? 'G' : 'g'; - togglestats[3] = curconfig[DiskCache].val.i ? 'D' : 'd'; - togglestats[4] = curconfig[LoadImages].val.i ? 'I' : 'i'; - togglestats[5] = curconfig[JavaScript].val.i ? 'S' : 's'; - togglestats[6] = curconfig[Style].val.i ? 'M' : 'm'; - togglestats[8] = curconfig[Certificate].val.i ? 'X' : 'x'; - togglestats[9] = curconfig[StrictTLS].val.i ? 'T' : 't'; -} - -void -getpagestats(Client *c) -{ - if (c->https) - pagestats[0] = (c->tlserr || c->insecure) ? 'U' : 'T'; - else - pagestats[0] = '-'; - pagestats[1] = '\0'; -} - -WebKitCookieAcceptPolicy -cookiepolicy_get(void) -{ - switch (((char *)curconfig[CookiePolicies].val.v)[cookiepolicy]) { - case 'a': - return WEBKIT_COOKIE_POLICY_ACCEPT_NEVER; - case '@': - return WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY; - default: /* fallthrough */ - case 'A': - return WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS; - } -} - -char -cookiepolicy_set(const WebKitCookieAcceptPolicy p) -{ - switch (p) { - case WEBKIT_COOKIE_POLICY_ACCEPT_NEVER: - return 'a'; - case WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY: - return '@'; - default: /* fallthrough */ - case WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS: - return 'A'; - } -} - -void -seturiparameters(Client *c, const char *uri, ParamName *params) -{ - Parameter *config, *uriconfig = NULL; - int i, p; - - for (i = 0; i < LENGTH(uriparams); ++i) { - if (uriparams[i].uri && - !regexec(&(uriparams[i].re), uri, 0, NULL, 0)) { - uriconfig = uriparams[i].config; - break; - } - } - - curconfig = uriconfig ? uriconfig : defconfig; - - for (i = 0; (p = params[i]) != ParameterLast; ++i) { - switch(p) { - default: /* FALLTHROUGH */ - if (!(defconfig[p].prio < curconfig[p].prio || - defconfig[p].prio < modparams[p])) - continue; - case Certificate: - case CookiePolicies: - case Style: - setparameter(c, 0, p, &curconfig[p].val); - } - } -} - -void -setparameter(Client *c, int refresh, ParamName p, const Arg *a) -{ - GdkRGBA bgcolor = { 0 }; - - modparams[p] = curconfig[p].prio; - - switch (p) { - case AccessMicrophone: - return; /* do nothing */ - case AccessWebcam: - return; /* do nothing */ - case CaretBrowsing: - webkit_settings_set_enable_caret_browsing(c->settings, a->i); - refresh = 0; - break; - case Certificate: - if (a->i) - setcert(c, geturi(c)); - return; /* do not update */ - case CookiePolicies: - webkit_cookie_manager_set_accept_policy( - webkit_web_context_get_cookie_manager(c->context), - cookiepolicy_get()); - refresh = 0; - break; - case DarkMode: - g_object_set(gtk_settings_get_default(), - "gtk-application-prefer-dark-theme", a->i, NULL); - return; - case DiskCache: - webkit_web_context_set_cache_model(c->context, a->i ? - WEBKIT_CACHE_MODEL_WEB_BROWSER : - WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); - return; /* do not update */ - case DefaultCharset: - webkit_settings_set_default_charset(c->settings, a->v); - return; /* do not update */ - case DNSPrefetch: - webkit_settings_set_enable_dns_prefetching(c->settings, a->i); - return; /* do not update */ - case FileURLsCrossAccess: - webkit_settings_set_allow_file_access_from_file_urls( - c->settings, a->i); - webkit_settings_set_allow_universal_access_from_file_urls( - c->settings, a->i); - return; /* do not update */ - case FontSize: - webkit_settings_set_default_font_size(c->settings, a->i); - return; /* do not update */ - case Geolocation: - refresh = 0; - break; - case HideBackground: - if (a->i) - webkit_web_view_set_background_color(c->view, &bgcolor); - return; /* do not update */ - case Inspector: - webkit_settings_set_enable_developer_extras(c->settings, a->i); - return; /* do not update */ - case JavaScript: - webkit_settings_set_enable_javascript(c->settings, a->i); - break; - case KioskMode: - return; /* do nothing */ - case LoadImages: - webkit_settings_set_auto_load_images(c->settings, a->i); - break; - case MediaManualPlay: - webkit_settings_set_media_playback_requires_user_gesture( - c->settings, a->i); - break; - case PreferredLanguages: - return; /* do nothing */ - case RunInFullscreen: - return; /* do nothing */ - case ScrollBars: - /* Disabled until we write some WebKitWebExtension for - * manipulating the DOM directly. - enablescrollbars = !enablescrollbars; - evalscript(c, "document.documentElement.style.overflow = '%s'", - enablescrollbars ? "auto" : "hidden"); - */ - return; /* do not update */ - case ShowIndicators: - break; - case SmoothScrolling: - webkit_settings_set_enable_smooth_scrolling(c->settings, a->i); - return; /* do not update */ - case SiteQuirks: - webkit_settings_set_enable_site_specific_quirks( - c->settings, a->i); - break; - case SpellChecking: - webkit_web_context_set_spell_checking_enabled( - c->context, a->i); - return; /* do not update */ - case SpellLanguages: - return; /* do nothing */ - case StrictTLS: - webkit_website_data_manager_set_tls_errors_policy( - webkit_web_view_get_website_data_manager(c->view), a->i ? - WEBKIT_TLS_ERRORS_POLICY_FAIL : - WEBKIT_TLS_ERRORS_POLICY_IGNORE); - break; - case Style: - webkit_user_content_manager_remove_all_style_sheets( - webkit_web_view_get_user_content_manager(c->view)); - if (a->i) - setstyle(c, getstyle(geturi(c))); - refresh = 0; - break; - case WebGL: - webkit_settings_set_enable_webgl(c->settings, a->i); - break; - case ZoomLevel: - webkit_web_view_set_zoom_level(c->view, a->f); - return; /* do not update */ - default: - return; /* do nothing */ - } - - updatetitle(c); - if (refresh) - reload(c, a); -} - -const char * -getcert(const char *uri) -{ - int i; - - for (i = 0; i < LENGTH(certs); ++i) { - if (certs[i].regex && - !regexec(&(certs[i].re), uri, 0, NULL, 0)) - return certs[i].file; - } - - return NULL; -} - -void -setcert(Client *c, const char *uri) -{ - const char *file = getcert(uri); - char *host; - GTlsCertificate *cert; - - if (!file) - return; - - if (!(cert = g_tls_certificate_new_from_file(file, NULL))) { - fprintf(stderr, "Could not read certificate file: %s\n", file); - return; - } - - if ((uri = strstr(uri, "https://"))) { - uri += sizeof("https://") - 1; - host = g_strndup(uri, strchr(uri, '/') - uri); - webkit_web_context_allow_tls_certificate_for_host(c->context, - cert, host); - g_free(host); - } - - g_object_unref(cert); - -} - -const char * -getstyle(const char *uri) -{ - int i; - - if (stylefile) - return stylefile; - - for (i = 0; i < LENGTH(styles); ++i) { - if (styles[i].regex && - !regexec(&(styles[i].re), uri, 0, NULL, 0)) - return styles[i].file; - } - - return ""; -} - -void -setstyle(Client *c, const char *file) -{ - gchar *style; - - if (!g_file_get_contents(file, &style, NULL, NULL)) { - fprintf(stderr, "Could not read style file: %s\n", file); - return; - } - - webkit_user_content_manager_add_style_sheet( - webkit_web_view_get_user_content_manager(c->view), - webkit_user_style_sheet_new(style, - WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, - WEBKIT_USER_STYLE_LEVEL_USER, - NULL, NULL)); - - g_free(style); -} - -void -runscript(Client *c) -{ - gchar *script; - gsize l; - - if (g_file_get_contents(scriptfile, &script, &l, NULL) && l) - evalscript(c, "%s", script); - g_free(script); -} - -void -evalscript(Client *c, const char *jsstr, ...) -{ - va_list ap; - gchar *script; - - va_start(ap, jsstr); - script = g_strdup_vprintf(jsstr, ap); - va_end(ap); - - webkit_web_view_evaluate_javascript(c->view, script, -1, - NULL, NULL, NULL, NULL, NULL); - g_free(script); -} - -void -updatewinid(Client *c) -{ - snprintf(winid, LENGTH(winid), "%lu", c->xid); -} - -void -handleplumb(Client *c, const char *uri) -{ - Arg a = (Arg)PLUMB(uri); - spawn(c, &a); -} - -void -newwindow(Client *c, const Arg *a, int noembed) -{ - int i = 0; - char tmp[64]; - const char *cmd[29], *uri; - const Arg arg = { .v = cmd }; - - cmd[i++] = argv0; - cmd[i++] = "-a"; - cmd[i++] = curconfig[CookiePolicies].val.v; - cmd[i++] = curconfig[ScrollBars].val.i ? "-B" : "-b"; - if (cookiefile && g_strcmp0(cookiefile, "")) { - cmd[i++] = "-c"; - cmd[i++] = cookiefile; - } - if (stylefile && g_strcmp0(stylefile, "")) { - cmd[i++] = "-C"; - cmd[i++] = stylefile; - } - cmd[i++] = curconfig[DiskCache].val.i ? "-D" : "-d"; - if (embed && !noembed) { - cmd[i++] = "-e"; - snprintf(tmp, LENGTH(tmp), "%lu", embed); - cmd[i++] = tmp; - } - cmd[i++] = curconfig[RunInFullscreen].val.i ? "-F" : "-f" ; - cmd[i++] = curconfig[Geolocation].val.i ? "-G" : "-g" ; - cmd[i++] = curconfig[LoadImages].val.i ? "-I" : "-i" ; - cmd[i++] = curconfig[KioskMode].val.i ? "-K" : "-k" ; - cmd[i++] = curconfig[Style].val.i ? "-M" : "-m" ; - cmd[i++] = curconfig[Inspector].val.i ? "-N" : "-n" ; - if (scriptfile && g_strcmp0(scriptfile, "")) { - cmd[i++] = "-r"; - cmd[i++] = scriptfile; - } - cmd[i++] = curconfig[JavaScript].val.i ? "-S" : "-s"; - cmd[i++] = curconfig[StrictTLS].val.i ? "-T" : "-t"; - if (fulluseragent && g_strcmp0(fulluseragent, "")) { - cmd[i++] = "-u"; - cmd[i++] = fulluseragent; - } - if (showxid) - cmd[i++] = "-w"; - cmd[i++] = curconfig[Certificate].val.i ? "-X" : "-x" ; - /* do not keep zoom level */ - cmd[i++] = "--"; - if ((uri = a->v)) - cmd[i++] = uri; - cmd[i] = NULL; - - spawn(c, &arg); -} - -void -spawn(Client *c, const Arg *a) -{ - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - close(spair[0]); - close(spair[1]); - setsid(); - execvp(((char **)a->v)[0], (char **)a->v); - fprintf(stderr, "%s: execvp %s", argv0, ((char **)a->v)[0]); - perror(" failed"); - exit(1); - } -} - -void -destroyclient(Client *c) -{ - Client *p; - - webkit_web_view_stop_loading(c->view); - /* Not needed, has already been called - gtk_widget_destroy(c->win); - */ - - for (p = clients; p && p->next != c; p = p->next) - ; - if (p) - p->next = c->next; - else - clients = c->next; - free(c); -} - -void -cleanup(void) -{ - while (clients) - destroyclient(clients); - - close(spair[0]); - close(spair[1]); - g_free(cookiefile); - g_free(scriptfile); - g_free(stylefile); - g_free(cachedir); - XCloseDisplay(dpy); -} - -WebKitWebView * -newview(Client *c, WebKitWebView *rv) -{ - WebKitWebView *v; - WebKitSettings *settings; - WebKitWebContext *context; - WebKitCookieManager *cookiemanager; - WebKitUserContentManager *contentmanager; - - /* Webview */ - if (rv) { - v = WEBKIT_WEB_VIEW(webkit_web_view_new_with_related_view(rv)); - context = webkit_web_view_get_context(v); - settings = webkit_web_view_get_settings(v); - } else { - settings = webkit_settings_new_with_settings( - "allow-file-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, - "allow-universal-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, - "auto-load-images", curconfig[LoadImages].val.i, - "default-charset", curconfig[DefaultCharset].val.v, - "default-font-size", curconfig[FontSize].val.i, - "enable-caret-browsing", curconfig[CaretBrowsing].val.i, - "enable-developer-extras", curconfig[Inspector].val.i, - "enable-dns-prefetching", curconfig[DNSPrefetch].val.i, - "enable-html5-database", curconfig[DiskCache].val.i, - "enable-html5-local-storage", curconfig[DiskCache].val.i, - "enable-javascript", curconfig[JavaScript].val.i, - "enable-site-specific-quirks", curconfig[SiteQuirks].val.i, - "enable-smooth-scrolling", curconfig[SmoothScrolling].val.i, - "enable-webgl", curconfig[WebGL].val.i, - "media-playback-requires-user-gesture", curconfig[MediaManualPlay].val.i, - NULL); -/* For more interesting settings, have a look at - * http://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html */ - - if (strcmp(fulluseragent, "")) { - webkit_settings_set_user_agent(settings, fulluseragent); - } else if (surfuseragent) { - webkit_settings_set_user_agent_with_application_details( - settings, "Surf", VERSION); - } - useragent = webkit_settings_get_user_agent(settings); - - contentmanager = webkit_user_content_manager_new(); - - if (curconfig[Ephemeral].val.i) { - context = webkit_web_context_new_ephemeral(); - } else { - context = webkit_web_context_new_with_website_data_manager( - webkit_website_data_manager_new( - "base-cache-directory", cachedir, - "base-data-directory", cachedir, - NULL)); - } - - cookiemanager = webkit_web_context_get_cookie_manager(context); - - /* TLS */ - webkit_website_data_manager_set_tls_errors_policy( - webkit_web_context_get_website_data_manager(context), - curconfig[StrictTLS].val.i ? WEBKIT_TLS_ERRORS_POLICY_FAIL : - WEBKIT_TLS_ERRORS_POLICY_IGNORE); - /* disk cache */ - webkit_web_context_set_cache_model(context, - curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER : - WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); - - /* Currently only works with text file to be compatible with curl */ - if (!curconfig[Ephemeral].val.i) - webkit_cookie_manager_set_persistent_storage(cookiemanager, - cookiefile, WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); - /* cookie policy */ - webkit_cookie_manager_set_accept_policy(cookiemanager, - cookiepolicy_get()); - /* languages */ - webkit_web_context_set_preferred_languages(context, - curconfig[PreferredLanguages].val.v); - webkit_web_context_set_spell_checking_languages(context, - curconfig[SpellLanguages].val.v); - webkit_web_context_set_spell_checking_enabled(context, - curconfig[SpellChecking].val.i); - - g_signal_connect(G_OBJECT(context), "download-started", - G_CALLBACK(downloadstarted), c); - g_signal_connect(G_OBJECT(context), "initialize-web-extensions", - G_CALLBACK(initwebextensions), c); - - v = g_object_new(WEBKIT_TYPE_WEB_VIEW, - "settings", settings, - "user-content-manager", contentmanager, - "web-context", context, - NULL); - } - - g_signal_connect(G_OBJECT(v), "notify::estimated-load-progress", - G_CALLBACK(progresschanged), c); - g_signal_connect(G_OBJECT(v), "notify::title", - G_CALLBACK(titlechanged), c); - g_signal_connect(G_OBJECT(v), "button-release-event", - G_CALLBACK(buttonreleased), c); - g_signal_connect(G_OBJECT(v), "close", - G_CALLBACK(closeview), c); - g_signal_connect(G_OBJECT(v), "create", - G_CALLBACK(createview), c); - g_signal_connect(G_OBJECT(v), "decide-policy", - G_CALLBACK(decidepolicy), c); - g_signal_connect(G_OBJECT(v), "insecure-content-detected", - G_CALLBACK(insecurecontent), c); - g_signal_connect(G_OBJECT(v), "load-failed-with-tls-errors", - G_CALLBACK(loadfailedtls), c); - g_signal_connect(G_OBJECT(v), "load-changed", - G_CALLBACK(loadchanged), c); - g_signal_connect(G_OBJECT(v), "mouse-target-changed", - G_CALLBACK(mousetargetchanged), c); - g_signal_connect(G_OBJECT(v), "permission-request", - G_CALLBACK(permissionrequested), c); - g_signal_connect(G_OBJECT(v), "ready-to-show", - G_CALLBACK(showview), c); - g_signal_connect(G_OBJECT(v), "user-message-received", - G_CALLBACK(viewusrmsgrcv), c); - g_signal_connect(G_OBJECT(v), "web-process-terminated", - G_CALLBACK(webprocessterminated), c); - - c->context = context; - c->settings = settings; - - setparameter(c, 0, DarkMode, &curconfig[DarkMode].val); - - return v; -} - -void -initwebextensions(WebKitWebContext *wc, Client *c) -{ - webkit_web_context_set_web_extensions_directory(wc, WEBEXTDIR); -} - -GtkWidget * -createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c) -{ - Client *n; - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - /* - * popup windows of type “other” are almost always triggered - * by user gesture, so inverse the logic here - */ -/* instead of this, compare destination uri to mouse-over uri for validating window */ - if (webkit_navigation_action_is_user_gesture(a)) - return NULL; - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: - n = newclient(c); - break; - default: - return NULL; - } - - return GTK_WIDGET(n->view); -} - -gboolean -buttonreleased(GtkWidget *w, GdkEvent *e, Client *c) -{ - WebKitHitTestResultContext element; - int i; - - element = webkit_hit_test_result_get_context(c->mousepos); - - for (i = 0; i < LENGTH(buttons); ++i) { - if (element & buttons[i].target && - e->button.button == buttons[i].button && - CLEANMASK(e->button.state) == CLEANMASK(buttons[i].mask) && - buttons[i].func) { - buttons[i].func(c, &buttons[i].arg, c->mousepos); - return buttons[i].stopevent; - } - } - - return FALSE; -} - -GdkFilterReturn -processx(GdkXEvent *e, GdkEvent *event, gpointer d) -{ - Client *c = (Client *)d; - XPropertyEvent *ev; - Arg a; - - if (((XEvent *)e)->type == PropertyNotify) { - ev = &((XEvent *)e)->xproperty; - if (ev->state == PropertyNewValue) { - if (ev->atom == atoms[AtomFind]) { - find(c, NULL); - - return GDK_FILTER_REMOVE; - } else if (ev->atom == atoms[AtomGo]) { - a.v = getatom(c, AtomGo); - loaduri(c, &a); - - return GDK_FILTER_REMOVE; - } - } - } - return GDK_FILTER_CONTINUE; -} - -gboolean -winevent(GtkWidget *w, GdkEvent *e, Client *c) -{ - int i; - - switch (e->type) { - case GDK_ENTER_NOTIFY: - c->overtitle = c->targeturi; - updatetitle(c); - break; - case GDK_KEY_PRESS: - if (!curconfig[KioskMode].val.i) { - for (i = 0; i < LENGTH(keys); ++i) { - if (gdk_keyval_to_lower(e->key.keyval) == - keys[i].keyval && - CLEANMASK(e->key.state) == keys[i].mod && - keys[i].func) { - updatewinid(c); - keys[i].func(c, &(keys[i].arg)); - return TRUE; - } - } - } - case GDK_LEAVE_NOTIFY: - c->overtitle = NULL; - updatetitle(c); - break; - case GDK_WINDOW_STATE: - if (e->window_state.changed_mask == - GDK_WINDOW_STATE_FULLSCREEN) - c->fullscreen = e->window_state.new_window_state & - GDK_WINDOW_STATE_FULLSCREEN; - break; - default: - break; - } - - return FALSE; -} - -void -showview(WebKitWebView *v, Client *c) -{ - GdkRGBA bgcolor = { 0 }; - GdkWindow *gwin; - - c->finder = webkit_web_view_get_find_controller(c->view); - c->inspector = webkit_web_view_get_inspector(c->view); - - c->pageid = webkit_web_view_get_page_id(c->view); - c->win = createwindow(c); - - gtk_container_add(GTK_CONTAINER(c->win), GTK_WIDGET(c->view)); - gtk_widget_show_all(c->win); - gtk_widget_grab_focus(GTK_WIDGET(c->view)); - - gwin = gtk_widget_get_window(GTK_WIDGET(c->win)); - c->xid = gdk_x11_window_get_xid(gwin); - updatewinid(c); - if (showxid) { - gdk_display_sync(gtk_widget_get_display(c->win)); - puts(winid); - fflush(stdout); - } - - if (curconfig[HideBackground].val.i) - webkit_web_view_set_background_color(c->view, &bgcolor); - - if (!curconfig[KioskMode].val.i) { - gdk_window_set_events(gwin, GDK_ALL_EVENTS_MASK); - gdk_window_add_filter(gwin, processx, c); - } - - if (curconfig[RunInFullscreen].val.i) - togglefullscreen(c, NULL); - - if (curconfig[ZoomLevel].val.f != 1.0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f); - - setatom(c, AtomFind, ""); - setatom(c, AtomUri, "about:blank"); -} - -GtkWidget * -createwindow(Client *c) -{ - char *wmstr; - GtkWidget *w; - - if (embed) { - w = gtk_plug_new(embed); - } else { - w = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - wmstr = g_path_get_basename(argv0); - gtk_window_set_wmclass(GTK_WINDOW(w), wmstr, "Surf"); - g_free(wmstr); - - wmstr = g_strdup_printf("%s[%"PRIu64"]", "Surf", c->pageid); - gtk_window_set_role(GTK_WINDOW(w), wmstr); - g_free(wmstr); - - gtk_window_set_default_size(GTK_WINDOW(w), winsize[0], winsize[1]); - } - - g_signal_connect(G_OBJECT(w), "destroy", - G_CALLBACK(destroywin), c); - g_signal_connect(G_OBJECT(w), "enter-notify-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "key-press-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "leave-notify-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "window-state-event", - G_CALLBACK(winevent), c); - - return w; -} - -gboolean -loadfailedtls(WebKitWebView *v, gchar *uri, GTlsCertificate *cert, - GTlsCertificateFlags err, Client *c) -{ - GString *errmsg = g_string_new(NULL); - gchar *html, *pem; - - c->failedcert = g_object_ref(cert); - c->tlserr = err; - c->errorpage = 1; - - if (err & G_TLS_CERTIFICATE_UNKNOWN_CA) - g_string_append(errmsg, - "The signing certificate authority is not known.
"); - if (err & G_TLS_CERTIFICATE_BAD_IDENTITY) - g_string_append(errmsg, - "The certificate does not match the expected identity " - "of the site that it was retrieved from.
"); - if (err & G_TLS_CERTIFICATE_NOT_ACTIVATED) - g_string_append(errmsg, - "The certificate's activation time " - "is still in the future.
"); - if (err & G_TLS_CERTIFICATE_EXPIRED) - g_string_append(errmsg, "The certificate has expired.
"); - if (err & G_TLS_CERTIFICATE_REVOKED) - g_string_append(errmsg, - "The certificate has been revoked according to " - "the GTlsConnection's certificate revocation list.
"); - if (err & G_TLS_CERTIFICATE_INSECURE) - g_string_append(errmsg, - "The certificate's algorithm is considered insecure.
"); - if (err & G_TLS_CERTIFICATE_GENERIC_ERROR) - g_string_append(errmsg, - "Some error occurred validating the certificate.
"); - - g_object_get(cert, "certificate-pem", &pem, NULL); - html = g_strdup_printf("

Could not validate TLS for “%s”
%s

" - "

You can inspect the following certificate " - "with Ctrl-t (default keybinding).

" - "

%s

", uri, errmsg->str, pem); - g_free(pem); - g_string_free(errmsg, TRUE); - - webkit_web_view_load_alternate_html(c->view, html, uri, NULL); - g_free(html); - - return TRUE; -} - -void -loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) -{ - const char *uri = geturi(c); - - switch (e) { - case WEBKIT_LOAD_STARTED: - setatom(c, AtomUri, uri); - c->title = uri; - c->https = c->insecure = 0; - seturiparameters(c, uri, loadtransient); - if (c->errorpage) - c->errorpage = 0; - else - g_clear_object(&c->failedcert); - break; - case WEBKIT_LOAD_REDIRECTED: - setatom(c, AtomUri, uri); - c->title = uri; - seturiparameters(c, uri, loadtransient); - break; - case WEBKIT_LOAD_COMMITTED: - setatom(c, AtomUri, uri); - c->title = uri; - seturiparameters(c, uri, loadcommitted); - c->https = webkit_web_view_get_tls_info(c->view, &c->cert, - &c->tlserr); - break; - case WEBKIT_LOAD_FINISHED: - seturiparameters(c, uri, loadfinished); - /* Disabled until we write some WebKitWebExtension for - * manipulating the DOM directly. - evalscript(c, "document.documentElement.style.overflow = '%s'", - enablescrollbars ? "auto" : "hidden"); - */ - runscript(c); - break; - } - updatetitle(c); -} - -void -progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c) -{ - c->progress = webkit_web_view_get_estimated_load_progress(c->view) * - 100; - updatetitle(c); -} - -void -titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c) -{ - c->title = webkit_web_view_get_title(c->view); - updatetitle(c); -} - -gboolean -viewusrmsgrcv(WebKitWebView *v, WebKitUserMessage *m, gpointer unused) -{ - WebKitUserMessage *r; - GUnixFDList *gfd; - const char *name; - - name = webkit_user_message_get_name(m); - if (strcmp(name, "page-created") != 0) { - fprintf(stderr, "surf: Unknown UserMessage: %s\n", name); - return TRUE; - } - - if (spair[1] < 0) - return TRUE; - - gfd = g_unix_fd_list_new_from_array(&spair[1], 1); - r = webkit_user_message_new_with_fd_list("surf-pipe", NULL, gfd); - - webkit_user_message_send_reply(m, r); - - return TRUE; -} - -void -mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers, - Client *c) -{ - WebKitHitTestResultContext hc = webkit_hit_test_result_get_context(h); - - /* Keep the hit test to know where is the pointer on the next click */ - c->mousepos = h; - - if (hc & OnLink) - c->targeturi = webkit_hit_test_result_get_link_uri(h); - else if (hc & OnImg) - c->targeturi = webkit_hit_test_result_get_image_uri(h); - else if (hc & OnMedia) - c->targeturi = webkit_hit_test_result_get_media_uri(h); - else - c->targeturi = NULL; - - c->overtitle = c->targeturi; - updatetitle(c); -} - -gboolean -permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c) -{ - ParamName param = ParameterLast; - - if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(r)) { - param = Geolocation; - } else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(r)) { - if (webkit_user_media_permission_is_for_audio_device( - WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) - param = AccessMicrophone; - else if (webkit_user_media_permission_is_for_video_device( - WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) - param = AccessWebcam; - } else { - return FALSE; - } - - if (curconfig[param].val.i) - webkit_permission_request_allow(r); - else - webkit_permission_request_deny(r); - - return TRUE; -} - -gboolean -decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, - WebKitPolicyDecisionType dt, Client *c) -{ - switch (dt) { - case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: - decidenavigation(d, c); - break; - case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: - decidenewwindow(d, c); - break; - case WEBKIT_POLICY_DECISION_TYPE_RESPONSE: - decideresource(d, c); - break; - default: - webkit_policy_decision_ignore(d); - break; - } - return TRUE; -} - -void -decidenavigation(WebKitPolicyDecision *d, Client *c) -{ - WebKitNavigationAction *a = - webkit_navigation_policy_decision_get_navigation_action( - WEBKIT_NAVIGATION_POLICY_DECISION(d)); - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - default: - /* Do not navigate to links with a "_blank" target (popup) */ - if (webkit_navigation_action_get_frame_name(a)) { - webkit_policy_decision_ignore(d); - } else { - /* Filter out navigation to different domain ? */ - /* get action→urirequest, copy and load in new window+view - * on Ctrl+Click ? */ - webkit_policy_decision_use(d); - } - break; - } -} - -void -decidenewwindow(WebKitPolicyDecision *d, Client *c) -{ - Arg arg; - WebKitNavigationAction *a = - webkit_navigation_policy_decision_get_navigation_action( - WEBKIT_NAVIGATION_POLICY_DECISION(d)); - - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: - /* Filter domains here */ -/* If the value of “mouse-button” is not 0, then the navigation was triggered by a mouse event. - * test for link clicked but no button ? */ - arg.v = webkit_uri_request_get_uri( - webkit_navigation_action_get_request(a)); - newwindow(c, &arg, 0); - break; - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - default: - break; - } - - webkit_policy_decision_ignore(d); -} - -void -decideresource(WebKitPolicyDecision *d, Client *c) -{ - int i, isascii = 1; - WebKitResponsePolicyDecision *r = WEBKIT_RESPONSE_POLICY_DECISION(d); - WebKitURIResponse *res = - webkit_response_policy_decision_get_response(r); - const gchar *uri = webkit_uri_response_get_uri(res); - - if (g_str_has_suffix(uri, "/favicon.ico")) { - webkit_policy_decision_ignore(d); - return; - } - - if (!g_str_has_prefix(uri, "http://") - && !g_str_has_prefix(uri, "https://") - && !g_str_has_prefix(uri, "about:") - && !g_str_has_prefix(uri, "file://") - && !g_str_has_prefix(uri, "webkit://") - && !g_str_has_prefix(uri, "data:") - && !g_str_has_prefix(uri, "blob:") - && strlen(uri) > 0) { - for (i = 0; i < strlen(uri); i++) { - if (!g_ascii_isprint(uri[i])) { - isascii = 0; - break; - } - } - if (isascii) { - handleplumb(c, uri); - webkit_policy_decision_ignore(d); - return; - } - } - - if (webkit_response_policy_decision_is_mime_type_supported(r)) { - webkit_policy_decision_use(d); - } else { - webkit_policy_decision_ignore(d); - download(c, res); - } -} - -void -insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, Client *c) -{ - c->insecure = 1; -} - -void -downloadstarted(WebKitWebContext *wc, WebKitDownload *d, Client *c) -{ - g_signal_connect(G_OBJECT(d), "notify::response", - G_CALLBACK(responsereceived), c); -} - -void -responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c) -{ - download(c, webkit_download_get_response(d)); - webkit_download_cancel(d); -} - -void -download(Client *c, WebKitURIResponse *r) -{ - Arg a = (Arg)DOWNLOAD(webkit_uri_response_get_uri(r), geturi(c)); - spawn(c, &a); -} - -void -webprocessterminated(WebKitWebView *v, WebKitWebProcessTerminationReason r, - Client *c) -{ - fprintf(stderr, "web process terminated: %s\n", - r == WEBKIT_WEB_PROCESS_CRASHED ? "crashed" : "no memory"); - closeview(v, c); -} - -void -closeview(WebKitWebView *v, Client *c) -{ - gtk_widget_destroy(c->win); -} - -void -destroywin(GtkWidget* w, Client *c) -{ - destroyclient(c); - if (!clients) - gtk_main_quit(); -} - -void -pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) -{ - Arg a = {.v = text }; - if (text) - loaduri((Client *) d, &a); -} - -void -reload(Client *c, const Arg *a) -{ - if (a->i) - webkit_web_view_reload_bypass_cache(c->view); - else - webkit_web_view_reload(c->view); -} - -void -print(Client *c, const Arg *a) -{ - webkit_print_operation_run_dialog(webkit_print_operation_new(c->view), - GTK_WINDOW(c->win)); -} - -void -showcert(Client *c, const Arg *a) -{ - GTlsCertificate *cert = c->failedcert ? c->failedcert : c->cert; - GcrCertificate *gcrt; - GByteArray *crt; - GtkWidget *win; - GcrCertificateWidget *wcert; - - if (!cert) - return; - - g_object_get(cert, "certificate", &crt, NULL); - gcrt = gcr_simple_certificate_new(crt->data, crt->len); - g_byte_array_unref(crt); - - win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - wcert = gcr_certificate_widget_new(gcrt); - g_object_unref(gcrt); - - gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(wcert)); - gtk_widget_show_all(win); -} - -void -clipboard(Client *c, const Arg *a) -{ - if (a->i) { /* load clipboard uri */ - gtk_clipboard_request_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), - pasteuri, c); - } else { /* copy uri */ - gtk_clipboard_set_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), c->targeturi - ? c->targeturi : geturi(c), -1); - } -} - -void -zoom(Client *c, const Arg *a) -{ - if (a->i > 0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f + 0.1); - else if (a->i < 0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f - 0.1); - else - webkit_web_view_set_zoom_level(c->view, 1.0); - - curconfig[ZoomLevel].val.f = webkit_web_view_get_zoom_level(c->view); -} - -static void -msgext(Client *c, char type, const Arg *a) -{ - static unsigned char msg[MSGBUFSZ]; - int ret; - - if (spair[0] < 0) - return; - - ret = snprintf(msg, sizeof(msg), "%c%c%c", - (unsigned char)c->pageid, type, (signed char)a->i); - if (ret >= sizeof(msg)) { - fprintf(stderr, "surf: message too long: %d\n", ret); - return; - } - - if (send(spair[0], msg, ret, 0) != ret) - fprintf(stderr, "surf: error sending: %hhu/%c/%d (%d)\n", - (unsigned char)c->pageid, type, a->i, ret); -} - -void -scrollv(Client *c, const Arg *a) -{ - msgext(c, 'v', a); -} - -void -scrollh(Client *c, const Arg *a) -{ - msgext(c, 'h', a); -} - -void -navigate(Client *c, const Arg *a) -{ - if (a->i < 0) - webkit_web_view_go_back(c->view); - else if (a->i > 0) - webkit_web_view_go_forward(c->view); -} - -void -stop(Client *c, const Arg *a) -{ - webkit_web_view_stop_loading(c->view); -} - -void -toggle(Client *c, const Arg *a) -{ - curconfig[a->i].val.i ^= 1; - setparameter(c, 1, (ParamName)a->i, &curconfig[a->i].val); -} - -void -togglefullscreen(Client *c, const Arg *a) -{ - /* toggling value is handled in winevent() */ - if (c->fullscreen) - gtk_window_unfullscreen(GTK_WINDOW(c->win)); - else - gtk_window_fullscreen(GTK_WINDOW(c->win)); -} - -void -togglecookiepolicy(Client *c, const Arg *a) -{ - ++cookiepolicy; - cookiepolicy %= strlen(curconfig[CookiePolicies].val.v); - - setparameter(c, 0, CookiePolicies, NULL); -} - -void -toggleinspector(Client *c, const Arg *a) -{ - if (webkit_web_inspector_is_attached(c->inspector)) - webkit_web_inspector_close(c->inspector); - else if (curconfig[Inspector].val.i) - webkit_web_inspector_show(c->inspector); -} - -void -find(Client *c, const Arg *a) -{ - const char *s, *f; - - if (a && a->i) { - if (a->i > 0) - webkit_find_controller_search_next(c->finder); - else - webkit_find_controller_search_previous(c->finder); - } else { - s = getatom(c, AtomFind); - f = webkit_find_controller_get_search_text(c->finder); - - if (g_strcmp0(f, s) == 0) /* reset search */ - webkit_find_controller_search(c->finder, "", findopts, - G_MAXUINT); - - webkit_find_controller_search(c->finder, s, findopts, - G_MAXUINT); - - if (strcmp(s, "") == 0) - webkit_find_controller_search_finish(c->finder); - } -} - -void -clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - navigate(c, a); -} - -void -clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - Arg arg; - - arg.v = webkit_hit_test_result_get_link_uri(h); - newwindow(c, &arg, a->i); -} - -void -clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - Arg arg; - - arg = (Arg)VIDEOPLAY(webkit_hit_test_result_get_media_uri(h)); - spawn(c, &arg); -} - -int -main(int argc, char *argv[]) -{ - Arg arg; - Client *c; - - memset(&arg, 0, sizeof(arg)); - - /* command line args */ - ARGBEGIN { - case 'a': - defconfig[CookiePolicies].val.v = EARGF(usage()); - defconfig[CookiePolicies].prio = 2; - break; - case 'b': - defconfig[ScrollBars].val.i = 0; - defconfig[ScrollBars].prio = 2; - break; - case 'B': - defconfig[ScrollBars].val.i = 1; - defconfig[ScrollBars].prio = 2; - break; - case 'c': - cookiefile = EARGF(usage()); - break; - case 'C': - stylefile = EARGF(usage()); - break; - case 'd': - defconfig[DiskCache].val.i = 0; - defconfig[DiskCache].prio = 2; - break; - case 'D': - defconfig[DiskCache].val.i = 1; - defconfig[DiskCache].prio = 2; - break; - case 'e': - embed = strtol(EARGF(usage()), NULL, 0); - break; - case 'f': - defconfig[RunInFullscreen].val.i = 0; - defconfig[RunInFullscreen].prio = 2; - break; - case 'F': - defconfig[RunInFullscreen].val.i = 1; - defconfig[RunInFullscreen].prio = 2; - break; - case 'g': - defconfig[Geolocation].val.i = 0; - defconfig[Geolocation].prio = 2; - break; - case 'G': - defconfig[Geolocation].val.i = 1; - defconfig[Geolocation].prio = 2; - break; - case 'i': - defconfig[LoadImages].val.i = 0; - defconfig[LoadImages].prio = 2; - break; - case 'I': - defconfig[LoadImages].val.i = 1; - defconfig[LoadImages].prio = 2; - break; - case 'k': - defconfig[KioskMode].val.i = 0; - defconfig[KioskMode].prio = 2; - break; - case 'K': - defconfig[KioskMode].val.i = 1; - defconfig[KioskMode].prio = 2; - break; - case 'm': - defconfig[Style].val.i = 0; - defconfig[Style].prio = 2; - break; - case 'M': - defconfig[Style].val.i = 1; - defconfig[Style].prio = 2; - break; - case 'n': - defconfig[Inspector].val.i = 0; - defconfig[Inspector].prio = 2; - break; - case 'N': - defconfig[Inspector].val.i = 1; - defconfig[Inspector].prio = 2; - break; - case 'r': - scriptfile = EARGF(usage()); - break; - case 's': - defconfig[JavaScript].val.i = 0; - defconfig[JavaScript].prio = 2; - break; - case 'S': - defconfig[JavaScript].val.i = 1; - defconfig[JavaScript].prio = 2; - break; - case 't': - defconfig[StrictTLS].val.i = 0; - defconfig[StrictTLS].prio = 2; - break; - case 'T': - defconfig[StrictTLS].val.i = 1; - defconfig[StrictTLS].prio = 2; - break; - case 'u': - fulluseragent = EARGF(usage()); - break; - case 'v': - die("surf-"VERSION", see LICENSE for © details\n"); - case 'w': - showxid = 1; - break; - case 'x': - defconfig[Certificate].val.i = 0; - defconfig[Certificate].prio = 2; - break; - case 'X': - defconfig[Certificate].val.i = 1; - defconfig[Certificate].prio = 2; - break; - case 'z': - defconfig[ZoomLevel].val.f = strtof(EARGF(usage()), NULL); - defconfig[ZoomLevel].prio = 2; - break; - default: - usage(); - } ARGEND; - if (argc > 0) - arg.v = argv[0]; - else -#ifdef HOMEPAGE - arg.v = HOMEPAGE; -#else - arg.v = "about:blank"; -#endif - - setup(); - c = newclient(NULL); - showview(NULL, c); - - loaduri(c, &arg); - updatetitle(c); - - gtk_main(); - cleanup(); - - return 0; -} diff --git a/dwm/surf/surf.c.orig b/dwm/surf/surf.c.orig deleted file mode 100644 index 18d65d7..0000000 --- a/dwm/surf/surf.c.orig +++ /dev/null @@ -1,2131 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * To understand surf, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arg.h" -#include "common.h" - -#define LENGTH(x) (sizeof(x) / sizeof(x[0])) -#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK)) - -enum { AtomFind, AtomGo, AtomUri, AtomUTF8, AtomLast }; - -enum { - OnDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT, - OnLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK, - OnImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE, - OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA, - OnEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE, - OnBar = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR, - OnSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION, - OnAny = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel, -}; - -typedef enum { - AccessMicrophone, - AccessWebcam, - CaretBrowsing, - Certificate, - CookiePolicies, - DarkMode, - DiskCache, - DefaultCharset, - DNSPrefetch, - Ephemeral, - FileURLsCrossAccess, - FontSize, - Geolocation, - HideBackground, - Inspector, - JavaScript, - KioskMode, - LoadImages, - MediaManualPlay, - PreferredLanguages, - RunInFullscreen, - ScrollBars, - ShowIndicators, - SiteQuirks, - SmoothScrolling, - SpellChecking, - SpellLanguages, - StrictTLS, - Style, - WebGL, - ZoomLevel, - ParameterLast -} ParamName; - -typedef union { - int i; - float f; - const void *v; -} Arg; - -typedef struct { - Arg val; - int prio; -} Parameter; - -typedef struct Client { - GtkWidget *win; - WebKitWebView *view; - WebKitSettings *settings; - WebKitWebContext *context; - WebKitWebInspector *inspector; - WebKitFindController *finder; - WebKitHitTestResult *mousepos; - GTlsCertificate *cert, *failedcert; - GTlsCertificateFlags tlserr; - Window xid; - guint64 pageid; - int progress, fullscreen, https, insecure, errorpage; - const char *title, *overtitle, *targeturi; - const char *needle; - struct Client *next; -} Client; - -typedef struct { - guint mod; - guint keyval; - void (*func)(Client *c, const Arg *a); - const Arg arg; -} Key; - -typedef struct { - unsigned int target; - unsigned int mask; - guint button; - void (*func)(Client *c, const Arg *a, WebKitHitTestResult *h); - const Arg arg; - unsigned int stopevent; -} Button; - -typedef struct { - const char *uri; - Parameter config[ParameterLast]; - regex_t re; -} UriParameters; - -typedef struct { - char *regex; - char *file; - regex_t re; -} SiteSpecific; - -/* Surf */ -static void die(const char *errstr, ...); -static void usage(void); -static void setup(void); -static void sigchld(int unused); -static void sighup(int unused); -static char *buildfile(const char *path); -static char *buildpath(const char *path); -static char *untildepath(const char *path); -static const char *getuserhomedir(const char *user); -static const char *getcurrentuserhomedir(void); -static Client *newclient(Client *c); -static void loaduri(Client *c, const Arg *a); -static const char *geturi(Client *c); -static void setatom(Client *c, int a, const char *v); -static const char *getatom(Client *c, int a); -static void updatetitle(Client *c); -static void gettogglestats(Client *c); -static void getpagestats(Client *c); -static WebKitCookieAcceptPolicy cookiepolicy_get(void); -static char cookiepolicy_set(const WebKitCookieAcceptPolicy p); -static void seturiparameters(Client *c, const char *uri, ParamName *params); -static void setparameter(Client *c, int refresh, ParamName p, const Arg *a); -static const char *getcert(const char *uri); -static void setcert(Client *c, const char *file); -static const char *getstyle(const char *uri); -static void setstyle(Client *c, const char *file); -static void runscript(Client *c); -static void evalscript(Client *c, const char *jsstr, ...); -static void updatewinid(Client *c); -static void handleplumb(Client *c, const char *uri); -static void newwindow(Client *c, const Arg *a, int noembed); -static void spawn(Client *c, const Arg *a); -static void msgext(Client *c, char type, const Arg *a); -static void destroyclient(Client *c); -static void cleanup(void); - -/* GTK/WebKit */ -static WebKitWebView *newview(Client *c, WebKitWebView *rv); -static void initwebextensions(WebKitWebContext *wc, Client *c); -static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, - Client *c); -static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c); -static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, - gpointer d); -static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c); -static void showview(WebKitWebView *v, Client *c); -static GtkWidget *createwindow(Client *c); -static gboolean loadfailedtls(WebKitWebView *v, gchar *uri, - GTlsCertificate *cert, - GTlsCertificateFlags err, Client *c); -static void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c); -static void progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c); -static void titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c); -static void mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, - guint modifiers, Client *c); -static gboolean permissionrequested(WebKitWebView *v, - WebKitPermissionRequest *r, Client *c); -static gboolean decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, - WebKitPolicyDecisionType dt, Client *c); -static void decidenavigation(WebKitPolicyDecision *d, Client *c); -static void decidenewwindow(WebKitPolicyDecision *d, Client *c); -static void decideresource(WebKitPolicyDecision *d, Client *c); -static void insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, - Client *c); -static void downloadstarted(WebKitWebContext *wc, WebKitDownload *d, - Client *c); -static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c); -static void download(Client *c, WebKitURIResponse *r); -static gboolean viewusrmsgrcv(WebKitWebView *v, WebKitUserMessage *m, - gpointer u); -static void webprocessterminated(WebKitWebView *v, - WebKitWebProcessTerminationReason r, - Client *c); -static void closeview(WebKitWebView *v, Client *c); -static void destroywin(GtkWidget* w, Client *c); - -/* Hotkeys */ -static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); -static void reload(Client *c, const Arg *a); -static void print(Client *c, const Arg *a); -static void showcert(Client *c, const Arg *a); -static void clipboard(Client *c, const Arg *a); -static void zoom(Client *c, const Arg *a); -static void scrollv(Client *c, const Arg *a); -static void scrollh(Client *c, const Arg *a); -static void navigate(Client *c, const Arg *a); -static void stop(Client *c, const Arg *a); -static void toggle(Client *c, const Arg *a); -static void togglefullscreen(Client *c, const Arg *a); -static void togglecookiepolicy(Client *c, const Arg *a); -static void toggleinspector(Client *c, const Arg *a); -static void find(Client *c, const Arg *a); - -/* Buttons */ -static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); -static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h); -static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h); - -static char winid[64]; -static char togglestats[11]; -static char pagestats[2]; -static Atom atoms[AtomLast]; -static Window embed; -static int showxid; -static int cookiepolicy; -static Display *dpy; -static Client *clients; -static GdkDevice *gdkkb; -static char *stylefile; -static const char *useragent; -static Parameter *curconfig; -static int modparams[ParameterLast]; -static int spair[2]; -char *argv0; - -static ParamName loadtransient[] = { - Certificate, - CookiePolicies, - DiskCache, - DNSPrefetch, - FileURLsCrossAccess, - JavaScript, - LoadImages, - PreferredLanguages, - ShowIndicators, - StrictTLS, - ParameterLast -}; - -static ParamName loadcommitted[] = { -// AccessMicrophone, -// AccessWebcam, - CaretBrowsing, - DarkMode, - DefaultCharset, - FontSize, - Geolocation, - HideBackground, - Inspector, -// KioskMode, - MediaManualPlay, - RunInFullscreen, - ScrollBars, - SiteQuirks, - SmoothScrolling, - SpellChecking, - SpellLanguages, - Style, - ZoomLevel, - ParameterLast -}; - -static ParamName loadfinished[] = { - ParameterLast -}; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -void -usage(void) -{ - die("usage: surf [-bBdDfFgGiIkKmMnNsStTvwxX]\n" - "[-a cookiepolicies ] [-c cookiefile] [-C stylefile] [-e xid]\n" - "[-r scriptfile] [-u useragent] [-z zoomlevel] [uri]\n"); -} - -void -setup(void) -{ - GIOChannel *gchanin; - GdkDisplay *gdpy; - int i, j; - - /* clean up any zombies immediately */ - sigchld(0); - if (signal(SIGHUP, sighup) == SIG_ERR) - die("Can't install SIGHUP handler"); - - if (!(dpy = XOpenDisplay(NULL))) - die("Can't open default display"); - - /* atoms */ - atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); - atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False); - atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False); - atoms[AtomUTF8] = XInternAtom(dpy, "UTF8_STRING", False); - - gtk_init(NULL, NULL); - - gdpy = gdk_display_get_default(); - - curconfig = defconfig; - - /* dirs and files */ - cookiefile = buildfile(cookiefile); - scriptfile = buildfile(scriptfile); - certdir = buildpath(certdir); - if (curconfig[Ephemeral].val.i) - cachedir = NULL; - else - cachedir = buildpath(cachedir); - - gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); - - if (socketpair(AF_UNIX, SOCK_DGRAM, 0, spair) < 0) { - fputs("Unable to create sockets\n", stderr); - spair[0] = spair[1] = -1; - } else { - gchanin = g_io_channel_unix_new(spair[0]); - g_io_channel_set_encoding(gchanin, NULL, NULL); - g_io_channel_set_flags(gchanin, g_io_channel_get_flags(gchanin) - | G_IO_FLAG_NONBLOCK, NULL); - g_io_channel_set_close_on_unref(gchanin, TRUE); - } - - - for (i = 0; i < LENGTH(certs); ++i) { - if (!regcomp(&(certs[i].re), certs[i].regex, REG_EXTENDED)) { - certs[i].file = g_strconcat(certdir, "/", certs[i].file, - NULL); - } else { - fprintf(stderr, "Could not compile regex: %s\n", - certs[i].regex); - certs[i].regex = NULL; - } - } - - if (!stylefile) { - styledir = buildpath(styledir); - for (i = 0; i < LENGTH(styles); ++i) { - if (!regcomp(&(styles[i].re), styles[i].regex, - REG_EXTENDED)) { - styles[i].file = g_strconcat(styledir, "/", - styles[i].file, NULL); - } else { - fprintf(stderr, "Could not compile regex: %s\n", - styles[i].regex); - styles[i].regex = NULL; - } - } - g_free(styledir); - } else { - stylefile = buildfile(stylefile); - } - - for (i = 0; i < LENGTH(uriparams); ++i) { - if (regcomp(&(uriparams[i].re), uriparams[i].uri, - REG_EXTENDED)) { - fprintf(stderr, "Could not compile regex: %s\n", - uriparams[i].uri); - uriparams[i].uri = NULL; - continue; - } - - /* copy default parameters with higher priority */ - for (j = 0; j < ParameterLast; ++j) { - if (defconfig[j].prio >= uriparams[i].config[j].prio) - uriparams[i].config[j] = defconfig[j]; - } - } -} - -void -sigchld(int unused) -{ - if (signal(SIGCHLD, sigchld) == SIG_ERR) - die("Can't install SIGCHLD handler"); - while (waitpid(-1, NULL, WNOHANG) > 0) - ; -} - -void -sighup(int unused) -{ - Arg a = { .i = 0 }; - Client *c; - - for (c = clients; c; c = c->next) - reload(c, &a); -} - -char * -buildfile(const char *path) -{ - char *dname, *bname, *bpath, *fpath; - FILE *f; - - dname = g_path_get_dirname(path); - bname = g_path_get_basename(path); - - bpath = buildpath(dname); - g_free(dname); - - fpath = g_build_filename(bpath, bname, NULL); - g_free(bpath); - g_free(bname); - - if (!(f = fopen(fpath, "a"))) - die("Could not open file: %s\n", fpath); - - g_chmod(fpath, 0600); /* always */ - fclose(f); - - return fpath; -} - -static const char* -getuserhomedir(const char *user) -{ - struct passwd *pw = getpwnam(user); - - if (!pw) - die("Can't get user %s login information.\n", user); - - return pw->pw_dir; -} - -static const char* -getcurrentuserhomedir(void) -{ - const char *homedir; - const char *user; - struct passwd *pw; - - homedir = getenv("HOME"); - if (homedir) - return homedir; - - user = getenv("USER"); - if (user) - return getuserhomedir(user); - - pw = getpwuid(getuid()); - if (!pw) - die("Can't get current user home directory\n"); - - return pw->pw_dir; -} - -char * -buildpath(const char *path) -{ - char *apath, *fpath; - - if (path[0] == '~') - apath = untildepath(path); - else - apath = g_strdup(path); - - /* creating directory */ - if (g_mkdir_with_parents(apath, 0700) < 0) - die("Could not access directory: %s\n", apath); - - fpath = realpath(apath, NULL); - g_free(apath); - - return fpath; -} - -char * -untildepath(const char *path) -{ - char *apath, *name, *p; - const char *homedir; - - if (path[1] == '/' || path[1] == '\0') { - p = (char *)&path[1]; - homedir = getcurrentuserhomedir(); - } else { - if ((p = strchr(path, '/'))) - name = g_strndup(&path[1], p - (path + 1)); - else - name = g_strdup(&path[1]); - - homedir = getuserhomedir(name); - g_free(name); - } - apath = g_build_filename(homedir, p, NULL); - return apath; -} - -Client * -newclient(Client *rc) -{ - Client *c; - - if (!(c = calloc(1, sizeof(Client)))) - die("Cannot malloc!\n"); - - c->next = clients; - clients = c; - - c->progress = 100; - c->view = newview(c, rc ? rc->view : NULL); - - return c; -} - -void -loaduri(Client *c, const Arg *a) -{ - struct stat st; - char *url, *path, *apath; - const char *uri = a->v; - - if (g_strcmp0(uri, "") == 0) - return; - - if (g_str_has_prefix(uri, "http://") || - g_str_has_prefix(uri, "https://") || - g_str_has_prefix(uri, "file://") || - g_str_has_prefix(uri, "webkit://") || - g_str_has_prefix(uri, "about:")) { - url = g_strdup(uri); - } else { - if (uri[0] == '~') - apath = untildepath(uri); - else - apath = (char *)uri; - if (!stat(apath, &st) && (path = realpath(apath, NULL))) { - url = g_strdup_printf("file://%s", path); - free(path); - } else { - url = g_strdup_printf("http://%s", uri); - } - if (apath != uri) - free(apath); - } - - setatom(c, AtomUri, url); - - if (strcmp(url, geturi(c)) == 0) { - reload(c, a); - } else { - webkit_web_view_load_uri(c->view, url); - updatetitle(c); - } - - g_free(url); -} - -const char * -geturi(Client *c) -{ - const char *uri; - - if (!(uri = webkit_web_view_get_uri(c->view))) - uri = "about:blank"; - return uri; -} - -void -setatom(Client *c, int a, const char *v) -{ - XChangeProperty(dpy, c->xid, - atoms[a], atoms[AtomUTF8], 8, PropModeReplace, - (unsigned char *)v, strlen(v) + 1); - XSync(dpy, False); -} - -const char * -getatom(Client *c, int a) -{ - static char buf[BUFSIZ]; - Atom adummy; - int idummy; - unsigned long ldummy; - unsigned char *p = NULL; - - XSync(dpy, False); - XGetWindowProperty(dpy, c->xid, - atoms[a], 0L, BUFSIZ, False, atoms[AtomUTF8], - &adummy, &idummy, &ldummy, &ldummy, &p); - if (p) - strncpy(buf, (char *)p, LENGTH(buf) - 1); - else - buf[0] = '\0'; - XFree(p); - - return buf; -} - -void -updatetitle(Client *c) -{ - char *title; - const char *name = c->overtitle ? c->overtitle : - c->title ? c->title : ""; - - if (curconfig[ShowIndicators].val.i) { - gettogglestats(c); - getpagestats(c); - - if (c->progress != 100) - title = g_strdup_printf("[%i%%] %s:%s | %s", - c->progress, togglestats, pagestats, name); - else - title = g_strdup_printf("%s:%s | %s", - togglestats, pagestats, name); - - gtk_window_set_title(GTK_WINDOW(c->win), title); - g_free(title); - } else { - gtk_window_set_title(GTK_WINDOW(c->win), name); - } -} - -void -gettogglestats(Client *c) -{ - togglestats[0] = cookiepolicy_set(cookiepolicy_get()); - togglestats[1] = curconfig[CaretBrowsing].val.i ? 'C' : 'c'; - togglestats[2] = curconfig[Geolocation].val.i ? 'G' : 'g'; - togglestats[3] = curconfig[DiskCache].val.i ? 'D' : 'd'; - togglestats[4] = curconfig[LoadImages].val.i ? 'I' : 'i'; - togglestats[5] = curconfig[JavaScript].val.i ? 'S' : 's'; - togglestats[6] = curconfig[Style].val.i ? 'M' : 'm'; - togglestats[8] = curconfig[Certificate].val.i ? 'X' : 'x'; - togglestats[9] = curconfig[StrictTLS].val.i ? 'T' : 't'; -} - -void -getpagestats(Client *c) -{ - if (c->https) - pagestats[0] = (c->tlserr || c->insecure) ? 'U' : 'T'; - else - pagestats[0] = '-'; - pagestats[1] = '\0'; -} - -WebKitCookieAcceptPolicy -cookiepolicy_get(void) -{ - switch (((char *)curconfig[CookiePolicies].val.v)[cookiepolicy]) { - case 'a': - return WEBKIT_COOKIE_POLICY_ACCEPT_NEVER; - case '@': - return WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY; - default: /* fallthrough */ - case 'A': - return WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS; - } -} - -char -cookiepolicy_set(const WebKitCookieAcceptPolicy p) -{ - switch (p) { - case WEBKIT_COOKIE_POLICY_ACCEPT_NEVER: - return 'a'; - case WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY: - return '@'; - default: /* fallthrough */ - case WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS: - return 'A'; - } -} - -void -seturiparameters(Client *c, const char *uri, ParamName *params) -{ - Parameter *config, *uriconfig = NULL; - int i, p; - - for (i = 0; i < LENGTH(uriparams); ++i) { - if (uriparams[i].uri && - !regexec(&(uriparams[i].re), uri, 0, NULL, 0)) { - uriconfig = uriparams[i].config; - break; - } - } - - curconfig = uriconfig ? uriconfig : defconfig; - - for (i = 0; (p = params[i]) != ParameterLast; ++i) { - switch(p) { - default: /* FALLTHROUGH */ - if (!(defconfig[p].prio < curconfig[p].prio || - defconfig[p].prio < modparams[p])) - continue; - case Certificate: - case CookiePolicies: - case Style: - setparameter(c, 0, p, &curconfig[p].val); - } - } -} - -void -setparameter(Client *c, int refresh, ParamName p, const Arg *a) -{ - GdkRGBA bgcolor = { 0 }; - - modparams[p] = curconfig[p].prio; - - switch (p) { - case AccessMicrophone: - return; /* do nothing */ - case AccessWebcam: - return; /* do nothing */ - case CaretBrowsing: - webkit_settings_set_enable_caret_browsing(c->settings, a->i); - refresh = 0; - break; - case Certificate: - if (a->i) - setcert(c, geturi(c)); - return; /* do not update */ - case CookiePolicies: - webkit_cookie_manager_set_accept_policy( - webkit_web_context_get_cookie_manager(c->context), - cookiepolicy_get()); - refresh = 0; - break; - case DarkMode: - g_object_set(gtk_settings_get_default(), - "gtk-application-prefer-dark-theme", a->i, NULL); - return; - case DiskCache: - webkit_web_context_set_cache_model(c->context, a->i ? - WEBKIT_CACHE_MODEL_WEB_BROWSER : - WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); - return; /* do not update */ - case DefaultCharset: - webkit_settings_set_default_charset(c->settings, a->v); - return; /* do not update */ - case DNSPrefetch: - webkit_settings_set_enable_dns_prefetching(c->settings, a->i); - return; /* do not update */ - case FileURLsCrossAccess: - webkit_settings_set_allow_file_access_from_file_urls( - c->settings, a->i); - webkit_settings_set_allow_universal_access_from_file_urls( - c->settings, a->i); - return; /* do not update */ - case FontSize: - webkit_settings_set_default_font_size(c->settings, a->i); - return; /* do not update */ - case Geolocation: - refresh = 0; - break; - case HideBackground: - if (a->i) - webkit_web_view_set_background_color(c->view, &bgcolor); - return; /* do not update */ - case Inspector: - webkit_settings_set_enable_developer_extras(c->settings, a->i); - return; /* do not update */ - case JavaScript: - webkit_settings_set_enable_javascript(c->settings, a->i); - break; - case KioskMode: - return; /* do nothing */ - case LoadImages: - webkit_settings_set_auto_load_images(c->settings, a->i); - break; - case MediaManualPlay: - webkit_settings_set_media_playback_requires_user_gesture( - c->settings, a->i); - break; - case PreferredLanguages: - return; /* do nothing */ - case RunInFullscreen: - return; /* do nothing */ - case ScrollBars: - /* Disabled until we write some WebKitWebExtension for - * manipulating the DOM directly. - enablescrollbars = !enablescrollbars; - evalscript(c, "document.documentElement.style.overflow = '%s'", - enablescrollbars ? "auto" : "hidden"); - */ - return; /* do not update */ - case ShowIndicators: - break; - case SmoothScrolling: - webkit_settings_set_enable_smooth_scrolling(c->settings, a->i); - return; /* do not update */ - case SiteQuirks: - webkit_settings_set_enable_site_specific_quirks( - c->settings, a->i); - break; - case SpellChecking: - webkit_web_context_set_spell_checking_enabled( - c->context, a->i); - return; /* do not update */ - case SpellLanguages: - return; /* do nothing */ - case StrictTLS: - webkit_website_data_manager_set_tls_errors_policy( - webkit_web_view_get_website_data_manager(c->view), a->i ? - WEBKIT_TLS_ERRORS_POLICY_FAIL : - WEBKIT_TLS_ERRORS_POLICY_IGNORE); - break; - case Style: - webkit_user_content_manager_remove_all_style_sheets( - webkit_web_view_get_user_content_manager(c->view)); - if (a->i) - setstyle(c, getstyle(geturi(c))); - refresh = 0; - break; - case WebGL: - webkit_settings_set_enable_webgl(c->settings, a->i); - break; - case ZoomLevel: - webkit_web_view_set_zoom_level(c->view, a->f); - return; /* do not update */ - default: - return; /* do nothing */ - } - - updatetitle(c); - if (refresh) - reload(c, a); -} - -const char * -getcert(const char *uri) -{ - int i; - - for (i = 0; i < LENGTH(certs); ++i) { - if (certs[i].regex && - !regexec(&(certs[i].re), uri, 0, NULL, 0)) - return certs[i].file; - } - - return NULL; -} - -void -setcert(Client *c, const char *uri) -{ - const char *file = getcert(uri); - char *host; - GTlsCertificate *cert; - - if (!file) - return; - - if (!(cert = g_tls_certificate_new_from_file(file, NULL))) { - fprintf(stderr, "Could not read certificate file: %s\n", file); - return; - } - - if ((uri = strstr(uri, "https://"))) { - uri += sizeof("https://") - 1; - host = g_strndup(uri, strchr(uri, '/') - uri); - webkit_web_context_allow_tls_certificate_for_host(c->context, - cert, host); - g_free(host); - } - - g_object_unref(cert); - -} - -const char * -getstyle(const char *uri) -{ - int i; - - if (stylefile) - return stylefile; - - for (i = 0; i < LENGTH(styles); ++i) { - if (styles[i].regex && - !regexec(&(styles[i].re), uri, 0, NULL, 0)) - return styles[i].file; - } - - return ""; -} - -void -setstyle(Client *c, const char *file) -{ - gchar *style; - - if (!g_file_get_contents(file, &style, NULL, NULL)) { - fprintf(stderr, "Could not read style file: %s\n", file); - return; - } - - webkit_user_content_manager_add_style_sheet( - webkit_web_view_get_user_content_manager(c->view), - webkit_user_style_sheet_new(style, - WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, - WEBKIT_USER_STYLE_LEVEL_USER, - NULL, NULL)); - - g_free(style); -} - -void -runscript(Client *c) -{ - gchar *script; - gsize l; - - if (g_file_get_contents(scriptfile, &script, &l, NULL) && l) - evalscript(c, "%s", script); - g_free(script); -} - -void -evalscript(Client *c, const char *jsstr, ...) -{ - va_list ap; - gchar *script; - - va_start(ap, jsstr); - script = g_strdup_vprintf(jsstr, ap); - va_end(ap); - - webkit_web_view_evaluate_javascript(c->view, script, -1, - NULL, NULL, NULL, NULL, NULL); - g_free(script); -} - -void -updatewinid(Client *c) -{ - snprintf(winid, LENGTH(winid), "%lu", c->xid); -} - -void -handleplumb(Client *c, const char *uri) -{ - Arg a = (Arg)PLUMB(uri); - spawn(c, &a); -} - -void -newwindow(Client *c, const Arg *a, int noembed) -{ - int i = 0; - char tmp[64]; - const char *cmd[29], *uri; - const Arg arg = { .v = cmd }; - - cmd[i++] = argv0; - cmd[i++] = "-a"; - cmd[i++] = curconfig[CookiePolicies].val.v; - cmd[i++] = curconfig[ScrollBars].val.i ? "-B" : "-b"; - if (cookiefile && g_strcmp0(cookiefile, "")) { - cmd[i++] = "-c"; - cmd[i++] = cookiefile; - } - if (stylefile && g_strcmp0(stylefile, "")) { - cmd[i++] = "-C"; - cmd[i++] = stylefile; - } - cmd[i++] = curconfig[DiskCache].val.i ? "-D" : "-d"; - if (embed && !noembed) { - cmd[i++] = "-e"; - snprintf(tmp, LENGTH(tmp), "%lu", embed); - cmd[i++] = tmp; - } - cmd[i++] = curconfig[RunInFullscreen].val.i ? "-F" : "-f" ; - cmd[i++] = curconfig[Geolocation].val.i ? "-G" : "-g" ; - cmd[i++] = curconfig[LoadImages].val.i ? "-I" : "-i" ; - cmd[i++] = curconfig[KioskMode].val.i ? "-K" : "-k" ; - cmd[i++] = curconfig[Style].val.i ? "-M" : "-m" ; - cmd[i++] = curconfig[Inspector].val.i ? "-N" : "-n" ; - if (scriptfile && g_strcmp0(scriptfile, "")) { - cmd[i++] = "-r"; - cmd[i++] = scriptfile; - } - cmd[i++] = curconfig[JavaScript].val.i ? "-S" : "-s"; - cmd[i++] = curconfig[StrictTLS].val.i ? "-T" : "-t"; - if (fulluseragent && g_strcmp0(fulluseragent, "")) { - cmd[i++] = "-u"; - cmd[i++] = fulluseragent; - } - if (showxid) - cmd[i++] = "-w"; - cmd[i++] = curconfig[Certificate].val.i ? "-X" : "-x" ; - /* do not keep zoom level */ - cmd[i++] = "--"; - if ((uri = a->v)) - cmd[i++] = uri; - cmd[i] = NULL; - - spawn(c, &arg); -} - -void -spawn(Client *c, const Arg *a) -{ - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - close(spair[0]); - close(spair[1]); - setsid(); - execvp(((char **)a->v)[0], (char **)a->v); - fprintf(stderr, "%s: execvp %s", argv0, ((char **)a->v)[0]); - perror(" failed"); - exit(1); - } -} - -void -destroyclient(Client *c) -{ - Client *p; - - webkit_web_view_stop_loading(c->view); - /* Not needed, has already been called - gtk_widget_destroy(c->win); - */ - - for (p = clients; p && p->next != c; p = p->next) - ; - if (p) - p->next = c->next; - else - clients = c->next; - free(c); -} - -void -cleanup(void) -{ - while (clients) - destroyclient(clients); - - close(spair[0]); - close(spair[1]); - g_free(cookiefile); - g_free(scriptfile); - g_free(stylefile); - g_free(cachedir); - XCloseDisplay(dpy); -} - -WebKitWebView * -newview(Client *c, WebKitWebView *rv) -{ - WebKitWebView *v; - WebKitSettings *settings; - WebKitWebContext *context; - WebKitCookieManager *cookiemanager; - WebKitUserContentManager *contentmanager; - - /* Webview */ - if (rv) { - v = WEBKIT_WEB_VIEW(webkit_web_view_new_with_related_view(rv)); - context = webkit_web_view_get_context(v); - settings = webkit_web_view_get_settings(v); - } else { - settings = webkit_settings_new_with_settings( - "allow-file-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, - "allow-universal-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, - "auto-load-images", curconfig[LoadImages].val.i, - "default-charset", curconfig[DefaultCharset].val.v, - "default-font-size", curconfig[FontSize].val.i, - "enable-caret-browsing", curconfig[CaretBrowsing].val.i, - "enable-developer-extras", curconfig[Inspector].val.i, - "enable-dns-prefetching", curconfig[DNSPrefetch].val.i, - "enable-html5-database", curconfig[DiskCache].val.i, - "enable-html5-local-storage", curconfig[DiskCache].val.i, - "enable-javascript", curconfig[JavaScript].val.i, - "enable-site-specific-quirks", curconfig[SiteQuirks].val.i, - "enable-smooth-scrolling", curconfig[SmoothScrolling].val.i, - "enable-webgl", curconfig[WebGL].val.i, - "media-playback-requires-user-gesture", curconfig[MediaManualPlay].val.i, - NULL); -/* For more interesting settings, have a look at - * http://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html */ - - if (strcmp(fulluseragent, "")) { - webkit_settings_set_user_agent(settings, fulluseragent); - } else if (surfuseragent) { - webkit_settings_set_user_agent_with_application_details( - settings, "Surf", VERSION); - } - useragent = webkit_settings_get_user_agent(settings); - - contentmanager = webkit_user_content_manager_new(); - - if (curconfig[Ephemeral].val.i) { - context = webkit_web_context_new_ephemeral(); - } else { - context = webkit_web_context_new_with_website_data_manager( - webkit_website_data_manager_new( - "base-cache-directory", cachedir, - "base-data-directory", cachedir, - NULL)); - } - - cookiemanager = webkit_web_context_get_cookie_manager(context); - - /* TLS */ - webkit_website_data_manager_set_tls_errors_policy( - webkit_web_context_get_website_data_manager(context), - curconfig[StrictTLS].val.i ? WEBKIT_TLS_ERRORS_POLICY_FAIL : - WEBKIT_TLS_ERRORS_POLICY_IGNORE); - /* disk cache */ - webkit_web_context_set_cache_model(context, - curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER : - WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); - - /* Currently only works with text file to be compatible with curl */ - if (!curconfig[Ephemeral].val.i) - webkit_cookie_manager_set_persistent_storage(cookiemanager, - cookiefile, WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); - /* cookie policy */ - webkit_cookie_manager_set_accept_policy(cookiemanager, - cookiepolicy_get()); - /* languages */ - webkit_web_context_set_preferred_languages(context, - curconfig[PreferredLanguages].val.v); - webkit_web_context_set_spell_checking_languages(context, - curconfig[SpellLanguages].val.v); - webkit_web_context_set_spell_checking_enabled(context, - curconfig[SpellChecking].val.i); - - g_signal_connect(G_OBJECT(context), "download-started", - G_CALLBACK(downloadstarted), c); - g_signal_connect(G_OBJECT(context), "initialize-web-extensions", - G_CALLBACK(initwebextensions), c); - - v = g_object_new(WEBKIT_TYPE_WEB_VIEW, - "settings", settings, - "user-content-manager", contentmanager, - "web-context", context, - NULL); - } - - g_signal_connect(G_OBJECT(v), "notify::estimated-load-progress", - G_CALLBACK(progresschanged), c); - g_signal_connect(G_OBJECT(v), "notify::title", - G_CALLBACK(titlechanged), c); - g_signal_connect(G_OBJECT(v), "button-release-event", - G_CALLBACK(buttonreleased), c); - g_signal_connect(G_OBJECT(v), "close", - G_CALLBACK(closeview), c); - g_signal_connect(G_OBJECT(v), "create", - G_CALLBACK(createview), c); - g_signal_connect(G_OBJECT(v), "decide-policy", - G_CALLBACK(decidepolicy), c); - g_signal_connect(G_OBJECT(v), "insecure-content-detected", - G_CALLBACK(insecurecontent), c); - g_signal_connect(G_OBJECT(v), "load-failed-with-tls-errors", - G_CALLBACK(loadfailedtls), c); - g_signal_connect(G_OBJECT(v), "load-changed", - G_CALLBACK(loadchanged), c); - g_signal_connect(G_OBJECT(v), "mouse-target-changed", - G_CALLBACK(mousetargetchanged), c); - g_signal_connect(G_OBJECT(v), "permission-request", - G_CALLBACK(permissionrequested), c); - g_signal_connect(G_OBJECT(v), "ready-to-show", - G_CALLBACK(showview), c); - g_signal_connect(G_OBJECT(v), "user-message-received", - G_CALLBACK(viewusrmsgrcv), c); - g_signal_connect(G_OBJECT(v), "web-process-terminated", - G_CALLBACK(webprocessterminated), c); - - c->context = context; - c->settings = settings; - - setparameter(c, 0, DarkMode, &curconfig[DarkMode].val); - - return v; -} - -void -initwebextensions(WebKitWebContext *wc, Client *c) -{ - webkit_web_context_set_web_extensions_directory(wc, WEBEXTDIR); -} - -GtkWidget * -createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c) -{ - Client *n; - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - /* - * popup windows of type “other” are almost always triggered - * by user gesture, so inverse the logic here - */ -/* instead of this, compare destination uri to mouse-over uri for validating window */ - if (webkit_navigation_action_is_user_gesture(a)) - return NULL; - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: - n = newclient(c); - break; - default: - return NULL; - } - - return GTK_WIDGET(n->view); -} - -gboolean -buttonreleased(GtkWidget *w, GdkEvent *e, Client *c) -{ - WebKitHitTestResultContext element; - int i; - - element = webkit_hit_test_result_get_context(c->mousepos); - - for (i = 0; i < LENGTH(buttons); ++i) { - if (element & buttons[i].target && - e->button.button == buttons[i].button && - CLEANMASK(e->button.state) == CLEANMASK(buttons[i].mask) && - buttons[i].func) { - buttons[i].func(c, &buttons[i].arg, c->mousepos); - return buttons[i].stopevent; - } - } - - return FALSE; -} - -GdkFilterReturn -processx(GdkXEvent *e, GdkEvent *event, gpointer d) -{ - Client *c = (Client *)d; - XPropertyEvent *ev; - Arg a; - - if (((XEvent *)e)->type == PropertyNotify) { - ev = &((XEvent *)e)->xproperty; - if (ev->state == PropertyNewValue) { - if (ev->atom == atoms[AtomFind]) { - find(c, NULL); - - return GDK_FILTER_REMOVE; - } else if (ev->atom == atoms[AtomGo]) { - a.v = getatom(c, AtomGo); - loaduri(c, &a); - - return GDK_FILTER_REMOVE; - } - } - } - return GDK_FILTER_CONTINUE; -} - -gboolean -winevent(GtkWidget *w, GdkEvent *e, Client *c) -{ - int i; - - switch (e->type) { - case GDK_ENTER_NOTIFY: - c->overtitle = c->targeturi; - updatetitle(c); - break; - case GDK_KEY_PRESS: - if (!curconfig[KioskMode].val.i) { - for (i = 0; i < LENGTH(keys); ++i) { - if (gdk_keyval_to_lower(e->key.keyval) == - keys[i].keyval && - CLEANMASK(e->key.state) == keys[i].mod && - keys[i].func) { - updatewinid(c); - keys[i].func(c, &(keys[i].arg)); - return TRUE; - } - } - } - case GDK_LEAVE_NOTIFY: - c->overtitle = NULL; - updatetitle(c); - break; - case GDK_WINDOW_STATE: - if (e->window_state.changed_mask == - GDK_WINDOW_STATE_FULLSCREEN) - c->fullscreen = e->window_state.new_window_state & - GDK_WINDOW_STATE_FULLSCREEN; - break; - default: - break; - } - - return FALSE; -} - -void -showview(WebKitWebView *v, Client *c) -{ - GdkRGBA bgcolor = { 0 }; - GdkWindow *gwin; - - c->finder = webkit_web_view_get_find_controller(c->view); - c->inspector = webkit_web_view_get_inspector(c->view); - - c->pageid = webkit_web_view_get_page_id(c->view); - c->win = createwindow(c); - - gtk_container_add(GTK_CONTAINER(c->win), GTK_WIDGET(c->view)); - gtk_widget_show_all(c->win); - gtk_widget_grab_focus(GTK_WIDGET(c->view)); - - gwin = gtk_widget_get_window(GTK_WIDGET(c->win)); - c->xid = gdk_x11_window_get_xid(gwin); - updatewinid(c); - if (showxid) { - gdk_display_sync(gtk_widget_get_display(c->win)); - puts(winid); - fflush(stdout); - } - - if (curconfig[HideBackground].val.i) - webkit_web_view_set_background_color(c->view, &bgcolor); - - if (!curconfig[KioskMode].val.i) { - gdk_window_set_events(gwin, GDK_ALL_EVENTS_MASK); - gdk_window_add_filter(gwin, processx, c); - } - - if (curconfig[RunInFullscreen].val.i) - togglefullscreen(c, NULL); - - if (curconfig[ZoomLevel].val.f != 1.0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f); - - setatom(c, AtomFind, ""); - setatom(c, AtomUri, "about:blank"); -} - -GtkWidget * -createwindow(Client *c) -{ - char *wmstr; - GtkWidget *w; - - if (embed) { - w = gtk_plug_new(embed); - } else { - w = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - wmstr = g_path_get_basename(argv0); - gtk_window_set_wmclass(GTK_WINDOW(w), wmstr, "Surf"); - g_free(wmstr); - - wmstr = g_strdup_printf("%s[%"PRIu64"]", "Surf", c->pageid); - gtk_window_set_role(GTK_WINDOW(w), wmstr); - g_free(wmstr); - - gtk_window_set_default_size(GTK_WINDOW(w), winsize[0], winsize[1]); - } - - g_signal_connect(G_OBJECT(w), "destroy", - G_CALLBACK(destroywin), c); - g_signal_connect(G_OBJECT(w), "enter-notify-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "key-press-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "leave-notify-event", - G_CALLBACK(winevent), c); - g_signal_connect(G_OBJECT(w), "window-state-event", - G_CALLBACK(winevent), c); - - return w; -} - -gboolean -loadfailedtls(WebKitWebView *v, gchar *uri, GTlsCertificate *cert, - GTlsCertificateFlags err, Client *c) -{ - GString *errmsg = g_string_new(NULL); - gchar *html, *pem; - - c->failedcert = g_object_ref(cert); - c->tlserr = err; - c->errorpage = 1; - - if (err & G_TLS_CERTIFICATE_UNKNOWN_CA) - g_string_append(errmsg, - "The signing certificate authority is not known.
"); - if (err & G_TLS_CERTIFICATE_BAD_IDENTITY) - g_string_append(errmsg, - "The certificate does not match the expected identity " - "of the site that it was retrieved from.
"); - if (err & G_TLS_CERTIFICATE_NOT_ACTIVATED) - g_string_append(errmsg, - "The certificate's activation time " - "is still in the future.
"); - if (err & G_TLS_CERTIFICATE_EXPIRED) - g_string_append(errmsg, "The certificate has expired.
"); - if (err & G_TLS_CERTIFICATE_REVOKED) - g_string_append(errmsg, - "The certificate has been revoked according to " - "the GTlsConnection's certificate revocation list.
"); - if (err & G_TLS_CERTIFICATE_INSECURE) - g_string_append(errmsg, - "The certificate's algorithm is considered insecure.
"); - if (err & G_TLS_CERTIFICATE_GENERIC_ERROR) - g_string_append(errmsg, - "Some error occurred validating the certificate.
"); - - g_object_get(cert, "certificate-pem", &pem, NULL); - html = g_strdup_printf("

Could not validate TLS for “%s”
%s

" - "

You can inspect the following certificate " - "with Ctrl-t (default keybinding).

" - "

%s

", uri, errmsg->str, pem); - g_free(pem); - g_string_free(errmsg, TRUE); - - webkit_web_view_load_alternate_html(c->view, html, uri, NULL); - g_free(html); - - return TRUE; -} - -void -loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) -{ - const char *uri = geturi(c); - - switch (e) { - case WEBKIT_LOAD_STARTED: - setatom(c, AtomUri, uri); - c->title = uri; - c->https = c->insecure = 0; - seturiparameters(c, uri, loadtransient); - if (c->errorpage) - c->errorpage = 0; - else - g_clear_object(&c->failedcert); - break; - case WEBKIT_LOAD_REDIRECTED: - setatom(c, AtomUri, uri); - c->title = uri; - seturiparameters(c, uri, loadtransient); - break; - case WEBKIT_LOAD_COMMITTED: - setatom(c, AtomUri, uri); - c->title = uri; - seturiparameters(c, uri, loadcommitted); - c->https = webkit_web_view_get_tls_info(c->view, &c->cert, - &c->tlserr); - break; - case WEBKIT_LOAD_FINISHED: - seturiparameters(c, uri, loadfinished); - /* Disabled until we write some WebKitWebExtension for - * manipulating the DOM directly. - evalscript(c, "document.documentElement.style.overflow = '%s'", - enablescrollbars ? "auto" : "hidden"); - */ - runscript(c); - break; - } - updatetitle(c); -} - -void -progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c) -{ - c->progress = webkit_web_view_get_estimated_load_progress(c->view) * - 100; - updatetitle(c); -} - -void -titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c) -{ - c->title = webkit_web_view_get_title(c->view); - updatetitle(c); -} - -gboolean -viewusrmsgrcv(WebKitWebView *v, WebKitUserMessage *m, gpointer unused) -{ - WebKitUserMessage *r; - GUnixFDList *gfd; - const char *name; - - name = webkit_user_message_get_name(m); - if (strcmp(name, "page-created") != 0) { - fprintf(stderr, "surf: Unknown UserMessage: %s\n", name); - return TRUE; - } - - if (spair[1] < 0) - return TRUE; - - gfd = g_unix_fd_list_new_from_array(&spair[1], 1); - r = webkit_user_message_new_with_fd_list("surf-pipe", NULL, gfd); - - webkit_user_message_send_reply(m, r); - - return TRUE; -} - -void -mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers, - Client *c) -{ - WebKitHitTestResultContext hc = webkit_hit_test_result_get_context(h); - - /* Keep the hit test to know where is the pointer on the next click */ - c->mousepos = h; - - if (hc & OnLink) - c->targeturi = webkit_hit_test_result_get_link_uri(h); - else if (hc & OnImg) - c->targeturi = webkit_hit_test_result_get_image_uri(h); - else if (hc & OnMedia) - c->targeturi = webkit_hit_test_result_get_media_uri(h); - else - c->targeturi = NULL; - - c->overtitle = c->targeturi; - updatetitle(c); -} - -gboolean -permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c) -{ - ParamName param = ParameterLast; - - if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(r)) { - param = Geolocation; - } else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(r)) { - if (webkit_user_media_permission_is_for_audio_device( - WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) - param = AccessMicrophone; - else if (webkit_user_media_permission_is_for_video_device( - WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) - param = AccessWebcam; - } else { - return FALSE; - } - - if (curconfig[param].val.i) - webkit_permission_request_allow(r); - else - webkit_permission_request_deny(r); - - return TRUE; -} - -gboolean -decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, - WebKitPolicyDecisionType dt, Client *c) -{ - switch (dt) { - case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: - decidenavigation(d, c); - break; - case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: - decidenewwindow(d, c); - break; - case WEBKIT_POLICY_DECISION_TYPE_RESPONSE: - decideresource(d, c); - break; - default: - webkit_policy_decision_ignore(d); - break; - } - return TRUE; -} - -void -decidenavigation(WebKitPolicyDecision *d, Client *c) -{ - WebKitNavigationAction *a = - webkit_navigation_policy_decision_get_navigation_action( - WEBKIT_NAVIGATION_POLICY_DECISION(d)); - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - default: - /* Do not navigate to links with a "_blank" target (popup) */ - if (webkit_navigation_action_get_frame_name(a)) { - webkit_policy_decision_ignore(d); - } else { - /* Filter out navigation to different domain ? */ - /* get action→urirequest, copy and load in new window+view - * on Ctrl+Click ? */ - webkit_policy_decision_use(d); - } - break; - } -} - -void -decidenewwindow(WebKitPolicyDecision *d, Client *c) -{ - Arg arg; - WebKitNavigationAction *a = - webkit_navigation_policy_decision_get_navigation_action( - WEBKIT_NAVIGATION_POLICY_DECISION(d)); - - - switch (webkit_navigation_action_get_navigation_type(a)) { - case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ - case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: - /* Filter domains here */ -/* If the value of “mouse-button” is not 0, then the navigation was triggered by a mouse event. - * test for link clicked but no button ? */ - arg.v = webkit_uri_request_get_uri( - webkit_navigation_action_get_request(a)); - newwindow(c, &arg, 0); - break; - case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ - default: - break; - } - - webkit_policy_decision_ignore(d); -} - -void -decideresource(WebKitPolicyDecision *d, Client *c) -{ - int i, isascii = 1; - WebKitResponsePolicyDecision *r = WEBKIT_RESPONSE_POLICY_DECISION(d); - WebKitURIResponse *res = - webkit_response_policy_decision_get_response(r); - const gchar *uri = webkit_uri_response_get_uri(res); - - if (g_str_has_suffix(uri, "/favicon.ico")) { - webkit_policy_decision_ignore(d); - return; - } - - if (!g_str_has_prefix(uri, "http://") - && !g_str_has_prefix(uri, "https://") - && !g_str_has_prefix(uri, "about:") - && !g_str_has_prefix(uri, "file://") - && !g_str_has_prefix(uri, "webkit://") - && !g_str_has_prefix(uri, "data:") - && !g_str_has_prefix(uri, "blob:") - && strlen(uri) > 0) { - for (i = 0; i < strlen(uri); i++) { - if (!g_ascii_isprint(uri[i])) { - isascii = 0; - break; - } - } - if (isascii) { - handleplumb(c, uri); - webkit_policy_decision_ignore(d); - return; - } - } - - if (webkit_response_policy_decision_is_mime_type_supported(r)) { - webkit_policy_decision_use(d); - } else { - webkit_policy_decision_ignore(d); - download(c, res); - } -} - -void -insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, Client *c) -{ - c->insecure = 1; -} - -void -downloadstarted(WebKitWebContext *wc, WebKitDownload *d, Client *c) -{ - g_signal_connect(G_OBJECT(d), "notify::response", - G_CALLBACK(responsereceived), c); -} - -void -responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c) -{ - download(c, webkit_download_get_response(d)); - webkit_download_cancel(d); -} - -void -download(Client *c, WebKitURIResponse *r) -{ - Arg a = (Arg)DOWNLOAD(webkit_uri_response_get_uri(r), geturi(c)); - spawn(c, &a); -} - -void -webprocessterminated(WebKitWebView *v, WebKitWebProcessTerminationReason r, - Client *c) -{ - fprintf(stderr, "web process terminated: %s\n", - r == WEBKIT_WEB_PROCESS_CRASHED ? "crashed" : "no memory"); - closeview(v, c); -} - -void -closeview(WebKitWebView *v, Client *c) -{ - gtk_widget_destroy(c->win); -} - -void -destroywin(GtkWidget* w, Client *c) -{ - destroyclient(c); - if (!clients) - gtk_main_quit(); -} - -void -pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) -{ - Arg a = {.v = text }; - if (text) - loaduri((Client *) d, &a); -} - -void -reload(Client *c, const Arg *a) -{ - if (a->i) - webkit_web_view_reload_bypass_cache(c->view); - else - webkit_web_view_reload(c->view); -} - -void -print(Client *c, const Arg *a) -{ - webkit_print_operation_run_dialog(webkit_print_operation_new(c->view), - GTK_WINDOW(c->win)); -} - -void -showcert(Client *c, const Arg *a) -{ - GTlsCertificate *cert = c->failedcert ? c->failedcert : c->cert; - GcrCertificate *gcrt; - GByteArray *crt; - GtkWidget *win; - GcrCertificateWidget *wcert; - - if (!cert) - return; - - g_object_get(cert, "certificate", &crt, NULL); - gcrt = gcr_simple_certificate_new(crt->data, crt->len); - g_byte_array_unref(crt); - - win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - wcert = gcr_certificate_widget_new(gcrt); - g_object_unref(gcrt); - - gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(wcert)); - gtk_widget_show_all(win); -} - -void -clipboard(Client *c, const Arg *a) -{ - if (a->i) { /* load clipboard uri */ - gtk_clipboard_request_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), - pasteuri, c); - } else { /* copy uri */ - gtk_clipboard_set_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), c->targeturi - ? c->targeturi : geturi(c), -1); - } -} - -void -zoom(Client *c, const Arg *a) -{ - if (a->i > 0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f + 0.1); - else if (a->i < 0) - webkit_web_view_set_zoom_level(c->view, - curconfig[ZoomLevel].val.f - 0.1); - else - webkit_web_view_set_zoom_level(c->view, 1.0); - - curconfig[ZoomLevel].val.f = webkit_web_view_get_zoom_level(c->view); -} - -static void -msgext(Client *c, char type, const Arg *a) -{ - static unsigned char msg[MSGBUFSZ]; - int ret; - - if (spair[0] < 0) - return; - - ret = snprintf(msg, sizeof(msg), "%c%c%c", - (unsigned char)c->pageid, type, (signed char)a->i); - if (ret >= sizeof(msg)) { - fprintf(stderr, "surf: message too long: %d\n", ret); - return; - } - - if (send(spair[0], msg, ret, 0) != ret) - fprintf(stderr, "surf: error sending: %hhu/%c/%d (%d)\n", - (unsigned char)c->pageid, type, a->i, ret); -} - -void -scrollv(Client *c, const Arg *a) -{ - msgext(c, 'v', a); -} - -void -scrollh(Client *c, const Arg *a) -{ - msgext(c, 'h', a); -} - -void -navigate(Client *c, const Arg *a) -{ - if (a->i < 0) - webkit_web_view_go_back(c->view); - else if (a->i > 0) - webkit_web_view_go_forward(c->view); -} - -void -stop(Client *c, const Arg *a) -{ - webkit_web_view_stop_loading(c->view); -} - -void -toggle(Client *c, const Arg *a) -{ - curconfig[a->i].val.i ^= 1; - setparameter(c, 1, (ParamName)a->i, &curconfig[a->i].val); -} - -void -togglefullscreen(Client *c, const Arg *a) -{ - /* toggling value is handled in winevent() */ - if (c->fullscreen) - gtk_window_unfullscreen(GTK_WINDOW(c->win)); - else - gtk_window_fullscreen(GTK_WINDOW(c->win)); -} - -void -togglecookiepolicy(Client *c, const Arg *a) -{ - ++cookiepolicy; - cookiepolicy %= strlen(curconfig[CookiePolicies].val.v); - - setparameter(c, 0, CookiePolicies, NULL); -} - -void -toggleinspector(Client *c, const Arg *a) -{ - if (webkit_web_inspector_is_attached(c->inspector)) - webkit_web_inspector_close(c->inspector); - else if (curconfig[Inspector].val.i) - webkit_web_inspector_show(c->inspector); -} - -void -find(Client *c, const Arg *a) -{ - const char *s, *f; - - if (a && a->i) { - if (a->i > 0) - webkit_find_controller_search_next(c->finder); - else - webkit_find_controller_search_previous(c->finder); - } else { - s = getatom(c, AtomFind); - f = webkit_find_controller_get_search_text(c->finder); - - if (g_strcmp0(f, s) == 0) /* reset search */ - webkit_find_controller_search(c->finder, "", findopts, - G_MAXUINT); - - webkit_find_controller_search(c->finder, s, findopts, - G_MAXUINT); - - if (strcmp(s, "") == 0) - webkit_find_controller_search_finish(c->finder); - } -} - -void -clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - navigate(c, a); -} - -void -clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - Arg arg; - - arg.v = webkit_hit_test_result_get_link_uri(h); - newwindow(c, &arg, a->i); -} - -void -clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h) -{ - Arg arg; - - arg = (Arg)VIDEOPLAY(webkit_hit_test_result_get_media_uri(h)); - spawn(c, &arg); -} - -int -main(int argc, char *argv[]) -{ - Arg arg; - Client *c; - - memset(&arg, 0, sizeof(arg)); - - /* command line args */ - ARGBEGIN { - case 'a': - defconfig[CookiePolicies].val.v = EARGF(usage()); - defconfig[CookiePolicies].prio = 2; - break; - case 'b': - defconfig[ScrollBars].val.i = 0; - defconfig[ScrollBars].prio = 2; - break; - case 'B': - defconfig[ScrollBars].val.i = 1; - defconfig[ScrollBars].prio = 2; - break; - case 'c': - cookiefile = EARGF(usage()); - break; - case 'C': - stylefile = EARGF(usage()); - break; - case 'd': - defconfig[DiskCache].val.i = 0; - defconfig[DiskCache].prio = 2; - break; - case 'D': - defconfig[DiskCache].val.i = 1; - defconfig[DiskCache].prio = 2; - break; - case 'e': - embed = strtol(EARGF(usage()), NULL, 0); - break; - case 'f': - defconfig[RunInFullscreen].val.i = 0; - defconfig[RunInFullscreen].prio = 2; - break; - case 'F': - defconfig[RunInFullscreen].val.i = 1; - defconfig[RunInFullscreen].prio = 2; - break; - case 'g': - defconfig[Geolocation].val.i = 0; - defconfig[Geolocation].prio = 2; - break; - case 'G': - defconfig[Geolocation].val.i = 1; - defconfig[Geolocation].prio = 2; - break; - case 'i': - defconfig[LoadImages].val.i = 0; - defconfig[LoadImages].prio = 2; - break; - case 'I': - defconfig[LoadImages].val.i = 1; - defconfig[LoadImages].prio = 2; - break; - case 'k': - defconfig[KioskMode].val.i = 0; - defconfig[KioskMode].prio = 2; - break; - case 'K': - defconfig[KioskMode].val.i = 1; - defconfig[KioskMode].prio = 2; - break; - case 'm': - defconfig[Style].val.i = 0; - defconfig[Style].prio = 2; - break; - case 'M': - defconfig[Style].val.i = 1; - defconfig[Style].prio = 2; - break; - case 'n': - defconfig[Inspector].val.i = 0; - defconfig[Inspector].prio = 2; - break; - case 'N': - defconfig[Inspector].val.i = 1; - defconfig[Inspector].prio = 2; - break; - case 'r': - scriptfile = EARGF(usage()); - break; - case 's': - defconfig[JavaScript].val.i = 0; - defconfig[JavaScript].prio = 2; - break; - case 'S': - defconfig[JavaScript].val.i = 1; - defconfig[JavaScript].prio = 2; - break; - case 't': - defconfig[StrictTLS].val.i = 0; - defconfig[StrictTLS].prio = 2; - break; - case 'T': - defconfig[StrictTLS].val.i = 1; - defconfig[StrictTLS].prio = 2; - break; - case 'u': - fulluseragent = EARGF(usage()); - break; - case 'v': - die("surf-"VERSION", see LICENSE for © details\n"); - case 'w': - showxid = 1; - break; - case 'x': - defconfig[Certificate].val.i = 0; - defconfig[Certificate].prio = 2; - break; - case 'X': - defconfig[Certificate].val.i = 1; - defconfig[Certificate].prio = 2; - break; - case 'z': - defconfig[ZoomLevel].val.f = strtof(EARGF(usage()), NULL); - defconfig[ZoomLevel].prio = 2; - break; - default: - usage(); - } ARGEND; - if (argc > 0) - arg.v = argv[0]; - else - arg.v = "about:blank"; - - setup(); - c = newclient(NULL); - showview(NULL, c); - - loaduri(c, &arg); - updatetitle(c); - - gtk_main(); - cleanup(); - - return 0; -} diff --git a/dwm/surf/surf.o b/dwm/surf/surf.o deleted file mode 100644 index 07f7c95..0000000 Binary files a/dwm/surf/surf.o and /dev/null differ diff --git a/dwm/surf/surf.png b/dwm/surf/surf.png deleted file mode 100644 index f5b2ab1..0000000 Binary files a/dwm/surf/surf.png and /dev/null differ diff --git a/dwm/surf/webext-surf.c b/dwm/surf/webext-surf.c deleted file mode 100644 index 7063fa7..0000000 --- a/dwm/surf/webext-surf.c +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "common.h" - -#define LENGTH(x) (sizeof(x) / sizeof(x[0])) - -static WebKitWebExtension *webext; -static int sock; - -/* - * Return: - * 0 No data processed: need more data - * > 0 Amount of data processed or discarded - */ -static size_t -evalmsg(char *msg, size_t sz) -{ - char js[48]; - WebKitWebPage *page; - JSCContext *jsc; - JSCValue *jsv; - - if (!(page = webkit_web_extension_get_page(webext, msg[0]))) - return sz; - - if (sz < 2) - return 0; - - jsc = webkit_frame_get_js_context(webkit_web_page_get_main_frame(page)); - jsv = NULL; - - switch (msg[1]) { - case 'h': - if (sz < 3) { - sz = 0; - break; - } - sz = 3; - snprintf(js, sizeof(js), - "window.scrollBy(window.innerWidth/100*%hhd,0);", - msg[2]); - jsv = jsc_context_evaluate(jsc, js, -1); - break; - case 'v': - if (sz < 3) { - sz = 0; - break; - } - sz = 3; - snprintf(js, sizeof(js), - "window.scrollBy(0,window.innerHeight/100*%hhd);", - msg[2]); - jsv = jsc_context_evaluate(jsc, js, -1); - break; - default: - fprintf(stderr, "%s:%d:evalmsg: unknown cmd(%zu): '%#x'\n", - __FILE__, __LINE__, sz, msg[1]); - } - - g_object_unref(jsc); - if (jsv) - g_object_unref(jsv); - - return sz; -} - -static gboolean -readsock(GIOChannel *s, GIOCondition c, gpointer unused) -{ - static char msg[MSGBUFSZ]; - static size_t msgoff; - GError *gerr = NULL; - size_t sz; - gsize rsz; - - if (g_io_channel_read_chars(s, msg+msgoff, sizeof(msg)-msgoff, &rsz, &gerr) != - G_IO_STATUS_NORMAL) { - if (gerr) { - fprintf(stderr, "webext: error reading socket: %s\n", - gerr->message); - g_error_free(gerr); - } - return TRUE; - } - if (msgoff >= sizeof(msg)) { - fprintf(stderr, "%s:%d:%s: msgoff: %zu", __FILE__, __LINE__, __func__, msgoff); - return FALSE; - } - - for (rsz += msgoff; rsz; rsz -= sz) { - sz = evalmsg(msg, rsz); - if (sz == 0) { - /* need more data */ - break; - } - if (sz != rsz) { - /* continue processing message */ - memmove(msg, msg+sz, rsz-sz); - } - } - msgoff = rsz; - - return TRUE; -} - -static void -pageusermessagereply(GObject *o, GAsyncResult *r, gpointer page) -{ - WebKitUserMessage *m; - GUnixFDList *gfd; - GIOChannel *gchansock; - const char *name; - int nfd; - - m = webkit_web_page_send_message_to_view_finish(page, r, NULL); - name = webkit_user_message_get_name(m); - if (strcmp(name, "surf-pipe") != 0) { - fprintf(stderr, "webext-surf: Unknown User Reply: %s\n", name); - return; - } - - gfd = webkit_user_message_get_fd_list(m); - if ((nfd = g_unix_fd_list_get_length(gfd)) != 1) { - fprintf(stderr, "webext-surf: Too many file-descriptors: %d\n", nfd); - return; - } - - sock = g_unix_fd_list_get(gfd, 0, NULL); - - gchansock = g_io_channel_unix_new(sock); - g_io_channel_set_encoding(gchansock, NULL, NULL); - g_io_channel_set_flags(gchansock, g_io_channel_get_flags(gchansock) - | G_IO_FLAG_NONBLOCK, NULL); - g_io_channel_set_close_on_unref(gchansock, TRUE); - g_io_add_watch(gchansock, G_IO_IN, readsock, NULL); -} - -void -pagecreated(WebKitWebExtension *e, WebKitWebPage *p, gpointer unused) -{ - WebKitUserMessage *msg; - - msg = webkit_user_message_new("page-created", NULL); - webkit_web_page_send_message_to_view(p, msg, NULL, pageusermessagereply, p); -} - -G_MODULE_EXPORT void -webkit_web_extension_initialize(WebKitWebExtension *e) -{ - webext = e; - - g_signal_connect(G_OBJECT(e), "page-created", - G_CALLBACK(pagecreated), NULL); -} diff --git a/dwm/surf/webext-surf.o b/dwm/surf/webext-surf.o deleted file mode 100644 index b691525..0000000 Binary files a/dwm/surf/webext-surf.o and /dev/null differ diff --git a/dwm/surf/webext-surf.so b/dwm/surf/webext-surf.so deleted file mode 100755 index 8a38856..0000000 Binary files a/dwm/surf/webext-surf.so and /dev/null differ diff --git a/eww/eww.scss b/eww/eww.scss deleted file mode 100644 index 23841ba..0000000 --- a/eww/eww.scss +++ /dev/null @@ -1,75 +0,0 @@ -/** Global *******************************************/ -*{ - all: unset; - font-family: feather; - font-family: Iosevka; -} - -/** Background ***************************************/ -.bg { - // background-image: url("images/bg.png"); - background-color: #474D59; - opacity: 1; -} - -/** Generic window ***********************************/ -.genwin { - background-color: #2E3440; - border-radius: 16px; -} - -/** Music ***************************************/ -.album_art { - background-size: 240px; - min-height: 240px; - min-width: 240px; - margin: 20px; - border-radius: 14px; -} - -.song { - color: #8FBCBB; - font-size : 24px; - font-weight : bold; - margin : 40px 0px 0px 0px; -} - -.artist { - color: #EBCB8B; - font-size : 16px; - font-weight : normal; - margin : 0px 0px 15px 0px; -} - -.btn_prev, .btn_play, .btn_next { - font-family: Iosevka Nerd Font; -} -.btn_prev { - color: #EBCB8B; - font-size : 32px; - font-weight : normal; -} -.btn_play { - color: #A3BE8C; - font-size : 48px; - font-weight : bold; -} -.btn_next { - color: #EBCB8B; - font-size : 32px; - font-weight : normal; -} - -.music_bar scale trough highlight { - all: unset; - background-color: #B48EAD; - border-radius: 8px; -} -.music_bar scale trough { - all: unset; - background-color: #3A404C; - border-radius: 8px; - min-height: 20px; - min-width: 310px; - margin : 10px 0px 0px 0px; -} diff --git a/eww/eww.yuck b/eww/eww.yuck deleted file mode 100644 index a6e29a2..0000000 --- a/eww/eww.yuck +++ /dev/null @@ -1,37 +0,0 @@ -; Music vars -(deflisten music_metadata "scripts/music listen-metadata") -(deflisten music_position "scripts/music listen-position") -(deflisten music_status "scripts/music listen-status") - -; Music -(defwidget music [] - (box :class "genwin" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" - (box :class "album_art" :vexpand "false" :hexpand "false" :style "background-image: url('${music_metadata.arturl}');") - (box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" - (label :halign "center" :class "song" :wrap "true" :limit-width 20 :text "${music_metadata.title}") - (label :halign "center" :class "artist" :wrap "true" :limit-width 15 :text "${music_metadata.artist}") - (box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false" - (button :class "btn_prev" :onclick "playerctl previous" "") - (button :class "btn_play" :onclick "playerctl play-pause" {"${music_status.status}" == "Playing" ? "" : ""}) - (button :class "btn_next" :onclick "playerctl next" "") - ) - (box :class "music_bar" :halign "center" :state "progress" - (scale - :onscroll "playerctl position {}" - :onclick "playerctl position {}" - :min 0 - :max "${music_metadata.length}" - :active true - :hexpand true - :vexpand true - :value "${music_position.position}" - ) - ) - ) - ) -) - -; music -(defwindow music :stacking "fg" :focusable "false" :screen 1 :monitor 0 - :geometry (geometry :x 100 :y 100 :width 610 :height 280) - (music)) diff --git a/eww/scripts/music b/eww/scripts/music deleted file mode 100755 index d4488f4..0000000 --- a/eww/scripts/music +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -listen_metadata() { - fmt="\"artist\":\"{{artist}}\",\"title\":\"{{title}}\",\"album\":\"{{album}}\"" - fmt="$fmt,\"arturl\":\"{{mpris:artUrl}}\",\"length\":\"{{mpris:length}}\"" - fmt="$fmt,\"duration\":\"{{duration(mpris:length)}}\"" - playerctl --follow metadata --format "{$fmt}" | while read -r info; do - artist=$(echo -e $info | jq -r ".artist") - title=$(echo -e $info | jq -r ".title") - url=$(echo -e $info | jq -r ".arturl") - # cover=$(cover_art "$url") - # lyrics=$(lyrics_lines "$artist" "$title") - echo $info | jq -cr ". + {\"cover\":\"$cover\",\"lyrics\":\"$lyrics\"}" - done -} - -listen_position() { - fmt="{\"position\":\"{{position}}\",\"time\":\"{{duration(position)}}\"}" - playerctl --follow position --format "$fmt" -} - -listen_status() { - playerctl --follow status | while read -r playstatus; do - if [[ $playstatus != "Playing" ]]; then - icon="" - else - icon="" - fi - echo "{\"status\":\"$playstatus\",\"icon\":\"$icon\"}" - done -} - -case "$1" in - "listen-metadata") - listen_metadata - ;; - "listen-position") - listen_position - ;; - "listen-status") - listen_status - ;; -esac diff --git a/eww/toggle_music b/eww/toggle_music deleted file mode 100755 index bf3a477..0000000 --- a/eww/toggle_music +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if [ ! -f ~/.eww_music ]; then - eww --config ~/dotfiles/eww open music - echo $! > ~/.eww_music -else - eww --config ~/dotfiles/eww close music - rm ~/.eww_music -fi diff --git a/eww/weather/eww.scss b/eww/weather/eww.scss deleted file mode 100644 index 6e21aa7..0000000 --- a/eww/weather/eww.scss +++ /dev/null @@ -1,48 +0,0 @@ -/** Global *******************************************/ -*{ - all: unset; - font-family: feather; - font-family: Iosevka; -} - -/** Background ***************************************/ -.bg { - // background-image: url("images/bg.png"); - background-color: #474D59; - opacity: 1; -} - -/** Generic window ***********************************/ -.genwin { - background-color: #2E3440; - border-radius: 16px; - padding: 20px; -} - -.label_temp { - font-size: 100; - color: white; - background-color: black; - padding: 10; - border-radius: 16; -} - -.label_stat { - padding: 10; - border-radius: 16; - font-size: 50; - color: white; - background-color: black; -} - -.areabox { - background-color: black; - border-radius: 16; -} - -.label_quote { - color: white; - background-color: black; - padding: 10; - border-radius: 16; -} diff --git a/eww/weather/eww.yuck b/eww/weather/eww.yuck deleted file mode 100644 index 0d25ba3..0000000 --- a/eww/weather/eww.yuck +++ /dev/null @@ -1,32 +0,0 @@ -; Weather data -(defpoll weatherdata :interval "15m" `wttr/wttr.py`) - -(defwidget weather [] - (box :class "genwin" :style "background-image: url('${weatherdata.current_condition[0].weatherCode}');background-size: cover;" - (box :orientation "v" :spacing 10 :space-evenly false :vexpand false :hexpand false - (box :orientation "h" :spacing 0 :vexpand false :hexpand false - (label :class "label_temp" :halign "center" :text "${weatherdata.current_condition[0].temp_C}") - ) - (box :orientation "v" :spacing 10 :halign "center" :space-evenly false :vexpand false :hexpand false - (label :class "label_stat" :text "${weatherdata.current_condition[0].weatherDesc[0].value}") - (box - :class "areabox" - :orientation "h" - :spacing 10 - :space-evenly false - :vexpand false - :hexpand false - :halign "center" - (label :class "label_quote" :text "${weatherdata.nearest_area[0].country[0].value}") - (label :class "label_quote" :text "${weatherdata.nearest_area[0].region[0].value}") - ) - ) - ) - ) -) - -; Weather window -(defwindow weather :stacking "bg" :focusable true :exclusive true :screen 1 :windowtype "dock" - :geometry (geometry :x 100 :y 100 :width 610 :height 280) - (weather) -) diff --git a/eww/weather/images/113.jpg b/eww/weather/images/113.jpg deleted file mode 100644 index c52e76c..0000000 Binary files a/eww/weather/images/113.jpg and /dev/null differ diff --git a/eww/weather/images/116.jpeg b/eww/weather/images/116.jpeg deleted file mode 100644 index 91cd3a6..0000000 Binary files a/eww/weather/images/116.jpeg and /dev/null differ diff --git a/eww/weather/images/119.jpeg b/eww/weather/images/119.jpeg deleted file mode 100644 index f5ee625..0000000 Binary files a/eww/weather/images/119.jpeg and /dev/null differ diff --git a/eww/weather/images/143.jpg b/eww/weather/images/143.jpg deleted file mode 100644 index 15f14da..0000000 Binary files a/eww/weather/images/143.jpg and /dev/null differ diff --git a/eww/weather/images/176.jpeg b/eww/weather/images/176.jpeg deleted file mode 100644 index 30d79bc..0000000 Binary files a/eww/weather/images/176.jpeg and /dev/null differ diff --git a/eww/weather/images/bg.png b/eww/weather/images/bg.png deleted file mode 100644 index 4a9b899..0000000 Binary files a/eww/weather/images/bg.png and /dev/null differ diff --git a/eww/weather/images/bidstorm.jpeg b/eww/weather/images/bidstorm.jpeg deleted file mode 100644 index beb3330..0000000 Binary files a/eww/weather/images/bidstorm.jpeg and /dev/null differ diff --git a/eww/weather/images/cold.jpeg b/eww/weather/images/cold.jpeg deleted file mode 100644 index d39a8d2..0000000 Binary files a/eww/weather/images/cold.jpeg and /dev/null differ diff --git a/eww/weather/images/rain.jpeg b/eww/weather/images/rain.jpeg deleted file mode 100644 index 23f45f6..0000000 Binary files a/eww/weather/images/rain.jpeg and /dev/null differ diff --git a/eww/weather/images/snow.jpeg b/eww/weather/images/snow.jpeg deleted file mode 100644 index a7834ce..0000000 Binary files a/eww/weather/images/snow.jpeg and /dev/null differ diff --git a/eww/weather/images/storm.jpeg b/eww/weather/images/storm.jpeg deleted file mode 100644 index 9e8f09f..0000000 Binary files a/eww/weather/images/storm.jpeg and /dev/null differ diff --git a/eww/weather/wttr.json b/eww/weather/wttr.json deleted file mode 100644 index 4fb9a29..0000000 --- a/eww/weather/wttr.json +++ /dev/null @@ -1,1146 +0,0 @@ -{ - "current_condition": [ - { - "FeelsLikeC": "8", - "FeelsLikeF": "47", - "cloudcover": "77", - "humidity": "88", - "localObsDateTime": "2024-09-03 09:00 AM", - "observation_time": "02:00 AM", - "precipInches": "0.0", - "precipMM": "0.1", - "pressure": "1008", - "pressureInches": "30", - "temp_C": "10", - "temp_F": "50", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "W", - "winddirDegree": "268", - "windspeedKmph": "14", - "windspeedMiles": "9" - } - ], - "nearest_area": [ - { - "areaName": [{ "value": "Томск" }], - "country": [{ "value": "Russia" }], - "latitude": "56.500", - "longitude": "84.967", - "population": "485519", - "region": [{ "value": "Tomsk" }], - "weatherUrl": [{ "value": "" }] - } - ], - "request": [{ "query": "Lat 56.49 and Lon 84.95", "type": "LatLon" }], - "weather": [ - { - "astronomy": [ - { - "moon_illumination": "0", - "moon_phase": "Waxing Crescent", - "moonrise": "06:17 AM", - "moonset": "08:22 PM", - "sunrise": "06:27 AM", - "sunset": "08:10 PM" - } - ], - "avgtempC": "9", - "avgtempF": "48", - "date": "2024-09-03", - "hourly": [ - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "5", - "FeelsLikeF": "41", - "HeatIndexC": "8", - "HeatIndexF": "46", - "WindChillC": "5", - "WindChillF": "41", - "WindGustKmph": "31", - "WindGustMiles": "19", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "90", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "0.0", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.6", - "pressure": "1005", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "8", - "tempF": "46", - "time": "0", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [{ "value": "Light drizzle" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "SSW", - "winddirDegree": "192", - "windspeedKmph": "20", - "windspeedMiles": "12" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "22", - "WindGustMiles": "14", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "92", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "1.5", - "humidity": "99", - "precipInches": "0.0", - "precipMM": "0.3", - "pressure": "1004", - "pressureInches": "30", - "shortRad": "1.9", - "tempC": "9", - "tempF": "48", - "time": "300", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "266", - "weatherDesc": [{ "value": "Light drizzle" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "SW", - "winddirDegree": "233", - "windspeedKmph": "14", - "windspeedMiles": "9" - }, - { - "DewPointC": "9", - "DewPointF": "48", - "FeelsLikeC": "8", - "FeelsLikeF": "47", - "HeatIndexC": "10", - "HeatIndexF": "51", - "WindChillC": "8", - "WindChillF": "47", - "WindGustKmph": "20", - "WindGustMiles": "13", - "chanceoffog": "7", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "88", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "22.1", - "humidity": "92", - "precipInches": "0.0", - "precipMM": "0.2", - "pressure": "1006", - "pressureInches": "30", - "shortRad": "38.6", - "tempC": "10", - "tempF": "51", - "time": "600", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [{ "value": "Light rain shower" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "W", - "winddirDegree": "280", - "windspeedKmph": "15", - "windspeedMiles": "9" - }, - { - "DewPointC": "9", - "DewPointF": "47", - "FeelsLikeC": "9", - "FeelsLikeF": "48", - "HeatIndexC": "11", - "HeatIndexF": "51", - "WindChillC": "9", - "WindChillF": "48", - "WindGustKmph": "22", - "WindGustMiles": "13", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "81", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "84", - "diffRad": "100.4", - "humidity": "86", - "precipInches": "0.0", - "precipMM": "0.1", - "pressure": "1008", - "pressureInches": "30", - "shortRad": "176.4", - "tempC": "11", - "tempF": "51", - "time": "900", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "W", - "winddirDegree": "276", - "windspeedKmph": "15", - "windspeedMiles": "10" - }, - { - "DewPointC": "8", - "DewPointF": "47", - "FeelsLikeC": "9", - "FeelsLikeF": "49", - "HeatIndexC": "11", - "HeatIndexF": "51", - "WindChillC": "9", - "WindChillF": "49", - "WindGustKmph": "17", - "WindGustMiles": "11", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "86", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "84", - "diffRad": "90.4", - "humidity": "85", - "precipInches": "0.0", - "precipMM": "0.2", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "160.4", - "tempC": "11", - "tempF": "51", - "time": "1200", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "353", - "weatherDesc": [{ "value": "Light rain shower" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "W", - "winddirDegree": "262", - "windspeedKmph": "12", - "windspeedMiles": "7" - }, - { - "DewPointC": "8", - "DewPointF": "47", - "FeelsLikeC": "8", - "FeelsLikeF": "47", - "HeatIndexC": "9", - "HeatIndexF": "49", - "WindChillC": "8", - "WindChillF": "47", - "WindGustKmph": "15", - "WindGustMiles": "9", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "81", - "chanceofrain": "71", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "7.1", - "humidity": "92", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "13.3", - "tempC": "9", - "tempF": "49", - "time": "1500", - "uvIndex": "2", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "SW", - "winddirDegree": "225", - "windspeedKmph": "9", - "windspeedMiles": "5" - }, - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "7", - "FeelsLikeF": "44", - "HeatIndexC": "8", - "HeatIndexF": "46", - "WindChillC": "7", - "WindChillF": "44", - "WindGustKmph": "12", - "WindGustMiles": "7", - "chanceoffog": "2", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "90", - "chanceofrain": "0", - "chanceofremdry": "93", - "chanceofsnow": "0", - "chanceofsunshine": "17", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "1.8", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "3.3", - "tempC": "8", - "tempF": "46", - "time": "1800", - "uvIndex": "2", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "SW", - "winddirDegree": "226", - "windspeedKmph": "6", - "windspeedMiles": "4" - }, - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "8", - "FeelsLikeF": "46", - "HeatIndexC": "8", - "HeatIndexF": "46", - "WindChillC": "8", - "WindChillF": "46", - "WindGustKmph": "3", - "WindGustMiles": "2", - "chanceoffog": "41", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "94", - "chanceofrain": "0", - "chanceofremdry": "92", - "chanceofsnow": "0", - "chanceofsunshine": "13", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "90", - "diffRad": "0.0", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "8", - "tempF": "46", - "time": "2100", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "WSW", - "winddirDegree": "244", - "windspeedKmph": "1", - "windspeedMiles": "1" - } - ], - "maxtempC": "11", - "maxtempF": "52", - "mintempC": "7", - "mintempF": "44", - "sunHour": "10.5", - "totalSnow_cm": "0.0", - "uvIndex": "1" - }, - { - "astronomy": [ - { - "moon_illumination": "1", - "moon_phase": "Waxing Crescent", - "moonrise": "07:35 AM", - "moonset": "08:26 PM", - "sunrise": "06:29 AM", - "sunset": "08:07 PM" - } - ], - "avgtempC": "9", - "avgtempF": "49", - "date": "2024-09-04", - "hourly": [ - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "6", - "HeatIndexF": "44", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "9", - "WindGustMiles": "6", - "chanceoffog": "16", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "86", - "chanceofrain": "0", - "chanceofremdry": "86", - "chanceofsnow": "0", - "chanceofsunshine": "17", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "66", - "diffRad": "0.0", - "humidity": "97", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "6", - "tempF": "44", - "time": "0", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "ENE", - "winddirDegree": "60", - "windspeedKmph": "5", - "windspeedMiles": "3" - }, - { - "DewPointC": "6", - "DewPointF": "44", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "7", - "HeatIndexF": "45", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "11", - "WindGustMiles": "7", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "81", - "chanceofrain": "0", - "chanceofremdry": "91", - "chanceofsnow": "0", - "chanceofsunshine": "19", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "50", - "diffRad": "28.3", - "humidity": "95", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "57.6", - "tempC": "7", - "tempF": "45", - "time": "300", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "37", - "windspeedKmph": "6", - "windspeedMiles": "4" - }, - { - "DewPointC": "7", - "DewPointF": "45", - "FeelsLikeC": "10", - "FeelsLikeF": "51", - "HeatIndexC": "12", - "HeatIndexF": "53", - "WindChillC": "10", - "WindChillF": "51", - "WindGustKmph": "12", - "WindGustMiles": "7", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "85", - "chanceofrain": "0", - "chanceofremdry": "85", - "chanceofsnow": "0", - "chanceofsunshine": "10", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "74", - "diffRad": "94.1", - "humidity": "74", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "242.7", - "tempC": "12", - "tempF": "53", - "time": "600", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "119", - "weatherDesc": [{ "value": "Cloudy " }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NNE", - "winddirDegree": "30", - "windspeedKmph": "10", - "windspeedMiles": "6" - }, - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "13", - "FeelsLikeF": "55", - "HeatIndexC": "14", - "HeatIndexF": "57", - "WindChillC": "13", - "WindChillF": "55", - "WindGustKmph": "14", - "WindGustMiles": "9", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "81", - "chanceofrain": "100", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "100", - "diffRad": "181.7", - "humidity": "59", - "precipInches": "0.0", - "precipMM": "0.1", - "pressure": "1009", - "pressureInches": "30", - "shortRad": "463.6", - "tempC": "14", - "tempF": "57", - "time": "900", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "N", - "winddirDegree": "358", - "windspeedKmph": "12", - "windspeedMiles": "7" - }, - { - "DewPointC": "5", - "DewPointF": "41", - "FeelsLikeC": "11", - "FeelsLikeF": "52", - "HeatIndexC": "13", - "HeatIndexF": "55", - "WindChillC": "11", - "WindChillF": "52", - "WindGustKmph": "17", - "WindGustMiles": "11", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "80", - "chanceofrain": "0", - "chanceofremdry": "83", - "chanceofsnow": "0", - "chanceofsunshine": "19", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "92", - "diffRad": "153.0", - "humidity": "60", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "327.8", - "tempC": "13", - "tempF": "55", - "time": "1200", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "122", - "weatherDesc": [{ "value": "Overcast " }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "N", - "winddirDegree": "352", - "windspeedKmph": "13", - "windspeedMiles": "8" - }, - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "8", - "FeelsLikeF": "46", - "HeatIndexC": "9", - "HeatIndexF": "48", - "WindChillC": "8", - "WindChillF": "46", - "WindGustKmph": "15", - "WindGustMiles": "9", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "82", - "chanceofrain": "62", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "82", - "diffRad": "14.3", - "humidity": "81", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1012", - "pressureInches": "30", - "shortRad": "29.1", - "tempC": "9", - "tempF": "48", - "time": "1500", - "uvIndex": "2", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "N", - "winddirDegree": "357", - "windspeedKmph": "8", - "windspeedMiles": "5" - }, - { - "DewPointC": "6", - "DewPointF": "42", - "FeelsLikeC": "5", - "FeelsLikeF": "41", - "HeatIndexC": "6", - "HeatIndexF": "43", - "WindChillC": "5", - "WindChillF": "41", - "WindGustKmph": "13", - "WindGustMiles": "8", - "chanceoffog": "7", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "83", - "chanceofrain": "0", - "chanceofremdry": "93", - "chanceofsnow": "0", - "chanceofsunshine": "6", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "34", - "diffRad": "3.6", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1014", - "pressureInches": "30", - "shortRad": "7.3", - "tempC": "6", - "tempF": "43", - "time": "1800", - "uvIndex": "2", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "N", - "winddirDegree": "4", - "windspeedKmph": "6", - "windspeedMiles": "4" - }, - { - "DewPointC": "6", - "DewPointF": "42", - "FeelsLikeC": "5", - "FeelsLikeF": "42", - "HeatIndexC": "6", - "HeatIndexF": "43", - "WindChillC": "5", - "WindChillF": "42", - "WindGustKmph": "10", - "WindGustMiles": "6", - "chanceoffog": "20", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "82", - "chanceofrain": "0", - "chanceofremdry": "93", - "chanceofsnow": "0", - "chanceofsunshine": "10", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "68", - "diffRad": "0.0", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1014", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "6", - "tempF": "43", - "time": "2100", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "N", - "winddirDegree": "3", - "windspeedKmph": "5", - "windspeedMiles": "3" - } - ], - "maxtempC": "14", - "maxtempF": "57", - "mintempC": "6", - "mintempF": "43", - "sunHour": "11.3", - "totalSnow_cm": "0.0", - "uvIndex": "3" - }, - { - "astronomy": [ - { - "moon_illumination": "3", - "moon_phase": "Waxing Crescent", - "moonrise": "08:50 AM", - "moonset": "08:29 PM", - "sunrise": "06:31 AM", - "sunset": "08:04 PM" - } - ], - "avgtempC": "10", - "avgtempF": "49", - "date": "2024-09-05", - "hourly": [ - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "7", - "HeatIndexF": "44", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "10", - "WindGustMiles": "6", - "chanceoffog": "22", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "0", - "chanceofremdry": "84", - "chanceofsnow": "0", - "chanceofsunshine": "18", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "67", - "diffRad": "0.0", - "humidity": "96", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1014", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "7", - "tempF": "44", - "time": "0", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NNE", - "winddirDegree": "14", - "windspeedKmph": "6", - "windspeedMiles": "4" - }, - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "6", - "FeelsLikeF": "43", - "HeatIndexC": "8", - "HeatIndexF": "46", - "WindChillC": "6", - "WindChillF": "43", - "WindGustKmph": "11", - "WindGustMiles": "7", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "44", - "chanceofrain": "0", - "chanceofremdry": "90", - "chanceofsnow": "0", - "chanceofsunshine": "71", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "55", - "diffRad": "26.2", - "humidity": "92", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1014", - "pressureInches": "30", - "shortRad": "55.5", - "tempC": "8", - "tempF": "46", - "time": "300", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "116", - "weatherDesc": [{ "value": "Partly Cloudy " }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NNE", - "winddirDegree": "23", - "windspeedKmph": "8", - "windspeedMiles": "5" - }, - { - "DewPointC": "6", - "DewPointF": "43", - "FeelsLikeC": "11", - "FeelsLikeF": "51", - "HeatIndexC": "12", - "HeatIndexF": "53", - "WindChillC": "11", - "WindChillF": "51", - "WindGustKmph": "13", - "WindGustMiles": "8", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "86", - "chanceofrain": "68", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "82", - "diffRad": "82.4", - "humidity": "67", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1013", - "pressureInches": "30", - "shortRad": "256.5", - "tempC": "12", - "tempF": "53", - "time": "600", - "uvIndex": "1", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "37", - "windspeedKmph": "12", - "windspeedMiles": "7" - }, - { - "DewPointC": "5", - "DewPointF": "41", - "FeelsLikeC": "13", - "FeelsLikeF": "55", - "HeatIndexC": "14", - "HeatIndexF": "57", - "WindChillC": "13", - "WindChillF": "55", - "WindGustKmph": "15", - "WindGustMiles": "9", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "83", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "93", - "diffRad": "163.1", - "humidity": "54", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1012", - "pressureInches": "30", - "shortRad": "453.8", - "tempC": "14", - "tempF": "57", - "time": "900", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "49", - "windspeedKmph": "13", - "windspeedMiles": "8" - }, - { - "DewPointC": "6", - "DewPointF": "44", - "FeelsLikeC": "12", - "FeelsLikeF": "54", - "HeatIndexC": "13", - "HeatIndexF": "55", - "WindChillC": "12", - "WindChillF": "54", - "WindGustKmph": "14", - "WindGustMiles": "8", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "93", - "chanceofrain": "67", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "69", - "diffRad": "100.0", - "humidity": "64", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1012", - "pressureInches": "30", - "shortRad": "219.3", - "tempC": "13", - "tempF": "55", - "time": "1200", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "42", - "windspeedKmph": "9", - "windspeedMiles": "6" - }, - { - "DewPointC": "7", - "DewPointF": "44", - "FeelsLikeC": "9", - "FeelsLikeF": "49", - "HeatIndexC": "11", - "HeatIndexF": "51", - "WindChillC": "9", - "WindChillF": "49", - "WindGustKmph": "19", - "WindGustMiles": "12", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "91", - "chanceofrain": "81", - "chanceofremdry": "0", - "chanceofsnow": "0", - "chanceofsunshine": "0", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "51", - "diffRad": "8.8", - "humidity": "76", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1012", - "pressureInches": "30", - "shortRad": "16.7", - "tempC": "11", - "tempF": "51", - "time": "1500", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "176", - "weatherDesc": [{ "value": "Patchy rain nearby" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NNE", - "winddirDegree": "33", - "windspeedKmph": "11", - "windspeedMiles": "7" - }, - { - "DewPointC": "5", - "DewPointF": "42", - "FeelsLikeC": "5", - "FeelsLikeF": "41", - "HeatIndexC": "7", - "HeatIndexF": "44", - "WindChillC": "5", - "WindChillF": "41", - "WindGustKmph": "20", - "WindGustMiles": "13", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "37", - "chanceofrain": "0", - "chanceofremdry": "94", - "chanceofsnow": "0", - "chanceofsunshine": "88", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "36", - "diffRad": "2.2", - "humidity": "90", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1012", - "pressureInches": "30", - "shortRad": "4.2", - "tempC": "7", - "tempF": "44", - "time": "1800", - "uvIndex": "3", - "visibility": "10", - "visibilityMiles": "6", - "weatherCode": "116", - "weatherDesc": [{ "value": "Partly Cloudy " }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "38", - "windspeedKmph": "10", - "windspeedMiles": "6" - }, - { - "DewPointC": "5", - "DewPointF": "41", - "FeelsLikeC": "3", - "FeelsLikeF": "38", - "HeatIndexC": "6", - "HeatIndexF": "42", - "WindChillC": "3", - "WindChillF": "38", - "WindGustKmph": "22", - "WindGustMiles": "14", - "chanceoffog": "0", - "chanceoffrost": "0", - "chanceofhightemp": "0", - "chanceofovercast": "89", - "chanceofrain": "0", - "chanceofremdry": "82", - "chanceofsnow": "0", - "chanceofsunshine": "11", - "chanceofthunder": "0", - "chanceofwindy": "0", - "cloudcover": "16", - "diffRad": "0.0", - "humidity": "95", - "precipInches": "0.0", - "precipMM": "0.0", - "pressure": "1011", - "pressureInches": "30", - "shortRad": "0.0", - "tempC": "6", - "tempF": "42", - "time": "2100", - "uvIndex": "1", - "visibility": "2", - "visibilityMiles": "1", - "weatherCode": "143", - "weatherDesc": [{ "value": "Mist" }], - "weatherIconUrl": [{ "value": "" }], - "winddir16Point": "NE", - "winddirDegree": "35", - "windspeedKmph": "10", - "windspeedMiles": "6" - } - ], - "maxtempC": "14", - "maxtempF": "57", - "mintempC": "6", - "mintempF": "42", - "sunHour": "12.0", - "totalSnow_cm": "0.0", - "uvIndex": "3" - } - ] -} diff --git a/eww/weather/wttr/wttr.py b/eww/weather/wttr/wttr.py deleted file mode 100755 index 723795e..0000000 --- a/eww/weather/wttr/wttr.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python - -import json -import requests -from datetime import datetime - -WEATHER_CODES = { - '113': 'images/113.jpg', - '116': 'images/116.jpeg', - '119': 'images/119.jpeg', - '122': 'images/119.jpeg', - '143': 'images/143.jpg', - '176': 'images/176.jpeg', - '179': 'images/rain.jpeg', - '182': 'images/rain.jpeg', - '185': 'images/rain.jpeg', - '200': 'images/storm.jpeg', - '227': 'images/snow.jpeg', - '230': 'images/cold.jpeg', - '248': 'images/143.jpg', - '260': 'images/143.jpg', - '263': 'images/176.jpeg', - '266': 'images/176.jpeg', - '281': 'images/rain.jpeg', - '284': 'images/rain.jpeg', - '293': 'images/176.jpeg', - '296': 'images/176.jpeg', - '299': 'images/rain.jpeg', - '302': 'images/rain.jpeg', - '305': 'images/rain.jpeg', - '308': 'images/rain.jpeg', - '311': 'images/rain.jpeg', - '314': 'images/rain.jpeg', - '317': 'images/rain.jpeg', - '320': 'images/snow.jpeg', - '323': 'images/snow.jpeg', - '326': 'images/snow.jpeg', - '329': 'images/cold.jpeg', - '332': 'images/cold.jpeg', - '335': 'images/cold.jpeg', - '338': 'images/cold.jpeg', - '350': 'images/rain.jpeg', - '353': 'images/176.jpeg', - '356': 'images/rain.jpeg', - '359': 'images/rain.jpeg', - '362': 'images/rain.jpeg', - '365': 'images/rain.jpeg', - '368': 'images/snow.jpeg', - '371': 'images/cold.jpeg', - '374': 'images/rain.jpeg', - '377': 'images/rain.jpeg', - '386': 'images/storm.jpeg', - '389': 'images/bigstorm.jpeg', - '392': 'images/storm.jpeg', - '395': 'images/cold.jpeg' -} - -data = {} - -weather = requests.get("https://wttr.in/Tomsk+Russia?format=j1").json() - -# data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ -# " "+weather['current_condition'][0]['FeelsLikeC']+"°" - -weather['current_condition'][0]['weatherCode'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] - -print(json.dumps(weather)) diff --git a/fastfetch/config.jsonc b/fastfetch/config.jsonc deleted file mode 100644 index a1f72a5..0000000 --- a/fastfetch/config.jsonc +++ /dev/null @@ -1,246 +0,0 @@ -{ - "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", - "display": { - "separator": " ─▶ " - }, - "logo": { - "source": "~/dotfiles/hypr/pictures/user.jpeg", - "width": 50, - "height": 22 - }, - "modules": [ - "title", - { - "type": "custom", - "format": "─────────" - }, - { - "type": "custom", - "format": "┌─────────── OS ──────────────┐" - }, - { - "type": "os", - "key": "├▶ ", - "keyColor": "bright_blue" - }, - { - "type": "host", - "key": "├▶ 󰍺 ", - "keyColor": "bright_blue" - }, - { - "type": "kernel", - "key": "├▶ ", - "keyColor": "bright_blue" - }, - { - "type": "uptime", - "key": "├▶ ", - "keyColor": "bright_blue" - }, - { - "type": "packages", - "key": "├▶ 󰏗", - "keyColor": "bright_blue" - }, - { - "type": "shell", - "key": "├▶ ", - "keyColor": "bright_blue" - }, - { - "type": "processes", - "key": "├▶ ", - "keyColor": "bright_blue" - }, - { - "type": "custom", - "format": "└─────────────────────────────┘" - }, - { - "type": "custom", - "format": "┌───────── GRAPHIC ─────────────┐" - }, - { - "type": "display", - "key": "├▶  ", - "keyColor": "green" - }, - "de", - { - "type": "wm", - "key": "├▶  ", - "keyColor": "green" - }, - { - "type": "wmtheme", - "key": "├▶  ", - "keyColor": "green" - }, - { - "type": "theme", - "key": "├▶  ", - "keyColor": "green" - }, - { - "type": "icons", - "key": "├▶  ", - "keyColor": "green" - }, - { - "type": "font", - "key": "├▶ ꬵ ", - "keyColor": "green" - }, - { - "type": "cursor", - "key": "├▶ ", - "keyColor": "green" - }, - { - "type": "terminal", - "key": "├▶  ", - "keyColor": "green" - }, - { - "type": "terminalfont", - "key": "├▶ tꬵ ", - "keyColor": "green" - }, - { - "type": "vulkan", - "key": "", - "keyColor": "green" - }, - { - "type": "opengl", - "key": "", - "keyColor": "green" - }, - { - "type": "opencl", - "key": "", - "keyColor": "green" - }, - { - "type": "custom", - "format": "└───────────────────────────────┘" - }, - { - "type": "custom", - "format": "┌───────── HARDWARE ─────────────┐" - }, - { - "type": "cpu", - "key": "├▶  ", - "keyColor": "red" - }, - { - "type": "gpu", - "key": "├▶  ", - "keyColor": "red" - }, - { - "type": "memory", - "key": "├▶  ", - "keyColor": "red" - }, - { - "type": "swap", - "key": "├▶ ", - "keyColor": "red" - }, - { - "type": "chassis", - "key": "├▶ ", - "keyColor": "red" - }, - { - "type": "board", - "key": "├▶ ", - "keyColor": "red" - }, - { - "type": "disk", - "key": "├▶  (/)", - "keyColor": "red" - }, - { - "type": "bios", - "key": "", - "keyColor": "red" - }, - { - "type": "custom", - "format": "└────────────────────────────────┘" - }, - { - "type": "custom", - "format": "┌────────── NET ──────────────┐" - }, - { - "type": "localip", - "key": "├▶  ", - "keyColor": "yellow" - }, - { - "type": "publicip", - "key": "├▶  ", - "keyColor": "yellow" - }, - { - "type": "custom", - "format": "└─────────────────────────────┘" - }, - "battery", - "poweradapter", - { - "type": "custom", - "format": "┌────────── LOCALE ──────────────┐" - }, - { - "type": "locale", - "key": "├▶  ", - "keyColor": "magenta" - }, - { - "type": "custom", - "format": "└────────────────────────────────┘" - }, - { - "type": "weather", - "key": "├▶ ", - "keyColor": "white" - }, - { - "type": "player", - "key": "", - "keyColor": "blue" - }, - { - "type": "custom", - "format": "┌─────────── IO ──────────────┐" - }, - { - "type": "netio", - "key": "", - "keyColor": "blue" - }, - { - "type": "diskio", - "key": "", - "keyColor": "bright_yellow" - }, - { - "type": "custom", - "format": "└─────────────────────────────┘" - }, - { - "type": "users", - "key": "├▶ ", - "keyColor": "white" - }, - "break", - "colors" - ] -} diff --git a/gitconfig b/gitconfig deleted file mode 100644 index f5d329b..0000000 --- a/gitconfig +++ /dev/null @@ -1,15 +0,0 @@ -[user] - name = TolaMironcenko - email = mironcenkotola@gmail.com - username = TolaMironcenko -[init] - defaultBranch = main -[alias] - a = add . - c = commit -m - cl = clone - ch = checkout - chb = checkout -b - s = status - ps = push - pl = pull diff --git a/greenclip/greenclip.toml b/greenclip/greenclip.toml deleted file mode 100644 index a2f324b..0000000 --- a/greenclip/greenclip.toml +++ /dev/null @@ -1,11 +0,0 @@ - -[greenclip] - blacklisted_applications = [] - enable_image_support = true - history_file = "/home/tola/.cache/greenclip.history" - image_cache_directory = "/tmp/greenclip" - max_history_length = 50 - max_selection_size_bytes = 0 - static_history = ["Greenclip has been updated to v4.1, update your new config file at ~/.config/greenclip.toml"] - trim_space_from_selection = true - use_primary_selection_as_input = false diff --git a/gtk-2.0/apps.rc b/gtk-2.0/apps.rc deleted file mode 100644 index 916acfd..0000000 --- a/gtk-2.0/apps.rc +++ /dev/null @@ -1,99 +0,0 @@ -# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et: -# -# This file, unlike hacks.rc, contains legitimate cases we need to handle, e.g. -# custom widgets, programs giving us a chance to alter their UI to fit more with -# the theme or stuff that is supposed to look different, like panels. - -# TODO: This could really look nicer -style "gimp_spin_scale" { - - # Spin background - bg[NORMAL] = @base_color - - engine "pixmap" { - - image { - function = BOX - state = NORMAL - detail = "spinbutton_up" - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_up" - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_up" - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_up" - overlay_file = "assets/spin-up-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = NORMAL - detail = "spinbutton_down" - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_down" - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_down" - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_down" - overlay_file = "assets/spin-down-insensitive.png" - overlay_stretch = FALSE - } - - } - -} - -style "chrome_gtk_frame" { - - ChromeGtkFrame::frame-color = @window_color - ChromeGtkFrame::frame-gradient-color = @window_color - ChromeGtkFrame::inactive-frame-color = @bg_color - - ChromeGtkFrame::incognito-frame-color = "#cbd2d9" - ChromeGtkFrame::incognito-frame-gradient-color = "#cbd2d9" - ChromeGtkFrame::incognito-inactive-frame-color = mix (0.5, @bg_color, "#cbd2d9") - -} - -# Disable spin button assets for GimpSpinScale -class "GimpSpinScale" style "gimp_spin_scale" - -# Chromium lets us define some colours and settings for better integration -class "ChromeGtkFrame" style "chrome_gtk_frame" diff --git a/gtk-2.0/assets/border.png b/gtk-2.0/assets/border.png deleted file mode 100644 index 489ca55..0000000 Binary files a/gtk-2.0/assets/border.png and /dev/null differ diff --git a/gtk-2.0/assets/button-active.png b/gtk-2.0/assets/button-active.png deleted file mode 100644 index d1a9562..0000000 Binary files a/gtk-2.0/assets/button-active.png and /dev/null differ diff --git a/gtk-2.0/assets/button-hover.png b/gtk-2.0/assets/button-hover.png deleted file mode 100644 index 4dd11ab..0000000 Binary files a/gtk-2.0/assets/button-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/button-insensitive.png b/gtk-2.0/assets/button-insensitive.png deleted file mode 100644 index 6d3f65c..0000000 Binary files a/gtk-2.0/assets/button-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/button.png b/gtk-2.0/assets/button.png deleted file mode 100644 index 6cbc4ec..0000000 Binary files a/gtk-2.0/assets/button.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-checked-active.png b/gtk-2.0/assets/checkbox-checked-active.png deleted file mode 100644 index 3df3847..0000000 Binary files a/gtk-2.0/assets/checkbox-checked-active.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-checked-hover.png b/gtk-2.0/assets/checkbox-checked-hover.png deleted file mode 100644 index 2d2a869..0000000 Binary files a/gtk-2.0/assets/checkbox-checked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-checked-insensitive.png b/gtk-2.0/assets/checkbox-checked-insensitive.png deleted file mode 100644 index 163316d..0000000 Binary files a/gtk-2.0/assets/checkbox-checked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-checked.png b/gtk-2.0/assets/checkbox-checked.png deleted file mode 100644 index 40a37ba..0000000 Binary files a/gtk-2.0/assets/checkbox-checked.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-mixed-active.png b/gtk-2.0/assets/checkbox-mixed-active.png deleted file mode 100644 index b21a05a..0000000 Binary files a/gtk-2.0/assets/checkbox-mixed-active.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-mixed-hover.png b/gtk-2.0/assets/checkbox-mixed-hover.png deleted file mode 100644 index f7cb735..0000000 Binary files a/gtk-2.0/assets/checkbox-mixed-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-mixed-insensitive.png b/gtk-2.0/assets/checkbox-mixed-insensitive.png deleted file mode 100644 index cd41027..0000000 Binary files a/gtk-2.0/assets/checkbox-mixed-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-mixed.png b/gtk-2.0/assets/checkbox-mixed.png deleted file mode 100644 index 8f34af4..0000000 Binary files a/gtk-2.0/assets/checkbox-mixed.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-unchecked-active.png b/gtk-2.0/assets/checkbox-unchecked-active.png deleted file mode 100644 index 1749400..0000000 Binary files a/gtk-2.0/assets/checkbox-unchecked-active.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-unchecked-hover.png b/gtk-2.0/assets/checkbox-unchecked-hover.png deleted file mode 100644 index cf12558..0000000 Binary files a/gtk-2.0/assets/checkbox-unchecked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-unchecked-insensitive.png b/gtk-2.0/assets/checkbox-unchecked-insensitive.png deleted file mode 100644 index 4820aa8..0000000 Binary files a/gtk-2.0/assets/checkbox-unchecked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/checkbox-unchecked.png b/gtk-2.0/assets/checkbox-unchecked.png deleted file mode 100644 index 4637aec..0000000 Binary files a/gtk-2.0/assets/checkbox-unchecked.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-button-active.png b/gtk-2.0/assets/combo-entry-ltr-button-active.png deleted file mode 100644 index 45dd7e1..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-button-active.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-button-hover.png b/gtk-2.0/assets/combo-entry-ltr-button-hover.png deleted file mode 100644 index 180423a..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-button-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-button-insensitive.png b/gtk-2.0/assets/combo-entry-ltr-button-insensitive.png deleted file mode 100644 index a204730..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-button-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-button.png b/gtk-2.0/assets/combo-entry-ltr-button.png deleted file mode 100644 index 09a2b67..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-button.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-entry-active.png b/gtk-2.0/assets/combo-entry-ltr-entry-active.png deleted file mode 100644 index fb9cc3a..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-entry-insensitive.png b/gtk-2.0/assets/combo-entry-ltr-entry-insensitive.png deleted file mode 100644 index dc4588f..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-ltr-entry.png b/gtk-2.0/assets/combo-entry-ltr-entry.png deleted file mode 100644 index 57b20d5..0000000 Binary files a/gtk-2.0/assets/combo-entry-ltr-entry.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-button-active.png b/gtk-2.0/assets/combo-entry-rtl-button-active.png deleted file mode 100644 index 92603de..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-button-active.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-button-hover.png b/gtk-2.0/assets/combo-entry-rtl-button-hover.png deleted file mode 100644 index 51a2f29..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-button-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-button-insensitive.png b/gtk-2.0/assets/combo-entry-rtl-button-insensitive.png deleted file mode 100644 index 58d4dcc..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-button-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-button.png b/gtk-2.0/assets/combo-entry-rtl-button.png deleted file mode 100644 index 235026f..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-button.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-entry-active.png b/gtk-2.0/assets/combo-entry-rtl-entry-active.png deleted file mode 100644 index 2c44348..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-entry-insensitive.png b/gtk-2.0/assets/combo-entry-rtl-entry-insensitive.png deleted file mode 100644 index 5870812..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/combo-entry-rtl-entry.png b/gtk-2.0/assets/combo-entry-rtl-entry.png deleted file mode 100644 index f7ab1ba..0000000 Binary files a/gtk-2.0/assets/combo-entry-rtl-entry.png and /dev/null differ diff --git a/gtk-2.0/assets/entry-active.png b/gtk-2.0/assets/entry-active.png deleted file mode 100644 index b024d4d..0000000 Binary files a/gtk-2.0/assets/entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/entry-background-insensitive.png b/gtk-2.0/assets/entry-background-insensitive.png deleted file mode 100644 index 2c33807..0000000 Binary files a/gtk-2.0/assets/entry-background-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/entry-background.png b/gtk-2.0/assets/entry-background.png deleted file mode 100644 index 59a57cf..0000000 Binary files a/gtk-2.0/assets/entry-background.png and /dev/null differ diff --git a/gtk-2.0/assets/entry-insensitive.png b/gtk-2.0/assets/entry-insensitive.png deleted file mode 100644 index db11e94..0000000 Binary files a/gtk-2.0/assets/entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/entry.png b/gtk-2.0/assets/entry.png deleted file mode 100644 index 7d26f51..0000000 Binary files a/gtk-2.0/assets/entry.png and /dev/null differ diff --git a/gtk-2.0/assets/focus.png b/gtk-2.0/assets/focus.png deleted file mode 100644 index 885a7a8..0000000 Binary files a/gtk-2.0/assets/focus.png and /dev/null differ diff --git a/gtk-2.0/assets/frame-inline.png b/gtk-2.0/assets/frame-inline.png deleted file mode 100644 index 19c189b..0000000 Binary files a/gtk-2.0/assets/frame-inline.png and /dev/null differ diff --git a/gtk-2.0/assets/frame-notebook.png b/gtk-2.0/assets/frame-notebook.png deleted file mode 100644 index f7b807e..0000000 Binary files a/gtk-2.0/assets/frame-notebook.png and /dev/null differ diff --git a/gtk-2.0/assets/frame.png b/gtk-2.0/assets/frame.png deleted file mode 100644 index 843ac8e..0000000 Binary files a/gtk-2.0/assets/frame.png and /dev/null differ diff --git a/gtk-2.0/assets/handle-horz.png b/gtk-2.0/assets/handle-horz.png deleted file mode 100644 index e5290f6..0000000 Binary files a/gtk-2.0/assets/handle-horz.png and /dev/null differ diff --git a/gtk-2.0/assets/handle-vert.png b/gtk-2.0/assets/handle-vert.png deleted file mode 100644 index 5f51e26..0000000 Binary files a/gtk-2.0/assets/handle-vert.png and /dev/null differ diff --git a/gtk-2.0/assets/handle.png b/gtk-2.0/assets/handle.png deleted file mode 100644 index a4ce686..0000000 Binary files a/gtk-2.0/assets/handle.png and /dev/null differ diff --git a/gtk-2.0/assets/line.png b/gtk-2.0/assets/line.png deleted file mode 100644 index 59c31d6..0000000 Binary files a/gtk-2.0/assets/line.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-border.png b/gtk-2.0/assets/menu-border.png deleted file mode 100644 index 843ac8e..0000000 Binary files a/gtk-2.0/assets/menu-border.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-checked-hover.png b/gtk-2.0/assets/menu-checkbox-checked-hover.png deleted file mode 100644 index 7a8a6ab..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-checked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-checked-insensitive.png b/gtk-2.0/assets/menu-checkbox-checked-insensitive.png deleted file mode 100644 index 20312ae..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-checked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-checked.png b/gtk-2.0/assets/menu-checkbox-checked.png deleted file mode 100644 index 7a8a6ab..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-checked.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-hover.png b/gtk-2.0/assets/menu-checkbox-hover.png deleted file mode 100644 index b1bedb1..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-insensitive.png b/gtk-2.0/assets/menu-checkbox-insensitive.png deleted file mode 100644 index cdc99cc..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-mixed-hover.png b/gtk-2.0/assets/menu-checkbox-mixed-hover.png deleted file mode 100644 index 7a97ea5..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-mixed-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-mixed-insensitive.png b/gtk-2.0/assets/menu-checkbox-mixed-insensitive.png deleted file mode 100644 index 839ebc8..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-mixed-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox-mixed.png b/gtk-2.0/assets/menu-checkbox-mixed.png deleted file mode 100644 index 7a97ea5..0000000 Binary files a/gtk-2.0/assets/menu-checkbox-mixed.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-checkbox.png b/gtk-2.0/assets/menu-checkbox.png deleted file mode 100644 index b1bedb1..0000000 Binary files a/gtk-2.0/assets/menu-checkbox.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-down-insensitive.png b/gtk-2.0/assets/menu-pan-down-insensitive.png deleted file mode 100644 index 1e041f1..0000000 Binary files a/gtk-2.0/assets/menu-pan-down-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-down.png b/gtk-2.0/assets/menu-pan-down.png deleted file mode 100644 index 4bc193e..0000000 Binary files a/gtk-2.0/assets/menu-pan-down.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-left-hover.png b/gtk-2.0/assets/menu-pan-left-hover.png deleted file mode 100644 index f7d9689..0000000 Binary files a/gtk-2.0/assets/menu-pan-left-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-left-insensitive.png b/gtk-2.0/assets/menu-pan-left-insensitive.png deleted file mode 100644 index 0d50045..0000000 Binary files a/gtk-2.0/assets/menu-pan-left-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-left.png b/gtk-2.0/assets/menu-pan-left.png deleted file mode 100644 index f7d9689..0000000 Binary files a/gtk-2.0/assets/menu-pan-left.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-right-hover.png b/gtk-2.0/assets/menu-pan-right-hover.png deleted file mode 100644 index 0f54212..0000000 Binary files a/gtk-2.0/assets/menu-pan-right-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-right-insensitive.png b/gtk-2.0/assets/menu-pan-right-insensitive.png deleted file mode 100644 index 774a8d1..0000000 Binary files a/gtk-2.0/assets/menu-pan-right-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-right.png b/gtk-2.0/assets/menu-pan-right.png deleted file mode 100644 index 0f54212..0000000 Binary files a/gtk-2.0/assets/menu-pan-right.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-up-insensitive.png b/gtk-2.0/assets/menu-pan-up-insensitive.png deleted file mode 100644 index ddf5f36..0000000 Binary files a/gtk-2.0/assets/menu-pan-up-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-pan-up.png b/gtk-2.0/assets/menu-pan-up.png deleted file mode 100644 index e1d5d4a..0000000 Binary files a/gtk-2.0/assets/menu-pan-up.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-checked-hover.png b/gtk-2.0/assets/menu-radio-checked-hover.png deleted file mode 100644 index 8622c54..0000000 Binary files a/gtk-2.0/assets/menu-radio-checked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-checked-insensitive.png b/gtk-2.0/assets/menu-radio-checked-insensitive.png deleted file mode 100644 index 61416d7..0000000 Binary files a/gtk-2.0/assets/menu-radio-checked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-checked.png b/gtk-2.0/assets/menu-radio-checked.png deleted file mode 100644 index 8622c54..0000000 Binary files a/gtk-2.0/assets/menu-radio-checked.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-hover.png b/gtk-2.0/assets/menu-radio-hover.png deleted file mode 100644 index 31cf880..0000000 Binary files a/gtk-2.0/assets/menu-radio-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-insensitive.png b/gtk-2.0/assets/menu-radio-insensitive.png deleted file mode 100644 index c4424eb..0000000 Binary files a/gtk-2.0/assets/menu-radio-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-mixed-hover.png b/gtk-2.0/assets/menu-radio-mixed-hover.png deleted file mode 100644 index 75a0e90..0000000 Binary files a/gtk-2.0/assets/menu-radio-mixed-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-mixed-insensitive.png b/gtk-2.0/assets/menu-radio-mixed-insensitive.png deleted file mode 100644 index 471a82b..0000000 Binary files a/gtk-2.0/assets/menu-radio-mixed-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio-mixed.png b/gtk-2.0/assets/menu-radio-mixed.png deleted file mode 100644 index 75a0e90..0000000 Binary files a/gtk-2.0/assets/menu-radio-mixed.png and /dev/null differ diff --git a/gtk-2.0/assets/menu-radio.png b/gtk-2.0/assets/menu-radio.png deleted file mode 100644 index 31cf880..0000000 Binary files a/gtk-2.0/assets/menu-radio.png and /dev/null differ diff --git a/gtk-2.0/assets/menubar-item-active.png b/gtk-2.0/assets/menubar-item-active.png deleted file mode 100644 index 0c87fba..0000000 Binary files a/gtk-2.0/assets/menubar-item-active.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-ltr-entry-active.png b/gtk-2.0/assets/notebook-combo-entry-ltr-entry-active.png deleted file mode 100644 index 88b50ed..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-ltr-entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-ltr-entry-insensitive.png b/gtk-2.0/assets/notebook-combo-entry-ltr-entry-insensitive.png deleted file mode 100644 index 1ba01e1..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-ltr-entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-ltr-entry.png b/gtk-2.0/assets/notebook-combo-entry-ltr-entry.png deleted file mode 100644 index 2967e09..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-ltr-entry.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-rtl-entry-active.png b/gtk-2.0/assets/notebook-combo-entry-rtl-entry-active.png deleted file mode 100644 index 62a9574..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-rtl-entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-rtl-entry-insensitive.png b/gtk-2.0/assets/notebook-combo-entry-rtl-entry-insensitive.png deleted file mode 100644 index c969972..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-rtl-entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-combo-entry-rtl-entry.png b/gtk-2.0/assets/notebook-combo-entry-rtl-entry.png deleted file mode 100644 index 12ab866..0000000 Binary files a/gtk-2.0/assets/notebook-combo-entry-rtl-entry.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-entry-active.png b/gtk-2.0/assets/notebook-entry-active.png deleted file mode 100644 index be28c7b..0000000 Binary files a/gtk-2.0/assets/notebook-entry-active.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-entry-insensitive.png b/gtk-2.0/assets/notebook-entry-insensitive.png deleted file mode 100644 index 467b3e3..0000000 Binary files a/gtk-2.0/assets/notebook-entry-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/notebook-entry.png b/gtk-2.0/assets/notebook-entry.png deleted file mode 100644 index d16735d..0000000 Binary files a/gtk-2.0/assets/notebook-entry.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-down-insensitive.png b/gtk-2.0/assets/pan-down-insensitive.png deleted file mode 100644 index 1e041f1..0000000 Binary files a/gtk-2.0/assets/pan-down-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-down.png b/gtk-2.0/assets/pan-down.png deleted file mode 100644 index 4bc193e..0000000 Binary files a/gtk-2.0/assets/pan-down.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-left-insensitive.png b/gtk-2.0/assets/pan-left-insensitive.png deleted file mode 100644 index 14769fd..0000000 Binary files a/gtk-2.0/assets/pan-left-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-left-semi.png b/gtk-2.0/assets/pan-left-semi.png deleted file mode 100644 index f27160b..0000000 Binary files a/gtk-2.0/assets/pan-left-semi.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-left.png b/gtk-2.0/assets/pan-left.png deleted file mode 100644 index d3fa1e9..0000000 Binary files a/gtk-2.0/assets/pan-left.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-right-insensitive.png b/gtk-2.0/assets/pan-right-insensitive.png deleted file mode 100644 index 67728bf..0000000 Binary files a/gtk-2.0/assets/pan-right-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-right-semi.png b/gtk-2.0/assets/pan-right-semi.png deleted file mode 100644 index 36850e5..0000000 Binary files a/gtk-2.0/assets/pan-right-semi.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-right.png b/gtk-2.0/assets/pan-right.png deleted file mode 100644 index de21e05..0000000 Binary files a/gtk-2.0/assets/pan-right.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-up-insensitive.png b/gtk-2.0/assets/pan-up-insensitive.png deleted file mode 100644 index ddf5f36..0000000 Binary files a/gtk-2.0/assets/pan-up-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/pan-up.png b/gtk-2.0/assets/pan-up.png deleted file mode 100644 index e1d5d4a..0000000 Binary files a/gtk-2.0/assets/pan-up.png and /dev/null differ diff --git a/gtk-2.0/assets/progressbar-horz-trough.png b/gtk-2.0/assets/progressbar-horz-trough.png deleted file mode 100644 index cd6f451..0000000 Binary files a/gtk-2.0/assets/progressbar-horz-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/progressbar-horz.png b/gtk-2.0/assets/progressbar-horz.png deleted file mode 100644 index e9d0dc4..0000000 Binary files a/gtk-2.0/assets/progressbar-horz.png and /dev/null differ diff --git a/gtk-2.0/assets/progressbar-vert-trough.png b/gtk-2.0/assets/progressbar-vert-trough.png deleted file mode 100644 index ec1f3d0..0000000 Binary files a/gtk-2.0/assets/progressbar-vert-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/progressbar-vert.png b/gtk-2.0/assets/progressbar-vert.png deleted file mode 100644 index 0bf33f6..0000000 Binary files a/gtk-2.0/assets/progressbar-vert.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-checked-active.png b/gtk-2.0/assets/radio-checked-active.png deleted file mode 100644 index b85b399..0000000 Binary files a/gtk-2.0/assets/radio-checked-active.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-checked-hover.png b/gtk-2.0/assets/radio-checked-hover.png deleted file mode 100644 index b11400c..0000000 Binary files a/gtk-2.0/assets/radio-checked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-checked-insensitive.png b/gtk-2.0/assets/radio-checked-insensitive.png deleted file mode 100644 index f9f8064..0000000 Binary files a/gtk-2.0/assets/radio-checked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-checked.png b/gtk-2.0/assets/radio-checked.png deleted file mode 100644 index cc24b0b..0000000 Binary files a/gtk-2.0/assets/radio-checked.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-mixed-active.png b/gtk-2.0/assets/radio-mixed-active.png deleted file mode 100644 index 1720c73..0000000 Binary files a/gtk-2.0/assets/radio-mixed-active.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-mixed-hover.png b/gtk-2.0/assets/radio-mixed-hover.png deleted file mode 100644 index 5da44af..0000000 Binary files a/gtk-2.0/assets/radio-mixed-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-mixed-insensitive.png b/gtk-2.0/assets/radio-mixed-insensitive.png deleted file mode 100644 index f2440ff..0000000 Binary files a/gtk-2.0/assets/radio-mixed-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-mixed.png b/gtk-2.0/assets/radio-mixed.png deleted file mode 100644 index 39726b0..0000000 Binary files a/gtk-2.0/assets/radio-mixed.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-unchecked-active.png b/gtk-2.0/assets/radio-unchecked-active.png deleted file mode 100644 index e45cd20..0000000 Binary files a/gtk-2.0/assets/radio-unchecked-active.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-unchecked-hover.png b/gtk-2.0/assets/radio-unchecked-hover.png deleted file mode 100644 index f004bcb..0000000 Binary files a/gtk-2.0/assets/radio-unchecked-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-unchecked-insensitive.png b/gtk-2.0/assets/radio-unchecked-insensitive.png deleted file mode 100644 index 6db8954..0000000 Binary files a/gtk-2.0/assets/radio-unchecked-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/radio-unchecked.png b/gtk-2.0/assets/radio-unchecked.png deleted file mode 100644 index bca58d1..0000000 Binary files a/gtk-2.0/assets/radio-unchecked.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-horz-focus.png b/gtk-2.0/assets/scale-horz-focus.png deleted file mode 100644 index 91c4efd..0000000 Binary files a/gtk-2.0/assets/scale-horz-focus.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-horz-trough-active.png b/gtk-2.0/assets/scale-horz-trough-active.png deleted file mode 100644 index 8fd1bac..0000000 Binary files a/gtk-2.0/assets/scale-horz-trough-active.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-horz-trough.png b/gtk-2.0/assets/scale-horz-trough.png deleted file mode 100644 index bdcbe9e..0000000 Binary files a/gtk-2.0/assets/scale-horz-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-slider-active.png b/gtk-2.0/assets/scale-slider-active.png deleted file mode 100644 index e6899c2..0000000 Binary files a/gtk-2.0/assets/scale-slider-active.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-slider-hover.png b/gtk-2.0/assets/scale-slider-hover.png deleted file mode 100644 index cdd7289..0000000 Binary files a/gtk-2.0/assets/scale-slider-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-slider-insensitive.png b/gtk-2.0/assets/scale-slider-insensitive.png deleted file mode 100644 index f30aea9..0000000 Binary files a/gtk-2.0/assets/scale-slider-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-slider.png b/gtk-2.0/assets/scale-slider.png deleted file mode 100644 index f91b25e..0000000 Binary files a/gtk-2.0/assets/scale-slider.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-vert-trough-active.png b/gtk-2.0/assets/scale-vert-trough-active.png deleted file mode 100644 index 7198da5..0000000 Binary files a/gtk-2.0/assets/scale-vert-trough-active.png and /dev/null differ diff --git a/gtk-2.0/assets/scale-vert-trough.png b/gtk-2.0/assets/scale-vert-trough.png deleted file mode 100644 index 83731ff..0000000 Binary files a/gtk-2.0/assets/scale-vert-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-horz-slider-active.png b/gtk-2.0/assets/scrollbar-horz-slider-active.png deleted file mode 100644 index 5159833..0000000 Binary files a/gtk-2.0/assets/scrollbar-horz-slider-active.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-horz-slider-hover.png b/gtk-2.0/assets/scrollbar-horz-slider-hover.png deleted file mode 100644 index 17d7259..0000000 Binary files a/gtk-2.0/assets/scrollbar-horz-slider-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-horz-slider.png b/gtk-2.0/assets/scrollbar-horz-slider.png deleted file mode 100644 index 188759f..0000000 Binary files a/gtk-2.0/assets/scrollbar-horz-slider.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-horz-trough.png b/gtk-2.0/assets/scrollbar-horz-trough.png deleted file mode 100644 index 4c659f6..0000000 Binary files a/gtk-2.0/assets/scrollbar-horz-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider-active-rtl.png b/gtk-2.0/assets/scrollbar-vert-slider-active-rtl.png deleted file mode 100644 index baa4d2b..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider-active-rtl.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider-active.png b/gtk-2.0/assets/scrollbar-vert-slider-active.png deleted file mode 100644 index b184594..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider-active.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider-hover-rtl.png b/gtk-2.0/assets/scrollbar-vert-slider-hover-rtl.png deleted file mode 100644 index 59c3d9e..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider-hover-rtl.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider-hover.png b/gtk-2.0/assets/scrollbar-vert-slider-hover.png deleted file mode 100644 index 6d2e324..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider-rtl.png b/gtk-2.0/assets/scrollbar-vert-slider-rtl.png deleted file mode 100644 index c0444e6..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider-rtl.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-slider.png b/gtk-2.0/assets/scrollbar-vert-slider.png deleted file mode 100644 index 25b1705..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-slider.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-trough-rtl.png b/gtk-2.0/assets/scrollbar-vert-trough-rtl.png deleted file mode 100644 index 6f1f109..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-trough-rtl.png and /dev/null differ diff --git a/gtk-2.0/assets/scrollbar-vert-trough.png b/gtk-2.0/assets/scrollbar-vert-trough.png deleted file mode 100644 index 4b86c5e..0000000 Binary files a/gtk-2.0/assets/scrollbar-vert-trough.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-down-insensitive.png b/gtk-2.0/assets/spin-down-insensitive.png deleted file mode 100644 index 855423c..0000000 Binary files a/gtk-2.0/assets/spin-down-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-down.png b/gtk-2.0/assets/spin-down.png deleted file mode 100644 index 146dbc5..0000000 Binary files a/gtk-2.0/assets/spin-down.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-down-active.png b/gtk-2.0/assets/spin-ltr-down-active.png deleted file mode 100644 index 624bf4e..0000000 Binary files a/gtk-2.0/assets/spin-ltr-down-active.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-down-hover.png b/gtk-2.0/assets/spin-ltr-down-hover.png deleted file mode 100644 index aca8fc4..0000000 Binary files a/gtk-2.0/assets/spin-ltr-down-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-down-insensitive.png b/gtk-2.0/assets/spin-ltr-down-insensitive.png deleted file mode 100644 index 62ded43..0000000 Binary files a/gtk-2.0/assets/spin-ltr-down-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-down.png b/gtk-2.0/assets/spin-ltr-down.png deleted file mode 100644 index 72cf05e..0000000 Binary files a/gtk-2.0/assets/spin-ltr-down.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-up-active.png b/gtk-2.0/assets/spin-ltr-up-active.png deleted file mode 100644 index 6df9a11..0000000 Binary files a/gtk-2.0/assets/spin-ltr-up-active.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-up-hover.png b/gtk-2.0/assets/spin-ltr-up-hover.png deleted file mode 100644 index 399c22a..0000000 Binary files a/gtk-2.0/assets/spin-ltr-up-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-up-insensitive.png b/gtk-2.0/assets/spin-ltr-up-insensitive.png deleted file mode 100644 index acf2106..0000000 Binary files a/gtk-2.0/assets/spin-ltr-up-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-ltr-up.png b/gtk-2.0/assets/spin-ltr-up.png deleted file mode 100644 index bb856ad..0000000 Binary files a/gtk-2.0/assets/spin-ltr-up.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-down-active.png b/gtk-2.0/assets/spin-rtl-down-active.png deleted file mode 100644 index 932e432..0000000 Binary files a/gtk-2.0/assets/spin-rtl-down-active.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-down-hover.png b/gtk-2.0/assets/spin-rtl-down-hover.png deleted file mode 100644 index 823fdb1..0000000 Binary files a/gtk-2.0/assets/spin-rtl-down-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-down-insensitive.png b/gtk-2.0/assets/spin-rtl-down-insensitive.png deleted file mode 100644 index 144c8d5..0000000 Binary files a/gtk-2.0/assets/spin-rtl-down-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-down.png b/gtk-2.0/assets/spin-rtl-down.png deleted file mode 100644 index 74b70de..0000000 Binary files a/gtk-2.0/assets/spin-rtl-down.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-up-active.png b/gtk-2.0/assets/spin-rtl-up-active.png deleted file mode 100644 index dd911ec..0000000 Binary files a/gtk-2.0/assets/spin-rtl-up-active.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-up-hover.png b/gtk-2.0/assets/spin-rtl-up-hover.png deleted file mode 100644 index d114727..0000000 Binary files a/gtk-2.0/assets/spin-rtl-up-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-up-insensitive.png b/gtk-2.0/assets/spin-rtl-up-insensitive.png deleted file mode 100644 index fd01f5e..0000000 Binary files a/gtk-2.0/assets/spin-rtl-up-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-rtl-up.png b/gtk-2.0/assets/spin-rtl-up.png deleted file mode 100644 index b1d4ae7..0000000 Binary files a/gtk-2.0/assets/spin-rtl-up.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-up-insensitive.png b/gtk-2.0/assets/spin-up-insensitive.png deleted file mode 100644 index d48bc72..0000000 Binary files a/gtk-2.0/assets/spin-up-insensitive.png and /dev/null differ diff --git a/gtk-2.0/assets/spin-up.png b/gtk-2.0/assets/spin-up.png deleted file mode 100644 index 4899b88..0000000 Binary files a/gtk-2.0/assets/spin-up.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-down-active.png b/gtk-2.0/assets/tab-down-active.png deleted file mode 100644 index 9deb995..0000000 Binary files a/gtk-2.0/assets/tab-down-active.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-down.png b/gtk-2.0/assets/tab-down.png deleted file mode 100644 index e9bb984..0000000 Binary files a/gtk-2.0/assets/tab-down.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-horz-gap.png b/gtk-2.0/assets/tab-horz-gap.png deleted file mode 100644 index f509872..0000000 Binary files a/gtk-2.0/assets/tab-horz-gap.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-left-active.png b/gtk-2.0/assets/tab-left-active.png deleted file mode 100644 index dc44189..0000000 Binary files a/gtk-2.0/assets/tab-left-active.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-left.png b/gtk-2.0/assets/tab-left.png deleted file mode 100644 index 9eeaeb2..0000000 Binary files a/gtk-2.0/assets/tab-left.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-right-active.png b/gtk-2.0/assets/tab-right-active.png deleted file mode 100644 index 9fdde6d..0000000 Binary files a/gtk-2.0/assets/tab-right-active.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-right.png b/gtk-2.0/assets/tab-right.png deleted file mode 100644 index e74fe08..0000000 Binary files a/gtk-2.0/assets/tab-right.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-up-active.png b/gtk-2.0/assets/tab-up-active.png deleted file mode 100644 index c88b1c9..0000000 Binary files a/gtk-2.0/assets/tab-up-active.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-up.png b/gtk-2.0/assets/tab-up.png deleted file mode 100644 index 832592e..0000000 Binary files a/gtk-2.0/assets/tab-up.png and /dev/null differ diff --git a/gtk-2.0/assets/tab-vert-gap.png b/gtk-2.0/assets/tab-vert-gap.png deleted file mode 100644 index ad7ed20..0000000 Binary files a/gtk-2.0/assets/tab-vert-gap.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-down-active.png b/gtk-2.0/assets/treeview-pan-down-active.png deleted file mode 100644 index 2ed9644..0000000 Binary files a/gtk-2.0/assets/treeview-pan-down-active.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-down-hover.png b/gtk-2.0/assets/treeview-pan-down-hover.png deleted file mode 100644 index 506c4f5..0000000 Binary files a/gtk-2.0/assets/treeview-pan-down-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-down.png b/gtk-2.0/assets/treeview-pan-down.png deleted file mode 100644 index b009279..0000000 Binary files a/gtk-2.0/assets/treeview-pan-down.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-up-active.png b/gtk-2.0/assets/treeview-pan-up-active.png deleted file mode 100644 index ffb3889..0000000 Binary files a/gtk-2.0/assets/treeview-pan-up-active.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-up-hover.png b/gtk-2.0/assets/treeview-pan-up-hover.png deleted file mode 100644 index b800425..0000000 Binary files a/gtk-2.0/assets/treeview-pan-up-hover.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-pan-up.png b/gtk-2.0/assets/treeview-pan-up.png deleted file mode 100644 index 67964a2..0000000 Binary files a/gtk-2.0/assets/treeview-pan-up.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-separator-ltr.png b/gtk-2.0/assets/treeview-separator-ltr.png deleted file mode 100644 index 06e0df7..0000000 Binary files a/gtk-2.0/assets/treeview-separator-ltr.png and /dev/null differ diff --git a/gtk-2.0/assets/treeview-separator-rtl.png b/gtk-2.0/assets/treeview-separator-rtl.png deleted file mode 100644 index c8eec4a..0000000 Binary files a/gtk-2.0/assets/treeview-separator-rtl.png and /dev/null differ diff --git a/gtk-2.0/gtkfilechooser.ini b/gtk-2.0/gtkfilechooser.ini deleted file mode 100644 index 5fec4c5..0000000 --- a/gtk-2.0/gtkfilechooser.ini +++ /dev/null @@ -1,11 +0,0 @@ -[Filechooser Settings] -LocationMode=path-bar -ShowHidden=false -ShowSizeColumn=true -GeometryX=0 -GeometryY=0 -GeometryWidth=1008 -GeometryHeight=765 -SortColumn=name -SortOrder=ascending -StartupMode=recent diff --git a/gtk-2.0/gtkrc b/gtk-2.0/gtkrc deleted file mode 100644 index 86f1269..0000000 --- a/gtk-2.0/gtkrc +++ /dev/null @@ -1,41 +0,0 @@ -# Based on Bridge by ScionicSpectre -# vim:set ts=2 sw=2 sts=2 ai et: -# -# This is the GTK+ 2 version of Adwaita. It's whole purpose is to look as the -# GTK+ 3 version as much as possible until GTK+ 2 dies completely. -# -# Note: comments for explaining styles are on the bottom of each file beside the -# widget matches. - -# Declare the colours used throughout the theme. -# There shouldn't be any fiddling with them in the theme files themselves in -# order to not mess up the dark theme. - -# Text/base -gtk-color-scheme = "text_color:white\nbase_color:#232729" -# Foreground/background -gtk-color-scheme = "fg_color:#eeeeec\nbg_color:#33393b" -# Selected foreground/background -gtk-color-scheme = "selected_fg_color:#ffffff\nselected_bg_color:#215d9c" -# Insensitive foreground/background -gtk-color-scheme = "insensitive_fg_color:#919494\ninsensitive_bg_color:#2d3234" -# Menus -gtk-color-scheme = "menu_color:#262b2d" -# Links -gtk-color-scheme = "link_color:#4a90d9\nvisited_link_color:#2a76c6" -# Treeview headers -gtk-color-scheme = "column_header_color:#898b8b\nhover_column_header_color:#bcbdbc" -# Window decoration -gtk-color-scheme = "window_color:#2c3133" -# Tooltips -gtk-color-scheme = "tooltip_fg_color:#ffffff\ntooltip_bg_color:#343434" -gtk-icon-theme-name = "Papirus-Dark" -# Set GTK settings -gtk-auto-mnemonics = 1 -gtk-primary-button-warps-slider = 1 - -# And hand over the control to the theme files -include "main.rc" -include "apps.rc" -include "hacks.rc" -include "hacks-dark.rc" diff --git a/gtk-2.0/hacks-dark.rc b/gtk-2.0/hacks-dark.rc deleted file mode 100644 index 91ed04a..0000000 --- a/gtk-2.0/hacks-dark.rc +++ /dev/null @@ -1,16 +0,0 @@ -# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et: -# -# GTK+ 2 hardcodes a light shadow under certain inactive things. We can use this -# horrible workaround to make it at least distinguishable. - -style "dark_insensitive" { - - fg[INSENSITIVE] = "#000000" - text[INSENSITIVE] = "#000000" - -} - -widget_class "**" style "dark_insensitive" -widget_class "*." style "dark_insensitive" -widget_class "**" style "dark_insensitive" -widget_class "*.." style "dark_insensitive" diff --git a/gtk-2.0/hacks.rc b/gtk-2.0/hacks.rc deleted file mode 100644 index 1bdbee9..0000000 --- a/gtk-2.0/hacks.rc +++ /dev/null @@ -1,36 +0,0 @@ -# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et: -# -# This file contains horrible hacks to make this theme work with some programs -# This is mostly due to the limitations of gtk2 but sometimes its the fault of -# the programs themselves. Not going to point fingers. -# -# Either way, it's a WONTFIX for both, hence this horrible file. - -style "toplevel_hack" { - engine "adwaita" {} -} - -style "chrome_entry" { - base[NORMAL] = @base_color - base[INSENSITIVE] = @base_color -} - -style "vim_notebook" { - bg[NORMAL] = @base_color - bg[ACTIVE] = @insensitive_bg_color -} - -# Vim puts an eventbox between the tab and the label and colours it, -# we need to handle that -widget "vim-main-window*GtkNotebook.GtkEventBox" style "vim_notebook" - -# (he)xchat input box -class "SexySpellEntry" style:highest "normal_entry" - -# Chromium uses base as the fill colour of its own entries -# This would be fine but Gtk+ uses it to fill the surrounding space, so its set to bg -# That results in Chromium using it for the fill, so we need to handle that -widget_class "*Chrom*" style "chrome_entry" - -# Hack to be able to match widgets in LibreOffice -class "GtkWindow" style "toplevel_hack" diff --git a/gtk-2.0/main.rc b/gtk-2.0/main.rc deleted file mode 100644 index 062796d..0000000 --- a/gtk-2.0/main.rc +++ /dev/null @@ -1,2554 +0,0 @@ -# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et: -# -# This is the main theme file, handling all the default widgets and theme -# properties. Since GTK+ 2 is old, we need to overcome some of its limitations, -# which is also mostly done in this file. Sadly not all of them can be overcome -# so there will always be a visible difference between the GTK+ 2 and 3 theme. - -style "default" { - - xthickness = 1 - ythickness = 1 - - #################### - # Style Properties # - #################### - - GtkWidget::focus-line-width = 1 - GtkWidget::focus-line-pattern = "\2\1" - - GtkToolbar::internal-padding = 4 - GtkToolButton::icon-spacing = 4 - - GtkWidget::tooltip-radius = 3 - GtkWidget::tooltip-alpha = 235 - GtkWidget::new-tooltip-style = 1 #for compatibility - - GtkWidget::link-color = @link_color - GtkWidget::visited-link-color = @visited_link_color - GnomeHRef::link_color = @link_color - GtkHTML::link-color = @link_color - GtkHTML::vlink-color = @visited_link_color - GtkIMHtml::hyperlink-color = @link_color - GtkIMHtml::hyperlink-visited-color = @visited_link_color - - GtkSeparatorMenuItem::horizontal-padding = 0 - GtkSeparatorMenuItem::wide-separators = 1 - GtkSeparatorMenuItem::separator-height = 1 - - GtkButton::child-displacement-y = 0 - - GtkButton::default-border = {0, 0, 0, 0} - GtkButton::default-outside-border = {0, 0, 0, 0} - GtkButton::inner-border = {4, 4, 4, 4} - - GtkEntry::state-hint = 1 - GtkEntry::inner-border = {7, 7, 4, 5} - - GtkPaned::handle-size = 9 - GtkHPaned::handle-size = 9 - GtkVPaned::handle-size = 9 - - GtkScrollbar::trough-border = 0 - GtkRange::trough-border = 0 - GtkRange::slider-width = 13 - GtkRange::stepper-size = 0 - GtkRange::activate-slider = 1 - - GtkScrollbar::activate-slider = 1 - GtkScrollbar::stepper-size = 0 - GtkScrollbar::has-backward-stepper = 0 - GtkScrollbar::has-forward-stepper = 0 - GtkScrollbar::min-slider-length = 48 # 42 + 2*3 (margins) - GtkScrolledWindow::scrollbar-spacing = 0 - GtkScrolledWindow::scrollbars-within-bevel = 1 - - GtkScale::slider_length = 26 - GtkScale::slider_width = 26 - GtkScale::trough-side-details = 1 - - GtkProgressBar::min-horizontal-bar-height = 6 - GtkProgressBar::min-vertical-bar-width = 6 - # Making this bigger than the min[height,width]-2*[y,x]spacing makes the - # whole progressbar thicker, so by setting it to the exact above value - # we get the maximum spacing between the text and the edges without - # doing so. - GtkProgressBar::xspacing = 4 - GtkProgressBar::yspacing = 4 - - GtkStatusbar::shadow_type = GTK_SHADOW_NONE - GtkSpinButton::shadow_type = GTK_SHADOW_NONE - GtkMenuBar::shadow-type = GTK_SHADOW_NONE - GtkToolbar::shadow-type = GTK_SHADOW_NONE - # TODO: find out what this comment means: - # ( every window is misaligned for the sake of menus ): - GtkMenuBar::internal-padding = 0 - GtkMenu::horizontal-padding = 0 - GtkMenu::vertical-padding = 2 - GtkMenu::double-arrows = 0 - GtkMenuItem::arrow-scaling = 1 - GtkMenuItem::toggle-spacing = 10 - - GtkCheckButton::indicator_spacing = 3 - GtkOptionMenu::indicator_spacing = {13, 13, 5, 8} - - GtkTreeView::expander-size = 16 - GtkTreeView::vertical-separator = 0 - GtkTreeView::horizontal-separator = 4 - GtkTreeView::allow-rules = 0 - # Set this because some apps read it - GtkTreeView::odd-row-color = @base_color - GtkTreeView::even-row-color = @base_color - - GtkExpander::expander-size = 16 - - GtkNotebook::tab-overlap = 4 - - ########## - # Colors # - ########## - - bg[NORMAL] = @bg_color - bg[PRELIGHT] = @bg_color - bg[SELECTED] = @selected_bg_color - bg[INSENSITIVE] = @insensitive_bg_color - bg[ACTIVE] = @bg_color - - fg[NORMAL] = @fg_color - fg[PRELIGHT] = @fg_color - fg[SELECTED] = @selected_fg_color - fg[INSENSITIVE] = @insensitive_fg_color - fg[ACTIVE] = @fg_color - - text[NORMAL] = @text_color - text[PRELIGHT] = @text_color - text[SELECTED] = @selected_fg_color - text[INSENSITIVE] = @insensitive_fg_color - text[ACTIVE] = @selected_fg_color - - base[NORMAL] = @base_color - base[PRELIGHT] = shade (0.95, @bg_color) - base[SELECTED] = @selected_bg_color - base[INSENSITIVE] = @insensitive_bg_color - base[ACTIVE] = @selected_bg_color - - # For succinctness, all reasonable pixmap options remain here - - # Draw frame around menu in a non-compositied environment - # This needs to go before pixmap because we need to override some stuff - engine "adwaita" {} - - engine "pixmap" { - - ################# - # Check Buttons # - ################# - - image { - function = CHECK - state = NORMAL - shadow = OUT - overlay_file = "assets/checkbox-unchecked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = OUT - overlay_file = "assets/checkbox-unchecked-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = OUT - overlay_file = "assets/checkbox-unchecked-active.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = SELECTED - shadow = OUT - overlay_file = "assets/checkbox-unchecked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = OUT - overlay_file = "assets/checkbox-unchecked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = NORMAL - shadow = IN - overlay_file = "assets/checkbox-checked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = IN - overlay_file = "assets/checkbox-checked-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = IN - overlay_file = "assets/checkbox-checked-active.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = SELECTED - shadow = IN - overlay_file = "assets/checkbox-checked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = IN - overlay_file = "assets/checkbox-checked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = NORMAL - shadow = ETCHED_IN - overlay_file = "assets/checkbox-mixed.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = ETCHED_IN - overlay_file = "assets/checkbox-mixed-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = ETCHED_IN - overlay_file = "assets/checkbox-mixed-active.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = SELECTED - shadow = ETCHED_IN - overlay_file = "assets/checkbox-mixed.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = ETCHED_IN - overlay_file = "assets/checkbox-mixed-insensitive.png" - overlay_stretch = FALSE - } - - ################# - # Radio Buttons # - ################# - - image { - function = OPTION - state = NORMAL - shadow = OUT - overlay_file = "assets/radio-unchecked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = OUT - overlay_file = "assets/radio-unchecked-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = OUT - overlay_file = "assets/radio-unchecked-active.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = SELECTED - shadow = OUT - overlay_file = "assets/radio-unchecked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = OUT - overlay_file = "assets/radio-unchecked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = NORMAL - shadow = IN - overlay_file = "assets/radio-checked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = IN - overlay_file = "assets/radio-checked-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = IN - overlay_file = "assets/radio-checked-active.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = SELECTED - shadow = IN - overlay_file = "assets/radio-checked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = IN - overlay_file = "assets/radio-checked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = NORMAL - shadow = ETCHED_IN - overlay_file = "assets/radio-mixed.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = ETCHED_IN - overlay_file = "assets/radio-mixed-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = ETCHED_IN - overlay_file = "assets/radio-mixed-active.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = SELECTED - shadow = ETCHED_IN - overlay_file = "assets/radio-mixed.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = ETCHED_IN - overlay_file = "assets/radio-mixed-insensitive.png" - overlay_stretch = FALSE - } - - ########## - # Arrows # - ########## - - # Overrides - - # Disable arrows in spinbuttons - image { - function = ARROW - detail = "spinbutton" - } - - # Disable arrows for qt in scrollbars - image { - function = ARROW - detail = "vscrollbar" - } - image { - function = ARROW - detail = "hscrollbar" - } - - # Menu arrows - - image { - function = ARROW - state = NORMAL - detail = "menuitem" - overlay_file = "assets/menu-pan-left.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = PRELIGHT - detail = "menuitem" - overlay_file = "assets/menu-pan-left-hover.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = INSENSITIVE - detail = "menuitem" - overlay_file = "assets/menu-pan-left-insensitive.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = NORMAL - detail = "menuitem" - overlay_file = "assets/menu-pan-right.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = PRELIGHT - detail = "menuitem" - overlay_file = "assets/menu-pan-right-hover.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = INSENSITIVE - detail = "menuitem" - overlay_file = "assets/menu-pan-right-insensitive.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = INSENSITIVE - detail = "menu_scroll_arrow_up" - overlay_file = "assets/menu-pan-up-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = ARROW - detail = "menu_scroll_arrow_up" - overlay_file = "assets/menu-pan-up.png" - overlay_stretch = FALSE - } - - image { - function = ARROW - state = INSENSITIVE - detail = "menu_scroll_arrow_down" - overlay_file = "assets/menu-pan-down-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = ARROW - detail = "menu_scroll_arrow_down" - overlay_file = "assets/menu-pan-down.png" - overlay_stretch = FALSE - } - - # Regular arrows - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/pan-up.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/pan-up.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/pan-up.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = INSENSITIVE - overlay_file = "assets/pan-up-insensitive.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = INSENSITIVE - overlay_file = "assets/pan-down-insensitive.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/pan-left.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/pan-left.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/pan-left.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = INSENSITIVE - overlay_file = "assets/pan-left-insensitive.png" - overlay_stretch = FALSE - arrow_direction = LEFT - } - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/pan-right.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/pan-right.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/pan-right.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - image { - function = ARROW - state = INSENSITIVE - overlay_file = "assets/pan-right-insensitive.png" - overlay_stretch = FALSE - arrow_direction = RIGHT - } - - ###################### - # Option Menu Arrows # - ###################### - - image { - function = TAB - state = NORMAL - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - } - - image { - function = TAB - state = PRELIGHT - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - } - - image { - function = TAB - state = ACTIVE - overlay_file = "assets/pan-down.png" - overlay_stretch = FALSE - } - - image { - function = TAB - state = INSENSITIVE - overlay_file = "assets/pan-down-insensitive.png" - overlay_stretch = FALSE - } - - ######### - # Lines # - ######### - - image { - function = VLINE - file = "assets/line.png" - border = {1, 0, 0, 0} - } - - image { - function = HLINE - file = "assets/line.png" - border = {0, 0, 1, 0} - } - - ######### - # Focus # - ######### - - image { - function = FOCUS - file = "assets/focus.png" - border = {1, 1, 1, 1} - stretch = TRUE - } - - ########### - # Handles # - ########### - - image { - function = HANDLE - detail = "handlebox" - overlay_file = "assets/handle.png" - overlay_stretch = FALSE - } - - image { - function = HANDLE - file = "assets/handle-horz.png" - border = {0, 0, 4, 4} - orientation = HORIZONTAL - } - - image { - function = HANDLE - file = "assets/handle-vert.png" - border = {4, 4, 0, 0} - orientation = VERTICAL - } - - image { - function = RESIZE_GRIP - } - - ############# - # Expanders # - ############# - - image { - function = EXPANDER - expander_style = EXPANDED - file = "assets/pan-down.png" - } - - # LTR - - image { - function = EXPANDER - expander_style = COLLAPSED - file = "assets/pan-right.png" - direction = LTR - } - - image { - function = EXPANDER - expander_style = SEMI_COLLAPSED - file = "assets/pan-right-semi.png" - direction = LTR - } - - image { - function = EXPANDER - expander_style = SEMI_EXPANDED - file = "assets/pan-right-semi.png" - direction = LTR - } - - # RTL - - image { - function = EXPANDER - expander_style = COLLAPSED - file = "assets/pan-left.png" - direction = RTL - } - - image { - function = EXPANDER - expander_style = SEMI_COLLAPSED - file = "assets/pan-left-semi.png" - direction = RTL - } - - image { - function = EXPANDER - expander_style = SEMI_EXPANDED - file = "assets/pan-left-semi.png" - direction = RTL - } - - ############# - # Notebooks # - ############# - - # Left - - image { - function = EXTENSION - state = NORMAL - file = "assets/tab-left-active.png" - border = {3, 0, 3, 3} - stretch = TRUE - gap_side = RIGHT - } - - image { - function = EXTENSION - file = "assets/tab-left.png" - border = {3, 0, 3, 3} - stretch = TRUE - gap_side = RIGHT - } - - # Right - - image { - function = EXTENSION - state = NORMAL - file = "assets/tab-right-active.png" - border = {0, 3, 3, 3} - stretch = TRUE - gap_side = LEFT - } - - image { - function = EXTENSION - file = "assets/tab-right.png" - border = {0, 3, 3, 3} - stretch = TRUE - gap_side = LEFT - } - - # Up - - image { - function = EXTENSION - state = NORMAL - file = "assets/tab-up-active.png" - border = {3, 3, 3, 0} - stretch = TRUE - gap_side = BOTTOM - } - - image { - function = EXTENSION - file = "assets/tab-up.png" - border = {3, 3, 3, 0} - stretch = TRUE - gap_side = BOTTOM - } - - # Down - - image { - function = EXTENSION - state = NORMAL - file = "assets/tab-down-active.png" - border = {3, 3, 0, 3} - stretch = TRUE - gap_side = TOP - } - - image { - function = EXTENSION - file = "assets/tab-down.png" - border = {3, 3, 0, 3} - stretch = TRUE - gap_side = TOP - } - - # Inner frame - - image { - function = BOX_GAP - detail = "notebook" - file = "assets/frame-notebook.png" - border = {1, 1, 1, 1} - stretch = TRUE - gap_file = "assets/tab-vert-gap.png" - gap_border = {1, 0, 1, 1} - gap_side = LEFT - } - - image { - function = BOX_GAP - detail = "notebook" - file = "assets/frame-notebook.png" - border = {1, 1, 1, 1} - stretch = TRUE - gap_file = "assets/tab-vert-gap.png" - gap_border = {0, 1, 1, 1} - gap_side = RIGHT - } - - image { - function = BOX_GAP - detail = "notebook" - file = "assets/frame-notebook.png" - border = {1, 1, 1, 1} - stretch = TRUE - gap_file = "assets/tab-horz-gap.png" - gap_border = {1, 1, 1, 0} - gap_side = TOP - } - - image { - function = BOX_GAP - detail = "notebook" - file = "assets/frame-notebook.png" - border = {1, 1, 1, 1} - stretch = TRUE - gap_file = "assets/tab-horz-gap.png" - gap_border = {1, 1, 0, 1} - gap_side = BOTTOM - } - - # Standalone frame - image { - function = BOX - detail = "notebook" - file = "assets/frame-notebook.png" - border = {1, 1, 1, 1} - stretch = TRUE - } - - ############## - # Scrollbars # - ############## - - image { - function = BOX - detail = "trough" - file = "assets/scrollbar-horz-trough.png" - border = {0, 0, 1, 0} - orientation = HORIZONTAL - } - - image { - function = BOX - detail = "trough" - file = "assets/scrollbar-vert-trough.png" - border = {1, 0, 0, 0} - orientation = VERTICAL - direction = LTR - } - - image { - function = BOX - detail = "trough" - file = "assets/scrollbar-vert-trough-rtl.png" - border = {0, 1, 0, 0} - orientation = VERTICAL - direction = RTL - } - - - # Disable insensitive sliders - - image { - function = SLIDER - state = INSENSITIVE - detail = "slider" - } - - # Horizontal sliders - - image { - function = SLIDER - state = NORMAL - detail = "slider" - file = "assets/scrollbar-horz-slider.png" - border = {6, 6, 7, 6 } - stretch = TRUE - orientation = HORIZONTAL - } - - image { - function = SLIDER - state = PRELIGHT - detail = "slider" - file = "assets/scrollbar-horz-slider-hover.png" - border = {6, 6, 7, 6 } - stretch = TRUE - orientation = HORIZONTAL - } - - image { - function = SLIDER - state = ACTIVE - detail = "slider" - file = "assets/scrollbar-horz-slider-active.png" - border = {6, 6, 7, 6 } - stretch = TRUE - orientation = HORIZONTAL - } - - # Vertical sliders - - image { - function = SLIDER - state = NORMAL - detail = "slider" - file = "assets/scrollbar-vert-slider.png" - border = {7, 6, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = LTR - } - - image { - function = SLIDER - state = PRELIGHT - detail = "slider" - file = "assets/scrollbar-vert-slider-hover.png" - border = {7, 6, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = LTR - } - - image { - function = SLIDER - state = ACTIVE - detail = "slider" - file = "assets/scrollbar-vert-slider-active.png" - border = {7, 6, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = LTR - } - - # RTL - - image { - function = SLIDER - state = NORMAL - detail = "slider" - file = "assets/scrollbar-vert-slider-rtl.png" - border = {6, 7, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = RTL - } - - image { - function = SLIDER - state = PRELIGHT - detail = "slider" - file = "assets/scrollbar-vert-slider-hover-rtl.png" - border = {6, 7, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = RTL - } - - image { - function = SLIDER - state = ACTIVE - detail = "slider" - file = "assets/scrollbar-vert-slider-active-rtl.png" - border = {6, 7, 6, 6} - stretch = TRUE - orientation = VERTICAL - direction = RTL - } - - ########## - # Scales # - ########## - - # Troughs, overrided later on. We set them here too because some widgets - # don't specify their orientation. - - image { - function = BOX - detail = "trough-upper" - file = "assets/scale-horz-trough.png" - border = {10, 10, 0, 0} - stretch = TRUE - orientation = HORIZONTAL - } - - image { - function = BOX - detail = "trough-lower" - file = "assets/scale-horz-trough-active.png" - border = {10, 10, 0, 0} - stretch = TRUE - orientation = HORIZONTAL - } - - image { - function = BOX - detail = "trough-upper" - file = "assets/scale-vert-trough.png" - border = {0, 0, 10, 10} - stretch = TRUE - orientation = VERTICAL - } - - image { - function = BOX - detail = "trough-lower" - file = "assets/scale-vert-trough-active.png" - border = {0, 0, 10, 10} - stretch = TRUE - orientation = VERTICAL - } - - # Sliders - - image { - function = SLIDER - state = NORMAL - detail = "hscale" - file = "assets/scale-slider.png" - } - - image { - function = SLIDER - state = PRELIGHT - detail = "hscale" - file = "assets/scale-slider-hover.png" - } - - image { - function = SLIDER - state = ACTIVE - detail = "hscale" - file = "assets/scale-slider-active.png" - } - - image { - function = SLIDER - state = INSENSITIVE - detail = "hscale" - file = "assets/scale-slider-insensitive.png" - } - image { - function = SLIDER - state = NORMAL - detail = "vscale" - file = "assets/scale-slider.png" - } - - image { - function = SLIDER - state = PRELIGHT - detail = "vscale" - file = "assets/scale-slider-hover.png" - } - - image { - function = SLIDER - state = ACTIVE - detail = "vscale" - file = "assets/scale-slider-active.png" - } - - image { - function = SLIDER - state = INSENSITIVE - detail = "vscale" - file = "assets/scale-slider-insensitive.png" - } - - ########### - # Menubar # - ########### - - image { - function = BOX - detail = "menubar" - file = "assets/line.png" - border = {0, 0, 0, 1} - } - - ######### - # Menus # - ######### - - image { - function = BOX - state = PRELIGHT - detail = "menu_scroll_arrow_up" - file = "assets/line.png" - } - - image { - function = BOX - detail = "menu_scroll_arrow_up" - file = "assets/line.png" - border = {0, 0, 0, 1} - } - - image { - function = BOX - state = PRELIGHT - detail = "menu_scroll_arrow_down" - file = "assets/line.png" - } - - image { - function = BOX - detail = "menu_scroll_arrow_down" - file = "assets/line.png" - border = {0, 0, 1, 0} - } - - ########### - # Entries # - ########### - - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - detail = "entry" - file = "assets/entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = FLAT_BOX - state = ACTIVE - detail = "entry_bg" - file = "assets/entry-background.png" - } - - image { - function = FLAT_BOX - state = INSENSITIVE - detail = "entry_bg" - file = "assets/entry-background-insensitive.png" - } - - image { - function = FLAT_BOX - detail = "entry_bg" - file = "assets/entry-background.png" - } - ######### - # Spins # - ######### - - # Spin-Up LTR - - image { - function = BOX - state = NORMAL - detail = "spinbutton_up" - file = "assets/spin-ltr-up.png" - border = {1, 4, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_up" - file = "assets/spin-ltr-up-hover.png" - border = {1, 4, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_up" - file = "assets/spin-ltr-up-active.png" - border = {1, 4, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_up" - file = "assets/spin-ltr-up-insensitive.png" - border = {1, 4, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up-insensitive.png" - overlay_stretch = FALSE - direction = LTR - } - - # Spin-Up RTL - - image { - function = BOX - state = NORMAL - detail = "spinbutton_up" - file = "assets/spin-rtl-up.png" - border = {4, 1, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_up" - file = "assets/spin-rtl-up-hover.png" - border = {4, 1, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_up" - file = "assets/spin-rtl-up-hover.png" - border = {4, 1, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_up" - file = "assets/spin-rtl-up-insensitive.png" - border = {4, 1, 4, 0} - stretch = TRUE - overlay_file = "assets/spin-up-insensitive.png" - overlay_stretch = FALSE - direction = RTL - } - - # Spin-Down LTR - - image { - function = BOX - state = NORMAL - detail = "spinbutton_down" - file = "assets/spin-ltr-down.png" - border = {1, 4, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_down" - file = "assets/spin-ltr-down-hover.png" - border = {1, 4, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_down" - file = "assets/spin-ltr-down-active.png" - border = {1, 4, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = LTR - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_down" - file = "assets/spin-ltr-down-insensitive.png" - border = {1, 4, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down-insensitive.png" - overlay_stretch = FALSE - direction = LTR - } - - # Spin-Down RTL - - image { - function = BOX - state = NORMAL - detail = "spinbutton_down" - file = "assets/spin-rtl-down.png" - border = {4, 1, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = PRELIGHT - detail = "spinbutton_down" - file = "assets/spin-rtl-down-hover.png" - border = {4, 1, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = ACTIVE - detail = "spinbutton_down" - file = "assets/spin-rtl-down-active.png" - border = {4, 1, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down.png" - overlay_stretch = FALSE - direction = RTL - } - - image { - function = BOX - state = INSENSITIVE - detail = "spinbutton_down" - file = "assets/spin-rtl-down-insensitive.png" - border = {4, 1, 1, 4} - stretch = TRUE - overlay_file = "assets/spin-down-insensitive.png" - overlay_stretch = FALSE - direction = RTL - } - - ############## - # Scrollbars # - ############## - - image { - function = BOX - detail = "bar" - file = "assets/progressbar-horz.png" - stretch = TRUE - border = {2, 2, 1, 1} - orientation = HORIZONTAL - } - - image { - function = BOX - detail = "bar" - file = "assets/progressbar-vert.png" - stretch = TRUE - border = {1, 1, 2, 2} - orientation = VERTICAL - } - - ############# - # Treeviews # - ############# - - # Disable active the column highlight - # We need to match specific cells or we break stuff - # Looking at you deadbeef - - image { - function = FLAT_BOX - detail = "cell_even_sorted" - state = NORMAL - } - - image { - function = FLAT_BOX - detail = "cell_odd_sorted" - state = NORMAL - } - - # Disable all the other shadows - # This prevents the Raleigh effect - image { - function = SHADOW - } - - } - -} - -style "menubar" { - - # Needed to fix Firefox's menubar text - bg[SELECTED] = @selected_fg_color - fg[SELECTED] = @link_color - -} - -style "menubar_item" { - - xthickness = 3 - ythickness = 4 - - fg[PRELIGHT] = @link_color - - engine "pixmap" { - image { - function = BOX - state = PRELIGHT - file = "assets/menubar-item-active.png" - border = {0, 0, 0, 3} - } - } - -} - -style "menu" { - - xthickness = 0 - ythickness = 0 - - bg[NORMAL] = @menu_color - bg[INSENSITIVE] = @menu_color - bg[PRELIGHT] = @menu_color - bg[SELECTED] = @selected_bg_color - -} - -style "menu_item" { - - xthickness = 3 - ythickness = 4 - - bg[PRELIGHT] = @selected_bg_color - # Chromium uses this setting - bg[SELECTED] = @selected_bg_color - - fg[PRELIGHT] = @selected_fg_color - # Some widgets use text, we need to handle that - text[NORMAL] = @fg_color - text[PRELIGHT] = @selected_fg_color - - # Unfortunately we can't tell regular and menu checks/radios apart - # Without the heirarchy - engine "pixmap" { - - ################# - # Check Buttons # - ################# - - image { - function = CHECK - state = NORMAL - shadow = OUT - overlay_file = "assets/menu-checkbox.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = OUT - overlay_file = "assets/menu-checkbox-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = OUT - overlay_file = "assets/menu-checkbox.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = OUT - overlay_file = "assets/menu-checkbox-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = NORMAL - shadow = IN - overlay_file = "assets/menu-checkbox-checked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = IN - overlay_file = "assets/menu-checkbox-checked-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = IN - overlay_file = "assets/menu-checkbox-checked.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = IN - overlay_file = "assets/menu-checkbox-checked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = NORMAL - shadow = ETCHED_IN - overlay_file = "assets/menu-checkbox-mixed.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = PRELIGHT - shadow = ETCHED_IN - overlay_file = "assets/menu-checkbox-mixed-hover.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = ACTIVE - shadow = ETCHED_IN - overlay_file = "assets/menu-checkbox-mixed.png" - overlay_stretch = FALSE - } - - image { - function = CHECK - state = INSENSITIVE - shadow = ETCHED_IN - overlay_file = "assets/menu-checkbox-mixed-insensitive.png" - overlay_stretch = FALSE - } - - ################# - # Radio Buttons # - ################# - - image { - function = OPTION - state = NORMAL - shadow = OUT - overlay_file = "assets/menu-radio.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = OUT - overlay_file = "assets/menu-radio-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = OUT - overlay_file = "assets/menu-radio.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = OUT - overlay_file = "assets/menu-radio-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = NORMAL - shadow = IN - overlay_file = "assets/menu-radio-checked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = IN - overlay_file = "assets/menu-radio-checked-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = IN - overlay_file = "assets/menu-radio-checked.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = IN - overlay_file = "assets/menu-radio-checked-insensitive.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = NORMAL - shadow = ETCHED_IN - overlay_file = "assets/menu-radio-mixed.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = PRELIGHT - shadow = ETCHED_IN - overlay_file = "assets/menu-radio-mixed-hover.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = ACTIVE - shadow = ETCHED_IN - overlay_file = "assets/menu-radio-mixed.png" - overlay_stretch = FALSE - } - - image { - function = OPTION - state = INSENSITIVE - shadow = ETCHED_IN - overlay_file = "assets/menu-radio-mixed-insensitive.png" - overlay_stretch = FALSE - } - - - - } - -} - -style "separator_menu_item" { - - xthickness = 0 - ythickness = 0 - - engine "pixmap" { - image { - function = BOX - file = "assets/line.png" - } - } - -} - -style "button" { - - xthickness = 2 - ythickness = 2 - - # For the sake of sanity style buttons this way - engine "pixmap" { - - ########### - # Buttons # - ########### - - image { - function = BOX - state = NORMAL - file = "assets/button.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = BOX - state = PRELIGHT - shadow = OUT - file = "assets/button-hover.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - # Don't add hover effect on pressed buttons - image { - function = BOX - state = PRELIGHT - shadow = IN - file = "assets/button-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = BOX - state = ACTIVE - file = "assets/button-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = BOX - state = INSENSITIVE - file = "assets/button-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - } -} - -style "link_button" { - - # Disable the button effect, leave just the link - engine "pixmap" { - image { - function = BOX - } - } - -} - -style "entry" { - - # We set this same as the border of the border of the entry - # This way there's no overlap - xthickness = 4 - ythickness = 4 - -} - -style "combobox" { - - xthickness = 6 - ythickness = 4 - - # This affects only the button beside an entry - GtkButton::inner-border = {0, 0, 0, 0} - -} - -style "combobox_cellview" { - text[NORMAL] = @fg_color - text[PRELIGHT] = @fg_color -} - -style "combobox_entry" { - - # Since one side of the button is missing, we need to shift the arrow a little to the right - GtkButton::inner-border = {0, 1, 0, 0} - - engine "pixmap" { - - ############# - # LTR entry # - ############# - - image { - function = SHADOW - state = NORMAL - detail = "entry" - file = "assets/combo-entry-ltr-entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/combo-entry-ltr-entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/combo-entry-ltr-entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - ############# - # RTL entry # - ############# - - image { - function = SHADOW - state = NORMAL - detail = "entry" - file = "assets/combo-entry-rtl-entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/combo-entry-rtl-entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/combo-entry-rtl-entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - ############## - # LTR button # - ############## - - image { - function = BOX - state = NORMAL - detail = "button" - file = "assets/combo-entry-ltr-button.png" - border = {0, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = BOX - state = PRELIGHT - detail = "button" - file = "assets/combo-entry-ltr-button-hover.png" - border = {0, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = BOX - state = ACTIVE - detail = "button" - file = "assets/combo-entry-ltr-button-active.png" - border = {0, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = BOX - state = INSENSITIVE - detail = "button" - file = "assets/combo-entry-ltr-button-insensitive.png" - border = {0, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - ############## - # RTL button # - ############## - - image { - function = BOX - state = NORMAL - detail = "button" - file = "assets/combo-entry-rtl-button.png" - border = {4, 0, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = BOX - state = PRELIGHT - detail = "button" - file = "assets/combo-entry-rtl-button-hover.png" - border = {4, 0, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = BOX - state = ACTIVE - detail = "button" - file = "assets/combo-entry-rtl-button-active.png" - border = {4, 0, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = BOX - state = INSENSITIVE - detail = "button" - file = "assets/combo-entry-rtl-button-insensitive.png" - border = {4, 0, 4, 4} - stretch = TRUE - direction = RTL - } - - } - -} - -style "combo_button_padding" { - - # Since one side of the button is missing, we need to shift the arrow a - # little to the right. - # This is the same thing we've done above but the combo, unlike the combobox, - # uses padding the same way as a button. - GtkButton::inner-border = {6, 8, 4, 4} - -} - -style "notebook" { - - xthickness = 5 - ythickness = 2 - -} - -style "notebook_viewport" { - bg[NORMAL] = @base_color -} - -style "notebook_bg" { - bg[NORMAL] = @base_color - bg[PRELIGHT] = @base_color - bg[INSENSITIVE] = @base_color -} - -style "notebook_entry" { - - engine "pixmap" { - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/notebook-entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/notebook-entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - detail = "entry" - file = "assets/notebook-entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - } -} - -style "normal_bg" { - bg[NORMAL] = @bg_color - bg[PRELIGHT] = @bg_color - bg[INSENSITIVE] = @insensitive_bg_color -} - -style "normal_entry" { - - engine "pixmap" { - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - - image { - function = SHADOW - detail = "entry" - file = "assets/entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - } - } -} - -style "notebook_combo" { - - engine "pixmap" { - - ############# - # LTR entry # - ############# - - image { - function = SHADOW - state = NORMAL - detail = "entry" - file = "assets/notebook-combo-entry-ltr-entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/notebook-combo-entry-ltr-entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/notebook-combo-entry-ltr-entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = LTR - } - - ############# - # RTL entry # - ############# - - image { - function = SHADOW - state = NORMAL - detail = "entry" - file = "assets/notebook-combo-entry-rtl-entry.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = SHADOW - state = ACTIVE - detail = "entry" - file = "assets/notebook-combo-entry-rtl-entry-active.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - image { - function = SHADOW - state = INSENSITIVE - detail = "entry" - file = "assets/notebook-combo-entry-rtl-entry-insensitive.png" - border = {4, 4, 4, 4} - stretch = TRUE - direction = RTL - } - - } - -} - -style "textview" { - bg[NORMAL] = @base_color -} - -style "scale_horz" { - - engine "pixmap" { - - image { - function = BOX - detail = "trough-upper" - file = "assets/scale-horz-trough.png" - border = {10, 10, 0, 0} - stretch = TRUE - } - - image { - function = BOX - detail = "trough-lower" - file = "assets/scale-horz-trough-active.png" - border = {10, 10, 0, 0} - stretch = TRUE - } - - } - -} - -style "scale_vert" { - - engine "pixmap" { - - image { - function = BOX - detail = "trough-upper" - file = "assets/scale-vert-trough.png" - border = {0, 0, 10, 10} - stretch = TRUE - } - - image { - function = BOX - detail = "trough-lower" - file = "assets/scale-vert-trough-active.png" - border = {0, 0, 10, 10} - stretch = TRUE - } - - } - -} - -style "progressbar" { - - xthickness = 1 - ythickness = 1 - - fg[PRELIGHT] = @selected_fg_color - - engine "pixmap" { - - image { - function = BOX - detail = "trough" - file = "assets/progressbar-horz-trough.png" - border = {3, 3, 2, 2} - stretch = TRUE - orientation = HORIZONTAL - } - - image { - function = BOX - detail = "trough" - file = "assets/progressbar-vert-trough.png" - border = {2, 2, 3, 3} - stretch = TRUE - orientation = VERTICAL - } - - } - -} - -style "treeview_header" { - - xthickness = 1 - ythickness = 0 - - fg[NORMAL] = @column_header_color - fg[PRELIGHT] = @hover_column_header_color - - font_name = "Bold" - - GtkButton::inner-border = {5, 5, 0, 1} - - engine "pixmap" { - - image { - function = BOX - file = "assets/treeview-separator-ltr.png" - border = {0, 1, 0, 1} - stretch = TRUE - direction = LTR - } - - image { - function = BOX - file = "assets/treeview-separator-rtl.png" - border = {1, 0, 0, 1} - stretch = TRUE - direction = RTL - } - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/treeview-pan-up.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/treeview-pan-up-hover.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/treeview-pan-up-active.png" - overlay_stretch = FALSE - arrow_direction = UP - } - - image { - function = ARROW - state = NORMAL - overlay_file = "assets/treeview-pan-down.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = PRELIGHT - overlay_file = "assets/treeview-pan-down-hover.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - image { - function = ARROW - state = ACTIVE - overlay_file = "assets/treeview-pan-down-active.png" - overlay_stretch = FALSE - arrow_direction = DOWN - } - - } - -} - -style "scrolled_window" { - - engine "pixmap" { - image { - function = SHADOW - file = "assets/frame.png" - border = {1, 1, 1, 1} - stretch = TRUE - } - } - -} - -style "frame" { - - engine "pixmap" { - - image { - function = SHADOW - shadow = NONE - } - - image { - function = SHADOW - file = "assets/frame.png" - border = {1, 1, 1, 1} - stretch = TRUE - } - - image { - function = SHADOW_GAP - file = "assets/frame.png" - border = {1, 1, 1, 1} - stretch = TRUE - gap_start_file = "assets/border.png" - gap_end_file = "assets/border.png" - } - - } - -} - -style "toolbar_button" { - - xthickness = 2 - ythickness = 2 - - GtkButton::inner-border = {2, 2, 2, 2} - -} - -style "toolbar_separator" { - - GtkWidget::wide-separators = 1 - GtkWidget::separator-width = 1 - GtkWidget::separator-height = 1 - - engine "pixmap" { - image { - function = BOX - file = "assets/line.png" - } - } - -} - -style "inline_toolbar" { - - GtkToolbar::button-relief = GTK_RELIEF_NORMAL - - engine "pixmap" { - image { - function = SHADOW - file = "assets/frame-inline.png" - border = {1, 1, 0, 1} - stretch = TRUE - } - } - -} - -style "tooltip" { - - xthickness = 13 - ythickness = 13 - - bg[NORMAL] = @tooltip_bg_color - fg[NORMAL] = @tooltip_fg_color - bg[SELECTED] = @tooltip_bg_color - -} - -style "disable_separator" { - - xthickness = 0 - ythickness = 0 - - GtkWidget::wide-separators = 1 - -} - -# Default style, containing theme properties and trying to match every widget as -# much as possible, which is not only faster than trying to match every widget -# by its own but also less bug-prune and more consistent. However there is some -# widget specific stuff that needs to be taken care of, which is the point of -# every other style below. -class "GtkWidget" style "default" - - ###################################### - # Override padding, style and colour # - ###################################### - -class "GtkButton" style "button" -class "GtkLinkButton" style "link_button" -class "GtkEntry" style "entry" -class "GtkOldEditable" style "entry" -class "GtkNotebook" style "notebook" -class "GtkHScale" style "scale_horz" -class "GtkVScale" style "scale_vert" -class "GtkProgressBar" style "progressbar" -class "GtkScrolledWindow" style "scrolled_window" -class "GtkFrame" style "frame" -class "GtkSeparatorToolItem" style "toolbar_separator" -class "GtkMenuBar" style "menubar" -class "GtkMenu" style "menu" -class "GtkTextView" style "textview" - -# Menu and menubar items -widget_class "**" style "menu_item" -widget_class "*.*" style "menubar_item" -widget_class "**" style "separator_menu_item" - -# Treeview buttons -widget_class "***" style "treeview_header" - -# Give the file chooser toolbar a border -widget_class "**" style "inline_toolbar" - -# Fix padding on regular comboboxes -widget_class "*." style "combobox" -# And disable separators on them -widget_class "*.*" style "disable_separator" - -# Join together the ComboBoxEntry entry and button -widget_class "**" style "combobox_entry" - -# Join the Combo entry and button -widget_class "**" style "combobox_entry" -# Tweak the padding on the button a little bit because it -# uses it a bit differently -widget_class "*." style "combo_button_padding" - -# Alas we cannot do the same for ComboBoxText because there -# isn't a way to apply the style to only the comboboxes that -# have an entry inside - -# Toolbar buttons have different paddings -widget_class "**" style "toolbar_button" - -# Notebooks are white, act accordingly -widget_class "**" style "notebook_entry" -widget_class "**" style "notebook_bg" -widget_class "**" style "notebook_bg" -widget_class "***" style "notebook_bg" -widget_class "**" style "notebook_bg" -widget_class "*.*" style "notebook_bg" -widget_class "***" style "notebook_combo" -widget_class "***" style "notebook_combo" - -# However, stuff inside eventboxes inside notebooks is grey -# again, react -widget_class "***" style "normal_entry" -widget_class "***" style "normal_bg" -widget_class "***" style "normal_bg" -widget_class "****" style "combobox_entry" -widget_class "****" style "combobox_entry" -widget_class "***." style "combo_button_padding" - -# ComboBoxes tend to draw the button label with text[] -# instead of fg[], we need to fix that -widget_class "**" style "combobox_cellview" - -# GTK tooltips -widget "gtk-tooltip*" style "tooltip" diff --git a/hyfetch/hyfetch.json b/hyfetch/hyfetch.json deleted file mode 100644 index 142fc6b..0000000 --- a/hyfetch/hyfetch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "preset": "rainbow", - "mode": "rgb", - "light_dark": "dark", - "lightness": 0.65, - "color_align": { - "mode": "horizontal", - "custom_colors": [], - "fore_back": null - }, - "backend": "neofetch", - "args": null, - "distro": null, - "pride_month_shown": [], - "pride_month_disable": false -} \ No newline at end of file diff --git a/hypr/animation.conf b/hypr/animation.conf deleted file mode 100644 index 2ff8aa4..0000000 --- a/hypr/animation.conf +++ /dev/null @@ -1,12 +0,0 @@ - -#--------- animations --------------------------------------- -animations { - enabled = true - animation = windows, 1, 2, default - animation = windowsOut, 1, 2, default, popin 80% - animation = border, 1, 2, default - animation = borderangle, 1, 2, default - animation = fade, 1, 2, default - animation = workspaces, 1, 4, default,slidefade 20% -} -#------------------------------------------------------------ diff --git a/hypr/bin/background-swww.sh b/hypr/bin/background-swww.sh deleted file mode 100755 index ea6252b..0000000 --- a/hypr/bin/background-swww.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env sh -directory=~/Pictures/hyprpaper -monitors=`hyprctl monitors | grep Monitor | awk '{print $2}'` - -while [ true ]; do - if [ -d "$directory" ]; then - for monitor in $monitors; do - random_background=$(ls $directory/* | shuf -n 1) - - extention="${random_background##*.}" - echo $extention - if [[ "$extention" == "jpg" ]]; then - swww img -o $monitor $random_background --transition-type random - elif [[ "$extention" == "mp4" ]]; then - mpvpaper $monitor $random_background - fi - done - fi - sleep 30 -done - -#swww img -o VGA-1 /home/tola/Pictures/hyprpaper/calder-moore-aliencrack-01-copy.jpg --transition-type wipe diff --git a/hypr/bin/background.sh b/hypr/bin/background.sh deleted file mode 100755 index e2a3255..0000000 --- a/hypr/bin/background.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh -directory=~/Pictures/wallpaper -monitors=`hyprctl monitors | grep Monitor | awk '{print $2}'` - -echo $(ls $directory/*) - -while [ true ]; do - if [ -d "$directory" ]; then - for monitor in $monitors; do - random_background=$(ls $directory/* | shuf -n 1) - - hyprctl hyprpaper unload all - hyprctl hyprpaper preload $random_background - hyprctl hyprpaper wallpaper "$monitor, $random_background" - sleep 2 - done - fi - sleep 60 -done - diff --git a/hypr/bin/colors.sh b/hypr/bin/colors.sh deleted file mode 100644 index 088a13c..0000000 --- a/hypr/bin/colors.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh - -#--- reset colors --- -RESET="\033[0m" -#-------------------- - -#--------- regularcolrs --------- -GREEN="\033[0;32m" #GREEN -BLUE="\033[0;34m" #BLUE -YELLOW="\033[1;33m" #YELLOW -RED="\033[0;31m" #RED -BLACK="\033[0;30m" #BLACK -PURPLE="\033[0;35m" #PURPLE -CYAN="\033[0;36m" #CYAN -WHITE="\033[0;37m" #WHITE -#-------------------------------- - -#-------- bold ------------------ -BBLACK="\033[1;30m" #BLACK -BRED="\033[1;31m" #RED -BGREEN="\033[1;32m" #GREEN -BYELLOW="\033[1;33m" #YELLOW -BBLUE="\033[1;34m" #BLUE -BPURPLE="\033[1;35m" #PURPLE -BCYAN="\033[1;36m" #CYAN -BWHITE="\033[1;37m" #WHITE -#-------------------------------- - -#-------- Underline ------------- -UBLACK="\033[4;30m" #BLACK -URED="\033[4;31m" #RED -UGREEN="\033[4;32m" #GREEN -UYELLOW="\033[4;33m" #YELLOW -UBLUE="\033[4;34m" #BLUE -UPURPLE="\033[4;35m" #PURPLE -UCYAN="\033[4;36m" #CYAN -UWHITE="\033[4;37m" #WHITE -#-------------------------------- - -#--------- Background ----------- -ON_BLACK="\033[40m" #BLACK -ON_RED="\033[41m" #RED -ON_GREEN="\033[42m" #GREEN -ON_YELLOW="\033[43m" #YELLOW -ON_BLUE="\033[44m" #BLUE -ON_PURPLE="\033[45m" #PURPLE -ON_CYAN="\033[46m" #CYAN -ON_WHITE="\033[47m" #WHITE -#-------------------------------- - -#------ HighIntensity ----------- -IBLACK="\033[0;90m" #BLACK -IRED="\033[0;91m" #RED -IGREEN="\033[0;92m" #GREEN -IYELLOW="\033[0;93m" #YELLOW -IBLUE="\033[0;94m" #BLUE -IPURPLE="\033[0;95m" #PURPLE -ICYAN="\033[0;96m" #CYAN -IWHITE="\033[0;97m" #WHITE -#-------------------------------- - -#------ BoldHighIntensity ------- -BIBLACK="\033[1;90m" #BLACK -BIRED="\033[1;91m" #RED -BIGREEN="\033[1;92m" #GREEN -BIYELLOW="\033[1;93m" #YELLOW -BIBLUE="\033[1;94m" #BLUE -BIPURPLE="\033[1;95m" #PURPLE -BICYAN="\033[1;96m" #CYAN -BIWHITE="\033[1;97m" #WHITE -#-------------------------------- - -#--- HighIntensitybackgrounds --- -ON_IBLACK="\033[0;100m" #BLACK -ON_IRED="\033[0;101m" #RED -ON_IGREEN="\033[0;102m" #GREEN -ON_IYELLOW="\033[0;103m" #YELLOW -ON_IBLUE="\033[0;104m" #BLUE -ON_IPURPLE="\033[0;105m" #PURPLE -ON_ICYAN="\033[0;106m" #CYAN -ON_IWHITE="\033[0;107m" #WHITE -#-------------------------------- diff --git a/hypr/bin/hyprlock-background.sh b/hypr/bin/hyprlock-background.sh deleted file mode 100755 index c5c0edb..0000000 --- a/hypr/bin/hyprlock-background.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -ls ~/Pictures/wallpaper/*.png | shuf -n 1 - diff --git a/hypr/bin/songdetail.sh b/hypr/bin/songdetail.sh deleted file mode 100755 index 51745e6..0000000 --- a/hypr/bin/songdetail.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -song_info=$(playerctl metadata --format '{{title}}  {{artist}}') - -echo "$song_info" diff --git a/hypr/bin/startupdate.sh b/hypr/bin/startupdate.sh deleted file mode 100755 index 796eb67..0000000 --- a/hypr/bin/startupdate.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -. ~/dotfiles/hypr/bin/colors.sh - -kitty -e /bin/sh -c "printf '$BLUE==>$UGREEN Starting update system packages $BLUE<==$RESET\n'; sudo pacman -Syu; printf '$BLUE==>$UGREEN Successfull (Press any key to exit) $BLUE<==$RESET\n';read EXIT;" diff --git a/hypr/bin/toggle_keyboard.sh b/hypr/bin/toggle_keyboard.sh deleted file mode 100755 index a7c89b8..0000000 --- a/hypr/bin/toggle_keyboard.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -if [ ! -f ~/.keyboard_started ]; then - wvkbd-mobintl & - touch ~/.keyboard_started -else - killall wvkbd-mobintl - rm ~/.keyboard_started -fi - diff --git a/hypr/bin/toggle_weather_ags b/hypr/bin/toggle_weather_ags deleted file mode 100755 index 3cee912..0000000 --- a/hypr/bin/toggle_weather_ags +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if [ ! -f ~/.ags_weather ]; then - ags --bus-name weather -c ~/dotfiles/ags/weather/config.js & - touch ~/.ags_weather -else - ags --bus-name weather -c ~/dotfiles/ags/weather/config.js --quit - rm ~/.ags_weather -fi diff --git a/hypr/decoration.conf b/hypr/decoration.conf deleted file mode 100644 index 65b134d..0000000 --- a/hypr/decoration.conf +++ /dev/null @@ -1,19 +0,0 @@ - -#-------- decorations ------------ -decoration { - rounding = 10 - dim_inactive = true - blur { - enabled = false - size = 10 - passes = 1 - - vibrancy = 0.1696 - } - - drop_shadow = false - shadow_range = 50 - shadow_render_power = 3 - col.shadow = rgba(000000aa) -} -#--------------------------------- diff --git a/hypr/environment.conf b/hypr/environment.conf deleted file mode 100644 index 4fa5d9f..0000000 --- a/hypr/environment.conf +++ /dev/null @@ -1,20 +0,0 @@ -#------------- default env vars ----------------------------------------------- - -#------------- QT ------------------ -env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that -env = QT_QPA_PLATFORM,wayland -env = QT_SCALE_FACTOR,1 -#----------------------------------- - -#---------- GTK --------------- -env = GTK_THEME,Marwaita-Dark-Grey -env = GTK2_RC_FILES,~/.config/gtk-2.0/gtkrc -#------------------------------ - -#-------------------- hyprcursor ------------ -env = HYPRCURSOR_THEME,Bibata-Modern-Ice -env = HYPRCURSOR_SIZE,24 -#-------------------------------------------- - -#------------------------------------------------------------------------------ - diff --git a/hypr/hyprclock.conf b/hypr/hyprclock.conf deleted file mode 100644 index 7f875a2..0000000 --- a/hypr/hyprclock.conf +++ /dev/null @@ -1,9 +0,0 @@ -[General] -clock_format = "24-hour" - -[Theme] -theme = "Adwaita-dark" - -[Animation] -blur_enabled = true -fade_in_enabled = true diff --git a/hypr/hyprgrass.conf b/hypr/hyprgrass.conf deleted file mode 100644 index 5d58d01..0000000 --- a/hypr/hyprgrass.conf +++ /dev/null @@ -1,4 +0,0 @@ -plugin:touch_gestures { - hyprgrass-bind = , swipe:3:d, killactive - hyprgrass-bind = , tap:3, exec, kitty -} \ No newline at end of file diff --git a/hypr/hypridle.conf b/hypr/hypridle.conf deleted file mode 100644 index 0217020..0000000 --- a/hypr/hypridle.conf +++ /dev/null @@ -1,16 +0,0 @@ -general { - lock_cmd = pidof hyprlock || hyprlock - before_sleep_cmd = loginctl lock-session -} - -listener { - timeout = 600 - on-timeout = loginctl lock-session -} - -listener { - timeout = 7200 - on-timeout = hyprctl dispatch dpms off - on-timeout = hyprctl dispatch dpms on -} - diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf deleted file mode 100644 index 02c2b40..0000000 --- a/hypr/hyprland.conf +++ /dev/null @@ -1,58 +0,0 @@ -# Hypland config created by Anatoly Mironcenko - -source=~/.config/hypr/programs.conf -source=~/.config/hypr/keybinds.conf -source=~/dotfiles/hypr/hyprgrass.conf -source=~/.config/hypr/windowrules.conf -source=~/.config/hypr/startup.conf - -source=~/dotfiles/hypr/monitors.conf - -source=~/dotfiles/hypr/environment.conf - -source=~/dotfiles/hypr/keyboard.conf -#----------------------- system config --------------------------------- - -general { - gaps_in = 5 - gaps_out = 5 - border_size = 1 - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - col.inactive_border = rgba(595959aa) - - layout = dwindle - - allow_tearing = false - #apply_sens_to_raw = 0 -} - -source=~/dotfiles/hypr/decoration.conf - -source=~/dotfiles/hypr/animation.conf - -dwindle { - pseudotile = false - preserve_split = true # you probably want this -} - -gestures { - workspace_swipe = true - workspace_swipe_fingers = 3 - workspace_swipe_distance = 300 -} - -misc { - force_default_wallpaper = -1 # Set to 0 to disable the anime mascot wallpapers -} - -debug { - damage_tracking = 2 -} - -xwayland { - force_zero_scaling = true -} - -#device:epic-mouse-v1 { -# sensitivity = -0.5 -#} diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf deleted file mode 100644 index 92dacae..0000000 --- a/hypr/hyprlock.conf +++ /dev/null @@ -1,126 +0,0 @@ -# hyprlock.conf -# ------------------------------------------------------ -# HyprLock -# ........ - -background { - monitor = - path = /home/tola/Pictures/wallpaper/dunes-sun.png # only *.png supported for now - color = rgba(25, 20, 20, 1.0) - blur_passes = 4 # 0 disables blurring - blur_size = 2 - noise = 0.0117 - contrast = 0.8916 - brightness = 0.8172 - vibrancy = 0.1696 - vibrancy_darkness = 0.0 -} - -general { - no_fade_in = false - grace = 0 - disable_loading_bar = false -} - -# Profile Photo -image { - monitor = - path = ~/dotfiles/hypr/pictures/user.jpeg - border_size = 2 - border_color = rgba(255, 255, 255, 0) - size = 130 - rounding = -1 - rotate = 0 - reload_time = -1 - reload_cmd = - position = 0, 40 - halign = center - valign = center -} - -# Day Month Date -label { - monitor = - text = cmd[update:1000] echo "$(date +"%A %d %B %Y")" - color = rgba(200, 200, 200, 1.0) - font_size = 25 - font_family = SF Pro Display Bold - position = 0, 350 - halign = center - valign = center -} - -# Time -label { - monitor = - text = cmd[update:1000] echo "$(date +"%H:%M")" - color = rgba(200, 200, 200, 1.0) - font_size = 120 - font_family = SF Pro Display Bold - position = 0, 250 - halign = center - valign = center -} - -# User Box -shape { - monitor = - size = 300, 60 - color = rgba(255, 255, 255, .1) - rounding = -1 - border_size = 0 - border_color = rgba(253, 198, 135, 0) - rotate = 0 - xray = false # if true, make a "hole" in thej background (rectangle of specified size, no rotation) - position = 0, -130 - halign = center - valign = center -} - -# User -label { - monitor = - text =  $USER - color = rgba(216, 222, 233, 0.80) - outline_thickness = 2 - dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 - dots_spacing = 0.2 # Scale of dots absolute size, 0.0 - 1.0 - dots_center = true - font_size = 18 - font_family = SF Pro Display Bold - position = 0, -130 - halign = center - valign = center -} - -input-field { - monitor = - size = 300, 60 - outline_thickness = 2 - dots_size = 0.2 - dots_spacing = 0.2 - dots_center = true - outer_color = rgba(0, 0, 0, 0) - inner_color = rgba(255, 255, 255, 0.1) - font_color = rgb(200, 200, 200) - fade_on_empty = false - font_family = SF Pro Display Bold - placeholder_text = Enter Pass - hide_input = false - position = 0, -210 - halign = center - valign = center -} - -label { - monitor = - text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/songdetail.sh)" - color = rgba(255, 255, 255, 0.6) - font_size = 18 - font_family = JetBrains Mono Nerd, SF Pro Display Bold - position = 0, 50 - halign = center - valign = bottom -} - -# ------------------------------------------------------ diff --git a/hypr/hyprpanel/hyprpanel_config.json b/hypr/hyprpanel/hyprpanel_config.json deleted file mode 100644 index d876bd6..0000000 --- a/hypr/hyprpanel/hyprpanel_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "bar.customModules.updates.pollingInterval": 1440000, - "theme.bar.scaling": 75, - "theme.bar.floating": true, - "theme.osd.location": "bottom", - "theme.osd.orientation": "horizontal", - "theme.osd.margins": "0px 5px 15px 0px", - "bar.layouts": { - "*": { - "left": [ - "dashboard", - "cpu", - "ram", - "weather", - "storage", - "updates", - "windowtitle" - ], - "middle": [ - "workspaces" - ], - "right": [ - "media", - "volume", - "network", - "bluetooth", - "battery", - "systray", - "clock", - "notifications", - "power" - ] - } - }, - "theme.font.name": "JetBrainsMonoNL Nerd Font Propo", - "scalingPriority": "hyprland", - "theme.font.weight": 400, - "menus.dashboard.powermenu.avatar.image": "/home/tola/dotfiles/hypr/pictures/user.jpeg", - "menus.dashboard.stats.enable_gpu": true, - "theme.bar.menus.menu.dashboard.scaling": 85, - "theme.notification.scaling": 75, - "theme.bar.border_radius": "0.9em", - "theme.bar.margin_sides": "0.5em", - "theme.bar.buttons.radius": "0.9em", - "theme.bar.buttons.padding_x": "0.7rem", - "theme.bar.buttons.spacing": "0.2em", - "theme.bar.outer_spacing": "0.5em", - "menus.clock.weather.location": "Tomsk", - "menus.clock.weather.unit": "metric", - "menus.clock.weather.key": "c594dc0d97cc470485474811240409", - "bar.customModules.weather.unit": "metric", - "bar.customModules.updates.leftClick": "~/dotfiles/hypr/bin/startupdate.sh", - "wallpaper.pywal": true, - "theme.bar.menus.monochrome": false, - "theme.bar.transparent": false, - "theme.bar.opacity": 80, - "theme.bar.buttons.opacity": 100, - "theme.bar.buttons.monochrome": false, - "theme.matugen": true, - "wallpaper.image": "/home/tola/Pictures/wallpaper/astronaut_jellyfish.jpg", - "theme.matugen_settings.mode": "dark", - "theme.matugen_settings.scheme_type": "monochrome", - "menus.dashboard.directories.left.directory1.command": "bash -c \"thunar $HOME/Downloads/\"", - "menus.dashboard.directories.left.directory2.command": "bash -c \"thunar $HOME/Videos/\"", - "menus.dashboard.directories.left.directory3.command": "bash -c \"thunar $HOME/Projects/\"", - "menus.dashboard.directories.right.directory1.command": "bash -c \"thunar $HOME/Documents/\"", - "menus.dashboard.directories.right.directory2.command": "bash -c \"thunar $HOME/Pictures/\"", - "menus.dashboard.directories.right.directory3.command": "bash -c \"thunar $HOME/\"" -} \ No newline at end of file diff --git a/hypr/hyprpanel/hyprpanel_theme.json b/hypr/hyprpanel/hyprpanel_theme.json deleted file mode 100644 index a8a3dbd..0000000 --- a/hypr/hyprpanel/hyprpanel_theme.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "theme.bar.buttons.style": "default", - "theme.bar.menus.menu.media.card.color": "#303030" -} \ No newline at end of file diff --git a/hypr/hyprpaper.conf b/hypr/hyprpaper.conf deleted file mode 100644 index 4aef3ed..0000000 --- a/hypr/hyprpaper.conf +++ /dev/null @@ -1,2 +0,0 @@ -preload = ~/Pictures/wallpaper/astronaut_jellyfish.jpg -wallpaper = , ~/Pictures/wallpaper/astronaut_jellyfish.jpg \ No newline at end of file diff --git a/hypr/keybinds.conf b/hypr/keybinds.conf deleted file mode 100644 index ceacf98..0000000 --- a/hypr/keybinds.conf +++ /dev/null @@ -1,174 +0,0 @@ -#-------------------------- keybinds ------------------------------ - -#--- modkey --- -$mainMod = ALT -#-------------- - -#---------------- applications --------------------- -bind = $mainMod, Return, exec, $terminal -bind = $mainMod, T, exec, $fileManager -bind = $mainMod, D, exec, $menu -bind = , XF86LaunchB, exec, $menu -bind = $mainMod, B, exec, $locker -bind = $mainMod, G, exec, $browser -bind = $mainMod, A, exec, telegram-desktop -bind = $mainMod, P, exec, $dashboard -bind = $mainMod, C, exec, $clipboard -bind = $mainMod SHIFT, P, exec, $powermenu -bind = $mainMod SHIFT, O, exec, $onscreenkeyboard -bind = $mainMod, S, exec, spotify-launcher -bind = $mainMod, Y, exec, $calculator -bind = $mainMod, E, exec, $emojipicker -bind = $mainMod, M, exec, ~/dotfiles/ags/media/toggle_media -bind = $mainMod, Z, exec, swaync-client -t -bind = $mainMod SHIFT, R, exec, swaync-client -R -bind = $mainMod, U, exec, ~/dotfiles/hypr/bin/startupdate.sh -bind = $mainMod, O, exec, code ~/dotfiles -#--------------------------------------------------- - -#-------------- windows -------------------------- -# bind = $mainMod, J, togglesplit, # dwindle -bind = $mainMod, F, fullscreen, -bind = $mainMod, V, togglefloating, -bind = $mainMod, Q, killactive, -#------------------------------------------------- - -#-------- quit from Hyprland --------- -bind = $mainMod SHIFT, E, exit, -#------------------------------------- - -#---------------- screenshot ---------------------------------------- -bind = $mainMod SHIFT, C, exec, grim -g "$(slurp -d)" - | wl-copy -bind = $mainMod, P, exec, grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y%m%d-%H%M%S).png -bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy -#-------------------------------------------------------------------- - -#--------------- pamixer -------------------- -# bind = $mainMod, equal, exec, pamixer -i 10 -# bind = $mainMod, minus, exec, pamixer -d 10 -# bind = $mainMod SHIFT, M, exec, pamixer -t -bind = $mainMod, equal, exec, swayosd-client --output-volume raise -bind = $mainMod, minus, exec, swayosd-client --output-volume lower -bind = $mainMod SHIFT, M, exec, swayosd-client --output-volume mute-toggle -#------------------- for xf86AudioVolumes ----------- -# bind = , XF86AudioLowerVolume, exec, pamixer -d 5 -# bind = , XF86AudioRaiseVolume, exec, pamixer -i 5 -# bind = , XF86AudioMicMute, exec, pamixer --default-source -m -# bind = , XF86AudioMute, exec, pamixer -t -bind = , XF86AudioLowerVolume, exec, swayosd-client --output-volume lower -bind = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise -bind = , XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle -bind = , XF86AudioMute, exec, swayosd-client --output-volume mute-toggle - -bind = , XF86AudioPlay, exec, playerctl play-pause -bind = , XF86AudioPause, exec, playerctl play-pause -bind = , XF86AudioNext, exec, playerctl next -bind = , XF86AudioPrev, exec, playerctl previous - -bind = $mainMod, bracketleft, exec, playerctl previous -bind = $mainMod, bracketright, exec, playerctl next -bind = $mainMod, backslash, exec, playerctl play-pause -#---------------------------------------------------- -#-------------------------------------------- - -#--------------- playerctl --------------------------- -bind = $mainMod, space, exec, playerctl play-pause -bind = , Pause, exec, playerctl play-pause -#----------------------------------------------------- - -#------------------ brightness ---------------------- -# bind = $mainMod SHIFT, minus, exec, brightnessctl s 10%- -# bind = $mainMod SHIFT, equal, exec, brightnessctl s 10%+ -bind = $mainMod SHIFT, minus, exec, swayosd-client --brightness lower -bind = $mainMod SHIFT, equal, exec, swayosd-client --brightness raise -#------------ for xf86MonBrightness ----------------- -# bind = , XF86MonBrightnessDown, exec, brightnessctl s 10%- -# bind = , XF86MonBrightnessUp, exec, brightnessctl s 10%+ -bind = , XF86MonBrightnessDown, exec, swayosd-client --brightness lower -bind = , XF86MonBrightnessUp, exec, swayosd-client --brightness raise -#---------------------------------------------------- -#-------------- for XF86KbdBrightness keyboard brightness --------------- -bind = , XF86KbdBrightnessUp, exec, brightnessctl --device smc::kbd_backlight s 10%+ -bind = , XF86KbdBrightnessDown, exec, brightnessctl --device smc::kbd_backlight s 10%- -#------------------------------------------------------------------------ -#---------------------------------------------------- - -#----------------- Move focus ---------- -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -bind = $mainMod, J, movefocus, d -bind = $mainMod, K, movefocus, u -bind = $mainMod, H, movefocus, l -bind = $mainMod, L, movefocus, r -#--------------------------------------- - -#---- Move windows --------------------------- -bind = $mainMod SHIFT, lift, movewindow, l -bind = $mainMod SHIFT, right, movewindow, r -bind = $mainMod SHIFT, up, movewindow, u -bind = $mainMod SHIFT, down, movewindow, d - -bind = $mainMod SHIFT, J, movewindow, d -bind = $mainMod SHIFT, K, movewindow, u -bind = $mainMod SHIFT, H, movewindow, l -bind = $mainMod SHIFT, L, movewindow, r -#--------------------------------------------- - -#--------- Switch workspaces ------------------------- -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 -bind = Control_L $mainMod, Right, workspace, e+1 -bind = Control_L $mainMod, Left, workspace, e-1 -#----------------------------------------------------- - -#------------- Move active window to a workspace --- -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 -#--------------------------------------------------- - -#------------ Move/resize windows ---------- -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -bind=$mainMod, R, submap, resize -submap=resize -binde= , H, resizeactive, -30 0 -binde= , L, resizeactive, 30 0 -binde= , J, resizeactive, 0 -30 -binde= , K, resizeactive, 0 30 -binde= , left, resizeactive, -30 0 -binde= , right, resizeactive, 30 0 -binde= , up, resizeactive, 0 -30 -binde= , down, resizeactive, 0 30 -bind= , escape, submap, reset -submap=reset -#------------------------------------------- - -#-------------- special workspace (scratchpad) --------------- -bind = $mainMod, W, togglespecialworkspace, magic -bind = $mainMod SHIFT, W, movetoworkspace, special:magic -#------------------------------------------------------------- - -#------------------------------------------------------------------ diff --git a/hypr/keyboard.conf b/hypr/keyboard.conf deleted file mode 100644 index 2d4b1ed..0000000 --- a/hypr/keyboard.conf +++ /dev/null @@ -1,22 +0,0 @@ -# --------------- keyboard ----------------------- -input { - kb_layout = us,ru - kb_variant = - kb_model = - kb_options = grp:win_space_toggle - kb_rules = - - follow_mouse = 1 - - touchpad { - disable_while_typing = true - natural_scroll = true - scroll_factor = 0.2 - } - - repeat_rate = 50 - repeat_delay = 500 - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. -} -# ------------------------------------------------ diff --git a/hypr/monitors.conf b/hypr/monitors.conf deleted file mode 100644 index c930a13..0000000 --- a/hypr/monitors.conf +++ /dev/null @@ -1,6 +0,0 @@ -#-------- monitors ------------ -monitor=,preferred,auto,auto -monitor=DVI-I-1,1920x1200,0x0,1 -monitor=HEADLESS-2,2048x1538,0x0,2 -#------------------------------ - diff --git a/hypr/pictures/user.jpeg b/hypr/pictures/user.jpeg deleted file mode 100644 index 38fdacd..0000000 Binary files a/hypr/pictures/user.jpeg and /dev/null differ diff --git a/hypr/programs.conf b/hypr/programs.conf deleted file mode 100644 index 0f81585..0000000 --- a/hypr/programs.conf +++ /dev/null @@ -1,12 +0,0 @@ -#---------------- programs -------------------------------------- -$powermenu = ~/dotfiles/rofi/powermenu/powermenu.sh -$terminal = kitty -$fileManager = thunar -$menu = ~/dotfiles/rofi/launcher/launcher.sh -$locker = hyprlock -$browser = google-chrome-stable -$clipboard = ~/dotfiles/rofi/clipboard/clipboard.sh -$emojipicker = ~/dotfiles/rofi/emoji/rofimoji.sh -$onscreenkeyboard = ~/dotfiles/hypr/bin/toggle_keyboard.sh -$calculator = gnome-calculator -#---------------------------------------------------------------- diff --git a/hypr/startup.conf b/hypr/startup.conf deleted file mode 100644 index cdffe1e..0000000 --- a/hypr/startup.conf +++ /dev/null @@ -1,36 +0,0 @@ -#---------- on startup ------------------------------------------------------------ - -#----------- wallpaper ----------------- -exec-once = hyprpaper -exec-once = ~/dotfiles/hypr/bin/background.sh -exec-once = ags -#exec-once = waybar -c ~/dotfiles/waybar/config -#exec-once = swww init -#exec-once = ~/dotfiles/background-swww.sh -#--------------------------------------- - -#-------- polkit ------ -exec-once = lxpolkit -#---------------------- - -#------------------------------ GTK settings ------------------------------------ -exec-once = gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark' -exec-once = gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' -exec-once = gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' -exec-once = gsettings set org.gnome.desktop.interface cursor-theme 'Bibata-Modern-Ice' -#------------------------------ GTK settings ------------------------------------ - -#-------------------------- XDG settings -------------------------------------------------------- -exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -#------------------------------------------------------------------------------------------------ - -# exec-once = swaync -# exec-once = ~/dotfiles/ags/notification-popups/start_notification_service -# exec-once = mako -exec-once = nm-applet --indicator -exec-once = greenclip daemon -exec-once = uxplay -exec-once = hypridle -exec-once = swayosd-server -#---------------------------------------------------------------------------------- diff --git a/hypr/windowrules.conf b/hypr/windowrules.conf deleted file mode 100644 index 7f69b72..0000000 --- a/hypr/windowrules.conf +++ /dev/null @@ -1,37 +0,0 @@ -#------------------- windowrules -------------------------------------------------- - -#---------------------- float --------------------------------------------------- -windowrulev2 = float, title: Properties -windowrulev2 = float, class: ^(thunar)$, title: ^(File Operation Progress)$ -windowrulev2 = float, class: ^(thunar)$, title: ^(Confirm to replace files)$ -windowrule = float, org.pulseaudio.pavucontrol -windowrule = float, ^(nm-connection-editor)$ -windowrule = float, ^(GParted)$ -windowrule = float, startapp -windowrule = float, virtualbox -windowrule = float, Bubbletime -windowrule = float, Calculator -#-------------------------------------------------------------------------------- - -#--------------- opacity --------------------------------- -windowrule = opacity 0.90, sublime -windowrule = opacity 0.90, firefox -windowrule = opacity 0.9, thunar -windowrule = opacity 0.8, foot -windowrulev2 = opacity 0.80 0.80, class:^(org.telegram.desktop)$ -windowrule = opacity 0.9, balenaEtcher -windowrule = opacity 0.95, planify -windowrule = opacity 0.9, kitty -windowrulev2 = opacity 1, class: ^(Google-chrome)$ -#--------------------------------------------------------- - -#---------------- workspace ------------------------------ -windowrule = workspace 2, firefox -#windowrulev2 = workspace 2, class: ^(Google-chrome)$ -#--------------------------------------------------------- - -layerrule = animation popin, rofi -layerrule = animation slide right, swaync -layerrule = animation slide top, ags - -#---------------------------------------------------------------------------------- diff --git a/install_scripts/install-arch.sh b/install_scripts/install-arch.sh deleted file mode 100755 index d52beff..0000000 --- a/install_scripts/install-arch.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh - -# ---- colors ---- -RESET='\033[0m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -# ---------------- - -# ----- variables ---- -disk="/dev/sda" -efi_part_size=500 -swap_size=8192 -hostname="arch" -normal_user="tola" -rootfstype="btrfs" -answer=n -# ------------------- - -# -------------- cheking system ----------------- -printf "$YELLOW ::$GREEN Cheking system$RESET " -if [[ $(uname) != "Linux" ]]; then - printf "$RED This is working only on Linux systems (only Arch Linux)\n$RESET" - exit 1 -fi -printf "[$GREEN OK $RESET]\n" -# ---------------------------------------------- - -# ---------- cheking root ---------------------- -printf "$YELLOW ::$GREEN Cheking permissions$RESET " -if [[ "$(id -u)" != "0" ]]; then - printf "$RED ERROR:$RESET You must be root\n" - exit 1 -fi -printf "[$GREEN OK $RESET]\n" -# --------------------------------------------- - -# --------------- cheking disk --------------- -printf "$YELLOW Your disk is $disk?$RESET ($(echo $GREEN)y$RESET/$(echo $RED)n$RESET): " -read answer -if [[ "$answer" != "y" ]];then - printf "$RED ERROR:$RESET Please Write your disk name in this script.\n" - exit 1 -fi -# ------------------------------------------- - -# ---- umounting disks ---- -umount ${disk}* -# ------------------------- - -# --------- partitioning disks ------------------- -wipefs -af $disk - -printf "g\nn\n1\n2048\n$((($efi_part_size+1)*2048))\nn\n2\n$(((($efi_part_size+1)*2048)+2048))\n$(((($efi_part_size+1)*2048)+4096))\nn\n3\n$(((($efi_part_size+1)*2048)+6144))\n$((((($efi_part_size+1)*2048)+6144)+($swap_size*2048)))\nn\n4\n\n\nt\n1\nEFI System\nt\n2\nBIOS boot\nt\n3\nLinux swap\nt\n4\nLinux filesystem\nw\n" | fdisk $disk -# ------------------------------------------------ - -# --------------- formatting partitions ----------- -mkfs.vfat -F 32 ${disk}1 -mkswap ${disk}3 -[ "$rootfstype" == "ext4" ] && mkfs.ext4 ${disk}4 -[ "$rootfstype" == "btrfs" ] && mkfs.btrfs -L arch -f ${disk}4 -# ------------------------------------------------- - -# ----------- mounting partitions ----------------- -mount ${disk}4 /mnt -mkdir -p /mnt/boot/EFI -mount ${disk}1 /mnt/boot/EFI -swapon ${disk}3 -# ------------------------------------------------- - -# ------------ installing the system -------------- -printf "$YELLOW ::$GREEN Installing the system$RESET\n" -pacstrap /mnt base base-devel linux linux-firmware vim -# ------------------------------------------------- - -# ---------------- system configuration -------------------- -printf "$YELLOW ::$GREEN System configuration$RESET\n" -# ----- generating fstab ------------------- -printf "$YELLOW ::$GREEN Geerating fstab$RESET\n" -genfstab -U /mnt > /mnt/etc/fstab -# ------------------------------------------ - -# ----- installing timezone ---------------- -printf "$YELLOW ::$GREEN Installing timezone$RESET\n" -arch-chroot /mnt bash -c 'ln -svf /usr/share/zoneinfo/Asia/Novosibirsk /etc/localtime' -# ------------------------------------------ - -# ------ configuring system clock --------------- -printf "$YELLOW ::$GREEN Configuring system clock$RESET\n" -arch-chroot /mnt bash -c 'hwclock --systohc --utc' -# ----------------------------------------------- - -# ------- installing locale ------------------ -printf "$YELLOW ::$GREEN Installing locale$RESET\n" -arch-chroot /mnt bash -c 'printf "en_US.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8" >> /etc/locale.gen;locale-gen' -arch-chroot /mnt bash -c 'printf "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8" > /etc/locale.conf' -# -------------------------------------------- - -# -------- configuring console ---------------------- -printf "$YELLOW ::$GREEN Configuring console$RESET\n" -arch-chroot /mnt bash -c 'printf "FONT=Lat2-Terminus16\nKEYMAP=ruwin_alt_sh-UTF-8" > /etc/vconsole.conf' -# --------------------------------------------------- - -# ----- configuring networking hostname and hosts ------- -printf "$YELLOW ::$GREEN Installing hostname and hosts$RESET\n" -arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'echo $hostname > /etc/hostname' -arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'printf "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 ${hostname}.localdomain ${hostname}" >> /etc/hosts' -# ------------------------------------------------------- - -# ----- installing root password and normal user ----------------------- -printf "$YELLOW ::$GREEN Installing root password and normal user$RESET\n" -arch-chroot /mnt /usr/bin/env -i arch_user=$normal_user bash -c 'passwd;useradd -m -g users -G wheel -s /bin/bash $arch_user;passwd $arch_user' -# ---------------------------------------------------------------------- - -# ------------ installing and configuring sudo ------------------- -printf "$YELLOW ::$GREEN Installing and configuring sudo$RESET\n" -arch-chroot /mnt bash -c 'pacman -S sudo;echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers' -# ------------------------------------------------- - -# ----------- installing and configuring grub ---------- -printf "$YELLOW ::$GREEN Installing and configuring grub$RESET\n" -arch-chroot /mnt /usr/bin/env -i grubdisk=$disk bash -c 'pacman -S grub efibootmgr os-prober;grub-install $grubdisk;grub-mkconfig -o /boot/grub/grub.cfg' -# ------------------------------------------------------ - -# --------- installing and enabling networkmanager -------------------- -printf "$YELLOW ::$GREEN Installing and configuring NetworkManager$RESET\n" -arch-chroot /mnt bash -c 'pacman -S netctl dhcpcd networkmanager network-manager-applet;systemctl enable NetworkManager' -# -------------------------------------------------------- - -# ------ deps for connecting iphone ---------------------- -printf "$YELLOW ::$GREEN Installing dependencies for connecting iphone$RESET\n" -arch-chroot /mnt bash -c 'pacman -S libimobiledevice usbmuxd' -# ------------------------------------------------------- - -# ---------------------------------------------------------- - -# -- umounting filesystem --- -# printf "$YELLOW ::$GREEN Unmounting filesystem$RESET\n" -#umount -R /mnt -# --------------------------- - diff --git a/install_scripts/install-deps.sh b/install_scripts/install-deps.sh deleted file mode 100755 index b27a6db..0000000 --- a/install_scripts/install-deps.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh - -# ---- colors ---- -RESET='\033[0m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -# ---------------- - -# ------------ cheking system ------------------------------ -if [[ $(uname) != "Linux" ]]; then - printf "$RED This is working only on Linux systems (only Arch Linux)\n$RESET" - exit 1 -fi -# ---------------------------------------------------------- - -# ---------------- upgrading system ------------------------ -printf "$GREEN upgrading system...\n$RESET" -sudo pacman -Syu -if [ $? ]; then - printf "$GREEN upgrading system success $RESET[$GREEN ok $RESET]\n" -else - printf "$RED upgrading system not success $RESET[$RED err $RESET]\n" - exit 1 -fi -# ----------------------------------------------------------- - -# -------------------- installing deps ---------------------------- -printf "$GREEN installing deps... (vim, rofi-wayland, hyprland, waybar, ly, mako, neofetch, ranger, kitty, alacritty, hyprpaper rofimoji)\n$RESET" -sudo pacman -S \ - vim \ - rofi-wayland \ - rofimoji \ - hyprland \ - hyprpaper \ - waybar \ - ly \ - mako \ - neofetch \ - ranger \ - kitty \ - alacritty \ - playerctl -if [ $? ]; then - printf "$GREEN installing deps success $RESET[$GREEN ok $RESET]\n" -else - printf "$RED installing deps not success $RESET[$RED err $RESET]\n" - exit 1 -fi -# ------------------------------------------------------------------ - -# -------------- installing paru --------------- -printf "$GREEN installing paru...\n$RESET" -sudo pacman -S --needed base-devel -git clone https://aur.archlinux.org/paru.git -cd paru -makepkg -si -if [ $? ]; then - printf "$GREEN installing paru success $RESET[$GREEN ok $RESET]\n" -else - printf "$RED installing paru not success $RESET[$RED err $RESET]\n" - exit 1 -fi -# ---------------------------------------------- - -# ---------------------- installing deps from AUR ------------------------ -printf "$GREEN installing deps from AUR... (rofi-greenclip, hyprlock)\n$RESET" -paru -S rofi-greenclip hyprlock waybar-module-pacman-updates-git -if [ $? ]; then - printf "$GREEN installing deps from AUR success $RESET[$GREEN ok $RESET]\n" -else - printf "$RED installing deps from AUR not success $RESET[$RED err $RESET]\n" - exit 1 -fi -# ------------------------------------------------------------------------ - diff --git a/install_scripts/install-nfs-config.sh b/install_scripts/install-nfs-config.sh deleted file mode 100755 index 2c5dada..0000000 --- a/install_scripts/install-nfs-config.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -if [ -f /etc/exports ]; then - printf "please create copy of your old config /etc/exports and delete file /etc/exports\n" - exit 1 -fi - -if [ ! -d ~/dotfiles ]; then - printf "please rename your directory of hyprland_dotfiles repository to ~/dotfiles\n" - exit 1 -fi -sudo -E ln -sv ~/dotfiles/nfs/exports /etc/ - diff --git a/install_scripts/install-samba-config.sh b/install_scripts/install-samba-config.sh deleted file mode 100755 index fd6983e..0000000 --- a/install_scripts/install-samba-config.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -if [ -f /etc/samba/smb.conf ]; then - printf "please create copy of your old config /etc/samba/smb.conf and delete file /etc/samba/smb.conf\n" - exit 1 -fi - -if [ ! -d ~/dotfiles ]; then - printf "please rename your directory of hyprland_dotfiles repository to ~/dotfiles\n" - exit 1 -fi -sudo -E ln -sv ~/dotfiles/samba/smb.conf /etc/samba/ diff --git a/install_scripts/install.sh b/install_scripts/install.sh deleted file mode 100755 index d3bd616..0000000 --- a/install_scripts/install.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/sh - -# ---- colors ---- -RESET='\033[0m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -# ---------------- - -# ---------------- cheking system --------------------------- -if [[ $(uname) != "Linux" ]]; then - printf "$RED This is working only on Linux systems (only Arch Linux)\n$RESET" - exit 1 -fi -# ---------------------------------------------------------- - -# -------------- ~/.config/hypr ---------------------------- -printf "$GREEN installing hyprland configuration...$RESET" -if [ ! -d ~/.config/hypr ]; then - ln -sv ~/dotfiles/hypr ~/.config/hypr &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# ---------------------- ~/.config/waybar ------------------- -printf "$GREEN installing waybar configuration...$RESET" -if [ ! -d ~/.config/waybar ]; then - ln -sv ~/dotfiles/waybar ~/.config/waybar &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# -------------- ~/.config/mako ----------------------------- -printf "$GREEN installing mako configuration...$RESET" -if [ ! -d ~/.config/mako ]; then - ln -sv ~/dotfiles/mako ~/.config/mako &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# -------------------- /etc/ly/config.ini ------------------- -printf "$GREEN installing ly configuration...$RESET" -if [ ! -f /etc/ly/config.ini ]; then - sudo ln -sv ~/dotfiles/ly/config.ini /etc/ly/config.ini &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# ----------------- ~/.config/cava -------------------------- -printf "$GREEN installing cava configuration...$RESET" -if [ ! -d ~/.config/cava ]; then - ln -sv ~/dotfiles/cava ~/.config/cava &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# --------------- ~/.config/greenclip.toml ------------------ -printf "$GREEN installing greenclip configuration...$RESET" -if [ ! -f ~/.config/greenclip.toml ]; then - ln -sv ~/dotfiles/greenclip/greenclip.toml ~/.config/greenclip.toml &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ----------------------------------------------------------- - -# ------------------------ ~/.config/alacritty -------------- -printf "$GREEN installing alacritty configuration...$RESET" -if [ ! -d ~/.config/alacritty ]; then - ln -sv ~/dotfiles/alacritty ~/.config/alacritty &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------ - -# -------------------- ~/.vimrc ------------------------------ -printf "$GREEN installing vim configuration...$RESET" -if [ ! -f ~/.vimrc ]; then - ln -sv ~/dotfiles/vimrc ~/.vimrc &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# -------------------- ~/.config/neofetch ------------------------------ -printf "$GREEN installing neofetch configuration...$RESET" -if [ ! -d ~/.config/neofetch ]; then - ln -sv ~/dotfiles/neofetch ~/.config/neofetch &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# -------------------- ~/.config/ranger ------------------------------ -printf "$GREEN installing ranger configuration...$RESET" -if [ ! -d ~/.config/ranger ]; then - ln -sv ~/dotfiles/ranger ~/.config/ranger &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# -------------------- ~/.config/kitty ------------------------------ -printf "$GREEN installing kitty configuration...$RESET" -if [ ! -d ~/.config/kitty ]; then - ln -sv ~/dotfiles/kitty ~/.config/kitty &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# -------------------- ~/.config/rofimoji.rc ------------------------------ -printf "$GREEN installing rofimoji configuration...$RESET" -if [ ! -f ~/.config/rofimoji.rc ]; then - ln -sv ~/dotfiles/rofi/emoji/rofimoji.rc ~/.config/rofimoji.rc &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# -------------------- ~/.config/fastfetch ------------------------------ -printf "$GREEN installing fastfetch configuration...$RESET" -if [ ! -d ~/.config/fastfetch ]; then - ln -sv ~/dotfiles/fastfetch ~/.config/fastfetch &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# ------------------- ~/.config/picom ------------------------- -printf "$GREEN installing picom configuration...$RESET" -if [ ! -d ~/.config/picom ]; then - ln -sv ~/dotfiles/picom ~/.config/picom &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - -# ------------------- ~/.config/dunst ------------------------- -printf "$GREEN installing dunst configuration...$RESET" -if [ ! -d ~/.config/dunst ]; then - ln -sv ~/dotfiles/dunst ~/.config/dunst &> /dev/null - printf "[$GREEN ok $RESET]\n" -else - printf "[$YELLOW warn $RESET]\n$YELLOW backup your configuration, delete the folder and try again$RESET\n" -fi -# ------------------------------------------------------------- - diff --git a/kitty/kitty.conf b/kitty/kitty.conf deleted file mode 100644 index 254c7f1..0000000 --- a/kitty/kitty.conf +++ /dev/null @@ -1,19 +0,0 @@ - -#------------- font ------------- -font_family JetBrainsMono -bold_font JetBrainsMono -italic_font JetBrainsMono -bold_italic_font JetBrainsMono -#-------------------------------- - -#----- padding -------- -window_padding_width 5 -#---------------------- - -#----- opacity -------- -background_opacity 0.8 -#---------------------- - -#---- back blur --- -background_blur 10 -#------------------ diff --git a/kitty/kitty1.conf b/kitty/kitty1.conf deleted file mode 100644 index 100456c..0000000 --- a/kitty/kitty1.conf +++ /dev/null @@ -1,12 +0,0 @@ - -# ----------------- font ------ -font_family JetBrainsMono -#------------------------------ - -#---- opacity --------- -background_opacity 0.7 -#---------------------- - -#---- back blur --- -background_blur 1 -#------------------ diff --git a/lfs/mkinitramfs/init.in b/lfs/mkinitramfs/init.in deleted file mode 100644 index 66158d2..0000000 --- a/lfs/mkinitramfs/init.in +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh - -PATH=/usr/bin:/usr/sbin -export PATH - -problem() -{ - printf "Encountered a problem!\n\nDropping you to a shell.\n\n" - sh -} - -no_device() -{ - printf "The device %s, which is supposed to contain the\n" $1 - printf "root file system, does not exist.\n" - printf "Please fix this problem and exit this shell.\n\n" -} - -no_mount() -{ - printf "Could not mount device %s\n" $1 - printf "Sleeping forever. Please reboot and fix the kernel command line.\n\n" - printf "Maybe the device is formatted with an unsupported file system?\n\n" - printf "Or maybe filesystem type autodetection went wrong, in which case\n" - printf "you should add the rootfstype=... parameter to the kernel command line.\n\n" - printf "Available partitions:\n" -} - -do_mount_root() -{ - mkdir /.root - [ -n "$rootflags" ] && rootflags="$rootflags," - rootflags="$rootflags$ro" - - case "$root" in - /dev/* ) device=$root ;; - UUID=* ) eval $root; device="/dev/disk/by-uuid/$UUID" ;; - PARTUUID=*) eval $root; device="/dev/disk/by-partuuid/$PARTUUID" ;; - LABEL=* ) eval $root; device="/dev/disk/by-label/$LABEL" ;; - "" ) echo "No root device specified." ; problem ;; - esac - - while [ ! -b "$device" ] ; do - no_device $device - problem - done - - if ! mount -n -t "$rootfstype" -o "$rootflags" "$device" /.root ; then - no_mount $device - cat /proc/partitions - while true ; do sleep 10000 ; done - else - echo "Successfully mounted device $root" - fi -} - -do_try_resume() -{ - case "$resume" in - UUID=* ) eval $resume; resume="/dev/disk/by-uuid/$UUID" ;; - LABEL=*) eval $resume; resume="/dev/disk/by-label/$LABEL" ;; - esac - - if $noresume || ! [ -b "$resume" ]; then return; fi - - ls -lH "$resume" | ( read x x x x maj min x - echo -n ${maj%,}:$min > /sys/power/resume ) -} - -init=/sbin/init -root= -rootdelay= -rootfstype=auto -ro="ro" -rootflags= -device= -resume= -noresume=false - -mount -n -t devtmpfs devtmpfs /dev -mount -n -t proc proc /proc -mount -n -t sysfs sysfs /sys -mount -n -t tmpfs tmpfs /run - -read -r cmdline < /proc/cmdline - -for param in $cmdline ; do - case $param in - init=* ) init=${param#init=} ;; - root=* ) root=${param#root=} ;; - rootdelay=* ) rootdelay=${param#rootdelay=} ;; - rootfstype=*) rootfstype=${param#rootfstype=} ;; - rootflags=* ) rootflags=${param#rootflags=} ;; - resume=* ) resume=${param#resume=} ;; - noresume ) noresume=true ;; - ro ) ro="ro" ;; - rw ) ro="rw" ;; - esac -done - -# udevd location depends on version -if [ -x /sbin/udevd ]; then - UDEVD=/sbin/udevd -elif [ -x /lib/udev/udevd ]; then - UDEVD=/lib/udev/udevd -elif [ -x /lib/systemd/systemd-udevd ]; then - UDEVD=/lib/systemd/systemd-udevd -else - echo "Cannot find udevd nor systemd-udevd" - problem -fi - -${UDEVD} --daemon --resolve-names=never -udevadm trigger -udevadm settle - -if [ -f /etc/mdadm.conf ] ; then mdadm -As ; fi -if [ -x /sbin/vgchange ] ; then /sbin/vgchange -a y > /dev/null ; fi -if [ -n "$rootdelay" ] ; then sleep "$rootdelay" ; fi - -do_try_resume # This function will not return if resuming from disk -do_mount_root - -killall -w ${UDEVD##*/} - -exec switch_root /.root "$init" "$@" diff --git a/lfs/mkinitramfs/init.in.permissions.location b/lfs/mkinitramfs/init.in.permissions.location deleted file mode 100644 index ee3ba84..0000000 --- a/lfs/mkinitramfs/init.in.permissions.location +++ /dev/null @@ -1 +0,0 @@ -/usr/share/mkinitramfs/init.in diff --git a/lfs/mkinitramfs/mkinitramfs b/lfs/mkinitramfs/mkinitramfs deleted file mode 100644 index fc72d0c..0000000 --- a/lfs/mkinitramfs/mkinitramfs +++ /dev/null @@ -1,226 +0,0 @@ -#!/bin/sh -# This file based in part on the mkinitramfs script for the LFS LiveCD -# written by Alexander E. Patrakov and Jeremy Huntwork. - -copy() -{ - local file - - if [ "$2" = "lib" ]; then - file=$(PATH=/usr/lib type -p $1) - else - file=$(type -p $1) - fi - - if [ -n "$file" ] ; then - cp $file $WDIR/usr/$2 - else - echo "Missing required file: $1 for directory $2" - rm -rf $WDIR - exit 1 - fi -} - -if [ -z $1 ] ; then - INITRAMFS_FILE=initrd.img-no-kmods -else - KERNEL_VERSION=$1 - INITRAMFS_FILE=initrd.img-$KERNEL_VERSION -fi - -if [ -n "$KERNEL_VERSION" ] && [ ! -d "/usr/lib/modules/$1" ] ; then - echo "No modules directory named $1" - exit 1 -fi - -printf "Creating $INITRAMFS_FILE... " - -binfiles="sh cat cp dd killall ls mkdir mknod mount " -binfiles="$binfiles umount sed sleep ln rm uname" -binfiles="$binfiles readlink basename" - -# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin -if [ -x /usr/bin/udevadm ] ; then binfiles="$binfiles udevadm"; fi - -sbinfiles="modprobe blkid switch_root" - -# Optional files and locations -for f in mdadm mdmon udevd udevadm; do - if [ -x /usr/sbin/$f ] ; then sbinfiles="$sbinfiles $f"; fi -done - -# Add lvm if present (cannot be done with the others because it -# also needs dmsetup -if [ -x /usr/sbin/lvm ] ; then sbinfiles="$sbinfiles lvm dmsetup"; fi - -unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX) - -DATADIR=/usr/share/mkinitramfs -INITIN=init.in - -# Create a temporary working directory -WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX) - -# Create base directory structure -mkdir -p $WDIR/{dev,run,sys,proc,usr/{bin,lib/{firmware,modules},sbin}} -mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d} -touch $WDIR/etc/modprobe.d/modprobe.conf -ln -s usr/bin $WDIR/bin -ln -s usr/lib $WDIR/lib -ln -s usr/sbin $WDIR/sbin -ln -s lib $WDIR/lib64 - -# Create necessary device nodes -mknod -m 640 $WDIR/dev/console c 5 1 -mknod -m 664 $WDIR/dev/null c 1 3 - -# Install the udev configuration files -if [ -f /etc/udev/udev.conf ]; then - cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf -fi - -for file in $(find /etc/udev/rules.d/ -type f) ; do - cp $file $WDIR/etc/udev/rules.d -done - -# Install any firmware present -cp -a /usr/lib/firmware $WDIR/usr/lib - -# Copy the RAID configuration file if present -if [ -f /etc/mdadm.conf ] ; then - cp /etc/mdadm.conf $WDIR/etc -fi - -# Install the init file -install -m0755 $DATADIR/$INITIN $WDIR/init - -if [ -n "$KERNEL_VERSION" ] ; then - if [ -x /usr/bin/kmod ] ; then - binfiles="$binfiles kmod" - else - binfiles="$binfiles lsmod" - sbinfiles="$sbinfiles insmod" - fi -fi - -# Install basic binaries -for f in $binfiles ; do - ldd /usr/bin/$f | sed "s/\t//" | cut -d " " -f1 >> $unsorted - copy /usr/bin/$f bin -done - -for f in $sbinfiles ; do - ldd /usr/sbin/$f | sed "s/\t//" | cut -d " " -f1 >> $unsorted - copy $f sbin -done - -# Add udevd libraries if not in /usr/sbin -if [ -x /usr/lib/udev/udevd ] ; then - ldd /usr/lib/udev/udevd | sed "s/\t//" | cut -d " " -f1 >> $unsorted -elif [ -x /usr/lib/systemd/systemd-udevd ] ; then - ldd /usr/lib/systemd/systemd-udevd | sed "s/\t//" | cut -d " " -f1 >> $unsorted -fi - -# Add module symlinks if appropriate -if [ -n "$KERNEL_VERSION" ] && [ -x /usr/bin/kmod ] ; then - ln -s kmod $WDIR/usr/bin/lsmod - ln -s kmod $WDIR/usr/bin/insmod -fi - -# Add lvm symlinks if appropriate -# Also copy the lvm.conf file -if [ -x /usr/sbin/lvm ] ; then - ln -s lvm $WDIR/usr/sbin/lvchange - ln -s lvm $WDIR/usr/sbin/lvrename - ln -s lvm $WDIR/usr/sbin/lvextend - ln -s lvm $WDIR/usr/sbin/lvcreate - ln -s lvm $WDIR/usr/sbin/lvdisplay - ln -s lvm $WDIR/usr/sbin/lvscan - - ln -s lvm $WDIR/usr/sbin/pvchange - ln -s lvm $WDIR/usr/sbin/pvck - ln -s lvm $WDIR/usr/sbin/pvcreate - ln -s lvm $WDIR/usr/sbin/pvdisplay - ln -s lvm $WDIR/usr/sbin/pvscan - - ln -s lvm $WDIR/usr/sbin/vgchange - ln -s lvm $WDIR/usr/sbin/vgcreate - ln -s lvm $WDIR/usr/sbin/vgscan - ln -s lvm $WDIR/usr/sbin/vgrename - ln -s lvm $WDIR/usr/sbin/vgck - # Conf file(s) - cp -a /etc/lvm $WDIR/etc -fi - -# Install libraries -sort $unsorted | uniq | while read library ; do -# linux-vdso and linux-gate are pseudo libraries and do not correspond to a file -# libsystemd-shared is in /lib/systemd, so it is not found by copy, and -# it is copied below anyway - if [[ "$library" == linux-vdso.so.1 ]] || - [[ "$library" == linux-gate.so.1 ]] || - [[ "$library" == libsystemd-shared* ]]; then - continue - fi - - copy $library lib -done - -if [ -d /usr/lib/udev ]; then - cp -a /usr/lib/udev $WDIR/usr/lib -fi -if [ -d /usr/lib/systemd ]; then - cp -a /usr/lib/systemd $WDIR/usr/lib -fi -if [ -d /usr/lib/elogind ]; then - cp -a /usr/lib/elogind $WDIR/usr/lib -fi - -# Install the kernel modules if requested -if [ -n "$KERNEL_VERSION" ]; then - find \ - /usr/lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib} \ - /usr/lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,nvme,md,firewire} \ - /usr/lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \ - /usr/lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage} \ - -type f 2> /dev/null | cpio --make-directories -p --quiet $WDIR - - cp /usr/lib/modules/$KERNEL_VERSION/modules.{builtin,order} \ - $WDIR/usr/lib/modules/$KERNEL_VERSION - if [ -f /usr/lib/modules/$KERNEL_VERSION/modules.builtin.modinfo ]; then - cp /usr/lib/modules/$KERNEL_VERSION/modules.builtin.modinfo \ - $WDIR/usr/lib/modules/$KERNEL_VERSION - fi - - depmod -b $WDIR $KERNEL_VERSION -fi - -( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) > $INITRAMFS_FILE - -# Prepare early loading of microcode if available -if ls /usr/lib/firmware/intel-ucode/* >/dev/null 2>&1 || - ls /usr/lib/firmware/amd-ucode/* >/dev/null 2>&1; then - -# first empty WDIR to reuse it - rm -r $WDIR/* - - DSTDIR=$WDIR/kernel/x86/microcode - mkdir -p $DSTDIR - - if [ -d /usr/lib/firmware/amd-ucode ]; then - cat /usr/lib/firmware/amd-ucode/microcode_amd*.bin > $DSTDIR/AuthenticAMD.bin - fi - - if [ -d /usr/lib/firmware/intel-ucode ]; then - cat /usr/lib/firmware/intel-ucode/* > $DSTDIR/GenuineIntel.bin - fi - - ( cd $WDIR; find . | cpio -o -H newc --quiet ) > microcode.img - cat microcode.img $INITRAMFS_FILE > tmpfile - mv tmpfile $INITRAMFS_FILE - rm microcode.img -fi - -# Remove the temporary directories and files -rm -rf $WDIR $unsorted -printf "done.\n" diff --git a/lfs/mkinitramfs/mkinitramfs.permissions.location b/lfs/mkinitramfs/mkinitramfs.permissions.location deleted file mode 100644 index 470c3aa..0000000 --- a/lfs/mkinitramfs/mkinitramfs.permissions.location +++ /dev/null @@ -1,2 +0,0 @@ -chmod 0755 /usr/bin/mkinitramfs -mkinitramfs [KERNEL VERSION] diff --git a/lfs/mount-virt.sh b/lfs/mount-virt.sh deleted file mode 100755 index 10db7c7..0000000 --- a/lfs/mount-virt.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -function mountbind -{ - if ! mountpoint $LFS/$1 >/dev/null; then - $SUDO mount --bind /$1 $LFS/$1 - echo $LFS/$1 mounted - else - echo $LFS/$1 already mounted - fi -} - -function mounttype -{ - if ! mountpoint $LFS/$1 >/dev/null; then - $SUDO mount -t $2 $3 $4 $5 $LFS/$1 - echo $LFS/$1 mounted - else - echo $LFS/$1 already mounted - fi -} - -if [ $EUID -ne 0 ]; then - SUDO=sudo -else - SUDO="" -fi - -if [ x$LFS == x ]; then - echo "LFS not set" - exit 1 -fi - -mountbind dev -mounttype dev/pts devpts devpts -o gid=5,mode=620 -mounttype proc proc proc -mounttype sys sysfs sysfs -mounttype run tmpfs run -if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) -else - mounttype dev/shm tmpfs tmpfs -o nosuid,nodev -fi - -#mountbind usr/src -#mountbind boot -#mountbind home diff --git a/lfs/version-check.sh b/lfs/version-check.sh deleted file mode 100755 index 93ed9ad..0000000 --- a/lfs/version-check.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# A script to list version numbers of critical development tools - -# If you have tools installed in other directories, adjust PATH here AND -# in ~lfs/.bashrc (section 4.4) as well. - -LC_ALL=C -PATH=/usr/bin:/bin - -bail() { echo "FATAL: $1"; exit 1; } -grep --version > /dev/null 2> /dev/null || bail "grep does not work" -sed '' /dev/null || bail "sed does not work" -sort /dev/null || bail "sort does not work" - -ver_check() -{ - if ! type -p $2 &>/dev/null - then - echo "ERROR: Cannot find $2 ($1)"; return 1; - fi - v=$($2 --version 2>&1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1) - if printf '%s\n' $3 $v | sort --version-sort --check &>/dev/null - then - printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0; - else - printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1"; - return 1; - fi -} - -ver_kernel() -{ - kver=$(uname -r | grep -E -o '^[0-9\.]+') - if printf '%s\n' $1 $kver | sort --version-sort --check &>/dev/null - then - printf "OK: Linux Kernel $kver >= $1\n"; return 0; - else - printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver"; - return 1; - fi -} - -# Coreutils first because --version-sort needs Coreutils >= 7.0 -ver_check Coreutils sort 8.1 || bail "Coreutils too old, stop" -ver_check Bash bash 3.2 -ver_check Binutils ld 2.13.1 -ver_check Bison bison 2.7 -ver_check Diffutils diff 2.8.1 -ver_check Findutils find 4.2.31 -ver_check Gawk gawk 4.0.1 -ver_check GCC gcc 5.2 -ver_check "GCC (C++)" g++ 5.2 -ver_check Grep grep 2.5.1a -ver_check Gzip gzip 1.3.12 -ver_check M4 m4 1.4.10 -ver_check Make make 4.0 -ver_check Patch patch 2.5.4 -ver_check Perl perl 5.8.8 -ver_check Python python3 3.4 -ver_check Sed sed 4.1.5 -ver_check Tar tar 1.22 -ver_check Texinfo texi2any 5.0 -ver_check Xz xz 5.0.0 -ver_kernel 4.19 - -if mount | grep -q 'devpts on /dev/pts' && [ -e /dev/ptmx ] -then echo "OK: Linux Kernel supports UNIX 98 PTY"; -else echo "ERROR: Linux Kernel does NOT support UNIX 98 PTY"; fi - -alias_check() { - if $1 --version 2>&1 | grep -qi $2 - then printf "OK: %-4s is $2\n" "$1"; - else printf "ERROR: %-4s is NOT $2\n" "$1"; fi -} -echo "Aliases:" -alias_check awk GNU -alias_check yacc Bison -alias_check sh Bash - -echo "Compiler check:" -if printf "int main(){}" | g++ -x c++ - -then echo "OK: g++ works"; -else echo "ERROR: g++ does NOT work"; fi -rm -f a.out - -if [ "$(nproc)" = "" ]; then - echo "ERROR: nproc is not available or it produces empty output" -else - echo "OK: nproc reports $(nproc) logical cores are available" -fi diff --git a/ly/config.ini b/ly/config.ini deleted file mode 100755 index c1123c5..0000000 --- a/ly/config.ini +++ /dev/null @@ -1,140 +0,0 @@ -# Animation enabled/disabled -animate = true - -# The active animation -# 0 -> PSX DOOM fire (default) -# 1 -> CMatrix -animation = 0 - -# format string for clock in top right corner (see strftime specification) -clock = %c - -# enable/disable big clock -bigclock = true - -# The character used to mask the password -asterisk = * - -# Erase password input on failure -#blank_password = false - -#The `fg` and `bg` color settings take a digit 0-8 corresponding to: -#define TB_DEFAULT 0x00 -#define TB_BLACK 0x01 -#define TB_RED 0x02 -#define TB_GREEN 0x03 -#define TB_YELLOW 0x04 -#define TB_BLUE 0x05 -#define TB_MAGENTA 0x06 -#define TB_CYAN 0x07 -#define TB_WHITE 0x08 -# -# Setting both to zero makes `bg` black and `fg` white. To set the actual color palette you are encouraged to use another tool -# such as [mkinitcpio-colors](https://github.com/evanpurkhiser/mkinitcpio-colors). Note that the color palette defined with -# `mkinitcpio-colors` takes 16 colors (0-15), only values 0-8 are valid for `ly` config and these values do not correspond -# exactly. For instance, in defining palettes with `mkinitcpio-colors` the order is black, dark red, dark green, brown, dark -# blue, dark purple, dark cyan, light gray, dark gray, bright red, bright green, yellow, bright blue, bright purple, bright -# cyan, and white, indexed in that order 0 through 15. For example, the color defined for white (indexed at 15 in the mkinitcpio -# config) will be used by `ly` for `fg = 8`. - -# Background color id -bg = 0 - -# Foreground color id -fg = 9 - -# Blank main box background -# Setting to false will make it transparent -#blank_box = true - -# Remove main box borders -#hide_borders = false - -# Main box margins -#margin_box_h = 2 -#margin_box_v = 1 - -# Input boxes length -#input_len = 34 - -# Max input sizes -#max_desktop_len = 100 -#max_login_len = 255 -#max_password_len = 255 - - -# Input box active by default on startup -#default_input = 2 - -# Load the saved desktop and username -load = true - -# Save the current desktop and login as defaults -save = true - -# File in which to save and load the default desktop and login -#save_file = /etc/ly/save - - -# Remove F1/F2 command hints -#hide_f1_commands = false - -# Command executed when pressing F1 -#shutdown_cmd = /sbin/shutdown -a now - -# Command executed when pressing F2 -#restart_cmd = /sbin/shutdown -r now - - -# Active language -# Available languages are found in /etc/ly/lang/ -lang = en - - -# tty in use -tty = 2 - -# Console path -#console_dev = /dev/console - -# Default path -path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin - - -# Event timeout in milliseconds -#min_refresh_delta = 5 - -# Service name (set to ly to use the provided pam config file) -#service_name = ly - -# Terminal reset command (tput is faster) -#term_reset_cmd = /usr/bin/tput reset - -# Cookie generator -#mcookie_cmd = /usr/bin/mcookie - - -# Wayland setup command -#wayland_cmd = /etc/ly/wsetup.sh - -# Add wayland specifier to session names -#wayland_specifier = false - -# Wayland desktop environments -#waylandsessions = /usr/share/wayland-sessions - - -# xinitrc -xinitrc = ~/.xinitrc - -# Xorg server command -#x_cmd = /usr/bin/X - -# Xorg setup command -#x_cmd_setup = /etc/ly/xsetup.sh - -# Xorg xauthority edition tool -#xauth_cmd = /usr/bin/xauth - -# Xorg desktop environments -#xsessions = /usr/share/xsessions diff --git a/macos/skhd/skhdrc b/macos/skhd/skhdrc deleted file mode 100644 index 71cc68a..0000000 --- a/macos/skhd/skhdrc +++ /dev/null @@ -1,41 +0,0 @@ -lalt - return: /Applications/kitty.app/Contents/MacOS/kitty --single-instance -d ~ -lalt - t: open ~/ - -lalt - q: yabai -m window --close -lalt - f: yabai -m window --toggle native-fullscreen - -lalt - h : yabai -m window --focus west -lalt - l: yabai -m window --focus east -lalt - j: yabai -m window --focus south -lalt - k: yabai -m window --focus north - -lalt + shift - h : yabai -m window --warp west || $(yabai -m window --display west && yabai -m display --focus west && yabai -m window --warp last) || yabai -m window --move rel:-10:0 -lalt + shift - j : yabai -m window --warp south || $(yabai -m window --display south && yabai -m display --focus south) || yabai -m window --move rel:0:10 -lalt + shift - k : yabai -m window --warp north || $(yabai -m window --display north && yabai -m display --focus north) || yabai -m window --move rel:0:-10 -lalt + shift - l : yabai -m window --warp east || $(yabai -m window --display east && yabai -m display --focus east && yabai -m window --warp first) || yabai -m window --move rel:10:0 - -lalt + shift - 1 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[1] ]] \ - && yabai -m window --space $SPACES[1] && yabai -m window --space 1 && yabai -m space --switch 1 -lalt + shift - 2 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[2] ]] \ - && yabai -m window --space $SPACES[2] -lalt + shift - 3 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[3] ]] \ - && yabai -m window --space $SPACES[3] -lalt + shift - 4 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[4] ]] \ - && yabai -m window --space $SPACES[4] -lalt + shift - 5 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[5] ]] \ - && yabai -m window --space $SPACES[5] -lalt + shift - 6 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[6] ]] \ - && yabai -m window --space $SPACES[6] -lalt + shift - 7 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[7] ]] \ - && yabai -m window --space $SPACES[7] -lalt + shift - 8 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[8] ]] \ - && yabai -m window --space $SPACES[8] -lalt + shift - 9 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[9] ]] \ - && yabai -m window --space $SPACES[9] -lalt + shift - 0 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[10] ]] \ - && yabai -m window --space $SPACES[10] - - -lalt - s: yabai --start-service -lalt + shift - s: yabai --stop-service -# lalt - 2: yabai --restart-service diff --git a/macos/yabai/yabairc b/macos/yabai/yabairc deleted file mode 100644 index 48cc04b..0000000 --- a/macos/yabai/yabairc +++ /dev/null @@ -1,17 +0,0 @@ -yabai -m config \ - layout bsp \ - auto_balance on \ - top_padding 5 \ - bottom_padding 5 \ - left_padding 5 \ - right_padding 5 \ - window_gap 5 \ - mouse_drop_action swap \ - focus_follows_mouse autofocus \ - mouse_follows_focus off \ - window_shadow float \ - window_opacity off \ - window_opacity_duration 0.2 \ - active_window_opacity 1.0 \ - normal_window_opacity 0.96 \ - insert_feedback_color 0xff9dd274 \ \ No newline at end of file diff --git a/mako/config b/mako/config deleted file mode 100644 index 4b476cf..0000000 --- a/mako/config +++ /dev/null @@ -1,40 +0,0 @@ -#look at the mako manpage with the command: -# man 5 mako -# To view all configuration options. - -font=JetBrainsMono Nerd Font Mono 11 -format=%a ⏵ %s\n%b -sort=-time -output=DP-2 -layer=overlay -anchor=top-right -background-color=#000000 -width=300 -height=110 -margin=5 -padding=0,5,10 -border-size=2 -border-color=#aaaaaa -border-radius=15 -icons=1 -icon-path=/usr/share/icons/Papirus-Dark -icon-location=left -max-icon-size=64 -default-timeout=5000 -ignore-timeout=1 - -[urgency=normal] -border-color=#aaaaaa - -[urgency=high] -border-color=#bf616a -default-timeout=0 - -[app-name=lightcord] -border-color=#88c0d0 - -[summary~="log-.*"] -border-color=#a3be8c - -[app-name=lightcord summary~="(.*(^| )orz|ORZ|sto|STO|otl|OTL( |$).*)"] -invisible=1 diff --git a/neofetch/config.conf b/neofetch/config.conf deleted file mode 100644 index dc9f404..0000000 --- a/neofetch/config.conf +++ /dev/null @@ -1,894 +0,0 @@ -# See this wiki page for more info: -# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info -print_info() { - info title - info underline - - prin "$(color 6)┌─────────── OS ──────────────┐" - - info "├▶  " distro - info "├▶ 󰍺 " model - info "├▶  " kernel - info "├▶  " uptime - info "├▶ 󰏗 " packages - info "├▶  " shell - - prin "$(color 6)└─────────────────────────────┘" - - prin "$(color 6)┌───────── GRAPHIC ─────────────┐" - - info "├▶  " resolution - info "├▶  " de - info "├▶WM" wm - info "├▶WM Theme" wm_theme - info "├▶  " theme - info "├▶  " icons - info "├▶  " term - info "├▶Terminal Font" term_font - info "├▶ ꬵ " font - - prin "$(color 6)└───────────────────────────────┘" - - prin "$(color 6)┌───────── HARDWARE ─────────────────────────────┐" - - info "├▶  " cpu - info "├▶  " cpu_usage - info "├▶  " gpu - info "├▶  " gpu_driver - info "├▶  " memory - - info "├▶  " disk - info "├▶  " battery - - prin "$(color 6)└────────────────────────────────────────────────┘" - - prin "$(color 6)┌" - - info "├▶  " song - - [[ "$player" ]] && prin "├▶  " "$player" - - prin "$(color 6)└" - - prin "$(color 6)┌────────── NET ──────────────┐" - - info "├▶  " local_ip - info "├▶  " public_ip - - info "├▶  " users - info "├▶  " locale # This only works on glibc systems. - - prin "$(color 6)└─────────────────────────────┘" - - #prin "┌───────── COLORS ────────────┐" - - info " " cols - - #prin "└─────────────────────────────┘" -} - -# Title - - -# Hide/Show Fully qualified domain name. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --title_fqdn -title_fqdn="off" - - -# Kernel - - -# Shorten the output of the kernel function. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --kernel_shorthand -# Supports: Everything except *BSDs (except PacBSD and PC-BSD) -# -# Example: -# on: '4.8.9-1-ARCH' -# off: 'Linux 4.8.9-1-ARCH' -kernel_shorthand="on" - - -# Distro - - -# Shorten the output of the distro function -# -# Default: 'off' -# Values: 'on', 'tiny', 'off' -# Flag: --distro_shorthand -# Supports: Everything except Windows and Haiku -distro_shorthand="off" - -# Show/Hide OS Architecture. -# Show 'x86_64', 'x86' and etc in 'Distro:' output. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --os_arch -# -# Example: -# on: 'Arch Linux x86_64' -# off: 'Arch Linux' -os_arch="on" - - -# Uptime - - -# Shorten the output of the uptime function -# -# Default: 'on' -# Values: 'on', 'tiny', 'off' -# Flag: --uptime_shorthand -# -# Example: -# on: '2 days, 10 hours, 3 mins' -# tiny: '2d 10h 3m' -# off: '2 days, 10 hours, 3 minutes' -uptime_shorthand="on" - - -# Memory - - -# Show memory pecentage in output. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --memory_percent -# -# Example: -# on: '1801MiB / 7881MiB (22%)' -# off: '1801MiB / 7881MiB' -memory_percent="on" - -# Change memory output unit. -# -# Default: 'mib' -# Values: 'kib', 'mib', 'gib' -# Flag: --memory_unit -# -# Example: -# kib '1020928KiB / 7117824KiB' -# mib '1042MiB / 6951MiB' -# gib: ' 0.98GiB / 6.79GiB' -memory_unit="mib" - - -# Packages - - -# Show/Hide Package Manager names. -# -# Default: 'tiny' -# Values: 'on', 'tiny' 'off' -# Flag: --package_managers -# -# Example: -# on: '998 (pacman), 8 (flatpak), 4 (snap)' -# tiny: '908 (pacman, flatpak, snap)' -# off: '908' -package_managers="on" - - -# Shell - - -# Show the path to $SHELL -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --shell_path -# -# Example: -# on: '/bin/bash' -# off: 'bash' -shell_path="on" - -# Show $SHELL version -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --shell_version -# -# Example: -# on: 'bash 4.4.5' -# off: 'bash' -shell_version="on" - - -# CPU - - -# CPU speed type -# -# Default: 'bios_limit' -# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. -# Flag: --speed_type -# Supports: Linux with 'cpufreq' -# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. -speed_type="bios_limit" - -# CPU speed shorthand -# -# Default: 'off' -# Values: 'on', 'off'. -# Flag: --speed_shorthand -# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz -# -# Example: -# on: 'i7-6500U (4) @ 3.1GHz' -# off: 'i7-6500U (4) @ 3.100GHz' -speed_shorthand="on" - -# Enable/Disable CPU brand in output. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --cpu_brand -# -# Example: -# on: 'Intel i7-6500U' -# off: 'i7-6500U (4)' -cpu_brand="on" - -# CPU Speed -# Hide/Show CPU speed. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --cpu_speed -# -# Example: -# on: 'Intel i7-6500U (4) @ 3.1GHz' -# off: 'Intel i7-6500U (4)' -cpu_speed="on" - -# CPU Cores -# Display CPU cores in output -# -# Default: 'logical' -# Values: 'logical', 'physical', 'off' -# Flag: --cpu_cores -# Support: 'physical' doesn't work on BSD. -# -# Example: -# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) -# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) -# off: 'Intel i7-6500U @ 3.1GHz' -cpu_cores="logical" - -# CPU Temperature -# Hide/Show CPU temperature. -# Note the temperature is added to the regular CPU function. -# -# Default: 'off' -# Values: 'C', 'F', 'off' -# Flag: --cpu_temp -# Supports: Linux, BSD -# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable -# coretemp kernel module. This only supports newer Intel processors. -# -# Example: -# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' -# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' -# off: 'Intel i7-6500U (4) @ 3.1GHz' -cpu_temp="on" - - -# GPU - - -# Enable/Disable GPU Brand -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gpu_brand -# -# Example: -# on: 'AMD HD 7950' -# off: 'HD 7950' -gpu_brand="on" - -# Which GPU to display -# -# Default: 'all' -# Values: 'all', 'dedicated', 'integrated' -# Flag: --gpu_type -# Supports: Linux -# -# Example: -# all: -# GPU1: AMD HD 7950 -# GPU2: Intel Integrated Graphics -# -# dedicated: -# GPU1: AMD HD 7950 -# -# integrated: -# GPU1: Intel Integrated Graphics -gpu_type="all" - - -# Resolution - - -# Display refresh rate next to each monitor -# Default: 'off' -# Values: 'on', 'off' -# Flag: --refresh_rate -# Supports: Doesn't work on Windows. -# -# Example: -# on: '1920x1080 @ 60Hz' -# off: '1920x1080' -refresh_rate="on" - - -# Gtk Theme / Icons / Font - - -# Shorten output of GTK Theme / Icons / Font -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --gtk_shorthand -# -# Example: -# on: 'Numix, Adwaita' -# off: 'Numix [GTK2], Adwaita [GTK3]' -gtk_shorthand="off" - - -# Enable/Disable gtk2 Theme / Icons / Font -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gtk2 -# -# Example: -# on: 'Numix [GTK2], Adwaita [GTK3]' -# off: 'Adwaita [GTK3]' -gtk2="on" - -# Enable/Disable gtk3 Theme / Icons / Font -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --gtk3 -# -# Example: -# on: 'Numix [GTK2], Adwaita [GTK3]' -# off: 'Numix [GTK2]' -gtk3="on" - - -# IP Address - - -# Website to ping for the public IP -# -# Default: 'http://ident.me' -# Values: 'url' -# Flag: --ip_host -public_ip_host="http://ident.me" - -# Public IP timeout. -# -# Default: '2' -# Values: 'int' -# Flag: --ip_timeout -public_ip_timeout=2 - - -# Desktop Environment - - -# Show Desktop Environment version -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --de_version -de_version="on" - - -# Disk - - -# Which disks to display. -# The values can be any /dev/sdXX, mount point or directory. -# NOTE: By default we only show the disk info for '/'. -# -# Default: '/' -# Values: '/', '/dev/sdXX', '/path/to/drive'. -# Flag: --disk_show -# -# Example: -# disk_show=('/' '/dev/sdb1'): -# 'Disk (/): 74G / 118G (66%)' -# 'Disk (/mnt/Videos): 823G / 893G (93%)' -# -# disk_show=('/'): -# 'Disk (/): 74G / 118G (66%)' -# -disk_show=('/') - -# Disk subtitle. -# What to append to the Disk subtitle. -# -# Default: 'mount' -# Values: 'mount', 'name', 'dir', 'none' -# Flag: --disk_subtitle -# -# Example: -# name: 'Disk (/dev/sda1): 74G / 118G (66%)' -# 'Disk (/dev/sdb2): 74G / 118G (66%)' -# -# mount: 'Disk (/): 74G / 118G (66%)' -# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' -# 'Disk (/mnt/Videos): 74G / 118G (66%)' -# -# dir: 'Disk (/): 74G / 118G (66%)' -# 'Disk (Local Disk): 74G / 118G (66%)' -# 'Disk (Videos): 74G / 118G (66%)' -# -# none: 'Disk: 74G / 118G (66%)' -# 'Disk: 74G / 118G (66%)' -# 'Disk: 74G / 118G (66%)' -disk_subtitle="mount" - -# Disk percent. -# Show/Hide disk percent. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --disk_percent -# -# Example: -# on: 'Disk (/): 74G / 118G (66%)' -# off: 'Disk (/): 74G / 118G' -disk_percent="on" - - -# Song - - -# Manually specify a music player. -# -# Default: 'auto' -# Values: 'auto', 'player-name' -# Flag: --music_player -# -# Available values for 'player-name': -# -# amarok -# audacious -# banshee -# bluemindo -# clementine -# cmus -# deadbeef -# deepin-music -# dragon -# elisa -# exaile -# gnome-music -# gmusicbrowser -# gogglesmm -# guayadeque -# io.elementary.music -# iTunes -# juk -# lollypop -# mocp -# mopidy -# mpd -# muine -# netease-cloud-music -# olivia -# playerctl -# pogo -# pragha -# qmmp -# quodlibet -# rhythmbox -# sayonara -# smplayer -# spotify -# strawberry -# tauonmb -# tomahawk -# vlc -# xmms2d -# xnoise -# yarock -music_player="auto" - -# Format to display song information. -# -# Default: '%artist% - %album% - %title%' -# Values: '%artist%', '%album%', '%title%' -# Flag: --song_format -# -# Example: -# default: 'Song: Jet - Get Born - Sgt Major' -song_format="%artist% - %album% - %title%" - -# Print the Artist, Album and Title on separate lines -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --song_shorthand -# -# Example: -# on: 'Artist: The Fratellis' -# 'Album: Costello Music' -# 'Song: Chelsea Dagger' -# -# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' -song_shorthand="off" - -# 'mpc' arguments (specify a host, password etc). -# -# Default: '' -# Example: mpc_args=(-h HOST -P PASSWORD) -mpc_args=() - - -# Text Colors - - -# Text Colors -# -# Default: 'distro' -# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' -# Flag: --colors -# -# Each number represents a different part of the text in -# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' -# -# Example: -# colors=(distro) - Text is colored based on Distro colors. -# colors=(4 6 1 8 8 6) - Text is colored in the order above. -colors=(distro) - - -# Text Options - - -# Toggle bold text -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --bold -bold="on" - -# Enable/Disable Underline -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --underline -underline_enabled="on" - -# Underline character -# -# Default: '-' -# Values: 'string' -# Flag: --underline_char -underline_char="─" - - -# Info Separator -# Replace the default separator with the specified string. -# -# Default: ':' -# Flag: --separator -# -# Example: -# separator="->": 'Shell-> bash' -# separator=" =": 'WM = dwm' -separator=" ─▶ " - - -# Color Blocks - - -# Color block range -# The range of colors to print. -# -# Default: '0', '15' -# Values: 'num' -# Flag: --block_range -# -# Example: -# -# Display colors 0-7 in the blocks. (8 colors) -# neofetch --block_range 0 7 -# -# Display colors 0-15 in the blocks. (16 colors) -# neofetch --block_range 0 15 -block_range=(0 15) - -# Toggle color blocks -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --color_blocks -color_blocks="on" - -# Color block width in spaces -# -# Default: '3' -# Values: 'num' -# Flag: --block_width -block_width=3 - -# Color block height in lines -# -# Default: '1' -# Values: 'num' -# Flag: --block_height -block_height=1 - -# Color Alignment -# -# Default: 'auto' -# Values: 'auto', 'num' -# Flag: --col_offset -# -# Number specifies how far from the left side of the terminal (in spaces) to -# begin printing the columns, in case you want to e.g. center them under your -# text. -# Example: -# col_offset="auto" - Default behavior of neofetch -# col_offset=7 - Leave 7 spaces then print the colors -col_offset="auto" - -# Progress Bars - - -# Bar characters -# -# Default: '-', '=' -# Values: 'string', 'string' -# Flag: --bar_char -# -# Example: -# neofetch --bar_char 'elapsed' 'total' -# neofetch --bar_char '-' '=' -bar_char_elapsed="-" -bar_char_total="=" - -# Toggle Bar border -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --bar_border -bar_border="on" - -# Progress bar length in spaces -# Number of chars long to make the progress bars. -# -# Default: '15' -# Values: 'num' -# Flag: --bar_length -bar_length=15 - -# Progress bar colors -# When set to distro, uses your distro's logo colors. -# -# Default: 'distro', 'distro' -# Values: 'distro', 'num' -# Flag: --bar_colors -# -# Example: -# neofetch --bar_colors 3 4 -# neofetch --bar_colors distro 5 -bar_color_elapsed="distro" -bar_color_total="distro" - - -# Info display -# Display a bar with the info. -# -# Default: 'off' -# Values: 'bar', 'infobar', 'barinfo', 'off' -# Flags: --cpu_display -# --memory_display -# --battery_display -# --disk_display -# -# Example: -# bar: '[---=======]' -# infobar: 'info [---=======]' -# barinfo: '[---=======] info' -# off: 'info' -cpu_display="infobar" -memory_display="infobar" -battery_display="infobar" -disk_display="infobar" - - -# Backend Settings - - -# Image backend. -# -# Default: 'ascii' -# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', -# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' -# Flag: --backend -image_backend="ascii"; - -# Image Source -# -# Which image or ascii file to display. -# -# Default: 'auto' -# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' -# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' -# Flag: --source -# -# NOTE: 'auto' will pick the best image source for whatever image backend is used. -# In ascii mode, distro ascii art will be used and in an image mode, your -# wallpaper will be used. -image_source="/home/tola/Pictures/neofetch/Tux.svg.png" - - -# Ascii Options - - -# Ascii distro -# Which distro's ascii art to display. -# -# Default: 'auto' -# Values: 'auto', 'distro_name' -# Flag: --ascii_distro -# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", -# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, -# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, -# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, -# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, -# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, -# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, -# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, -# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, -# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, -# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, -# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, -# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, -# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, -# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, -# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, -# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, -# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, -# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, -# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, -# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, -# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, -# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, -# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, -# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, -# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, -# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, -# and IRIX have ascii logos -# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. -# Use '{distro name}_old' to use the old logos. -# NOTE: Ubuntu has flavor variants. -# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, -# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. -# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, -# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, -# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, -# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, -# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, -# postmarketOS, and Void have a smaller logo variant. -# Use '{distro name}_small' to use the small variants. -ascii_distro="auto" - -# Ascii Colors -# -# Default: 'distro' -# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' -# Flag: --ascii_colors -# -# Example: -# ascii_colors=(distro) - Ascii is colored based on Distro colors. -# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. -ascii_colors=(distro) - -# Bold ascii logo -# Whether or not to bold the ascii logo. -# -# Default: 'on' -# Values: 'on', 'off' -# Flag: --ascii_bold -ascii_bold="on" - - -# Image Options - - -# Image loop -# Setting this to on will make neofetch redraw the image constantly until -# Ctrl+C is pressed. This fixes display issues in some terminal emulators. -# -# Default: 'off' -# Values: 'on', 'off' -# Flag: --loop -image_loop="off" - -# Thumbnail directory -# -# Default: '~/.cache/thumbnails/neofetch' -# Values: 'dir' -thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" - -# Crop mode -# -# Default: 'normal' -# Values: 'normal', 'fit', 'fill' -# Flag: --crop_mode -# -# See this wiki page to learn about the fit and fill options. -# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F -crop_mode="normal" - -# Crop offset -# Note: Only affects 'normal' crop mode. -# -# Default: 'center' -# Values: 'northwest', 'north', 'northeast', 'west', 'center' -# 'east', 'southwest', 'south', 'southeast' -# Flag: --crop_offset -crop_offset="center" - -# Image size -# The image is half the terminal width by default. -# -# Default: 'auto' -# Values: 'auto', '00px', '00%', 'none' -# Flags: --image_size -# --size -image_size="auto" - -# Gap between image and text -# -# Default: '3' -# Values: 'num', '-num' -# Flag: --gap -gap=3 - -# Image offsets -# Only works with the w3m backend. -# -# Default: '0' -# Values: 'px' -# Flags: --xoffset -# --yoffset -yoffset=0 -xoffset=0 - -# Image background color -# Only works with the w3m backend. -# -# Default: '' -# Values: 'color', 'blue' -# Flag: --bg_color -background_color='blue' - - -# Misc Options - -# Stdout mode -# Turn off all colors and disables image backend (ASCII/Image). -# Useful for piping into another command. -# Default: 'off' -# Values: 'on', 'off' -stdout="off" diff --git a/nfs/exports b/nfs/exports deleted file mode 100644 index 582aacf..0000000 --- a/nfs/exports +++ /dev/null @@ -1,4 +0,0 @@ -/samba/public *(rw,insecure) -/media *(rw,insecure) -/dotfiles *(ro) -/sshkeys *(ro) diff --git a/picom/picom.conf b/picom/picom.conf deleted file mode 100644 index 2986901..0000000 --- a/picom/picom.conf +++ /dev/null @@ -1,77 +0,0 @@ -################################# -# Shadows # -################################# -shadow = true; -shadow-radius = 7; -shadow-offset-x = -7; -shadow-offset-y = -7; -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "_GTK_FRAME_EXTENTS@:c" -]; -################################# - -################################# -# Fading # -################################# -fading = true; -fade-in-step = 0.03; -fade-out-step = 0.03; -################################# - -################################# -# Transparency / Opacity # -################################# -inactive-opacity = 0.95; -frame-opacity = 0.9; -inactive-opacity-override = false; -focus-exclude = [ "class_g = 'Cairo-clock'" ]; -################################# - -################################# -# Corners # -################################# -corner-radius = 10 -rounded-corners-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'" -]; -################################# - -################################# -# Background-Blurring # -################################# -blur-kern = "3x3box"; -blur-background-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c" -]; -################################# - -################################# -# General Settings # -################################# -backend = "glx" -dithered-present = false; -vsync = true; -mark-wmwin-focused = true; -mark-ovredir-focused = true; -detect-rounded-corners = true; -detect-client-opacity = true; -detect-transient = true; -glx-no-stencil = true; -use-damage = true; -log-level = "warn"; -wintypes: -{ - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; clip-shadow-above = true; } - dnd = { shadow = false; } - popup_menu = { opacity = 0.8; } - dropdown_menu = { opacity = 0.8; } -}; -################################# diff --git a/preview/fastfetch-preview.png b/preview/fastfetch-preview.png deleted file mode 100644 index 61db551..0000000 Binary files a/preview/fastfetch-preview.png and /dev/null differ diff --git a/preview/rofi-greenclip-preview.png b/preview/rofi-greenclip-preview.png deleted file mode 100644 index d2c8115..0000000 Binary files a/preview/rofi-greenclip-preview.png and /dev/null differ diff --git a/preview/rofi-launcher-preview.png b/preview/rofi-launcher-preview.png deleted file mode 100644 index f86fe7a..0000000 Binary files a/preview/rofi-launcher-preview.png and /dev/null differ diff --git a/preview/rofimoji-preview.png b/preview/rofimoji-preview.png deleted file mode 100644 index 18318bc..0000000 Binary files a/preview/rofimoji-preview.png and /dev/null differ diff --git a/preview/thunar-preview.png b/preview/thunar-preview.png deleted file mode 100644 index 1857cbb..0000000 Binary files a/preview/thunar-preview.png and /dev/null differ diff --git a/preview/vim-preview.png b/preview/vim-preview.png deleted file mode 100644 index 4722603..0000000 Binary files a/preview/vim-preview.png and /dev/null differ diff --git a/ranger/rc.conf b/ranger/rc.conf deleted file mode 100644 index d114a1c..0000000 --- a/ranger/rc.conf +++ /dev/null @@ -1,4 +0,0 @@ -#------- preview images ---------- -set preview_images true -set preview_images_method kitty -#--------------------------------- diff --git a/rofi/clipboard/clipboard.rasi b/rofi/clipboard/clipboard.rasi deleted file mode 100644 index 39c0c8e..0000000 --- a/rofi/clipboard/clipboard.rasi +++ /dev/null @@ -1,83 +0,0 @@ - -@import "~/dotfiles/rofi/shared/fonts.rasi" - -/*****----- Main Window -----*****/ -window { - width: 500px; - border-radius: 10px; - cursor: "default"; - background-color: black; - text-color: white; -} - -/*****----- Main Box -----*****/ -mainbox { - spacing: 10px; - padding: 10px; - border: 0px solid; - border-radius: 0px 0px 0px 0px; - background-color: transparent; - children: [ "inputbar", "message", "listview" ]; -} - -/*****----- Inputbar -----*****/ -inputbar { - spacing: 10px; - background-color: transparent; - text-color: white; - children: [ "textbox-prompt-colon", "entry", "mode-switcher" ]; -} - -textbox-prompt-colon { - padding: 7px 10px 10px 10px; - expand: false; - str: ""; - background-color: inherit; - text-color: inherit; -} -entry { - padding: 10px 0px 0px 0px; - background-color: inherit; - text-color: inherit; - cursor: text; - placeholder: "Search..."; -} - -/*****----- Listview -----*****/ -listview { - cycle: false; - background-color: transparent; - text-color: white; -} - -/*****----- Elements -----*****/ -element { - padding: 5px 10px; - border-radius: 6px; - background-color: transparent; - text-color: white; - cursor: pointer; -} - -element selected.normal { - background-color: white/15%; -} - -element-text { - background-color: transparent; - text-color: inherit; - cursor: pointer; -} - -/*****----- Mode Switcher -----*****/ -mode-switcher{ - background-color: transparent; -} -button { - padding: 0px 10px; - border-radius: 6px; -} -button selected { - background-color: white/15%; - text-color: white; -} diff --git a/rofi/clipboard/clipboard.sh b/rofi/clipboard/clipboard.sh deleted file mode 100755 index 2676d8e..0000000 --- a/rofi/clipboard/clipboard.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env zsh - -theme=~/dotfiles/rofi/clipboard/clipboard.rasi -mode="clipboard:greenclip print" - -rofi -modi $mode -show clipboard -run-command '{cmd}' -theme $theme - diff --git a/rofi/colors/adapta.rasi b/rofi/colors/adapta.rasi deleted file mode 100644 index dcde9e5..0000000 --- a/rofi/colors/adapta.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #222D32FF; - background-alt: #29353BFF; - foreground: #B8C2C6FF; - selected: #00BCD4FF; - active: #21FF90FF; - urgent: #FF4B60FF; -} diff --git a/rofi/colors/arc.rasi b/rofi/colors/arc.rasi deleted file mode 100644 index 0dfb773..0000000 --- a/rofi/colors/arc.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #2F343FFF; - background-alt: #383C4AFF; - foreground: #BAC5D0FF; - selected: #5294E2FF; - active: #98C379FF; - urgent: #E06B74FF; -} diff --git a/rofi/colors/black.rasi b/rofi/colors/black.rasi deleted file mode 100644 index fa7b76f..0000000 --- a/rofi/colors/black.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #000000FF; - background-alt: #101010FF; - foreground: #FFFFFFFF; - selected: #62AEEFFF; - active: #98C379FF; - urgent: #E06B74FF; -} diff --git a/rofi/colors/catppuccin.rasi b/rofi/colors/catppuccin.rasi deleted file mode 100644 index 62c5945..0000000 --- a/rofi/colors/catppuccin.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #1E1D2FFF; - background-alt: #282839FF; - foreground: #D9E0EEFF; - selected: #7AA2F7FF; - active: #ABE9B3FF; - urgent: #F28FADFF; -} diff --git a/rofi/colors/cyberpunk.rasi b/rofi/colors/cyberpunk.rasi deleted file mode 100644 index f5fa0e7..0000000 --- a/rofi/colors/cyberpunk.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #000B1EFF; - background-alt: #0A1528FF; - foreground: #0ABDC6FF; - selected: #0ABDC6FF; - active: #00FF00FF; - urgent: #FF0000FF; -} diff --git a/rofi/colors/dracula.rasi b/rofi/colors/dracula.rasi deleted file mode 100644 index 7ae606d..0000000 --- a/rofi/colors/dracula.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #1E1F29FF; - background-alt: #282A36FF; - foreground: #FFFFFFFF; - selected: #BD93F9FF; - active: #50FA7BFF; - urgent: #FF5555FF; -} diff --git a/rofi/colors/everforest.rasi b/rofi/colors/everforest.rasi deleted file mode 100644 index 83d4f71..0000000 --- a/rofi/colors/everforest.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #323D43FF; - background-alt: #3C474DFF; - foreground: #DAD1BEFF; - selected: #7FBBB3FF; - active: #A7C080FF; - urgent: #E67E80FF; -} diff --git a/rofi/colors/gruvbox.rasi b/rofi/colors/gruvbox.rasi deleted file mode 100644 index 2ee85d0..0000000 --- a/rofi/colors/gruvbox.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #282828FF; - background-alt: #353535FF; - foreground: #EBDBB2FF; - selected: #83A598FF; - active: #B8BB26FF; - urgent: #FB4934FF; -} diff --git a/rofi/colors/lovelace.rasi b/rofi/colors/lovelace.rasi deleted file mode 100644 index 80140ee..0000000 --- a/rofi/colors/lovelace.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #1D1F28FF; - background-alt: #282A36FF; - foreground: #FDFDFDFF; - selected: #79E6F3FF; - active: #5ADECDFF; - urgent: #F37F97FF; -} diff --git a/rofi/colors/navy.rasi b/rofi/colors/navy.rasi deleted file mode 100644 index 1289f53..0000000 --- a/rofi/colors/navy.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #021B21FF; - background-alt: #0C252BFF; - foreground: #F2F1B9FF; - selected: #44B5B1FF; - active: #7CBF9EFF; - urgent: #C2454EFF; -} diff --git a/rofi/colors/nord.rasi b/rofi/colors/nord.rasi deleted file mode 100644 index c6bc05d..0000000 --- a/rofi/colors/nord.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #2E3440FF; - background-alt: #383E4AFF; - foreground: #E5E9F0FF; - selected: #81A1C1FF; - active: #A3BE8CFF; - urgent: #BF616AFF; -} diff --git a/rofi/colors/onedark.rasi b/rofi/colors/onedark.rasi deleted file mode 100644 index 7c76108..0000000 --- a/rofi/colors/onedark.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #1E2127FF; - background-alt: #282B31FF; - foreground: #FFFFFFFF; - selected: #61AFEFFF; - active: #98C379FF; - urgent: #E06C75FF; -} diff --git a/rofi/colors/paper.rasi b/rofi/colors/paper.rasi deleted file mode 100644 index c3d76e8..0000000 --- a/rofi/colors/paper.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #F1F1F1FF; - background-alt: #E0E0E0FF; - foreground: #252525FF; - selected: #008EC4FF; - active: #10A778FF; - urgent: #C30771FF; -} diff --git a/rofi/colors/solarized.rasi b/rofi/colors/solarized.rasi deleted file mode 100644 index 9051e13..0000000 --- a/rofi/colors/solarized.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #002B36FF; - background-alt: #073642FF; - foreground: #EEE8D5FF; - selected: #268BD2FF; - active: #859900FF; - urgent: #DC322FFF; -} diff --git a/rofi/colors/tokyonight.rasi b/rofi/colors/tokyonight.rasi deleted file mode 100644 index 1145cbd..0000000 --- a/rofi/colors/tokyonight.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Levi Lacoss (fishyfishfish55) - * Github : @fishyfishfish55 - * - * Colors - **/ - -* { - background: #15161EFF; - background-alt: #1A1B26FF; - foreground: #C0CAF5FF; - selected: #33467CFF; - active: #414868FF; - urgent: #F7768EFF; -} diff --git a/rofi/colors/yousai.rasi b/rofi/colors/yousai.rasi deleted file mode 100644 index 757cab3..0000000 --- a/rofi/colors/yousai.rasi +++ /dev/null @@ -1,16 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - **/ - -* { - background: #F5E7DEFF; - background-alt: #EBDCD2FF; - foreground: #34302DFF; - selected: #D97742FF; - active: #BF8F60FF; - urgent: #B23636FF; -} diff --git a/rofi/emoji/rofimoji.rc b/rofi/emoji/rofimoji.rc deleted file mode 100644 index e8c8df2..0000000 --- a/rofi/emoji/rofimoji.rc +++ /dev/null @@ -1,3 +0,0 @@ -action = copy -files = [emojis, math] -skin-tone = moderate diff --git a/rofi/emoji/rofimoji.sh b/rofi/emoji/rofimoji.sh deleted file mode 100755 index 26bbdd4..0000000 --- a/rofi/emoji/rofimoji.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -rofi -modi "emoji:rofimoji" -show emoji -theme ~/dotfiles/rofi/clipboard/clipboard.rasi - diff --git a/rofi/launcher/launcher.rasi b/rofi/launcher/launcher.rasi deleted file mode 100644 index 4961b46..0000000 --- a/rofi/launcher/launcher.rasi +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * THEME FOR ROFI - * Made By : Vivek Rajan - * Github Repo : https://github.com/MrVivekRajan - *******************************************************************************/ - -configuration { -display-drun: "󱓞 Applications"; -show-icons: true; -icon-theme: "Gruvminimal"; -} - -* { - font: "SF Pro Display Bold 18"; - - background-color: transparent; - text-color: #ebdbb3; - - margin: 0px; - padding: 0px; - spacing: 0px; -} - -window { - location: center; - width: 1000; - height: 515; - border-radius: 24px; - - border-color: #b95cb9; - border: 3px; - background-color: rgba(30, 30, 62, 60%); - x-offset: 8px; - y-offset: -40px; -} - -mainbox { - padding: 12px; - orientation: horizontal; - children: [ "imagebox", "listbox" ]; -} - -imagebox { - padding: 2px; - background-color: transparent; - background-image: url("~/.config/rofi/Rofi.png", width); - orientation: horizontal; -} - -listbox { - spacing: 20px; - padding: 20px; - background-color: transparent; - orientation: vertical; - children: [ "inputbar", "listview", "message" ]; -} - -inputbar { - background-color: rgba(30, 30, 62, 60%); - border-color: #b95cb9; - - border: 4px; - border-radius: 16px; - - padding: 8px 16px; - spacing: 8px; - children: [ prompt, entry ]; -} - -prompt { - text-color: #ebdbb3; -} - -entry { - placeholder: "Search"; - placeholder-color: #ebdbb580; -} - -message { - margin: 12px 0 0; - border-radius: 16px; - border-color: #b95cb9; - background-image: linear-gradient(45, #b95cb9d9, #4774bfd9); -} - -textbox { - padding: 8px 24px; -} - -listview { - background-color: transparent; - - margin: 12px 0 0; - lines: 8; - columns: 1; - - fixed-height: false; -} - -element { - padding: 8px 16px; - spacing: 8px; - border-radius: 20px; -} - -element normal active { - text-color: #ebdbb2; -} - -element selected normal, element selected active { - background-image: linear-gradient(45, #b95cb9d9, #4774bfd9); -} - -element-icon { - size: 1em; - vertical-align: 0.5; -} - -element-text { - text-color: #ebdbb3; -} \ No newline at end of file diff --git a/rofi/launcher/launcher.sh b/rofi/launcher/launcher.sh deleted file mode 100755 index 812ef87..0000000 --- a/rofi/launcher/launcher.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -dir="~/dotfiles/rofi/launcher" -theme='launchpad' - -## Run -rofi \ - -show drun \ - -theme ${dir}/${theme}.rasi diff --git a/rofi/launcher/launchpad.rasi b/rofi/launcher/launchpad.rasi deleted file mode 100644 index c37404b..0000000 --- a/rofi/launcher/launchpad.rasi +++ /dev/null @@ -1,94 +0,0 @@ -/*****----- Configuration -----*****/ -configuration { - modi: "drun"; - show-icons: true; - display-drun: " "; - drun-display-format: "{name}"; -} - -/*****----- Global Properties -----*****/ -@import "~/dotfiles/rofi/shared/fonts.rasi" - -/*****----- Main Window -----*****/ -window { - transparency: "real"; - location: center; - anchor: center; - fullscreen: true; - width: 1366px; - background-color: black / 90%; -} - -/*****----- Main Box -----*****/ -mainbox { - spacing: 10px; - padding: 100px; - background-color: transparent; - children: [ "inputbar", "listview" ]; -} - -/*****----- Inputbar -----*****/ -inputbar { - margin: 0% 28%; - padding: 10px; - border: 1px solid; - border-radius: 6px; - border-color: white / 25%; - background-color: white / 5%; - text-color: white; - children: [ "prompt", "entry" ]; -} - -prompt { - margin: 0px 0px 0px 0px; - background-color: transparent; - text-color: inherit; -} - -entry { - background-color: transparent; - text-color: inherit; - cursor: text; - placeholder: "Search"; - margin: 3px 0px 0px 0px; -} - -/*****----- Listview -----*****/ -listview { - columns: 12; - cycle: false; - scrollbar: false; - background-color: transparent; - text-color: white; - cursor: "default"; -} - -/*****----- Elements -----*****/ -element { - padding: 15px 10px; - border-radius: 10px; - background-color: transparent; - text-color: white; - orientation: vertical; - cursor: pointer; -} - -element selected.normal { - background-color: white / 15%; - text-color: white; -} - -element-icon { - background-color: transparent; - text-color: inherit; - size: 40px; - cursor: inherit; -} - -element-text { - background-color: transparent; - text-color: inherit; - cursor: inherit; - horizontal-align: 0.5; - padding: 10px 0px 0px 0px; -} diff --git a/rofi/powermenu/confirm.rasi b/rofi/powermenu/confirm.rasi deleted file mode 100644 index cc6b6e6..0000000 --- a/rofi/powermenu/confirm.rasi +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Rofi Theme File - * Rofi Version: 1.7.3 - **/ - -/*****----- Configuration -----*****/ -configuration { - show-icons: false; -} - -/*****----- Global Properties -----*****/ -@import "~/dotfiles/rofi/shared/colors.rasi" -@import "~/dotfiles/rofi/shared/fonts.rasi" - -/*****----- Main Window -----*****/ -window { - location: center; - anchor: center; - fullscreen: false; - width: 300px; - border-radius: 10px; - cursor: "default"; - background-color: @background; -} - -/*****----- Main Box -----*****/ -mainbox { - spacing: 10px; - padding: 10px; - background-color: transparent; - children: [ "message", "listview" ]; -} - -/*****----- Message -----*****/ -message { - margin: 0px; - padding: 10px; - border-radius: 10px; - background-color: @background-alt; - text-color: @foreground; -} -textbox { - background-color: inherit; - text-color: inherit; - vertical-align: 0.5; - horizontal-align: 0.5; - placeholder-color: @foreground; - blink: true; - markup: true; -} - -/*****----- Listview -----*****/ -listview { - columns: 2; - lines: 1; - cycle: true; - dynamic: true; - scrollbar: false; - layout: vertical; - reverse: false; - fixed-height: true; - fixed-columns: true; - - spacing: 10px; - background-color: transparent; - text-color: @foreground; - cursor: "default"; -} - -/*****----- Elements -----*****/ -element { - padding: 40px 20px 40px 0px; - border-radius: 10px; - background-color: white/5%; - text-color: @foreground; - cursor: pointer; -} -element-text { - font: "feather 30"; - background-color: transparent; - text-color: inherit; - cursor: inherit; - vertical-align: 0.5; - horizontal-align: 0.5; -} -element selected.normal { - background-color: white/15%; -} diff --git a/rofi/powermenu/powermenu.sh b/rofi/powermenu/powermenu.sh deleted file mode 100755 index d2d3c1e..0000000 --- a/rofi/powermenu/powermenu.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -## Author : Aditya Shakya (adi1090x) -## Github : @adi1090x -# -## Rofi : Power Menu -# -## Available Styles -# -## style-1 style-2 style-3 style-4 style-5 - -# Current Theme -dir="~/dotfiles/rofi/powermenu" -theme='userimage' - -# CMDs -uptime="`uptime -p | sed -e 's/up //g'`" -host=`hostname` - -# Options -shutdown='' -reboot='' -lock='' -suspend='' -logout='' -yes='' -no='' - -# Rofi CMD -rofi_cmd() { - rofi -dmenu \ - -p "Goodbye ${USER}" \ - -mesg "Uptime: $uptime" \ - -theme ${dir}/${theme}.rasi -} - -# Confirmation CMD -confirm_cmd() { - rofi -dmenu \ - -p 'Confirmation' \ - -mesg 'Are you Sure?' \ - -theme ${dir}/confirm.rasi -} - -# Ask for confirmation -confirm_exit() { - echo -e "$yes\n$no" | confirm_cmd -} - -# Pass variables to rofi dmenu -run_rofi() { - echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd -} - -# Execute Command -run_cmd() { - selected="$(confirm_exit)" - if [[ "$selected" == "$yes" ]]; then - if [[ $1 == '--shutdown' ]]; then - systemctl poweroff - elif [[ $1 == '--reboot' ]]; then - systemctl reboot - elif [[ $1 == '--suspend' ]]; then - mpc -q pause - amixer set Master mute - systemctl suspend - elif [[ $1 == '--logout' ]]; then - killall Hyprland - fi - else - exit 0 - fi -} - -# Actions -chosen="$(run_rofi)" -case ${chosen} in - $shutdown) - run_cmd --shutdown - ;; - $reboot) - run_cmd --reboot - ;; - $lock) - hyprlock - ;; - $suspend) - run_cmd --suspend - ;; - $logout) - run_cmd --logout - ;; -esac diff --git a/rofi/powermenu/userimage.rasi b/rofi/powermenu/userimage.rasi deleted file mode 100644 index 20a64f9..0000000 --- a/rofi/powermenu/userimage.rasi +++ /dev/null @@ -1,134 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Rofi Theme File - * Rofi Version: 1.7.3 - **/ - -/*****----- Configuration -----*****/ -configuration { - show-icons: false; -} - -/*****----- Global Properties -----*****/ -* { - /* Resolution : 1920x1080 */ - mainbox-spacing: 10px; - message-margin: 10px; - message-padding: 10px; - message-border-radius: 10px; - listview-spacing: 10px; - element-padding: 10px 10px 10px 0px; - element-border-radius: 10px; - - prompt-font: "Iosevka Nerd Font Bold 18"; - textbox-font: "Iosevka Nerd Font 10"; - element-text-font: "feather 30"; - - background-window: black/95%; - background-normal: white/5%; - background-selected: white/15%; - foreground-normal: white; - foreground-selected: white; -} - -/*****----- Main Window -----*****/ -window { - // transparency: "real"; - location: center; - anchor: center; - cursor: "default"; - background-color: var(background-window); - border-radius: 10px; - width: 500px; -} - -/*****----- Main Box -----*****/ -mainbox { - enabled: true; - spacing: var(mainbox-spacing); - background-color: transparent; - children: [ "dummy", "inputbar", "listview", "message", "dummy" ]; -} - -/*****----- Inputbar -----*****/ -inputbar { - enabled: true; - background-color: transparent; - children: [ "dummy", "prompt", "dummy"]; -} - -dummy { - background-color: transparent; -} - -prompt { - enabled: true; - font: var(prompt-font); - background-color: transparent; - text-color: var(foreground-normal); -} - -/*****----- Message -----*****/ -message { - enabled: true; - margin: var(message-margin); - padding: var(message-padding); - border-radius: var(message-border-radius); - background-color: var(background-normal); - text-color: var(foreground-normal); -} -textbox { - font: var(textbox-font); - background-color: transparent; - text-color: inherit; - vertical-align: 0.5; - horizontal-align: 0.5; -} - -/*****----- Listview -----*****/ -listview { - enabled: true; - expand: false; - columns: 5; - lines: 1; - cycle: true; - dynamic: true; - scrollbar: false; - layout: vertical; - reverse: false; - fixed-height: true; - fixed-columns: true; - - spacing: var(listview-spacing); - background-color: transparent; - cursor: "default"; - padding: 0px 10px; -} - -/*****----- Elements -----*****/ -element { - enabled: true; - padding: var(element-padding); - border-radius: var(element-border-radius); - background-color: var(background-normal); - text-color: var(foreground-normal); - cursor: pointer; - width: 100px; - // height: 100px; - // padding: 10px 0px; -} -element-text { - font: var(element-text-font); - background-color: transparent; - text-color: inherit; - cursor: inherit; - vertical-align: 0.5; - horizontal-align: 0.5; -} -element selected.normal { - background-color: var(background-selected); - text-color: var(foreground-selected); -} diff --git a/rofi/shared/colors.rasi b/rofi/shared/colors.rasi deleted file mode 100644 index 4877e6e..0000000 --- a/rofi/shared/colors.rasi +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Colors - * - * Available Colors Schemes - * - * adapta catppuccin everforest navy paper - * arc cyberpunk gruvbox nord solarized - * black dracula lovelace onedark yousai - * - **/ - -/* Import color-scheme from `colors` directory */ - -@import "~/dotfiles/rofi/colors/black.rasi" diff --git a/rofi/shared/fonts.rasi b/rofi/shared/fonts.rasi deleted file mode 100644 index ea545bf..0000000 --- a/rofi/shared/fonts.rasi +++ /dev/null @@ -1,12 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Fonts - * - **/ - -* { - font: "JetBrainsMono Nerd font 10"; -} diff --git a/samba/smb.conf b/samba/smb.conf deleted file mode 100644 index 65cb875..0000000 --- a/samba/smb.conf +++ /dev/null @@ -1,24 +0,0 @@ -[global] -netbios name = tola -name resolve order = bcast lmhosts host wins -workgroup = home -server string = Filestore -map to guest = Bad User - -[Public] -path = /samba/public -guest ok = Yes -browseable = yes -writable = yes - -[Private] -comment = My private Filestore -path=/samba/private -read only = no -guest ok = no -browseable = yes -writable = yes -create mask = 0777 -directory mask = 0777 -force user = tola -force group = users diff --git a/shell/source.sh b/shell/source.sh deleted file mode 100644 index 951e9a6..0000000 --- a/shell/source.sh +++ /dev/null @@ -1,89 +0,0 @@ - -#--- path --- -export PATH=$PATH:~/dotfiles/bin:~/dotfiles/hypr/bin:~/dotfiles/dwm/bin/:~/.cargo/bin -export GTK2_RC_FILES=~/.config/gtk-2.0/gtkrc -#------------ - -#--- sys --- -alias psa='busybox ps' # show all processes -alias c='clear' # clear terminal screen -alias e='echo' # print in terminal -alias s='source' # source -alias kcat='kitty icat' # show image in kitty terminal -alias ff='fastfetch' # system data -alias una='uname -a' # system name -alias ifcnf='ifconfig' # ifconfig -#--- pacman --- -alias p='sudo pacman' # pacman -alias psy='sudo pacman -Sy' # update repositories -alias psyu='sudo pacman -Syu' # upgrade system -alias pi='sudo pacman -S' # install package -alias psc='sudo pacman -Ss' # search package in repository -alias pqdtq='sudo pacman -Qdtq' # list files without dependencies -alias pq='sudo pacman -Q' # list installed packages -alias pql='sudo pacman -Ql' # list files in packages -alias prm='sudo pacman -R' # delete pacman package -alias prns='sudo pacman -Rns' # delete pacman package with all dependencies -#-------------- -#--- apt --- -alias aptu='sudo apt update' # update apt repositories -alias apti='sudo apt install -y' # install apt package -alias aptui='sudo apt upgrade -y' # upgrade apt packages -alias aptrm='sudo apt remove -y' # remove apt package -alias aptautorm='sudo apt autoremove -y' # remove apt package with dependencies -#----------- -alias ipr='ip route' # show routes -alias ipa='ip addr' # show addresses -alias ipl='ip link' # show links -alias sctl='systemctl' # systemctl -alias sctls='systemctl start' # service start -alias sctlst='systemctl status' # service status -alias sctlp='systemctl stop' # service stop -alias H='Hyprland' # start Hyprland -alias sx='startx' # startx - start xorg -#----------- - -#--- git --- -alias g='git' # git -alias ga='git add' # add unstaged changes -alias gaa='git add --all' # add all unstaged changes -alias gb='git branch' # create branch -alias gba='git branch --all' # list all branches -alias gbd='git branch --delete' # delete branch -alias gbD='git branch --delete --force' # force delete branch -alias gco='git checkout' # checkout to another branch -alias gcb='git checkout -b' # checkout and create branch -alias gc='git clone' # clone from remote repository -alias gcl='git clone --recursive' # clone recursive with submodules -alias gcam='git commit --all --message' # commit with commit message -alias gd='git diff' # create diff -alias gcf='git config --list' # show config -alias gf='git fetch' # fetch from remote repository -alias ghh='git help' # help -alias glgg='git log --graph' # log with graph -alias glg='git log --stat' # log with stat -alias gm='git merge' # merge branches -alias gl='git pull' # pull from upstream repository -alias gpr='git pull --rebase' # pull from upstream repository and rebase local changes -alias gp='git push' # push to upstream repository -alias gpo='git push --set-upstream origin' # push to upstream repository and set upstream branch -alias gra='git remote add' # add remote repository -alias grrm='git remote remove' # remove remote repository -alias gstall='git stash --all' # stash all in repository -alias gstc='git stash clear' # clear git stash -alias gst='git status' # status repository -#----------- - -#--- docker --- -alias dpa='docker ps -a' # list all docker containers -alias dp='docker ps' # list active docker containers -alias dia='docker images -a' # list all docker images -alias di='docker images' # list docker images -alias dcrm='docker container rm' # remove docker container -alias dirm='docker image rm' # remove docker image -alias dr='docker run' # run docker image as container -alias ds='docker start' # start docker container -alias dst='docker stop' # stop docker container -alias dspa='docker system prune -a' # delete all docker data -alias dcaq='docker ps -aq' # stop all containers -#-------------- diff --git a/sowm/sowm/LICENSE.md b/sowm/sowm/LICENSE.md deleted file mode 100644 index 38cf607..0000000 --- a/sowm/sowm/LICENSE.md +++ /dev/null @@ -1,33 +0,0 @@ -MIT/X Consortium License - -- © 2019- Dylan Araps -- © 2006-2011 Anselm R Garbe -- © 2007-2011 Peter Hartlich -- © 2010-2011 Connor Lane Smith -- © 2006-2009 Jukka Salmi -- © 2007-2009 Premysl Hruby -- © 2007-2009 Szabolcs Nagy -- © 2007-2009 Christof Musik -- © 2009 Mate Nagy -- © 2007-2008 Enno Gottox Boland -- © 2008 Martin Hurton -- © 2008 Neale Pickett -- © 2006-2007 Sander van Dijk - -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 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. diff --git a/sowm/sowm/Makefile b/sowm/sowm/Makefile deleted file mode 100644 index 20f3734..0000000 --- a/sowm/sowm/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -CFLAGS += -std=c99 -Wall -Wextra -pedantic -Wold-style-declaration -CFLAGS += -Wmissing-prototypes -Wno-unused-parameter -PREFIX ?= /usr -BINDIR ?= $(PREFIX)/bin -CC ?= gcc - -all: sowm - -config.h: - cp config.def.h config.h - -sowm: sowm.c sowm.h config.h Makefile - $(CC) -O3 $(CFLAGS) -o $@ $< -lX11 $(LDFLAGS) - -install: all - install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm - -uninstall: - rm -f $(DESTDIR)$(BINDIR)/sowm - -clean: - rm -f sowm *.o - -.PHONY: all install uninstall clean diff --git a/sowm/sowm/README.md b/sowm/sowm/README.md deleted file mode 100644 index e0aa3e9..0000000 --- a/sowm/sowm/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# sowm (*~~Simple~~ Shitty Opinionated Window Manager*) - - - -An itsy bitsy floating window manager (*220~ sloc!*). - -- Floating only. -- Fullscreen toggle. -- Window centering. -- Mix of mouse and keyboard workflow. -- Focus with cursor. -- Rounded corners (*[through patch](https://github.com/dylanaraps/sowm/pull/58)*) -- Titlebars (*[through patch](https://github.com/dylanaraps/sowm/pull/57)*) - - - -- Alt-Tab window focusing. -- All windows die on exit. -- No window borders. -- [No ICCCM](https://web.archive.org/web/20190617214524/https://raw.githubusercontent.com/kfish/xsel/1a1c5edf0dc129055f7764c666da2dd468df6016/rant.txt). -- No EWMH. -- etc etc etc - - -
- -Patches available here: https://github.com/dylanaraps/sowm/pulls - -## Default Keybindings - -**Window Management** - -| combo | action | -| -------------------------- | -----------------------| -| `Mouse` | focus under cursor | -| `MOD4` + `Left Mouse` | move window | -| `MOD4` + `Right Mouse` | resize window | -| `MOD4` + `f` | maximize toggle | -| `MOD4` + `c` | center window | -| `MOD4` + `q` | kill window | -| `MOD4` + `1-6` | desktop swap | -| `MOD4` + `Shift` +`1-6` | send window to desktop | -| `MOD1` + `TAB` (*alt-tab*) | focus cycle | - -**Programs** - -| combo | action | program | -| ------------------------ | ---------------- | -------------- | -| `MOD4` + `Return` | terminal | `st` | -| `MOD4` + `d` | dmenu | `dmenu_run` | -| `MOD4` + `p` | scrot | `scr` | -| `MOD4` + `w` | wallpaper cycler | `bud` | -| `XF86_AudioLowerVolume` | volume down | `amixer` | -| `XF86_AudioRaiseVolume` | volume up | `amixer` | -| `XF86_AudioMute` | volume toggle | `amixer` | -| `XF86_MonBrightnessUp` | brightness up | `bri` | -| `XF86_MonBrightnessDown` | brightness down | `bri` | - - -## Dependencies - -- `xlib` (*usually `libX11`*). - - -## Installation - -1) Copy `config.def.h` to `config.h` and modify it to suit your needs. -2) Run `make` to build `sowm`. -3) Copy it to your path or run `make install`. - - `DESTDIR` and `PREFIX` are supported. -4) (Optional) Apply patch with `git apply patches/patch-name` - - In case of applying multiple patches, it has to be done **manually**. - -If you are using GDM, save the following to `/usr/share/xsessions/sowm.desktop`. It is still recommended to start `sowm` from `.xinitrc` or through -[your own xinit implementation](https://github.com/dylanaraps/bin/blob/dfd9a9ff4555efb1cc966f8473339f37d13698ba/x). - -``` -[Desktop Entry] -Name=sowm -Comment=This session runs sowm as desktop manager -Exec=sowm -Type=Application -``` - - -## Thanks - -- [2bwm](https://github.com/venam/2bwm) -- [SmallWM](https://github.com/adamnew123456/SmallWM) -- [berry](https://github.com/JLErvin/berry) -- [catwm](https://github.com/pyknite/catwm) -- [dminiwm](https://github.com/moetunes/dminiwm) -- [dwm](https://dwm.suckless.org) -- [monsterwm](https://github.com/c00kiemon5ter/monsterwm) -- [openbox](https://github.com/danakj/openbox) -- [possum-wm](https://github.com/duckinator/possum-wm) -- [swm](https://github.com/dcat/swm) -- [tinywm](http://incise.org/tinywm.html) diff --git a/sowm/sowm/config.def.h b/sowm/sowm/config.def.h deleted file mode 100644 index cae2009..0000000 --- a/sowm/sowm/config.def.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define MOD Mod4Mask - -const char* menu[] = {"dmenu_run", 0}; -const char* term[] = {"st", 0}; -const char* scrot[] = {"scr", 0}; -const char* briup[] = {"bri", "10", "+", 0}; -const char* bridown[] = {"bri", "10", "-", 0}; -const char* voldown[] = {"amixer", "sset", "Master", "5%-", 0}; -const char* volup[] = {"amixer", "sset", "Master", "5%+", 0}; -const char* volmute[] = {"amixer", "sset", "Master", "toggle", 0}; -const char* colors[] = {"bud", "/home/goldie/Pictures/Wallpapers", 0}; - -static struct key keys[] = { - {MOD, XK_q, win_kill, {0}}, - {MOD, XK_c, win_center, {0}}, - {MOD, XK_f, win_fs, {0}}, - - {Mod1Mask, XK_Tab, win_next, {0}}, - {Mod1Mask|ShiftMask, XK_Tab, win_prev, {0}}, - - {MOD, XK_d, run, {.com = menu}}, - {MOD, XK_w, run, {.com = colors}}, - {MOD, XK_p, run, {.com = scrot}}, - {MOD, XK_Return, run, {.com = term}}, - - {0, XF86XK_AudioLowerVolume, run, {.com = voldown}}, - {0, XF86XK_AudioRaiseVolume, run, {.com = volup}}, - {0, XF86XK_AudioMute, run, {.com = volmute}}, - {0, XF86XK_MonBrightnessUp, run, {.com = briup}}, - {0, XF86XK_MonBrightnessDown, run, {.com = bridown}}, - - {MOD, XK_1, ws_go, {.i = 1}}, - {MOD|ShiftMask, XK_1, win_to_ws, {.i = 1}}, - {MOD, XK_2, ws_go, {.i = 2}}, - {MOD|ShiftMask, XK_2, win_to_ws, {.i = 2}}, - {MOD, XK_3, ws_go, {.i = 3}}, - {MOD|ShiftMask, XK_3, win_to_ws, {.i = 3}}, - {MOD, XK_4, ws_go, {.i = 4}}, - {MOD|ShiftMask, XK_4, win_to_ws, {.i = 4}}, - {MOD, XK_5, ws_go, {.i = 5}}, - {MOD|ShiftMask, XK_5, win_to_ws, {.i = 5}}, - {MOD, XK_6, ws_go, {.i = 6}}, - {MOD|ShiftMask, XK_6, win_to_ws, {.i = 6}}, -}; - -#endif diff --git a/sowm/sowm/config.h b/sowm/sowm/config.h deleted file mode 100644 index 3d1e457..0000000 --- a/sowm/sowm/config.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -//-------- modkey --- -#define MOD Mod1Mask -//------------------- - -const char* menu[] = {"/home/tola/dotfiles/rofi/launcher/launcher.sh", 0}; -const char* term[] = {"st", 0}; -const char* scrot[] = {"scr", 0}; -const char* briup[] = {"bri", "10", "+", 0}; -const char* bridown[] = {"bri", "10", "-", 0}; -const char* voldown[] = {"amixer", "sset", "Master", "5%-", 0}; -const char* volup[] = {"amixer", "sset", "Master", "5%+", 0}; -const char* volmute[] = {"amixer", "sset", "Master", "toggle", 0}; -const char* colors[] = {"bud", "/home/goldie/Pictures/Wallpapers", 0}; - -static struct key keys[] = { - //------------- windows ------------- - {MOD, XK_q, win_kill, {0}}, - {MOD, XK_c, win_center, {0}}, - {MOD, XK_f, win_fs, {0}}, - //----------------------------------- - - {Mod1Mask, XK_Tab, win_next, {0}}, - {Mod1Mask|ShiftMask, XK_Tab, win_prev, {0}}, - - {MOD, XK_d, run, {.com = menu}}, - {MOD, XK_w, run, {.com = colors}}, - {MOD, XK_p, run, {.com = scrot}}, - {MOD, XK_Return, run, {.com = term}}, - - {0, XF86XK_AudioLowerVolume, run, {.com = voldown}}, - {0, XF86XK_AudioRaiseVolume, run, {.com = volup}}, - {0, XF86XK_AudioMute, run, {.com = volmute}}, - {0, XF86XK_MonBrightnessUp, run, {.com = briup}}, - {0, XF86XK_MonBrightnessDown, run, {.com = bridown}}, - - //-------------- workspaces --------------- - {MOD, XK_1, ws_go, {.i = 1}}, - {MOD|ShiftMask, XK_1, win_to_ws, {.i = 1}}, - {MOD, XK_2, ws_go, {.i = 2}}, - {MOD|ShiftMask, XK_2, win_to_ws, {.i = 2}}, - {MOD, XK_3, ws_go, {.i = 3}}, - {MOD|ShiftMask, XK_3, win_to_ws, {.i = 3}}, - {MOD, XK_4, ws_go, {.i = 4}}, - {MOD|ShiftMask, XK_4, win_to_ws, {.i = 4}}, - {MOD, XK_5, ws_go, {.i = 5}}, - {MOD|ShiftMask, XK_5, win_to_ws, {.i = 5}}, - {MOD, XK_6, ws_go, {.i = 6}}, - {MOD|ShiftMask, XK_6, win_to_ws, {.i = 6}}, - //----------------------------------------- -}; - -#endif diff --git a/sowm/sowm/sowm b/sowm/sowm/sowm deleted file mode 100755 index c3c625a..0000000 Binary files a/sowm/sowm/sowm and /dev/null differ diff --git a/sowm/sowm/sowm.c b/sowm/sowm/sowm.c deleted file mode 100644 index 96f8340..0000000 --- a/sowm/sowm/sowm.c +++ /dev/null @@ -1,289 +0,0 @@ -// sowm - An itsy bitsy floating window manager. - -#include -#include -#include -#include -#include -#include -#include - -#include "sowm.h" - -static client *list = {0}, *ws_list[10] = {0}, *cur; -static int ws = 1, sw, sh, wx, wy, numlock = 0; -static unsigned int ww, wh; - -static Display *d; -static XButtonEvent mouse; -static Window root; - -static void (*events[LASTEvent])(XEvent *e) = { - [ButtonPress] = button_press, - [ButtonRelease] = button_release, - [ConfigureRequest] = configure_request, - [KeyPress] = key_press, - [MapRequest] = map_request, - [MappingNotify] = mapping_notify, - [DestroyNotify] = notify_destroy, - [EnterNotify] = notify_enter, - [MotionNotify] = notify_motion -}; - -#include "config.h" - -void win_focus(client *c) { - cur = c; - XSetInputFocus(d, cur->w, RevertToParent, CurrentTime); -} - -void notify_destroy(XEvent *e) { - win_del(e->xdestroywindow.window); - - if (list) win_focus(list->prev); -} - -void notify_enter(XEvent *e) { - while(XCheckTypedEvent(d, EnterNotify, e)); - - for win if (c->w == e->xcrossing.window) win_focus(c); -} - -void notify_motion(XEvent *e) { - if (!mouse.subwindow || cur->f) return; - - while(XCheckTypedEvent(d, MotionNotify, e)); - - int xd = e->xbutton.x_root - mouse.x_root; - int yd = e->xbutton.y_root - mouse.y_root; - - XMoveResizeWindow(d, mouse.subwindow, - wx + (mouse.button == 1 ? xd : 0), - wy + (mouse.button == 1 ? yd : 0), - MAX(1, ww + (mouse.button == 3 ? xd : 0)), - MAX(1, wh + (mouse.button == 3 ? yd : 0))); -} - -void key_press(XEvent *e) { - KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0); - - for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) - if (keys[i].keysym == keysym && - mod_clean(keys[i].mod) == mod_clean(e->xkey.state)) - keys[i].function(keys[i].arg); -} - -void button_press(XEvent *e) { - if (!e->xbutton.subwindow) return; - - win_size(e->xbutton.subwindow, &wx, &wy, &ww, &wh); - XRaiseWindow(d, e->xbutton.subwindow); - mouse = e->xbutton; -} - -void button_release(XEvent *e) { - mouse.subwindow = 0; -} - -void win_add(Window w) { - client *c; - - if (!(c = (client *) calloc(1, sizeof(client)))) - exit(1); - - c->w = w; - - if (list) { - list->prev->next = c; - c->prev = list->prev; - list->prev = c; - c->next = list; - - } else { - list = c; - list->prev = list->next = list; - } - - ws_save(ws); -} - -void win_del(Window w) { - client *x = 0; - - for win if (c->w == w) x = c; - - if (!list || !x) return; - if (x->prev == x) list = 0; - if (list == x) list = x->next; - if (x->next) x->next->prev = x->prev; - if (x->prev) x->prev->next = x->next; - - free(x); - ws_save(ws); -} - -void win_kill(const Arg arg) { - if (cur) XKillClient(d, cur->w); -} - -void win_center(const Arg arg) { - if (!cur) return; - - win_size(cur->w, &(int){0}, &(int){0}, &ww, &wh); - XMoveWindow(d, cur->w, (sw - ww) / 2, (sh - wh) / 2); -} - -void win_fs(const Arg arg) { - if (!cur) return; - - if ((cur->f = cur->f ? 0 : 1)) { - win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); - XMoveResizeWindow(d, cur->w, 0, 0, sw, sh); - - } else { - XMoveResizeWindow(d, cur->w, cur->wx, cur->wy, cur->ww, cur->wh); - } -} - -void win_to_ws(const Arg arg) { - int tmp = ws; - - if (arg.i == tmp) return; - - ws_sel(arg.i); - win_add(cur->w); - ws_save(arg.i); - - ws_sel(tmp); - win_del(cur->w); - XUnmapWindow(d, cur->w); - ws_save(tmp); - - if (list) win_focus(list); -} - -void win_prev(const Arg arg) { - if (!cur) return; - - XRaiseWindow(d, cur->prev->w); - win_focus(cur->prev); -} - -void win_next(const Arg arg) { - if (!cur) return; - - XRaiseWindow(d, cur->next->w); - win_focus(cur->next); -} - -void ws_go(const Arg arg) { - int tmp = ws; - - if (arg.i == ws) return; - - ws_save(ws); - ws_sel(arg.i); - - for win XMapWindow(d, c->w); - - ws_sel(tmp); - - for win XUnmapWindow(d, c->w); - - ws_sel(arg.i); - - if (list) win_focus(list); else cur = 0; -} - -void configure_request(XEvent *e) { - XConfigureRequestEvent *ev = &e->xconfigurerequest; - - XConfigureWindow(d, ev->window, ev->value_mask, &(XWindowChanges) { - .x = ev->x, - .y = ev->y, - .width = ev->width, - .height = ev->height, - .sibling = ev->above, - .stack_mode = ev->detail - }); -} - -void map_request(XEvent *e) { - Window w = e->xmaprequest.window; - - XSelectInput(d, w, StructureNotifyMask|EnterWindowMask); - win_size(w, &wx, &wy, &ww, &wh); - win_add(w); - cur = list->prev; - - if (wx + wy == 0) win_center((Arg){0}); - - XMapWindow(d, w); - win_focus(list->prev); -} - -void mapping_notify(XEvent *e) { - XMappingEvent *ev = &e->xmapping; - - if (ev->request == MappingKeyboard || ev->request == MappingModifier) { - XRefreshKeyboardMapping(ev); - input_grab(root); - } -} - -void run(const Arg arg) { - if (fork()) return; - if (d) close(ConnectionNumber(d)); - - setsid(); - execvp((char*)arg.com[0], (char**)arg.com); -} - -void input_grab(Window root) { - unsigned int i, j, modifiers[] = {0, LockMask, numlock, numlock|LockMask}; - XModifierKeymap *modmap = XGetModifierMapping(d); - KeyCode code; - - for (i = 0; i < 8; i++) - for (int k = 0; k < modmap->max_keypermod; k++) - if (modmap->modifiermap[i * modmap->max_keypermod + k] - == XKeysymToKeycode(d, 0xff7f)) - numlock = (1 << i); - - XUngrabKey(d, AnyKey, AnyModifier, root); - - for (i = 0; i < sizeof(keys)/sizeof(*keys); i++) - if ((code = XKeysymToKeycode(d, keys[i].keysym))) - for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) - XGrabKey(d, code, keys[i].mod | modifiers[j], root, - True, GrabModeAsync, GrabModeAsync); - - for (i = 1; i < 4; i += 2) - for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) - XGrabButton(d, i, MOD | modifiers[j], root, True, - ButtonPressMask|ButtonReleaseMask|PointerMotionMask, - GrabModeAsync, GrabModeAsync, 0, 0); - - XFreeModifiermap(modmap); -} - -int main(void) { - XEvent ev; - - if (!(d = XOpenDisplay(0))) exit(1); - - signal(SIGCHLD, SIG_IGN); - XSetErrorHandler(xerror); - - int s = DefaultScreen(d); - root = RootWindow(d, s); - sw = XDisplayWidth(d, s); - sh = XDisplayHeight(d, s); - - XSelectInput(d, root, SubstructureRedirectMask); - XDefineCursor(d, root, XCreateFontCursor(d, 68)); - input_grab(root); - - while (1 && !XNextEvent(d, &ev)) // 1 && will forever be here. - if (events[ev.type]) events[ev.type](&ev); -} diff --git a/sowm/sowm/sowm.h b/sowm/sowm/sowm.h deleted file mode 100644 index b059f06..0000000 --- a/sowm/sowm/sowm.h +++ /dev/null @@ -1,58 +0,0 @@ -#include - -#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next) -#define ws_save(W) ws_list[W] = list -#define ws_sel(W) list = ws_list[ws = W] -#define MAX(a, b) ((a) > (b) ? (a) : (b)) - -#define win_size(W, gx, gy, gw, gh) \ - XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ - &(unsigned int){0}, &(unsigned int){0}) - -// Taken from DWM. Many thanks. https://git.suckless.org/dwm -#define mod_clean(mask) (mask & ~(numlock|LockMask) & \ - (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) - -typedef struct { - const char** com; - const int i; - const Window w; -} Arg; - -struct key { - unsigned int mod; - KeySym keysym; - void (*function)(const Arg arg); - const Arg arg; -}; - -typedef struct client { - struct client *next, *prev; - int f, wx, wy; - unsigned int ww, wh; - Window w; -} client; - -void button_press(XEvent *e); -void button_release(XEvent *e); -void configure_request(XEvent *e); -void input_grab(Window root); -void key_press(XEvent *e); -void map_request(XEvent *e); -void mapping_notify(XEvent *e); -void notify_destroy(XEvent *e); -void notify_enter(XEvent *e); -void notify_motion(XEvent *e); -void run(const Arg arg); -void win_add(Window w); -void win_center(const Arg arg); -void win_del(Window w); -void win_fs(const Arg arg); -void win_focus(client *c); -void win_kill(const Arg arg); -void win_prev(const Arg arg); -void win_next(const Arg arg); -void win_to_ws(const Arg arg); -void ws_go(const Arg arg); - -static int xerror() { return 0; } diff --git a/sowm/startsowm.sh b/sowm/startsowm.sh deleted file mode 100755 index 4eba74e..0000000 --- a/sowm/startsowm.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -setxkbmap "us,ru" -option 'grp:win_space_toggle' -~/dotfiles/dwm/background.sh & -# picom -b -dunst & - - -while true; do - sowm 2> ~/.sowm.log -done - diff --git a/start_uxplay.sh b/start_uxplay.sh deleted file mode 100755 index 7f4364e..0000000 --- a/start_uxplay.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -uxplay & diff --git a/swaync/config.json b/swaync/config.json deleted file mode 100644 index 4089933..0000000 --- a/swaync/config.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "/etc/xdg/swaync/configSchema.json", - "positionX": "right", - "positionY": "top", - "layer": "overlay", - "control-center-layer": "top", - "layer-shell": true, - "cssPriority": "application", - - "control-center-width": 350, - "control-center-height": 700, - "control-center-margin-top": 1, - "control-center-margin-bottom": 2, - "control-center-margin-right": 1, - "control-center-margin-left": 0, - - "notification-2fa-action": true, - "notification-inline-replies": true, - "notification-window-width": 350, - "notification-icon-size": 50, - "notification-body-image-height": 140, - "notification-body-image-width": 180, - - "timeout": 6, - "timeout-low": 3, - "timeout-critical": 0, - "fit-to-screen": false, - "keyboard-shortcuts": true, - "image-visibility": "when available", - "transition-time": 200, - "hide-on-clear": false, - "hide-on-action": true, - "script-fail-notify": true, - "widgets": [ - "title", - "mpris", - "volume", - "backlight", - "notifications" - ], - "widget-config": { - "title": { - "text": "Notifications", - "clear-all-button": true, - "button-text": "Clear" - }, - "dnd": { - "text": " " - }, - "label": { - "max-lines":2, - "text": "Notification" - }, - "mpris": { - "image-size": 60, - "image-radius": 10 - }, - "volume": { - "label": "󰕾" - }, - "backlight": { - "label": "󰃟" - }, - "buttons-grid": { - "actions": [ - { - "label": " Wi-FI", - "command": "nm-connection-editor" - }, - { - "label": "󰕾 Mute", - "command": "pactl set-sink-mute @DEFAULT_SINK@ toggle" - - }, - { - "label": "󰂯 Bluetooth", - "command": "blueman-manager" - }, - { - "label": " Theme", - "command":"/home/alien/.config/hypr/scripts/themechanging" - - - } - ] - } - } - } \ No newline at end of file diff --git a/swaync/configSchema.json b/swaync/configSchema.json deleted file mode 100644 index 8d96c68..0000000 --- a/swaync/configSchema.json +++ /dev/null @@ -1,622 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "SwayNotificationCenter JSON schema", - "type": "object", - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "description": "Pointer to the schema against which this document should be validated." - }, - "positionX": { - "type": "string", - "description": "Horizontal position of control center and notification window", - "default": "right", - "enum": ["right", "left", "center"] - }, - "layer": { - "type": "string", - "description": "Layer of notification window", - "default": "overlay", - "enum": ["background", "bottom", "top", "overlay"] - }, - "layer-shell": { - "type": "boolean", - "description": "Wether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply", - "default": true - }, - "cssPriority": { - "type": "string", - "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", - "default": "application", - "enum": ["application", "user"] - }, - "positionY": { - "type": "string", - "description": "Vertical position of control center and notification window", - "default": "top", - "enum": ["top", "center", "bottom"] - }, - "control-center-positionX": { - "type": "string", - "description": "Optional: Horizontal position of the control center. Supersedes positionX if not set to `none`", - "default": "none", - "enum": ["right", "left", "center", "none"] - }, - "control-center-positionY": { - "type": "string", - "description": "Optional: Vertical position of the control center. Supersedes positionY if not set to `none`", - "default": "none", - "enum": ["top", "bottom", "none"] - }, - "control-center-margin-top": { - "type": "integer", - "description": "The margin (in pixels) at the top of the control center. 0 to disable", - "default": 0 - }, - "control-center-margin-bottom": { - "type": "integer", - "description": "The margin (in pixels) at the bottom of the control center. 0 to disable", - "default": 0 - }, - "control-center-margin-right": { - "type": "integer", - "description": "The margin (in pixels) at the right of the control center. 0 to disable", - "default": 0 - }, - "control-center-margin-left": { - "type": "integer", - "description": "The margin (in pixels) at the left of the control center. 0 to disable", - "default": 0 - }, - "control-center-layer": { - "type": "string", - "description": "Layer of control center window", - "default": "none", - "enum": ["background", "bottom", "top", "overlay", "none"] - }, - "control-center-exclusive-zone": { - "type": "boolean", - "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.", - "default": true - }, - "notification-2fa-action": { - "type": "boolean", - "description": "If each notification should display a 'COPY \"1234\"' action", - "default": true - }, - "notification-inline-replies": { - "type": "boolean", - "description": "If notifications should display a text field to reply if the sender requests it. NOTE: Replying in popup notifications is only available if the compositor supports GTK Layer-Shell ON_DEMAND keyboard interactivity.", - "default": false - }, - "notification-icon-size": { - "type": "integer", - "description": "The notification icon size (in pixels). The app icon size is 1/3", - "default": 64, - "minimum": 16 - }, - "notification-body-image-height": { - "type": "integer", - "description": "The notification body image height (in pixels)", - "default": 100, - "minimum": 100 - }, - "notification-body-image-width": { - "type": "integer", - "description": "The notification body image width (in pixels)", - "default": 200, - "minimum": 200 - }, - "timeout": { - "type": "integer", - "description": "The notification timeout for notifications with normal priority", - "default": 10 - }, - "timeout-low": { - "type": "integer", - "description": "The notification timeout for notifications with low priority", - "default": 5 - }, - "timeout-critical": { - "type": "integer", - "description": "The notification timeout for notifications with critical priority. 0 to disable", - "default": 0 - }, - "notification-window-width": { - "type": "integer", - "description": "Width of the notification in pixels", - "default": 500 - }, - "fit-to-screen": { - "type": "boolean", - "description": "If the control center should expand to both edges of the screen", - "default": true - }, - "relative-timestamps": { - "type": "boolean", - "description": "Display notification timestamps relative to now e.g. \"26 minutes ago\". If false, a local iso8601-formatted absolute timestamp is displayed.", - "default": true - }, - "control-center-height": { - "type": "integer", - "description": "Height of the control center in pixels. Ignored when 'fit-to-screen' is set to 'true'", - "default": 600, - "minimum": 300 - }, - "control-center-width": { - "type": "integer", - "description": "Width of the control center in pixels", - "default": 500, - "minimum": 300 - }, - "keyboard-shortcuts": { - "type": "boolean", - "description": "If control center should use keyboard shortcuts", - "default": true - }, - "image-visibility": { - "type": "string", - "description": "The notification image visibility when no icon is available.", - "default": "when-available", - "enum": ["always", "when-available", "never"] - }, - "transition-time": { - "type": "integer", - "description": "The notification animation duration. 0 to disable", - "default": 200 - }, - "hide-on-clear": { - "type": "boolean", - "description": "Hides the control center after pressing \"Clear All\"", - "default": false - }, - "hide-on-action": { - "type": "boolean", - "description": "Hides the control center when clicking on notification action", - "default": true - }, - "script-fail-notify": { - "type": "boolean", - "description": "Sends a notification if a script fails to run", - "default": true - }, - "scripts": { - "type": "object", - "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.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^.{1,}$": { - "type": "object", - "description": "Your script object.", - "required": ["exec"], - "minProperties": 2, - "additionalProperties": false, - "properties": { - "exec": { - "type": "string", - "description": "The script to run. Can also run regular shell commands." - }, - "app-name": { - "type": "string", - "description": "The app-name. Uses Regex." - }, - "desktop-entry": { - "type": "string", - "description": "The desktop-entry. Uses Regex." - }, - "summary": { - "type": "string", - "description": "The summary of the notification. Uses Regex." - }, - "body": { - "type": "string", - "description": "The body of the notification. Uses Regex." - }, - "urgency": { - "type": "string", - "description": "The urgency of the notification.", - "default": "Normal", - "enum": ["Low", "Normal", "Critical"] - }, - "category": { - "type": "string", - "description": "Which category the notification belongs to. Uses Regex." - }, - "run-on": { - "type": "string", - "description": "Whether to run the script on an action being activated, or when the notification is received.", - "enum": ["action", "receive"], - "default": "receive" - } - } - } - } - }, - "notification-visibility": { - "type": "object", - "description": "Set the visibility 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.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^.{1,}$": { - "type": "object", - "description": "Your script object.", - "required": ["state"], - "minProperties": 2, - "additionalProperties": false, - "properties": { - "state": { - "type": "string", - "description": "The notification visibility state.", - "default": "enabled", - "enum": ["ignored", "muted", "enabled", "transient"] - }, - "app-name": { - "type": "string", - "description": "The app-name. Uses Regex." - }, - "desktop-entry": { - "type": "string", - "description": "The desktop-entry. Uses Regex." - }, - "summary": { - "type": "string", - "description": "The summary of the notification. Uses Regex." - }, - "body": { - "type": "string", - "description": "The body of the notification. Uses Regex." - }, - "urgency": { - "type": "string", - "description": "The urgency of the notification.", - "default": "Normal", - "enum": ["Low", "Normal", "Critical"] - }, - "override-urgency": { - "type": "string", - "description": "The new urgency of the notification (optional)", - "default": "unset", - "enum": ["unset", "low", "normal", "critical"] - }, - "category": { - "type": "string", - "description": "Which category the notification belongs to. Uses Regex." - } - } - } - } - }, - "widgets": { - "type": "array", - "description": "Which order and which widgets to display. If the \"notifications\" widget isn't specified, it will be placed at the bottom.", - "default": ["inhibitors", "title", "dnd", "notifications"], - "items": { - "type": "string", - "$comment": "Sadly can't use regex and enums at the same time. Fix in the future?", - "pattern": "^[a-zA-Z0-9_-]{1,}(#[a-zA-Z0-9_-]{1,}){0,1}?$" - } - }, - "widget-config": { - "type": "object", - "description": "Configure specific widget properties.", - "additionalProperties": false, - "$comment": "New widgets go here in \"patternProperties\" ↓", - "patternProperties": { - "^title(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$comment": "References the widget structure from \"widgets\" below", - "$ref": "#/widgets/title" - }, - "^dnd(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/dnd" - }, - "^label(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/label" - }, - "^mpris(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/mpris" - }, - "^buttons-grid(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/buttons-grid" - }, - "^menubar(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/menubar" - }, - "^volume(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/volume" - }, - "^backlight(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/backlight" - }, - "^inhibitors(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$comment": "References the widget structure from \"widgets\" below", - "$ref": "#/widgets/inhibitors" - } - } - } - }, - "widgets": { - "$comment": "New widgets go here", - "title": { - "type": "object", - "description": "Control Center Title Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Notifications" - }, - "clear-all-button": { - "type": "boolean", - "description": "Wether to display a \"Clear All\" button", - "default": true - }, - "button-text": { - "type": "string", - "description": "\"Clear All\" button text", - "default": "Clear All" - } - } - }, - "dnd": { - "type": "object", - "description": "Control Center Do Not Disturb Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Do Not Disturb" - } - } - }, - "label": { - "type": "object", - "description": "A generic widget that allows the user to add custom text", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The text content of the widget", - "default": "Label Text" - }, - "max-lines": { - "type": "integer", - "description": "The maximum lines", - "default": 5 - } - } - }, - "mpris": { - "type": "object", - "description": "A widget that displays multiple music players", - "additionalProperties": false, - "properties": { - "image-size": { - "type": "integer", - "description": "The size of the album art", - "default": 96 - }, - "image-radius": { - "type": "integer", - "description": "The border radius of the album art. Will be overriden by setting the border-radius in the style.css for the \".widget-mpris-album-art\" class", - - "default": 12 - }, - "blur": { - "type": "bool", - "description": "Appy the artwork as the MPRIS background and blur it", - "default": true - } - } - }, - "buttons-grid": { - "type": "object", - "description": "A widget to add a grid of buttons that execute shell commands", - "additionalProperties": false, - "properties": { - "actions": { - "type": "array", - "description": "A list of actions containing a label and a command", - "items": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Text to be displayed in button", - "default": "label" - }, - "command": { - "type": "string", - "description": "Command to be executed on click", - "default": "" - }, - "type": { - "type": "string", - "description": "Type of the button; toggle buttons receive the .active css class and an env variable 'SWAYNC_TOGGLE_STATE' is set. See example in the default config.json", - "default": "normal", - "enum": ["normal", "toggle"] - }, - "update-command": { - "type": "string", - "description": "Command to be executed on visibility change of cc to update the active state of the toggle button (should echo true or false)", - "default": "" - }, - "active": { - "type": "bool", - "description": "Wether the toggle button is active as default or not", - "default": false - } - } - } - } - } - }, - "menubar": { - "type": "object", - "description": "A bar that contains action-buttons and buttons to open a dropdown with action-buttons", - "additionalProperties": false, - "patternProperties": { - "^menu(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "type": "object", - "description": "A button that opens a dropdown with action-buttons", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text to be displayed in button", - "default": "Menu" - }, - "position": { - "type": "string", - "description": "Horizontal position of the button in the bar", - "default": "right", - "enum": ["right", "left"] - }, - "animation-type": { - "type": "string", - "default": "slide_down", - "description": "Animation type for menu", - "enum": ["slide_down", "slide_up", "none"] - }, - "animation-duration":{ - "type": "integer", - "default": 250, - "description": "Duration of animation in milliseconds" - }, - "actions": { - "$ref" : "#/widgets/buttons-grid/properties/actions" - } - } - }, - "^buttons(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "type": "object", - "description": "A list of action-buttons to be displayed in the topbar", - "additionalProperties": false, - "properties": { - "position": { - "type": "string", - "description": "Horizontal position of the button in the bar", - "default": "right", - "enum": ["right", "left"] - }, - "actions": { - "$ref" : "#/widgets/buttons-grid/properties/actions" - } - } - } - } - }, - "volume": { - "type": "object", - "description": "Slider to control pulse volume", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text displayed in front of the volume slider", - "default": "Volume" - }, - "show-per-app": { - "type": "boolean", - "default": false, - "description": "Show per app volume control" - }, - "show-per-app-icon": { - "type": "boolean", - "default": true, - "description": "Show application icon in per app control" - }, - "show-per-app-label": { - "type": "boolean", - "default": false, - "description": "Show application name in per app control" - }, - "empty-list-label": { - "type": "string", - "default": "No active sink input", - "description": "Text displayed when there are not active sink inputs" - }, - "expand-button-label": { - "type": "string", - "default": "⇧", - "description": "Label displayed on button to show per app volume control" - }, - "collapse-button-label": { - "type": "string", - "default": "⇩", - "description": "Label displayed on button to hide per app volume control" - }, - "icon-size": { - "type": "integer", - "default": 24, - "description": "Size of the application icon in per app volume control" - }, - "animation-type": { - "type": "string", - "default": "slide_down", - "description": "Animation type for menu", - "enum": ["slide_down", "slide_up", "none"] - }, - "animation-duration":{ - "type": "integer", - "default": 250, - "description": "Duration of animation in milliseconds" - } - } - }, - "backlight": { - "type": "object", - "description": "Slider to control monitor brightness", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text displayed in front of the backlight slider", - "default": "Brightness" - }, - "device": { - "type": "string", - "description": "Name of monitor (find possible devices using `ls /sys/class/backlight` or `ls /sys/class/leds`)", - "default": "intel_backlight" - }, - "subsystem": { - "type": "string", - "description": "Kernel subsystem for brightness control", - "default": "backlight", - "enum": ["backlight", "leds"] - }, - "min": { - "type": "integer", - "default": 0, - "description": "Lowest possible value for brightness" - } - } - }, - "inhibitors": { - "type": "object", - "description": "Control Center Inhibitors Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Inhibitors" - }, - "clear-all-button": { - "type": "boolean", - "description": "Wether to display a \"Clear All\" button", - "default": true - }, - "button-text": { - "type": "string", - "description": "\"Clear All\" button text", - "default": "Clear All" - } - } - } - } -} diff --git a/swaync/style.css b/swaync/style.css deleted file mode 100644 index 8be7b06..0000000 --- a/swaync/style.css +++ /dev/null @@ -1,479 +0,0 @@ -@define-color cc-bg rgba(20, 20, 20, 0.7); -@define-color noti-border-color rgba(255, 255, 255, 0.15); -@define-color noti-bg rgba(50, 50, 50, 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); -@import url("/home/tola/.cache/wal/colors-waybar.css") - -.testing { - background-color: red; -} - -.control-center { - background: alpha(@background, 0.6); - border-radius: 24px; - border: 0px solid @foreground; - margin: 2px; - padding: 4px; -} - -.control-center-list { - background: transparent; -} - -.control-center-list-placeholder { - opacity: 0.8; -} - -/* Window behind control center and on all other monitors */ -.blank-window { - background: transparent; -} - -/*** Widgets ***/ - -/* Title widget */ -.widget-title { - margin: 8px; - font-size: 1.5rem; - background: alpha(@color0,0.0); -} -.widget-title > button { - font-size: initial; - color:@color7; - text-shadow: none; - background: alpha(@background,0.0); - border: 1px solid alpha(@color7,0.5); - box-shadow: none; - border-radius: 12px; -} -.widget-title > button:hover { - background: @color1; -} - -.widget-label { - background: @color0; - padding: 20px; - padding-bottom: 50px; - border-radius: 20px; -} - -/* DND widget */ -.widget-dnd { - background-color: @color; -} -.widget-dnd > switch { - font-size: initial; - border-radius: 14px; - background: @noti-bg; - border: 2px solid @noti-border-color; - box-shadow: none; -} -.widget-dnd > switch:checked { - background: @color5; -} -.widget-dnd > switch slider { - background: @noti-bg-hover; - border-radius: 12px; -} - -/* Label widget */ -.widget-label { - margin: 8px; -} -.widget-label > label { - font-size: 1.1rem; -} - -/* Mpris widget */ -.widget-mpris { - font-family: "JetBrains Mono Nerd Font"; - /* The parent to all players */ - border: 0px; -} -.widget-mpris-player { - padding: 14px; - margin: 14px; - background-color: @mpris-album-art-overlay; - border-radius: 20px; -} -.widget-mpris-album-art { - border-radius: 12px; -} -.widget-mpris-player button:hover { - /* The media player buttons (play, pause, next, etc...) */ - background: @noti-bg-hover; -} -.widget-mpris > box > button { - /* Change player side buttons */ -} -.widget-mpris > box > button:disabled { - /* Change player side buttons insensitive */ -} -.widget-mpris-title { - font-family: "JetBrains Mono Nerd Font"; - font-weight: bold; - font-size: 1.25rem; -} -.widget-mpris-subtitle { - font-family: "JetBrains Mono Nerd Font"; - font-size: 1.1rem; -} - -/* Buttons widget */ -.widget-buttons-grid { - font-size: 15px; - background: alpha(@background, 0.9); - font-family: "JetBrains Mono Nerd Font"; - padding-left: 5px; - margin-left: 10px; - margin-right: 10px; - border-radius: 20px; - padding-top: 10px; - padding-bottom: 10px; - background-color: alpha(@background, 0.9); -} - -.widget-buttons-grid > flowbox > flowboxchild > button { - padding: 10px; - background: @color1; - color:@color7; - border-radius: 20px; - margin: 2px; - border: 0px solid #04030a; -} - -.widget-buttons-grid > flowbox > flowboxchild > button:hover { - background: @color4; - transition: all 0.3s ease-in-out; -} - -/* Menubar widget */ -.widget-menubar > box > .menu-button-bar > button { - border: none; - background: transparent; - background: red; -} - -.topbar-buttons > button { - /* Name defined in config after # */ - border: none; - background: transparent; - background: rgba(69, 133, 136, 1); -} - -/* Volume widget */ -trough { - border-radius: 20px; - background: @background; - border: 1px solid @background; -} - -trough highlight { - /* ´trough´ is the background of the slider, ´highlight´ is the actual slider */ - padding-top: 1px; - background: @color4; - border: 1px solid @color4; - border-radius: 20px; -} - -trough slider { - padding: 1px; - background: @color4; - border: 1px solid @color4; -} -trough slider:hover { - padding: 1px; - background: @color4; -} - -.widget-volume { - background-color: alpha(@background, 0.0); - border-radius: 20px 20px 0px 0px; - font-size: 15px; - margin-left: 10px; - margin-right: 10px; - padding-bottom: 5px; - border: 0px solid transparent; -} - -.widget-backlight { - padding-left: 5px; - background-color: alpha(@background, 0.0); - font-size: 15px; - margin-top: -8px; - margin-left: 10px; - margin-right: 10px; - border-radius: 0px 0px 20px 20px; - border: 0px solid transparent; -} - -/* Title widget */ -.widget-inhibitors { - margin: 8px; - font-size: 1.5rem; -} -.widget-inhibitors > button { - font-size: initial; - color: white; - text-shadow: none; - background: @noti-bg; - border: 1px solid @noti-border-color; - box-shadow: none; - border-radius: 12px; -} -.widget-inhibitors > button:hover { - background: @noti-bg-hover; -} -.notification-row { - outline: none; -} - -.notification-row:focus, -.notification-row:hover { - background: alpha(@color14, 0.5); /* @noti-bg-focus */ -} - -.notification-row .notification-background { - padding: 6px 12px; -} - -.notification-row .notification-background .close-button { - /* The notification Close Button */ - background: alpha(@color4, 0.5); /* @noti-close-bg */ - color: alpha(@color15, 1.0); /* @text-color */ - text-shadow: none; - padding: 0; - border-radius: 100%; - margin-top: 5px; - margin-right: 5px; - box-shadow: none; - border: none; - min-width: 24px; - min-height: 24px; -} - -.notification-row .notification-background .close-button:hover { - background: alpha(@color12, 0.5); /* @noti-close-bg-hover */ - transition: background 0.15s ease-in-out; -} - -.notification-row .notification-background .notification { - /* The actual notification */ - border-radius: 12px; - border: 2px solid alpha(@color8, 0.5); /* @border */ - padding: 0; - transition: background 0.15s ease-in-out; - background: alpha(@color0, 0.5); /* @noti-bg */ -} - -.notification-row .notification-background .notification.low { - /* Low Priority Notification */ -} - -.notification-row .notification-background .notification.normal { - /* Normal Priority Notification */ -} - -.notification-row .notification-background .notification.critical { - /* Critical Priority Notification */ -} - -.notification-row .notification-background .notification .notification-action, -.notification-row .notification-background .notification .notification-default-action { - padding: 4px; - margin: 0; - box-shadow: none; - background: transparent; - border: none; - color: alpha(@color15, 1.0); /* @text-color */ - transition: background 0.15s ease-in-out; -} - -.notification-row .notification-background .notification .notification-action:hover, -.notification-row .notification-background .notification .notification-default-action:hover { - background: alpha(@color13, 0.5); /* @noti-bg-hover */ -} - -.notification-row .notification-background .notification .notification-default-action { - /* The large action that also displays the notification summary and body */ - border-radius: 12px; -} - -.notification-row .notification-background .notification .notification-default-action:not(:only-child) { - /* When alternative actions are visible */ - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content { - background: transparent; - border-radius: 12px; - padding: 4px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .image { - /* Notification Primary Image */ - border-radius: 100px; - /* Size in px */ - margin: 4px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .app-icon { - /* Notification app icon (only visible when the primary image is set) */ - -gtk-icon-shadow: 0 1px 4px black; - margin: 6px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .text-box .summary { - /* Notification summary/title */ - font-size: 16px; - font-weight: bold; - background: transparent; - color: alpha(@color15, 1.0); /* @text-color */ - text-shadow: none; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .text-box .time { - /* Notification time-ago */ - font-size: 16px; - font-weight: bold; - background: transparent; - color: alpha(@color15, 1.0); /* @text-color */ - text-shadow: none; - margin-right: 30px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body { - /* Notification body */ - font-size: 15px; - font-weight: normal; - background: transparent; - color: alpha(@color15, 1.0); /* @text-color */ - text-shadow: none; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content progressbar { - /* The optional notification progress bar */ - margin-top: 4px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .body-image { - /* The "extra" optional bottom notification image */ - margin-top: 4px; - background-color: alpha(@color15, 0.5); - border-radius: 12px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply { - /* The inline reply section */ - margin-top: 4px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-entry { - background: alpha(@color1, 0.5); /* @noti-bg-darker */ - color: alpha(@color15, 1.0); /* @text-color */ - caret-color: alpha(@color15, 1.0); /* @text-color */ - border: 1px solid alpha(@color8, 0.5); /* @border */ - border-radius: 12px; -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button { - margin-left: 4px; - background: alpha(@color0, 0.5); /* @noti-bg */ - border: 1px solid alpha(@color8, 0.5); /* @border */ - border-radius: 12px; - color: alpha(@color15, 1.0); /* @text-color */ -} - -.notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button:disabled { - background: initial; - color: alpha(@color7, 0.5); /* @text-color-disabled */ - border: 1px solid alpha(@color8, 0.5); /* @border */ - border-color: transparent; -} - -.notification-row .notification-background .notification .notification-default-action .inline-reply .inline-reply-button:hover { - background: alpha(@color13, 0.5); /* @noti-bg-hover */ -} - -.notification-row .notification-background .notification .notification-action { - /* The alternative actions below the default action */ - border-top: 1px solid alpha(@color8, 0.5); /* @border */ - border-radius: 0px; - border-right: 1px solid alpha(@color8, 0.5); /* @border */ -} - -.notification-row .notification-background .notification .notification-action:first-child { - /* Add bottom border radius to eliminate clipping */ - border-bottom-left-radius: 12px; -} - -.notification-row .notification-background .notification .notification-action:last-child { - border-bottom-right-radius: 12px; - border-right: none; -} - -.notification-group { - /* Styling only for Grouped Notifications */ -} - -.notification-group.low { - /* Low Priority Group */ -} - -.notification-group.normal { - /* Normal Priority Group */ -} - -.notification-group.critical { - /* Critical Priority Group */ -} - -.notification-group .notification-group-buttons, -.notification-group .notification-group-headers { - margin: 0 16px; - color: alpha(@color15, 1.0); /* @text-color */ -} - -.notification-group .notification-group-headers { - /* Notification Group Headers */ -} - -.notification-group .notification-group-headers .notification-group-icon { - color: alpha(@color15, 1.0); /* @text-color */ -} - -.notification-group .notification-group-headers .notification-group-header { - color: alpha(@color15, 1.0); /* @text-color */ -} - -.notification-group .notification-group-buttons { - /* Notification Group Buttons */ -} - -.notification-group.collapsed .notification-row .notification { - background-color: alpha(@color0, 0.5); /* @noti-bg-opaque */ -} - -.notification-group.collapsed .notification-row:not(:last-child) { - /* Top notification in stack */ - /* Set lower stacked notifications opacity to 0 */ -} - -.notification-group.collapsed .notification-row:not(:last-child) .notification-action, -.notification-group.collapsed .notification-row:not(:last-child) .notification-default-action { - opacity: 0; -} - -.notification-group.collapsed:hover .notification-row:not(:only-child) .notification { - background-color: alpha(@color13, 0.5); /* @noti-bg-hover-opaque */ -} \ No newline at end of file diff --git a/uxplay/install_uxplay.sh b/uxplay/install_uxplay.sh deleted file mode 100755 index 310ea83..0000000 --- a/uxplay/install_uxplay.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo pacman -S avahi -paru -S uxplay # uxplay-git diff --git a/uxplay/runuxplay.sh b/uxplay/runuxplay.sh deleted file mode 100755 index 8dec92e..0000000 --- a/uxplay/runuxplay.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo systemctl restart avahi-daemon -uxplay diff --git a/vimrc b/vimrc deleted file mode 100644 index 765be0f..0000000 --- a/vimrc +++ /dev/null @@ -1,76 +0,0 @@ -set number -syntax on -set expandtab -set smarttab -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set foldcolumn=2 -set mouse=a -set encoding=utf8 -set guifont=JetBrains\ Mono\ Nerd\ Font\ 11 -"----- color scheme --- -colorscheme tokyonight -"---------------------- -"-------- colorcolumn ------------------ -set colorcolumn=110 -highlight ColorColumn ctermbg=darkgray -"--------------------------------------- - -"-------------------- plugins ------------------------ -call plug#begin() - Plug 'preservim/nerdtree' - Plug 'ryanoasis/vim-devicons' - Plug 'ap/vim-css-color' - Plug 'leshill/vim-json' - Plug 'tiagofumo/vim-nerdtree-syntax-highlight' - Plug 'kassio/neoterm' - Plug 'othree/html5-syntax.vim' - Plug 'tomasr/molokai' - Plug 'wolf-dog/nighted.vim' - Plug 'ale-cci/aqua-vim' - Plug 'ghifarit53/tokyonight-vim' - Plug 'Eliot00/git-lens.vim' - Plug 'pangloss/vim-javascript' - Plug 'mxw/vim-jsx' - Plug 'theRealCarneiro/hyprland-vim-syntax' -call plug#end() -"----------------------------------------------------- - -"--------- keybinds ------------------------- -nnoremap :NERDTreeFocus -inoremap :NERDTreeFocus -nnoremap :NERDTree -nnoremap :NERDTreeToggle -inoremap :NERDTreeToggle -nnoremap :NERDTreeRefresh -inoremap :NERDTreeRefresh -"------------ tabs ----------------------- -nnoremap :tabprevious -nnoremap :tabnext -nnoremap :tabnew -inoremap :tabpreviousi -inoremap :tabnexti -inoremap :tabnew -nnoremap :tabclose -inoremap :tabclose -"----------------------------------------- -"----------------- term -------- -nnoremap :term -inoremap :term -"------------------------------- -"------------- gitlens ----------------------- -nnoremap :call ToggleGitLens() -inoremap :call ToggleGitLens() -"--------------------------------------------- -nnoremap :w -inoremap :w -nnoremap :q -inoremap :q -"------------- vim-plug -------------- -nnoremap :PlugInstall -inoremap :PlugInstall -"------------------------------------- -nnoremap :so% -inoremap :so% -"-------------------------------------------- diff --git a/waybar/._config b/waybar/._config deleted file mode 100644 index ab3a5c7..0000000 Binary files a/waybar/._config and /dev/null differ diff --git a/waybar/._style.css b/waybar/._style.css deleted file mode 100644 index ccfce5f..0000000 Binary files a/waybar/._style.css and /dev/null differ diff --git a/waybar/config b/waybar/config deleted file mode 100644 index 3f19fbb..0000000 --- a/waybar/config +++ /dev/null @@ -1,252 +0,0 @@ -{ - "layer": "top", - "height": 30, - "margin-top": 2, - "margin-left": 5, - "margin-right": 5, - "margin-bottom": 0, - "spacing": 4, - "modules-left": ["custom/launcher", "cpu", "memory", "temperature", "disk", "custom/weather", "custom/updates", "custom/onscreenkeyboard", "hyprland/window"], - "modules-center": ["hyprland/workspaces"], - "modules-right": ["pulseaudio", "mpris", "network", "backlight", "keyboard-state", "hyprland/language", "battery", "battery#bat2", "clock", "tray", "custom/power"], - "hyprland/workspaces": { - "format": "{icon}", - // "format-icons": { - // "1": "", - // "2": "", - // "3": "", - // "4": "", - // "default": "", // "", - // "focused": "", - // "urgent": "" - // }, - // "icon-size": 20, - "all-outputs": true, - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1" - }, - "hyprland/window": { - "format": "{}", - "icon": true, - "icon-size" : 20 - }, - "keyboard-state": { - "numlock": true, - "capslock": true, - "format": "{name} {icon}", - "format-icons": { - "locked": "", - "unlocked": "" - } - }, - "hyprland/language": { - "format": "{}", - "format-en": "US", - "format-ru": "RU", - "on-click": "swaync-client -t" - }, - "tray": { - "spacing": 10 - }, - "clock": { - "timezone": "Asia/Tomsk", - "tooltip-format": "{:%Y %B}\n{calendar}", - "format-alt": "{:%Y-%m-%d}" - }, - "cpu": { - "format": "{usage}% ", - "tooltip": false - }, - "memory": { - "format": "{}% " - }, - "temperature": { - "critical-threshold": 80, - "format": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""] - }, - "backlight": { - "format": "{percent}% {icon}", - "format-icons": ["", "", "", "", "", "", "", "", ""] - }, - "battery": { - "states": { - "warning": 30, - "critical": 15 - }, - "format": "{capacity}% {icon}", - "format-charging": "{capacity}% ", - "format-plugged": "{capacity}% ", - "format-alt": "{time} {icon}", - "format-icons": ["", "", "", "", ""] - }, - "battery#bat2": { - "bat": "BAT2" - }, - "network": { - "format-wifi": "{essid} ({signalStrength}%) 󰤨", - "format-ethernet": "", //"{ipaddr}/{cidr} ", - "tooltip-format": "{ifname} via {gwaddr} ", - "format-linked": "{ifname} (No IP) ", - "format-disconnected": "Disconnected ⚠", - "format-alt": "{ifname}: {ipaddr}/{cidr}" - }, - "pulseaudio/slider": { - "min": 0, - "max": 100, - "orientation": "horizontal" - }, - "pulseaudio": { - "format": "{volume}% {icon} {format_source}", - "format-bluetooth": "{volume}% {icon} {format_source}", - "format-bluetooth-muted": " {icon} {format_source}", - "format-muted": " {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": [" ", " ", " "] - }, - "on-click": "pavucontrol" - }, - "custom/power": { - "format": "⏻", - "on-click": "~/dotfiles/rofi/powermenu/powermenu.sh" - }, - "custom/launcher": { - "format": "", - "on-click": "~/dotfiles/rofi/launcher/launcher.sh" - }, - "disk": { - "interval": 30, - "format": " {used}/{free}", - "unit": "GB" - }, - "custom/spotify": { - "format": "{} ", - "exec": "~/.config/waybar/scripts/spotify.sh", - "return-type": "json", - "on-click": "playerctl -p spotify play-pause", - "on-scroll-up": "playerctl -p spotify next", - "on-scroll-down": "playerctl -p spotify previous", - "exec-if": "pgrep spotfiy" - }, - //"custom/weather": { - // "interval": 900, - // "return-type": "json", - // "exec": "waybar_weather_display --latitude 56.4884 --longitude 84.9480", - // "format-alt": "{} ", - // "format": "{alt} ", - // "format-alt-click": "click-right", - // "escape": true - //}, - "custom/weather": { - "format": "{}", - "tooltip": true, - "interval": 900, - "exec": "wttrbar --location tomsk", - "return-type": "json", - "on-click": "~/dotfiles/hypr/bin/toggle_weather_ags" - }, - "custom/pacman": { - "format": "{} ", - "interval": 3600, // every hour - "exec": "checkupdates | wc -l", // # of updates - "exec-if": "exit 0", // always run; consider advanced run conditions - "on-click": "echo click", // update system - "signal": 8 - }, - "custom/updates": { - "format": "{} {icon}", - "return-type": "json", - "format-icons": { - "has-updates": "󱍷", - "updated": "󰂪" - }, - "on-click": "~/dotfiles/hypr/bin/startupdate.sh", - "exec-if": "which waybar-module-pacman-updates", - "exec": "waybar-module-pacman-updates --interval-seconds 5 --network-interval-seconds 300" - }, - "custom/onscreenkeyboard": { - "format": " ", - "on-click": "~/dotfiles/hypr/bin/toggle_keyboard.sh" - }, - "bluetooth": { - "format": " {status}", - "format-no-controller": "", - "format-disabled": "", - "format-connected": " {device_alias}", - "format-connected-battery": " {device_alias} {device_battery_percentage}%", - "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", - "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", - "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", - "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%" - }, - "privacy": { - "icon-spacing": 4, - "icon-size": 18, - "transition-duration": 250, - "modules": [ - { - "type": "screenshare", - "tooltip": true, - "tooltip-icon-size": 24 - }, - { - "type": "audio-out", - "tooltip": true, - "tooltip-icon-size": 24 - }, - { - "type": "audio-in", - "tooltip": true, - "tooltip-icon-size": 24 - } - ] - }, - "cava": { -// "cava_config": "$XDG_CONFIG_HOME/cava/cava.conf", - "framerate": 30, - "autosens": 1, - "sensitivity": 100, - "bars": 14, - "lower_cutoff_freq": 50, - "higher_cutoff_freq": 10000, - "method": "pulse", - "source": "auto", - "stereo": true, - "reverse": false, - "bar_delimiter": 0, - "monstercat": false, - "waves": false, - "noise_reduction": 0.77, - "input_delay": 2, - "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], - "actions": { - "on-click-right": "mode" - } - }, - "mpris": { - "format": "{player_icon} {status_icon}", - "format-paused": "{player_icon} {status_icon}", - "player-icons": { - //"default": "▶", - "mpv": "🎵", - "chromium": "", - "firefox": "", - "TelegramDesktop": "" - }, - "status-icons": { - "playing": "", - "paused": "" - }, - "on-click-right": "~/dotfiles/ags/media/toggle_media", - // "ignored-players": ["firefox"] - } -} - diff --git a/waybar/scripts/get-weather.sh b/waybar/scripts/get-weather.sh deleted file mode 100755 index debf2e4..0000000 --- a/waybar/scripts/get-weather.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -for i in {1..5} -do - text=$(curl -s "https://wttr.in/$1?format=1") - if [[ $? == 0 ]] - then - text=$(echo "$text" | sed -E "s/\s+/ /g") - tooltip=$(curl -s "https://wttr.in/$1?format=4") - if [[ $? == 0 ]] - then - tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g") - echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}" - exit - fi - fi - sleep 2 -done -echo "{\"text\":\"error\", \"tooltip\":\"error\"}" diff --git a/waybar/scripts/spotify.sh b/waybar/scripts/spotify.sh deleted file mode 100755 index c6b1731..0000000 --- a/waybar/scripts/spotify.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -while true -do - player_status=$(playerctl -p spotify status 2> /dev/null) - - if [ "$player_status" = "Playing" ]; then - artist=$(playerctl -p spotify metadata artist) - title=$(playerctl -p spotify metadata title) - echo '{"text": "'"$artist - $title"'", "class": "custom-spotify", "alt": "Spotify"}' - elif [ "$player_status" = "Paused" ]; then - artist=$(playerctl -p spotify metadata artist) - title=$(playerctl -p spotify metadata title) - echo '{"text": "'"Paused"'", "class": "custom-spotify", "alt": "Spotify (Paused)"}' - fi - sleep 1 -done \ No newline at end of file diff --git a/waybar/scripts/waybar-wttr.py b/waybar/scripts/waybar-wttr.py deleted file mode 100755 index 978a404..0000000 --- a/waybar/scripts/waybar-wttr.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python - -import json -import requests -from datetime import datetime - -WEATHER_CODES = { - '113': '☀️', - '116': '⛅️', - '119': '☁️', - '122': '☁️', - '143': '🌫', - '176': '🌦', - '179': '🌧', - '182': '🌧', - '185': '🌧', - '200': '⛈', - '227': '🌨', - '230': '❄️', - '248': '🌫', - '260': '🌫', - '263': '🌦', - '266': '🌦', - '281': '🌧', - '284': '🌧', - '293': '🌦', - '296': '🌦', - '299': '🌧', - '302': '🌧', - '305': '🌧', - '308': '🌧', - '311': '🌧', - '314': '🌧', - '317': '🌧', - '320': '🌨', - '323': '🌨', - '326': '🌨', - '329': '❄️', - '332': '❄️', - '335': '❄️', - '338': '❄️', - '350': '🌧', - '353': '🌦', - '356': '🌧', - '359': '🌧', - '362': '🌧', - '365': '🌧', - '368': '🌨', - '371': '❄️', - '374': '🌧', - '377': '🌧', - '386': '⛈', - '389': '🌩', - '392': '⛈', - '395': '❄️' -} - -data = {} - - -weather = requests.get("https://wttr.in/Tomsk+Russia?format=j1").json() - - -def format_time(time): - return time.replace("00", "").zfill(2) - - -def format_temp(temp): - return (hour['FeelsLikeC']+"°").ljust(3) - - -def format_chances(hour): - chances = { - "chanceoffog": "Fog", - "chanceoffrost": "Frost", - "chanceofovercast": "Overcast", - "chanceofrain": "Rain", - "chanceofsnow": "Snow", - "chanceofsunshine": "Sunshine", - "chanceofthunder": "Thunder", - "chanceofwindy": "Wind" - } - - conditions = [] - for event in chances.keys(): - if int(hour[event]) > 0: - conditions.append(chances[event]+" "+hour[event]+"%") - return ", ".join(conditions) - - -data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \ - " "+weather['current_condition'][0]['FeelsLikeC']+"°" - -data['tooltip'] = f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°\n" -data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n" -data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n" -data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n" -for i, day in enumerate(weather['weather']): - data['tooltip'] += f"\n" - if i == 0: - data['tooltip'] += "Today, " - if i == 1: - data['tooltip'] += "Tomorrow, " - data['tooltip'] += f"{day['date']}\n" - data['tooltip'] += f"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° " - data['tooltip'] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n" - for hour in day['hourly']: - if i == 0: - if int(format_time(hour['time'])) < datetime.now().hour-2: - continue - data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" - - -print(json.dumps(data)) diff --git a/waybar/style.css b/waybar/style.css deleted file mode 100644 index 40c562d..0000000 --- a/waybar/style.css +++ /dev/null @@ -1,383 +0,0 @@ -* { - /* `otf-font-awesome` is required to be installed for icons */ - font-family: JetBrainsMono Nerd font, FontAwesome, Roboto, Helvetica, Arial, sans-serif; - font-size: 13px; - border-radius: 10px; -} - -window#waybar { - background-color: #000000; - opacity: 0.7; - color: #ffffff; - transition-property: background-color; - transition-duration: .5s; - padding: 2px; -} - -window#waybar.hidden { - opacity: 0.2; -} - -window#waybar.termite { - background-color: #3F3F3F; -} - -window#waybar.chromium { - background-color: #000000; - border: none; -} - -button { - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each button name */ - border: none; - border-radius: 5px; -} - -#workspaces { - background-color: gray; - border-radius: 25px; - transition: 0.3s; -} - -#workspaces button { - padding: 0 15px; -/* background-color: transparent;*/ - color: #ffffff; - margin: 2px 2px; - border-radius: 25px; - transition: 0.3s; -} - -#workspaces button label { - /* font-size: 20px; */ -} - -#workspaces button:hover { - color: white; -} - -#workspaces button.focused { - background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; -} - -#workspaces button.urgent { - background-color: #eb4d4b; -} - -#workspaces button.active { - background-color: white; - color: black; - padding: 0 15px; -} - -#workspaces button.active:hover { - color: white; -} - -#mode { - background-color: #64727D; - border-bottom: 3px solid #ffffff; -} - -#clock, -#battery, -#cpu, -#memory, -#disk, -#temperature, -#backlight, -#network, -#pulseaudio, -#wireplumber, -#custom-media, -#tray, -#mode, -#idle_inhibitor, -#scratchpad, -#custom-power, -#custom-launcher, -#mpd, -#language, -#keyboard-state, -#custom-updatees, -#custom-weather -{ - padding: 0 10px; - color: #ffffff; - /*background-color: #64727D;*/ - border-radius: 25px; -} - -#window { - margin: 0 4px; - /*background-color: #64727D;*/ - border-radius: 25px; - padding: 0 10px; -} - -/* If workspaces is the leftmost module, omit left margin */ -.modules-left > widget:first-child > #workspaces { - margin-left: 4px; -} - -/* If workspaces is the rightmost module, omit right margin */ -.modules-right > widget:last-child > #workspaces { - margin-right: 4px; -} - -#clock { -/* background-color: #64727D;*/ -} - -#battery { -/* background-color: #ffffff;*/ - color: #ffffff; -} - -#battery.charging, #battery.plugged { - color: #ffffff; -/* background-color: #26A65B;*/ -} - -@keyframes blink { - to { -/* background-color: #ffffff;*/ - color: #ffffff; - } -} - -#battery.critical:not(.charging) { -/* background-color: #f53c3c;*/ - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} - -label:focus { -/* background-color: #000000;*/ -} - -#cpu { -/* background-color: #2ecc71;*/ - color: #ffffff; -} - -#memory { -/* background-color: #9b59b6;*/ -} - -#disk { -/* background-color: #964B00;*/ -} - -#backlight { -/* background-color: #90b1b1;*/ -} - -#network { -/* background-color: #2980b9;*/ -} - -#network.disconnected { -/* background-color: #f53c3c;*/ -} - -#pulseaudio { - color: #ffffff; -} - -#pulseaudio.muted { -/* background-color: #90b1b1;*/ - color: #2a5c45; -} - -#wireplumber { -/* background-color: #fff0f5;*/ - color: #000000; -} - -#wireplumber.muted { -/* background-color: #f53c3c;*/ -} - -#custom-media { -/* background-color: #66cc99;*/ - color: #2a5c45; - min-width: 100px; -} - -#custom-media.custom-spotify { -/* background-color: #66cc99;*/ -} - -#custom-media.custom-vlc { -/* background-color: #ffa000;*/ -} - -#temperature { -/* background-color: #f0932b;*/ -} - -#temperature.critical { -/* background-color: #eb4d4b;*/ -} - -#tray { -/* background-color: #2980b9;*/ -} - -#tray > .passive { - -gtk-icon-effect: dim; -} - -#tray > .needs-attention { - -gtk-icon-effect: highlight; -/* background-color: #eb4d4b;*/ -} - -#idle_inhibitor { -/* background-color: #2d3436;*/ -} - -#idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; -} - -#mpd { -/* background-color: #66cc99;*/ - color: #2a5c45; -} - -#mpd.disconnected { -/* background-color: #f53c3c;*/ -} - -#mpd.stopped { -/* background-color: #90b1b1;*/ -} - -#mpd.paused { -/* background-color: #51a37a;*/ -} - -#language { -/* background: #00b093;*/ - color: #ffffff; - padding: 0 5px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state { -/* background: #97e1ad;*/ - color: #ffffff; - padding: 0 0px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state > label { - padding: 0 5px; -} - -#keyboard-state > label.locked { -/* background: rgba(0, 0, 0, 0.2);*/ -} - -#scratchpad { -/* background: rgba(0, 0, 0, 0.2);*/ -} - -#scratchpad.empty { - background-color: transparent; -} - -#privacy { - padding: 0; -} - -#privacy-item { - padding: 0 5px; - color: white; -} - -#privacy-item.screenshare { - background-color: #cf5700; -} - -#privacy-item.audio-in { - background-color: #1ca000; -} - -#privacy-item.audio-out { -/* background-color: #0069d4;*/ -} - -#custom-power { -/* background-color: #f0932b;*/ - margin: 0 2px; -} - -/*#custom-power:hover { - background: blue; -}*/ - -#custom-launcher { -/* background-color: #f0932b;*/ - padding: 0 15px 0 10px; - margin: 0 2px; -} - -.custom-spotify { - padding: 2px 12px; - margin: 0 1px; - background-color: black; -} - -#custom-updates { - padding: 10px 12px; -} - -#pulseaudio-slider slider { - min-height: 2px; - min-width: 2px; - background-color: white; - border-radius: 100%; - background-image: none; -} -#pulseaudio-slider trough { - min-height: 2px; - min-width: 60px; - border-radius: 5px; - background-color: gray; -} -#pulseaudio-slider highlight { - min-width: 10px; - border-radius: 5px; - background-color: gray; -} - -#privacy { - background-color: red; -} - -#privacy-item { - min-width: 100px; - min-height: 100px; -} - -#mpris { - padding: 10px 12px; -} - -#custom-onscreenkeyboard { - padding: 10px 12px; -} -