my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux

style: formating

+7621 -7840
+5 -27
.editorconfig
··· 3 3 [*] 4 4 charset = utf-8 5 5 end_of_line = lf 6 - indent_style = tab 7 - indent_size = 4 8 - insert_final_newline = true 9 - tab_width = 4 10 - trim_trailing_whitespace = false 11 - 12 - [*.md] 13 6 indent_style = space 14 7 indent_size = 2 8 + insert_final_newline = true 9 + tab_width = 4 15 10 trim_trailing_whitespace = false 16 11 17 - [*.{nix,yml,yaml}] 18 - indent_style = space 19 - indent_size = 2 20 - tab_width = 2 21 - 22 - [*.yuck] 23 - indent_style = spaces 24 - indent_size = 4 25 - 26 - [*.{js, sh}] 27 - indent_style = spaces 28 - indent_size = 2 29 - 30 - [*.{diff,patch}] 12 + [*.{diff,patch,lock}] 13 + indent_size = unset 14 + indent_size = unset 31 15 end_of_line = unset 32 16 insert_final_newline = unset 33 17 trim_trailing_whitespace = unset 34 - 35 - [secrets.yaml] 36 - indent_size = unset 37 - 38 - [*.lock] 39 - indent_size = unset
+17 -17
flake/templates/node/package.json
··· 1 1 { 2 - "name": "sample-nodejs", 3 - "version": "0.0.1", 4 - "description": "Sample node program", 5 - "bin": { 6 - "sample-node": "build/index.js" 7 - }, 8 - "scripts": { 9 - "build": "tsc", 10 - "start": "npm run build && node build/index.js" 11 - }, 12 - "author": "NotAShelf", 13 - "license": "MIT", 14 - "devDependencies": { 15 - "@types/node": "^20.1.2", 16 - "typescript": "^5.0.4", 17 - "typescript-language-server": "^3.3.2" 18 - } 2 + "name": "sample-nodejs", 3 + "version": "0.0.1", 4 + "description": "Sample node program", 5 + "bin": { 6 + "sample-node": "build/index.js" 7 + }, 8 + "scripts": { 9 + "build": "tsc", 10 + "start": "npm run build && node build/index.js" 11 + }, 12 + "author": "NotAShelf", 13 + "license": "MIT", 14 + "devDependencies": { 15 + "@types/node": "^20.1.2", 16 + "typescript": "^5.0.4", 17 + "typescript-language-server": "^3.3.2" 18 + } 19 19 }
+14 -14
flake/templates/node/tsconfig.json
··· 1 1 { 2 - "compilerOptions": { 3 - "target": "es2016", 4 - "lib": ["es6"], 5 - "module": "commonjs", 6 - "rootDir": "src", 7 - "resolveJsonModule": true, 8 - "allowJs": true, 9 - "outDir": "build", 10 - "esModuleInterop": true, 11 - "forceConsistentCasingInFileNames": true, 12 - "strict": true, 13 - "noImplicitAny": true, 14 - "skipLibCheck": true 15 - } 2 + "compilerOptions": { 3 + "target": "es2016", 4 + "lib": ["es6"], 5 + "module": "commonjs", 6 + "rootDir": "src", 7 + "resolveJsonModule": true, 8 + "allowJs": true, 9 + "outDir": "build", 10 + "esModuleInterop": true, 11 + "forceConsistentCasingInFileNames": true, 12 + "strict": true, 13 + "noImplicitAny": true, 14 + "skipLibCheck": true 15 + } 16 16 }
+14 -14
home/isabel/programs/configs/editors/vscode/keybindings.json
··· 1 1 [ 2 - { 3 - "key": "ctrl+alt+up", 4 - "command": "-editor.action.copyLinesUpAction", 5 - "when": "editorTextFocus" 6 - }, 7 - { 8 - "key": "ctrl+alt+down", 9 - "command": "-editor.action.copyLinesDownAction", 10 - "when": "editorTextFocus" 11 - }, 12 - { 13 - "key": "ctrl+m", 14 - "command": "-editor.action.toggleTabFocusMode" 15 - } 2 + { 3 + "key": "ctrl+alt+up", 4 + "command": "-editor.action.copyLinesUpAction", 5 + "when": "editorTextFocus" 6 + }, 7 + { 8 + "key": "ctrl+alt+down", 9 + "command": "-editor.action.copyLinesDownAction", 10 + "when": "editorTextFocus" 11 + }, 12 + { 13 + "key": "ctrl+m", 14 + "command": "-editor.action.toggleTabFocusMode" 15 + } 16 16 ]
+48 -48
home/isabel/programs/configs/editors/vscode/settings.json
··· 1 1 { 2 - "security.workspace.trust.untrustedFiles": "open", 3 - "editor.suggestSelection": "first", 4 - "editor.formatOnPaste": true, 5 - "explorer.confirmDragAndDrop": false, 6 - "files.autoSave": "onWindowChange", 7 - "editor.multiCursorModifier": "ctrlCmd", 8 - "git.autofetch": true, 9 - "git.confirmSync": false, 10 - "git.ignoreRebaseWarning": true, 11 - "git.enableSmartCommit": true, 12 - "editor.guides.bracketPairs": true, 13 - "editor.guides.bracketPairsHorizontal": true, 14 - "emmet.triggerExpansionOnTab": true, 15 - "editor.inlineSuggest.enabled": true, 16 - "github.copilot.enable": { 17 - "*": true 18 - }, 19 - "editor.accessibilitySupport": "off", 20 - "editor.fontFamily": "JetBrainsMono Nerd Font Mono", 21 - "terminal.integrated.fontSize": 16, 22 - "editor.linkedEditing": true, 23 - "workbench.startupEditor": "none", 24 - "markdown-preview-enhanced.liveUpdate": true, 25 - "editor.formatOnSave": true, 26 - "explorer.confirmDelete": false, 27 - "workbench.settings.applyToAllProfiles": [], 28 - "workbench.iconTheme": "catppuccin-mocha", 29 - "window.titleBarStyle": "custom", 30 - "nix.enableLanguageServer": true, 31 - "nix.serverPath": "nil", 32 - // using flakes with `formatter = pkgs.alejandra;` 33 - "nix.formatterPath": ["nix", "fmt", "--", "-"], 34 - "nix.serverSettings": { 35 - // settings for 'nil' LSP 36 - "nil": { 37 - "formatting": { 38 - "command": ["alejandra"] 39 - } 40 - } 41 - }, 42 - "workbench.editor.empty.hint": "hidden", 43 - "arduino.useArduinoCli": true, 44 - "arduino.enableUSBDetection": true, 45 - "[css]": { 46 - "editor.defaultFormatter": "stylelint.vscode-stylelint" 47 - }, 48 - "workbench.colorTheme": "Catppuccin Mocha", 49 - "catppuccin.accentColor": "sapphire" 2 + "security.workspace.trust.untrustedFiles": "open", 3 + "editor.suggestSelection": "first", 4 + "editor.formatOnPaste": true, 5 + "explorer.confirmDragAndDrop": false, 6 + "files.autoSave": "onWindowChange", 7 + "editor.multiCursorModifier": "ctrlCmd", 8 + "git.autofetch": true, 9 + "git.confirmSync": false, 10 + "git.ignoreRebaseWarning": true, 11 + "git.enableSmartCommit": true, 12 + "editor.guides.bracketPairs": true, 13 + "editor.guides.bracketPairsHorizontal": true, 14 + "emmet.triggerExpansionOnTab": true, 15 + "editor.inlineSuggest.enabled": true, 16 + "github.copilot.enable": { 17 + "*": true 18 + }, 19 + "editor.accessibilitySupport": "off", 20 + "editor.fontFamily": "JetBrainsMono Nerd Font Mono", 21 + "terminal.integrated.fontSize": 16, 22 + "editor.linkedEditing": true, 23 + "workbench.startupEditor": "none", 24 + "markdown-preview-enhanced.liveUpdate": true, 25 + "editor.formatOnSave": true, 26 + "explorer.confirmDelete": false, 27 + "workbench.settings.applyToAllProfiles": [], 28 + "workbench.iconTheme": "catppuccin-mocha", 29 + "window.titleBarStyle": "custom", 30 + "nix.enableLanguageServer": true, 31 + "nix.serverPath": "nil", 32 + // using flakes with `formatter = pkgs.alejandra;` 33 + "nix.formatterPath": ["nix", "fmt", "--", "-"], 34 + "nix.serverSettings": { 35 + // settings for 'nil' LSP 36 + "nil": { 37 + "formatting": { 38 + "command": ["alejandra"] 39 + } 40 + } 41 + }, 42 + "workbench.editor.empty.hint": "hidden", 43 + "arduino.useArduinoCli": true, 44 + "arduino.enableUSBDetection": true, 45 + "[css]": { 46 + "editor.defaultFormatter": "stylelint.vscode-stylelint" 47 + }, 48 + "workbench.colorTheme": "Catppuccin Mocha", 49 + "catppuccin.accentColor": "sapphire" 50 50 }
+16 -16
home/isabel/programs/configs/gui/bars/ags/config/config.js
··· 14 14 initWallpaper(); 15 15 16 16 const windows = () => [ 17 - forMonitors(TopBar), 18 - // forMonitors(LeftBar), 19 - forMonitors(OSD), 20 - forMonitors(Notifications), 21 - Applauncher(), 22 - Dashboard(), 23 - QuickSettings(), 24 - PowerMenu(), 17 + forMonitors(TopBar), 18 + // forMonitors(LeftBar), 19 + forMonitors(OSD), 20 + forMonitors(Notifications), 21 + Applauncher(), 22 + Dashboard(), 23 + QuickSettings(), 24 + PowerMenu(), 25 25 ]; 26 26 27 27 export default { 28 - onConfigParsed: init, 29 - windows: windows().flat(1), 30 - maxStreamVolume: 1.05, 31 - cacheNotificationActions: true, 32 - closeWindowDelay: { 33 - quicksettings: options.transition.value, 34 - dashboard: options.transition.value, 35 - }, 28 + onConfigParsed: init, 29 + windows: windows().flat(1), 30 + maxStreamVolume: 1.05, 31 + cacheNotificationActions: true, 32 + closeWindowDelay: { 33 + quicksettings: options.transition.value, 34 + dashboard: options.transition.value, 35 + }, 36 36 };
+111 -111
home/isabel/programs/configs/gui/bars/ags/config/icons.js
··· 1 1 export default { 2 - lock: "system-lock-screen-symbolic", 3 - fallback: { 4 - executable: "application-x-executable-symbolic", 2 + lock: "system-lock-screen-symbolic", 3 + fallback: { 4 + executable: "application-x-executable-symbolic", 5 + }, 6 + audio: { 7 + mic: { 8 + muted: "microphone-disabled-symbolic", 9 + low: "microphone-sensitivity-low-symbolic", 10 + medium: "microphone-sensitivity-medium-symbolic", 11 + high: "microphone-sensitivity-high-symbolic", 5 12 }, 6 - audio: { 7 - mic: { 8 - muted: "microphone-disabled-symbolic", 9 - low: "microphone-sensitivity-low-symbolic", 10 - medium: "microphone-sensitivity-medium-symbolic", 11 - high: "microphone-sensitivity-high-symbolic", 12 - }, 13 - volume: { 14 - muted: "audio-volume-muted-symbolic", 15 - low: "audio-volume-low-symbolic", 16 - medium: "audio-volume-medium-symbolic", 17 - high: "audio-volume-high-symbolic", 18 - overamplified: "audio-volume-overamplified-symbolic", 19 - }, 20 - type: { 21 - headset: "audio-headphones-symbolic", 22 - speaker: "audio-speakers-symbolic", 23 - card: "audio-card-symbolic", 24 - }, 25 - mixer: "", 13 + volume: { 14 + muted: "audio-volume-muted-symbolic", 15 + low: "audio-volume-low-symbolic", 16 + medium: "audio-volume-medium-symbolic", 17 + high: "audio-volume-high-symbolic", 18 + overamplified: "audio-volume-overamplified-symbolic", 26 19 }, 27 - asusctl: { 28 - profile: { 29 - Balanced: "power-profile-balanced-symbolic", 30 - Quiet: "power-profile-power-saver-symbolic", 31 - Performance: "power-profile-performance-symbolic", 32 - }, 33 - mode: { 34 - Integrated: "", 35 - Hybrid: "󰢮", 36 - }, 20 + type: { 21 + headset: "audio-headphones-symbolic", 22 + speaker: "audio-speakers-symbolic", 23 + card: "audio-card-symbolic", 37 24 }, 38 - apps: { 39 - apps: "view-app-grid-symbolic", 40 - search: "folder-saved-search-symbolic", 41 - }, 42 - battery: { 43 - charging: "󱐋", 44 - warning: "battery-empty-symbolic", 45 - }, 46 - bluetooth: { 47 - enabled: "bluetooth-active-symbolic", 48 - disabled: "bluetooth-disabled-symbolic", 49 - }, 50 - brightness: { 51 - indicator: "display-brightness-symbolic", 52 - keyboard: "keyboard-brightness-symbolic", 53 - screen: "display-brightness-symbolic", 54 - }, 55 - powermenu: { 56 - sleep: "weather-clear-night-symbolic", 57 - reboot: "system-reboot-symbolic", 58 - logout: "system-log-out-symbolic", 59 - shutdown: "system-shutdown-symbolic", 25 + mixer: "", 26 + }, 27 + asusctl: { 28 + profile: { 29 + Balanced: "power-profile-balanced-symbolic", 30 + Quiet: "power-profile-power-saver-symbolic", 31 + Performance: "power-profile-performance-symbolic", 60 32 }, 61 - recorder: { 62 - recording: "media-record-symbolic", 63 - }, 64 - notifications: { 65 - noisy: "preferences-system-notifications-symbolic", 66 - silent: "notifications-disabled-symbolic", 67 - }, 68 - trash: { 69 - full: "user-trash-full-symbolic", 70 - empty: "user-trash-symbolic", 71 - }, 72 - mpris: { 73 - fallback: "audio-x-generic-symbolic", 74 - shuffle: { 75 - enabled: "󰒟", 76 - disabled: "󰒟", 77 - }, 78 - loop: { 79 - none: "󰓦", 80 - track: "󰓦", 81 - playlist: "󰑐", 82 - }, 83 - playing: "󰏦", 84 - paused: "󰐍", 85 - stopped: "󰐍", 86 - prev: "󰒮", 87 - next: "󰒭", 33 + mode: { 34 + Integrated: "", 35 + Hybrid: "󰢮", 88 36 }, 89 - ui: { 90 - close: "window-close-symbolic", 91 - info: "info-symbolic", 92 - menu: "open-menu-symbolic", 93 - link: "external-link-symbolic", 94 - settings: "emblem-system-symbolic", 95 - tick: "object-select-symbolic", 96 - arrow: { 97 - right: "pan-end-symbolic", 98 - left: "pan-start-symbolic", 99 - down: "pan-down-symbolic", 100 - up: "pan-up-symbolic", 101 - }, 37 + }, 38 + apps: { 39 + apps: "view-app-grid-symbolic", 40 + search: "folder-saved-search-symbolic", 41 + }, 42 + battery: { 43 + charging: "󱐋", 44 + warning: "battery-empty-symbolic", 45 + }, 46 + bluetooth: { 47 + enabled: "bluetooth-active-symbolic", 48 + disabled: "bluetooth-disabled-symbolic", 49 + }, 50 + brightness: { 51 + indicator: "display-brightness-symbolic", 52 + keyboard: "keyboard-brightness-symbolic", 53 + screen: "display-brightness-symbolic", 54 + }, 55 + powermenu: { 56 + sleep: "weather-clear-night-symbolic", 57 + reboot: "system-reboot-symbolic", 58 + logout: "system-log-out-symbolic", 59 + shutdown: "system-shutdown-symbolic", 60 + }, 61 + recorder: { 62 + recording: "media-record-symbolic", 63 + }, 64 + notifications: { 65 + noisy: "preferences-system-notifications-symbolic", 66 + silent: "notifications-disabled-symbolic", 67 + }, 68 + trash: { 69 + full: "user-trash-full-symbolic", 70 + empty: "user-trash-symbolic", 71 + }, 72 + mpris: { 73 + fallback: "audio-x-generic-symbolic", 74 + shuffle: { 75 + enabled: "󰒟", 76 + disabled: "󰒟", 102 77 }, 103 - system: { 104 - cpu: "org.gnome.SystemMonitor-symbolic", 105 - ram: "drive-harddisk-solidstate-symbolic", 106 - temp: "temperature-symbolic", 78 + loop: { 79 + none: "󰓦", 80 + track: "󰓦", 81 + playlist: "󰑐", 107 82 }, 108 - dialog: { 109 - Search: "", 110 - Applauncher: "󰵆", 111 - Bar: "", 112 - Border: "󰃇", 113 - Color: "󰏘", 114 - Desktop: "", 115 - Font: "", 116 - General: "󰒓", 117 - Miscellaneous: "󰠱", 118 - Theme: "󰃟", 119 - Notifications: "󰂚 ", 83 + playing: "󰏦", 84 + paused: "󰐍", 85 + stopped: "󰐍", 86 + prev: "󰒮", 87 + next: "󰒭", 88 + }, 89 + ui: { 90 + close: "window-close-symbolic", 91 + info: "info-symbolic", 92 + menu: "open-menu-symbolic", 93 + link: "external-link-symbolic", 94 + settings: "emblem-system-symbolic", 95 + tick: "object-select-symbolic", 96 + arrow: { 97 + right: "pan-end-symbolic", 98 + left: "pan-start-symbolic", 99 + down: "pan-down-symbolic", 100 + up: "pan-up-symbolic", 120 101 }, 102 + }, 103 + system: { 104 + cpu: "org.gnome.SystemMonitor-symbolic", 105 + ram: "drive-harddisk-solidstate-symbolic", 106 + temp: "temperature-symbolic", 107 + }, 108 + dialog: { 109 + Search: "", 110 + Applauncher: "󰵆", 111 + Bar: "", 112 + Border: "󰃇", 113 + Color: "󰏘", 114 + Desktop: "", 115 + Font: "", 116 + General: "󰒓", 117 + Miscellaneous: "󰠱", 118 + Theme: "󰃟", 119 + Notifications: "󰂚 ", 120 + }, 121 121 };
+18 -18
home/isabel/programs/configs/gui/bars/ags/config/misc/Avatar.js
··· 3 3 4 4 /** @param {import('types/widgets/box').BoxProps=} props */ 5 5 export default (props) => 6 - Widget.Box({ 7 - ...props, 8 - class_name: "avatar", 9 - connections: [ 10 - [ 11 - options.desktop.avatar, 12 - (box) => 13 - box.setCss(` 6 + Widget.Box({ 7 + ...props, 8 + class_name: "avatar", 9 + connections: [ 10 + [ 11 + options.desktop.avatar, 12 + (box) => 13 + box.setCss(` 14 14 background-image: url('${options.desktop.avatar.value}'); 15 15 background-size: cover; 16 16 `), 17 - ], 18 - [ 19 - "draw", 20 - (box) => { 21 - const h = box.get_allocated_height(); 22 - box.set_size_request(h, -1); 23 - }, 24 - ], 25 - ], 26 - }); 17 + ], 18 + [ 19 + "draw", 20 + (box) => { 21 + const h = box.get_allocated_height(); 22 + box.set_size_request(h, -1); 23 + }, 24 + ], 25 + ], 26 + });
+14 -14
home/isabel/programs/configs/gui/bars/ags/config/misc/BatteryIcon.js
··· 2 2 import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; 3 3 4 4 export default () => 5 - Widget.Icon({ 6 - class_name: "battery", 7 - binds: [["icon", Battery, "icon-name"]], 8 - connections: [ 9 - [ 10 - Battery, 11 - (icon) => { 12 - icon.toggleClassName("charging", Battery.charging); 13 - icon.toggleClassName("charged", Battery.charged); 14 - icon.toggleClassName("low", Battery.percent < 30); 15 - }, 16 - ], 17 - ], 18 - }); 5 + Widget.Icon({ 6 + class_name: "battery", 7 + binds: [["icon", Battery, "icon-name"]], 8 + connections: [ 9 + [ 10 + Battery, 11 + (icon) => { 12 + icon.toggleClassName("charging", Battery.charging); 13 + icon.toggleClassName("charged", Battery.charged); 14 + icon.toggleClassName("low", Battery.percent < 30); 15 + }, 16 + ], 17 + ], 18 + });
+15 -16
home/isabel/programs/configs/gui/bars/ags/config/misc/Clock.js
··· 8 8 * }} o 9 9 */ 10 10 export default ({ 11 - format = "%H:%M:%S %B %e. %A", 12 - interval = 1000, 13 - ...rest 11 + format = "%H:%M:%S %B %e. %A", 12 + interval = 1000, 13 + ...rest 14 14 } = {}) => 15 - Widget.Label({ 16 - class_name: "clock", 17 - ...rest, 18 - connections: [ 19 - [ 20 - interval, 21 - (label) => 22 - (label.label = 23 - GLib.DateTime.new_now_local().format(format) || 24 - "wrong format"), 25 - ], 26 - ], 27 - }); 15 + Widget.Label({ 16 + class_name: "clock", 17 + ...rest, 18 + connections: [ 19 + [ 20 + interval, 21 + (label) => 22 + (label.label = 23 + GLib.DateTime.new_now_local().format(format) || "wrong format"), 24 + ], 25 + ], 26 + });
+31 -31
home/isabel/programs/configs/gui/bars/ags/config/misc/FontIcon.js
··· 3 3 import AgsLabel from "resource:///com/github/Aylur/ags/widgets/label.js"; 4 4 5 5 class FontIcon extends AgsLabel { 6 - static { 7 - GObject.registerClass(this); 8 - } 6 + static { 7 + GObject.registerClass(this); 8 + } 9 9 10 - /** @param {string | import('types/widgets/label').Props & { icon?: string }} params */ 11 - constructor(params = "") { 12 - const { icon = "", ...rest } = params; 13 - super(typeof params === "string" ? {} : rest); 14 - this.toggleClassName("font-icon"); 10 + /** @param {string | import('types/widgets/label').Props & { icon?: string }} params */ 11 + constructor(params = "") { 12 + const { icon = "", ...rest } = params; 13 + super(typeof params === "string" ? {} : rest); 14 + this.toggleClassName("font-icon"); 15 15 16 - if (typeof params === "object") this.icon = icon; 16 + if (typeof params === "object") this.icon = icon; 17 17 18 - if (typeof params === "string") this.icon = params; 19 - } 18 + if (typeof params === "string") this.icon = params; 19 + } 20 20 21 - get icon() { 22 - return this.label; 23 - } 24 - set icon(icon) { 25 - this.label = icon; 26 - } 21 + get icon() { 22 + return this.label; 23 + } 24 + set icon(icon) { 25 + this.label = icon; 26 + } 27 27 28 - get size() { 29 - return this.get_style_context().get_property( 30 - "font-size", 31 - Gtk.StateFlags.NORMAL, 32 - ); 33 - } 28 + get size() { 29 + return this.get_style_context().get_property( 30 + "font-size", 31 + Gtk.StateFlags.NORMAL, 32 + ); 33 + } 34 34 35 - /** @returns {[number, number]} */ 36 - vfunc_get_preferred_height() { 37 - return [this.size, this.size]; 38 - } 35 + /** @returns {[number, number]} */ 36 + vfunc_get_preferred_height() { 37 + return [this.size, this.size]; 38 + } 39 39 40 - /** @returns {[number, number]} */ 41 - vfunc_get_preferred_width() { 42 - return [this.size, this.size]; 43 - } 40 + /** @returns {[number, number]} */ 41 + vfunc_get_preferred_width() { 42 + return [this.size, this.size]; 43 + } 44 44 } 45 45 46 46 /** @param {string | import('types/widgets/label').Props & { icon?: string }} params */
+40 -40
home/isabel/programs/configs/gui/bars/ags/config/misc/HoverRevealer.js
··· 15 15 * @param {HoverRevealProps} props 16 16 */ 17 17 export default ({ 18 - indicator, 19 - child, 20 - direction = "left", 21 - duration = 300, 22 - connections = [], 23 - eventboxConnections = [], 24 - binds = [], 25 - ...rest 18 + indicator, 19 + child, 20 + direction = "left", 21 + duration = 300, 22 + connections = [], 23 + eventboxConnections = [], 24 + binds = [], 25 + ...rest 26 26 }) => { 27 - let open = false; 28 - const vertical = direction === "down" || direction === "up"; 29 - const posStart = direction === "down" || direction === "right"; 30 - const posEnd = direction === "up" || direction === "left"; 27 + let open = false; 28 + const vertical = direction === "down" || direction === "up"; 29 + const posStart = direction === "down" || direction === "right"; 30 + const posEnd = direction === "up" || direction === "left"; 31 31 32 - const revealer = Widget.Revealer({ 33 - transition: `slide_${direction}`, 34 - connections, 35 - binds, 36 - transition_duration: duration, 37 - child, 38 - }); 32 + const revealer = Widget.Revealer({ 33 + transition: `slide_${direction}`, 34 + connections, 35 + binds, 36 + transition_duration: duration, 37 + child, 38 + }); 39 39 40 - const eventbox = Widget.EventBox({ 41 - ...rest, 42 - connections: eventboxConnections, 43 - on_hover: () => { 44 - if (open) return; 40 + const eventbox = Widget.EventBox({ 41 + ...rest, 42 + connections: eventboxConnections, 43 + on_hover: () => { 44 + if (open) return; 45 45 46 - revealer.reveal_child = true; 47 - Utils.timeout(duration, () => (open = true)); 48 - }, 49 - on_hover_lost: () => { 50 - if (!open) return; 46 + revealer.reveal_child = true; 47 + Utils.timeout(duration, () => (open = true)); 48 + }, 49 + on_hover_lost: () => { 50 + if (!open) return; 51 51 52 - revealer.reveal_child = false; 53 - open = false; 54 - }, 55 - child: Widget.Box({ 56 - vertical, 57 - children: [posStart && indicator, revealer, posEnd && indicator], 58 - }), 59 - }); 52 + revealer.reveal_child = false; 53 + open = false; 54 + }, 55 + child: Widget.Box({ 56 + vertical, 57 + children: [posStart && indicator, revealer, posEnd && indicator], 58 + }), 59 + }); 60 60 61 - return Widget.Box({ 62 - children: [eventbox], 63 - }); 61 + return Widget.Box({ 62 + children: [eventbox], 63 + }); 64 64 };
+51 -51
home/isabel/programs/configs/gui/bars/ags/config/misc/IconBrowser.js
··· 3 3 import Gtk from "gi://Gtk"; 4 4 5 5 export default () => { 6 - const selected = Widget.Label({ 7 - css: "font-size: 1.2em;", 8 - }); 6 + const selected = Widget.Label({ 7 + css: "font-size: 1.2em;", 8 + }); 9 9 10 - const flowbox = Widget.FlowBox({ 11 - min_children_per_line: 10, 12 - setup: (self) => { 13 - self.connect("child-activated", (_, child) => { 14 - selected.label = child.get_child().iconName; 15 - }); 10 + const flowbox = Widget.FlowBox({ 11 + min_children_per_line: 10, 12 + setup: (self) => { 13 + self.connect("child-activated", (_, child) => { 14 + selected.label = child.get_child().iconName; 15 + }); 16 16 17 - Gtk.IconTheme.get_default() 18 - .list_icons(null) 19 - .sort() 20 - .map((icon) => { 21 - !icon.endsWith(".symbolic") && 22 - self.insert( 23 - Widget.Icon({ 24 - icon, 25 - size: 38, 26 - }), 27 - -1, 28 - ); 29 - }); 17 + Gtk.IconTheme.get_default() 18 + .list_icons(null) 19 + .sort() 20 + .map((icon) => { 21 + !icon.endsWith(".symbolic") && 22 + self.insert( 23 + Widget.Icon({ 24 + icon, 25 + size: 38, 26 + }), 27 + -1, 28 + ); 29 + }); 30 30 31 - self.show_all(); 32 - }, 33 - }); 31 + self.show_all(); 32 + }, 33 + }); 34 34 35 - const entry = Widget.Entry({ 36 - on_change: ({ text }) => 37 - flowbox.get_children().forEach((child) => { 38 - child.visible = child.get_child().iconName.includes(text); 39 - }), 40 - }); 35 + const entry = Widget.Entry({ 36 + on_change: ({ text }) => 37 + flowbox.get_children().forEach((child) => { 38 + child.visible = child.get_child().iconName.includes(text); 39 + }), 40 + }); 41 41 42 - return RegularWindow({ 43 - name: "icons", 44 - visible: true, 45 - child: Widget.Box({ 46 - css: "padding: 30px;", 47 - spacing: 20, 48 - vertical: true, 49 - children: [ 50 - entry, 51 - Widget.Scrollable({ 52 - hscroll: "never", 53 - vscroll: "always", 54 - hexpand: true, 55 - vexpand: true, 56 - css: "min-width: 500px;" + "min-height: 500px;", 57 - child: flowbox, 58 - }), 59 - selected, 60 - ], 42 + return RegularWindow({ 43 + name: "icons", 44 + visible: true, 45 + child: Widget.Box({ 46 + css: "padding: 30px;", 47 + spacing: 20, 48 + vertical: true, 49 + children: [ 50 + entry, 51 + Widget.Scrollable({ 52 + hscroll: "never", 53 + vscroll: "always", 54 + hexpand: true, 55 + vexpand: true, 56 + css: "min-width: 500px;" + "min-height: 500px;", 57 + child: flowbox, 61 58 }), 62 - }); 59 + selected, 60 + ], 61 + }), 62 + }); 63 63 };
+103 -103
home/isabel/programs/configs/gui/bars/ags/config/misc/Notification.js
··· 4 4 5 5 /** @param {import('types/service/notifications').Notification} n */ 6 6 const NotificationIcon = ({ app_entry, app_icon, image }) => { 7 - if (image) { 8 - return Widget.Box({ 9 - vpack: "start", 10 - hexpand: false, 11 - class_name: "icon img", 12 - css: ` 7 + if (image) { 8 + return Widget.Box({ 9 + vpack: "start", 10 + hexpand: false, 11 + class_name: "icon img", 12 + css: ` 13 13 background-image: url("${image}"); 14 14 background-size: contain; 15 15 background-repeat: no-repeat; ··· 17 17 min-width: 78px; 18 18 min-height: 78px; 19 19 `, 20 - }); 21 - } 20 + }); 21 + } 22 22 23 - let icon = "dialog-information-symbolic"; 24 - if (Utils.lookUpIcon(app_icon)) icon = app_icon; 23 + let icon = "dialog-information-symbolic"; 24 + if (Utils.lookUpIcon(app_icon)) icon = app_icon; 25 25 26 - if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || ""; 26 + if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || ""; 27 27 28 - return Widget.Box({ 29 - vpack: "start", 30 - hexpand: false, 31 - class_name: "icon", 32 - css: ` 28 + return Widget.Box({ 29 + vpack: "start", 30 + hexpand: false, 31 + class_name: "icon", 32 + css: ` 33 33 min-width: 78px; 34 34 min-height: 78px; 35 35 `, 36 - child: Widget.Icon({ 37 - icon, 38 - size: 58, 39 - hpack: "center", 40 - hexpand: true, 41 - vpack: "center", 42 - vexpand: true, 43 - }), 44 - }); 36 + child: Widget.Icon({ 37 + icon, 38 + size: 58, 39 + hpack: "center", 40 + hexpand: true, 41 + vpack: "center", 42 + vexpand: true, 43 + }), 44 + }); 45 45 }; 46 46 47 47 /** @param {import('types/service/notifications').Notification} notification */ 48 48 export default (notification) => { 49 - const content = Widget.Box({ 50 - class_name: "content", 49 + const content = Widget.Box({ 50 + class_name: "content", 51 + children: [ 52 + NotificationIcon(notification), 53 + Widget.Box({ 54 + hexpand: true, 55 + vertical: true, 51 56 children: [ 52 - NotificationIcon(notification), 53 - Widget.Box({ 57 + Widget.Box({ 58 + children: [ 59 + Widget.Label({ 60 + class_name: "title", 61 + xalign: 0, 62 + justification: "left", 54 63 hexpand: true, 55 - vertical: true, 56 - children: [ 57 - Widget.Box({ 58 - children: [ 59 - Widget.Label({ 60 - class_name: "title", 61 - xalign: 0, 62 - justification: "left", 63 - hexpand: true, 64 - max_width_chars: 24, 65 - truncate: "end", 66 - wrap: true, 67 - label: notification.summary, 68 - use_markup: true, 69 - }), 70 - Widget.Label({ 71 - class_name: "time", 72 - vpack: "start", 73 - label: GLib.DateTime.new_from_unix_local( 74 - notification.time, 75 - ).format("%H:%M"), 76 - }), 77 - Widget.Button({ 78 - class_name: "close-button", 79 - vpack: "start", 80 - child: Widget.Icon("window-close-symbolic"), 81 - on_clicked: () => notification.close(), 82 - }), 83 - ], 84 - }), 85 - Widget.Label({ 86 - class_name: "description", 87 - hexpand: true, 88 - use_markup: true, 89 - xalign: 0, 90 - justification: "left", 91 - label: notification.body, 92 - wrap: true, 93 - }), 94 - ], 95 - }), 64 + max_width_chars: 24, 65 + truncate: "end", 66 + wrap: true, 67 + label: notification.summary, 68 + use_markup: true, 69 + }), 70 + Widget.Label({ 71 + class_name: "time", 72 + vpack: "start", 73 + label: GLib.DateTime.new_from_unix_local( 74 + notification.time, 75 + ).format("%H:%M"), 76 + }), 77 + Widget.Button({ 78 + class_name: "close-button", 79 + vpack: "start", 80 + child: Widget.Icon("window-close-symbolic"), 81 + on_clicked: () => notification.close(), 82 + }), 83 + ], 84 + }), 85 + Widget.Label({ 86 + class_name: "description", 87 + hexpand: true, 88 + use_markup: true, 89 + xalign: 0, 90 + justification: "left", 91 + label: notification.body, 92 + wrap: true, 93 + }), 96 94 ], 97 - }); 95 + }), 96 + ], 97 + }); 98 98 99 - const actionsbox = Widget.Revealer({ 100 - transition: "slide_down", 101 - child: Widget.EventBox({ 102 - child: Widget.Box({ 103 - class_name: "actions horizontal", 104 - children: notification.actions.map((action) => 105 - Widget.Button({ 106 - class_name: "action-button", 107 - on_clicked: () => notification.invoke(action.id), 108 - hexpand: true, 109 - child: Widget.Label(action.label), 110 - }), 111 - ), 112 - }), 113 - }), 114 - }); 99 + const actionsbox = Widget.Revealer({ 100 + transition: "slide_down", 101 + child: Widget.EventBox({ 102 + child: Widget.Box({ 103 + class_name: "actions horizontal", 104 + children: notification.actions.map((action) => 105 + Widget.Button({ 106 + class_name: "action-button", 107 + on_clicked: () => notification.invoke(action.id), 108 + hexpand: true, 109 + child: Widget.Label(action.label), 110 + }), 111 + ), 112 + }), 113 + }), 114 + }); 115 115 116 - return Widget.EventBox({ 117 - class_name: `notification ${notification.urgency}`, 118 - vexpand: false, 119 - on_primary_click: () => notification.dismiss(), 120 - on_hover() { 121 - actionsbox.reveal_child = true; 122 - }, 123 - on_hover_lost() { 124 - actionsbox.reveal_child = true; 125 - notification.dismiss(); 126 - }, 127 - child: Widget.Box({ 128 - vertical: true, 129 - children: [content, notification.actions.length > 0 && actionsbox], 130 - }), 131 - }); 116 + return Widget.EventBox({ 117 + class_name: `notification ${notification.urgency}`, 118 + vexpand: false, 119 + on_primary_click: () => notification.dismiss(), 120 + on_hover() { 121 + actionsbox.reveal_child = true; 122 + }, 123 + on_hover_lost() { 124 + actionsbox.reveal_child = true; 125 + notification.dismiss(); 126 + }, 127 + child: Widget.Box({ 128 + vertical: true, 129 + children: [content, notification.actions.length > 0 && actionsbox], 130 + }), 131 + }); 132 132 };
+62 -70
home/isabel/programs/configs/gui/bars/ags/config/misc/OSD.js
··· 5 5 import Indicator from "../services/onScreenIndicator.js"; 6 6 7 7 export const OnScreenIndicator = ({ height = 300, width = 48 } = {}) => 8 - Widget.Box({ 9 - class_name: "indicator", 10 - css: "padding: 1px;", 11 - child: Widget.Revealer({ 12 - transition: "slide_left", 13 - connections: [ 14 - [ 15 - Indicator, 16 - (revealer, value) => { 17 - revealer.reveal_child = value > -1; 18 - }, 8 + Widget.Box({ 9 + class_name: "indicator", 10 + css: "padding: 1px;", 11 + child: Widget.Revealer({ 12 + transition: "slide_left", 13 + connections: [ 14 + [ 15 + Indicator, 16 + (revealer, value) => { 17 + revealer.reveal_child = value > -1; 18 + }, 19 + ], 20 + ], 21 + child: Progress({ 22 + width, 23 + height, 24 + vertical: true, 25 + connections: [ 26 + [Indicator, (progress, value) => progress.setValue(value)], 27 + ], 28 + child: Widget.Stack({ 29 + vpack: "start", 30 + hpack: "center", 31 + hexpand: false, 32 + items: [ 33 + [ 34 + "true", 35 + Widget.Icon({ 36 + hpack: "center", 37 + size: width, 38 + connections: [ 39 + [Indicator, (icon, _v, name) => (icon.icon = name || "")], 19 40 ], 41 + }), 20 42 ], 21 - child: Progress({ 22 - width, 23 - height, 24 - vertical: true, 43 + [ 44 + "false", 45 + FontIcon({ 46 + hpack: "center", 47 + hexpand: true, 48 + css: `font-size: ${width}px;`, 25 49 connections: [ 26 - [Indicator, (progress, value) => progress.setValue(value)], 50 + [Indicator, (icon, _v, name) => (icon.icon = name || "")], 27 51 ], 28 - child: Widget.Stack({ 29 - vpack: "start", 30 - hpack: "center", 31 - hexpand: false, 32 - items: [ 33 - [ 34 - "true", 35 - Widget.Icon({ 36 - hpack: "center", 37 - size: width, 38 - connections: [ 39 - [ 40 - Indicator, 41 - (icon, _v, name) => 42 - (icon.icon = name || ""), 43 - ], 44 - ], 45 - }), 46 - ], 47 - [ 48 - "false", 49 - FontIcon({ 50 - hpack: "center", 51 - hexpand: true, 52 - css: `font-size: ${width}px;`, 53 - connections: [ 54 - [ 55 - Indicator, 56 - (icon, _v, name) => 57 - (icon.icon = name || ""), 58 - ], 59 - ], 60 - }), 61 - ], 62 - ], 63 - connections: [ 64 - [ 65 - Indicator, 66 - (stack, _v, name) => { 67 - stack.shown = `${!!Utils.lookUpIcon(name)}`; 68 - }, 69 - ], 70 - ], 71 - }), 72 - }), 52 + }), 53 + ], 54 + ], 55 + connections: [ 56 + [ 57 + Indicator, 58 + (stack, _v, name) => { 59 + stack.shown = `${!!Utils.lookUpIcon(name)}`; 60 + }, 61 + ], 62 + ], 73 63 }), 74 - }); 64 + }), 65 + }), 66 + }); 75 67 76 68 /** @param {number} monitor */ 77 69 export default (monitor) => 78 - Widget.Window({ 79 - name: `indicator${monitor}`, 80 - monitor, 81 - class_name: "indicator", 82 - layer: "overlay", 83 - anchor: ["right"], 84 - child: OnScreenIndicator(), 85 - }); 70 + Widget.Window({ 71 + name: `indicator${monitor}`, 72 + monitor, 73 + class_name: "indicator", 74 + layer: "overlay", 75 + anchor: ["right"], 76 + child: OnScreenIndicator(), 77 + });
+44 -51
home/isabel/programs/configs/gui/bars/ags/config/misc/PopupWindow.js
··· 5 5 import GObject from "gi://GObject"; 6 6 7 7 class PopupWindow2 extends AgsWindow { 8 - static { 9 - GObject.registerClass(this); 10 - } 8 + static { 9 + GObject.registerClass(this); 10 + } 11 11 12 - /** @param {import('types/widgets/window').WindowProps & { 13 - * name: string 14 - * child: import('types/widgets/box').default 15 - * transition?: import('types/widgets/revealer').RevealerProps['transition'] 16 - * }} o 17 - */ 18 - constructor({ 19 - name, 20 - child, 21 - transition = "none", 22 - visible = false, 23 - ...rest 24 - }) { 25 - super({ 26 - ...rest, 27 - name, 28 - popup: true, 29 - focusable: true, 30 - class_names: ["popup-window", name], 31 - }); 12 + /** @param {import('types/widgets/window').WindowProps & { 13 + * name: string 14 + * child: import('types/widgets/box').default 15 + * transition?: import('types/widgets/revealer').RevealerProps['transition'] 16 + * }} o 17 + */ 18 + constructor({ name, child, transition = "none", visible = false, ...rest }) { 19 + super({ 20 + ...rest, 21 + name, 22 + popup: true, 23 + focusable: true, 24 + class_names: ["popup-window", name], 25 + }); 32 26 33 - child.toggleClassName("window-content"); 34 - this.revealer = Widget.Revealer({ 35 - transition, 36 - child, 37 - transitionDuration: options.transition.value, 38 - connections: [ 39 - [ 40 - App, 41 - (_, wname, visible) => { 42 - if (wname === name) 43 - this.revealer.reveal_child = visible; 44 - }, 45 - ], 46 - ], 47 - }); 27 + child.toggleClassName("window-content"); 28 + this.revealer = Widget.Revealer({ 29 + transition, 30 + child, 31 + transitionDuration: options.transition.value, 32 + connections: [ 33 + [ 34 + App, 35 + (_, wname, visible) => { 36 + if (wname === name) this.revealer.reveal_child = visible; 37 + }, 38 + ], 39 + ], 40 + }); 48 41 49 - this.child = Widget.Box({ 50 - css: "padding: 1px;", 51 - child: this.revealer, 52 - }); 42 + this.child = Widget.Box({ 43 + css: "padding: 1px;", 44 + child: this.revealer, 45 + }); 53 46 54 - this.show_all(); 55 - this.visible = visible; 56 - } 47 + this.show_all(); 48 + this.visible = visible; 49 + } 57 50 58 - set transition(dir) { 59 - this.revealer.transition = dir; 60 - } 61 - get transition() { 62 - return this.revealer.transition; 63 - } 51 + set transition(dir) { 52 + this.revealer.transition = dir; 53 + } 54 + get transition() { 55 + return this.revealer.transition; 56 + } 64 57 } 65 58 66 59 /** @param {import('types/widgets/window').WindowProps & {
+42 -42
home/isabel/programs/configs/gui/bars/ags/config/misc/Progress.js
··· 2 2 import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; 3 3 4 4 export default ({ 5 - height = 18, 6 - width = 180, 7 - vertical = false, 8 - child, 9 - ...props 5 + height = 18, 6 + width = 180, 7 + vertical = false, 8 + child, 9 + ...props 10 10 }) => { 11 - const fill = Widget.Box({ 12 - class_name: "fill", 13 - hexpand: vertical, 14 - vexpand: !vertical, 15 - hpack: vertical ? "fill" : "start", 16 - vpack: vertical ? "end" : "fill", 17 - children: [child], 18 - }); 11 + const fill = Widget.Box({ 12 + class_name: "fill", 13 + hexpand: vertical, 14 + vexpand: !vertical, 15 + hpack: vertical ? "fill" : "start", 16 + vpack: vertical ? "end" : "fill", 17 + children: [child], 18 + }); 19 19 20 - let fill_size = 0; 20 + let fill_size = 0; 21 21 22 - return Widget.Box({ 23 - ...props, 24 - class_name: "progress", 25 - css: ` 22 + return Widget.Box({ 23 + ...props, 24 + class_name: "progress", 25 + css: ` 26 26 min-width: ${width}px; 27 27 min-height: ${height}px; 28 28 `, 29 - children: [fill], 30 - setup: (progress) => 31 - (progress.setValue = (value) => { 32 - if (value < 0) return; 29 + children: [fill], 30 + setup: (progress) => 31 + (progress.setValue = (value) => { 32 + if (value < 0) return; 33 33 34 - const axis = vertical ? "height" : "width"; 35 - const axisv = vertical ? height : width; 36 - const min = vertical ? width : height; 37 - const preferred = (axisv - min) * value + min; 34 + const axis = vertical ? "height" : "width"; 35 + const axisv = vertical ? height : width; 36 + const min = vertical ? width : height; 37 + const preferred = (axisv - min) * value + min; 38 38 39 - if (!fill_size) { 40 - fill_size = preferred; 41 - fill.setCss(`min-${axis}: ${preferred}px;`); 42 - return; 43 - } 39 + if (!fill_size) { 40 + fill_size = preferred; 41 + fill.setCss(`min-${axis}: ${preferred}px;`); 42 + return; 43 + } 44 44 45 - const frames = 10; 46 - const goal = preferred - fill_size; 47 - const step = goal / frames; 45 + const frames = 10; 46 + const goal = preferred - fill_size; 47 + const step = goal / frames; 48 48 49 - for (let i = 0; i < frames; ++i) { 50 - Utils.timeout(5 * i, () => { 51 - fill_size += step; 52 - fill.setCss(`min-${axis}: ${fill_size}px`); 53 - }); 54 - } 55 - }), 56 - }); 49 + for (let i = 0; i < frames; ++i) { 50 + Utils.timeout(5 * i, () => { 51 + fill_size += step; 52 + fill.setCss(`min-${axis}: ${fill_size}px`); 53 + }); 54 + } 55 + }), 56 + }); 57 57 };
+4 -4
home/isabel/programs/configs/gui/bars/ags/config/misc/Spinner.js
··· 1 1 import Widget from "resource:///com/github/Aylur/ags/widget.js"; 2 2 3 3 export default (props) => 4 - Widget.Spinner({ 5 - ...props, 6 - active: true, 7 - }); 4 + Widget.Spinner({ 5 + ...props, 6 + active: true, 7 + });
+251 -257
home/isabel/programs/configs/gui/bars/ags/config/misc/mpris.js
··· 10 10 * @param {import('types/widgets/box').BoxProps=} props 11 11 */ 12 12 export const CoverArt = (player, props) => 13 - Widget.Box({ 14 - ...props, 15 - class_name: "cover", 16 - binds: [ 17 - [ 18 - "css", 19 - player, 20 - "cover-path", 21 - (path) => `background-image: url("${path}")`, 22 - ], 23 - ], 24 - }); 13 + Widget.Box({ 14 + ...props, 15 + class_name: "cover", 16 + binds: [ 17 + [ 18 + "css", 19 + player, 20 + "cover-path", 21 + (path) => `background-image: url("${path}")`, 22 + ], 23 + ], 24 + }); 25 25 26 26 /** 27 27 * @param {import('types/service/mpris').MprisPlayer} player 28 28 * @param {import('types/widgets/box').BoxProps=} props 29 29 */ 30 30 export const BlurredCoverArt = (player, props) => 31 - Widget.Box({ 32 - ...props, 33 - class_name: "blurred-cover", 34 - connections: [ 35 - [ 36 - player, 37 - (box) => { 38 - const url = player.cover_path; 39 - if (!url) return; 31 + Widget.Box({ 32 + ...props, 33 + class_name: "blurred-cover", 34 + connections: [ 35 + [ 36 + player, 37 + (box) => { 38 + const url = player.cover_path; 39 + if (!url) return; 40 40 41 - const blurredPath = MEDIA_CACHE_PATH + "/blurred"; 42 - const blurred = 43 - blurredPath + url.substring(MEDIA_CACHE_PATH.length); 41 + const blurredPath = MEDIA_CACHE_PATH + "/blurred"; 42 + const blurred = blurredPath + url.substring(MEDIA_CACHE_PATH.length); 44 43 45 - if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) { 46 - box.setCss(`background-image: url("${blurred}")`); 47 - return; 48 - } 44 + if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) { 45 + box.setCss(`background-image: url("${blurred}")`); 46 + return; 47 + } 49 48 50 - Utils.ensureDirectory(blurredPath); 51 - Utils.execAsync(["convert", url, "-blur", "0x22", blurred]) 52 - .then(() => 53 - box.setCss(`background-image: url("${blurred}")`), 54 - ) 55 - .catch(() => {}); 56 - }, 57 - "notify::cover-path", 58 - ], 59 - ], 60 - }); 49 + Utils.ensureDirectory(blurredPath); 50 + Utils.execAsync(["convert", url, "-blur", "0x22", blurred]) 51 + .then(() => box.setCss(`background-image: url("${blurred}")`)) 52 + .catch(() => {}); 53 + }, 54 + "notify::cover-path", 55 + ], 56 + ], 57 + }); 61 58 62 59 /** 63 60 * @param {import('types/service/mpris').MprisPlayer} player 64 61 * @param {import('types/widgets/label').Props=} props 65 62 */ 66 63 export const TitleLabel = (player, props) => 67 - Widget.Label({ 68 - ...props, 69 - class_name: "title", 70 - binds: [["label", player, "track-title"]], 71 - }); 64 + Widget.Label({ 65 + ...props, 66 + class_name: "title", 67 + binds: [["label", player, "track-title"]], 68 + }); 72 69 73 70 /** 74 71 * @param {import('types/service/mpris').MprisPlayer} player 75 72 * @param {import('types/widgets/label').Props=} props 76 73 */ 77 74 export const ArtistLabel = (player, props) => 78 - Widget.Label({ 79 - ...props, 80 - class_name: "artist", 81 - binds: [["label", player, "track-artists", (a) => a.join(", ") || ""]], 82 - }); 75 + Widget.Label({ 76 + ...props, 77 + class_name: "artist", 78 + binds: [["label", player, "track-artists", (a) => a.join(", ") || ""]], 79 + }); 83 80 84 81 /** 85 82 * @param {import('types/service/mpris').MprisPlayer} player 86 83 * @param {import('types/widgets/icon').Props & { symbolic?: boolean }=} props 87 84 */ 88 85 export const PlayerIcon = (player, { symbolic = true, ...props } = {}) => 89 - Widget.Icon({ 90 - ...props, 91 - class_name: "player-icon", 92 - tooltip_text: player.identity || "", 93 - connections: [ 94 - [ 95 - player, 96 - (icon) => { 97 - const name = `${player.entry}${ 98 - symbolic ? "-symbolic" : "" 99 - }`; 100 - Utils.lookUpIcon(name) 101 - ? (icon.icon = name) 102 - : (icon.icon = icons.mpris.fallback); 103 - }, 104 - ], 105 - ], 106 - }); 86 + Widget.Icon({ 87 + ...props, 88 + class_name: "player-icon", 89 + tooltip_text: player.identity || "", 90 + connections: [ 91 + [ 92 + player, 93 + (icon) => { 94 + const name = `${player.entry}${symbolic ? "-symbolic" : ""}`; 95 + Utils.lookUpIcon(name) 96 + ? (icon.icon = name) 97 + : (icon.icon = icons.mpris.fallback); 98 + }, 99 + ], 100 + ], 101 + }); 107 102 108 103 /** 109 104 * @param {import('types/service/mpris').MprisPlayer} player 110 105 * @param {import('types/widgets/slider').SliderProps=} props 111 106 */ 112 107 export const PositionSlider = (player, props) => 113 - Widget.Slider({ 114 - ...props, 115 - class_name: "position-slider", 116 - draw_value: false, 117 - on_change: ({ value }) => { 118 - player.position = player.length * value; 119 - }, 120 - properties: [ 121 - [ 122 - "update", 123 - (slider) => { 124 - if (slider.dragging) return; 108 + Widget.Slider({ 109 + ...props, 110 + class_name: "position-slider", 111 + draw_value: false, 112 + on_change: ({ value }) => { 113 + player.position = player.length * value; 114 + }, 115 + properties: [ 116 + [ 117 + "update", 118 + (slider) => { 119 + if (slider.dragging) return; 125 120 126 - slider.visible = player.length > 0; 127 - if (player.length > 0) 128 - slider.value = player.position / player.length; 129 - }, 130 - ], 131 - ], 132 - connections: [ 133 - [player, (s) => s._update(s)], 134 - [player, (s) => s._update(s), "position"], 135 - [1000, (s) => s._update(s)], 136 - ], 137 - }); 121 + slider.visible = player.length > 0; 122 + if (player.length > 0) slider.value = player.position / player.length; 123 + }, 124 + ], 125 + ], 126 + connections: [ 127 + [player, (s) => s._update(s)], 128 + [player, (s) => s._update(s), "position"], 129 + [1000, (s) => s._update(s)], 130 + ], 131 + }); 138 132 139 133 /** @param {number} length */ 140 134 function lengthStr(length) { 141 - const min = Math.floor(length / 60); 142 - const sec = Math.floor(length % 60); 143 - const sec0 = sec < 10 ? "0" : ""; 144 - return `${min}:${sec0}${sec}`; 135 + const min = Math.floor(length / 60); 136 + const sec = Math.floor(length % 60); 137 + const sec0 = sec < 10 ? "0" : ""; 138 + return `${min}:${sec0}${sec}`; 145 139 } 146 140 147 141 /** @param {import('types/service/mpris').MprisPlayer} player */ 148 142 export const PositionLabel = (player) => 149 - Widget.Label({ 150 - properties: [ 151 - [ 152 - "update", 153 - (label, time) => { 154 - player.length > 0 155 - ? (label.label = lengthStr(time || player.position)) 156 - : (label.visible = !!player); 157 - }, 158 - ], 159 - ], 160 - connections: [ 161 - [player, (l, time) => l._update(l, time), "position"], 162 - [1000, (l) => l._update(l)], 163 - ], 164 - }); 143 + Widget.Label({ 144 + properties: [ 145 + [ 146 + "update", 147 + (label, time) => { 148 + player.length > 0 149 + ? (label.label = lengthStr(time || player.position)) 150 + : (label.visible = !!player); 151 + }, 152 + ], 153 + ], 154 + connections: [ 155 + [player, (l, time) => l._update(l, time), "position"], 156 + [1000, (l) => l._update(l)], 157 + ], 158 + }); 165 159 166 160 /** @param {import('types/service/mpris').MprisPlayer} player */ 167 161 export const LengthLabel = (player) => 168 - Widget.Label({ 169 - connections: [ 170 - [ 171 - player, 172 - (label) => { 173 - player.length > 0 174 - ? (label.label = lengthStr(player.length)) 175 - : (label.visible = !!player); 176 - }, 177 - ], 178 - ], 179 - }); 162 + Widget.Label({ 163 + connections: [ 164 + [ 165 + player, 166 + (label) => { 167 + player.length > 0 168 + ? (label.label = lengthStr(player.length)) 169 + : (label.visible = !!player); 170 + }, 171 + ], 172 + ], 173 + }); 180 174 181 175 /** @param {import('types/service/mpris').MprisPlayer} player */ 182 176 export const Slash = (player) => 183 - Widget.Label({ 184 - label: "/", 185 - connections: [ 186 - [ 187 - player, 188 - (label) => { 189 - label.visible = player.length > 0; 190 - }, 191 - ], 192 - ], 193 - }); 177 + Widget.Label({ 178 + label: "/", 179 + connections: [ 180 + [ 181 + player, 182 + (label) => { 183 + label.visible = player.length > 0; 184 + }, 185 + ], 186 + ], 187 + }); 194 188 195 189 /** 196 190 * @param {Object} o ··· 202 196 * @param {any} o.cantValue 203 197 */ 204 198 const PlayerButton = ({ player, items, onClick, prop, canProp, cantValue }) => 205 - Widget.Button({ 206 - child: Widget.Stack({ 207 - items, 208 - binds: [["shown", player, prop, (p) => `${p}`]], 209 - }), 210 - on_clicked: player[onClick].bind(player), 211 - binds: [["visible", player, canProp, (c) => c !== cantValue]], 212 - }); 199 + Widget.Button({ 200 + child: Widget.Stack({ 201 + items, 202 + binds: [["shown", player, prop, (p) => `${p}`]], 203 + }), 204 + on_clicked: player[onClick].bind(player), 205 + binds: [["visible", player, canProp, (c) => c !== cantValue]], 206 + }); 213 207 214 208 /** @param {import('types/service/mpris').MprisPlayer} player */ 215 209 export const ShuffleButton = (player) => 216 - PlayerButton({ 217 - player, 218 - items: [ 219 - [ 220 - "true", 221 - Widget.Label({ 222 - class_name: "shuffle enabled", 223 - label: icons.mpris.shuffle.enabled, 224 - }), 225 - ], 226 - [ 227 - "false", 228 - Widget.Label({ 229 - class_name: "shuffle disabled", 230 - label: icons.mpris.shuffle.disabled, 231 - }), 232 - ], 233 - ], 234 - onClick: "shuffle", 235 - prop: "shuffle-status", 236 - canProp: "shuffle-status", 237 - cantValue: null, 238 - }); 210 + PlayerButton({ 211 + player, 212 + items: [ 213 + [ 214 + "true", 215 + Widget.Label({ 216 + class_name: "shuffle enabled", 217 + label: icons.mpris.shuffle.enabled, 218 + }), 219 + ], 220 + [ 221 + "false", 222 + Widget.Label({ 223 + class_name: "shuffle disabled", 224 + label: icons.mpris.shuffle.disabled, 225 + }), 226 + ], 227 + ], 228 + onClick: "shuffle", 229 + prop: "shuffle-status", 230 + canProp: "shuffle-status", 231 + cantValue: null, 232 + }); 239 233 240 234 /** @param {import('types/service/mpris').MprisPlayer} player */ 241 235 export const LoopButton = (player) => 242 - PlayerButton({ 243 - player, 244 - items: [ 245 - [ 246 - "None", 247 - Widget.Label({ 248 - class_name: "loop none", 249 - label: icons.mpris.loop.none, 250 - }), 251 - ], 252 - [ 253 - "Track", 254 - Widget.Label({ 255 - class_name: "loop track", 256 - label: icons.mpris.loop.track, 257 - }), 258 - ], 259 - [ 260 - "Playlist", 261 - Widget.Label({ 262 - class_name: "loop playlist", 263 - label: icons.mpris.loop.playlist, 264 - }), 265 - ], 266 - ], 267 - onClick: "loop", 268 - prop: "loop-status", 269 - canProp: "loop-status", 270 - cantValue: null, 271 - }); 236 + PlayerButton({ 237 + player, 238 + items: [ 239 + [ 240 + "None", 241 + Widget.Label({ 242 + class_name: "loop none", 243 + label: icons.mpris.loop.none, 244 + }), 245 + ], 246 + [ 247 + "Track", 248 + Widget.Label({ 249 + class_name: "loop track", 250 + label: icons.mpris.loop.track, 251 + }), 252 + ], 253 + [ 254 + "Playlist", 255 + Widget.Label({ 256 + class_name: "loop playlist", 257 + label: icons.mpris.loop.playlist, 258 + }), 259 + ], 260 + ], 261 + onClick: "loop", 262 + prop: "loop-status", 263 + canProp: "loop-status", 264 + cantValue: null, 265 + }); 272 266 273 267 /** @param {import('types/service/mpris').MprisPlayer} player */ 274 268 export const PlayPauseButton = (player) => 275 - PlayerButton({ 276 - player, 277 - items: [ 278 - [ 279 - "Playing", 280 - Widget.Label({ 281 - class_name: "playing", 282 - label: icons.mpris.playing, 283 - }), 284 - ], 285 - [ 286 - "Paused", 287 - Widget.Label({ 288 - class_name: "paused", 289 - label: icons.mpris.paused, 290 - }), 291 - ], 292 - [ 293 - "Stopped", 294 - Widget.Label({ 295 - class_name: "stopped", 296 - label: icons.mpris.stopped, 297 - }), 298 - ], 299 - ], 300 - onClick: "playPause", 301 - prop: "play-back-status", 302 - canProp: "can-play", 303 - cantValue: false, 304 - }); 269 + PlayerButton({ 270 + player, 271 + items: [ 272 + [ 273 + "Playing", 274 + Widget.Label({ 275 + class_name: "playing", 276 + label: icons.mpris.playing, 277 + }), 278 + ], 279 + [ 280 + "Paused", 281 + Widget.Label({ 282 + class_name: "paused", 283 + label: icons.mpris.paused, 284 + }), 285 + ], 286 + [ 287 + "Stopped", 288 + Widget.Label({ 289 + class_name: "stopped", 290 + label: icons.mpris.stopped, 291 + }), 292 + ], 293 + ], 294 + onClick: "playPause", 295 + prop: "play-back-status", 296 + canProp: "can-play", 297 + cantValue: false, 298 + }); 305 299 306 300 /** @param {import('types/service/mpris').MprisPlayer} player */ 307 301 export const PreviousButton = (player) => 308 - PlayerButton({ 309 - player, 310 - items: [ 311 - [ 312 - "true", 313 - Widget.Label({ 314 - class_name: "previous", 315 - label: icons.mpris.prev, 316 - }), 317 - ], 318 - ], 319 - onClick: "previous", 320 - prop: "can-go-prev", 321 - canProp: "can-go-prev", 322 - cantValue: false, 323 - }); 302 + PlayerButton({ 303 + player, 304 + items: [ 305 + [ 306 + "true", 307 + Widget.Label({ 308 + class_name: "previous", 309 + label: icons.mpris.prev, 310 + }), 311 + ], 312 + ], 313 + onClick: "previous", 314 + prop: "can-go-prev", 315 + canProp: "can-go-prev", 316 + cantValue: false, 317 + }); 324 318 325 319 /** @param {import('types/service/mpris').MprisPlayer} player */ 326 320 export const NextButton = (player) => 327 - PlayerButton({ 328 - player, 329 - items: [ 330 - [ 331 - "true", 332 - Widget.Label({ 333 - class_name: "next", 334 - label: icons.mpris.next, 335 - }), 336 - ], 337 - ], 338 - onClick: "next", 339 - prop: "can-go-next", 340 - canProp: "can-go-next", 341 - cantValue: false, 342 - }); 321 + PlayerButton({ 322 + player, 323 + items: [ 324 + [ 325 + "true", 326 + Widget.Label({ 327 + class_name: "next", 328 + label: icons.mpris.next, 329 + }), 330 + ], 331 + ], 332 + onClick: "next", 333 + prop: "can-go-next", 334 + canProp: "can-go-next", 335 + cantValue: false, 336 + });
+197 -197
home/isabel/programs/configs/gui/bars/ags/config/options.js
··· 13 13 import themes from "./themes.js"; 14 14 15 15 export default { 16 - reset: resetOptions, 17 - values: getValues, 18 - apply: apply, 16 + reset: resetOptions, 17 + values: getValues, 18 + apply: apply, 19 + 20 + spacing: Option(9), 21 + padding: Option(8), 22 + radii: Option(15), 19 23 20 - spacing: Option(9), 21 - padding: Option(8), 22 - radii: Option(15), 24 + popover_padding_multiplier: Option(1.4, { 25 + category: "General", 26 + note: "popover-padding: padding x this", 27 + type: "float", 28 + unit: "", 29 + }), 23 30 24 - popover_padding_multiplier: Option(1.4, { 25 - category: "General", 26 - note: "popover-padding: padding x this", 27 - type: "float", 28 - unit: "", 31 + font: { 32 + font: Option("Ubuntu Nerd Font", { 33 + type: "font", 34 + title: "Font", 35 + scss: "font", 29 36 }), 37 + mono: Option("Mononoki Nerd Font", { 38 + title: "Monospaced Font", 39 + scss: "mono-font", 40 + }), 41 + size: Option(13, { 42 + scss: "font-size", 43 + unit: "pt", 44 + }), 45 + }, 30 46 31 - font: { 32 - font: Option("Ubuntu Nerd Font", { 33 - type: "font", 34 - title: "Font", 35 - scss: "font", 36 - }), 37 - mono: Option("Mononoki Nerd Font", { 38 - title: "Monospaced Font", 39 - scss: "mono-font", 40 - }), 41 - size: Option(13, { 42 - scss: "font-size", 43 - unit: "pt", 44 - }), 45 - }, 47 + color: { 48 + red: Option("#f38ba8", { scss: "red" }), 49 + green: Option("#a6e3a1", { scss: "green" }), 50 + yellow: Option("#f9e2af", { scss: "yellow" }), 51 + blue: Option("#74c7ec", { scss: "blue" }), 52 + magenta: Option("#cba6f7", { scss: "magenta" }), 53 + teal: Option("#94e2d5", { scss: "teal" }), 54 + orange: Option("#fab387", { scss: "orange" }), 55 + }, 46 56 47 - color: { 48 - red: Option("#f38ba8", { scss: "red" }), 49 - green: Option("#a6e3a1", { scss: "green" }), 50 - yellow: Option("#f9e2af", { scss: "yellow" }), 51 - blue: Option("#74c7ec", { scss: "blue" }), 52 - magenta: Option("#cba6f7", { scss: "magenta" }), 53 - teal: Option("#94e2d5", { scss: "teal" }), 54 - orange: Option("#fab387", { scss: "orange" }), 55 - }, 57 + theme: { 58 + name: Option(themes[0].name, { 59 + category: "exclude", 60 + note: "Name to show as active in quicktoggles", 61 + }), 56 62 57 - theme: { 58 - name: Option(themes[0].name, { 59 - category: "exclude", 60 - note: "Name to show as active in quicktoggles", 61 - }), 63 + icon: Option(themes[0].icon, { 64 + category: "exclude", 65 + note: "Icon to show as active in quicktoggles", 66 + }), 62 67 63 - icon: Option(themes[0].icon, { 64 - category: "exclude", 65 - note: "Icon to show as active in quicktoggles", 66 - }), 68 + scheme: Option("dark", { 69 + enums: ["dark", "light"], 70 + type: "enum", 71 + note: "Color scheme to set on Gtk apps: 'ligth' or 'dark'", 72 + title: "Color Scheme", 73 + scss: "color-scheme", 74 + }), 67 75 68 - scheme: Option("dark", { 69 - enums: ["dark", "light"], 70 - type: "enum", 71 - note: "Color scheme to set on Gtk apps: 'ligth' or 'dark'", 72 - title: "Color Scheme", 73 - scss: "color-scheme", 74 - }), 76 + bg: Option("#1e1e2e", { 77 + title: "Background Color", 78 + scss: "bg-color", 79 + }), 80 + fg: Option("#cdd6f4", { 81 + title: "Foreground Color", 82 + scss: "fg-color", 83 + }), 75 84 76 - bg: Option("#1e1e2e", { 77 - title: "Background Color", 78 - scss: "bg-color", 79 - }), 80 - fg: Option("#cdd6f4", { 81 - title: "Foreground Color", 82 - scss: "fg-color", 83 - }), 84 - 85 - accent: { 86 - accent: Option("$blue", { 87 - category: "Theme", 88 - title: "Accent Color", 89 - scss: "accent", 90 - }), 91 - fg: Option("$bg-color", { 92 - category: "Theme", 93 - title: "Accent Foreground Color", 94 - scss: "accent-fg", 95 - }), 96 - gradient: Option("to right, $accent, lighten($accent, 6%)", { 97 - category: "Theme", 98 - title: "Accent Linear Gradient", 99 - scss: "accent-gradient", 100 - }), 101 - }, 102 - 103 - widget: { 104 - bg: Option("$fg_color", { 105 - category: "Theme", 106 - title: "Widget Background Color", 107 - scss: "_widget-bg", 108 - }), 109 - opacity: Option(94, { 110 - category: "Theme", 111 - title: "Widget Background Opacity", 112 - unit: "", 113 - scss: "widget-opacity", 114 - }), 115 - }, 85 + accent: { 86 + accent: Option("$blue", { 87 + category: "Theme", 88 + title: "Accent Color", 89 + scss: "accent", 90 + }), 91 + fg: Option("$bg-color", { 92 + category: "Theme", 93 + title: "Accent Foreground Color", 94 + scss: "accent-fg", 95 + }), 96 + gradient: Option("to right, $accent, lighten($accent, 6%)", { 97 + category: "Theme", 98 + title: "Accent Linear Gradient", 99 + scss: "accent-gradient", 100 + }), 116 101 }, 117 102 118 - border: { 119 - color: Option("$fg_color", { 120 - category: "Border", 121 - title: "Border Color", 122 - scss: "_border-color", 123 - }), 124 - opacity: Option(97, { 125 - category: "Border", 126 - title: "Border Opacity", 127 - unit: "", 128 - }), 129 - width: Option(1, { 130 - category: "Border", 131 - title: "Border Width", 132 - }), 103 + widget: { 104 + bg: Option("$fg_color", { 105 + category: "Theme", 106 + title: "Widget Background Color", 107 + scss: "_widget-bg", 108 + }), 109 + opacity: Option(94, { 110 + category: "Theme", 111 + title: "Widget Background Opacity", 112 + unit: "", 113 + scss: "widget-opacity", 114 + }), 133 115 }, 116 + }, 134 117 135 - shadow: Option("rgba(0, 0, 0, .6)"), 136 - drop_shadow: Option(true, { scss: "drop-shadow" }), 118 + border: { 119 + color: Option("$fg_color", { 120 + category: "Border", 121 + title: "Border Color", 122 + scss: "_border-color", 123 + }), 124 + opacity: Option(97, { 125 + category: "Border", 126 + title: "Border Opacity", 127 + unit: "", 128 + }), 129 + width: Option(1, { 130 + category: "Border", 131 + title: "Border Width", 132 + }), 133 + }, 137 134 138 - hypr: { 139 - wm_gaps: Option(8, { 140 - category: "General", 141 - scss: "wm-gaps", 142 - note: "wm-gaps", 143 - type: "float", 144 - unit: "", 145 - }), 146 - }, 135 + shadow: Option("rgba(0, 0, 0, .6)"), 136 + drop_shadow: Option(true, { scss: "drop-shadow" }), 147 137 148 - transition: Option(200, { 149 - category: "exclude", 150 - note: "Transition time on aminations in ms, e.g on hover", 151 - unit: "ms", 138 + hypr: { 139 + wm_gaps: Option(8, { 140 + category: "General", 141 + scss: "wm-gaps", 142 + note: "wm-gaps", 143 + type: "float", 144 + unit: "", 152 145 }), 146 + }, 153 147 154 - applauncher: { 155 - width: Option(500), 156 - height: Option(500), 157 - icon_size: Option(52), 158 - }, 148 + transition: Option(200, { 149 + category: "exclude", 150 + note: "Transition time on aminations in ms, e.g on hover", 151 + unit: "ms", 152 + }), 159 153 160 - bar: { 161 - position: Option("top", { 162 - enums: ["top", "bottom"], 163 - type: "enum", 164 - }), 165 - style: Option("floating", { 166 - enums: ["floating", "normal", "separated"], 167 - type: "enum", 168 - }), 169 - flat_buttons: Option(true, { scss: "bar-flat-buttons" }), 170 - separators: Option(true), 171 - icon: Option("distro-icon", { 172 - note: '"distro-icon" or a single font', 173 - }), 174 - }, 154 + applauncher: { 155 + width: Option(500), 156 + height: Option(500), 157 + icon_size: Option(52), 158 + }, 175 159 176 - battery: { 177 - show_percentage: Option(true, { noReload: false, category: "exclude" }), 178 - bar: { 179 - width: Option(70, { category: "Bar" }), 180 - height: Option(14, { category: "Bar" }), 181 - }, 182 - low: Option(25, { category: "Bar" }), 183 - medium: Option(50, { category: "Bar" }), 184 - }, 160 + bar: { 161 + position: Option("top", { 162 + enums: ["top", "bottom"], 163 + type: "enum", 164 + }), 165 + style: Option("floating", { 166 + enums: ["floating", "normal", "separated"], 167 + type: "enum", 168 + }), 169 + flat_buttons: Option(true, { scss: "bar-flat-buttons" }), 170 + separators: Option(true), 171 + icon: Option("distro-icon", { 172 + note: '"distro-icon" or a single font', 173 + }), 174 + }, 185 175 186 - desktop: { 187 - avatar: Option(``, { 188 - format: (v) => `"${v}"`, 189 - }), 190 - wallpaper: { 191 - fg: Option("#fff", { scss: "wallpaper-fg" }), 192 - img: Option(themes[0].options["desktop.wallpaper.img"], { 193 - scssFormat: (v) => `"${v}"`, 194 - type: "img", 195 - }), 196 - }, 197 - avatar: Option(`/home/${USER}/media/pictures/pfps/avatar`, { 198 - scssFormat: (v) => `"${v}"`, 199 - type: "img", 200 - note: "displayed in quicksettings and locksreen", 201 - }), 202 - drop_shadow: Option(true, { scss: "drop-shadow" }), 203 - shadow: Option("rgba(0, 0, 0, .6)", { scss: "shadow" }), 176 + battery: { 177 + show_percentage: Option(true, { noReload: false, category: "exclude" }), 178 + bar: { 179 + width: Option(70, { category: "Bar" }), 180 + height: Option(14, { category: "Bar" }), 204 181 }, 182 + low: Option(25, { category: "Bar" }), 183 + medium: Option(50, { category: "Bar" }), 184 + }, 205 185 206 - notifications: { 207 - black_list: Option(["Spotify"], { note: "app-name | entry" }), 208 - position: Option(["top"], { note: "anchor" }), 209 - width: Option(450), 186 + desktop: { 187 + avatar: Option(``, { 188 + format: (v) => `"${v}"`, 189 + }), 190 + wallpaper: { 191 + fg: Option("#fff", { scss: "wallpaper-fg" }), 192 + img: Option(themes[0].options["desktop.wallpaper.img"], { 193 + scssFormat: (v) => `"${v}"`, 194 + type: "img", 195 + }), 210 196 }, 197 + avatar: Option(`/home/${USER}/media/pictures/pfps/avatar`, { 198 + scssFormat: (v) => `"${v}"`, 199 + type: "img", 200 + note: "displayed in quicksettings and locksreen", 201 + }), 202 + drop_shadow: Option(true, { scss: "drop-shadow" }), 203 + shadow: Option("rgba(0, 0, 0, .6)", { scss: "shadow" }), 204 + }, 211 205 212 - dashboard: { 213 - sys_info_size: Option(70, { 214 - category: "Desktop", 215 - scss: "sys-info-size", 216 - }), 217 - }, 206 + notifications: { 207 + black_list: Option(["Spotify"], { note: "app-name | entry" }), 208 + position: Option(["top"], { note: "anchor" }), 209 + width: Option(450), 210 + }, 218 211 219 - mpris: { 220 - black_list: Option(["Caprine"], { 221 - category: "Bar", 222 - title: "List of blacklisted mpris players", 223 - note: "filters for bus-name, name, identity, entry", 224 - }), 225 - preferred: Option("spotify", { 226 - category: "Bar", 227 - title: "Preferred player", 228 - }), 229 - }, 212 + dashboard: { 213 + sys_info_size: Option(70, { 214 + category: "Desktop", 215 + scss: "sys-info-size", 216 + }), 217 + }, 230 218 231 - workspaces: Option(7, { 232 - category: "Bar", 233 - title: "No. workspaces on bar and overview", 234 - note: "Set it to 0 to make it dynamic", 219 + mpris: { 220 + black_list: Option(["Caprine"], { 221 + category: "Bar", 222 + title: "List of blacklisted mpris players", 223 + note: "filters for bus-name, name, identity, entry", 235 224 }), 225 + preferred: Option("spotify", { 226 + category: "Bar", 227 + title: "Preferred player", 228 + }), 229 + }, 236 230 237 - // path to read temperature from 238 - temperature: "/sys/class/thermal/thermal_zone0/temp", 231 + workspaces: Option(7, { 232 + category: "Bar", 233 + title: "No. workspaces on bar and overview", 234 + note: "Set it to 0 to make it dynamic", 235 + }), 239 236 240 - // at what intervals should cpu, ram, temperature refresh 241 - systemFetchInterval: 5000, 237 + // path to read temperature from 238 + temperature: "/sys/class/thermal/thermal_zone0/temp", 239 + 240 + // at what intervals should cpu, ram, temperature refresh 241 + systemFetchInterval: 5000, 242 242 };
+84 -84
home/isabel/programs/configs/gui/bars/ags/config/scss/common/button.scss
··· 1 1 @mixin button-focus() { 2 - box-shadow: inset 0 0 0 $border-width $accent; 3 - background-color: $hover; 4 - color: $hover-fg; 2 + box-shadow: inset 0 0 0 $border-width $accent; 3 + background-color: $hover; 4 + color: $hover-fg; 5 5 } 6 6 7 7 @mixin button-hover() { 8 - box-shadow: inset 0 0 0 $border-width $border-color; 9 - background-color: $hover; 10 - color: $hover-fg; 8 + box-shadow: inset 0 0 0 $border-width $border-color; 9 + background-color: $hover; 10 + color: $hover-fg; 11 11 } 12 12 13 13 @mixin button-active() { 14 - box-shadow: inset 0 0 0 $border-width $border-color; 15 - background-image: $active-gradient; 16 - background-color: $accent; 17 - color: $accent-fg; 14 + box-shadow: inset 0 0 0 $border-width $border-color; 15 + background-image: $active-gradient; 16 + background-color: $accent; 17 + color: $accent-fg; 18 18 } 19 19 20 20 @mixin button-disabled() { 21 - box-shadow: none; 22 - background-color: transparent; 23 - color: transparentize($fg-color, 0.7); 21 + box-shadow: none; 22 + background-color: transparent; 23 + color: transparentize($fg-color, 0.7); 24 24 } 25 25 26 26 @mixin button($flat: false, $reactive: true, $radii: $radii, $focusable: true) { 27 - @include unset; 28 - transition: $transition; 29 - border-radius: $radii; 30 - color: $fg-color; 27 + @include unset; 28 + transition: $transition; 29 + border-radius: $radii; 30 + color: $fg-color; 31 31 32 - @if $flat { 33 - background-color: transparent; 34 - background-image: none; 35 - box-shadow: none; 36 - } @else { 37 - background-color: $widget-bg; 38 - box-shadow: inset 0 0 0 $border-width $border-color; 39 - } 32 + @if $flat { 33 + background-color: transparent; 34 + background-image: none; 35 + box-shadow: none; 36 + } @else { 37 + background-color: $widget-bg; 38 + box-shadow: inset 0 0 0 $border-width $border-color; 39 + } 40 40 41 - @if $reactive { 42 - @if $focusable { 43 - &:focus { 44 - @include button-focus; 45 - } 46 - } 41 + @if $reactive { 42 + @if $focusable { 43 + &:focus { 44 + @include button-focus; 45 + } 46 + } 47 47 48 - &:hover { 49 - @include button-hover; 50 - } 48 + &:hover { 49 + @include button-hover; 50 + } 51 51 52 - &:active, 53 - &.on, 54 - &.active, 55 - &:checked { 56 - @include button-active; 52 + &:active, 53 + &.on, 54 + &.active, 55 + &:checked { 56 + @include button-active; 57 57 58 - &:hover { 59 - box-shadow: 60 - inset 0 0 0 $border-width $border-color, 61 - inset 0 0 0 99px $hover; 62 - } 63 - } 64 - } 58 + &:hover { 59 + box-shadow: 60 + inset 0 0 0 $border-width $border-color, 61 + inset 0 0 0 99px $hover; 62 + } 63 + } 64 + } 65 65 66 - &:disabled { 67 - @include button-disabled; 68 - } 66 + &:disabled { 67 + @include button-disabled; 68 + } 69 69 } 70 70 71 71 @mixin accs-button($flat: false, $reactive: true) { 72 - @include button($flat: true, $reactive: false, $focusable: false); 73 - color: $fg-color; 72 + @include button($flat: true, $reactive: false, $focusable: false); 73 + color: $fg-color; 74 74 75 - > * { 76 - border-radius: $radii; 77 - transition: $transition; 75 + > * { 76 + border-radius: $radii; 77 + transition: $transition; 78 78 79 - @if $flat { 80 - background-color: transparent; 81 - box-shadow: none; 82 - } @else { 83 - background-color: $widget-bg; 84 - box-shadow: inset 0 0 0 $border-width $border-color; 85 - } 86 - } 79 + @if $flat { 80 + background-color: transparent; 81 + box-shadow: none; 82 + } @else { 83 + background-color: $widget-bg; 84 + box-shadow: inset 0 0 0 $border-width $border-color; 85 + } 86 + } 87 87 88 - @if $reactive { 89 - &:focus > *, 90 - &.focused > * { 91 - @include button-focus; 92 - } 88 + @if $reactive { 89 + &:focus > *, 90 + &.focused > * { 91 + @include button-focus; 92 + } 93 93 94 - &:hover > * { 95 - @include button-hover; 96 - } 94 + &:hover > * { 95 + @include button-hover; 96 + } 97 97 98 - &:active, 99 - &.active, 100 - &.on, 101 - &:checked { 102 - > * { 103 - @include button-active; 104 - } 98 + &:active, 99 + &.active, 100 + &.on, 101 + &:checked { 102 + > * { 103 + @include button-active; 104 + } 105 105 106 - &:hover > * { 107 - box-shadow: 108 - inset 0 0 0 $border-width $border-color, 109 - inset 0 0 0 99px $hover; 110 - } 111 - } 112 - } 106 + &:hover > * { 107 + box-shadow: 108 + inset 0 0 0 $border-width $border-color, 109 + inset 0 0 0 99px $hover; 110 + } 111 + } 112 + } 113 113 }
+10 -10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/floating-widget.scss
··· 1 1 @mixin floating-widget { 2 - @if $drop-shadow { 3 - box-shadow: 0 0 5px 0 $shadow; 4 - } 2 + @if $drop-shadow { 3 + box-shadow: 0 0 5px 0 $shadow; 4 + } 5 5 6 - transition: $transition; 7 - margin: max($padding, 8px); 8 - border: $border-width solid $popover-border-color; 9 - background-color: $bg-color; 10 - color: $fg-color; 11 - border-radius: $radii; 12 - padding: $popover-padding; 6 + transition: $transition; 7 + margin: max($padding, 8px); 8 + border: $border-width solid $popover-border-color; 9 + background-color: $bg-color; 10 + color: $fg-color; 11 + border-radius: $radii; 12 + padding: $popover-padding; 13 13 }
+12 -12
home/isabel/programs/configs/gui/bars/ags/config/scss/common/hidden.scss
··· 1 1 @mixin hidden { 2 - background-color: transparent; 3 - background-image: none; 4 - border-color: transparent; 5 - box-shadow: none; 6 - -gtk-icon-transform: scale(0); 2 + background-color: transparent; 3 + background-image: none; 4 + border-color: transparent; 5 + box-shadow: none; 6 + -gtk-icon-transform: scale(0); 7 7 8 - * { 9 - background-color: transparent; 10 - background-image: none; 11 - border-color: transparent; 12 - box-shadow: none; 13 - -gtk-icon-transform: scale(0); 14 - } 8 + * { 9 + background-color: transparent; 10 + background-image: none; 11 + border-color: transparent; 12 + box-shadow: none; 13 + -gtk-icon-transform: scale(0); 14 + } 15 15 }
+24 -24
home/isabel/programs/configs/gui/bars/ags/config/scss/common/menu.scss
··· 1 1 window.popup { 2 - > * { 3 - border: none; 4 - box-shadow: none; 5 - } 2 + > * { 3 + border: none; 4 + box-shadow: none; 5 + } 6 6 7 - menu { 8 - border-radius: $popover-radius; 9 - background-color: $bg-color; 10 - padding: $popover-padding; 11 - border: $border-width solid $popover-border-color; 7 + menu { 8 + border-radius: $popover-radius; 9 + background-color: $bg-color; 10 + padding: $popover-padding; 11 + border: $border-width solid $popover-border-color; 12 12 13 - separator { 14 - background-color: $border-color; 15 - } 13 + separator { 14 + background-color: $border-color; 15 + } 16 16 17 - menuitem { 18 - @include button; 19 - padding: $spacing/2; 20 - margin: $spacing/2 0; 17 + menuitem { 18 + @include button; 19 + padding: $spacing/2; 20 + margin: $spacing/2 0; 21 21 22 - &:first-child { 23 - margin-top: 0; 24 - } 22 + &:first-child { 23 + margin-top: 0; 24 + } 25 25 26 - &:last-child { 27 - margin-bottom: 0; 28 - } 29 - } 30 - } 26 + &:last-child { 27 + margin-bottom: 0; 28 + } 29 + } 30 + } 31 31 }
+22 -22
home/isabel/programs/configs/gui/bars/ags/config/scss/common/scrollable.scss
··· 1 1 @mixin scrollable { 2 - scrollbar, 3 - scrollbar * { 4 - all: unset; 5 - } 2 + scrollbar, 3 + scrollbar * { 4 + all: unset; 5 + } 6 6 7 - scrollbar.vertical { 8 - transition: $transition; 9 - background-color: transparentize($bg-color, 0.7); 7 + scrollbar.vertical { 8 + transition: $transition; 9 + background-color: transparentize($bg-color, 0.7); 10 10 11 - &:hover { 12 - background-color: transparentize($bg-color, 0.3); 11 + &:hover { 12 + background-color: transparentize($bg-color, 0.3); 13 13 14 - slider { 15 - background-color: transparentize($fg-color, 0.3); 16 - min-width: 0.6em; 17 - } 18 - } 19 - } 14 + slider { 15 + background-color: transparentize($fg-color, 0.3); 16 + min-width: 0.6em; 17 + } 18 + } 19 + } 20 20 21 - scrollbar.vertical slider { 22 - background-color: transparentize($fg-color, 0.5); 23 - border-radius: $radii; 24 - min-width: 0.4em; 25 - min-height: 2em; 26 - transition: $transition; 27 - } 21 + scrollbar.vertical slider { 22 + background-color: transparentize($fg-color, 0.5); 23 + border-radius: $radii; 24 + min-width: 0.4em; 25 + min-height: 2em; 26 + transition: $transition; 27 + } 28 28 }
+65 -65
home/isabel/programs/configs/gui/bars/ags/config/scss/common/slider.scss
··· 1 1 @import "./unset"; 2 2 3 3 @mixin slider( 4 - $width: 0.7em, 5 - $slider-width: 0.5em, 6 - $gradient: $active-gradient, 7 - $slider: true, 8 - $focusable: true, 9 - $radii: $radii 4 + $width: 0.7em, 5 + $slider-width: 0.5em, 6 + $gradient: $active-gradient, 7 + $slider: true, 8 + $focusable: true, 9 + $radii: $radii 10 10 ) { 11 - @include unset($rec: true); 11 + @include unset($rec: true); 12 12 13 - trough { 14 - transition: $transition; 15 - border-radius: $radii; 16 - border: $border; 17 - background-color: $widget-bg; 18 - min-height: $width; 19 - min-width: $width; 13 + trough { 14 + transition: $transition; 15 + border-radius: $radii; 16 + border: $border; 17 + background-color: $widget-bg; 18 + min-height: $width; 19 + min-width: $width; 20 20 21 - highlight, 22 - progress { 23 - border-radius: max($radii - $border-width, 0); 24 - background-image: $gradient; 25 - min-height: $width; 26 - min-width: $width; 27 - } 28 - } 21 + highlight, 22 + progress { 23 + border-radius: max($radii - $border-width, 0); 24 + background-image: $gradient; 25 + min-height: $width; 26 + min-width: $width; 27 + } 28 + } 29 29 30 - slider { 31 - box-shadow: none; 32 - background-color: transparent; 33 - border: $border-width solid transparent; 34 - transition: $transition; 35 - border-radius: $radii; 36 - min-height: $width; 37 - min-width: $width; 38 - margin: -$slider-width; 39 - } 30 + slider { 31 + box-shadow: none; 32 + background-color: transparent; 33 + border: $border-width solid transparent; 34 + transition: $transition; 35 + border-radius: $radii; 36 + min-height: $width; 37 + min-width: $width; 38 + margin: -$slider-width; 39 + } 40 40 41 - &:hover { 42 - trough { 43 - background-color: $hover; 44 - } 41 + &:hover { 42 + trough { 43 + background-color: $hover; 44 + } 45 45 46 - slider { 47 - @if $slider { 48 - background-color: $fg-color; 49 - border-color: $border-color; 46 + slider { 47 + @if $slider { 48 + background-color: $fg-color; 49 + border-color: $border-color; 50 50 51 - @if $drop-shadow { 52 - box-shadow: 0 0 3px 0 $shadow; 53 - } 54 - } 55 - } 56 - } 51 + @if $drop-shadow { 52 + box-shadow: 0 0 3px 0 $shadow; 53 + } 54 + } 55 + } 56 + } 57 57 58 - &:disabled { 59 - highlight, 60 - progress { 61 - background-color: transparentize($fg-color, 0.4); 62 - background-image: none; 63 - } 64 - } 58 + &:disabled { 59 + highlight, 60 + progress { 61 + background-color: transparentize($fg-color, 0.4); 62 + background-image: none; 63 + } 64 + } 65 65 66 - @if $focusable { 67 - trough:focus { 68 - background-color: $hover; 69 - box-shadow: inset 0 0 0 $border-width $accent; 66 + @if $focusable { 67 + trough:focus { 68 + background-color: $hover; 69 + box-shadow: inset 0 0 0 $border-width $accent; 70 70 71 - slider { 72 - @if $slider { 73 - background-color: $fg-color; 74 - box-shadow: inset 0 0 0 $border-width $accent; 75 - } 76 - } 77 - } 78 - } 71 + slider { 72 + @if $slider { 73 + background-color: $fg-color; 74 + box-shadow: inset 0 0 0 $border-width $accent; 75 + } 76 + } 77 + } 78 + } 79 79 }
+40 -40
home/isabel/programs/configs/gui/bars/ags/config/scss/common/spacing.scss
··· 1 1 @mixin spacing($multiplier: 1, $spacing: $spacing, $rec: false) { 2 - &.horizontal > * { 3 - margin: 0 $spacing * $multiplier / 2; 2 + &.horizontal > * { 3 + margin: 0 $spacing * $multiplier / 2; 4 4 5 - &:first-child { 6 - margin-left: 0; 7 - } 5 + &:first-child { 6 + margin-left: 0; 7 + } 8 8 9 - &:last-child { 10 - margin-right: 0; 11 - } 12 - } 9 + &:last-child { 10 + margin-right: 0; 11 + } 12 + } 13 13 14 - &.vertical > * { 15 - margin: $spacing * $multiplier / 2 0; 14 + &.vertical > * { 15 + margin: $spacing * $multiplier / 2 0; 16 16 17 - &:first-child { 18 - margin-top: 0; 19 - } 17 + &:first-child { 18 + margin-top: 0; 19 + } 20 20 21 - &:last-child { 22 - margin-bottom: 0; 23 - } 24 - } 21 + &:last-child { 22 + margin-bottom: 0; 23 + } 24 + } 25 25 26 - @if $rec { 27 - box { 28 - &.horizontal > * { 29 - margin: 0 $spacing * $multiplier / 2; 26 + @if $rec { 27 + box { 28 + &.horizontal > * { 29 + margin: 0 $spacing * $multiplier / 2; 30 30 31 - &:first-child { 32 - margin-left: 0; 33 - } 31 + &:first-child { 32 + margin-left: 0; 33 + } 34 34 35 - &:last-child { 36 - margin-right: 0; 37 - } 38 - } 35 + &:last-child { 36 + margin-right: 0; 37 + } 38 + } 39 39 40 - &.vertical > * { 41 - margin: $spacing * $multiplier / 2 0; 40 + &.vertical > * { 41 + margin: $spacing * $multiplier / 2 0; 42 42 43 - &:first-child { 44 - margin-top: 0; 45 - } 43 + &:first-child { 44 + margin-top: 0; 45 + } 46 46 47 - &:last-child { 48 - margin-bottom: 0; 49 - } 50 - } 51 - } 52 - } 47 + &:last-child { 48 + margin-bottom: 0; 49 + } 50 + } 51 + } 52 + } 53 53 }
+10 -10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/switch.scss
··· 1 1 @import "./button"; 2 2 3 3 @mixin switch { 4 - @include button; 4 + @include button; 5 5 6 - slider { 7 - background-color: $fg-color; 8 - border-radius: $radii; 9 - min-width: 24px; 10 - min-height: 24px; 11 - } 6 + slider { 7 + background-color: $fg-color; 8 + border-radius: $radii; 9 + min-width: 24px; 10 + min-height: 24px; 11 + } 12 12 13 - image { 14 - color: transparent; 15 - } 13 + image { 14 + color: transparent; 15 + } 16 16 }
+10 -10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/text-border.scss
··· 1 1 @mixin text-border { 2 - text-shadow: 3 - -1 * $border-width -1 * $border-width 0 $border-color, 4 - $border-width $border-width 0 $border-color, 5 - -1 * $border-width $border-width 0 $border-color, 6 - $border-width -1 * $border-width 0 $border-color; 2 + text-shadow: 3 + -1 * $border-width -1 * $border-width 0 $border-color, 4 + $border-width $border-width 0 $border-color, 5 + -1 * $border-width $border-width 0 $border-color, 6 + $border-width -1 * $border-width 0 $border-color; 7 7 8 - -gtk-icon-shadow: 9 - -1 * $border-width -1 * $border-width 0 $border-color, 10 - $border-width $border-width 0 $border-color, 11 - -1 * $border-width $border-width 0 $border-color, 12 - $border-width -1 * $border-width 0 $border-color; 8 + -gtk-icon-shadow: 9 + -1 * $border-width -1 * $border-width 0 $border-color, 10 + $border-width $border-width 0 $border-color, 11 + -1 * $border-width $border-width 0 $border-color, 12 + $border-width -1 * $border-width 0 $border-color; 13 13 }
+14 -14
home/isabel/programs/configs/gui/bars/ags/config/scss/common/tooltip.scss
··· 1 1 tooltip { 2 - * { 3 - all: unset; 4 - } 2 + * { 3 + all: unset; 4 + } 5 5 6 - background-color: transparent; 7 - border: none; 6 + background-color: transparent; 7 + border: none; 8 8 9 - > * > * { 10 - background-color: $bg-color; 11 - border-radius: $radii; 12 - border: $border-width solid $popover-border-color; 13 - color: $fg-color; 14 - padding: 8px; 15 - margin: 4px; 16 - box-shadow: 0 0 3px 0 $shadow; 17 - } 9 + > * > * { 10 + background-color: $bg-color; 11 + border-radius: $radii; 12 + border: $border-width solid $popover-border-color; 13 + color: $fg-color; 14 + padding: 8px; 15 + margin: 4px; 16 + box-shadow: 0 0 3px 0 $shadow; 17 + } 18 18 }
+6 -6
home/isabel/programs/configs/gui/bars/ags/config/scss/common/unset.scss
··· 1 1 @mixin unset($rec: false) { 2 - all: unset; 2 + all: unset; 3 3 4 - @if $rec { 5 - * { 6 - all: unset; 7 - } 8 - } 4 + @if $rec { 5 + * { 6 + all: unset; 7 + } 8 + } 9 9 }
+5 -5
home/isabel/programs/configs/gui/bars/ags/config/scss/common/widget.scss
··· 1 1 @mixin widget { 2 - transition: $transition; 3 - border-radius: $radii; 4 - color: $fg-color; 5 - background-color: $widget-bg; 6 - border: $border; 2 + transition: $transition; 3 + border-radius: $radii; 4 + color: $fg-color; 5 + background-color: $widget-bg; 6 + border: $border; 7 7 }
+6 -6
home/isabel/programs/configs/gui/bars/ags/config/scss/variables.scss
··· 3 3 $active-gradient: linear-gradient($accent-gradient); 4 4 5 5 $hover-fg: if( 6 - $color-scheme == "dark", 7 - lighten($fg-color, 10%), 8 - darken($fg-color, 8%) 6 + $color-scheme == "dark", 7 + lighten($fg-color, 10%), 8 + darken($fg-color, 8%) 9 9 ); 10 10 11 11 $border_color: transparentize($_border_color, $border_opacity / 100); ··· 14 14 $text-shadow: 2px 2px 2px $shadow; 15 15 16 16 $popover-border-color: transparentize( 17 - $_border-color, 18 - max(($border-opacity - 1) / 100, 0) 17 + $_border-color, 18 + max(($border-opacity - 1) / 100, 0) 19 19 ); 20 20 $popover-padding: $padding * $popover-padding-multiplier; 21 21 $popover-radius: if($radii ==0, 0, $radii + $popover-padding); ··· 23 23 $shader-fg: #fff; 24 24 25 25 * { 26 - font-size: $font-size; 26 + font-size: $font-size; 27 27 }
+56 -56
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/applauncher.scss
··· 1 1 window#applauncher .window-content { 2 - @include floating_widget; 2 + @include floating_widget; 3 3 4 - entry { 5 - @include button; 6 - padding: $padding; 7 - margin-bottom: $spacing; 4 + entry { 5 + @include button; 6 + padding: $padding; 7 + margin-bottom: $spacing; 8 8 9 - label, 10 - image { 11 - color: $fg-color; 12 - } 13 - } 9 + label, 10 + image { 11 + color: $fg-color; 12 + } 13 + } 14 14 15 - separator { 16 - min-height: 1px; 17 - background-color: $hover; 18 - } 15 + separator { 16 + min-height: 1px; 17 + background-color: $hover; 18 + } 19 19 20 - scrolledwindow { 21 - @include scrollable; 22 - min-width: $applauncher-width; 23 - min-height: $applauncher-height; 24 - } 20 + scrolledwindow { 21 + @include scrollable; 22 + min-width: $applauncher-width; 23 + min-height: $applauncher-height; 24 + } 25 25 26 - button.app-item { 27 - @include button($flat: true, $reactive: false); 26 + button.app-item { 27 + @include button($flat: true, $reactive: false); 28 28 29 - > box { 30 - @include spacing(0.5); 31 - } 29 + > box { 30 + @include spacing(0.5); 31 + } 32 32 33 - transition: $transition; 34 - padding: $padding; 33 + transition: $transition; 34 + padding: $padding; 35 35 36 - label { 37 - transition: $transition; 36 + label { 37 + transition: $transition; 38 38 39 - &.title { 40 - color: $fg-color; 41 - } 39 + &.title { 40 + color: $fg-color; 41 + } 42 42 43 - &.description { 44 - color: transparentize($fg-color, 0.3); 45 - } 46 - } 43 + &.description { 44 + color: transparentize($fg-color, 0.3); 45 + } 46 + } 47 47 48 - image { 49 - transition: $transition; 50 - } 48 + image { 49 + transition: $transition; 50 + } 51 51 52 - &:hover, 53 - &:focus { 54 - .title { 55 - color: $accent; 56 - } 52 + &:hover, 53 + &:focus { 54 + .title { 55 + color: $accent; 56 + } 57 57 58 - image { 59 - -gtk-icon-shadow: 2px 2px $accent; 60 - } 61 - } 58 + image { 59 + -gtk-icon-shadow: 2px 2px $accent; 60 + } 61 + } 62 62 63 - &:active { 64 - background-color: transparentize($accent, 0.5); 65 - border-radius: $radii; 66 - box-shadow: inset 0 0 0 $border-width $border-color; 63 + &:active { 64 + background-color: transparentize($accent, 0.5); 65 + border-radius: $radii; 66 + box-shadow: inset 0 0 0 $border-width $border-color; 67 67 68 - .title { 69 - color: $fg-color; 70 - } 71 - } 72 - } 68 + .title { 69 + color: $fg-color; 70 + } 71 + } 72 + } 73 73 }
+219 -219
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/bar.scss
··· 1 1 $bar-spacing: $spacing / 1.5; 2 2 $button-radius: if( 3 - $bar-style == "floating", 4 - max(0, $radii - $bar-spacing), 5 - $radii 3 + $bar-style == "floating", 4 + max(0, $radii - $bar-spacing), 5 + $radii 6 6 ); 7 7 8 8 @mixin panel-button($flat: $bar-flat-buttons, $reactive: true) { 9 - @include unset; 9 + @include unset; 10 10 11 - @if $bar-style == "separated" { 12 - transition: $transition; 11 + @if $bar-style == "separated" { 12 + transition: $transition; 13 13 14 - > * { 15 - @include floating-widget; 16 - border-radius: $radii; 17 - margin: $wm-gaps $bar-spacing; 18 - transition: $transition; 19 - } 14 + > * { 15 + @include floating-widget; 16 + border-radius: $radii; 17 + margin: $wm-gaps $bar-spacing; 18 + transition: $transition; 19 + } 20 20 21 - &:hover > * { 22 - color: $hover-fg; 21 + &:hover > * { 22 + color: $hover-fg; 23 23 24 - @if $drop-shadow { 25 - box-shadow: 26 - 0 0 min(6px, $spacing/2) 0 $shadow, 27 - inset 0 0 0 99px $hover; 28 - } @else { 29 - box-shadow: inset 0 0 0 99px $hover; 30 - } 31 - } 24 + @if $drop-shadow { 25 + box-shadow: 26 + 0 0 min(6px, $spacing/2) 0 $shadow, 27 + inset 0 0 0 99px $hover; 28 + } @else { 29 + box-shadow: inset 0 0 0 99px $hover; 30 + } 31 + } 32 32 33 - &:active > *, 34 - &.active > * { 35 - label, 36 - image { 37 - color: $accent-fg; 38 - } 33 + &:active > *, 34 + &.active > * { 35 + label, 36 + image { 37 + color: $accent-fg; 38 + } 39 39 40 - background-image: $active-gradient; 41 - background-color: $accent; 42 - } 43 - } @else { 44 - @include accs-button($flat, $reactive); 40 + background-image: $active-gradient; 41 + background-color: $accent; 42 + } 43 + } @else { 44 + @include accs-button($flat, $reactive); 45 45 46 - > * { 47 - margin: $bar-spacing; 48 - border-radius: $button-radius; 49 - } 50 - } 46 + > * { 47 + margin: $bar-spacing; 48 + border-radius: $button-radius; 49 + } 50 + } 51 51 52 - label, 53 - image { 54 - font-weight: bold; 55 - } 52 + label, 53 + image { 54 + font-weight: bold; 55 + } 56 56 57 - > * { 58 - padding: $padding * 0.4 $padding * 0.7; 59 - } 57 + > * { 58 + padding: $padding * 0.4 $padding * 0.7; 59 + } 60 60 } 61 61 62 62 .panel { 63 - @if $bar-style == "normal" { 64 - background-color: $bg-color; 65 - } 63 + @if $bar-style == "normal" { 64 + background-color: $bg-color; 65 + } 66 66 67 - @if $bar-style == "normal" { 68 - @if $bar-position == "bottom" { 69 - border-top: $border; 70 - } @else { 71 - border-bottom: $border; 72 - } 73 - } 67 + @if $bar-style == "normal" { 68 + @if $bar-position == "bottom" { 69 + border-top: $border; 70 + } @else { 71 + border-bottom: $border; 72 + } 73 + } 74 74 75 - @if $bar-style == "floating" { 76 - @include floating-widget; 77 - border-radius: $radii; 78 - margin: $wm-gaps; 79 - padding: 0; 80 - } 75 + @if $bar-style == "floating" { 76 + @include floating-widget; 77 + border-radius: $radii; 78 + margin: $wm-gaps; 79 + padding: 0; 80 + } 81 81 82 - @if $bar-style == "separated" { 83 - > .end > button:last-child > * { 84 - margin-right: $wm-gaps; 85 - } 82 + @if $bar-style == "separated" { 83 + > .end > button:last-child > * { 84 + margin-right: $wm-gaps; 85 + } 86 86 87 - > .start > button:first-child > * { 88 - margin-left: $wm-gaps; 89 - } 90 - } 87 + > .start > button:first-child > * { 88 + margin-left: $wm-gaps; 89 + } 90 + } 91 91 92 - .panel-button { 93 - @include panel-button; 94 - } 92 + .panel-button { 93 + @include panel-button; 94 + } 95 95 96 - .tray-item, 97 - .color-picker { 98 - @include panel-button($flat: true); 99 - } 96 + .tray-item, 97 + .color-picker { 98 + @include panel-button($flat: true); 99 + } 100 100 101 - separator { 102 - background-color: transparentize($fg-color, 0.86); 103 - border-radius: $radii; 104 - min-height: 5px; 105 - min-width: 5px; 106 - } 101 + separator { 102 + background-color: transparentize($fg-color, 0.86); 103 + border-radius: $radii; 104 + min-height: 5px; 105 + min-width: 5px; 106 + } 107 107 108 - .overview { 109 - label { 110 - color: transparentize($accent, 0.2); 111 - } 108 + .overview { 109 + label { 110 + color: transparentize($accent, 0.2); 111 + } 112 112 113 - &:hover label { 114 - color: $accent; 115 - } 113 + &:hover label { 114 + color: $accent; 115 + } 116 116 117 - &:active label, 118 - &.active label { 119 - color: $accent-fg; 120 - } 121 - } 117 + &:active label, 118 + &.active label { 119 + color: $accent-fg; 120 + } 121 + } 122 122 123 - .powermenu, 124 - .recorder { 125 - image { 126 - color: transparentize($red, 0.3); 127 - } 123 + .powermenu, 124 + .recorder { 125 + image { 126 + color: transparentize($red, 0.3); 127 + } 128 128 129 - &:hover image { 130 - color: transparentize($red, 0.15); 131 - } 129 + &:hover image { 130 + color: transparentize($red, 0.15); 131 + } 132 132 133 - &:active image { 134 - color: $red; 135 - } 136 - } 133 + &:active image { 134 + color: $red; 135 + } 136 + } 137 137 138 - .focused-client > box > box, 139 - .quicksettings > box { 140 - @include spacing(1, if($bar-spacing ==0, $padding / 2, $bar-spacing)); 141 - } 138 + .focused-client > box > box, 139 + .quicksettings > box { 140 + @include spacing(1, if($bar-spacing ==0, $padding / 2, $bar-spacing)); 141 + } 142 142 143 - /* stylelint-disable-next-line selector-not-notation */ 144 - .quicksettings:not(.active):not(:active) { 145 - .bluetooth { 146 - color: $blue; 147 - } 143 + /* stylelint-disable-next-line selector-not-notation */ 144 + .quicksettings:not(.active):not(:active) { 145 + .bluetooth { 146 + color: $blue; 147 + } 148 148 149 - .battery { 150 - &.low { 151 - color: $red; 152 - } 149 + .battery { 150 + &.low { 151 + color: $red; 152 + } 153 153 154 - &.charged, 155 - &.charging { 156 - color: $green; 157 - } 158 - } 159 - } 154 + &.charged, 155 + &.charging { 156 + color: $green; 157 + } 158 + } 159 + } 160 160 161 - .media { 162 - &.spotify image { 163 - color: $green; 164 - } 161 + .media { 162 + &.spotify image { 163 + color: $green; 164 + } 165 165 166 - &.firefox image { 167 - color: $orange; 168 - } 166 + &.firefox image { 167 + color: $orange; 168 + } 169 169 170 - &.mpv image { 171 - color: $magenta; 172 - } 173 - } 170 + &.mpv image { 171 + color: $magenta; 172 + } 173 + } 174 174 175 - .notifications { 176 - image { 177 - color: $yellow; 178 - } 179 - } 175 + .notifications { 176 + image { 177 + color: $yellow; 178 + } 179 + } 180 180 181 - .battery-bar { 182 - .font-icon { 183 - font-size: 1.3em; 184 - } 181 + .battery-bar { 182 + .font-icon { 183 + font-size: 1.3em; 184 + } 185 185 186 - image, 187 - .font-icon { 188 - margin-right: $bar-spacing * 0.5; 189 - } 186 + image, 187 + .font-icon { 188 + margin-right: $bar-spacing * 0.5; 189 + } 190 190 191 - levelbar trough { 192 - @include widget; 193 - min-width: $battery-bar-width; 194 - min-height: $battery-bar-height; 191 + levelbar trough { 192 + @include widget; 193 + min-width: $battery-bar-width; 194 + min-height: $battery-bar-height; 195 195 196 - block.filled { 197 - border-radius: max($radii - $border-width, 0); 198 - background-image: $active-gradient; 199 - } 200 - } 196 + block.filled { 197 + border-radius: max($radii - $border-width, 0); 198 + background-image: $active-gradient; 199 + } 200 + } 201 201 202 - @mixin color($color) { 203 - image, 204 - label { 205 - color: $color; 206 - } 202 + @mixin color($color) { 203 + image, 204 + label { 205 + color: $color; 206 + } 207 207 208 - block.filled { 209 - background-image: linear-gradient( 210 - to right, 211 - $color, 212 - lighten($color, 6%) 213 - ); 214 - } 215 - } 208 + block.filled { 209 + background-image: linear-gradient( 210 + to right, 211 + $color, 212 + lighten($color, 6%) 213 + ); 214 + } 215 + } 216 216 217 - .medium { 218 - @include color($yellow); 219 - } 217 + .medium { 218 + @include color($yellow); 219 + } 220 220 221 - .low { 222 - @include color($red); 223 - } 221 + .low { 222 + @include color($red); 223 + } 224 224 225 - .charging { 226 - @include color($green); 227 - } 225 + .charging { 226 + @include color($green); 227 + } 228 228 229 - &:active { 230 - @include color($accent-fg); 231 - } 232 - } 229 + &:active { 230 + @include color($accent-fg); 231 + } 232 + } 233 233 234 - .workspaces button { 235 - all: unset; 234 + .workspaces button { 235 + all: unset; 236 236 237 - .indicator { 238 - font-size: 0; 239 - min-width: 8px; 240 - min-height: 8px; 241 - border-radius: $radii * 0.6; 242 - box-shadow: inset 0 0 0 $border-width $border-color; 243 - margin: 0 $padding/2; 244 - transition: $transition/2; 245 - background-color: transparentize($fg-color, 0.8); 246 - } 237 + .indicator { 238 + font-size: 0; 239 + min-width: 8px; 240 + min-height: 8px; 241 + border-radius: $radii * 0.6; 242 + box-shadow: inset 0 0 0 $border-width $border-color; 243 + margin: 0 $padding/2; 244 + transition: $transition/2; 245 + background-color: transparentize($fg-color, 0.8); 246 + } 247 247 248 - &:last-child .indicator { 249 - margin-right: $padding; 250 - } 248 + &:last-child .indicator { 249 + margin-right: $padding; 250 + } 251 251 252 - &:first-child .indicator { 253 - margin-left: $padding; 254 - } 252 + &:first-child .indicator { 253 + margin-left: $padding; 254 + } 255 255 256 - &.occupied .indicator { 257 - background-color: transparentize($fg-color, 0.2); 258 - min-width: 10px; 259 - min-height: 10px; 260 - } 256 + &.occupied .indicator { 257 + background-color: transparentize($fg-color, 0.2); 258 + min-width: 10px; 259 + min-height: 10px; 260 + } 261 261 262 - &:hover .indicator { 263 - box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8); 264 - } 262 + &:hover .indicator { 263 + box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8); 264 + } 265 265 266 - &.active .indicator, 267 - &:active .indicator { 268 - background-color: $accent; 269 - } 266 + &.active .indicator, 267 + &:active .indicator { 268 + background-color: $accent; 269 + } 270 270 271 - &.active .indicator { 272 - min-width: 24px; 273 - min-height: 16px; 274 - } 275 - } 271 + &.active .indicator { 272 + min-width: 24px; 273 + min-height: 16px; 274 + } 275 + } 276 276 }
+102 -102
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/dashboard.scss
··· 1 1 @mixin calendar { 2 - @include widget; 3 - padding: $padding * 2 $padding * 2 0; 2 + @include widget; 3 + padding: $padding * 2 $padding * 2 0; 4 4 5 - calendar { 6 - all: unset; 5 + calendar { 6 + all: unset; 7 7 8 - &.button { 9 - @include button($flat: true); 10 - } 8 + &.button { 9 + @include button($flat: true); 10 + } 11 11 12 - &:selected { 13 - box-shadow: 14 - inset 0 -8px 0 0 transparentize($accent, 0.5), 15 - inset 0 0 0 1px $accent; 16 - border-radius: $radii * 0.6; 17 - } 12 + &:selected { 13 + box-shadow: 14 + inset 0 -8px 0 0 transparentize($accent, 0.5), 15 + inset 0 0 0 1px $accent; 16 + border-radius: $radii * 0.6; 17 + } 18 18 19 - &.header { 20 - background-color: transparent; 21 - border: none; 22 - color: transparentize($fg-color, 0.5); 23 - } 19 + &.header { 20 + background-color: transparent; 21 + border: none; 22 + color: transparentize($fg-color, 0.5); 23 + } 24 24 25 - &.highlight { 26 - background-color: transparent; 27 - color: transparentize($accent, 0.5); 28 - } 25 + &.highlight { 26 + background-color: transparent; 27 + color: transparentize($accent, 0.5); 28 + } 29 29 30 - &:indeterminate { 31 - color: transparentize($fg-color, 0.9); 32 - } 30 + &:indeterminate { 31 + color: transparentize($fg-color, 0.9); 32 + } 33 33 34 - font-size: 1.1em; 35 - padding: 0.2em; 36 - } 34 + font-size: 1.1em; 35 + padding: 0.2em; 36 + } 37 37 } 38 38 39 39 window#dashboard .window-content { 40 - @include floating-widget; 40 + @include floating-widget; 41 41 42 - .notifications { 43 - min-width: $notifications-width; 42 + .notifications { 43 + min-width: $notifications-width; 44 44 45 - .header { 46 - margin-bottom: $spacing; 47 - margin-right: $spacing; 45 + .header { 46 + margin-bottom: $spacing; 47 + margin-right: $spacing; 48 48 49 - > label { 50 - margin-left: $radii / 2; 51 - } 49 + > label { 50 + margin-left: $radii / 2; 51 + } 52 52 53 - button { 54 - @include button; 55 - padding: $padding/2 $padding; 56 - } 57 - } 53 + button { 54 + @include button; 55 + padding: $padding/2 $padding; 56 + } 57 + } 58 58 59 - .notification-scrollable { 60 - @include scrollable; 61 - } 59 + .notification-scrollable { 60 + @include scrollable; 61 + } 62 62 63 - .notification-list { 64 - margin-right: $spacing; 65 - } 63 + .notification-list { 64 + margin-right: $spacing; 65 + } 66 66 67 - .notification { 68 - @include notification; 67 + .notification { 68 + @include notification; 69 69 70 - > box { 71 - @include widget; 72 - padding: $padding; 73 - margin-bottom: $spacing; 74 - } 75 - } 70 + > box { 71 + @include widget; 72 + padding: $padding; 73 + margin-bottom: $spacing; 74 + } 75 + } 76 76 77 - .placeholder { 78 - image { 79 - font-size: 7em; 80 - } 77 + .placeholder { 78 + image { 79 + font-size: 7em; 80 + } 81 81 82 - label { 83 - font-size: 1.2em; 84 - } 85 - } 86 - } 82 + label { 83 + font-size: 1.2em; 84 + } 85 + } 86 + } 87 87 88 - separator { 89 - background-color: $popover-border-color; 90 - min-width: 2px; 91 - border-radius: $radii; 92 - margin-right: $spacing; 93 - } 88 + separator { 89 + background-color: $popover-border-color; 90 + min-width: 2px; 91 + border-radius: $radii; 92 + margin-right: $spacing; 93 + } 94 94 95 - .datemenu, 96 - .system-info { 97 - @include spacing; 98 - } 95 + .datemenu, 96 + .system-info { 97 + @include spacing; 98 + } 99 99 100 - .clock-box { 101 - padding: $padding; 100 + .clock-box { 101 + padding: $padding; 102 102 103 - .clock { 104 - font-size: 5em; 105 - } 103 + .clock { 104 + font-size: 5em; 105 + } 106 106 107 - .uptime { 108 - color: transparentize($fg-color, 0.2); 109 - } 110 - } 107 + .uptime { 108 + color: transparentize($fg-color, 0.2); 109 + } 110 + } 111 111 112 - .calendar { 113 - @include calendar; 114 - } 112 + .calendar { 113 + @include calendar; 114 + } 115 115 116 - .circular-progress-box { 117 - @include widget; 118 - padding: $padding; 116 + .circular-progress-box { 117 + @include widget; 118 + padding: $padding; 119 119 120 - .circular-progress { 121 - min-height: $sys-info-size; 122 - min-width: $sys-info-size; 123 - margin: $padding/2; 124 - font-size: $padding; 125 - background-color: $bg-color; 126 - color: $accent; 120 + .circular-progress { 121 + min-height: $sys-info-size; 122 + min-width: $sys-info-size; 123 + margin: $padding/2; 124 + font-size: $padding; 125 + background-color: $bg-color; 126 + color: $accent; 127 127 128 - image { 129 - font-size: 1.8em; 130 - } 131 - } 132 - } 128 + image { 129 + font-size: 1.8em; 130 + } 131 + } 132 + } 133 133 }
+57 -57
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/desktop.scss
··· 1 1 window.desktop { 2 - @if $bar-style == "normal" { 3 - box-shadow: inset 0 0 $padding 0 $shadow; 4 - } 2 + @if $bar-style == "normal" { 3 + box-shadow: inset 0 0 $padding 0 $shadow; 4 + } 5 5 6 - .clock-box-shadow { 7 - border: 5px solid $wallpaper-fg; 8 - border-radius: $radii; 6 + .clock-box-shadow { 7 + border: 5px solid $wallpaper-fg; 8 + border-radius: $radii; 9 9 10 - .clock-box { 11 - border-radius: max($radii - 5px, 0); 12 - padding: 0 14px; 10 + .clock-box { 11 + border-radius: max($radii - 5px, 0); 12 + padding: 0 14px; 13 13 14 - .clock { 15 - color: $wallpaper-fg; 16 - font-size: 140px; 17 - font-family: $mono-font; 18 - } 14 + .clock { 15 + color: $wallpaper-fg; 16 + font-size: 140px; 17 + font-family: $mono-font; 18 + } 19 19 20 - .separator-box { 21 - padding: 24px 12px; 20 + .separator-box { 21 + padding: 24px 12px; 22 22 23 - separator { 24 - border-radius: $radii; 25 - min-width: 16px; 26 - min-height: 16px; 27 - background-color: $wallpaper-fg; 28 - } 29 - } 30 - } 31 - } 23 + separator { 24 + border-radius: $radii; 25 + min-width: 16px; 26 + min-height: 16px; 27 + background-color: $wallpaper-fg; 28 + } 29 + } 30 + } 31 + } 32 32 33 - .date { 34 - color: $wallpaper-fg; 35 - font-size: 48px; 36 - } 33 + .date { 34 + color: $wallpaper-fg; 35 + font-size: 48px; 36 + } 37 37 38 - @if $drop-shadow { 39 - .clock-box-shadow, 40 - separator { 41 - box-shadow: 2px 2px 2px 0 $shadow; 42 - } 38 + @if $drop-shadow { 39 + .clock-box-shadow, 40 + separator { 41 + box-shadow: 2px 2px 2px 0 $shadow; 42 + } 43 43 44 - .clock-box { 45 - box-shadow: inset 2px 2px 2px 0 $shadow; 46 - } 44 + .clock-box { 45 + box-shadow: inset 2px 2px 2px 0 $shadow; 46 + } 47 47 48 - label { 49 - text-shadow: $text-shadow; 50 - } 51 - } @else { 52 - .clock-box-shadow { 53 - box-shadow: 54 - 0 0 0 $border-width $border-color, 55 - inset 0 0 0 $border-width $border-color; 56 - } 48 + label { 49 + text-shadow: $text-shadow; 50 + } 51 + } @else { 52 + .clock-box-shadow { 53 + box-shadow: 54 + 0 0 0 $border-width $border-color, 55 + inset 0 0 0 $border-width $border-color; 56 + } 57 57 58 - separator { 59 - border: $border; 60 - } 58 + separator { 59 + border: $border; 60 + } 61 61 62 - label { 63 - @include text-border; 64 - } 65 - } 62 + label { 63 + @include text-border; 64 + } 65 + } 66 66 } 67 67 68 68 .desktop-menu { 69 - image { 70 - margin-left: -14px; 71 - margin-right: 6px; 72 - } 69 + image { 70 + margin-left: -14px; 71 + margin-right: 6px; 72 + } 73 73 }
+95 -95
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/media.scss
··· 1 1 @mixin player-color($color) { 2 - button { 3 - .shuffle.enabled { 4 - color: $color; 5 - } 2 + button { 3 + .shuffle.enabled { 4 + color: $color; 5 + } 6 6 7 - .loop { 8 - &.playlist, 9 - &.track { 10 - color: $color; 11 - } 12 - } 7 + .loop { 8 + &.playlist, 9 + &.track { 10 + color: $color; 11 + } 12 + } 13 13 14 - &:active label { 15 - color: $color; 16 - } 17 - } 14 + &:active label { 15 + color: $color; 16 + } 17 + } 18 18 19 - .position-slider:hover trough { 20 - background-color: transparentize($color, 0.5); 21 - } 19 + .position-slider:hover trough { 20 + background-color: transparentize($color, 0.5); 21 + } 22 22 23 - .player-icon { 24 - color: $color; 25 - } 23 + .player-icon { 24 + color: $color; 25 + } 26 26 } 27 27 28 28 @mixin media() { 29 - @include widget; 29 + @include widget; 30 30 31 - label { 32 - color: $shader-fg; 33 - text-shadow: $text-shadow; 34 - } 31 + label { 32 + color: $shader-fg; 33 + text-shadow: $text-shadow; 34 + } 35 35 36 - .blurred-cover, 37 - .cover { 38 - background-size: cover; 39 - background-position: center; 40 - border-radius: $radii * 0.8; 41 - opacity: 0.8; 42 - } 36 + .blurred-cover, 37 + .cover { 38 + background-size: cover; 39 + background-position: center; 40 + border-radius: $radii * 0.8; 41 + opacity: 0.8; 42 + } 43 43 44 - .cover { 45 - min-height: 100px; 46 - min-width: 100px; 47 - box-shadow: 2px 2px 2px 0 $shadow; 48 - margin: $padding; 49 - opacity: 0.9; 50 - } 44 + .cover { 45 + min-height: 100px; 46 + min-width: 100px; 47 + box-shadow: 2px 2px 2px 0 $shadow; 48 + margin: $padding; 49 + opacity: 0.9; 50 + } 51 51 52 - .labels { 53 - margin-top: $padding; 52 + .labels { 53 + margin-top: $padding; 54 54 55 - label { 56 - font-size: 1.1em; 57 - text-shadow: $text-shadow; 55 + label { 56 + font-size: 1.1em; 57 + text-shadow: $text-shadow; 58 58 59 - &.title { 60 - font-weight: bold; 61 - } 62 - } 63 - } 59 + &.title { 60 + font-weight: bold; 61 + } 62 + } 63 + } 64 64 65 - .position-slider { 66 - @include slider( 67 - $width: 0.4em, 68 - $slider: false, 69 - $gradient: linear-gradient($shader-fg, $shader-fg), 70 - $radii: 0 71 - ); 72 - margin-bottom: $padding/2; 65 + .position-slider { 66 + @include slider( 67 + $width: 0.4em, 68 + $slider: false, 69 + $gradient: linear-gradient($shader-fg, $shader-fg), 70 + $radii: 0 71 + ); 72 + margin-bottom: $padding/2; 73 73 74 - trough { 75 - border: none; 76 - background-color: transparentize($shader-fg, 0.7); 77 - } 78 - } 74 + trough { 75 + border: none; 76 + background-color: transparentize($shader-fg, 0.7); 77 + } 78 + } 79 79 80 - .footer-box { 81 - margin: -$padding/2 $padding $padding/2; 80 + .footer-box { 81 + margin: -$padding/2 $padding $padding/2; 82 82 83 - image { 84 - -gtk-icon-shadow: $text-shadow; 85 - } 86 - } 83 + image { 84 + -gtk-icon-shadow: $text-shadow; 85 + } 86 + } 87 87 88 - .controls button { 89 - @include unset; 88 + .controls button { 89 + @include unset; 90 90 91 - label { 92 - font-size: 2em; 93 - color: transparentize($shader-fg, 0.2); 94 - transition: $transition; 91 + label { 92 + font-size: 2em; 93 + color: transparentize($shader-fg, 0.2); 94 + transition: $transition; 95 95 96 - &.shuffle, 97 - &.loop { 98 - font-size: 1.4em; 99 - } 100 - } 96 + &.shuffle, 97 + &.loop { 98 + font-size: 1.4em; 99 + } 100 + } 101 101 102 - &:hover label { 103 - color: transparentize($shader-fg, 0.1); 104 - } 102 + &:hover label { 103 + color: transparentize($shader-fg, 0.1); 104 + } 105 105 106 - &:active label { 107 - color: $shader-fg; 108 - } 109 - } 106 + &:active label { 107 + color: $shader-fg; 108 + } 109 + } 110 110 111 - &.spotify { 112 - @include player-color($green); 113 - } 111 + &.spotify { 112 + @include player-color($green); 113 + } 114 114 115 - &.firefox { 116 - @include player-color($orange); 117 - } 115 + &.firefox { 116 + @include player-color($orange); 117 + } 118 118 119 - &.mpv { 120 - @include player-color($magenta); 121 - } 119 + &.mpv { 120 + @include player-color($magenta); 121 + } 122 122 }
+62 -62
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/notifications.scss
··· 1 1 @mixin notification() { 2 - &.critical > box { 3 - box-shadow: inset 0 0 0.5em 0 $red; 4 - } 2 + &.critical > box { 3 + box-shadow: inset 0 0 0.5em 0 $red; 4 + } 5 5 6 - &:hover button.close-button { 7 - @include button-hover; 8 - background-color: transparentize($red, 0.5); 9 - } 6 + &:hover button.close-button { 7 + @include button-hover; 8 + background-color: transparentize($red, 0.5); 9 + } 10 10 11 - .content { 12 - .title { 13 - margin-right: $spacing; 14 - color: $fg-color; 15 - font-size: 1.1em; 16 - } 11 + .content { 12 + .title { 13 + margin-right: $spacing; 14 + color: $fg-color; 15 + font-size: 1.1em; 16 + } 17 17 18 - .time { 19 - color: transparentize($fg-color, 0.2); 20 - } 18 + .time { 19 + color: transparentize($fg-color, 0.2); 20 + } 21 21 22 - .description { 23 - font-size: 0.9em; 24 - color: transparentize($fg-color, 0.2); 25 - } 22 + .description { 23 + font-size: 0.9em; 24 + color: transparentize($fg-color, 0.2); 25 + } 26 26 27 - .icon { 28 - border-radius: $radii * 0.8; 29 - margin-right: $spacing; 27 + .icon { 28 + border-radius: $radii * 0.8; 29 + margin-right: $spacing; 30 30 31 - &.img { 32 - border: $border; 33 - } 34 - } 35 - } 31 + &.img { 32 + border: $border; 33 + } 34 + } 35 + } 36 36 37 - box.actions { 38 - @include spacing(0.5); 39 - margin-top: $spacing; 37 + box.actions { 38 + @include spacing(0.5); 39 + margin-top: $spacing; 40 40 41 - button { 42 - @include button; 43 - border-radius: $radii * 0.8; 44 - font-size: 1.2em; 45 - padding: $padding * 0.7; 46 - } 47 - } 41 + button { 42 + @include button; 43 + border-radius: $radii * 0.8; 44 + font-size: 1.2em; 45 + padding: $padding * 0.7; 46 + } 47 + } 48 48 49 - button.close-button { 50 - @include button($flat: true); 51 - margin-left: $spacing / 2; 52 - border-radius: $radii * 0.8; 53 - min-width: 1.2em; 54 - min-height: 1.2em; 49 + button.close-button { 50 + @include button($flat: true); 51 + margin-left: $spacing / 2; 52 + border-radius: $radii * 0.8; 53 + min-width: 1.2em; 54 + min-height: 1.2em; 55 55 56 - &:hover { 57 - background-color: transparentize($red, 0.2); 58 - } 56 + &:hover { 57 + background-color: transparentize($red, 0.2); 58 + } 59 59 60 - &:active { 61 - background-image: linear-gradient($red, $red); 62 - } 63 - } 60 + &:active { 61 + background-image: linear-gradient($red, $red); 62 + } 63 + } 64 64 } 65 65 66 66 window.notifications { 67 - @include unset; 67 + @include unset; 68 68 69 - .notification { 70 - @include notification; 69 + .notification { 70 + @include notification; 71 71 72 - > box { 73 - @include floating-widget; 74 - border-radius: $radii; 75 - } 72 + > box { 73 + @include floating-widget; 74 + border-radius: $radii; 75 + } 76 76 77 - .description { 78 - min-width: 350px; 79 - } 80 - } 77 + .description { 78 + min-width: 350px; 79 + } 80 + } 81 81 }
+14 -14
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/osd.scss
··· 1 1 window.indicator .progress { 2 - @include floating-widget; 3 - padding: $padding / 2; 4 - border-radius: if($radii ==0, 0, $radii + $padding / 2); 2 + @include floating-widget; 3 + padding: $padding / 2; 4 + border-radius: if($radii ==0, 0, $radii + $padding / 2); 5 5 6 - .fill { 7 - border-radius: $radii; 8 - background-color: $accent; 9 - color: $accent-fg; 6 + .fill { 7 + border-radius: $radii; 8 + background-color: $accent; 9 + color: $accent-fg; 10 10 11 - image { 12 - -gtk-icon-transform: scale(0.7); 13 - } 11 + image { 12 + -gtk-icon-transform: scale(0.7); 13 + } 14 14 15 - .font-icon { 16 - font-size: 34px; 17 - } 18 - } 15 + .font-icon { 16 + font-size: 34px; 17 + } 18 + } 19 19 }
+45 -45
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/powermenu.scss
··· 1 1 window#powermenu { 2 - .shader { 3 - background-color: rgba(0, 0, 0, 0.05); 4 - } 2 + .shader { 3 + background-color: rgba(0, 0, 0, 0.05); 4 + } 5 5 } 6 6 7 7 window#powermenu .window-content { 8 - @include floating-widget; 9 - @include spacing(2); 10 - padding: $popover-padding + $spacing * 1.5; 11 - border-radius: if( 12 - $radii ==0, 13 - 0, 14 - $popover-radius + ($popover-padding + $spacing * 1.5) 15 - ); 8 + @include floating-widget; 9 + @include spacing(2); 10 + padding: $popover-padding + $spacing * 1.5; 11 + border-radius: if( 12 + $radii ==0, 13 + 0, 14 + $popover-radius + ($popover-padding + $spacing * 1.5) 15 + ); 16 16 17 - button { 18 - @include unset; 17 + button { 18 + @include unset; 19 19 20 - image { 21 - @include button; 22 - border-radius: $popover-radius; 23 - min-width: 1.7em; 24 - min-height: 1.7em; 25 - font-size: 4em; 26 - } 20 + image { 21 + @include button; 22 + border-radius: $popover-radius; 23 + min-width: 1.7em; 24 + min-height: 1.7em; 25 + font-size: 4em; 26 + } 27 27 28 - label, 29 - image { 30 - color: transparentize($fg-color, 0.1); 31 - } 28 + label, 29 + image { 30 + color: transparentize($fg-color, 0.1); 31 + } 32 32 33 - &:hover { 34 - image { 35 - @include button-hover; 36 - } 33 + &:hover { 34 + image { 35 + @include button-hover; 36 + } 37 37 38 - label { 39 - color: $fg-color; 40 - } 41 - } 38 + label { 39 + color: $fg-color; 40 + } 41 + } 42 42 43 - &:focus image { 44 - @include button-focus; 45 - } 43 + &:focus image { 44 + @include button-focus; 45 + } 46 46 47 - &:active image { 48 - @include button-active; 49 - } 47 + &:active image { 48 + @include button-active; 49 + } 50 50 51 - &:focus, 52 - &:active { 53 - label { 54 - color: $accent; 55 - } 56 - } 57 - } 51 + &:focus, 52 + &:active { 53 + label { 54 + color: $accent; 55 + } 56 + } 57 + } 58 58 }
+132 -132
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/quicksettings.scss
··· 1 1 window#quicksettings .window-content { 2 - @include floating-widget; 3 - @include spacing; 2 + @include floating-widget; 3 + @include spacing; 4 4 5 - .avatar { 6 - @include widget; 7 - } 5 + .avatar { 6 + @include widget; 7 + } 8 8 9 - .header { 10 - @include spacing; 11 - } 9 + .header { 10 + @include spacing; 11 + } 12 12 13 - .system-box { 14 - @include widget; 15 - @include spacing($rec: true); 13 + .system-box { 14 + @include widget; 15 + @include spacing($rec: true); 16 16 17 - padding: $padding; 17 + padding: $padding; 18 18 19 - button, 20 - .uptime { 21 - @include button; 22 - padding: $padding; 23 - font-weight: bold; 24 - min-height: 20px; 25 - min-width: 20px; 19 + button, 20 + .uptime { 21 + @include button; 22 + padding: $padding; 23 + font-weight: bold; 24 + min-height: 20px; 25 + min-width: 20px; 26 26 27 - image { 28 - font-size: 1.2em; 29 - } 30 - } 31 - } 27 + image { 28 + font-size: 1.2em; 29 + } 30 + } 31 + } 32 32 33 - .battery-progress { 34 - label { 35 - color: $accent-fg; 36 - font-weight: bold; 37 - } 33 + .battery-progress { 34 + label { 35 + color: $accent-fg; 36 + font-weight: bold; 37 + } 38 38 39 - &.charging label { 40 - font-size: $padding * 2; 41 - } 39 + &.charging label { 40 + font-size: $padding * 2; 41 + } 42 42 43 - &.half label { 44 - color: $fg-color; 45 - } 43 + &.half label { 44 + color: $fg-color; 45 + } 46 46 47 - progressbar { 48 - @include slider($width: $padding * 3.6); 49 - } 47 + progressbar { 48 + @include slider($width: $padding * 3.6); 49 + } 50 50 51 - &.low progressbar { 52 - @include slider( 53 - $width: $padding * 3.6, 54 - $gradient: linear-gradient(to right, $red, $red) 55 - ); 56 - } 57 - } 51 + &.low progressbar { 52 + @include slider( 53 + $width: $padding * 3.6, 54 + $gradient: linear-gradient(to right, $red, $red) 55 + ); 56 + } 57 + } 58 58 59 - .sliders-box { 60 - @include widget; 61 - @include spacing($rec: true); 62 - @include spacing(0); 63 - padding: $padding; 59 + .sliders-box { 60 + @include widget; 61 + @include spacing($rec: true); 62 + @include spacing(0); 63 + padding: $padding; 64 64 65 - button { 66 - @include button($flat: true); 67 - padding: $padding / 2; 68 - } 65 + button { 66 + @include button($flat: true); 67 + padding: $padding / 2; 68 + } 69 69 70 - scale { 71 - @include slider; 72 - margin-left: $spacing * -0.5; 73 - } 70 + scale { 71 + @include slider; 72 + margin-left: $spacing * -0.5; 73 + } 74 74 75 - .menu { 76 - margin: $spacing 0; 77 - background-color: $bg-color; 78 - border: $border-width solid $popover-border-color; 79 - border-radius: $radii; 80 - } 81 - } 75 + .menu { 76 + margin: $spacing 0; 77 + background-color: $bg-color; 78 + border: $border-width solid $popover-border-color; 79 + border-radius: $radii; 80 + } 81 + } 82 82 83 - .mixer-item { 84 - scale { 85 - @include slider($width: 7px); 86 - } 83 + .mixer-item { 84 + scale { 85 + @include slider($width: 7px); 86 + } 87 87 88 - image { 89 - font-size: 1.2em; 90 - } 91 - } 88 + image { 89 + font-size: 1.2em; 90 + } 91 + } 92 92 93 - .row { 94 - @include spacing($rec: true); 95 - } 93 + .row { 94 + @include spacing($rec: true); 95 + } 96 96 97 - .menu { 98 - @include unset; 99 - @include widget; 100 - @include spacing($rec: true); 101 - padding: $padding; 102 - margin-top: $spacing; 97 + .menu { 98 + @include unset; 99 + @include widget; 100 + @include spacing($rec: true); 101 + padding: $padding; 102 + margin-top: $spacing; 103 103 104 - .title { 105 - @include spacing(0.5); 106 - } 104 + .title { 105 + @include spacing(0.5); 106 + } 107 107 108 - separator { 109 - margin: 0 $radii / 2; 110 - } 108 + separator { 109 + margin: 0 $radii / 2; 110 + } 111 111 112 - button { 113 - @include button($flat: true); 114 - padding: $padding / 2; 115 - } 112 + button { 113 + @include button($flat: true); 114 + padding: $padding / 2; 115 + } 116 116 117 - switch { 118 - @include switch; 119 - } 120 - } 117 + switch { 118 + @include switch; 119 + } 120 + } 121 121 122 - .toggle-button { 123 - @include button; 124 - font-weight: bold; 122 + .toggle-button { 123 + @include button; 124 + font-weight: bold; 125 125 126 - .label-box { 127 - @include spacing(0.5); 128 - } 126 + .label-box { 127 + @include spacing(0.5); 128 + } 129 129 130 - button { 131 - @include button($flat: true); 132 - padding: $padding; 130 + button { 131 + @include button($flat: true); 132 + padding: $padding; 133 133 134 - &:first-child { 135 - border-top-right-radius: 0; 136 - border-bottom-right-radius: 0; 137 - } 134 + &:first-child { 135 + border-top-right-radius: 0; 136 + border-bottom-right-radius: 0; 137 + } 138 138 139 - &:last-child { 140 - border-top-left-radius: 0; 141 - border-bottom-left-radius: 0; 142 - } 143 - } 139 + &:last-child { 140 + border-top-left-radius: 0; 141 + border-bottom-left-radius: 0; 142 + } 143 + } 144 144 145 - &.active { 146 - background-color: $accent; 145 + &.active { 146 + background-color: $accent; 147 147 148 - label, 149 - image { 150 - color: $accent-fg; 151 - } 152 - } 153 - } 148 + label, 149 + image { 150 + color: $accent-fg; 151 + } 152 + } 153 + } 154 154 155 - .simple-toggle { 156 - @include button; 157 - padding: $padding; 158 - } 155 + .simple-toggle { 156 + @include button; 157 + padding: $padding; 158 + } 159 159 160 - .media { 161 - @include spacing; 160 + .media { 161 + @include spacing; 162 162 163 - .player { 164 - @include media; 165 - } 166 - } 163 + .player { 164 + @include media; 165 + } 166 + } 167 167 }
+113 -113
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/settings.scss
··· 1 1 window#settings-dialog { 2 - background-color: $bg-color; 2 + background-color: $bg-color; 3 3 4 - .page { 5 - @include scrollable; 6 - } 4 + .page { 5 + @include scrollable; 6 + } 7 7 8 - .page-content { 9 - margin: $spacing; 10 - } 8 + .page-content { 9 + margin: $spacing; 10 + } 11 11 12 - .sidebar-box { 13 - @include spacing($rec: true); 14 - background-color: $widget-bg; 15 - border-right: $border; 16 - padding: $spacing / 2; 12 + .sidebar-box { 13 + @include spacing($rec: true); 14 + background-color: $widget-bg; 15 + border-right: $border; 16 + padding: $spacing / 2; 17 17 18 - button { 19 - @include button($flat: true); 20 - padding: $padding / 2 $padding * 2; 21 - } 18 + button { 19 + @include button($flat: true); 20 + padding: $padding / 2 $padding * 2; 21 + } 22 22 23 - scrolledwindow { 24 - @include scrollable; 25 - } 26 - } 23 + scrolledwindow { 24 + @include scrollable; 25 + } 26 + } 27 27 28 - .sidebar-header { 29 - background-color: $widget-bg; 30 - border-right: $border; 31 - border-bottom: $border; 32 - padding: $spacing / 2; 28 + .sidebar-header { 29 + background-color: $widget-bg; 30 + border-right: $border; 31 + border-bottom: $border; 32 + padding: $spacing / 2; 33 33 34 - button { 35 - @include button($flat: true); 36 - padding: $padding / 2 $padding; 37 - } 34 + button { 35 + @include button($flat: true); 36 + padding: $padding / 2 $padding; 37 + } 38 38 39 - button:last-child { 40 - margin-left: $spacing / 2; 41 - } 42 - } 39 + button:last-child { 40 + margin-left: $spacing / 2; 41 + } 42 + } 43 43 44 - .sidebar-footer { 45 - background-color: $widget-bg; 46 - border-right: $border; 47 - border-top: $border; 48 - padding: $spacing / 2; 44 + .sidebar-footer { 45 + background-color: $widget-bg; 46 + border-right: $border; 47 + border-top: $border; 48 + padding: $spacing / 2; 49 49 50 - button { 51 - @include button($flat: true); 52 - padding: $padding / 2 $padding; 53 - } 54 - } 50 + button { 51 + @include button($flat: true); 52 + padding: $padding / 2 $padding; 53 + } 54 + } 55 55 56 - entry.search { 57 - @include button; 58 - border-radius: 0; 59 - padding: $padding; 60 - } 56 + entry.search { 57 + @include button; 58 + border-radius: 0; 59 + padding: $padding; 60 + } 61 61 62 - .row { 63 - @include widget; 64 - border-radius: 0; 65 - border-bottom-width: 0; 66 - padding: $padding; 67 - transition: border-radius 0; 62 + .row { 63 + @include widget; 64 + border-radius: 0; 65 + border-bottom-width: 0; 66 + padding: $padding; 67 + transition: border-radius 0; 68 68 69 - &:last-child { 70 - border-radius: 0 0 $radii $radii; 71 - border-bottom-width: $border-width; 72 - } 69 + &:last-child { 70 + border-radius: 0 0 $radii $radii; 71 + border-bottom-width: $border-width; 72 + } 73 73 74 - &:first-child { 75 - border-radius: $radii $radii 0 0; 76 - } 74 + &:first-child { 75 + border-radius: $radii $radii 0 0; 76 + } 77 77 78 - &:first-child:last-child { 79 - border-radius: $radii; 80 - } 78 + &:first-child:last-child { 79 + border-radius: $radii; 80 + } 81 81 82 - .overlay-padding { 83 - min-height: $font-size * 3; 84 - } 82 + .overlay-padding { 83 + min-height: $font-size * 3; 84 + } 85 85 86 - &:hover { 87 - background-color: $hover; 88 - } 86 + &:hover { 87 + background-color: $hover; 88 + } 89 89 90 - entry, 91 - button { 92 - @include button; 93 - padding: $padding; 94 - } 90 + entry, 91 + button { 92 + @include button; 93 + padding: $padding; 94 + } 95 95 96 - switch { 97 - @include switch; 98 - } 96 + switch { 97 + @include switch; 98 + } 99 99 100 - spinbutton { 101 - @include unset; 100 + spinbutton { 101 + @include unset; 102 102 103 - entry { 104 - border-radius: $radii 0 0 $radii; 105 - } 103 + entry { 104 + border-radius: $radii 0 0 $radii; 105 + } 106 106 107 - button { 108 - border-radius: 0; 109 - } 107 + button { 108 + border-radius: 0; 109 + } 110 110 111 - button:last-child { 112 - border-radius: 0 $radii $radii 0; 113 - } 114 - } 111 + button:last-child { 112 + border-radius: 0 $radii $radii 0; 113 + } 114 + } 115 115 116 - .enum-setter { 117 - label { 118 - background-color: $widget-bg; 119 - border-top: $border; 120 - border-bottom: $border; 121 - padding: 0 $padding; 122 - } 116 + .enum-setter { 117 + label { 118 + background-color: $widget-bg; 119 + border-top: $border; 120 + border-bottom: $border; 121 + padding: 0 $padding; 122 + } 123 123 124 - button:first-child { 125 - border-radius: $radii 0 0 $radii; 126 - } 124 + button:first-child { 125 + border-radius: $radii 0 0 $radii; 126 + } 127 127 128 - button:last-child { 129 - border-radius: 0 $radii $radii 0; 130 - } 131 - } 132 - } 128 + button:last-child { 129 + border-radius: 0 $radii $radii 0; 130 + } 131 + } 132 + } 133 133 134 - .id, 135 - .note { 136 - font-size: 0.8em; 137 - color: transparentize($fg-color, $amount: 0.5); 138 - } 134 + .id, 135 + .note { 136 + font-size: 0.8em; 137 + color: transparentize($fg-color, $amount: 0.5); 138 + } 139 139 140 - .id { 141 - font-family: $mono-font; 142 - } 140 + .id { 141 + font-family: $mono-font; 142 + } 143 143 }
+31 -31
home/isabel/programs/configs/gui/bars/ags/config/services/brightness.js
··· 3 3 import { dependencies } from "../utils.js"; 4 4 5 5 class Brightness extends Service { 6 - static { 7 - Service.register( 8 - this, 9 - {}, 10 - { 11 - screen: ["float", "rw"], 12 - }, 13 - ); 14 - } 6 + static { 7 + Service.register( 8 + this, 9 + {}, 10 + { 11 + screen: ["float", "rw"], 12 + }, 13 + ); 14 + } 15 15 16 - #screen = 0; 16 + #screen = 0; 17 17 18 - get screen() { 19 - return this.#screen; 20 - } 18 + get screen() { 19 + return this.#screen; 20 + } 21 21 22 - set screen(percent) { 23 - if (!dependencies(["brightnessctl"])) return; 22 + set screen(percent) { 23 + if (!dependencies(["brightnessctl"])) return; 24 24 25 - if (percent < 0) percent = 0; 25 + if (percent < 0) percent = 0; 26 26 27 - if (percent > 1) percent = 1; 27 + if (percent > 1) percent = 1; 28 28 29 - Utils.execAsync(`brightnessctl s ${percent * 100}% -q`) 30 - .then(() => { 31 - this.#screen = percent; 32 - this.changed("screen"); 33 - }) 34 - .catch(console.error); 35 - } 29 + Utils.execAsync(`brightnessctl s ${percent * 100}% -q`) 30 + .then(() => { 31 + this.#screen = percent; 32 + this.changed("screen"); 33 + }) 34 + .catch(console.error); 35 + } 36 36 37 - constructor() { 38 - super(); 39 - if (dependencies(["brightnessctl"])) { 40 - this.#screen = 41 - Number(Utils.exec("brightnessctl g")) / 42 - Number(Utils.exec("brightnessctl m")); 43 - } 37 + constructor() { 38 + super(); 39 + if (dependencies(["brightnessctl"])) { 40 + this.#screen = 41 + Number(Utils.exec("brightnessctl g")) / 42 + Number(Utils.exec("brightnessctl m")); 44 43 } 44 + } 45 45 } 46 46 47 47 export default new Brightness();
+50 -50
home/isabel/programs/configs/gui/bars/ags/config/services/colorpicker.js
··· 7 7 const COLORS_CACHE = Utils.CACHE_DIR + "/colorpicker.json"; 8 8 9 9 class Colors extends Service { 10 - static { 11 - Service.register( 12 - this, 13 - {}, 14 - { 15 - colors: ["jsobject"], 16 - }, 17 - ); 18 - } 10 + static { 11 + Service.register( 12 + this, 13 + {}, 14 + { 15 + colors: ["jsobject"], 16 + }, 17 + ); 18 + } 19 19 20 - /** @type {Variable<string[]>} */ 21 - #colors = new Variable([]); 22 - get colors() { 23 - return this.#colors.value; 24 - } 25 - 26 - #notifID = 0; 20 + /** @type {Variable<string[]>} */ 21 + #colors = new Variable([]); 22 + get colors() { 23 + return this.#colors.value; 24 + } 27 25 28 - constructor() { 29 - super(); 26 + #notifID = 0; 30 27 31 - this.#colors.connect("changed", () => this.changed("colors")); 28 + constructor() { 29 + super(); 32 30 33 - Utils.readFileAsync(COLORS_CACHE) 34 - .then((out) => this.#colors.setValue(JSON.parse(out || "[]"))) 35 - .catch(() => print("no colorpicker cache found")); 36 - } 31 + this.#colors.connect("changed", () => this.changed("colors")); 37 32 38 - /** @param {string} color */ 39 - wlCopy(color) { 40 - Utils.execAsync(["wl-copy", color]).catch((err) => console.error(err)); 41 - } 33 + Utils.readFileAsync(COLORS_CACHE) 34 + .then((out) => this.#colors.setValue(JSON.parse(out || "[]"))) 35 + .catch(() => print("no colorpicker cache found")); 36 + } 42 37 43 - async pick() { 44 - if (!dependencies(["hyprpicker"])) return; 38 + /** @param {string} color */ 39 + wlCopy(color) { 40 + Utils.execAsync(["wl-copy", color]).catch((err) => console.error(err)); 41 + } 45 42 46 - const color = await Utils.execAsync("hyprpicker"); 47 - if (!color) return; 43 + async pick() { 44 + if (!dependencies(["hyprpicker"])) return; 48 45 49 - this.wlCopy(color); 50 - const list = this.#colors.value; 51 - if (!list.includes(color)) { 52 - list.push(color); 53 - if (list.length > 10) list.shift(); 46 + const color = await Utils.execAsync("hyprpicker"); 47 + if (!color) return; 54 48 55 - this.#colors.value = list; 56 - Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE).catch( 57 - (err) => console.error(err), 58 - ); 59 - } 49 + this.wlCopy(color); 50 + const list = this.#colors.value; 51 + if (!list.includes(color)) { 52 + list.push(color); 53 + if (list.length > 10) list.shift(); 60 54 61 - this.#notifID = Notifications.Notify( 62 - "Color Picker", 63 - this.#notifID, 64 - "color-select-symbolic", 65 - color, 66 - "", 67 - [], 68 - {}, 69 - ); 55 + this.#colors.value = list; 56 + Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE).catch( 57 + (err) => console.error(err), 58 + ); 70 59 } 60 + 61 + this.#notifID = Notifications.Notify( 62 + "Color Picker", 63 + this.#notifID, 64 + "color-select-symbolic", 65 + color, 66 + "", 67 + [], 68 + {}, 69 + ); 70 + } 71 71 } 72 72 73 73 export default new Colors();
+31 -31
home/isabel/programs/configs/gui/bars/ags/config/services/onScreenIndicator.js
··· 6 6 import Brightness from "./brightness.js"; 7 7 8 8 class Indicator extends Service { 9 - static { 10 - Service.register(this, { 11 - popup: ["double", "string"], 12 - }); 13 - } 9 + static { 10 + Service.register(this, { 11 + popup: ["double", "string"], 12 + }); 13 + } 14 14 15 - #delay = 1500; 16 - #count = 0; 17 - /** 18 - * @param {number} value - 0 < v < 1 19 - * @param {string} icon 20 - */ 21 - popup(value, icon) { 22 - this.emit("popup", value, icon); 23 - this.#count++; 24 - Utils.timeout(this.#delay, () => { 25 - this.#count--; 15 + #delay = 1500; 16 + #count = 0; 17 + /** 18 + * @param {number} value - 0 < v < 1 19 + * @param {string} icon 20 + */ 21 + popup(value, icon) { 22 + this.emit("popup", value, icon); 23 + this.#count++; 24 + Utils.timeout(this.#delay, () => { 25 + this.#count--; 26 26 27 - if (this.#count === 0) this.emit("popup", -1, icon); 28 - }); 29 - } 27 + if (this.#count === 0) this.emit("popup", -1, icon); 28 + }); 29 + } 30 30 31 - speaker() { 32 - this.popup( 33 - Audio.speaker?.volume || 0, 34 - getAudioTypeIcon(Audio.speaker?.icon_name || ""), 35 - ); 36 - } 31 + speaker() { 32 + this.popup( 33 + Audio.speaker?.volume || 0, 34 + getAudioTypeIcon(Audio.speaker?.icon_name || ""), 35 + ); 36 + } 37 37 38 - display() { 39 - // brightness is async, so lets wait a bit 40 - Utils.timeout(10, () => 41 - this.popup(Brightness.screen, icons.brightness.screen), 42 - ); 43 - } 38 + display() { 39 + // brightness is async, so lets wait a bit 40 + Utils.timeout(10, () => 41 + this.popup(Brightness.screen, icons.brightness.screen), 42 + ); 43 + } 44 44 } 45 45 46 46 export default new Indicator();
+31 -31
home/isabel/programs/configs/gui/bars/ags/config/services/powermenu.js
··· 2 2 import Service from "resource:///com/github/Aylur/ags/service.js"; 3 3 4 4 class PowerMenu extends Service { 5 - static { 6 - Service.register( 7 - this, 8 - {}, 9 - { 10 - title: ["string"], 11 - cmd: ["string"], 12 - }, 13 - ); 14 - } 5 + static { 6 + Service.register( 7 + this, 8 + {}, 9 + { 10 + title: ["string"], 11 + cmd: ["string"], 12 + }, 13 + ); 14 + } 15 15 16 - #title = ""; 17 - #cmd = ""; 16 + #title = ""; 17 + #cmd = ""; 18 18 19 - get title() { 20 - return this.#title; 21 - } 22 - get cmd() { 23 - return this.#cmd; 24 - } 19 + get title() { 20 + return this.#title; 21 + } 22 + get cmd() { 23 + return this.#cmd; 24 + } 25 25 26 - /** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */ 27 - action(action) { 28 - [this.#cmd, this.#title] = { 29 - sleep: ["systemctl suspend", "Sleep"], 30 - reboot: ["systemctl reboot", "Reboot"], 31 - logout: ["hyprctl dispatch exit 0", "Log Out"], 32 - shutdown: ["shutdown now", "Shutdown"], 33 - }[action]; 26 + /** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */ 27 + action(action) { 28 + [this.#cmd, this.#title] = { 29 + sleep: ["systemctl suspend", "Sleep"], 30 + reboot: ["systemctl reboot", "Reboot"], 31 + logout: ["hyprctl dispatch exit 0", "Log Out"], 32 + shutdown: ["shutdown now", "Shutdown"], 33 + }[action]; 34 34 35 - this.notify("cmd"); 36 - this.notify("title"); 37 - this.emit("changed"); 38 - App.closeWindow("powermenu"); 39 - } 35 + this.notify("cmd"); 36 + this.notify("title"); 37 + this.emit("changed"); 38 + App.closeWindow("powermenu"); 39 + } 40 40 } 41 41 42 42 export default new PowerMenu();
+265 -274
home/isabel/programs/configs/gui/bars/ags/config/settings/SettingsDialog.js
··· 8 8 9 9 const optionsList = getOptions(); 10 10 const categories = Array.from( 11 - new Set(optionsList.map((opt) => opt.category)), 11 + new Set(optionsList.map((opt) => opt.category)), 12 12 ).filter((category) => category !== "exclude"); 13 13 14 14 const currentPage = Variable(categories[0]); 15 15 const search = Variable(""); 16 16 const showSearch = Variable(false); 17 17 showSearch.connect("changed", ({ value }) => { 18 - if (!value) search.value = ""; 18 + if (!value) search.value = ""; 19 19 }); 20 20 21 21 /** @param {import('./option.js').Opt<string>} opt */ 22 22 const EnumSetter = (opt) => { 23 - const lbl = Widget.Label({ binds: [["label", opt]] }); 24 - const step = (dir = 1) => { 25 - const i = opt.enums.findIndex((i) => i === lbl.label); 26 - opt.setValue( 27 - dir > 0 28 - ? i + dir > opt.enums.length - 1 29 - ? opt.enums[0] 30 - : opt.enums[i + dir] 31 - : i + dir < 0 32 - ? opt.enums[opt.enums.length - 1] 33 - : opt.enums[i + dir], 34 - true, 35 - ); 36 - }; 37 - const next = Widget.Button({ 38 - child: Widget.Icon(icons.ui.arrow.right), 39 - on_clicked: () => step(+1), 40 - }); 41 - const prev = Widget.Button({ 42 - child: Widget.Icon(icons.ui.arrow.left), 43 - on_clicked: () => step(-1), 44 - }); 45 - return Widget.Box({ 46 - class_name: "enum-setter", 47 - children: [prev, lbl, next], 48 - }); 23 + const lbl = Widget.Label({ binds: [["label", opt]] }); 24 + const step = (dir = 1) => { 25 + const i = opt.enums.findIndex((i) => i === lbl.label); 26 + opt.setValue( 27 + dir > 0 28 + ? i + dir > opt.enums.length - 1 29 + ? opt.enums[0] 30 + : opt.enums[i + dir] 31 + : i + dir < 0 32 + ? opt.enums[opt.enums.length - 1] 33 + : opt.enums[i + dir], 34 + true, 35 + ); 36 + }; 37 + const next = Widget.Button({ 38 + child: Widget.Icon(icons.ui.arrow.right), 39 + on_clicked: () => step(+1), 40 + }); 41 + const prev = Widget.Button({ 42 + child: Widget.Icon(icons.ui.arrow.left), 43 + on_clicked: () => step(-1), 44 + }); 45 + return Widget.Box({ 46 + class_name: "enum-setter", 47 + children: [prev, lbl, next], 48 + }); 49 49 }; 50 50 51 51 /** @param {import('./option.js').Opt} opt */ 52 52 const Setter = (opt) => { 53 - switch (opt.type) { 54 - case "number": 55 - return Widget.SpinButton({ 56 - setup(self) { 57 - self.set_range(0, 1000); 58 - self.set_increments(1, 5); 59 - }, 60 - connections: [ 61 - ["value-changed", (self) => opt.setValue(self.value, true)], 62 - [opt, (self) => (self.value = opt.value)], 63 - ], 64 - }); 65 - case "float": 66 - case "object": 67 - return Widget.Entry({ 68 - on_accept: (self) => 69 - opt.setValue(JSON.parse(self.text || ""), true), 70 - connections: [ 71 - [opt, (self) => (self.text = JSON.stringify(opt.value))], 72 - ], 73 - }); 74 - case "string": 75 - return Widget.Entry({ 76 - on_accept: (self) => opt.setValue(self.text, true), 77 - connections: [[opt, (self) => (self.text = opt.value)]], 78 - }); 79 - case "enum": 80 - return EnumSetter(opt); 81 - case "boolean": 82 - return Widget.Switch({ 83 - connections: [ 84 - [ 85 - "notify::active", 86 - (self) => opt.setValue(self.active, true), 87 - ], 88 - [opt, (self) => (self.active = opt.value)], 89 - ], 90 - }); 91 - case "img": 92 - return Widget.FileChooserButton({ 93 - connections: [ 94 - [ 95 - "selection-changed", 96 - (self) => { 97 - opt.setValue( 98 - self.get_uri()?.replace("file://", ""), 99 - true, 100 - ); 101 - }, 102 - ], 103 - ], 104 - }); 105 - case "font": 106 - return Widget.FontButton({ 107 - show_size: false, 108 - use_size: false, 109 - connections: [ 110 - ["notify::font", ({ font }) => opt.setValue(font, true)], 111 - [opt, (self) => (self.font = opt.value)], 112 - ], 113 - }); 114 - default: 115 - return Widget.Label({ 116 - label: "no setter with type " + opt.type, 117 - }); 118 - } 53 + switch (opt.type) { 54 + case "number": 55 + return Widget.SpinButton({ 56 + setup(self) { 57 + self.set_range(0, 1000); 58 + self.set_increments(1, 5); 59 + }, 60 + connections: [ 61 + ["value-changed", (self) => opt.setValue(self.value, true)], 62 + [opt, (self) => (self.value = opt.value)], 63 + ], 64 + }); 65 + case "float": 66 + case "object": 67 + return Widget.Entry({ 68 + on_accept: (self) => opt.setValue(JSON.parse(self.text || ""), true), 69 + connections: [[opt, (self) => (self.text = JSON.stringify(opt.value))]], 70 + }); 71 + case "string": 72 + return Widget.Entry({ 73 + on_accept: (self) => opt.setValue(self.text, true), 74 + connections: [[opt, (self) => (self.text = opt.value)]], 75 + }); 76 + case "enum": 77 + return EnumSetter(opt); 78 + case "boolean": 79 + return Widget.Switch({ 80 + connections: [ 81 + ["notify::active", (self) => opt.setValue(self.active, true)], 82 + [opt, (self) => (self.active = opt.value)], 83 + ], 84 + }); 85 + case "img": 86 + return Widget.FileChooserButton({ 87 + connections: [ 88 + [ 89 + "selection-changed", 90 + (self) => { 91 + opt.setValue(self.get_uri()?.replace("file://", ""), true); 92 + }, 93 + ], 94 + ], 95 + }); 96 + case "font": 97 + return Widget.FontButton({ 98 + show_size: false, 99 + use_size: false, 100 + connections: [ 101 + ["notify::font", ({ font }) => opt.setValue(font, true)], 102 + [opt, (self) => (self.font = opt.value)], 103 + ], 104 + }); 105 + default: 106 + return Widget.Label({ 107 + label: "no setter with type " + opt.type, 108 + }); 109 + } 119 110 }; 120 111 121 112 /** @param {import('./option.js').Opt} opt */ 122 113 const Row = (opt) => 123 - Widget.Box({ 124 - class_name: "row", 125 - setup: (self) => (self.opt = opt), 114 + Widget.Box({ 115 + class_name: "row", 116 + setup: (self) => (self.opt = opt), 117 + children: [ 118 + Widget.Box({ 119 + vertical: true, 120 + vpack: "center", 126 121 children: [ 127 - Widget.Box({ 128 - vertical: true, 129 - vpack: "center", 130 - children: [ 131 - opt.title && 132 - Widget.Label({ 133 - xalign: 0, 134 - class_name: "summary", 135 - label: opt.title, 136 - }), 137 - Widget.Label({ 138 - xalign: 0, 139 - class_name: "id", 140 - label: `id: "${opt.id}"`, 141 - }), 142 - ], 122 + opt.title && 123 + Widget.Label({ 124 + xalign: 0, 125 + class_name: "summary", 126 + label: opt.title, 143 127 }), 144 - Widget.Box({ hexpand: true }), 145 - Widget.Box({ 146 - vpack: "center", 147 - vertical: true, 148 - children: [ 149 - Widget.Box({ 150 - hpack: "end", 151 - child: Setter(opt), 152 - }), 153 - opt.note && 154 - Widget.Label({ 155 - xalign: 1, 156 - class_name: "note", 157 - label: opt.note, 158 - }), 159 - ], 128 + Widget.Label({ 129 + xalign: 0, 130 + class_name: "id", 131 + label: `id: "${opt.id}"`, 132 + }), 133 + ], 134 + }), 135 + Widget.Box({ hexpand: true }), 136 + Widget.Box({ 137 + vpack: "center", 138 + vertical: true, 139 + children: [ 140 + Widget.Box({ 141 + hpack: "end", 142 + child: Setter(opt), 143 + }), 144 + opt.note && 145 + Widget.Label({ 146 + xalign: 1, 147 + class_name: "note", 148 + label: opt.note, 160 149 }), 161 150 ], 162 - }); 151 + }), 152 + ], 153 + }); 163 154 164 155 /** @param {string} category */ 165 156 const Page = (category) => 166 - Widget.Scrollable({ 157 + Widget.Scrollable({ 158 + vexpand: true, 159 + class_name: "page", 160 + child: Widget.Box({ 161 + class_name: "page-content vertical", 162 + vertical: true, 163 + connections: [ 164 + [ 165 + search, 166 + (self) => { 167 + for (const child of self.children) { 168 + child.visible = 169 + child.opt.id.includes(search.value) || 170 + child.opt.title.includes(search.value) || 171 + child.opt.note.includes(search.value); 172 + } 173 + }, 174 + ], 175 + ], 176 + children: optionsList 177 + .filter((opt) => opt.category.includes(category)) 178 + .map(Row), 179 + }), 180 + }); 181 + 182 + const sidebar = Widget.Revealer({ 183 + binds: [["reveal-child", search, "value", (v) => !v]], 184 + transition: "slide_right", 185 + child: Widget.Box({ 186 + hexpand: false, 187 + vertical: true, 188 + children: [ 189 + Widget.Box({ 190 + class_name: "sidebar-header", 191 + child: Widget.Button({ 192 + hexpand: true, 193 + label: icons.dialog.Search + " Search", 194 + on_clicked: () => (showSearch.value = !showSearch.value), 195 + }), 196 + }), 197 + Widget.Scrollable({ 167 198 vexpand: true, 168 - class_name: "page", 199 + hscroll: "never", 169 200 child: Widget.Box({ 170 - class_name: "page-content vertical", 171 - vertical: true, 172 - connections: [ 173 - [ 174 - search, 175 - (self) => { 176 - for (const child of self.children) { 177 - child.visible = 178 - child.opt.id.includes(search.value) || 179 - child.opt.title.includes(search.value) || 180 - child.opt.note.includes(search.value); 181 - } 182 - }, 201 + class_name: "sidebar-box vertical", 202 + vertical: true, 203 + children: [ 204 + ...categories.map((name) => 205 + Widget.Button({ 206 + label: (icons.dialog[name] || "") + " " + name, 207 + xalign: 0, 208 + binds: [ 209 + [ 210 + "class-name", 211 + currentPage, 212 + "value", 213 + (v) => (v === name ? "active" : ""), 214 + ], 183 215 ], 184 - ], 185 - children: optionsList 186 - .filter((opt) => opt.category.includes(category)) 187 - .map(Row), 216 + on_clicked: () => currentPage.setValue(name), 217 + }), 218 + ), 219 + ], 220 + }), 221 + }), 222 + Widget.Box({ 223 + class_name: "sidebar-footer", 224 + child: Widget.Button({ 225 + class_name: "copy", 226 + child: Widget.Label({ 227 + label: " Save", 228 + xalign: 0, 229 + }), 230 + hexpand: true, 231 + on_clicked: () => { 232 + Utils.execAsync(["wl-copy", getValues()]); 233 + print(getValues()); 234 + Utils.execAsync([ 235 + "notify-send", 236 + "-i", 237 + "preferences-desktop-theme-symbolic", 238 + "Theme copied to clipboard", 239 + 'To save it permanently, make a new theme in <span weight="bold">themes.js</span>', 240 + ]); 241 + }, 188 242 }), 189 - }); 190 - 191 - const sidebar = Widget.Revealer({ 192 - binds: [["reveal-child", search, "value", (v) => !v]], 193 - transition: "slide_right", 194 - child: Widget.Box({ 195 - hexpand: false, 196 - vertical: true, 197 - children: [ 198 - Widget.Box({ 199 - class_name: "sidebar-header", 200 - child: Widget.Button({ 201 - hexpand: true, 202 - label: icons.dialog.Search + " Search", 203 - on_clicked: () => (showSearch.value = !showSearch.value), 204 - }), 205 - }), 206 - Widget.Scrollable({ 207 - vexpand: true, 208 - hscroll: "never", 209 - child: Widget.Box({ 210 - class_name: "sidebar-box vertical", 211 - vertical: true, 212 - children: [ 213 - ...categories.map((name) => 214 - Widget.Button({ 215 - label: (icons.dialog[name] || "") + " " + name, 216 - xalign: 0, 217 - binds: [ 218 - [ 219 - "class-name", 220 - currentPage, 221 - "value", 222 - (v) => (v === name ? "active" : ""), 223 - ], 224 - ], 225 - on_clicked: () => currentPage.setValue(name), 226 - }), 227 - ), 228 - ], 229 - }), 230 - }), 231 - Widget.Box({ 232 - class_name: "sidebar-footer", 233 - child: Widget.Button({ 234 - class_name: "copy", 235 - child: Widget.Label({ 236 - label: " Save", 237 - xalign: 0, 238 - }), 239 - hexpand: true, 240 - on_clicked: () => { 241 - Utils.execAsync(["wl-copy", getValues()]); 242 - print(getValues()); 243 - Utils.execAsync([ 244 - "notify-send", 245 - "-i", 246 - "preferences-desktop-theme-symbolic", 247 - "Theme copied to clipboard", 248 - 'To save it permanently, make a new theme in <span weight="bold">themes.js</span>', 249 - ]); 250 - }, 251 - }), 252 - }), 253 - ], 254 - }), 243 + }), 244 + ], 245 + }), 255 246 }); 256 247 257 248 const searchEntry = Widget.Revealer({ 258 - transition: "slide_down", 259 - binds: [ 260 - ["reveal-child", showSearch], 261 - ["transition-duration", options.transition], 249 + transition: "slide_down", 250 + binds: [ 251 + ["reveal-child", showSearch], 252 + ["transition-duration", options.transition], 253 + ], 254 + child: Widget.Entry({ 255 + connections: [ 256 + [ 257 + showSearch, 258 + (self) => { 259 + if (!showSearch.value) self.text = ""; 260 + 261 + if (showSearch.value) self.grab_focus(); 262 + }, 263 + ], 262 264 ], 263 - child: Widget.Entry({ 264 - connections: [ 265 - [ 266 - showSearch, 267 - (self) => { 268 - if (!showSearch.value) self.text = ""; 269 - 270 - if (showSearch.value) self.grab_focus(); 271 - }, 272 - ], 273 - ], 274 - hexpand: true, 275 - class_name: "search", 276 - placeholder_text: "Search Options", 277 - secondary_icon_name: icons.apps.search, 278 - on_change: ({ text }) => (search.value = text || ""), 279 - }), 265 + hexpand: true, 266 + class_name: "search", 267 + placeholder_text: "Search Options", 268 + secondary_icon_name: icons.apps.search, 269 + on_change: ({ text }) => (search.value = text || ""), 270 + }), 280 271 }); 281 272 282 273 const categoriesStack = Widget.Stack({ 283 - transition: "slide_left_right", 284 - items: categories.map((name) => [name, Page(name)]), 285 - binds: [ 286 - ["shown", currentPage], 287 - ["visible", search, "value", (v) => !v], 288 - ], 274 + transition: "slide_left_right", 275 + items: categories.map((name) => [name, Page(name)]), 276 + binds: [ 277 + ["shown", currentPage], 278 + ["visible", search, "value", (v) => !v], 279 + ], 289 280 }); 290 281 291 282 const searchPage = Widget.Box({ 292 - binds: [["visible", search, "value", (v) => !!v]], 293 - child: Page(""), 283 + binds: [["visible", search, "value", (v) => !!v]], 284 + child: Page(""), 294 285 }); 295 286 296 287 export default RegularWindow({ 297 - name: "settings-dialog", 298 - title: "Settings", 299 - setup: (win) => win.set_default_size(800, 500), 300 - connections: [ 301 - [ 302 - "delete-event", 303 - (win) => { 304 - win.hide(); 305 - return true; 306 - }, 307 - ], 308 - [ 309 - "key-press-event", 310 - (self, event) => { 311 - if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) { 312 - self.text = ""; 313 - showSearch.setValue(false); 314 - search.setValue(""); 315 - } 316 - }, 317 - ], 288 + name: "settings-dialog", 289 + title: "Settings", 290 + setup: (win) => win.set_default_size(800, 500), 291 + connections: [ 292 + [ 293 + "delete-event", 294 + (win) => { 295 + win.hide(); 296 + return true; 297 + }, 298 + ], 299 + [ 300 + "key-press-event", 301 + (self, event) => { 302 + if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) { 303 + self.text = ""; 304 + showSearch.setValue(false); 305 + search.setValue(""); 306 + } 307 + }, 308 + ], 309 + ], 310 + child: Widget.Box({ 311 + children: [ 312 + sidebar, 313 + Widget.Box({ 314 + vertical: true, 315 + children: [searchEntry, categoriesStack, searchPage], 316 + }), 318 317 ], 319 - child: Widget.Box({ 320 - children: [ 321 - sidebar, 322 - Widget.Box({ 323 - vertical: true, 324 - children: [searchEntry, categoriesStack, searchPage], 325 - }), 326 - ], 327 - }), 318 + }), 328 319 });
+19 -19
home/isabel/programs/configs/gui/bars/ags/config/settings/globals.js
··· 1 1 import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js"; 2 2 3 3 export async function globals() { 4 - globalThis.options = (await import("../options.js")).default; 5 - globalThis.iconBrowser = (await import("../misc/IconBrowser.js")).default; 6 - globalThis.app = ( 7 - await import("resource:///com/github/Aylur/ags/app.js") 8 - ).default; 9 - globalThis.audio = ( 10 - await import("resource:///com/github/Aylur/ags/service/audio.js") 11 - ).default; 12 - globalThis.brightness = (await import("../services/brightness.js")).default; 13 - globalThis.indicator = ( 14 - await import("../services/onScreenIndicator.js") 15 - ).default; 16 - Mpris.connect("player-added", (mpris, bus) => { 17 - mpris.getPlayer(bus)?.connect("changed", (player) => { 18 - globalThis.mpris = player || Mpris.players[0]; 19 - }); 20 - }); 21 - Mpris.connect("player-closed", () => { 22 - globalThis.mpris = Mpris.players[0]; 4 + globalThis.options = (await import("../options.js")).default; 5 + globalThis.iconBrowser = (await import("../misc/IconBrowser.js")).default; 6 + globalThis.app = ( 7 + await import("resource:///com/github/Aylur/ags/app.js") 8 + ).default; 9 + globalThis.audio = ( 10 + await import("resource:///com/github/Aylur/ags/service/audio.js") 11 + ).default; 12 + globalThis.brightness = (await import("../services/brightness.js")).default; 13 + globalThis.indicator = ( 14 + await import("../services/onScreenIndicator.js") 15 + ).default; 16 + Mpris.connect("player-added", (mpris, bus) => { 17 + mpris.getPlayer(bus)?.connect("changed", (player) => { 18 + globalThis.mpris = player || Mpris.players[0]; 23 19 }); 20 + }); 21 + Mpris.connect("player-closed", () => { 22 + globalThis.mpris = Mpris.players[0]; 23 + }); 24 24 }
+26 -27
home/isabel/programs/configs/gui/bars/ags/config/settings/hyprland.js
··· 7 7 8 8 /** @param {Array<string>} batch */ 9 9 function sendBatch(batch) { 10 - const cmd = batch 11 - .filter((x) => !!x) 12 - .map((x) => `keyword ${x}`) 13 - .join("; "); 10 + const cmd = batch 11 + .filter((x) => !!x) 12 + .map((x) => `keyword ${x}`) 13 + .join("; "); 14 14 15 - Hyprland.sendMessage(`[[BATCH]]/${cmd}`); 15 + Hyprland.sendMessage(`[[BATCH]]/${cmd}`); 16 16 } 17 17 18 18 export function hyprlandInit() { 19 - if (readFile("/tmp/ags/hyprland-init")) return; 19 + if (readFile("/tmp/ags/hyprland-init")) return; 20 20 21 - sendBatch( 22 - Array.from(App.windows).flatMap(([name]) => [ 23 - `layerrule blur, ${name}`, 24 - noIgnorealpha.some((skip) => name.includes(skip)) 25 - ? "" 26 - : `layerrule ignorealpha 0.6, ${name}`, 27 - ]), 28 - ); 21 + sendBatch( 22 + Array.from(App.windows).flatMap(([name]) => [ 23 + `layerrule blur, ${name}`, 24 + noIgnorealpha.some((skip) => name.includes(skip)) 25 + ? "" 26 + : `layerrule ignorealpha 0.6, ${name}`, 27 + ]), 28 + ); 29 29 30 - writeFile("init", "/tmp/ags/hyprland-init"); 31 - setupHyprland(); 30 + writeFile("init", "/tmp/ags/hyprland-init"); 31 + setupHyprland(); 32 32 } 33 33 34 34 export async function setupHyprland() { 35 - const wm_gaps = options.hypr.wm_gaps.value; 36 - const bar_style = options.bar.style.value; 37 - const bar_pos = options.bar.position.value; 35 + const wm_gaps = options.hypr.wm_gaps.value; 36 + const bar_style = options.bar.style.value; 37 + const bar_pos = options.bar.position.value; 38 38 39 - const batch = []; 39 + const batch = []; 40 40 41 - JSON.parse(await Hyprland.sendMessage("j/monitors")).forEach(({ name }) => { 42 - const v = bar_pos === "top" ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`; 43 - if (bar_style !== "normal") 44 - batch.push(`monitor ${name},addreserved,${v}`); 45 - else batch.push(`monitor ${name},addreserved,0,0,0,0`); 46 - }); 41 + JSON.parse(await Hyprland.sendMessage("j/monitors")).forEach(({ name }) => { 42 + const v = bar_pos === "top" ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`; 43 + if (bar_style !== "normal") batch.push(`monitor ${name},addreserved,${v}`); 44 + else batch.push(`monitor ${name},addreserved,0,0,0,0`); 45 + }); 47 46 48 - sendBatch(batch); 47 + sendBatch(batch); 49 48 }
+117 -119
home/isabel/programs/configs/gui/bars/ags/config/settings/option.js
··· 1 1 import { 2 - CACHE_DIR, 3 - readFile, 4 - writeFile, 2 + CACHE_DIR, 3 + readFile, 4 + writeFile, 5 5 } from "resource:///com/github/Aylur/ags/utils.js"; 6 6 import { exec } from "resource:///com/github/Aylur/ags/utils.js"; 7 7 import options from "../options.js"; ··· 31 31 32 32 /** @template T */ 33 33 export class Opt extends Service { 34 - static { 35 - Service.register( 36 - this, 37 - {}, 38 - { 39 - value: ["jsobject"], 40 - }, 41 - ); 42 - } 34 + static { 35 + Service.register( 36 + this, 37 + {}, 38 + { 39 + value: ["jsobject"], 40 + }, 41 + ); 42 + } 43 43 44 - #value; 45 - #scss = ""; 46 - unit = "px"; 47 - noReload = false; 48 - id = ""; 49 - title = ""; 50 - note = ""; 51 - type = ""; 52 - category = ""; 44 + #value; 45 + #scss = ""; 46 + unit = "px"; 47 + noReload = false; 48 + id = ""; 49 + title = ""; 50 + note = ""; 51 + type = ""; 52 + category = ""; 53 53 54 - /** @type {Array<string>} */ 55 - enums = []; 54 + /** @type {Array<string>} */ 55 + enums = []; 56 56 57 - /** @type {(v: T) => any} */ 58 - format = (v) => v; 57 + /** @type {(v: T) => any} */ 58 + format = (v) => v; 59 59 60 - /** @type {(v: T) => any} */ 61 - scssFormat = (v) => v; 60 + /** @type {(v: T) => any} */ 61 + scssFormat = (v) => v; 62 62 63 - /** 64 - * @param {T} value 65 - * @param {OptionConfig<T> =} config 66 - */ 67 - constructor(value, config) { 68 - super(); 69 - this.#value = value; 70 - this.defaultValue = value; 71 - this.type = typeof value; 63 + /** 64 + * @param {T} value 65 + * @param {OptionConfig<T> =} config 66 + */ 67 + constructor(value, config) { 68 + super(); 69 + this.#value = value; 70 + this.defaultValue = value; 71 + this.type = typeof value; 72 72 73 - if (config) Object.keys(config).forEach((c) => (this[c] = config[c])); 73 + if (config) Object.keys(config).forEach((c) => (this[c] = config[c])); 74 74 75 - import("../options.js").then(this.#init.bind(this)); 76 - } 75 + import("../options.js").then(this.#init.bind(this)); 76 + } 77 77 78 - set scss(scss) { 79 - this.#scss = scss; 80 - } 81 - get scss() { 82 - return this.#scss || this.id.split(".").join("-").split("_").join("-"); 83 - } 78 + set scss(scss) { 79 + this.#scss = scss; 80 + } 81 + get scss() { 82 + return this.#scss || this.id.split(".").join("-").split("_").join("-"); 83 + } 84 84 85 - #init() { 86 - getOptions(); // sets the ids as a side effect 85 + #init() { 86 + getOptions(); // sets the ids as a side effect 87 87 88 - if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]); 88 + if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]); 89 89 90 - const words = this.id 91 - .split(".") 92 - .flatMap((w) => w.split("_")) 93 - .map((word) => word.charAt(0).toUpperCase() + word.slice(1)); 90 + const words = this.id 91 + .split(".") 92 + .flatMap((w) => w.split("_")) 93 + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)); 94 94 95 - this.title ||= words.join(" "); 96 - this.category ||= 97 - words.length === 1 ? "General" : words.at(0) || "General"; 95 + this.title ||= words.join(" "); 96 + this.category ||= words.length === 1 ? "General" : words.at(0) || "General"; 98 97 99 - this.connect("changed", () => { 100 - cacheObj[this.id] = this.value; 101 - writeFile(JSON.stringify(cacheObj, null, 2), CACHE_FILE); 102 - }); 103 - } 98 + this.connect("changed", () => { 99 + cacheObj[this.id] = this.value; 100 + writeFile(JSON.stringify(cacheObj, null, 2), CACHE_FILE); 101 + }); 102 + } 104 103 105 - get value() { 106 - return this.#value; 107 - } 108 - set value(value) { 109 - this.setValue(value); 110 - } 104 + get value() { 105 + return this.#value; 106 + } 107 + set value(value) { 108 + this.setValue(value); 109 + } 111 110 112 - /** @param {T} value */ 113 - setValue(value, reload = false) { 114 - if (typeof value !== typeof this.defaultValue) { 115 - console.error( 116 - Error( 117 - `WrongType: Option "${this.id}" can't be set to ${value}, ` + 118 - `expected "${typeof this 119 - .defaultValue}", but got "${typeof value}"`, 120 - ), 121 - ); 111 + /** @param {T} value */ 112 + setValue(value, reload = false) { 113 + if (typeof value !== typeof this.defaultValue) { 114 + console.error( 115 + Error( 116 + `WrongType: Option "${this.id}" can't be set to ${value}, ` + 117 + `expected "${typeof this.defaultValue}", but got "${typeof value}"`, 118 + ), 119 + ); 122 120 123 - return; 124 - } 121 + return; 122 + } 125 123 126 - if (this.value !== value) { 127 - this.#value = this.format(value); 128 - this.changed("value"); 124 + if (this.value !== value) { 125 + this.#value = this.format(value); 126 + this.changed("value"); 129 127 130 - if (reload && !this.noReload) { 131 - reloadScss(); 132 - setupHyprland(); 133 - } 134 - } 128 + if (reload && !this.noReload) { 129 + reloadScss(); 130 + setupHyprland(); 131 + } 135 132 } 133 + } 136 134 137 - reset(reload = false) { 138 - this.setValue(this.defaultValue, reload); 139 - } 135 + reset(reload = false) { 136 + this.setValue(this.defaultValue, reload); 137 + } 140 138 } 141 139 142 140 /** ··· 146 144 * @returns {Opt<T>} 147 145 */ 148 146 export function Option(value, config) { 149 - return new Opt(value, config); 147 + return new Opt(value, config); 150 148 } 151 149 152 150 /** @returns {Array<Opt<any>>} */ 153 151 export function getOptions(object = options, path = "") { 154 - return Object.keys(object).flatMap((key) => { 155 - /** @type Option<any> */ 156 - const obj = object[key]; 157 - const id = path ? path + "." + key : key; 152 + return Object.keys(object).flatMap((key) => { 153 + /** @type Option<any> */ 154 + const obj = object[key]; 155 + const id = path ? path + "." + key : key; 158 156 159 - if (obj instanceof Opt) { 160 - obj.id = id; 161 - return obj; 162 - } 157 + if (obj instanceof Opt) { 158 + obj.id = id; 159 + return obj; 160 + } 163 161 164 - if (typeof obj === "object") return getOptions(obj, id); 162 + if (typeof obj === "object") return getOptions(obj, id); 165 163 166 - return []; 167 - }); 164 + return []; 165 + }); 168 166 } 169 167 170 168 export function resetOptions() { 171 - exec(`rm -rf ${CACHE_FILE}`); 172 - cacheObj = {}; 173 - getOptions().forEach((opt) => opt.reset()); 169 + exec(`rm -rf ${CACHE_FILE}`); 170 + cacheObj = {}; 171 + getOptions().forEach((opt) => opt.reset()); 174 172 } 175 173 176 174 export function getValues() { 177 - const obj = {}; 178 - for (const opt of getOptions()) { 179 - if (opt.category !== "exclude") obj[opt.id] = opt.value; 180 - } 175 + const obj = {}; 176 + for (const opt of getOptions()) { 177 + if (opt.category !== "exclude") obj[opt.id] = opt.value; 178 + } 181 179 182 - return JSON.stringify(obj, null, 2); 180 + return JSON.stringify(obj, null, 2); 183 181 } 184 182 185 183 /** @param {string | object} config */ 186 184 export function apply(config) { 187 - const options = getOptions(); 188 - const settings = typeof config === "string" ? JSON.parse(config) : config; 185 + const options = getOptions(); 186 + const settings = typeof config === "string" ? JSON.parse(config) : config; 189 187 190 - for (const id of Object.keys(settings)) { 191 - const opt = options.find((opt) => opt.id === id); 192 - if (!opt) { 193 - print(`No option with id: "${id}"`); 194 - continue; 195 - } 196 - 197 - opt.setValue(settings[id]); 188 + for (const id of Object.keys(settings)) { 189 + const opt = options.find((opt) => opt.id === id); 190 + if (!opt) { 191 + print(`No option with id: "${id}"`); 192 + continue; 198 193 } 194 + 195 + opt.setValue(settings[id]); 196 + } 199 197 }
+41 -41
home/isabel/programs/configs/gui/bars/ags/config/settings/scss.js
··· 4 4 import { dependencies } from "../utils.js"; 5 5 6 6 export function scssWatcher() { 7 - return Utils.subprocess( 8 - [ 9 - "inotifywait", 10 - "--recursive", 11 - "--event", 12 - "create,modify", 13 - "-m", 14 - App.configDir + "/scss", 15 - ], 16 - reloadScss, 17 - () => print("missing dependancy for css hotreload: inotify-tools"), 18 - ); 7 + return Utils.subprocess( 8 + [ 9 + "inotifywait", 10 + "--recursive", 11 + "--event", 12 + "create,modify", 13 + "-m", 14 + App.configDir + "/scss", 15 + ], 16 + reloadScss, 17 + () => print("missing dependancy for css hotreload: inotify-tools"), 18 + ); 19 19 } 20 20 21 21 /** ··· 26 26 * options.bar.style.value => $bar-style 27 27 */ 28 28 export async function reloadScss() { 29 - if (!dependencies(["sassc"])) return; 29 + if (!dependencies(["sassc"])) return; 30 30 31 - const opts = getOptions(); 32 - const vars = opts.map((opt) => { 33 - if (opt.scss === "exclude") return ""; 31 + const opts = getOptions(); 32 + const vars = opts.map((opt) => { 33 + if (opt.scss === "exclude") return ""; 34 34 35 - const name = opt.id.split(".").join("-").split("_").join("-"); 36 - const unit = typeof opt.value === "number" ? opt.unit : ""; 37 - const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value; 38 - print(opt.scss, opt.id); 39 - return `$${opt.scss || name}: ${value}${unit};`; 40 - }); 35 + const name = opt.id.split(".").join("-").split("_").join("-"); 36 + const unit = typeof opt.value === "number" ? opt.unit : ""; 37 + const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value; 38 + print(opt.scss, opt.id); 39 + return `$${opt.scss || name}: ${value}${unit};`; 40 + }); 41 41 42 - const bar_style = opts.find((opt) => opt.id === "bar.style")?.value || ""; 43 - const additional = 44 - bar_style === "normal" 45 - ? "//" 46 - : ` 42 + const bar_style = opts.find((opt) => opt.id === "bar.style")?.value || ""; 43 + const additional = 44 + bar_style === "normal" 45 + ? "//" 46 + : ` 47 47 window#quicksettings .window-content { 48 48 margin-right: $wm-gaps; 49 49 } ··· 53 53 } 54 54 `; 55 55 56 - try { 57 - const tmp = "/tmp/ags/scss"; 58 - Utils.ensureDirectory(tmp); 59 - await Utils.writeFile(vars.join("\n"), `${tmp}/options.scss`); 60 - await Utils.writeFile(additional, `${tmp}/additional.scss`); 61 - await Utils.execAsync( 62 - `sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`, 63 - ); 64 - App.resetCss(); 65 - App.applyCss(`${tmp}/style.css`); 66 - } catch (error) { 67 - if (error instanceof Error) console.error(error.message); 56 + try { 57 + const tmp = "/tmp/ags/scss"; 58 + Utils.ensureDirectory(tmp); 59 + await Utils.writeFile(vars.join("\n"), `${tmp}/options.scss`); 60 + await Utils.writeFile(additional, `${tmp}/additional.scss`); 61 + await Utils.execAsync( 62 + `sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`, 63 + ); 64 + App.resetCss(); 65 + App.applyCss(`${tmp}/style.css`); 66 + } catch (error) { 67 + if (error instanceof Error) console.error(error.message); 68 68 69 - if (typeof error === "string") console.error(error); 70 - } 69 + if (typeof error === "string") console.error(error); 70 + } 71 71 }
+50 -52
home/isabel/programs/configs/gui/bars/ags/config/settings/setup.js
··· 10 10 import Gtk from "gi://Gtk"; 11 11 12 12 export function init() { 13 - notificationBlacklist(); 14 - warnOnLowBattery(); 15 - globals(); 16 - gsettigsColorScheme(); 17 - gtkFontSettings(); 18 - scssWatcher(); 13 + notificationBlacklist(); 14 + warnOnLowBattery(); 15 + globals(); 16 + gsettigsColorScheme(); 17 + gtkFontSettings(); 18 + scssWatcher(); 19 19 20 - reloadScss(); 21 - hyprlandInit(); 22 - setupHyprland(); 23 - wallpaper(); 20 + reloadScss(); 21 + hyprlandInit(); 22 + setupHyprland(); 23 + wallpaper(); 24 24 } 25 25 26 26 function gsettigsColorScheme() { 27 - if (!Utils.exec("which gsettings")) return; 27 + if (!Utils.exec("which gsettings")) return; 28 28 29 - options.theme.scheme.connect("changed", ({ value }) => { 30 - const gsettings = 31 - "gsettings set org.gnome.desktop.interface color-scheme"; 32 - Utils.execAsync(`${gsettings} "prefer-${value}"`).catch((err) => 33 - console.error(err.message), 34 - ); 35 - }); 29 + options.theme.scheme.connect("changed", ({ value }) => { 30 + const gsettings = "gsettings set org.gnome.desktop.interface color-scheme"; 31 + Utils.execAsync(`${gsettings} "prefer-${value}"`).catch((err) => 32 + console.error(err.message), 33 + ); 34 + }); 36 35 } 37 36 38 37 function gtkFontSettings() { 39 - const settings = Gtk.Settings.get_default(); 40 - if (!settings) { 41 - console.error(Error("Gtk.Settings unavailable")); 42 - return; 43 - } 38 + const settings = Gtk.Settings.get_default(); 39 + if (!settings) { 40 + console.error(Error("Gtk.Settings unavailable")); 41 + return; 42 + } 44 43 45 - const callback = () => { 46 - const { size, font } = options.font; 47 - settings.gtk_font_name = `${font.value} ${size.value}`; 48 - }; 44 + const callback = () => { 45 + const { size, font } = options.font; 46 + settings.gtk_font_name = `${font.value} ${size.value}`; 47 + }; 49 48 50 - options.font.font.connect("notify::value", callback); 51 - options.font.size.connect("notify::value", callback); 49 + options.font.font.connect("notify::value", callback); 50 + options.font.size.connect("notify::value", callback); 52 51 } 53 52 54 53 function notificationBlacklist() { 55 - Notifications.connect("notified", (_, id) => { 56 - const n = Notifications.getNotification(id); 57 - options.notifications.black_list.value.forEach((item) => { 58 - if (n?.app_name.includes(item) || n?.app_entry?.includes(item)) 59 - n.close(); 60 - }); 54 + Notifications.connect("notified", (_, id) => { 55 + const n = Notifications.getNotification(id); 56 + options.notifications.black_list.value.forEach((item) => { 57 + if (n?.app_name.includes(item) || n?.app_entry?.includes(item)) n.close(); 61 58 }); 59 + }); 62 60 } 63 61 64 62 function warnOnLowBattery() { 65 - Battery.connect("notify::percent", () => { 66 - const low = options.battery.low.value; 67 - if ( 68 - Battery.percent !== low || 69 - Battery.percent !== low / 2 || 70 - !Battery.charging 71 - ) 72 - return; 63 + Battery.connect("notify::percent", () => { 64 + const low = options.battery.low.value; 65 + if ( 66 + Battery.percent !== low || 67 + Battery.percent !== low / 2 || 68 + !Battery.charging 69 + ) 70 + return; 73 71 74 - Utils.execAsync([ 75 - "notify-send", 76 - `${Battery.percent}% Battery Percentage`, 77 - "-i", 78 - icons.battery.warning, 79 - "-u", 80 - "critical", 81 - ]); 82 - }); 72 + Utils.execAsync([ 73 + "notify-send", 74 + `${Battery.percent}% Battery Percentage`, 75 + "-i", 76 + icons.battery.warning, 77 + "-u", 78 + "critical", 79 + ]); 80 + }); 83 81 }
+31 -31
home/isabel/programs/configs/gui/bars/ags/config/settings/theme.js
··· 7 7 8 8 /** @param {string} name */ 9 9 export function setTheme(name) { 10 - options.reset(); 11 - const theme = themes.find((t) => t.name === name); 12 - if (!theme) return print("No theme named " + name); 10 + options.reset(); 11 + const theme = themes.find((t) => t.name === name); 12 + if (!theme) return print("No theme named " + name); 13 13 14 - options.apply(theme.options); 15 - reloadScss(); 16 - setupHyprland(); 17 - wallpaper(); 14 + options.apply(theme.options); 15 + reloadScss(); 16 + setupHyprland(); 17 + wallpaper(); 18 18 } 19 19 20 20 export const WP = `/home/${USER}/media/pictures/wallpapers/`; 21 21 22 22 export const lightColors = { 23 - "theme.scheme": "light", 24 - "color.red": "#d20f39", 25 - "color.green": "#40a02b", 26 - "color.yellow": "#df8e1d", 27 - "color.blue": "#209fb5", 28 - "color.magenta": "#8839ef", 29 - "color.teal": "#179299", 30 - "color.orange": "#fe640b", 31 - "theme.bg": "#eff1f5", 32 - "theme.fg": "#4c4f69", 23 + "theme.scheme": "light", 24 + "color.red": "#d20f39", 25 + "color.green": "#40a02b", 26 + "color.yellow": "#df8e1d", 27 + "color.blue": "#209fb5", 28 + "color.magenta": "#8839ef", 29 + "color.teal": "#179299", 30 + "color.orange": "#fe640b", 31 + "theme.bg": "#eff1f5", 32 + "theme.fg": "#4c4f69", 33 33 }; 34 34 35 35 export const Theme = ({ name, icon = " ", ...options }) => ({ 36 - name, 37 - icon, 38 - options: { 39 - "theme.name": name, 40 - "theme.icon": icon, 41 - ...options, 42 - }, 36 + name, 37 + icon, 38 + options: { 39 + "theme.name": name, 40 + "theme.icon": icon, 41 + ...options, 42 + }, 43 43 }); 44 44 45 45 let settingsDialog; 46 46 export async function openSettings() { 47 - if (settingsDialog) return settingsDialog.present(); 47 + if (settingsDialog) return settingsDialog.present(); 48 48 49 - try { 50 - settingsDialog = (await import("./SettingsDialog.js")).default; 51 - settingsDialog.present(); 52 - } catch (error) { 53 - if (error instanceof Error) console.error(error.message); 54 - } 49 + try { 50 + settingsDialog = (await import("./SettingsDialog.js")).default; 51 + settingsDialog.present(); 52 + } catch (error) { 53 + if (error instanceof Error) console.error(error.message); 54 + } 55 55 }
+8 -8
home/isabel/programs/configs/gui/bars/ags/config/settings/wallpaper.js
··· 3 3 import { dependencies } from "../utils.js"; 4 4 5 5 export function initWallpaper() { 6 - if (dependencies(["swww"])) { 7 - exec("swww init"); 8 - options.desktop.wallpaper.img.connect("changed", wallpaper); 9 - } 6 + if (dependencies(["swww"])) { 7 + exec("swww init"); 8 + options.desktop.wallpaper.img.connect("changed", wallpaper); 9 + } 10 10 } 11 11 12 12 export function wallpaper() { 13 - if (!dependencies(["swww"])) return; 13 + if (!dependencies(["swww"])) return; 14 14 15 - execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch( 16 - (err) => console.error(err), 17 - ); 15 + execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch((err) => 16 + console.error(err), 17 + ); 18 18 }
+11 -11
home/isabel/programs/configs/gui/bars/ags/config/themes.js
··· 1 1 import { Theme, WP, lightColors } from "./settings/theme.js"; 2 2 3 3 export default [ 4 - Theme({ 5 - name: "Mocha", 6 - icon: "", 7 - "desktop.wallpaper.img": WP + "walking.png", 8 - }), 9 - Theme({ 10 - name: "Latte", 11 - icon: "", 12 - "desktop.wallpaper.img": WP + "card_after_training.png", 13 - ...lightColors, 14 - }), 4 + Theme({ 5 + name: "Mocha", 6 + icon: "", 7 + "desktop.wallpaper.img": WP + "walking.png", 8 + }), 9 + Theme({ 10 + name: "Latte", 11 + icon: "", 12 + "desktop.wallpaper.img": WP + "card_after_training.png", 13 + ...lightColors, 14 + }), 15 15 ];
+30 -30
home/isabel/programs/configs/gui/bars/ags/config/utils.js
··· 9 9 * @returns {Array<number>} 10 10 */ 11 11 export function range(length, start = 1) { 12 - return Array.from({ length }, (_, i) => i + start); 12 + return Array.from({ length }, (_, i) => i + start); 13 13 } 14 14 15 15 /** ··· 18 18 * @returns {string} 19 19 */ 20 20 export function substitute(collection, item) { 21 - return collection.find(([from]) => from === item)?.[1] || item; 21 + return collection.find(([from]) => from === item)?.[1] || item; 22 22 } 23 23 24 24 /** ··· 26 26 * @returns {Array<import('types/widgets/window').default>} 27 27 */ 28 28 export function forMonitors(widget) { 29 - const n = Gdk.Display.get_default()?.get_n_monitors() || 1; 30 - return range(n, 0).map(widget).flat(1); 29 + const n = Gdk.Display.get_default()?.get_n_monitors() || 1; 30 + return range(n, 0).map(widget).flat(1); 31 31 } 32 32 33 33 /** ··· 35 35 * @returns {any} - missing cairo type 36 36 */ 37 37 export function createSurfaceFromWidget(widget) { 38 - const alloc = widget.get_allocation(); 39 - const surface = new cairo.ImageSurface( 40 - cairo.Format.ARGB32, 41 - alloc.width, 42 - alloc.height, 43 - ); 44 - const cr = new cairo.Context(surface); 45 - cr.setSourceRGBA(255, 255, 255, 0); 46 - cr.rectangle(0, 0, alloc.width, alloc.height); 47 - cr.fill(); 48 - widget.draw(cr); 38 + const alloc = widget.get_allocation(); 39 + const surface = new cairo.ImageSurface( 40 + cairo.Format.ARGB32, 41 + alloc.width, 42 + alloc.height, 43 + ); 44 + const cr = new cairo.Context(surface); 45 + cr.setSourceRGBA(255, 255, 255, 0); 46 + cr.rectangle(0, 0, alloc.width, alloc.height); 47 + cr.fill(); 48 + widget.draw(cr); 49 49 50 - return surface; 50 + return surface; 51 51 } 52 52 53 53 /** @param {string} icon */ 54 54 export function getAudioTypeIcon(icon) { 55 - const substitues = [ 56 - ["audio-headset-bluetooth", icons.audio.type.headset], 57 - ["audio-card-analog-usb", icons.audio.type.speaker], 58 - ["audio-card-analog-pci", icons.audio.type.card], 59 - ]; 55 + const substitues = [ 56 + ["audio-headset-bluetooth", icons.audio.type.headset], 57 + ["audio-card-analog-usb", icons.audio.type.speaker], 58 + ["audio-card-analog-pci", icons.audio.type.card], 59 + ]; 60 60 61 - return substitute(substitues, icon); 61 + return substitute(substitues, icon); 62 62 } 63 63 64 64 /** @param {import('types/service/applications').Application} app */ 65 65 export function launchApp(app) { 66 - Utils.execAsync(["hyprctl", "dispatch", "exec", `sh -c ${app.executable}`]); 67 - app.frequency += 1; 66 + Utils.execAsync(["hyprctl", "dispatch", "exec", `sh -c ${app.executable}`]); 67 + app.frequency += 1; 68 68 } 69 69 70 70 /** @param {Array<string>} bins */ 71 71 export function dependencies(bins) { 72 - const deps = bins.map((bin) => { 73 - const has = Utils.exec(`which ${bin}`); 74 - if (!has) print(`missing dependency: ${bin}`); 72 + const deps = bins.map((bin) => { 73 + const has = Utils.exec(`which ${bin}`); 74 + if (!has) print(`missing dependency: ${bin}`); 75 75 76 - return !!has; 77 - }); 76 + return !!has; 77 + }); 78 78 79 - return deps.every((has) => has); 79 + return deps.every((has) => has); 80 80 }
+54 -54
home/isabel/programs/configs/gui/bars/ags/config/variables.js
··· 5 5 const interval = options.systemFetchInterval; 6 6 7 7 export const uptime = Variable("", { 8 - poll: [ 9 - 60_000, 10 - "cat /proc/uptime", 11 - (line) => { 12 - const uptime = Number.parseInt(line.split(".")[0]) / 60; 13 - const h = Math.floor(uptime / 60); 14 - const s = Math.floor(uptime % 60); 15 - return `${h}:${s < 10 ? "0" + s : s}`; 16 - }, 17 - ], 8 + poll: [ 9 + 60_000, 10 + "cat /proc/uptime", 11 + (line) => { 12 + const uptime = Number.parseInt(line.split(".")[0]) / 60; 13 + const h = Math.floor(uptime / 60); 14 + const s = Math.floor(uptime % 60); 15 + return `${h}:${s < 10 ? "0" + s : s}`; 16 + }, 17 + ], 18 18 }); 19 19 20 20 export const distro = GLib.get_os_info("ID"); 21 21 22 22 export const distroIcon = (() => { 23 - switch (distro) { 24 - case "fedora": 25 - return ""; 26 - case "arch": 27 - return ""; 28 - case "nixos": 29 - return ""; 30 - case "debian": 31 - return ""; 32 - case "opensuse-tumbleweed": 33 - return ""; 34 - case "ubuntu": 35 - return ""; 36 - case "endeavouros": 37 - return ""; 38 - default: 39 - return ""; 40 - } 23 + switch (distro) { 24 + case "fedora": 25 + return ""; 26 + case "arch": 27 + return ""; 28 + case "nixos": 29 + return ""; 30 + case "debian": 31 + return ""; 32 + case "opensuse-tumbleweed": 33 + return ""; 34 + case "ubuntu": 35 + return ""; 36 + case "endeavouros": 37 + return ""; 38 + default: 39 + return ""; 40 + } 41 41 })(); 42 42 43 43 /** @type {function([string, string] | string[]): number} */ 44 44 const divide = ([total, free]) => free / total; 45 45 46 46 export const cpu = Variable(0, { 47 - poll: [ 48 - interval, 49 - "top -b -n 1", 50 - (out) => 51 - divide([ 52 - 100, 53 - out 54 - .split("\n") 55 - .find((line) => line.includes("Cpu(s)")) 56 - ?.split(/\s+/)[1] 57 - .replace(",", "."), 58 - ]), 59 - ], 47 + poll: [ 48 + interval, 49 + "top -b -n 1", 50 + (out) => 51 + divide([ 52 + 100, 53 + out 54 + .split("\n") 55 + .find((line) => line.includes("Cpu(s)")) 56 + ?.split(/\s+/)[1] 57 + .replace(",", "."), 58 + ]), 59 + ], 60 60 }); 61 61 62 62 export const ram = Variable(0, { 63 - poll: [ 64 - interval, 65 - "free", 66 - (out) => 67 - divide( 68 - out 69 - .split("\n") 70 - .find((line) => line.includes("Mem:")) 71 - ?.split(/\s+/) 72 - .splice(1, 2), 73 - ), 74 - ], 63 + poll: [ 64 + interval, 65 + "free", 66 + (out) => 67 + divide( 68 + out 69 + .split("\n") 70 + .find((line) => line.includes("Mem:")) 71 + ?.split(/\s+/) 72 + .splice(1, 2), 73 + ), 74 + ], 75 75 }); 76 76 77 77 export const temp = Variable(0, { 78 - poll: [interval, "cat " + options.temperature, (n) => n / 100_000], 78 + poll: [interval, "cat " + options.temperature, (n) => n / 100_000], 79 79 });
+35 -35
home/isabel/programs/configs/gui/bars/ags/config/windows/applauncher/AppItem.js
··· 5 5 6 6 /** @param {import('resource:///com/github/Aylur/ags/service/applications.js').Application} app */ 7 7 export default (app) => { 8 - const title = Widget.Label({ 9 - class_name: "title", 10 - label: app.name, 11 - xalign: 0, 12 - vpack: "center", 13 - truncate: "end", 14 - }); 8 + const title = Widget.Label({ 9 + class_name: "title", 10 + label: app.name, 11 + xalign: 0, 12 + vpack: "center", 13 + truncate: "end", 14 + }); 15 15 16 - const description = Widget.Label({ 17 - class_name: "description", 18 - label: app.description || "", 19 - wrap: true, 20 - xalign: 0, 21 - justification: "left", 22 - vpack: "center", 23 - }); 16 + const description = Widget.Label({ 17 + class_name: "description", 18 + label: app.description || "", 19 + wrap: true, 20 + xalign: 0, 21 + justification: "left", 22 + vpack: "center", 23 + }); 24 24 25 - const icon = Widget.Icon({ 26 - icon: lookUpIcon(app.icon_name || "") ? app.icon_name || "" : "", 27 - binds: [["size", options.applauncher.icon_size]], 28 - }); 25 + const icon = Widget.Icon({ 26 + icon: lookUpIcon(app.icon_name || "") ? app.icon_name || "" : "", 27 + binds: [["size", options.applauncher.icon_size]], 28 + }); 29 29 30 - const textBox = Widget.Box({ 31 - vertical: true, 32 - vpack: "center", 33 - children: app.description ? [title, description] : [title], 34 - }); 30 + const textBox = Widget.Box({ 31 + vertical: true, 32 + vpack: "center", 33 + children: app.description ? [title, description] : [title], 34 + }); 35 35 36 - return Widget.Button({ 37 - class_name: "app-item", 38 - setup: (self) => (self.app = app), 39 - on_clicked: () => { 40 - App.closeWindow("applauncher"); 41 - app.launch(); 42 - }, 43 - child: Widget.Box({ 44 - children: [icon, textBox], 45 - }), 46 - }); 36 + return Widget.Button({ 37 + class_name: "app-item", 38 + setup: (self) => (self.app = app), 39 + on_clicked: () => { 40 + App.closeWindow("applauncher"); 41 + app.launch(); 42 + }, 43 + child: Widget.Box({ 44 + children: [icon, textBox], 45 + }), 46 + }); 47 47 };
+57 -57
home/isabel/programs/configs/gui/bars/ags/config/windows/applauncher/Applauncher.js
··· 9 9 const WINDOW_NAME = "applauncher"; 10 10 11 11 const Applauncher = () => { 12 - const children = () => [ 13 - ...Applications.query("").flatMap((app) => { 14 - const item = AppItem(app); 15 - return [ 16 - Widget.Separator({ 17 - hexpand: true, 18 - binds: [["visible", item, "visible"]], 19 - }), 20 - item, 21 - ]; 12 + const children = () => [ 13 + ...Applications.query("").flatMap((app) => { 14 + const item = AppItem(app); 15 + return [ 16 + Widget.Separator({ 17 + hexpand: true, 18 + binds: [["visible", item, "visible"]], 22 19 }), 23 - Widget.Separator({ hexpand: true }), 24 - ]; 20 + item, 21 + ]; 22 + }), 23 + Widget.Separator({ hexpand: true }), 24 + ]; 25 25 26 - const list = Widget.Box({ 27 - vertical: true, 28 - children: children(), 29 - }); 26 + const list = Widget.Box({ 27 + vertical: true, 28 + children: children(), 29 + }); 30 30 31 - const entry = Widget.Entry({ 32 - hexpand: true, 33 - primary_icon_name: icons.apps.search, 34 - text: "-", 35 - on_accept: ({ text }) => { 36 - const list = Applications.query(text || ""); 37 - if (list[0]) { 38 - App.toggleWindow(WINDOW_NAME); 39 - launchApp(list[0]); 40 - } 41 - }, 42 - on_change: ({ text }) => 43 - list.children.map((item) => { 44 - if (item.app) item.visible = item.app.match(text); 45 - }), 46 - }); 31 + const entry = Widget.Entry({ 32 + hexpand: true, 33 + primary_icon_name: icons.apps.search, 34 + text: "-", 35 + on_accept: ({ text }) => { 36 + const list = Applications.query(text || ""); 37 + if (list[0]) { 38 + App.toggleWindow(WINDOW_NAME); 39 + launchApp(list[0]); 40 + } 41 + }, 42 + on_change: ({ text }) => 43 + list.children.map((item) => { 44 + if (item.app) item.visible = item.app.match(text); 45 + }), 46 + }); 47 47 48 - return Widget.Box({ 49 - vertical: true, 50 - children: [ 51 - entry, 52 - Widget.Scrollable({ 53 - hscroll: "never", 54 - child: list, 55 - }), 56 - ], 57 - connections: [ 58 - [ 59 - App, 60 - (_, name, visible) => { 61 - if (name !== WINDOW_NAME) return; 48 + return Widget.Box({ 49 + vertical: true, 50 + children: [ 51 + entry, 52 + Widget.Scrollable({ 53 + hscroll: "never", 54 + child: list, 55 + }), 56 + ], 57 + connections: [ 58 + [ 59 + App, 60 + (_, name, visible) => { 61 + if (name !== WINDOW_NAME) return; 62 62 63 - entry.text = ""; 64 - if (visible) entry.grab_focus(); 65 - }, 66 - ], 67 - ], 68 - }); 63 + entry.text = ""; 64 + if (visible) entry.grab_focus(); 65 + }, 66 + ], 67 + ], 68 + }); 69 69 }; 70 70 71 71 export default () => 72 - PopupWindow({ 73 - name: WINDOW_NAME, 74 - transition: "slide_down", 75 - child: Applauncher(), 76 - }); 72 + PopupWindow({ 73 + name: WINDOW_NAME, 74 + transition: "slide_down", 75 + child: Applauncher(), 76 + });
+64 -66
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/LeftBar.js
··· 17 17 18 18 const submenuItems = Variable(1); 19 19 SystemTray.connect("changed", () => { 20 - submenuItems.setValue(SystemTray.items.length + 1); 20 + submenuItems.setValue(SystemTray.items.length + 1); 21 21 }); 22 22 23 23 /** ··· 26 26 * @param {(self: T) => boolean=} condition 27 27 */ 28 28 const SeparatorDot = (service, condition) => { 29 - const visibility = (self) => { 30 - if (!options.bar.separators.value) return (self.visible = false); 29 + const visibility = (self) => { 30 + if (!options.bar.separators.value) return (self.visible = false); 31 31 32 - self.visible = 33 - condition && service 34 - ? condition(service) 35 - : options.bar.separators.value; 36 - }; 32 + self.visible = 33 + condition && service ? condition(service) : options.bar.separators.value; 34 + }; 37 35 38 - const conn = service ? [[service, visibility]] : []; 39 - return Widget.Separator({ 40 - connections: [["draw", visibility], ...conn], 41 - binds: [["visible", options.bar.separators]], 42 - vpack: "center", 43 - }); 36 + const conn = service ? [[service, visibility]] : []; 37 + return Widget.Separator({ 38 + connections: [["draw", visibility], ...conn], 39 + binds: [["visible", options.bar.separators]], 40 + vpack: "center", 41 + }); 44 42 }; 45 43 46 44 const Start = () => 47 - Widget.Box({ 48 - class_name: "start", 49 - vertical: true, 50 - children: [ 51 - ApplauncherButton(), 52 - Workspaces(), 53 - Widget.Box({ hexpand: true }), 54 - NotificationIndicator(), 55 - ], 56 - }); 45 + Widget.Box({ 46 + class_name: "start", 47 + vertical: true, 48 + children: [ 49 + ApplauncherButton(), 50 + Workspaces(), 51 + Widget.Box({ hexpand: true }), 52 + NotificationIndicator(), 53 + ], 54 + }); 57 55 58 56 const Center = () => 59 - Widget.Box({ 60 - class_name: "center", 61 - vertical: true, 62 - children: [DateButton()], 63 - }); 57 + Widget.Box({ 58 + class_name: "center", 59 + vertical: true, 60 + children: [DateButton()], 61 + }); 64 62 65 63 const End = () => 66 - Widget.Box({ 67 - class_name: "end", 68 - vertical: true, 69 - children: [ 70 - SeparatorDot(Mpris, (m) => m.players.length > 0), 71 - MediaIndicator({ vertical: true }), 72 - Widget.Box({ hexpand: true }), 64 + Widget.Box({ 65 + class_name: "end", 66 + vertical: true, 67 + children: [ 68 + SeparatorDot(Mpris, (m) => m.players.length > 0), 69 + MediaIndicator({ vertical: true }), 70 + Widget.Box({ hexpand: true }), 73 71 74 - SubMenu({ 75 - items: submenuItems, 76 - children: [SysTray({ vertical: true }), ColorPicker()], 77 - }), 78 - SystemIndicators({ vertical: true }), 79 - BatteryBar({ vertical: true }), 80 - PowerMenu({ vertical: true }), 81 - ], 82 - }); 72 + SubMenu({ 73 + items: submenuItems, 74 + children: [SysTray({ vertical: true }), ColorPicker()], 75 + }), 76 + SystemIndicators({ vertical: true }), 77 + BatteryBar({ vertical: true }), 78 + PowerMenu({ vertical: true }), 79 + ], 80 + }); 83 81 84 82 /** @param {number} monitor */ 85 83 export default (monitor) => 86 - Widget.Window({ 87 - name: `bar${monitor}`, 88 - class_name: "transparent", 89 - exclusivity: "exclusive", 90 - monitor, 91 - binds: [ 92 - [ 93 - "anchor", 94 - options.bar.position, 95 - "value", 96 - (pos) => [pos, "left", "bottom"], 97 - ], 98 - ], 99 - child: Widget.CenterBox({ 100 - class_name: "panel", 101 - vertical: true, 102 - start_widget: Start(), 103 - center_widget: Center(), 104 - end_widget: End(), 105 - }), 106 - }); 84 + Widget.Window({ 85 + name: `bar${monitor}`, 86 + class_name: "transparent", 87 + exclusivity: "exclusive", 88 + monitor, 89 + binds: [ 90 + [ 91 + "anchor", 92 + options.bar.position, 93 + "value", 94 + (pos) => [pos, "left", "bottom"], 95 + ], 96 + ], 97 + child: Widget.CenterBox({ 98 + class_name: "panel", 99 + vertical: true, 100 + start_widget: Start(), 101 + center_widget: Center(), 102 + end_widget: End(), 103 + }), 104 + });
+28 -28
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/PanelButton.js
··· 11 11 * @param {import('types/widgets/button').ButtonProps & PanelButtonProps} o 12 12 */ 13 13 export default ({ 14 - class_name, 15 - content, 16 - window = "", 17 - connections = [], 18 - ...rest 14 + class_name, 15 + content, 16 + window = "", 17 + connections = [], 18 + ...rest 19 19 }) => { 20 - let open = false; 20 + let open = false; 21 21 22 - const connection = [ 23 - [ 24 - App, 25 - (self, win, visible) => { 26 - if (win !== window) return; 22 + const connection = [ 23 + [ 24 + App, 25 + (self, win, visible) => { 26 + if (win !== window) return; 27 27 28 - if (open && !visible) { 29 - open = false; 30 - self.toggleClassName("active", false); 31 - } 28 + if (open && !visible) { 29 + open = false; 30 + self.toggleClassName("active", false); 31 + } 32 32 33 - if (visible) { 34 - open = true; 35 - self.toggleClassName("active"); 36 - } 37 - }, 38 - ], 39 - ]; 33 + if (visible) { 34 + open = true; 35 + self.toggleClassName("active"); 36 + } 37 + }, 38 + ], 39 + ]; 40 40 41 - return Widget.Button({ 42 - class_name: `panel-button ${class_name}`, 43 - child: Widget.Box({ children: [content] }), 44 - connections: connections.concat(connection), 45 - ...rest, 46 - }); 41 + return Widget.Button({ 42 + class_name: `panel-button ${class_name}`, 43 + child: Widget.Box({ children: [content] }), 44 + connections: connections.concat(connection), 45 + ...rest, 46 + }); 47 47 };
+60 -62
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/TopBar.js
··· 17 17 18 18 const submenuItems = Variable(1); 19 19 SystemTray.connect("changed", () => { 20 - submenuItems.setValue(SystemTray.items.length + 1); 20 + submenuItems.setValue(SystemTray.items.length + 1); 21 21 }); 22 22 23 23 /** ··· 26 26 * @param {(self: T) => boolean=} condition 27 27 */ 28 28 const SeparatorDot = (service, condition) => { 29 - const visibility = (self) => { 30 - if (!options.bar.separators.value) return (self.visible = false); 29 + const visibility = (self) => { 30 + if (!options.bar.separators.value) return (self.visible = false); 31 31 32 - self.visible = 33 - condition && service 34 - ? condition(service) 35 - : options.bar.separators.value; 36 - }; 32 + self.visible = 33 + condition && service ? condition(service) : options.bar.separators.value; 34 + }; 37 35 38 - const conn = service ? [[service, visibility]] : []; 39 - return Widget.Separator({ 40 - connections: [["draw", visibility], ...conn], 41 - binds: [["visible", options.bar.separators]], 42 - vpack: "center", 43 - }); 36 + const conn = service ? [[service, visibility]] : []; 37 + return Widget.Separator({ 38 + connections: [["draw", visibility], ...conn], 39 + binds: [["visible", options.bar.separators]], 40 + vpack: "center", 41 + }); 44 42 }; 45 43 46 44 const Start = () => 47 - Widget.Box({ 48 - class_name: "start", 49 - children: [ 50 - ApplauncherButton(), 51 - Workspaces(), 52 - Widget.Box({ hexpand: true }), 53 - NotificationIndicator(), 54 - ], 55 - }); 45 + Widget.Box({ 46 + class_name: "start", 47 + children: [ 48 + ApplauncherButton(), 49 + Workspaces(), 50 + Widget.Box({ hexpand: true }), 51 + NotificationIndicator(), 52 + ], 53 + }); 56 54 57 55 const Center = () => 58 - Widget.Box({ 59 - class_name: "center", 60 - children: [DateButton()], 61 - }); 56 + Widget.Box({ 57 + class_name: "center", 58 + children: [DateButton()], 59 + }); 62 60 63 61 const End = () => 64 - Widget.Box({ 65 - class_name: "end", 66 - children: [ 67 - SeparatorDot(Mpris, (m) => m.players.length > 0), 68 - MediaIndicator(), 69 - Widget.Box({ hexpand: true }), 62 + Widget.Box({ 63 + class_name: "end", 64 + children: [ 65 + SeparatorDot(Mpris, (m) => m.players.length > 0), 66 + MediaIndicator(), 67 + Widget.Box({ hexpand: true }), 70 68 71 - SubMenu({ 72 - items: submenuItems, 73 - children: [SysTray(), ColorPicker()], 74 - }), 75 - SystemIndicators(), 76 - BatteryBar(), 77 - PowerMenu(), 78 - ], 79 - }); 69 + SubMenu({ 70 + items: submenuItems, 71 + children: [SysTray(), ColorPicker()], 72 + }), 73 + SystemIndicators(), 74 + BatteryBar(), 75 + PowerMenu(), 76 + ], 77 + }); 80 78 81 79 /** @param {number} monitor */ 82 80 export default (monitor) => 83 - Widget.Window({ 84 - name: `bar${monitor}`, 85 - class_name: "transparent", 86 - exclusivity: "exclusive", 87 - monitor, 88 - binds: [ 89 - [ 90 - "anchor", 91 - options.bar.position, 92 - "value", 93 - (pos) => [pos, "left", "right"], 94 - ], 95 - ], 96 - child: Widget.CenterBox({ 97 - class_name: "panel", 98 - start_widget: Start(), 99 - center_widget: Center(), 100 - end_widget: End(), 101 - }), 102 - }); 81 + Widget.Window({ 82 + name: `bar${monitor}`, 83 + class_name: "transparent", 84 + exclusivity: "exclusive", 85 + monitor, 86 + binds: [ 87 + [ 88 + "anchor", 89 + options.bar.position, 90 + "value", 91 + (pos) => [pos, "left", "right"], 92 + ], 93 + ], 94 + child: Widget.CenterBox({ 95 + class_name: "panel", 96 + start_widget: Start(), 97 + center_widget: Center(), 98 + end_widget: End(), 99 + }), 100 + });
+13 -16
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/ApplauncherButton.js
··· 4 4 import { distroIcon } from "../../../variables.js"; 5 5 6 6 export default () => 7 - PanelButton({ 8 - class_name: "applauncher", 9 - connections: [ 10 - [ 11 - App, 12 - (btn, win, visible) => { 13 - btn.toggleClassName( 14 - "active", 15 - win === "applauncher" && visible, 16 - ); 17 - }, 18 - ], 19 - ], 20 - on_clicked: () => App.toggleWindow("applauncher"), 21 - content: FontIcon(distroIcon), 22 - }); 7 + PanelButton({ 8 + class_name: "applauncher", 9 + connections: [ 10 + [ 11 + App, 12 + (btn, win, visible) => { 13 + btn.toggleClassName("active", win === "applauncher" && visible); 14 + }, 15 + ], 16 + ], 17 + on_clicked: () => App.toggleWindow("applauncher"), 18 + content: FontIcon(distroIcon), 19 + });
+54 -57
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/BatteryBar.js
··· 6 6 import PanelButton from "../PanelButton.js"; 7 7 8 8 const Indicator = () => 9 - Widget.Stack({ 10 - items: [ 11 - ["false", Widget.Icon({ binds: [["icon", Battery, "icon-name"]] })], 12 - ["true", FontIcon(icons.battery.charging)], 13 - ], 14 - connections: [ 15 - [ 16 - Battery, 17 - (stack) => { 18 - stack.shown = `${Battery.charging || Battery.charged}`; 19 - }, 20 - ], 21 - ], 22 - }); 9 + Widget.Stack({ 10 + items: [ 11 + ["false", Widget.Icon({ binds: [["icon", Battery, "icon-name"]] })], 12 + ["true", FontIcon(icons.battery.charging)], 13 + ], 14 + connections: [ 15 + [ 16 + Battery, 17 + (stack) => { 18 + stack.shown = `${Battery.charging || Battery.charged}`; 19 + }, 20 + ], 21 + ], 22 + }); 23 23 24 24 const PercentLabel = () => 25 - Widget.Revealer({ 26 - transition: "slide_right", 27 - binds: [["reveal-child", options.battery.show_percentage]], 28 - child: Widget.Label({ 29 - binds: [["label", Battery, "percent", (p) => `${p}%`]], 30 - }), 31 - }); 25 + Widget.Revealer({ 26 + transition: "slide_right", 27 + binds: [["reveal-child", options.battery.show_percentage]], 28 + child: Widget.Label({ 29 + binds: [["label", Battery, "percent", (p) => `${p}%`]], 30 + }), 31 + }); 32 32 33 33 const LevelBar = () => 34 - Widget.LevelBar({ 35 - vpack: "center", 36 - binds: [["value", Battery, "percent", (p) => p / 100]], 37 - }); 34 + Widget.LevelBar({ 35 + vpack: "center", 36 + binds: [["value", Battery, "percent", (p) => p / 100]], 37 + }); 38 38 39 39 export default () => { 40 - const revaler = PercentLabel(); 40 + const revaler = PercentLabel(); 41 41 42 - return PanelButton({ 43 - class_name: "battery-bar", 44 - on_clicked: () => { 45 - const v = options.battery.show_percentage.value; 46 - options.battery.show_percentage.value = !v; 47 - }, 48 - content: Widget.Box({ 49 - binds: [["visible", Battery, "available"]], 50 - connections: [ 51 - [ 52 - Battery, 53 - (w) => { 54 - w.toggleClassName( 55 - "charging", 56 - Battery.charging || Battery.charged, 57 - ); 58 - w.toggleClassName( 59 - "medium", 60 - Battery.percent < options.battery.medium.value, 61 - ); 62 - w.toggleClassName( 63 - "low", 64 - Battery.percent < options.battery.low.value, 65 - ); 66 - w.toggleClassName("half", Battery.percent < 48); 67 - }, 68 - ], 69 - ], 70 - children: [Indicator(), Widget.Box({ child: revaler }), LevelBar()], 71 - }), 72 - }); 42 + return PanelButton({ 43 + class_name: "battery-bar", 44 + on_clicked: () => { 45 + const v = options.battery.show_percentage.value; 46 + options.battery.show_percentage.value = !v; 47 + }, 48 + content: Widget.Box({ 49 + binds: [["visible", Battery, "available"]], 50 + connections: [ 51 + [ 52 + Battery, 53 + (w) => { 54 + w.toggleClassName("charging", Battery.charging || Battery.charged); 55 + w.toggleClassName( 56 + "medium", 57 + Battery.percent < options.battery.medium.value, 58 + ); 59 + w.toggleClassName( 60 + "low", 61 + Battery.percent < options.battery.low.value, 62 + ); 63 + w.toggleClassName("half", Battery.percent < 48); 64 + }, 65 + ], 66 + ], 67 + children: [Indicator(), Widget.Box({ child: revaler }), LevelBar()], 68 + }), 69 + }); 73 70 };
+19 -21
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/ColorPicker.js
··· 4 4 import Gdk from "gi://Gdk"; 5 5 6 6 export default () => 7 - PanelButton({ 8 - class_name: "color-picker", 9 - content: Widget.Icon("color-select-symbolic"), 10 - binds: [ 11 - ["tooltip-text", Colors, "colors", (v) => `${v.length} colors`], 12 - ], 13 - on_clicked: () => Colors.pick(), 7 + PanelButton({ 8 + class_name: "color-picker", 9 + content: Widget.Icon("color-select-symbolic"), 10 + binds: [["tooltip-text", Colors, "colors", (v) => `${v.length} colors`]], 11 + on_clicked: () => Colors.pick(), 14 12 15 - on_secondary_click: (btn) => { 16 - if (Colors.colors.length === 0) return; 13 + on_secondary_click: (btn) => { 14 + if (Colors.colors.length === 0) return; 17 15 18 - Widget.Menu({ 19 - class_name: "colorpicker", 20 - children: Colors.colors.map((color) => 21 - Widget.MenuItem({ 22 - child: Widget.Label(color), 23 - css: `background-color: ${color}`, 24 - on_activate: () => Colors.wlCopy(color), 25 - }), 26 - ), 27 - }).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null); 28 - }, 29 - }); 16 + Widget.Menu({ 17 + class_name: "colorpicker", 18 + children: Colors.colors.map((color) => 19 + Widget.MenuItem({ 20 + child: Widget.Label(color), 21 + css: `background-color: ${color}`, 22 + on_activate: () => Colors.wlCopy(color), 23 + }), 24 + ), 25 + }).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null); 26 + }, 27 + });
+6 -6
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/DateButton.js
··· 3 3 import PanelButton from "../PanelButton.js"; 4 4 5 5 export default ({ format = "%I:%M:%S | %d/%m/%y" } = {}) => 6 - PanelButton({ 7 - class_name: "dashboard panel-button", 8 - on_clicked: () => App.toggleWindow("dashboard"), 9 - window: "dashboard", 10 - content: Clock({ format }), 11 - }); 6 + PanelButton({ 7 + class_name: "dashboard panel-button", 8 + on_clicked: () => App.toggleWindow("dashboard"), 9 + window: "dashboard", 10 + content: Clock({ format }), 11 + });
+56 -56
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/MediaIndicator.js
··· 6 6 import options from "../../../options.js"; 7 7 8 8 export const getPlayer = (name = options.mpris.preferred.value) => 9 - Mpris.getPlayer(name) || Mpris.players[0] || null; 9 + Mpris.getPlayer(name) || Mpris.players[0] || null; 10 10 11 11 /** 12 12 * @param {Object} o ··· 14 14 * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction 15 15 */ 16 16 const Indicator = ({ player, direction = "right" }) => 17 - HoverRevealer({ 18 - class_name: `media panel-button ${player.name}`, 19 - direction, 20 - on_primary_click: () => player.playPause(), 21 - on_scroll_up: () => player.next(), 22 - on_scroll_down: () => player.previous(), 23 - on_secondary_click: () => player.playPause(), 24 - indicator: mpris.PlayerIcon(player), 25 - child: Widget.Label({ 26 - vexpand: true, 27 - truncate: "end", 28 - max_width_chars: 40, 29 - connections: [ 30 - [ 31 - player, 32 - (label) => { 33 - label.label = `${player.track_artists.join(", ")} - ${ 34 - player.track_title 35 - }`; 36 - }, 37 - ], 38 - ], 39 - }), 40 - connections: [ 41 - [ 42 - player, 43 - (revealer) => { 44 - if (revealer._current === player.track_title) return; 45 - 46 - revealer._current = player.track_title; 47 - revealer.reveal_child = true; 48 - Utils.timeout(3000, () => { 49 - revealer.reveal_child = false; 50 - }); 51 - }, 52 - ], 17 + HoverRevealer({ 18 + class_name: `media panel-button ${player.name}`, 19 + direction, 20 + on_primary_click: () => player.playPause(), 21 + on_scroll_up: () => player.next(), 22 + on_scroll_down: () => player.previous(), 23 + on_secondary_click: () => player.playPause(), 24 + indicator: mpris.PlayerIcon(player), 25 + child: Widget.Label({ 26 + vexpand: true, 27 + truncate: "end", 28 + max_width_chars: 40, 29 + connections: [ 30 + [ 31 + player, 32 + (label) => { 33 + label.label = `${player.track_artists.join(", ")} - ${ 34 + player.track_title 35 + }`; 36 + }, 53 37 ], 54 - }); 38 + ], 39 + }), 40 + connections: [ 41 + [ 42 + player, 43 + (revealer) => { 44 + if (revealer._current === player.track_title) return; 45 + 46 + revealer._current = player.track_title; 47 + revealer.reveal_child = true; 48 + Utils.timeout(3000, () => { 49 + revealer.reveal_child = false; 50 + }); 51 + }, 52 + ], 53 + ], 54 + }); 55 55 56 56 /** 57 57 * @param {Object} o 58 58 * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction 59 59 */ 60 60 export default ({ direction = "right" } = {}) => { 61 - let current = null; 61 + let current = null; 62 62 63 - const update = (box) => { 64 - const player = getPlayer(); 65 - box.visible = !!player; 63 + const update = (box) => { 64 + const player = getPlayer(); 65 + box.visible = !!player; 66 66 67 - if (!player) { 68 - current = null; 69 - return; 70 - } 67 + if (!player) { 68 + current = null; 69 + return; 70 + } 71 71 72 - if (current === player) return; 72 + if (current === player) return; 73 73 74 - current = player; 75 - box.children = [Indicator({ player, direction })]; 76 - }; 74 + current = player; 75 + box.children = [Indicator({ player, direction })]; 76 + }; 77 77 78 - return Widget.Box({ 79 - connections: [ 80 - [options.mpris.preferred, update], 81 - [Mpris, update, "notify::players"], 82 - ], 83 - }); 78 + return Widget.Box({ 79 + connections: [ 80 + [options.mpris.preferred, update], 81 + [Mpris, update, "notify::players"], 82 + ], 83 + }); 84 84 };
+44 -52
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/NotificationIndicator.js
··· 10 10 * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction 11 11 */ 12 12 export default ({ direction = "left" } = {}) => 13 - HoverRevealer({ 14 - class_name: "notifications panel-button", 15 - eventboxConnections: [ 16 - ["button-press-event", () => App.openWindow("dashboard")], 17 - [ 18 - Notifications, 19 - (box) => 20 - (box.visible = 21 - Notifications.notifications.length > 0 || 22 - Notifications.dnd), 23 - ], 24 - ], 25 - connections: [ 26 - [ 27 - Notifications, 28 - (revealer) => { 29 - const title = Notifications.notifications[0]?.summary; 30 - if (revealer._title === title) return; 13 + HoverRevealer({ 14 + class_name: "notifications panel-button", 15 + eventboxConnections: [ 16 + ["button-press-event", () => App.openWindow("dashboard")], 17 + [ 18 + Notifications, 19 + (box) => 20 + (box.visible = 21 + Notifications.notifications.length > 0 || Notifications.dnd), 22 + ], 23 + ], 24 + connections: [ 25 + [ 26 + Notifications, 27 + (revealer) => { 28 + const title = Notifications.notifications[0]?.summary; 29 + if (revealer._title === title) return; 31 30 32 - revealer._title = title; 33 - revealer.reveal_child = true; 34 - Utils.timeout(3000, () => { 35 - revealer.reveal_child = false; 36 - }); 37 - }, 38 - ], 31 + revealer._title = title; 32 + revealer.reveal_child = true; 33 + Utils.timeout(3000, () => { 34 + revealer.reveal_child = false; 35 + }); 36 + }, 37 + ], 38 + ], 39 + direction, 40 + indicator: Widget.Icon({ 41 + binds: [ 42 + [ 43 + "icon", 44 + Notifications, 45 + "dnd", 46 + (dnd) => 47 + dnd ? icons.notifications.silent : icons.notifications.noisy, 39 48 ], 40 - direction, 41 - indicator: Widget.Icon({ 42 - binds: [ 43 - [ 44 - "icon", 45 - Notifications, 46 - "dnd", 47 - (dnd) => 48 - dnd 49 - ? icons.notifications.silent 50 - : icons.notifications.noisy, 51 - ], 52 - ], 53 - }), 54 - child: Widget.Label({ 55 - truncate: "end", 56 - max_width_chars: 40, 57 - binds: [ 58 - [ 59 - "label", 60 - Notifications, 61 - "notifications", 62 - (n) => n[0]?.summary || "", 63 - ], 64 - ], 65 - }), 66 - }); 49 + ], 50 + }), 51 + child: Widget.Label({ 52 + truncate: "end", 53 + max_width_chars: 40, 54 + binds: [ 55 + ["label", Notifications, "notifications", (n) => n[0]?.summary || ""], 56 + ], 57 + }), 58 + });
+5 -5
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/PowerMenu.js
··· 4 4 import PanelButton from "../PanelButton.js"; 5 5 6 6 export default () => 7 - PanelButton({ 8 - class_name: "powermenu", 9 - content: Widget.Icon(icons.powermenu.shutdown), 10 - on_clicked: () => App.openWindow("powermenu"), 11 - }); 7 + PanelButton({ 8 + class_name: "powermenu", 9 + content: Widget.Icon(icons.powermenu.shutdown), 10 + on_clicked: () => App.openWindow("powermenu"), 11 + });
+45 -45
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SubMenu.js
··· 10 10 * @param {import('types/variable').Variable} items 11 11 */ 12 12 const Arrow = (revealer, direction, items) => { 13 - let deg = 0; 13 + let deg = 0; 14 14 15 - const icon = Widget.Icon({ 16 - icon: icons.ui.arrow[direction], 17 - }); 15 + const icon = Widget.Icon({ 16 + icon: icons.ui.arrow[direction], 17 + }); 18 18 19 - const animate = () => { 20 - const t = options.transition.value / 20; 21 - const step = revealer.reveal_child ? 10 : -10; 22 - for (let i = 0; i < 18; ++i) { 23 - Utils.timeout(t * i, () => { 24 - deg += step; 25 - icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); 26 - }); 27 - } 28 - }; 19 + const animate = () => { 20 + const t = options.transition.value / 20; 21 + const step = revealer.reveal_child ? 10 : -10; 22 + for (let i = 0; i < 18; ++i) { 23 + Utils.timeout(t * i, () => { 24 + deg += step; 25 + icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); 26 + }); 27 + } 28 + }; 29 29 30 - return Widget.Button({ 31 - class_name: "panel-button sub-menu", 32 - connections: [ 33 - [ 34 - items, 35 - (btn) => { 36 - btn.tooltip_text = `${items.value} Items`; 37 - }, 38 - ], 39 - ], 40 - on_clicked: () => { 41 - animate(); 42 - revealer.reveal_child = !revealer.reveal_child; 30 + return Widget.Button({ 31 + class_name: "panel-button sub-menu", 32 + connections: [ 33 + [ 34 + items, 35 + (btn) => { 36 + btn.tooltip_text = `${items.value} Items`; 43 37 }, 44 - child: icon, 45 - }); 38 + ], 39 + ], 40 + on_clicked: () => { 41 + animate(); 42 + revealer.reveal_child = !revealer.reveal_child; 43 + }, 44 + child: icon, 45 + }); 46 46 }; 47 47 48 48 /** ··· 52 52 * @param {import('types/variable').Variable} o.items 53 53 */ 54 54 export default ({ children, direction = "left", items = Variable(0) }) => { 55 - const posStart = direction === "up" || direction === "left"; 56 - const posEnd = direction === "down" || direction === "right"; 57 - const revealer = Widget.Revealer({ 58 - transition: `slide_${direction}`, 59 - child: Widget.Box({ 60 - children, 61 - }), 62 - }); 55 + const posStart = direction === "up" || direction === "left"; 56 + const posEnd = direction === "down" || direction === "right"; 57 + const revealer = Widget.Revealer({ 58 + transition: `slide_${direction}`, 59 + child: Widget.Box({ 60 + children, 61 + }), 62 + }); 63 63 64 - return Widget.Box({ 65 - vertical: direction === "up" || direction === "down", 66 - children: [ 67 - posStart && revealer, 68 - Arrow(revealer, direction, items), 69 - posEnd && revealer, 70 - ], 71 - }); 64 + return Widget.Box({ 65 + vertical: direction === "up" || direction === "down", 66 + children: [ 67 + posStart && revealer, 68 + Arrow(revealer, direction, items), 69 + posEnd && revealer, 70 + ], 71 + }); 72 72 };
+33 -33
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SysTray.js
··· 5 5 6 6 /** @param {import('types/service/systemtray').TrayItem} item */ 7 7 const SysTrayItem = (item) => 8 - PanelButton({ 9 - class_name: "tray-item", 10 - content: Widget.Icon({ binds: [["icon", item, "icon"]] }), 11 - binds: [["tooltipMarkup", item, "tooltip-markup"]], 12 - setup: (btn) => { 13 - const id = item.menu?.connect("popped-up", (menu) => { 14 - btn.toggleClassName("active"); 15 - menu.connect("notify::visible", (menu) => { 16 - btn.toggleClassName("active", menu.visible); 17 - }); 18 - menu.disconnect(id); 19 - }); 20 - }, 21 - // @ts-expect-error popup_at_widget missing from types? 22 - on_primary_click: (btn) => 23 - item.menu?.popup_at_widget( 24 - btn, 25 - Gdk.Gravity.SOUTH, 26 - Gdk.Gravity.NORTH, 27 - null, 28 - ), 8 + PanelButton({ 9 + class_name: "tray-item", 10 + content: Widget.Icon({ binds: [["icon", item, "icon"]] }), 11 + binds: [["tooltipMarkup", item, "tooltip-markup"]], 12 + setup: (btn) => { 13 + const id = item.menu?.connect("popped-up", (menu) => { 14 + btn.toggleClassName("active"); 15 + menu.connect("notify::visible", (menu) => { 16 + btn.toggleClassName("active", menu.visible); 17 + }); 18 + menu.disconnect(id); 19 + }); 20 + }, 21 + // @ts-expect-error popup_at_widget missing from types? 22 + on_primary_click: (btn) => 23 + item.menu?.popup_at_widget( 24 + btn, 25 + Gdk.Gravity.SOUTH, 26 + Gdk.Gravity.NORTH, 27 + null, 28 + ), 29 29 30 - // @ts-expect-error popup_at_widget missing from types? 31 - on_secondary_click: (btn) => 32 - item.menu?.popup_at_widget( 33 - btn, 34 - Gdk.Gravity.SOUTH, 35 - Gdk.Gravity.NORTH, 36 - null, 37 - ), 38 - }); 30 + // @ts-expect-error popup_at_widget missing from types? 31 + on_secondary_click: (btn) => 32 + item.menu?.popup_at_widget( 33 + btn, 34 + Gdk.Gravity.SOUTH, 35 + Gdk.Gravity.NORTH, 36 + null, 37 + ), 38 + }); 39 39 40 40 export default () => 41 - Widget.Box({ 42 - binds: [["children", SystemTray, "items", (i) => i.map(SysTrayItem)]], 43 - }); 41 + Widget.Box({ 42 + binds: [["children", SystemTray, "items", (i) => i.map(SysTrayItem)]], 43 + });
+114 -122
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SystemIndicators.js
··· 10 10 import icons from "../../../icons.js"; 11 11 12 12 const MicrophoneIndicator = () => 13 - Widget.Icon({ 14 - connections: [ 15 - [ 16 - Audio, 17 - (icon) => { 18 - if (!Audio.microphone) return; 13 + Widget.Icon({ 14 + connections: [ 15 + [ 16 + Audio, 17 + (icon) => { 18 + if (!Audio.microphone) return; 19 19 20 - const { muted, low, medium, high } = icons.audio.mic; 21 - if (Audio.microphone.is_muted) return (icon.icon = muted); 20 + const { muted, low, medium, high } = icons.audio.mic; 21 + if (Audio.microphone.is_muted) return (icon.icon = muted); 22 22 23 - /** @type {Array<[number, string]>} */ 24 - const cons = [ 25 - [67, high], 26 - [34, medium], 27 - [1, low], 28 - [0, muted], 29 - ]; 30 - icon.icon = 31 - cons.find( 32 - ([n]) => n <= Audio.microphone.volume * 100, 33 - )?.[1] || ""; 23 + /** @type {Array<[number, string]>} */ 24 + const cons = [ 25 + [67, high], 26 + [34, medium], 27 + [1, low], 28 + [0, muted], 29 + ]; 30 + icon.icon = 31 + cons.find(([n]) => n <= Audio.microphone.volume * 100)?.[1] || ""; 34 32 35 - icon.visible = 36 - Audio.recorders.length > 0 || Audio.microphone.is_muted; 37 - }, 38 - ], 39 - ], 40 - }); 33 + icon.visible = 34 + Audio.recorders.length > 0 || Audio.microphone.is_muted; 35 + }, 36 + ], 37 + ], 38 + }); 41 39 42 40 const DNDIndicator = () => 43 - Widget.Icon({ 44 - icon: icons.notifications.silent, 45 - binds: [["visible", Notifications, "dnd"]], 46 - }); 41 + Widget.Icon({ 42 + icon: icons.notifications.silent, 43 + binds: [["visible", Notifications, "dnd"]], 44 + }); 47 45 48 46 const BluetoothDevicesIndicator = () => 49 - Widget.Box({ 50 - connections: [ 51 - [ 52 - Bluetooth, 53 - (box) => { 54 - box.children = Bluetooth.connectedDevices.map( 55 - ({ iconName, name }) => 56 - HoverRevealer({ 57 - indicator: Widget.Icon(iconName + "-symbolic"), 58 - child: Widget.Label(name), 59 - }), 60 - ); 47 + Widget.Box({ 48 + connections: [ 49 + [ 50 + Bluetooth, 51 + (box) => { 52 + box.children = Bluetooth.connectedDevices.map(({ iconName, name }) => 53 + HoverRevealer({ 54 + indicator: Widget.Icon(iconName + "-symbolic"), 55 + child: Widget.Label(name), 56 + }), 57 + ); 61 58 62 - box.visible = Bluetooth.connectedDevices.length > 0; 63 - }, 64 - "notify::connected-devices", 65 - ], 66 - ], 67 - }); 59 + box.visible = Bluetooth.connectedDevices.length > 0; 60 + }, 61 + "notify::connected-devices", 62 + ], 63 + ], 64 + }); 68 65 69 66 const BluetoothIndicator = () => 70 - Widget.Icon({ 71 - class_name: "bluetooth", 72 - icon: icons.bluetooth.enabled, 73 - binds: [["visible", Bluetooth, "enabled"]], 74 - }); 67 + Widget.Icon({ 68 + class_name: "bluetooth", 69 + icon: icons.bluetooth.enabled, 70 + binds: [["visible", Bluetooth, "enabled"]], 71 + }); 75 72 76 73 const NetworkIndicator = () => 77 - Widget.Icon({ 78 - connections: [ 79 - [ 80 - Network, 81 - (self) => { 82 - const icon = Network[Network.primary || "wifi"]?.iconName; 83 - self.icon = icon || ""; 84 - self.visible = icon; 85 - }, 86 - ], 87 - ], 88 - }); 74 + Widget.Icon({ 75 + connections: [ 76 + [ 77 + Network, 78 + (self) => { 79 + const icon = Network[Network.primary || "wifi"]?.iconName; 80 + self.icon = icon || ""; 81 + self.visible = icon; 82 + }, 83 + ], 84 + ], 85 + }); 89 86 90 87 const AudioIndicator = () => 91 - Widget.Icon({ 92 - connections: [ 93 - [ 94 - Audio, 95 - (icon) => { 96 - if (!Audio.speaker) return; 88 + Widget.Icon({ 89 + connections: [ 90 + [ 91 + Audio, 92 + (icon) => { 93 + if (!Audio.speaker) return; 97 94 98 - const { muted, low, medium, high, overamplified } = 99 - icons.audio.volume; 100 - if (Audio.speaker.is_muted) return (icon.icon = muted); 95 + const { muted, low, medium, high, overamplified } = 96 + icons.audio.volume; 97 + if (Audio.speaker.is_muted) return (icon.icon = muted); 101 98 102 - /** @type {Array<[number, string]>} */ 103 - const cons = [ 104 - [101, overamplified], 105 - [67, high], 106 - [34, medium], 107 - [1, low], 108 - [0, muted], 109 - ]; 110 - icon.icon = 111 - cons.find( 112 - ([n]) => n <= Audio.speaker.volume * 100, 113 - )?.[1] || ""; 114 - }, 115 - "speaker-changed", 116 - ], 117 - ], 118 - }); 99 + /** @type {Array<[number, string]>} */ 100 + const cons = [ 101 + [101, overamplified], 102 + [67, high], 103 + [34, medium], 104 + [1, low], 105 + [0, muted], 106 + ]; 107 + icon.icon = 108 + cons.find(([n]) => n <= Audio.speaker.volume * 100)?.[1] || ""; 109 + }, 110 + "speaker-changed", 111 + ], 112 + ], 113 + }); 119 114 120 115 export default () => 121 - PanelButton({ 122 - class_name: "quicksettings panel-button", 123 - on_clicked: () => App.toggleWindow("quicksettings"), 124 - on_scroll_up: () => { 125 - Audio.speaker.volume += 0.02; 126 - Indicator.speaker(); 116 + PanelButton({ 117 + class_name: "quicksettings panel-button", 118 + on_clicked: () => App.toggleWindow("quicksettings"), 119 + on_scroll_up: () => { 120 + Audio.speaker.volume += 0.02; 121 + Indicator.speaker(); 122 + }, 123 + on_scroll_down: () => { 124 + Audio.speaker.volume -= 0.02; 125 + Indicator.speaker(); 126 + }, 127 + connections: [ 128 + [ 129 + App, 130 + (btn, win, visible) => { 131 + btn.toggleClassName("active", win === "quicksettings" && visible); 127 132 }, 128 - on_scroll_down: () => { 129 - Audio.speaker.volume -= 0.02; 130 - Indicator.speaker(); 131 - }, 132 - connections: [ 133 - [ 134 - App, 135 - (btn, win, visible) => { 136 - btn.toggleClassName( 137 - "active", 138 - win === "quicksettings" && visible, 139 - ); 140 - }, 141 - ], 142 - ], 143 - child: Widget.Box({ 144 - children: [ 145 - DNDIndicator(), 146 - BluetoothDevicesIndicator(), 147 - BluetoothIndicator(), 148 - NetworkIndicator(), 149 - AudioIndicator(), 150 - MicrophoneIndicator(), 151 - ], 152 - }), 153 - }); 133 + ], 134 + ], 135 + child: Widget.Box({ 136 + children: [ 137 + DNDIndicator(), 138 + BluetoothDevicesIndicator(), 139 + BluetoothIndicator(), 140 + NetworkIndicator(), 141 + AudioIndicator(), 142 + MicrophoneIndicator(), 143 + ], 144 + }), 145 + });
+52 -55
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/Workspaces.js
··· 6 6 7 7 /** @param {any} arg */ 8 8 const dispatch = (arg) => () => 9 - Utils.execAsync(`hyprctl dispatch workspace ${arg}`); 9 + Utils.execAsync(`hyprctl dispatch workspace ${arg}`); 10 10 11 11 const Workspaces = () => { 12 - const ws = options.workspaces.value; 13 - return Widget.Box({ 14 - children: range(ws || 20).map((i) => 15 - Widget.Button({ 16 - setup: (btn) => (btn.id = i), 17 - on_clicked: () => dispatch(i), 18 - child: Widget.Label({ 19 - label: `${i}`, 20 - class_name: "indicator", 21 - vpack: "center", 22 - }), 23 - connections: [ 24 - [ 25 - Hyprland, 26 - (btn) => { 27 - btn.toggleClassName( 28 - "active", 29 - Hyprland.active.workspace.id === i, 30 - ); 31 - btn.toggleClassName( 32 - "occupied", 33 - Hyprland.getWorkspace(i)?.windows > 0, 34 - ); 35 - }, 36 - ], 37 - ], 38 - }), 39 - ), 40 - connections: ws 41 - ? [] 42 - : [ 43 - [ 44 - Hyprland.active.workspace, 45 - (box) => 46 - box.children.map((btn) => { 47 - btn.visible = Hyprland.workspaces.some( 48 - (ws) => ws.id === btn.id, 49 - ); 50 - }), 51 - ], 52 - ], 53 - }); 12 + const ws = options.workspaces.value; 13 + return Widget.Box({ 14 + children: range(ws || 20).map((i) => 15 + Widget.Button({ 16 + setup: (btn) => (btn.id = i), 17 + on_clicked: () => dispatch(i), 18 + child: Widget.Label({ 19 + label: `${i}`, 20 + class_name: "indicator", 21 + vpack: "center", 22 + }), 23 + connections: [ 24 + [ 25 + Hyprland, 26 + (btn) => { 27 + btn.toggleClassName("active", Hyprland.active.workspace.id === i); 28 + btn.toggleClassName( 29 + "occupied", 30 + Hyprland.getWorkspace(i)?.windows > 0, 31 + ); 32 + }, 33 + ], 34 + ], 35 + }), 36 + ), 37 + connections: ws 38 + ? [] 39 + : [ 40 + [ 41 + Hyprland.active.workspace, 42 + (box) => 43 + box.children.map((btn) => { 44 + btn.visible = Hyprland.workspaces.some( 45 + (ws) => ws.id === btn.id, 46 + ); 47 + }), 48 + ], 49 + ], 50 + }); 54 51 }; 55 52 56 53 export default () => 57 - Widget.EventBox({ 58 - class_name: "workspaces panel-button", 59 - child: Widget.Box({ 60 - // its nested like this to keep it consistent with other PanelButton widgets 61 - child: Widget.EventBox({ 62 - on_scroll_up: () => dispatch("m+1"), 63 - on_scroll_down: () => dispatch("m-1"), 64 - class_name: "eventbox", 65 - binds: [["child", options.workspaces, "value", Workspaces]], 66 - }), 67 - }), 68 - }); 54 + Widget.EventBox({ 55 + class_name: "workspaces panel-button", 56 + child: Widget.Box({ 57 + // its nested like this to keep it consistent with other PanelButton widgets 58 + child: Widget.EventBox({ 59 + on_scroll_up: () => dispatch("m+1"), 60 + on_scroll_down: () => dispatch("m-1"), 61 + class_name: "eventbox", 62 + binds: [["child", options.workspaces, "value", Workspaces]], 63 + }), 64 + }), 65 + });
+22 -22
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/Dashboard.js
··· 10 10 * @param {import('../../misc/PopupWindow.js').PopopWindowProps['layout']=} o.layout 11 11 */ 12 12 export default () => 13 - PopupWindow({ 14 - name: "dashboard", 15 - connections: [ 16 - [ 17 - options.bar.position, 18 - (self) => { 19 - self.anchor = [options.bar.position.value]; 20 - if (options.bar.position.value === "top") 21 - self.transition = "slide_down"; 13 + PopupWindow({ 14 + name: "dashboard", 15 + connections: [ 16 + [ 17 + options.bar.position, 18 + (self) => { 19 + self.anchor = [options.bar.position.value]; 20 + if (options.bar.position.value === "top") 21 + self.transition = "slide_down"; 22 22 23 - if (options.bar.position.value === "bottom") 24 - self.transition = "slide_up"; 25 - }, 26 - ], 27 - ], 28 - child: Widget.Box({ 29 - children: [ 30 - NotificationColumn(), 31 - Widget.Separator({ orientation: 1 }), 32 - DateColumn(), 33 - ], 34 - }), 35 - }); 23 + if (options.bar.position.value === "bottom") 24 + self.transition = "slide_up"; 25 + }, 26 + ], 27 + ], 28 + child: Widget.Box({ 29 + children: [ 30 + NotificationColumn(), 31 + Widget.Separator({ orientation: 1 }), 32 + DateColumn(), 33 + ], 34 + }), 35 + });
+51 -58
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/DateColumn.js
··· 10 10 * @param {string} unit 11 11 */ 12 12 const SysProgress = (type, title, unit) => 13 - Widget.Box({ 14 - class_name: `circular-progress-box ${type}`, 15 - hexpand: true, 16 - binds: [ 17 - [ 18 - "tooltipText", 19 - vars[type], 20 - "value", 21 - (v) => `${title}: ${Math.floor(v * 100)}${unit}`, 22 - ], 23 - ], 24 - child: Widget.CircularProgress({ 25 - hexpand: true, 26 - class_name: `circular-progress ${type}`, 27 - child: Widget.Icon(icons.system[type]), 28 - start_at: 0.75, 29 - binds: [ 30 - ["value", vars[type]], 31 - ["rounded", options.radii, "value", (v) => v > 0], 32 - ], 33 - }), 34 - }); 13 + Widget.Box({ 14 + class_name: `circular-progress-box ${type}`, 15 + hexpand: true, 16 + binds: [ 17 + [ 18 + "tooltipText", 19 + vars[type], 20 + "value", 21 + (v) => `${title}: ${Math.floor(v * 100)}${unit}`, 22 + ], 23 + ], 24 + child: Widget.CircularProgress({ 25 + hexpand: true, 26 + class_name: `circular-progress ${type}`, 27 + child: Widget.Icon(icons.system[type]), 28 + start_at: 0.75, 29 + binds: [ 30 + ["value", vars[type]], 31 + ["rounded", options.radii, "value", (v) => v > 0], 32 + ], 33 + }), 34 + }); 35 35 36 36 export default () => 37 - Widget.Box({ 37 + Widget.Box({ 38 + vertical: true, 39 + class_name: "datemenu vertical", 40 + children: [ 41 + Widget.Box({ 42 + class_name: "clock-box", 38 43 vertical: true, 39 - class_name: "datemenu vertical", 44 + children: [ 45 + Clock({ format: "%I:%M" }), 46 + Widget.Label({ 47 + class_name: "uptime", 48 + binds: [["label", vars.uptime, "value", (t) => `uptime: ${t}`]], 49 + }), 50 + ], 51 + }), 52 + Widget.Box({ 53 + class_name: "calendar", 54 + child: Widget.Calendar({ 55 + hexpand: true, 56 + hpack: "center", 57 + }), 58 + }), 59 + Widget.Box({ 60 + class_name: "system-info horizontal", 40 61 children: [ 41 - Widget.Box({ 42 - class_name: "clock-box", 43 - vertical: true, 44 - children: [ 45 - Clock({ format: "%I:%M" }), 46 - Widget.Label({ 47 - class_name: "uptime", 48 - binds: [ 49 - [ 50 - "label", 51 - vars.uptime, 52 - "value", 53 - (t) => `uptime: ${t}`, 54 - ], 55 - ], 56 - }), 57 - ], 58 - }), 59 - Widget.Box({ 60 - class_name: "calendar", 61 - child: Widget.Calendar({ 62 - hexpand: true, 63 - hpack: "center", 64 - }), 65 - }), 66 - Widget.Box({ 67 - class_name: "system-info horizontal", 68 - children: [ 69 - SysProgress("cpu", "Cpu", "%"), 70 - SysProgress("ram", "Ram", "%"), 71 - SysProgress("temp", "Temperature", "°"), 72 - ], 73 - }), 62 + SysProgress("cpu", "Cpu", "%"), 63 + SysProgress("ram", "Ram", "%"), 64 + SysProgress("temp", "Temperature", "°"), 74 65 ], 75 - }); 66 + }), 67 + ], 68 + });
+72 -79
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/NotificationColumn.js
··· 5 5 import { timeout } from "resource:///com/github/Aylur/ags/utils.js"; 6 6 7 7 const ClearButton = () => 8 - Widget.Button({ 9 - on_clicked: () => { 10 - const list = Array.from(Notifications.notifications); 11 - for (let i = 0; i < list.length; i++) 12 - timeout(50 * i, () => list[i]?.close()); 13 - }, 14 - binds: [ 15 - ["sensitive", Notifications, "notifications", (n) => n.length > 0], 16 - ], 17 - child: Widget.Box({ 18 - children: [ 19 - Widget.Label("Clear "), 20 - Widget.Icon({ 21 - binds: [ 22 - [ 23 - "icon", 24 - Notifications, 25 - "notifications", 26 - (n) => 27 - n.length > 0 28 - ? icons.trash.full 29 - : icons.trash.empty, 30 - ], 31 - ], 32 - }), 8 + Widget.Button({ 9 + on_clicked: () => { 10 + const list = Array.from(Notifications.notifications); 11 + for (let i = 0; i < list.length; i++) 12 + timeout(50 * i, () => list[i]?.close()); 13 + }, 14 + binds: [["sensitive", Notifications, "notifications", (n) => n.length > 0]], 15 + child: Widget.Box({ 16 + children: [ 17 + Widget.Label("Clear "), 18 + Widget.Icon({ 19 + binds: [ 20 + [ 21 + "icon", 22 + Notifications, 23 + "notifications", 24 + (n) => (n.length > 0 ? icons.trash.full : icons.trash.empty), 33 25 ], 26 + ], 34 27 }), 35 - }); 28 + ], 29 + }), 30 + }); 36 31 37 32 const Header = () => 38 - Widget.Box({ 39 - class_name: "header", 40 - children: [ 41 - Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }), 42 - ClearButton(), 43 - ], 44 - }); 33 + Widget.Box({ 34 + class_name: "header", 35 + children: [ 36 + Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }), 37 + ClearButton(), 38 + ], 39 + }); 45 40 46 41 const NotificationList = () => 47 - Widget.Box({ 48 - vertical: true, 49 - vexpand: true, 50 - connections: [ 51 - [ 52 - Notifications, 53 - (box) => { 54 - box.children = Notifications.notifications 55 - .reverse() 56 - .map(Notification); 42 + Widget.Box({ 43 + vertical: true, 44 + vexpand: true, 45 + connections: [ 46 + [ 47 + Notifications, 48 + (box) => { 49 + box.children = Notifications.notifications 50 + .reverse() 51 + .map(Notification); 57 52 58 - box.visible = Notifications.notifications.length > 0; 59 - }, 60 - ], 61 - ], 62 - }); 53 + box.visible = Notifications.notifications.length > 0; 54 + }, 55 + ], 56 + ], 57 + }); 63 58 64 59 const Placeholder = () => 65 - Widget.Box({ 66 - class_name: "placeholder", 67 - vertical: true, 68 - vpack: "center", 69 - hpack: "center", 70 - vexpand: true, 71 - hexpand: true, 72 - children: [ 73 - Widget.Icon(icons.notifications.silent), 74 - Widget.Label("Your inbox is empty"), 75 - ], 76 - binds: [ 77 - ["visible", Notifications, "notifications", (n) => n.length === 0], 78 - ], 79 - }); 60 + Widget.Box({ 61 + class_name: "placeholder", 62 + vertical: true, 63 + vpack: "center", 64 + hpack: "center", 65 + vexpand: true, 66 + hexpand: true, 67 + children: [ 68 + Widget.Icon(icons.notifications.silent), 69 + Widget.Label("Your inbox is empty"), 70 + ], 71 + binds: [["visible", Notifications, "notifications", (n) => n.length === 0]], 72 + }); 80 73 81 74 export default () => 82 - Widget.Box({ 83 - class_name: "notifications", 84 - vertical: true, 85 - children: [ 86 - Header(), 87 - Widget.Scrollable({ 88 - vexpand: true, 89 - class_name: "notification-scrollable", 90 - child: Widget.Box({ 91 - class_name: "notification-list", 92 - vertical: true, 93 - children: [NotificationList(), Placeholder()], 94 - }), 95 - }), 96 - ], 97 - }); 75 + Widget.Box({ 76 + class_name: "notifications", 77 + vertical: true, 78 + children: [ 79 + Header(), 80 + Widget.Scrollable({ 81 + vexpand: true, 82 + class_name: "notification-scrollable", 83 + child: Widget.Box({ 84 + class_name: "notification-list", 85 + vertical: true, 86 + children: [NotificationList(), Placeholder()], 87 + }), 88 + }), 89 + ], 90 + });
+48 -48
home/isabel/programs/configs/gui/bars/ags/config/windows/notifications/Notifications.js
··· 6 6 7 7 /** @param {import('types/widgets/revealer').default} parent */ 8 8 const Popups = (parent) => { 9 - const map = new Map(); 10 - 11 - const onDismissed = (_, id, force = false) => { 12 - if (!id || !map.has(id)) return; 9 + const map = new Map(); 13 10 14 - if (map.get(id).isHovered() && !force) return; 11 + const onDismissed = (_, id, force = false) => { 12 + if (!id || !map.has(id)) return; 15 13 16 - if (map.size - 1 === 0) parent.reveal_child = false; 14 + if (map.get(id).isHovered() && !force) return; 17 15 18 - Utils.timeout(200, () => { 19 - map.get(id)?.destroy(); 20 - map.delete(id); 21 - }); 22 - }; 16 + if (map.size - 1 === 0) parent.reveal_child = false; 23 17 24 - /** @param {import('types/widgets/box').default} box */ 25 - const onNotified = (box, id) => { 26 - if (!id || Notifications.dnd) return; 18 + Utils.timeout(200, () => { 19 + map.get(id)?.destroy(); 20 + map.delete(id); 21 + }); 22 + }; 27 23 28 - const n = Notifications.getNotification(id); 29 - if (!n) return; 24 + /** @param {import('types/widgets/box').default} box */ 25 + const onNotified = (box, id) => { 26 + if (!id || Notifications.dnd) return; 30 27 31 - if (options.notifications.black_list.value.includes(n.app_name || "")) 32 - return; 28 + const n = Notifications.getNotification(id); 29 + if (!n) return; 33 30 34 - map.delete(id); 35 - map.set(id, Notification(Notifications.getNotification(id))); 36 - box.children = Array.from(map.values()).reverse(); 37 - Utils.timeout(10, () => { 38 - parent.reveal_child = true; 39 - }); 40 - }; 31 + if (options.notifications.black_list.value.includes(n.app_name || "")) 32 + return; 41 33 42 - return Widget.Box({ 43 - vertical: true, 44 - connections: [ 45 - [Notifications, onNotified, "notified"], 46 - [Notifications, onDismissed, "dismissed"], 47 - [Notifications, (box, id) => onDismissed(box, id, true), "closed"], 48 - ], 34 + map.delete(id); 35 + map.set(id, Notification(Notifications.getNotification(id))); 36 + box.children = Array.from(map.values()).reverse(); 37 + Utils.timeout(10, () => { 38 + parent.reveal_child = true; 49 39 }); 40 + }; 41 + 42 + return Widget.Box({ 43 + vertical: true, 44 + connections: [ 45 + [Notifications, onNotified, "notified"], 46 + [Notifications, onDismissed, "dismissed"], 47 + [Notifications, (box, id) => onDismissed(box, id, true), "closed"], 48 + ], 49 + }); 50 50 }; 51 51 52 52 /** @param {import('types/widgets/revealer').RevealerProps['transition']} transition */ 53 53 const PopupList = (transition = "slide_down") => 54 - Widget.Box({ 55 - css: "padding: 1px", 56 - children: [ 57 - Widget.Revealer({ 58 - transition, 59 - setup: (self) => (self.child = Popups(self)), 60 - }), 61 - ], 62 - }); 54 + Widget.Box({ 55 + css: "padding: 1px", 56 + children: [ 57 + Widget.Revealer({ 58 + transition, 59 + setup: (self) => (self.child = Popups(self)), 60 + }), 61 + ], 62 + }); 63 63 64 64 /** @param {number} monitor */ 65 65 export default (monitor) => 66 - Widget.Window({ 67 - monitor, 68 - class_name: "notifications", 69 - name: `notifications${monitor}`, 70 - binds: [["anchor", options.notifications.position]], 71 - child: PopupList(), 72 - }); 66 + Widget.Window({ 67 + monitor, 68 + class_name: "notifications", 69 + name: `notifications${monitor}`, 70 + binds: [["anchor", options.notifications.position]], 71 + child: PopupList(), 72 + });
+19 -22
home/isabel/programs/configs/gui/bars/ags/config/windows/powermenu/PowerMenu.js
··· 9 9 * @param {string} label 10 10 */ 11 11 const SysButton = (action, label) => 12 - Widget.Button({ 13 - on_clicked: () => PowerMenu.action(action) + Utils.exec(PowerMenu.cmd), 14 - child: Widget.Box({ 15 - vertical: true, 16 - children: [ 17 - Widget.Icon(icons.powermenu[action]), 18 - Widget.Label(label), 19 - ], 20 - }), 21 - }); 12 + Widget.Button({ 13 + on_clicked: () => PowerMenu.action(action) + Utils.exec(PowerMenu.cmd), 14 + child: Widget.Box({ 15 + vertical: true, 16 + children: [Widget.Icon(icons.powermenu[action]), Widget.Label(label)], 17 + }), 18 + }); 22 19 23 20 export default () => 24 - ShadedPopup({ 25 - name: "powermenu", 26 - expand: true, 27 - child: Widget.Box({ 28 - children: [ 29 - SysButton("sleep", "Sleep"), 30 - SysButton("reboot", "Reboot"), 31 - SysButton("logout", "Log Out"), 32 - SysButton("shutdown", "Shutdown"), 33 - ], 34 - }), 35 - }); 21 + ShadedPopup({ 22 + name: "powermenu", 23 + expand: true, 24 + child: Widget.Box({ 25 + children: [ 26 + SysButton("sleep", "Sleep"), 27 + SysButton("reboot", "Reboot"), 28 + SysButton("logout", "Log Out"), 29 + SysButton("shutdown", "Shutdown"), 30 + ], 31 + }), 32 + });
+28 -30
home/isabel/programs/configs/gui/bars/ags/config/windows/powermenu/ShadedPopup.js
··· 3 3 4 4 /** @param {string} windowName */ 5 5 const Padding = (windowName) => 6 - Widget.EventBox({ 7 - class_name: "padding", 8 - hexpand: true, 9 - vexpand: true, 10 - connections: [ 11 - ["button-press-event", () => App.toggleWindow(windowName)], 12 - ], 13 - }); 6 + Widget.EventBox({ 7 + class_name: "padding", 8 + hexpand: true, 9 + vexpand: true, 10 + connections: [["button-press-event", () => App.toggleWindow(windowName)]], 11 + }); 14 12 15 13 /** 16 14 * @param {import('types/widgets/window').WindowProps & { ··· 19 17 * }} o 20 18 */ 21 19 export default ({ name, child, ...rest }) => 22 - Widget.Window({ 23 - ...rest, 24 - class_names: ["popup-window", name], 25 - name, 26 - visible: false, 27 - popup: true, 28 - focusable: true, 29 - setup() { 30 - child.toggleClassName("window-content"); 31 - }, 32 - child: Widget.CenterBox({ 33 - class_name: "shader", 34 - css: "min-width: 5000px; min-height: 3000px;", 35 - children: [ 36 - Padding(name), 37 - Widget.CenterBox({ 38 - vertical: true, 39 - children: [Padding(name), child, Padding(name)], 40 - }), 41 - Padding(name), 42 - ], 20 + Widget.Window({ 21 + ...rest, 22 + class_names: ["popup-window", name], 23 + name, 24 + visible: false, 25 + popup: true, 26 + focusable: true, 27 + setup() { 28 + child.toggleClassName("window-content"); 29 + }, 30 + child: Widget.CenterBox({ 31 + class_name: "shader", 32 + css: "min-width: 5000px; min-height: 3000px;", 33 + children: [ 34 + Padding(name), 35 + Widget.CenterBox({ 36 + vertical: true, 37 + children: [Padding(name), child, Padding(name)], 43 38 }), 44 - }); 39 + Padding(name), 40 + ], 41 + }), 42 + });
+50 -53
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/QuickSettings.js
··· 12 12 import PopupWindow from "../../misc/PopupWindow.js"; 13 13 14 14 const Row = (toggles = [], menus = []) => 15 - Widget.Box({ 16 - vertical: true, 17 - children: [ 18 - Widget.Box({ 19 - class_name: "row horizontal", 20 - children: toggles, 21 - }), 22 - ...menus, 23 - ], 24 - }); 15 + Widget.Box({ 16 + vertical: true, 17 + children: [ 18 + Widget.Box({ 19 + class_name: "row horizontal", 20 + children: toggles, 21 + }), 22 + ...menus, 23 + ], 24 + }); 25 25 26 26 const Homogeneous = (toggles) => 27 - Widget.Box({ 28 - homogeneous: true, 29 - children: toggles, 30 - }); 27 + Widget.Box({ 28 + homogeneous: true, 29 + children: toggles, 30 + }); 31 31 32 32 export default () => 33 - PopupWindow({ 34 - name: "quicksettings", 35 - connections: [ 36 - [ 37 - options.bar.position, 38 - (self) => { 39 - self.anchor = ["right", options.bar.position.value]; 40 - if (options.bar.position.value === "top") 41 - self.transition = "slide_down"; 33 + PopupWindow({ 34 + name: "quicksettings", 35 + connections: [ 36 + [ 37 + options.bar.position, 38 + (self) => { 39 + self.anchor = ["right", options.bar.position.value]; 40 + if (options.bar.position.value === "top") 41 + self.transition = "slide_down"; 42 42 43 - if (options.bar.position.value === "bottom") 44 - self.transition = "slide_up"; 45 - }, 46 - ], 47 - ], 48 - child: Widget.Box({ 49 - vertical: true, 50 - children: [ 51 - Header(), 52 - Widget.Box({ 53 - class_name: "sliders-box vertical", 54 - class_name: "slider-box", 55 - vertical: true, 56 - children: [ 57 - Row([Volume()], [SinkSelector(), AppMixer()]), 58 - Microhone(), 59 - Brightness(), 60 - ], 61 - }), 62 - Row( 63 - [Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()], 64 - [WifiSelection(), BluetoothDevices()], 65 - ), 66 - Row( 67 - [Homogeneous([ThemeToggle()]), MicMute()], 68 - [ThemeSelector()], 69 - ), 70 - Media(), 71 - ], 43 + if (options.bar.position.value === "bottom") 44 + self.transition = "slide_up"; 45 + }, 46 + ], 47 + ], 48 + child: Widget.Box({ 49 + vertical: true, 50 + children: [ 51 + Header(), 52 + Widget.Box({ 53 + class_name: "sliders-box vertical", 54 + class_name: "slider-box", 55 + vertical: true, 56 + children: [ 57 + Row([Volume()], [SinkSelector(), AppMixer()]), 58 + Microhone(), 59 + Brightness(), 60 + ], 72 61 }), 73 - }); 62 + Row( 63 + [Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()], 64 + [WifiSelection(), BluetoothDevices()], 65 + ), 66 + Row([Homogeneous([ThemeToggle()]), MicMute()], [ThemeSelector()]), 67 + Media(), 68 + ], 69 + }), 70 + });
+99 -101
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/ToggleButton.js
··· 7 7 /** name of the currently opened menu */ 8 8 export const opened = Variable(""); 9 9 App.connect("window-toggled", (_, name, visible) => { 10 - if (name === "quicksettings" && !visible) 11 - Utils.timeout(500, () => (opened.value = "")); 10 + if (name === "quicksettings" && !visible) 11 + Utils.timeout(500, () => (opened.value = "")); 12 12 }); 13 13 14 14 /** ··· 16 16 * @param {(() => void) | false=} activate 17 17 */ 18 18 export const Arrow = (name, activate) => { 19 - let deg = 0; 20 - let iconOpened = false; 21 - return Widget.Button({ 22 - child: Widget.Icon({ 23 - icon: icons.ui.arrow.right, 24 - connections: [ 25 - [ 26 - opened, 27 - (icon) => { 28 - if ( 29 - (opened.value === name && !iconOpened) || 30 - (opened.value !== name && iconOpened) 31 - ) { 32 - const step = opened.value === name ? 10 : -10; 33 - iconOpened = !iconOpened; 34 - for (let i = 0; i < 9; ++i) { 35 - Utils.timeout(15 * i, () => { 36 - deg += step; 37 - icon.setCss( 38 - `-gtk-icon-transform: rotate(${deg}deg);`, 39 - ); 40 - }); 41 - } 42 - } 43 - }, 44 - ], 45 - ], 46 - }), 47 - on_clicked: () => { 48 - opened.value = opened.value === name ? "" : name; 49 - if (typeof activate === "function") activate(); 50 - }, 51 - }); 19 + let deg = 0; 20 + let iconOpened = false; 21 + return Widget.Button({ 22 + child: Widget.Icon({ 23 + icon: icons.ui.arrow.right, 24 + connections: [ 25 + [ 26 + opened, 27 + (icon) => { 28 + if ( 29 + (opened.value === name && !iconOpened) || 30 + (opened.value !== name && iconOpened) 31 + ) { 32 + const step = opened.value === name ? 10 : -10; 33 + iconOpened = !iconOpened; 34 + for (let i = 0; i < 9; ++i) { 35 + Utils.timeout(15 * i, () => { 36 + deg += step; 37 + icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); 38 + }); 39 + } 40 + } 41 + }, 42 + ], 43 + ], 44 + }), 45 + on_clicked: () => { 46 + opened.value = opened.value === name ? "" : name; 47 + if (typeof activate === "function") activate(); 48 + }, 49 + }); 52 50 }; 53 51 54 52 /** ··· 62 60 * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection 63 61 */ 64 62 export const ArrowToggleButton = ({ 65 - name, 66 - icon, 67 - label, 68 - activate, 69 - deactivate, 70 - activateOnArrow = true, 71 - connection: [service, condition], 63 + name, 64 + icon, 65 + label, 66 + activate, 67 + deactivate, 68 + activateOnArrow = true, 69 + connection: [service, condition], 72 70 }) => 73 - Widget.Box({ 74 - class_name: "toggle-button", 75 - connections: [ 76 - [ 77 - service, 78 - (box) => { 79 - box.toggleClassName("active", condition()); 80 - }, 81 - ], 82 - ], 83 - children: [ 84 - Widget.Button({ 85 - child: Widget.Box({ 86 - hexpand: true, 87 - children: [icon, label], 88 - }), 89 - on_clicked: () => { 90 - if (condition()) { 91 - deactivate(); 92 - if (opened.value === name) opened.value = ""; 93 - } else { 94 - activate(); 95 - } 96 - }, 97 - }), 98 - Arrow(name, activateOnArrow && activate), 99 - ], 100 - }); 71 + Widget.Box({ 72 + class_name: "toggle-button", 73 + connections: [ 74 + [ 75 + service, 76 + (box) => { 77 + box.toggleClassName("active", condition()); 78 + }, 79 + ], 80 + ], 81 + children: [ 82 + Widget.Button({ 83 + child: Widget.Box({ 84 + hexpand: true, 85 + children: [icon, label], 86 + }), 87 + on_clicked: () => { 88 + if (condition()) { 89 + deactivate(); 90 + if (opened.value === name) opened.value = ""; 91 + } else { 92 + activate(); 93 + } 94 + }, 95 + }), 96 + Arrow(name, activateOnArrow && activate), 97 + ], 98 + }); 101 99 102 100 /** 103 101 * @param {Object} o ··· 107 105 * @param {import('gi://Gtk').Gtk.Widget[]} o.content 108 106 */ 109 107 export const Menu = ({ name, icon, title, content }) => 110 - Widget.Revealer({ 111 - transition: "slide_down", 112 - binds: [["reveal-child", opened, "value", (v) => v === name]], 113 - child: Widget.Box({ 114 - class_names: ["menu", name], 115 - vertical: true, 116 - children: [ 117 - Widget.Box({ 118 - class_name: "title horizontal", 119 - children: [icon, title], 120 - }), 121 - Widget.Separator(), 122 - ...content, 123 - ], 108 + Widget.Revealer({ 109 + transition: "slide_down", 110 + binds: [["reveal-child", opened, "value", (v) => v === name]], 111 + child: Widget.Box({ 112 + class_names: ["menu", name], 113 + vertical: true, 114 + children: [ 115 + Widget.Box({ 116 + class_name: "title horizontal", 117 + children: [icon, title], 124 118 }), 125 - }); 119 + Widget.Separator(), 120 + ...content, 121 + ], 122 + }), 123 + }); 126 124 127 125 /** 128 126 * @param {Object} o ··· 131 129 * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection 132 130 */ 133 131 export const SimpleToggleButton = ({ 134 - icon, 135 - toggle, 136 - connection: [service, condition], 132 + icon, 133 + toggle, 134 + connection: [service, condition], 137 135 }) => 138 - Widget.Button({ 139 - class_name: "simple-toggle", 140 - connections: [ 141 - [ 142 - service, 143 - (box) => { 144 - box.toggleClassName("active", condition()); 145 - }, 146 - ], 147 - ], 148 - child: icon, 149 - on_clicked: toggle, 150 - }); 136 + Widget.Button({ 137 + class_name: "simple-toggle", 138 + connections: [ 139 + [ 140 + service, 141 + (box) => { 142 + box.toggleClassName("active", condition()); 143 + }, 144 + ], 145 + ], 146 + child: icon, 147 + on_clicked: toggle, 148 + });
+80 -84
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Bluetooth.js
··· 4 4 import { Menu, ArrowToggleButton } from "../ToggleButton.js"; 5 5 6 6 export const BluetoothToggle = () => 7 - ArrowToggleButton({ 8 - name: "bluetooth", 9 - icon: Widget.Icon({ 10 - connections: [ 11 - [ 12 - Bluetooth, 13 - (icon) => { 14 - icon.icon = Bluetooth.enabled 15 - ? icons.bluetooth.enabled 16 - : icons.bluetooth.disabled; 17 - }, 18 - ], 19 - ], 20 - }), 21 - label: Widget.Label({ 22 - truncate: "end", 23 - connections: [ 24 - [ 25 - Bluetooth, 26 - (label) => { 27 - if (!Bluetooth.enabled) 28 - return (label.label = "Disabled"); 7 + ArrowToggleButton({ 8 + name: "bluetooth", 9 + icon: Widget.Icon({ 10 + connections: [ 11 + [ 12 + Bluetooth, 13 + (icon) => { 14 + icon.icon = Bluetooth.enabled 15 + ? icons.bluetooth.enabled 16 + : icons.bluetooth.disabled; 17 + }, 18 + ], 19 + ], 20 + }), 21 + label: Widget.Label({ 22 + truncate: "end", 23 + connections: [ 24 + [ 25 + Bluetooth, 26 + (label) => { 27 + if (!Bluetooth.enabled) return (label.label = "Disabled"); 29 28 30 - if (Bluetooth.connectedDevices.length === 0) 31 - return (label.label = "Not Connected"); 29 + if (Bluetooth.connectedDevices.length === 0) 30 + return (label.label = "Not Connected"); 32 31 33 - if (Bluetooth.connectedDevices.length === 1) 34 - return (label.label = 35 - Bluetooth.connectedDevices[0].alias); 32 + if (Bluetooth.connectedDevices.length === 1) 33 + return (label.label = Bluetooth.connectedDevices[0].alias); 36 34 37 - label.label = `${Bluetooth.connectedDevices.length} Connected`; 38 - }, 39 - ], 40 - ], 41 - }), 42 - connection: [Bluetooth, () => Bluetooth.enabled], 43 - deactivate: () => (Bluetooth.enabled = false), 44 - activate: () => (Bluetooth.enabled = true), 45 - }); 35 + label.label = `${Bluetooth.connectedDevices.length} Connected`; 36 + }, 37 + ], 38 + ], 39 + }), 40 + connection: [Bluetooth, () => Bluetooth.enabled], 41 + deactivate: () => (Bluetooth.enabled = false), 42 + activate: () => (Bluetooth.enabled = true), 43 + }); 46 44 47 45 const DeviceItem = (device) => 48 - Widget.Box({ 49 - children: [ 50 - Widget.Icon(device.icon_name + "-symbolic"), 51 - Widget.Label(device.name), 52 - Widget.Label({ 53 - label: `${device.battery_percentage}%`, 54 - binds: [ 55 - ["visible", device, "battery-percentage", (p) => p > 0], 56 - ], 57 - }), 58 - Widget.Box({ hexpand: true }), 59 - Widget.Spinner({ 60 - binds: [ 61 - ["active", device, "connecting"], 62 - ["visible", device, "connecting"], 63 - ], 64 - }), 65 - Widget.Switch({ 66 - active: device.connected, 67 - binds: [["visible", device, "connecting", (c) => !c]], 68 - connections: [ 69 - [ 70 - "notify::active", 71 - ({ active }) => { 72 - device.setConnection(active); 73 - }, 74 - ], 75 - ], 76 - }), 46 + Widget.Box({ 47 + children: [ 48 + Widget.Icon(device.icon_name + "-symbolic"), 49 + Widget.Label(device.name), 50 + Widget.Label({ 51 + label: `${device.battery_percentage}%`, 52 + binds: [["visible", device, "battery-percentage", (p) => p > 0]], 53 + }), 54 + Widget.Box({ hexpand: true }), 55 + Widget.Spinner({ 56 + binds: [ 57 + ["active", device, "connecting"], 58 + ["visible", device, "connecting"], 77 59 ], 78 - }); 60 + }), 61 + Widget.Switch({ 62 + active: device.connected, 63 + binds: [["visible", device, "connecting", (c) => !c]], 64 + connections: [ 65 + [ 66 + "notify::active", 67 + ({ active }) => { 68 + device.setConnection(active); 69 + }, 70 + ], 71 + ], 72 + }), 73 + ], 74 + }); 79 75 80 76 export const BluetoothDevices = () => 81 - Menu({ 82 - name: "bluetooth", 83 - icon: Widget.Icon(icons.bluetooth.disabled), 84 - title: Widget.Label("Bluetooth"), 85 - content: [ 86 - Widget.Box({ 87 - hexpand: true, 88 - vertical: true, 89 - binds: [ 90 - [ 91 - "children", 92 - Bluetooth, 93 - "devices", 94 - (ds) => ds.filter((d) => d.name).map(DeviceItem), 95 - ], 96 - ], 97 - }), 77 + Menu({ 78 + name: "bluetooth", 79 + icon: Widget.Icon(icons.bluetooth.disabled), 80 + title: Widget.Label("Bluetooth"), 81 + content: [ 82 + Widget.Box({ 83 + hexpand: true, 84 + vertical: true, 85 + binds: [ 86 + [ 87 + "children", 88 + Bluetooth, 89 + "devices", 90 + (ds) => ds.filter((d) => d.name).map(DeviceItem), 91 + ], 98 92 ], 99 - }); 93 + }), 94 + ], 95 + });
+21 -21
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Brightness.js
··· 3 3 import Brightness from "../../../services/brightness.js"; 4 4 5 5 const BrightnessSlider = () => 6 - Widget.Slider({ 7 - draw_value: false, 8 - hexpand: true, 9 - binds: [["value", Brightness, "screen"]], 10 - on_change: ({ value }) => (Brightness.screen = value), 11 - }); 6 + Widget.Slider({ 7 + draw_value: false, 8 + hexpand: true, 9 + binds: [["value", Brightness, "screen"]], 10 + on_change: ({ value }) => (Brightness.screen = value), 11 + }); 12 12 13 13 export default () => 14 - Widget.Box({ 15 - children: [ 16 - Widget.Button({ 17 - child: Widget.Icon(icons.brightness.indicator), 18 - binds: [ 19 - [ 20 - "tooltip-text", 21 - Brightness, 22 - "screen", 23 - (v) => `Screen Brightness: ${Math.floor(v * 100)}%`, 24 - ], 25 - ], 26 - }), 27 - BrightnessSlider(), 14 + Widget.Box({ 15 + children: [ 16 + Widget.Button({ 17 + child: Widget.Icon(icons.brightness.indicator), 18 + binds: [ 19 + [ 20 + "tooltip-text", 21 + Brightness, 22 + "screen", 23 + (v) => `Screen Brightness: ${Math.floor(v * 100)}%`, 24 + ], 28 25 ], 29 - }); 26 + }), 27 + BrightnessSlider(), 28 + ], 29 + });
+17 -17
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/DND.js
··· 4 4 import { SimpleToggleButton } from "../ToggleButton.js"; 5 5 6 6 export default () => 7 - SimpleToggleButton({ 8 - icon: Widget.Icon({ 9 - connections: [ 10 - [ 11 - Notifications, 12 - (icon) => { 13 - icon.icon = Notifications.dnd 14 - ? icons.notifications.silent 15 - : icons.notifications.noisy; 16 - }, 17 - "notify::dnd", 18 - ], 19 - ], 20 - }), 21 - toggle: () => (Notifications.dnd = !Notifications.dnd), 22 - connection: [Notifications, () => Notifications.dnd], 23 - }); 7 + SimpleToggleButton({ 8 + icon: Widget.Icon({ 9 + connections: [ 10 + [ 11 + Notifications, 12 + (icon) => { 13 + icon.icon = Notifications.dnd 14 + ? icons.notifications.silent 15 + : icons.notifications.noisy; 16 + }, 17 + "notify::dnd", 18 + ], 19 + ], 20 + }), 21 + toggle: () => (Notifications.dnd = !Notifications.dnd), 22 + connection: [Notifications, () => Notifications.dnd], 23 + });
+81 -87
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Header.js
··· 8 8 import { openSettings } from "../../../settings/theme.js"; 9 9 10 10 export const BatteryProgress = () => 11 - Widget.Box({ 12 - class_name: "battery-progress", 11 + Widget.Box({ 12 + class_name: "battery-progress", 13 + vexpand: true, 14 + binds: [["visible", Battery, "available"]], 15 + connections: [ 16 + [ 17 + Battery, 18 + (w) => { 19 + w.toggleClassName("charging", Battery.charging || Battery.charged); 20 + w.toggleClassName( 21 + "medium", 22 + Battery.percent < options.battery.medium.value, 23 + ); 24 + w.toggleClassName("low", Battery.percent < options.battery.low.value); 25 + w.toggleClassName("half", Battery.percent < 48); 26 + }, 27 + ], 28 + ], 29 + child: Widget.Overlay({ 30 + vexpand: true, 31 + child: Widget.ProgressBar({ 32 + hexpand: true, 13 33 vexpand: true, 14 - binds: [["visible", Battery, "available"]], 15 34 connections: [ 16 - [ 17 - Battery, 18 - (w) => { 19 - w.toggleClassName( 20 - "charging", 21 - Battery.charging || Battery.charged, 22 - ); 23 - w.toggleClassName( 24 - "medium", 25 - Battery.percent < options.battery.medium.value, 26 - ); 27 - w.toggleClassName( 28 - "low", 29 - Battery.percent < options.battery.low.value, 30 - ); 31 - w.toggleClassName("half", Battery.percent < 48); 32 - }, 33 - ], 35 + [ 36 + Battery, 37 + (progress) => { 38 + progress.fraction = Battery.percent / 100; 39 + }, 40 + ], 34 41 ], 35 - child: Widget.Overlay({ 36 - vexpand: true, 37 - child: Widget.ProgressBar({ 38 - hexpand: true, 39 - vexpand: true, 40 - connections: [ 41 - [ 42 - Battery, 43 - (progress) => { 44 - progress.fraction = Battery.percent / 100; 45 - }, 46 - ], 47 - ], 48 - }), 49 - overlays: [ 50 - Widget.Label({ 51 - connections: [ 52 - [ 53 - Battery, 54 - (l) => { 55 - l.label = 56 - Battery.charging || Battery.charged 57 - ? icons.battery.charging 58 - : `${Battery.percent}%`; 59 - }, 60 - ], 61 - ], 62 - }), 42 + }), 43 + overlays: [ 44 + Widget.Label({ 45 + connections: [ 46 + [ 47 + Battery, 48 + (l) => { 49 + l.label = 50 + Battery.charging || Battery.charged 51 + ? icons.battery.charging 52 + : `${Battery.percent}%`; 53 + }, 63 54 ], 55 + ], 64 56 }), 65 - }); 57 + ], 58 + }), 59 + }); 66 60 67 61 export default () => 68 - Widget.Box({ 69 - class_name: "header horizontal", 62 + Widget.Box({ 63 + class_name: "header horizontal", 64 + children: [ 65 + Avatar(), 66 + Widget.Box({ 67 + class_name: "system-box", 68 + vertical: true, 69 + hexpand: true, 70 70 children: [ 71 - Avatar(), 72 - Widget.Box({ 73 - class_name: "system-box", 74 - vertical: true, 71 + Widget.Box({ 72 + children: [ 73 + Widget.Button({ 74 + vpack: "center", 75 + on_clicked: openSettings, 76 + child: Widget.Icon(icons.ui.settings), 77 + }), 78 + Widget.Label({ 79 + class_name: "uptime", 75 80 hexpand: true, 76 - children: [ 77 - Widget.Box({ 78 - children: [ 79 - Widget.Button({ 80 - vpack: "center", 81 - on_clicked: openSettings, 82 - child: Widget.Icon(icons.ui.settings), 83 - }), 84 - Widget.Label({ 85 - class_name: "uptime", 86 - hexpand: true, 87 - vpack: "center", 88 - connections: [ 89 - [ 90 - uptime, 91 - (label) => { 92 - label.label = `uptime: ${uptime.value}`; 93 - }, 94 - ], 95 - ], 96 - }), 97 - Widget.Button({ 98 - vpack: "center", 99 - on_clicked: () => PowerMenu.action("shutdown"), 100 - child: Widget.Icon(icons.powermenu.shutdown), 101 - }), 102 - ], 103 - }), 104 - BatteryProgress(), 81 + vpack: "center", 82 + connections: [ 83 + [ 84 + uptime, 85 + (label) => { 86 + label.label = `uptime: ${uptime.value}`; 87 + }, 88 + ], 105 89 ], 106 - }), 90 + }), 91 + Widget.Button({ 92 + vpack: "center", 93 + on_clicked: () => PowerMenu.action("shutdown"), 94 + child: Widget.Icon(icons.powermenu.shutdown), 95 + }), 96 + ], 97 + }), 98 + BatteryProgress(), 107 99 ], 108 - }); 100 + }), 101 + ], 102 + });
+87 -92
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Media.js
··· 5 5 6 6 /** @param {import('types/service/mpris').MprisPlayer} player */ 7 7 const Footer = (player) => 8 - Widget.CenterBox({ 9 - class_name: "footer-box", 8 + Widget.CenterBox({ 9 + class_name: "footer-box", 10 + children: [ 11 + Widget.Box({ 12 + class_name: "position", 13 + children: [ 14 + mpris.PositionLabel(player), 15 + mpris.Slash(player), 16 + mpris.LengthLabel(player), 17 + ], 18 + }), 19 + Widget.Box({ 20 + class_name: "controls", 10 21 children: [ 11 - Widget.Box({ 12 - class_name: "position", 13 - children: [ 14 - mpris.PositionLabel(player), 15 - mpris.Slash(player), 16 - mpris.LengthLabel(player), 17 - ], 18 - }), 19 - Widget.Box({ 20 - class_name: "controls", 21 - children: [ 22 - mpris.ShuffleButton(player), 23 - mpris.PreviousButton(player), 24 - mpris.PlayPauseButton(player), 25 - mpris.NextButton(player), 26 - mpris.LoopButton(player), 27 - ], 28 - }), 29 - mpris.PlayerIcon(player, { 30 - symbolic: false, 31 - hexpand: true, 32 - hpack: "end", 33 - }), 22 + mpris.ShuffleButton(player), 23 + mpris.PreviousButton(player), 24 + mpris.PlayPauseButton(player), 25 + mpris.NextButton(player), 26 + mpris.LoopButton(player), 34 27 ], 35 - }); 28 + }), 29 + mpris.PlayerIcon(player, { 30 + symbolic: false, 31 + hexpand: true, 32 + hpack: "end", 33 + }), 34 + ], 35 + }); 36 36 37 37 /** @param {import('types/service/mpris').MprisPlayer} player */ 38 38 const TextBox = (player) => 39 - Widget.Box({ 39 + Widget.Box({ 40 + children: [ 41 + mpris.CoverArt(player, { 42 + hpack: "end", 43 + hexpand: false, 44 + }), 45 + Widget.Box({ 46 + hexpand: true, 47 + vertical: true, 48 + class_name: "labels", 40 49 children: [ 41 - mpris.CoverArt(player, { 42 - hpack: "end", 43 - hexpand: false, 44 - }), 45 - Widget.Box({ 46 - hexpand: true, 47 - vertical: true, 48 - class_name: "labels", 49 - children: [ 50 - mpris.TitleLabel(player, { 51 - xalign: 0, 52 - justification: "left", 53 - wrap: true, 54 - }), 55 - mpris.ArtistLabel(player, { 56 - xalign: 0, 57 - justification: "left", 58 - wrap: true, 59 - }), 60 - ], 61 - }), 50 + mpris.TitleLabel(player, { 51 + xalign: 0, 52 + justification: "left", 53 + wrap: true, 54 + }), 55 + mpris.ArtistLabel(player, { 56 + xalign: 0, 57 + justification: "left", 58 + wrap: true, 59 + }), 62 60 ], 63 - }); 61 + }), 62 + ], 63 + }); 64 64 65 65 /** @param {import('types/service/mpris').MprisPlayer} player */ 66 66 const PlayerBox = (player) => 67 - Widget.Box({ 68 - class_name: `player ${player.name}`, 69 - child: mpris.BlurredCoverArt(player, { 70 - hexpand: true, 71 - child: Widget.Box({ 72 - hexpand: true, 73 - vertical: true, 74 - children: [ 75 - TextBox(player), 76 - mpris.PositionSlider(player), 77 - Footer(player), 78 - ], 79 - }), 80 - }), 81 - }); 67 + Widget.Box({ 68 + class_name: `player ${player.name}`, 69 + child: mpris.BlurredCoverArt(player, { 70 + hexpand: true, 71 + child: Widget.Box({ 72 + hexpand: true, 73 + vertical: true, 74 + children: [ 75 + TextBox(player), 76 + mpris.PositionSlider(player), 77 + Footer(player), 78 + ], 79 + }), 80 + }), 81 + }); 82 82 83 83 export default () => 84 - Widget.Box({ 85 - vertical: true, 86 - class_name: "media vertical", 87 - connections: [ 88 - [ 89 - "draw", 90 - (self) => { 91 - self.visible = Mpris.players.length > 0; 92 - }, 93 - ], 94 - ], 95 - binds: [ 96 - [ 97 - "children", 98 - Mpris, 99 - "players", 100 - (ps) => 101 - ps 102 - .filter( 103 - (p) => 104 - !options.mpris.black_list.value.includes( 105 - p.identity, 106 - ), 107 - ) 108 - .map(PlayerBox), 109 - ], 110 - ], 111 - }); 84 + Widget.Box({ 85 + vertical: true, 86 + class_name: "media vertical", 87 + connections: [ 88 + [ 89 + "draw", 90 + (self) => { 91 + self.visible = Mpris.players.length > 0; 92 + }, 93 + ], 94 + ], 95 + binds: [ 96 + [ 97 + "children", 98 + Mpris, 99 + "players", 100 + (ps) => 101 + ps 102 + .filter((p) => !options.mpris.black_list.value.includes(p.identity)) 103 + .map(PlayerBox), 104 + ], 105 + ], 106 + });
+17 -17
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/MicMute.js
··· 4 4 import { SimpleToggleButton } from "../ToggleButton.js"; 5 5 6 6 export default () => 7 - SimpleToggleButton({ 8 - icon: Widget.Icon({ 9 - connections: [ 10 - [ 11 - Audio, 12 - (icon) => { 13 - icon.icon = Audio.microphone?.is_muted 14 - ? icons.audio.mic.muted 15 - : icons.audio.mic.high; 16 - }, 17 - "microphone-changed", 18 - ], 19 - ], 20 - }), 21 - toggle: () => (Audio.microphone.is_muted = !Audio.microphone.is_muted), 22 - connection: [Audio, () => Audio.microphone?.is_muted], 23 - }); 7 + SimpleToggleButton({ 8 + icon: Widget.Icon({ 9 + connections: [ 10 + [ 11 + Audio, 12 + (icon) => { 13 + icon.icon = Audio.microphone?.is_muted 14 + ? icons.audio.mic.muted 15 + : icons.audio.mic.high; 16 + }, 17 + "microphone-changed", 18 + ], 19 + ], 20 + }), 21 + toggle: () => (Audio.microphone.is_muted = !Audio.microphone.is_muted), 22 + connection: [Audio, () => Audio.microphone?.is_muted], 23 + });
+77 -83
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Network.js
··· 6 6 import icons from "../../../icons.js"; 7 7 8 8 export const NetworkToggle = () => 9 - ArrowToggleButton({ 10 - name: "network", 11 - icon: Widget.Icon({ 12 - connections: [ 13 - [ 14 - Network, 15 - (icon) => { 16 - icon.icon = Network.wifi.icon_name || ""; 17 - }, 18 - ], 19 - ], 20 - }), 21 - label: Widget.Label({ 22 - truncate: "end", 23 - connections: [ 24 - [ 25 - Network, 26 - (label) => { 27 - label.label = Network.wifi.ssid || "Not Connected"; 28 - }, 29 - ], 30 - ], 31 - }), 32 - connection: [Network, () => Network.wifi.enabled], 33 - deactivate: () => (Network.wifi.enabled = false), 34 - activate: () => { 35 - Network.wifi.enabled = true; 36 - Network.wifi.scan(); 37 - }, 38 - }); 9 + ArrowToggleButton({ 10 + name: "network", 11 + icon: Widget.Icon({ 12 + connections: [ 13 + [ 14 + Network, 15 + (icon) => { 16 + icon.icon = Network.wifi.icon_name || ""; 17 + }, 18 + ], 19 + ], 20 + }), 21 + label: Widget.Label({ 22 + truncate: "end", 23 + connections: [ 24 + [ 25 + Network, 26 + (label) => { 27 + label.label = Network.wifi.ssid || "Not Connected"; 28 + }, 29 + ], 30 + ], 31 + }), 32 + connection: [Network, () => Network.wifi.enabled], 33 + deactivate: () => (Network.wifi.enabled = false), 34 + activate: () => { 35 + Network.wifi.enabled = true; 36 + Network.wifi.scan(); 37 + }, 38 + }); 39 39 40 40 export const WifiSelection = () => 41 - Menu({ 42 - name: "network", 43 - icon: Widget.Icon({ 44 - connections: [ 45 - [ 46 - Network, 47 - (icon) => { 48 - icon.icon = Network.wifi.icon_name; 49 - }, 50 - ], 51 - ], 52 - }), 53 - title: Widget.Label("Wifi Selection"), 54 - content: [ 55 - Widget.Box({ 56 - vertical: true, 57 - connections: [ 58 - [ 59 - Network, 60 - (box) => 61 - (box.children = Network.wifi?.access_points.map( 62 - (ap) => 63 - Widget.Button({ 64 - on_clicked: () => 65 - Utils.execAsync( 66 - `nmcli device wifi connect ${ap.bssid}`, 67 - ), 68 - child: Widget.Box({ 69 - children: [ 70 - Widget.Icon(ap.iconName), 71 - Widget.Label(ap.ssid || ""), 72 - ap.active && 73 - Widget.Icon({ 74 - icon: icons.tick, 75 - hexpand: true, 76 - hpack: "end", 77 - }), 78 - ], 79 - }), 80 - }), 81 - )), 82 - ], 83 - ], 84 - }), 85 - Widget.Separator(), 86 - Widget.Button({ 87 - on_clicked: () => 88 - Applications.query("nm-connection-editor")?.[0].launch(), 89 - child: Widget.Box({ 41 + Menu({ 42 + name: "network", 43 + icon: Widget.Icon({ 44 + connections: [ 45 + [ 46 + Network, 47 + (icon) => { 48 + icon.icon = Network.wifi.icon_name; 49 + }, 50 + ], 51 + ], 52 + }), 53 + title: Widget.Label("Wifi Selection"), 54 + content: [ 55 + Widget.Box({ 56 + vertical: true, 57 + connections: [ 58 + [ 59 + Network, 60 + (box) => 61 + (box.children = Network.wifi?.access_points.map((ap) => 62 + Widget.Button({ 63 + on_clicked: () => 64 + Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`), 65 + child: Widget.Box({ 90 66 children: [ 91 - Widget.Icon(icons.ui.settings), 92 - Widget.Label("Network"), 67 + Widget.Icon(ap.iconName), 68 + Widget.Label(ap.ssid || ""), 69 + ap.active && 70 + Widget.Icon({ 71 + icon: icons.tick, 72 + hexpand: true, 73 + hpack: "end", 74 + }), 93 75 ], 76 + }), 94 77 }), 95 - }), 78 + )), 79 + ], 96 80 ], 97 - }); 81 + }), 82 + Widget.Separator(), 83 + Widget.Button({ 84 + on_clicked: () => 85 + Applications.query("nm-connection-editor")?.[0].launch(), 86 + child: Widget.Box({ 87 + children: [Widget.Icon(icons.ui.settings), Widget.Label("Network")], 88 + }), 89 + }), 90 + ], 91 + });
+45 -50
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Theme.js
··· 6 6 import { setTheme, openSettings } from "../../../settings/theme.js"; 7 7 8 8 export const ThemeToggle = () => 9 - ArrowToggleButton({ 10 - name: "theme", 11 - icon: Widget.Label({ binds: [["label", options.theme.icon]] }), 12 - label: Widget.Label({ binds: [["label", options.theme.name]] }), 13 - connection: [opened, () => opened.value === "theme"], 14 - activate: () => opened.setValue("theme"), 15 - activateOnArrow: false, 16 - deactivate: () => {}, 17 - }); 9 + ArrowToggleButton({ 10 + name: "theme", 11 + icon: Widget.Label({ binds: [["label", options.theme.icon]] }), 12 + label: Widget.Label({ binds: [["label", options.theme.name]] }), 13 + connection: [opened, () => opened.value === "theme"], 14 + activate: () => opened.setValue("theme"), 15 + activateOnArrow: false, 16 + deactivate: () => {}, 17 + }); 18 18 19 19 export const ThemeSelector = () => 20 - Menu({ 21 - name: "theme", 22 - icon: Widget.Label({ 23 - binds: [["label", options.theme.icon]], 20 + Menu({ 21 + name: "theme", 22 + icon: Widget.Label({ 23 + binds: [["label", options.theme.icon]], 24 + }), 25 + content: [ 26 + ...themes.map(({ name, icon }) => 27 + Widget.Button({ 28 + on_clicked: () => setTheme(name), 29 + child: Widget.Box({ 30 + children: [ 31 + Widget.Label(icon), 32 + Widget.Label(name), 33 + Widget.Icon({ 34 + icon: icons.tick, 35 + hexpand: true, 36 + hpack: "end", 37 + binds: [ 38 + ["visible", options.theme.name, "value", (v) => v === name], 39 + ], 40 + }), 41 + ], 42 + }), 43 + }), 44 + ), 45 + Widget.Separator(), 46 + Widget.Button({ 47 + on_clicked: openSettings, 48 + child: Widget.Box({ 49 + children: [ 50 + Widget.Icon(icons.ui.settings), 51 + Widget.Label("Theme Settings"), 52 + ], 24 53 }), 25 - content: [ 26 - ...themes.map(({ name, icon }) => 27 - Widget.Button({ 28 - on_clicked: () => setTheme(name), 29 - child: Widget.Box({ 30 - children: [ 31 - Widget.Label(icon), 32 - Widget.Label(name), 33 - Widget.Icon({ 34 - icon: icons.tick, 35 - hexpand: true, 36 - hpack: "end", 37 - binds: [ 38 - [ 39 - "visible", 40 - options.theme.name, 41 - "value", 42 - (v) => v === name, 43 - ], 44 - ], 45 - }), 46 - ], 47 - }), 48 - }), 49 - ), 50 - Widget.Separator(), 51 - Widget.Button({ 52 - on_clicked: openSettings, 53 - child: Widget.Box({ 54 - children: [ 55 - Widget.Icon(icons.ui.settings), 56 - Widget.Label("Theme Settings"), 57 - ], 58 - }), 59 - }), 60 - ], 61 - }); 54 + }), 55 + ], 56 + });
+164 -169
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Volume.js
··· 8 8 9 9 /** @param {'speaker' | 'microphone'=} type */ 10 10 const VolumeIndicator = (type = "speaker") => 11 - Widget.Button({ 12 - on_clicked: () => (Audio[type].is_muted = !Audio[type].is_muted), 13 - child: Widget.Icon({ 14 - connections: [ 15 - [ 16 - Audio, 17 - (icon) => { 18 - if (!Audio[type]) return; 11 + Widget.Button({ 12 + on_clicked: () => (Audio[type].is_muted = !Audio[type].is_muted), 13 + child: Widget.Icon({ 14 + connections: [ 15 + [ 16 + Audio, 17 + (icon) => { 18 + if (!Audio[type]) return; 19 19 20 - icon.icon = 21 - type === "speaker" 22 - ? getAudioTypeIcon(Audio[type].icon_name || "") 23 - : icons.audio.mic.high; 20 + icon.icon = 21 + type === "speaker" 22 + ? getAudioTypeIcon(Audio[type].icon_name || "") 23 + : icons.audio.mic.high; 24 24 25 - icon.tooltip_text = `Volume ${Math.floor( 26 - Audio[type].volume * 100, 27 - )}%`; 28 - }, 29 - `${type}-changed`, 30 - ], 31 - ], 32 - }), 33 - }); 25 + icon.tooltip_text = `Volume ${Math.floor( 26 + Audio[type].volume * 100, 27 + )}%`; 28 + }, 29 + `${type}-changed`, 30 + ], 31 + ], 32 + }), 33 + }); 34 34 35 35 /** @param {'speaker' | 'microphone'=} type */ 36 36 const VolumeSlider = (type = "speaker") => 37 - Widget.Slider({ 38 - hexpand: true, 39 - draw_value: false, 40 - on_change: ({ value }) => (Audio[type].volume = value), 41 - connections: [ 42 - [ 43 - Audio, 44 - (slider) => { 45 - slider.value = Audio[type]?.volume; 46 - }, 47 - `${type}-changed`, 48 - ], 49 - ], 50 - }); 37 + Widget.Slider({ 38 + hexpand: true, 39 + draw_value: false, 40 + on_change: ({ value }) => (Audio[type].volume = value), 41 + connections: [ 42 + [ 43 + Audio, 44 + (slider) => { 45 + slider.value = Audio[type]?.volume; 46 + }, 47 + `${type}-changed`, 48 + ], 49 + ], 50 + }); 51 51 52 52 export const Volume = () => 53 - Widget.Box({ 54 - children: [ 55 - VolumeIndicator("speaker"), 56 - VolumeSlider("speaker"), 57 - Widget.Box({ 58 - vpack: "center", 59 - child: Arrow("sink-selector"), 60 - }), 61 - Widget.Box({ 62 - vpack: "center", 63 - child: Arrow("app-mixer"), 64 - connections: [ 65 - [ 66 - Audio, 67 - (box) => { 68 - box.visible = Audio.apps.length > 0; 69 - }, 70 - ], 71 - ], 72 - }), 53 + Widget.Box({ 54 + children: [ 55 + VolumeIndicator("speaker"), 56 + VolumeSlider("speaker"), 57 + Widget.Box({ 58 + vpack: "center", 59 + child: Arrow("sink-selector"), 60 + }), 61 + Widget.Box({ 62 + vpack: "center", 63 + child: Arrow("app-mixer"), 64 + connections: [ 65 + [ 66 + Audio, 67 + (box) => { 68 + box.visible = Audio.apps.length > 0; 69 + }, 70 + ], 73 71 ], 74 - }); 72 + }), 73 + ], 74 + }); 75 75 76 76 export const Microhone = () => 77 - Widget.Box({ 78 - class_name: "slider horizontal", 79 - binds: [["visible", Audio, "recorders", (r) => r.length > 0]], 80 - children: [VolumeIndicator("microphone"), VolumeSlider("microphone")], 81 - }); 77 + Widget.Box({ 78 + class_name: "slider horizontal", 79 + binds: [["visible", Audio, "recorders", (r) => r.length > 0]], 80 + children: [VolumeIndicator("microphone"), VolumeSlider("microphone")], 81 + }); 82 82 83 83 /** @param {import('types/service/audio').Stream} stream */ 84 84 const MixerItem = (stream) => 85 - Widget.Box({ 86 - hexpand: true, 87 - class_name: "mixer-item horizontal", 85 + Widget.Box({ 86 + hexpand: true, 87 + class_name: "mixer-item horizontal", 88 + children: [ 89 + Widget.Icon({ 90 + binds: [["tooltipText", stream, "name"]], 91 + connections: [ 92 + [ 93 + stream, 94 + (icon) => { 95 + icon.icon = Utils.lookUpIcon(stream.name || "") 96 + ? stream.name || "" 97 + : icons.mpris.fallback; 98 + }, 99 + ], 100 + ], 101 + }), 102 + Widget.Box({ 103 + vertical: true, 88 104 children: [ 89 - Widget.Icon({ 90 - binds: [["tooltipText", stream, "name"]], 91 - connections: [ 92 - [ 93 - stream, 94 - (icon) => { 95 - icon.icon = Utils.lookUpIcon(stream.name || "") 96 - ? stream.name || "" 97 - : icons.mpris.fallback; 98 - }, 99 - ], 100 - ], 101 - }), 102 - Widget.Box({ 103 - vertical: true, 104 - children: [ 105 - Widget.Label({ 106 - xalign: 0, 107 - truncate: "end", 108 - binds: [["label", stream, "description"]], 109 - }), 110 - Widget.Slider({ 111 - hexpand: true, 112 - draw_value: false, 113 - binds: [["value", stream, "volume"]], 114 - on_change: ({ value }) => (stream.volume = value), 115 - }), 116 - ], 117 - }), 118 - Widget.Label({ 119 - xalign: 1, 120 - connections: [ 121 - [ 122 - stream, 123 - (l) => { 124 - l.label = `${Math.floor(stream.volume * 100)}%`; 125 - }, 126 - ], 127 - ], 128 - }), 105 + Widget.Label({ 106 + xalign: 0, 107 + truncate: "end", 108 + binds: [["label", stream, "description"]], 109 + }), 110 + Widget.Slider({ 111 + hexpand: true, 112 + draw_value: false, 113 + binds: [["value", stream, "volume"]], 114 + on_change: ({ value }) => (stream.volume = value), 115 + }), 116 + ], 117 + }), 118 + Widget.Label({ 119 + xalign: 1, 120 + connections: [ 121 + [ 122 + stream, 123 + (l) => { 124 + l.label = `${Math.floor(stream.volume * 100)}%`; 125 + }, 126 + ], 129 127 ], 130 - }); 128 + }), 129 + ], 130 + }); 131 131 132 132 /** @param {import('types/service/audio').Stream} stream */ 133 133 const SinkItem = (stream) => 134 - Widget.Button({ 135 - hexpand: true, 136 - on_clicked: () => (Audio.speaker = stream), 137 - child: Widget.Box({ 138 - children: [ 139 - Widget.Icon({ 140 - icon: getAudioTypeIcon(stream.icon_name || ""), 141 - tooltip_text: stream.icon_name, 142 - }), 143 - Widget.Label( 144 - (stream.description || "").split(" ").slice(0, 4).join(" "), 145 - ), 146 - Widget.Icon({ 147 - icon: icons.tick, 148 - hexpand: true, 149 - hpack: "end", 150 - connections: [ 151 - [ 152 - "draw", 153 - (icon) => { 154 - icon.visible = Audio.speaker === stream; 155 - }, 156 - ], 157 - ], 158 - }), 134 + Widget.Button({ 135 + hexpand: true, 136 + on_clicked: () => (Audio.speaker = stream), 137 + child: Widget.Box({ 138 + children: [ 139 + Widget.Icon({ 140 + icon: getAudioTypeIcon(stream.icon_name || ""), 141 + tooltip_text: stream.icon_name, 142 + }), 143 + Widget.Label( 144 + (stream.description || "").split(" ").slice(0, 4).join(" "), 145 + ), 146 + Widget.Icon({ 147 + icon: icons.tick, 148 + hexpand: true, 149 + hpack: "end", 150 + connections: [ 151 + [ 152 + "draw", 153 + (icon) => { 154 + icon.visible = Audio.speaker === stream; 155 + }, 159 156 ], 157 + ], 160 158 }), 161 - }); 159 + ], 160 + }), 161 + }); 162 162 163 163 const SettingsButton = () => 164 - Widget.Button({ 165 - on_clicked: () => Utils.execAsync("pavucontrol"), 166 - hexpand: true, 167 - child: Widget.Box({ 168 - children: [ 169 - Widget.Icon(icons.ui.settings), 170 - Widget.Label("Settings"), 171 - ], 172 - }), 173 - }); 164 + Widget.Button({ 165 + on_clicked: () => Utils.execAsync("pavucontrol"), 166 + hexpand: true, 167 + child: Widget.Box({ 168 + children: [Widget.Icon(icons.ui.settings), Widget.Label("Settings")], 169 + }), 170 + }); 174 171 175 172 export const AppMixer = () => 176 - Menu({ 177 - name: "app-mixer", 178 - icon: FontIcon(icons.audio.mixer), 179 - title: Widget.Label("App Mixer"), 180 - content: [ 181 - Widget.Box({ 182 - vertical: true, 183 - binds: [["children", Audio, "apps", (a) => a.map(MixerItem)]], 184 - }), 185 - Widget.Separator(), 186 - SettingsButton(), 187 - ], 188 - }); 173 + Menu({ 174 + name: "app-mixer", 175 + icon: FontIcon(icons.audio.mixer), 176 + title: Widget.Label("App Mixer"), 177 + content: [ 178 + Widget.Box({ 179 + vertical: true, 180 + binds: [["children", Audio, "apps", (a) => a.map(MixerItem)]], 181 + }), 182 + Widget.Separator(), 183 + SettingsButton(), 184 + ], 185 + }); 189 186 190 187 export const SinkSelector = () => 191 - Menu({ 192 - name: "sink-selector", 193 - icon: Widget.Icon(icons.audio.type.headset), 194 - title: Widget.Label("Sink Selector"), 195 - content: [ 196 - Widget.Box({ 197 - vertical: true, 198 - binds: [ 199 - ["children", Audio, "speakers", (s) => s.map(SinkItem)], 200 - ], 201 - }), 202 - Widget.Separator(), 203 - SettingsButton(), 204 - ], 205 - }); 188 + Menu({ 189 + name: "sink-selector", 190 + icon: Widget.Icon(icons.audio.type.headset), 191 + title: Widget.Label("Sink Selector"), 192 + content: [ 193 + Widget.Box({ 194 + vertical: true, 195 + binds: [["children", Audio, "speakers", (s) => s.map(SinkItem)]], 196 + }), 197 + Widget.Separator(), 198 + SettingsButton(), 199 + ], 200 + });
+1 -1
home/isabel/programs/configs/gui/bars/eww/config/eww.scss
··· 26 26 @import "./scss/windows/screenshot.scss"; 27 27 28 28 tooltip { 29 - @include tooltip; 29 + @include tooltip; 30 30 }
+96 -97
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/apps.js
··· 3 3 import { Gio, GObject, Gtk } from "./lib.js"; 4 4 5 5 export const Apps = GObject.registerClass( 6 - { 7 - Signals: { sync: {} }, 8 - }, 9 - class Apps extends GObject.Object { 10 - constructor() { 11 - super(); 6 + { 7 + Signals: { sync: {} }, 8 + }, 9 + class Apps extends GObject.Object { 10 + constructor() { 11 + super(); 12 12 13 - this._register(); 14 - } 13 + this._register(); 14 + } 15 15 16 - get json() { 17 - return this._list; 18 - } 16 + get json() { 17 + return this._list; 18 + } 19 19 20 - _iconPath(icon) { 21 - return APPICON_CACHE_PATH + icon + ".png"; 22 - } 20 + _iconPath(icon) { 21 + return APPICON_CACHE_PATH + icon + ".png"; 22 + } 23 23 24 - init() { 25 - this._initIcons(); 26 - this.Query(""); 27 - } 24 + init() { 25 + this._initIcons(); 26 + this.Query(""); 27 + } 28 28 29 - _initIcons() { 30 - MkDirectory(); 31 - let icons = []; 32 - Gio.AppInfo.get_all().forEach((app) => { 33 - if (!app.should_show() || !app.get_icon()) return; 34 - if (typeof app.get_icon().get_names !== "function") return; 35 - app?.get_icon() 36 - ?.get_names() 37 - .forEach((icon) => icons.push(icon)); 38 - }); 29 + _initIcons() { 30 + MkDirectory(); 31 + let icons = []; 32 + Gio.AppInfo.get_all().forEach((app) => { 33 + if (!app.should_show() || !app.get_icon()) return; 34 + if (typeof app.get_icon().get_names !== "function") return; 35 + app 36 + ?.get_icon() 37 + ?.get_names() 38 + .forEach((icon) => icons.push(icon)); 39 + }); 39 40 40 - icons.forEach((icon) => { 41 - if (icon.includes("-symbolic")) return; 42 - let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon( 43 - Gio.Icon.new_for_string(icon), 44 - 128, 45 - null, 46 - ); 41 + icons.forEach((icon) => { 42 + if (icon.includes("-symbolic")) return; 43 + let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon( 44 + Gio.Icon.new_for_string(icon), 45 + 128, 46 + null, 47 + ); 47 48 48 - if (!iconInfo) return; 49 + if (!iconInfo) return; 49 50 50 - let output_stream = Gio.File.new_for_path( 51 - this._iconPath(icon), 52 - ).replace(null, false, Gio.FileCreateFlags.NONE, null); 51 + let output_stream = Gio.File.new_for_path(this._iconPath(icon)).replace( 52 + null, 53 + false, 54 + Gio.FileCreateFlags.NONE, 55 + null, 56 + ); 53 57 54 - iconInfo 55 - .load_icon() 56 - .save_to_streamv(output_stream, "png", null, null, null); 58 + iconInfo 59 + .load_icon() 60 + .save_to_streamv(output_stream, "png", null, null, null); 57 61 58 - output_stream.close(null); 59 - }); 60 - } 62 + output_stream.close(null); 63 + }); 64 + } 61 65 62 - _appIconName(app) { 63 - if (!app.get_icon()) return ""; 66 + _appIconName(app) { 67 + if (!app.get_icon()) return ""; 64 68 65 - if (typeof app.get_icon().get_names !== "function") return ""; 69 + if (typeof app.get_icon().get_names !== "function") return ""; 66 70 67 - let name = app.get_icon().get_names()[0]; 68 - return name ? this._iconPath(name) : ""; 69 - } 71 + let name = app.get_icon().get_names()[0]; 72 + return name ? this._iconPath(name) : ""; 73 + } 70 74 71 - Query(search) { 72 - let apps = Gio.AppInfo.get_all(); 73 - let list = []; 74 - apps.forEach((app) => { 75 - if (!app.should_show()) return; 76 - if (app.get_name()?.toLowerCase().includes(search)) 77 - list.push(app); 78 - else if (app.get_id()?.toLowerCase().includes(search)) 79 - list.push(app); 80 - else if (app.get_executable()?.toLowerCase().includes(search)) 81 - list.push(app); 82 - else if (app.get_description()?.toLowerCase().includes(search)) 83 - list.push(app); 84 - }); 75 + Query(search) { 76 + let apps = Gio.AppInfo.get_all(); 77 + let list = []; 78 + apps.forEach((app) => { 79 + if (!app.should_show()) return; 80 + if (app.get_name()?.toLowerCase().includes(search)) list.push(app); 81 + else if (app.get_id()?.toLowerCase().includes(search)) list.push(app); 82 + else if (app.get_executable()?.toLowerCase().includes(search)) 83 + list.push(app); 84 + else if (app.get_description()?.toLowerCase().includes(search)) 85 + list.push(app); 86 + }); 85 87 86 - let outList = []; 87 - list.forEach((app) => { 88 - outList.push({ 89 - name: app.get_name(), 90 - desktop: app.get_id(), 91 - description: app.get_description(), 92 - icon: this._appIconName(app), 93 - }); 94 - }); 95 - this._list = outList; 96 - this.emit("sync"); 97 - } 88 + let outList = []; 89 + list.forEach((app) => { 90 + outList.push({ 91 + name: app.get_name(), 92 + desktop: app.get_id(), 93 + description: app.get_description(), 94 + icon: this._appIconName(app), 95 + }); 96 + }); 97 + this._list = outList; 98 + this.emit("sync"); 99 + } 98 100 99 - _register() { 100 - Gio.bus_own_name( 101 - Gio.BusType.SESSION, 102 - "com.github.isabel.host", 103 - Gio.BusNameOwnerFlags.NONE, 104 - (connection, _) => { 105 - this._dbus = Gio.DBusExportedObject.wrapJSObject( 106 - ApplicationsIFace, 107 - this, 108 - ); 109 - this._dbus.export( 110 - connection, 111 - "/com/github/isabel/applications", 112 - ); 113 - }, 114 - null, 115 - null, 116 - ); 117 - } 118 - }, 101 + _register() { 102 + Gio.bus_own_name( 103 + Gio.BusType.SESSION, 104 + "com.github.isabel.host", 105 + Gio.BusNameOwnerFlags.NONE, 106 + (connection, _) => { 107 + this._dbus = Gio.DBusExportedObject.wrapJSObject( 108 + ApplicationsIFace, 109 + this, 110 + ); 111 + this._dbus.export(connection, "/com/github/isabel/applications"); 112 + }, 113 + null, 114 + null, 115 + ); 116 + } 117 + }, 119 118 );
+50 -64
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/battery.js
··· 2 2 import { PowerManagerProxy } from "./dbus.js"; 3 3 4 4 export const Battery = GObject.registerClass( 5 - { 6 - Signals: { sync: {} }, 7 - }, 8 - class Battery extends GObject.Object { 9 - constructor() { 10 - super(); 5 + { 6 + Signals: { sync: {} }, 7 + }, 8 + class Battery extends GObject.Object { 9 + constructor() { 10 + super(); 11 11 12 - this._json = {}; 13 - this._proxy = new PowerManagerProxy( 14 - Gio.DBus.system, 15 - "org.freedesktop.UPower", 16 - "/org/freedesktop/UPower/devices/DisplayDevice", 17 - () => { 18 - this._proxy.connect("g-properties-changed", () => 19 - this._sync(), 20 - ); 21 - this._sync(); 22 - }, 23 - ); 24 - } 12 + this._json = {}; 13 + this._proxy = new PowerManagerProxy( 14 + Gio.DBus.system, 15 + "org.freedesktop.UPower", 16 + "/org/freedesktop/UPower/devices/DisplayDevice", 17 + () => { 18 + this._proxy.connect("g-properties-changed", () => this._sync()); 19 + this._sync(); 20 + }, 21 + ); 22 + } 25 23 26 - get json() { 27 - return this._json; 28 - } 24 + get json() { 25 + return this._json; 26 + } 29 27 30 - _sync() { 31 - if (!this._proxy.IsPresent) return { available: false }; 28 + _sync() { 29 + if (!this._proxy.IsPresent) return { available: false }; 32 30 33 - let percent = this._proxy.Percentage; 34 - let charging = 35 - this._proxy.State === UPowerGlib.DeviceState.CHARGING; 36 - let charged = 37 - this._proxy.State === UPowerGlib.DeviceState.FULLY_CHARGED || 38 - (this._proxy.State === UPowerGlib.DeviceState.CHARGING && 39 - percent === 100); 31 + let percent = this._proxy.Percentage; 32 + let charging = this._proxy.State === UPowerGlib.DeviceState.CHARGING; 33 + let charged = 34 + this._proxy.State === UPowerGlib.DeviceState.FULLY_CHARGED || 35 + (this._proxy.State === UPowerGlib.DeviceState.CHARGING && 36 + percent === 100); 40 37 41 - let icons = ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"]; 42 - let charging_icons = [ 43 - "󰢜", 44 - "󰂆", 45 - "󰂇", 46 - "󰂈", 47 - "󰢝", 48 - "󰂉", 49 - "󰢞", 50 - "󰂊", 51 - "󰂋", 52 - "󰂅", 53 - ]; 54 - let i = Math.round(percent / 10) - 1; 55 - if (i < 0) i = 0; 38 + let icons = ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"]; 39 + let charging_icons = ["󰢜", "󰂆", "󰂇", "󰂈", "󰢝", "󰂉", "󰢞", "󰂊", "󰂋", "󰂅"]; 40 + let i = Math.round(percent / 10) - 1; 41 + if (i < 0) i = 0; 56 42 57 - let icon; 58 - if (charged) icon = "󰂄"; 59 - else if (charging) icon = charging_icons[i]; 60 - else if (percent < 10) icon = "󱃍"; 61 - else icon = icons[i]; 43 + let icon; 44 + if (charged) icon = "󰂄"; 45 + else if (charging) icon = charging_icons[i]; 46 + else if (percent < 10) icon = "󱃍"; 47 + else icon = icons[i]; 62 48 63 - let state = ""; 64 - if (charged) state = "charged"; 65 - else if (charging) state = "charging"; 66 - else if (percent < 30) state = "low"; 49 + let state = ""; 50 + if (charged) state = "charged"; 51 + else if (charging) state = "charging"; 52 + else if (percent < 30) state = "low"; 67 53 68 - this._json = { 69 - available: true, 70 - icon, 71 - percent, 72 - state, 73 - }; 74 - this.emit("sync"); 75 - } 76 - }, 54 + this._json = { 55 + available: true, 56 + icon, 57 + percent, 58 + state, 59 + }; 60 + this.emit("sync"); 61 + } 62 + }, 77 63 );
+94 -99
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/bluetooth.js
··· 1 1 import { GObject, GnomeBluetooth } from "./lib.js"; 2 2 3 3 const STATES = { 4 - [GnomeBluetooth.AdapterState.ABSENT]: "absent", 5 - [GnomeBluetooth.AdapterState.ON]: "on", 6 - [GnomeBluetooth.AdapterState.TURNING_ON]: "on", 7 - [GnomeBluetooth.AdapterState.OFF]: "off", 8 - [GnomeBluetooth.AdapterState.TURNING_OFF]: "off", 4 + [GnomeBluetooth.AdapterState.ABSENT]: "absent", 5 + [GnomeBluetooth.AdapterState.ON]: "on", 6 + [GnomeBluetooth.AdapterState.TURNING_ON]: "on", 7 + [GnomeBluetooth.AdapterState.OFF]: "off", 8 + [GnomeBluetooth.AdapterState.TURNING_OFF]: "off", 9 9 }; 10 10 11 11 const ICONS = { 12 - absent: "󰂲", 13 - off: "󰂲", 14 - on: "󰂯", 15 - "audio-headset": "󰋋", 12 + absent: "󰂲", 13 + off: "󰂲", 14 + on: "󰂯", 15 + "audio-headset": "󰋋", 16 16 }; 17 17 18 18 export const Bluetooth = GObject.registerClass( 19 - { 20 - Signals: { sync: {} }, 21 - }, 22 - class Bluetooth extends GObject.Object { 23 - constructor() { 24 - super(); 19 + { 20 + Signals: { sync: {} }, 21 + }, 22 + class Bluetooth extends GObject.Object { 23 + constructor() { 24 + super(); 25 25 26 - this._json = {}; 27 - this._devices = new Map(); 28 - this._connections = new Map(); 29 - this._client = new GnomeBluetooth.Client(); 30 - this._client.connect( 31 - "notify::default-adapter-state", 32 - this._sync.bind(this), 33 - ); 34 - this._client.connect("device-added", this._deviceAdded.bind(this)); 35 - this._client.connect( 36 - "device-removed", 37 - this._deviceRemoved.bind(this), 38 - ); 39 - this._getDevices().forEach((device) => 40 - this._deviceAdded(_, device), 41 - ); 42 - this._sync(); 43 - } 26 + this._json = {}; 27 + this._devices = new Map(); 28 + this._connections = new Map(); 29 + this._client = new GnomeBluetooth.Client(); 30 + this._client.connect( 31 + "notify::default-adapter-state", 32 + this._sync.bind(this), 33 + ); 34 + this._client.connect("device-added", this._deviceAdded.bind(this)); 35 + this._client.connect("device-removed", this._deviceRemoved.bind(this)); 36 + this._getDevices().forEach((device) => this._deviceAdded(_, device)); 37 + this._sync(); 38 + } 44 39 45 - get json() { 46 - return this._json; 47 - } 40 + get json() { 41 + return this._json; 42 + } 48 43 49 - _deviceAdded(_, device) { 50 - if (this._devices.has(device.address)) return; 44 + _deviceAdded(_, device) { 45 + if (this._devices.has(device.address)) return; 51 46 52 - let connections = []; 53 - [ 54 - "address", 55 - "alias", 56 - "battery-level", 57 - "battery-percentage", 58 - "connected", 59 - "icon", 60 - "name", 61 - "paired", 62 - "truested", 63 - ].forEach((prop) => 64 - connections.push( 65 - device.connect(`notify::${prop}`, this._sync.bind(this)), 66 - ), 67 - ); 68 - this._connections.set(device.address, connections); 47 + let connections = []; 48 + [ 49 + "address", 50 + "alias", 51 + "battery-level", 52 + "battery-percentage", 53 + "connected", 54 + "icon", 55 + "name", 56 + "paired", 57 + "truested", 58 + ].forEach((prop) => 59 + connections.push( 60 + device.connect(`notify::${prop}`, this._sync.bind(this)), 61 + ), 62 + ); 63 + this._connections.set(device.address, connections); 69 64 70 - this._devices.set(device.address, device); 71 - this._sync(); 72 - } 65 + this._devices.set(device.address, device); 66 + this._sync(); 67 + } 73 68 74 - _deviceRemoved(_, device) { 75 - if (!this._devices.has(device.address)) return; 69 + _deviceRemoved(_, device) { 70 + if (!this._devices.has(device.address)) return; 76 71 77 - this._connections 78 - .get(device.address) 79 - .forEach((id) => device.disconnect(id)); 80 - this._connections.delete(device.address); 81 - this._devices.delete(device.address); 82 - this._sync(); 83 - } 72 + this._connections 73 + .get(device.address) 74 + .forEach((id) => device.disconnect(id)); 75 + this._connections.delete(device.address); 76 + this._devices.delete(device.address); 77 + this._sync(); 78 + } 84 79 85 - _getDevices() { 86 - let devices = []; 87 - const deviceStore = this._client.get_devices(); 80 + _getDevices() { 81 + let devices = []; 82 + const deviceStore = this._client.get_devices(); 88 83 89 - for (let i = 0; i < deviceStore.get_n_items(); ++i) { 90 - const device = deviceStore.get_item(i); 84 + for (let i = 0; i < deviceStore.get_n_items(); ++i) { 85 + const device = deviceStore.get_item(i); 91 86 92 - if (device.paired || device.trusted) devices.push(device); 93 - } 87 + if (device.paired || device.trusted) devices.push(device); 88 + } 94 89 95 - return devices; 96 - } 90 + return devices; 91 + } 97 92 98 - _sync() { 99 - this._json.state = STATES[this._client.default_adapter_state]; 100 - this._json.icon = ICONS[this._json.state]; 101 - this._json.connected_devices = []; 102 - this._json.devices = []; 103 - for (const [_, device] of this._devices) { 104 - let item = { 105 - address: device.address, 106 - alias: device.alias, 107 - battery_level: device.battery_level, 108 - battery_percentage: device.battery_percentage, 109 - connected: device.connected, 110 - icon: ICONS[device.icon], 111 - name: device.name, 112 - paired: device.paired, 113 - trusted: device.trusted, 114 - }; 115 - this._json.devices.push(item); 116 - if (device.connected) this._json.connected_devices.push(item); 117 - } 93 + _sync() { 94 + this._json.state = STATES[this._client.default_adapter_state]; 95 + this._json.icon = ICONS[this._json.state]; 96 + this._json.connected_devices = []; 97 + this._json.devices = []; 98 + for (const [_, device] of this._devices) { 99 + let item = { 100 + address: device.address, 101 + alias: device.alias, 102 + battery_level: device.battery_level, 103 + battery_percentage: device.battery_percentage, 104 + connected: device.connected, 105 + icon: ICONS[device.icon], 106 + name: device.name, 107 + paired: device.paired, 108 + trusted: device.trusted, 109 + }; 110 + this._json.devices.push(item); 111 + if (device.connected) this._json.connected_devices.push(item); 112 + } 118 113 119 - this.emit("sync"); 120 - } 121 - }, 114 + this.emit("sync"); 115 + } 116 + }, 122 117 );
+3 -3
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/dbus.js
··· 1 1 import { Gio } from "./lib.js"; 2 2 3 3 export const MprisPlayerProxy = Gio.DBusProxy.makeProxyWrapper( 4 - `<node> 4 + `<node> 5 5 <interface name="org.mpris.MediaPlayer2.Player"> 6 6 <property name='CanControl' type='b' access='read' /> 7 7 <property name='CanGoNext' type='b' access='read' /> ··· 19 19 ); 20 20 21 21 export const DBusProxy = Gio.DBusProxy.makeProxyWrapper( 22 - `<node> 22 + `<node> 23 23 <interface name="org.freedesktop.DBus"> 24 24 <method name="ListNames"> 25 25 <arg type="as" direction="out" name="names"/> ··· 34 34 ); 35 35 36 36 export const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper( 37 - `<node> 37 + `<node> 38 38 <interface name="org.freedesktop.UPower.Device"> 39 39 <property name="State" type="u" access="read"/> 40 40 <property name="Percentage" type="d" access="read"/>
+8 -8
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/lib.js
··· 8 8 imports.gi.versions.GdkPixbuf = "2.0"; 9 9 10 10 export const { 11 - Gtk, 12 - Gio, 13 - GLib, 14 - GObject, 15 - UPowerGlib, 16 - GnomeBluetooth, 17 - NM, 18 - GdkPixbuf, 11 + Gtk, 12 + Gio, 13 + GLib, 14 + GObject, 15 + UPowerGlib, 16 + GnomeBluetooth, 17 + NM, 18 + GdkPixbuf, 19 19 } = imports.gi;
+112 -120
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/main.js
··· 15 15 export const APPICON_CACHE_PATH = CACHE_PATH + "apps/"; 16 16 17 17 export const PlayerIcons = { 18 - deafult: "", //icon broken 19 - spotify: "", 20 - chromium: "", 21 - mpv: "", 18 + deafult: "", //icon broken 19 + spotify: "", 20 + chromium: "", 21 + mpv: "", 22 22 }; 23 23 24 24 export function MkDirectory() { 25 - [ 26 - CACHE_PATH, 27 - MEDIA_CACHE_PATH, 28 - NOTIFICATIONS_CACHE_PATH, 29 - APPICON_CACHE_PATH, 30 - ].forEach((path) => { 31 - if (!GLib.file_test(path, GLib.FileTest.EXISTS)) 32 - Gio.File.new_for_path(path).make_directory(null); 33 - }); 25 + [ 26 + CACHE_PATH, 27 + MEDIA_CACHE_PATH, 28 + NOTIFICATIONS_CACHE_PATH, 29 + APPICON_CACHE_PATH, 30 + ].forEach((path) => { 31 + if (!GLib.file_test(path, GLib.FileTest.EXISTS)) 32 + Gio.File.new_for_path(path).make_directory(null); 33 + }); 34 34 } 35 35 36 36 const App = GObject.registerClass( 37 - class App extends Gtk.Application { 38 - constructor({ eww, file, stdout, fg_color }) { 39 - super({ 40 - application_id: "com.github.isabel.host", 41 - flags: Gio.ApplicationFlags.DEFAULT_FLAGS, 42 - }); 37 + class App extends Gtk.Application { 38 + constructor({ eww, file, stdout, fg_color }) { 39 + super({ 40 + application_id: "com.github.isabel.host", 41 + flags: Gio.ApplicationFlags.DEFAULT_FLAGS, 42 + }); 43 43 44 - MkDirectory(); 44 + MkDirectory(); 45 45 46 - this._eww = eww; 47 - this._file = file; 48 - this._stdout = stdout; 49 - this._json = {}; 46 + this._eww = eww; 47 + this._file = file; 48 + this._stdout = stdout; 49 + this._json = {}; 50 50 51 - this._notifications = new Notifications(fg_color); 52 - this._battery = new Battery(); 53 - this._network = new Network(); 54 - this._bluetooth = new Bluetooth(); 55 - this._media = new Media(); 56 - this._apps = new Apps(); 51 + this._notifications = new Notifications(fg_color); 52 + this._battery = new Battery(); 53 + this._network = new Network(); 54 + this._bluetooth = new Bluetooth(); 55 + this._media = new Media(); 56 + this._apps = new Apps(); 57 57 58 - this.run(null); 59 - } 58 + this.run(null); 59 + } 60 60 61 - vfunc_activate() { 62 - this.hold(); 61 + vfunc_activate() { 62 + this.hold(); 63 63 64 - [ 65 - "notifications", 66 - "battery", 67 - "network", 68 - "bluetooth", 69 - "apps", 70 - "media", 71 - ].forEach((m) => this._output(this[`_${m}`].json, m)); 64 + [ 65 + "notifications", 66 + "battery", 67 + "network", 68 + "bluetooth", 69 + "apps", 70 + "media", 71 + ].forEach((m) => this._output(this[`_${m}`].json, m)); 72 72 73 - this._notifications.connect("sync", (o) => 74 - this._output(o.json, "notifications"), 75 - ); 76 - this._battery.connect("sync", (o) => 77 - this._output(o.json, "battery"), 78 - ); 79 - this._network.connect("sync", (o) => 80 - this._output(o.json, "network"), 81 - ); 82 - this._bluetooth.connect("sync", (o) => 83 - this._output(o.json, "bluetooth"), 84 - ); 85 - this._apps.connect("sync", (o) => this._output(o.json, "apps")); 86 - this._apps.init(); 73 + this._notifications.connect("sync", (o) => 74 + this._output(o.json, "notifications"), 75 + ); 76 + this._battery.connect("sync", (o) => this._output(o.json, "battery")); 77 + this._network.connect("sync", (o) => this._output(o.json, "network")); 78 + this._bluetooth.connect("sync", (o) => this._output(o.json, "bluetooth")); 79 + this._apps.connect("sync", (o) => this._output(o.json, "apps")); 80 + this._apps.init(); 87 81 88 - this._media.connect("sync", (o) => this._output(o.json, "media")); 89 - this._media.connect("positions", (o) => 90 - this._output(o.positions, "media_positions"), 91 - ); 92 - GLib.timeout_add(GLib.PRIORITY_DEFAULT, TICK_INTERVAL, () => 93 - this._media.getPositions(), 94 - ); 95 - } 82 + this._media.connect("sync", (o) => this._output(o.json, "media")); 83 + this._media.connect("positions", (o) => 84 + this._output(o.positions, "media_positions"), 85 + ); 86 + GLib.timeout_add(GLib.PRIORITY_DEFAULT, TICK_INTERVAL, () => 87 + this._media.getPositions(), 88 + ); 89 + } 96 90 97 - _output(json, name) { 98 - if (!json) return; 99 - if (this._file) { 100 - const file = Gio.File.new_for_path(CACHE_PATH + name + ".json"); 91 + _output(json, name) { 92 + if (!json) return; 93 + if (this._file) { 94 + const file = Gio.File.new_for_path(CACHE_PATH + name + ".json"); 101 95 102 - if (!GLib.file_test(file.get_path(), GLib.FileTest.EXISTS)) 103 - file.create(Gio.FileCreateFlags.NONE, null); 96 + if (!GLib.file_test(file.get_path(), GLib.FileTest.EXISTS)) 97 + file.create(Gio.FileCreateFlags.NONE, null); 104 98 105 - file.replace_contents( 106 - JSON.stringify(json, null, 2), 107 - null, 108 - false, 109 - Gio.FileCreateFlags.REPLACE_DESTINATION, 110 - null, 111 - ); 112 - } 99 + file.replace_contents( 100 + JSON.stringify(json, null, 2), 101 + null, 102 + false, 103 + Gio.FileCreateFlags.REPLACE_DESTINATION, 104 + null, 105 + ); 106 + } 113 107 114 - if (this._eww) { 115 - GLib.spawn_command_line_async( 116 - `eww update ${name}=${JSON.stringify( 117 - JSON.stringify(json), 118 - )}`, 119 - ); 120 - } 108 + if (this._eww) { 109 + GLib.spawn_command_line_async( 110 + `eww update ${name}=${JSON.stringify(JSON.stringify(json))}`, 111 + ); 112 + } 121 113 122 - if (this._stdout) { 123 - this._json[name] = json; 124 - print(JSON.stringify(this._json, null, 2)); 125 - } 126 - } 127 - }, 114 + if (this._stdout) { 115 + this._json[name] = json; 116 + print(JSON.stringify(this._json, null, 2)); 117 + } 118 + } 119 + }, 128 120 ); 129 121 130 122 function parseArgs(argv) { 131 - let args = {}; 132 - for (let i = 0; i < argv.length; ++i) { 133 - switch (argv[i]) { 134 - case "--help": 135 - args.help = true; 136 - break; 137 - case "--eww": 138 - args.eww = true; 139 - break; 140 - case "--file": 141 - args.file = true; 142 - break; 143 - case "--stdout": 144 - args.stdout = true; 145 - break; 146 - case "--fg-color": 147 - args.fg_color = argv[i++]; 148 - break; 149 - default: 150 - break; 151 - } 123 + let args = {}; 124 + for (let i = 0; i < argv.length; ++i) { 125 + switch (argv[i]) { 126 + case "--help": 127 + args.help = true; 128 + break; 129 + case "--eww": 130 + args.eww = true; 131 + break; 132 + case "--file": 133 + args.file = true; 134 + break; 135 + case "--stdout": 136 + args.stdout = true; 137 + break; 138 + case "--fg-color": 139 + args.fg_color = argv[i++]; 140 + break; 141 + default: 142 + break; 152 143 } 153 - return args; 144 + } 145 + return args; 154 146 } 155 147 156 148 export function main(argv) { 157 - let { help, eww, file, stdout, fg_color } = parseArgs(argv); 158 - if ((!eww && !file && !stdout) || help) { 159 - print("Usage:", argv[0], "[--eww] [--file] [--stdout]"); 160 - return; 161 - } 162 - print("Cache directory:", CACHE_PATH); 163 - new App({ eww, file, stdout, fg_color }); 149 + let { help, eww, file, stdout, fg_color } = parseArgs(argv); 150 + if ((!eww && !file && !stdout) || help) { 151 + print("Usage:", argv[0], "[--eww] [--file] [--stdout]"); 152 + return; 153 + } 154 + print("Cache directory:", CACHE_PATH); 155 + new App({ eww, file, stdout, fg_color }); 164 156 }
+237 -251
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/media.js
··· 1 1 import { MprisPlayerProxy, DBusProxy } from "./dbus.js"; 2 2 import { 3 - PlayerIcons, 4 - PREFERRED_PLAYER, 5 - MEDIA_CACHE_PATH, 6 - MkDirectory, 3 + PlayerIcons, 4 + PREFERRED_PLAYER, 5 + MEDIA_CACHE_PATH, 6 + MkDirectory, 7 7 } from "./main.js"; 8 8 import { GObject, Gio, GLib } from "./lib.js"; 9 9 10 10 function _lengthStr(length) { 11 - let min = Math.floor(length / 60); 12 - let sec0 = Math.floor(length % 60) < 10 ? "0" : ""; 13 - let sec = Math.floor(length % 60); 14 - return `${min}:${sec0}${sec}`; 11 + let min = Math.floor(length / 60); 12 + let sec0 = Math.floor(length % 60) < 10 ? "0" : ""; 13 + let sec = Math.floor(length % 60); 14 + return `${min}:${sec0}${sec}`; 15 15 } 16 16 17 17 function _getName(busName) { 18 - return busName.substring(23).split(".")[0]; 18 + return busName.substring(23).split(".")[0]; 19 19 } 20 20 21 21 const MprisPlayer = GObject.registerClass( 22 - { 23 - Signals: { changed: {}, closed: {}, ready: {} }, 24 - }, 25 - class MprisPlayer extends GObject.Object { 26 - constructor(busName) { 27 - super(); 22 + { 23 + Signals: { changed: {}, closed: {}, ready: {} }, 24 + }, 25 + class MprisPlayer extends GObject.Object { 26 + constructor(busName) { 27 + super(); 28 28 29 - this._proxy = new MprisPlayerProxy( 30 - Gio.DBus.session, 31 - busName, 32 - "/org/mpris/MediaPlayer2", 33 - this._onPlayerProxyReady.bind(this), 34 - ); 29 + this._proxy = new MprisPlayerProxy( 30 + Gio.DBus.session, 31 + busName, 32 + "/org/mpris/MediaPlayer2", 33 + this._onPlayerProxyReady.bind(this), 34 + ); 35 35 36 - this._busName = busName; 37 - this._name = _getName(busName); 38 - this._playerIcon = 39 - PlayerIcons?.[this._name] || PlayerIcons.deafult || ""; 40 - this._trackArtists = []; 41 - this._trackTitle = ""; 42 - this._trackCoverUrl = ""; 43 - this._coverPath = ""; 44 - this._playBackStatus = ""; 45 - this._canGoNext = false; 46 - this._canGoPrev = false; 47 - this._canPlay = false; 48 - this._shuffle = false; 49 - this._loopStatus = ""; 50 - this._volume = -1; 51 - this._length = -1; 52 - this._position = -1; 53 - } 36 + this._busName = busName; 37 + this._name = _getName(busName); 38 + this._playerIcon = PlayerIcons?.[this._name] || PlayerIcons.deafult || ""; 39 + this._trackArtists = []; 40 + this._trackTitle = ""; 41 + this._trackCoverUrl = ""; 42 + this._coverPath = ""; 43 + this._playBackStatus = ""; 44 + this._canGoNext = false; 45 + this._canGoPrev = false; 46 + this._canPlay = false; 47 + this._shuffle = false; 48 + this._loopStatus = ""; 49 + this._volume = -1; 50 + this._length = -1; 51 + this._position = -1; 52 + } 54 53 55 - close() { 56 - this._proxy.disconnect(this._playerBinding1); 57 - this._proxy.disconnect(this._playerBinding2); 58 - this._proxy = null; 54 + close() { 55 + this._proxy.disconnect(this._playerBinding1); 56 + this._proxy.disconnect(this._playerBinding2); 57 + this._proxy = null; 59 58 60 - this.emit("closed"); 61 - } 59 + this.emit("closed"); 60 + } 62 61 63 - _onPlayerProxyReady() { 64 - this._playerBinding1 = this._proxy.connect( 65 - "notify::g-name-owner", 66 - () => { 67 - if (!this._proxy.g_name_owner) this.close(); 68 - }, 69 - ); 70 - this._playerBinding2 = this._proxy.connect( 71 - "g-properties-changed", 72 - () => { 73 - this._updateState(); 74 - this._cacheCoverArt(); 75 - this.emit("changed"); 76 - }, 77 - ); 78 - if (!this._proxy.g_name_owner) this.close(); 62 + _onPlayerProxyReady() { 63 + this._playerBinding1 = this._proxy.connect("notify::g-name-owner", () => { 64 + if (!this._proxy.g_name_owner) this.close(); 65 + }); 66 + this._playerBinding2 = this._proxy.connect("g-properties-changed", () => { 67 + this._updateState(); 68 + this._cacheCoverArt(); 69 + this.emit("changed"); 70 + }); 71 + if (!this._proxy.g_name_owner) this.close(); 79 72 80 - this._updateState(); 81 - this._cacheCoverArt(); 82 - this.emit("ready"); 83 - } 73 + this._updateState(); 74 + this._cacheCoverArt(); 75 + this.emit("ready"); 76 + } 84 77 85 - _updateState() { 86 - let metadata = {}; 87 - for (let prop in this._proxy.Metadata) 88 - metadata[prop] = this._proxy.Metadata[prop].deep_unpack(); 78 + _updateState() { 79 + let metadata = {}; 80 + for (let prop in this._proxy.Metadata) 81 + metadata[prop] = this._proxy.Metadata[prop].deep_unpack(); 89 82 90 - this._trackArtists = metadata["xesam:artist"]; 91 - if ( 92 - !Array.isArray(this._trackArtists) || 93 - !this._trackArtists.every( 94 - (artist) => typeof artist === "string", 95 - ) 96 - ) 97 - this._trackArtists = ["Unknown artist"]; 83 + this._trackArtists = metadata["xesam:artist"]; 84 + if ( 85 + !Array.isArray(this._trackArtists) || 86 + !this._trackArtists.every((artist) => typeof artist === "string") 87 + ) 88 + this._trackArtists = ["Unknown artist"]; 98 89 99 - this._trackTitle = metadata["xesam:title"]; 100 - if (typeof this._trackTitle !== "string") 101 - this._trackTitle = "Unknown title"; 90 + this._trackTitle = metadata["xesam:title"]; 91 + if (typeof this._trackTitle !== "string") 92 + this._trackTitle = "Unknown title"; 102 93 103 - this._trackCoverUrl = metadata["mpris:artUrl"]; 104 - if (typeof this._trackCoverUrl !== "string") 105 - this._trackCoverUrl = ""; 94 + this._trackCoverUrl = metadata["mpris:artUrl"]; 95 + if (typeof this._trackCoverUrl !== "string") this._trackCoverUrl = ""; 106 96 107 - this._length = metadata["mpris:length"]; 108 - if (typeof this._length !== "number") this._length = -1; 109 - else 110 - this._length = Number.parseInt( 111 - `${this._length}`.substring(0, 3), 112 - ); 97 + this._length = metadata["mpris:length"]; 98 + if (typeof this._length !== "number") this._length = -1; 99 + else this._length = Number.parseInt(`${this._length}`.substring(0, 3)); 113 100 114 - this._position = this._proxy.Position; 115 - if (typeof this._position !== "number") this._position = -1; 116 - else this._position = this._position / 1000000; 101 + this._position = this._proxy.Position; 102 + if (typeof this._position !== "number") this._position = -1; 103 + else this._position = this._position / 1000000; 117 104 118 - this._playBackStatus = this._proxy.PlaybackStatus; 119 - this._canGoNext = this._proxy.CanGoNext; 120 - this._canGoPrev = this._proxy.CanGoPrevious; 121 - this._canPlay = this._proxy.CanPlay; 105 + this._playBackStatus = this._proxy.PlaybackStatus; 106 + this._canGoNext = this._proxy.CanGoNext; 107 + this._canGoPrev = this._proxy.CanGoPrevious; 108 + this._canPlay = this._proxy.CanPlay; 122 109 123 - this._shuffle = this._proxy.Shuffle; 124 - if (typeof this._shuffle !== "boolean") { 125 - this._shuffle = null; 126 - } 127 - this._loopStatus = this._proxy.LoopStatus; 128 - if (typeof this._loopStatus !== "string") { 129 - this._loopStatus = null; 130 - } 131 - this._volume = this._proxy.Volume; 132 - if (typeof this._volume !== "number") { 133 - this._volume = -1; 134 - } 135 - } 110 + this._shuffle = this._proxy.Shuffle; 111 + if (typeof this._shuffle !== "boolean") { 112 + this._shuffle = null; 113 + } 114 + this._loopStatus = this._proxy.LoopStatus; 115 + if (typeof this._loopStatus !== "string") { 116 + this._loopStatus = null; 117 + } 118 + this._volume = this._proxy.Volume; 119 + if (typeof this._volume !== "number") { 120 + this._volume = -1; 121 + } 122 + } 136 123 137 - _cacheCoverArt() { 138 - this._coverPath = 139 - MEDIA_CACHE_PATH + 140 - `${this._trackArtists.join(", ")}_${this._trackTitle}`.replace( 141 - /[\,\*\?\"\<\>\|\#\:\?\/\']/g, 142 - "", 143 - ); 124 + _cacheCoverArt() { 125 + this._coverPath = 126 + MEDIA_CACHE_PATH + 127 + `${this._trackArtists.join(", ")}_${this._trackTitle}`.replace( 128 + /[\,\*\?\"\<\>\|\#\:\?\/\']/g, 129 + "", 130 + ); 144 131 145 - if (this._trackCoverUrl === "") return; 146 - if (this._coverPath === "_") return; 147 - if (GLib.file_test(this._coverPath, GLib.FileTest.EXISTS)) return; 132 + if (this._trackCoverUrl === "") return; 133 + if (this._coverPath === "_") return; 134 + if (GLib.file_test(this._coverPath, GLib.FileTest.EXISTS)) return; 148 135 149 - MkDirectory(); 136 + MkDirectory(); 150 137 151 - // Gio.File.new_for_uri(this._trackCoverUrl).copy_async( 152 - // Gio.File.new_for_path(this._coverPath), 153 - // Gio.FileCopyFlags.OVERWRITE, 154 - // GLib.PRIORITY_DEFAULT, 155 - // null, 156 - // null, 157 - // (source, result) => { 158 - // try { source.copy_finish(result) } 159 - // catch (e) { log(`failed to cache ${this._coverPath}`, e) } 160 - // } 161 - // ); 138 + // Gio.File.new_for_uri(this._trackCoverUrl).copy_async( 139 + // Gio.File.new_for_path(this._coverPath), 140 + // Gio.FileCopyFlags.OVERWRITE, 141 + // GLib.PRIORITY_DEFAULT, 142 + // null, 143 + // null, 144 + // (source, result) => { 145 + // try { source.copy_finish(result) } 146 + // catch (e) { log(`failed to cache ${this._coverPath}`, e) } 147 + // } 148 + // ); 162 149 163 - try { 164 - Gio.File.new_for_uri(this._trackCoverUrl).copy( 165 - Gio.File.new_for_path(this._coverPath), 166 - Gio.FileCopyFlags.OVERWRITE, 167 - null, 168 - null, 169 - ); 170 - } catch (e) { 171 - log(`failed to cache ${this._coverPath}`, e); 172 - } 173 - } 150 + try { 151 + Gio.File.new_for_uri(this._trackCoverUrl).copy( 152 + Gio.File.new_for_path(this._coverPath), 153 + Gio.FileCopyFlags.OVERWRITE, 154 + null, 155 + null, 156 + ); 157 + } catch (e) { 158 + log(`failed to cache ${this._coverPath}`, e); 159 + } 160 + } 174 161 175 - get json() { 176 - return { 177 - busName: this._busName, //busName 178 - name: _getName(this._busName), 179 - icon: this._playerIcon, 180 - artist: this._trackArtists.join(", "), 181 - title: this._trackTitle, 182 - cover: this._coverPath, 183 - status: this._playBackStatus, 184 - canNext: this._canGoNext, 185 - canPrev: this._canGoPrev, 186 - canPlay: this._canPlay, 187 - shuffle: this._shuffle, 188 - loop: this._loopStatus, 189 - volume: this._volume * 100, 190 - length: this._length, 191 - lengthStr: _lengthStr(this._length), 192 - position: this._position, 193 - }; 194 - } 195 - }, 162 + get json() { 163 + return { 164 + busName: this._busName, //busName 165 + name: _getName(this._busName), 166 + icon: this._playerIcon, 167 + artist: this._trackArtists.join(", "), 168 + title: this._trackTitle, 169 + cover: this._coverPath, 170 + status: this._playBackStatus, 171 + canNext: this._canGoNext, 172 + canPrev: this._canGoPrev, 173 + canPlay: this._canPlay, 174 + shuffle: this._shuffle, 175 + loop: this._loopStatus, 176 + volume: this._volume * 100, 177 + length: this._length, 178 + lengthStr: _lengthStr(this._length), 179 + position: this._position, 180 + }; 181 + } 182 + }, 196 183 ); 197 184 198 185 export const Media = GObject.registerClass( 199 - { 200 - Signals: { sync: {}, positions: {} }, 201 - }, 202 - class Media extends GObject.Object { 203 - _init() { 204 - super._init(); 186 + { 187 + Signals: { sync: {}, positions: {} }, 188 + }, 189 + class Media extends GObject.Object { 190 + _init() { 191 + super._init(); 205 192 206 - this._json = {}; 207 - this._positions = {}; 208 - this._players = new Map(); 209 - this._proxy = new DBusProxy( 210 - Gio.DBus.session, 211 - "org.freedesktop.DBus", 212 - "/org/freedesktop/DBus", 213 - this._onProxyReady.bind(this), 214 - ); 215 - } 193 + this._json = {}; 194 + this._positions = {}; 195 + this._players = new Map(); 196 + this._proxy = new DBusProxy( 197 + Gio.DBus.session, 198 + "org.freedesktop.DBus", 199 + "/org/freedesktop/DBus", 200 + this._onProxyReady.bind(this), 201 + ); 202 + } 216 203 217 - get json() { 218 - return this._json; 219 - } 220 - get positions() { 221 - return this._positions; 222 - } 204 + get json() { 205 + return this._json; 206 + } 207 + get positions() { 208 + return this._positions; 209 + } 223 210 224 - _addPlayer(busName) { 225 - if (this._players.get(busName)) return; 211 + _addPlayer(busName) { 212 + if (this._players.get(busName)) return; 226 213 227 - let player = new MprisPlayer(busName); 228 - player.connect("closed", () => { 229 - this._players.delete(busName); 230 - this._sync(); 231 - }); 232 - player.connect("changed", this._sync.bind(this)); 233 - player.connect("ready", this._sync.bind(this)); 234 - this._players.set(busName, player); 235 - } 214 + let player = new MprisPlayer(busName); 215 + player.connect("closed", () => { 216 + this._players.delete(busName); 217 + this._sync(); 218 + }); 219 + player.connect("changed", this._sync.bind(this)); 220 + player.connect("ready", this._sync.bind(this)); 221 + this._players.set(busName, player); 222 + } 236 223 237 - _onProxyReady() { 238 - this._proxy.ListNamesRemote(([names]) => { 239 - names.forEach((name) => { 240 - if (name.startsWith("org.mpris.MediaPlayer2.")) 241 - this._addPlayer(name); 242 - }); 243 - }); 244 - this._proxy.connectSignal( 245 - "NameOwnerChanged", 246 - this._onNameOwnerChanged.bind(this), 247 - ); 248 - this._sync(); 249 - } 224 + _onProxyReady() { 225 + this._proxy.ListNamesRemote(([names]) => { 226 + names.forEach((name) => { 227 + if (name.startsWith("org.mpris.MediaPlayer2.")) this._addPlayer(name); 228 + }); 229 + }); 230 + this._proxy.connectSignal( 231 + "NameOwnerChanged", 232 + this._onNameOwnerChanged.bind(this), 233 + ); 234 + this._sync(); 235 + } 250 236 251 - _onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) { 252 - if (!name.startsWith("org.mpris.MediaPlayer2.")) return; 237 + _onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) { 238 + if (!name.startsWith("org.mpris.MediaPlayer2.")) return; 253 239 254 - if (newOwner && !oldOwner) this._addPlayer(name); 255 - } 240 + if (newOwner && !oldOwner) this._addPlayer(name); 241 + } 256 242 257 - _sync() { 258 - let preferred = null; 259 - let players = []; 260 - for (const [_, player] of this._players) { 261 - if (player.json.busName.includes(PREFERRED_PLAYER)) 262 - preferred = player.json; 243 + _sync() { 244 + let preferred = null; 245 + let players = []; 246 + for (const [_, player] of this._players) { 247 + if (player.json.busName.includes(PREFERRED_PLAYER)) 248 + preferred = player.json; 263 249 264 - players.push(player.json); 265 - } 250 + players.push(player.json); 251 + } 266 252 267 - if (this._players.size === 1) preferred = players[0]; 253 + if (this._players.size === 1) preferred = players[0]; 268 254 269 - this._json = { 270 - preferred, 271 - players, 272 - }; 273 - this.emit("sync"); 274 - } 255 + this._json = { 256 + preferred, 257 + players, 258 + }; 259 + this.emit("sync"); 260 + } 275 261 276 - getPositions() { 277 - if (this._players.size === 0) return; 278 - let playersReady = 0; 279 - let positions = {}; 280 - for (const [busName, _] of this._players) { 281 - new MprisPlayer(busName).connect("ready", (mpris) => { 282 - positions[mpris.json.name] = { 283 - length: mpris.json.length, 284 - lengthStr: _lengthStr(mpris.json.length), 285 - position: mpris.json.position, 286 - positionStr: _lengthStr(mpris.json.position), 287 - }; 288 - playersReady++; 262 + getPositions() { 263 + if (this._players.size === 0) return; 264 + let playersReady = 0; 265 + let positions = {}; 266 + for (const [busName, _] of this._players) { 267 + new MprisPlayer(busName).connect("ready", (mpris) => { 268 + positions[mpris.json.name] = { 269 + length: mpris.json.length, 270 + lengthStr: _lengthStr(mpris.json.length), 271 + position: mpris.json.position, 272 + positionStr: _lengthStr(mpris.json.position), 273 + }; 274 + playersReady++; 289 275 290 - if (playersReady === this._players.size) { 291 - this._positions = positions; 292 - this.emit("positions"); 293 - } 276 + if (playersReady === this._players.size) { 277 + this._positions = positions; 278 + this.emit("positions"); 279 + } 294 280 295 - mpris.close(); 296 - }); 297 - } 298 - return true; 299 - } 300 - }, 281 + mpris.close(); 282 + }); 283 + } 284 + return true; 285 + } 286 + }, 301 287 );
+117 -127
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/network.js
··· 1 1 import { NM, Gio, GObject } from "./lib.js"; 2 2 3 3 function showNotification(title, message) { 4 - let notification = new Gio.Notification(); 5 - notification.set_title(title); 6 - notification.set_body(message); 7 - notification.set_priority(Gio.NotificationPriority.NORMAL); 8 - application.register(null); 9 - application.send_notification(null, notification); 10 - GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => { 11 - application.quit(); 12 - return GLib.SOURCE_REMOVE; 13 - }); 4 + let notification = new Gio.Notification(); 5 + notification.set_title(title); 6 + notification.set_body(message); 7 + notification.set_priority(Gio.NotificationPriority.NORMAL); 8 + application.register(null); 9 + application.send_notification(null, notification); 10 + GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => { 11 + application.quit(); 12 + return GLib.SOURCE_REMOVE; 13 + }); 14 14 } 15 15 16 16 Gio._promisify(NM.Client, "new_async"); 17 17 Gio._promisify(NM.DeviceWifi.prototype, "request_scan_async"); 18 18 19 19 const WifiStyles = { 20 - "󰪎": "none", 21 - "󰤮": "low", 22 - "󰤯": "low", 23 - "󰤟": "low", 24 - "󰤢": "medium", 25 - "󰤥": "medium", 26 - "󰤨": "high", 20 + "󰪎": "none", 21 + "󰤮": "low", 22 + "󰤯": "low", 23 + "󰤟": "low", 24 + "󰤢": "medium", 25 + "󰤥": "medium", 26 + "󰤨": "high", 27 27 }; 28 28 29 29 export const Network = GObject.registerClass( 30 - { 31 - Signals: { sync: {} }, 32 - }, 33 - class Network extends GObject.Object { 34 - constructor() { 35 - super(); 30 + { 31 + Signals: { sync: {} }, 32 + }, 33 + class Network extends GObject.Object { 34 + constructor() { 35 + super(); 36 36 37 - this._json = {}; 38 - this._getClient(); 39 - } 37 + this._json = {}; 38 + this._getClient(); 39 + } 40 40 41 - get json() { 42 - return this._json; 43 - } 41 + get json() { 42 + return this._json; 43 + } 44 44 45 - _getDevice(devType) { 46 - return this._client 47 - .get_devices() 48 - .find((device) => device.get_device_type() === devType); 49 - } 45 + _getDevice(devType) { 46 + return this._client 47 + .get_devices() 48 + .find((device) => device.get_device_type() === devType); 49 + } 50 50 51 - async _getClient() { 52 - this._client = await NM.Client.new_async(null); 53 - this._client.connect( 54 - "notify::wireless-enabled", 55 - this._sync.bind(this), 56 - ); 57 - this._client.connect("notify::connectivity", this._sync.bind(this)); 58 - this._client.connect( 59 - "notify::primary-connection", 60 - this._sync.bind(this), 61 - ); 62 - this._client.connect( 63 - "notify::activating-connection", 64 - this._sync.bind(this), 65 - ); 51 + async _getClient() { 52 + this._client = await NM.Client.new_async(null); 53 + this._client.connect("notify::wireless-enabled", this._sync.bind(this)); 54 + this._client.connect("notify::connectivity", this._sync.bind(this)); 55 + this._client.connect("notify::primary-connection", this._sync.bind(this)); 56 + this._client.connect( 57 + "notify::activating-connection", 58 + this._sync.bind(this), 59 + ); 66 60 67 - this._wifi = this._getDevice(NM.DeviceType.WIFI); 68 - if (this._wifi) { 69 - this._wifi.connect( 70 - "notify::active-access-point", 71 - this._activeAp.bind(this), 72 - ); 73 - //this._wifi.connect('access-point-added', (_, ap) => this._apAdded(ap)); 74 - //this._wifi.connect('access-point-removed', (_, ap) => this._apRemoved(ap)); 75 - } 61 + this._wifi = this._getDevice(NM.DeviceType.WIFI); 62 + if (this._wifi) { 63 + this._wifi.connect( 64 + "notify::active-access-point", 65 + this._activeAp.bind(this), 66 + ); 67 + //this._wifi.connect('access-point-added', (_, ap) => this._apAdded(ap)); 68 + //this._wifi.connect('access-point-removed', (_, ap) => this._apRemoved(ap)); 69 + } 76 70 77 - this._activeAp(); 78 - this._sync(); 79 - } 71 + this._activeAp(); 72 + this._sync(); 73 + } 80 74 81 - //_apAdded(ap) { 82 - // let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data()); 83 - // showNotification('Access Point Added', `The access point "${ssid}" has been added.`); 84 - // this._sync(); 85 - //} 75 + //_apAdded(ap) { 76 + // let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data()); 77 + // showNotification('Access Point Added', `The access point "${ssid}" has been added.`); 78 + // this._sync(); 79 + //} 86 80 87 - //_apRemoved(ap) { 88 - // let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data()); 89 - // showNotification('Access Point Removed', `The access point "${ssid}" has been removed.`); 90 - // this._sync(); 91 - //} 81 + //_apRemoved(ap) { 82 + // let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data()); 83 + // showNotification('Access Point Removed', `The access point "${ssid}" has been removed.`); 84 + // this._sync(); 85 + //} 92 86 93 - _activeAp() { 94 - if (this._ap) this._ap.disconnect(this._apBind); 95 - this._ap = this._wifi?.get_active_access_point(); 96 - if (!this._ap) return; 97 - this._apBind = this._ap.connect( 98 - "notify::strength", 99 - this._sync.bind(this), 100 - ); 101 - this._sync(); 102 - } 87 + _activeAp() { 88 + if (this._ap) this._ap.disconnect(this._apBind); 89 + this._ap = this._wifi?.get_active_access_point(); 90 + if (!this._ap) return; 91 + this._apBind = this._ap.connect( 92 + "notify::strength", 93 + this._sync.bind(this), 94 + ); 95 + this._sync(); 96 + } 103 97 104 - _sync() { 105 - const mainConnection = 106 - this._client.get_primary_connection() || 107 - this._client.get_activating_connection(); 98 + _sync() { 99 + const mainConnection = 100 + this._client.get_primary_connection() || 101 + this._client.get_activating_connection(); 108 102 109 - const primary_type = mainConnection?.type || null; // 802-11-wireless ; 802-3-ethernet 110 - const internet = 111 - this._client.connectivity === NM.ConnectivityState.FULL; 103 + const primary_type = mainConnection?.type || null; // 802-11-wireless ; 802-3-ethernet 104 + const internet = this._client.connectivity === NM.ConnectivityState.FULL; 112 105 113 - let wifi = { 114 - primary: primary_type === "802-11-wireless", 115 - enabled: this._client.wireless_enabled, 116 - state: this._client.wireless_enabled ? "on" : "off", 117 - ssid: 118 - (this._ap && 119 - NM.utils_ssid_to_utf8( 120 - this._ap.get_ssid().get_data(), 121 - )) || 122 - "Unknown", 123 - strength: 124 - this._client.wireless_enabled && mainConnection 125 - ? `${this._ap?.strength}%` 126 - : "󰂭", 127 - icon: ["󰤮", "󰤯", "󰤟", "󰤢", "󰤥", "󰤨"][ 128 - Math.ceil(this._ap?.strength / 20) 129 - ], 130 - }; 131 - if (!internet) { 132 - wifi.strength = "󰪎"; 133 - wifi.icon = "󰪎"; 134 - } 135 - wifi.style = WifiStyles[wifi.icon]; 106 + let wifi = { 107 + primary: primary_type === "802-11-wireless", 108 + enabled: this._client.wireless_enabled, 109 + state: this._client.wireless_enabled ? "on" : "off", 110 + ssid: 111 + (this._ap && NM.utils_ssid_to_utf8(this._ap.get_ssid().get_data())) || 112 + "Unknown", 113 + strength: 114 + this._client.wireless_enabled && mainConnection 115 + ? `${this._ap?.strength}%` 116 + : "󰂭", 117 + icon: ["󰤮", "󰤯", "󰤟", "󰤢", "󰤥", "󰤨"][ 118 + Math.ceil(this._ap?.strength / 20) 119 + ], 120 + }; 121 + if (!internet) { 122 + wifi.strength = "󰪎"; 123 + wifi.icon = "󰪎"; 124 + } 125 + wifi.style = WifiStyles[wifi.icon]; 136 126 137 - let wired = { 138 - primary: primary_type === "802-3-ethernet", 139 - icon: internet ? "󰛳" : "󰪎", 140 - }; 127 + let wired = { 128 + primary: primary_type === "802-3-ethernet", 129 + icon: internet ? "󰛳" : "󰪎", 130 + }; 141 131 142 - this._json = { 143 - primary: 144 - { "802-3-ethernet": "wired", "802-11-wireless": "wifi" }[ 145 - primary_type 146 - ] || "none", 147 - none: { icon: "󰤮" }, 148 - wifi, 149 - wired, 150 - }; 151 - this.emit("sync"); 152 - } 153 - }, 132 + this._json = { 133 + primary: 134 + { "802-3-ethernet": "wired", "802-11-wireless": "wifi" }[ 135 + primary_type 136 + ] || "none", 137 + none: { icon: "󰤮" }, 138 + wifi, 139 + wired, 140 + }; 141 + this.emit("sync"); 142 + } 143 + }, 154 144 );
+236 -246
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/notifications.js
··· 1 1 import { NotificationIFace } from "./dbus.js"; 2 2 import { 3 - NOTIFICATIONS_CACHE_PATH, 4 - NOTIFICATIONS_BANNER_TIME_OUT, 5 - MkDirectory, 6 - CACHE_PATH, 3 + NOTIFICATIONS_CACHE_PATH, 4 + NOTIFICATIONS_BANNER_TIME_OUT, 5 + MkDirectory, 6 + CACHE_PATH, 7 7 } from "./main.js"; 8 8 import { GObject, Gio, Gtk, GdkPixbuf, GLib } from "./lib.js"; 9 9 10 10 export const Notifications = GObject.registerClass( 11 - { 12 - Signals: { sync: {} }, 13 - }, 14 - class Notifications extends GObject.Object { 15 - constructor(fg_color = "white") { 16 - super(); 11 + { 12 + Signals: { sync: {} }, 13 + }, 14 + class Notifications extends GObject.Object { 15 + constructor(fg_color = "white") { 16 + super(); 17 17 18 - this._fgColor = fg_color; 19 - this._json = {}; 20 - this._dnd = false; 21 - this._idCound = 1; 22 - this._notifications = new Map(); 23 - this._popups = new Map(); 24 - this._readFromFile(); 25 - this._register(); 26 - this._sync(); 27 - } 18 + this._fgColor = fg_color; 19 + this._json = {}; 20 + this._dnd = false; 21 + this._idCound = 1; 22 + this._notifications = new Map(); 23 + this._popups = new Map(); 24 + this._readFromFile(); 25 + this._register(); 26 + this._sync(); 27 + } 28 28 29 - get json() { 30 - return this._json; 31 - } 29 + get json() { 30 + return this._json; 31 + } 32 32 33 - get DoNotDisturb() { 34 - return this._dnd; 35 - } 33 + get DoNotDisturb() { 34 + return this._dnd; 35 + } 36 36 37 - Clear() { 38 - for (const [_, notification] of this._notifications) { 39 - this.CloseNotification(notification.id); 40 - } 41 - } 37 + Clear() { 38 + for (const [_, notification] of this._notifications) { 39 + this.CloseNotification(notification.id); 40 + } 41 + } 42 42 43 - Notify( 44 - app_name, 45 - replaces_id, 46 - app_icon, 47 - summary, 48 - body, 49 - actions, 50 - hints, 51 - time_out, 52 - ) { 53 - let acts = []; 54 - for (let i = 0; i < actions.length; i += 2) { 55 - if (actions[i + 1] !== "") 56 - acts.push({ 57 - label: actions[i + 1], 58 - id: actions[i], 59 - }); 60 - } 61 - let id = replaces_id || this._idCound++; 62 - let date = new Date(); 63 - let notification = { 64 - id, 65 - app_name, 66 - app_icon, 67 - summary, 68 - body, 69 - actions: acts, 70 - time: { 71 - hour: date.getHours(), 72 - minute: 73 - date.getMinutes() > 9 74 - ? date.getMinutes() 75 - : `0${date.getMinutes()}`, 76 - }, 77 - image: 78 - this._parseImage(hints["image-data"], `${summary}${id}`) || 79 - this._parseIcon(app_icon, `${summary}${id}`) || 80 - this._parseIcon(app_name, `${summary}${id}`), 81 - }; 82 - this._notifications.set(notification.id, notification); 83 - if (!this._dnd) { 84 - this._popups.set(notification.id, notification); 85 - GLib.timeout_add( 86 - GLib.PRIORITY_DEFAULT, 87 - time_out > 0 ? time_out : NOTIFICATIONS_BANNER_TIME_OUT, 88 - () => { 89 - if (!this._popups.has(id)) return; 90 - this._popups.delete(notification.id); 91 - this._sync(); 92 - }, 93 - ); 94 - } 43 + Notify( 44 + app_name, 45 + replaces_id, 46 + app_icon, 47 + summary, 48 + body, 49 + actions, 50 + hints, 51 + time_out, 52 + ) { 53 + let acts = []; 54 + for (let i = 0; i < actions.length; i += 2) { 55 + if (actions[i + 1] !== "") 56 + acts.push({ 57 + label: actions[i + 1], 58 + id: actions[i], 59 + }); 60 + } 61 + let id = replaces_id || this._idCound++; 62 + let date = new Date(); 63 + let notification = { 64 + id, 65 + app_name, 66 + app_icon, 67 + summary, 68 + body, 69 + actions: acts, 70 + time: { 71 + hour: date.getHours(), 72 + minute: 73 + date.getMinutes() > 9 ? date.getMinutes() : `0${date.getMinutes()}`, 74 + }, 75 + image: 76 + this._parseImage(hints["image-data"], `${summary}${id}`) || 77 + this._parseIcon(app_icon, `${summary}${id}`) || 78 + this._parseIcon(app_name, `${summary}${id}`), 79 + }; 80 + this._notifications.set(notification.id, notification); 81 + if (!this._dnd) { 82 + this._popups.set(notification.id, notification); 83 + GLib.timeout_add( 84 + GLib.PRIORITY_DEFAULT, 85 + time_out > 0 ? time_out : NOTIFICATIONS_BANNER_TIME_OUT, 86 + () => { 87 + if (!this._popups.has(id)) return; 88 + this._popups.delete(notification.id); 95 89 this._sync(); 96 - return notification.id; 97 - } 90 + }, 91 + ); 92 + } 93 + this._sync(); 94 + return notification.id; 95 + } 98 96 99 - ToggleDND() { 100 - this._dnd = !this._dnd; 101 - this._sync(); 102 - } 97 + ToggleDND() { 98 + this._dnd = !this._dnd; 99 + this._sync(); 100 + } 103 101 104 - DismissNotification(id) { 105 - this._popups.delete(id); 106 - this._sync(); 107 - } 102 + DismissNotification(id) { 103 + this._popups.delete(id); 104 + this._sync(); 105 + } 108 106 109 - DismissLatestNotification() { 110 - this._popups.delete([...this._popups.keys()].pop()); 111 - this._sync(); 112 - } 107 + DismissLatestNotification() { 108 + this._popups.delete([...this._popups.keys()].pop()); 109 + this._sync(); 110 + } 113 111 114 - CloseNotification(id) { 115 - if (!this._notifications.has(id)) return; 116 - this._dbus.emit_signal( 117 - "NotificationClosed", 118 - GLib.Variant.new("(uu)", [id, 2]), 119 - ); 120 - this._notifications.delete(id); 121 - this._popups.delete(id); 122 - this._sync(); 123 - } 112 + CloseNotification(id) { 113 + if (!this._notifications.has(id)) return; 114 + this._dbus.emit_signal( 115 + "NotificationClosed", 116 + GLib.Variant.new("(uu)", [id, 2]), 117 + ); 118 + this._notifications.delete(id); 119 + this._popups.delete(id); 120 + this._sync(); 121 + } 124 122 125 - CloseLatestNotification() { 126 - const latestNotificationId = [...this._notifications.keys()].pop(); 127 - if (latestNotificationId) { 128 - this.CloseNotification(latestNotificationId); 129 - } 130 - } 123 + CloseLatestNotification() { 124 + const latestNotificationId = [...this._notifications.keys()].pop(); 125 + if (latestNotificationId) { 126 + this.CloseNotification(latestNotificationId); 127 + } 128 + } 131 129 132 - InvokeAction(id, action) { 133 - if (!this._notifications.has(id)) return; 134 - this._dbus.emit_signal( 135 - "ActionInvoked", 136 - GLib.Variant.new("(us)", [id, action]), 137 - ); 138 - this._notifications.delete(id); 139 - this._popups.delete(id); 140 - this._sync(); 141 - } 130 + InvokeAction(id, action) { 131 + if (!this._notifications.has(id)) return; 132 + this._dbus.emit_signal( 133 + "ActionInvoked", 134 + GLib.Variant.new("(us)", [id, action]), 135 + ); 136 + this._notifications.delete(id); 137 + this._popups.delete(id); 138 + this._sync(); 139 + } 142 140 143 - GetCapabilities() { 144 - return ["actions", "body", "icon-static", "persistence"]; 145 - } 141 + GetCapabilities() { 142 + return ["actions", "body", "icon-static", "persistence"]; 143 + } 146 144 147 - GetServerInformation() { 148 - return new GLib.Variant("(ssss)", ["host", "isabel", "0.1", "1.2"]); 149 - } 145 + GetServerInformation() { 146 + return new GLib.Variant("(ssss)", ["host", "isabel", "0.1", "1.2"]); 147 + } 150 148 151 - _register() { 152 - Gio.bus_own_name( 153 - Gio.BusType.SESSION, 154 - "org.freedesktop.Notifications", 155 - Gio.BusNameOwnerFlags.NONE, 156 - (connection, _) => { 157 - this._dbus = Gio.DBusExportedObject.wrapJSObject( 158 - NotificationIFace, 159 - this, 160 - ); 161 - this._dbus.export( 162 - connection, 163 - "/org/freedesktop/Notifications", 164 - ); 165 - }, 166 - null, 167 - () => { 168 - print("Another Notification Daemon is already running!"); 169 - }, 170 - ); 171 - } 149 + _register() { 150 + Gio.bus_own_name( 151 + Gio.BusType.SESSION, 152 + "org.freedesktop.Notifications", 153 + Gio.BusNameOwnerFlags.NONE, 154 + (connection, _) => { 155 + this._dbus = Gio.DBusExportedObject.wrapJSObject( 156 + NotificationIFace, 157 + this, 158 + ); 159 + this._dbus.export(connection, "/org/freedesktop/Notifications"); 160 + }, 161 + null, 162 + () => { 163 + print("Another Notification Daemon is already running!"); 164 + }, 165 + ); 166 + } 172 167 173 - _filterName(name) { 174 - return ( 175 - NOTIFICATIONS_CACHE_PATH + 176 - name.replace(/[\ \,\*\?\"\<\>\|\#\:\?\/\!\']/g, "") + 177 - ".png" 178 - ); 179 - } 168 + _filterName(name) { 169 + return ( 170 + NOTIFICATIONS_CACHE_PATH + 171 + name.replace(/[\ \,\*\?\"\<\>\|\#\:\?\/\!\']/g, "") + 172 + ".png" 173 + ); 174 + } 180 175 181 - _parseIcon(icon_name, name) { 182 - if (!icon_name) return; 176 + _parseIcon(icon_name, name) { 177 + if (!icon_name) return; 183 178 184 - MkDirectory(); 185 - let fileName = this._filterName(name); 186 - let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon( 187 - Gio.Icon.new_for_string(icon_name), 188 - 128, 189 - null, 190 - ); 179 + MkDirectory(); 180 + let fileName = this._filterName(name); 181 + let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon( 182 + Gio.Icon.new_for_string(icon_name), 183 + 128, 184 + null, 185 + ); 191 186 192 - if (!iconInfo) return null; 187 + if (!iconInfo) return null; 193 188 194 - let output_stream = Gio.File.new_for_path(fileName).replace( 195 - null, 196 - false, 197 - Gio.FileCreateFlags.NONE, 198 - null, 199 - ); 189 + let output_stream = Gio.File.new_for_path(fileName).replace( 190 + null, 191 + false, 192 + Gio.FileCreateFlags.NONE, 193 + null, 194 + ); 200 195 201 - iconInfo 202 - .load_icon() 203 - .save_to_streamv(output_stream, "png", null, null, null); 196 + iconInfo 197 + .load_icon() 198 + .save_to_streamv(output_stream, "png", null, null, null); 204 199 205 - output_stream.close(null); 200 + output_stream.close(null); 206 201 207 - if (icon_name.includes("-symbolic")) 208 - GLib.spawn_command_line_sync(`convert ${fileName} -alpha on 202 + if (icon_name.includes("-symbolic")) 203 + GLib.spawn_command_line_sync(`convert ${fileName} -alpha on 209 204 -fill ${this._fgColor} -colorize 100% -bordercolor transparent -border 16 ${fileName}`); 210 205 211 - return fileName; 212 - } 206 + return fileName; 207 + } 213 208 214 - _readFromFile() { 215 - try { 216 - const file = Gio.File.new_for_path( 217 - CACHE_PATH + "notifications.json", 218 - ); 219 - const [, contents, etag] = file.load_contents(null); 220 - const json = JSON.parse( 221 - new TextDecoder("utf-8").decode(contents), 222 - ); 223 - json.notifications.forEach((n) => { 224 - if (n.id > this._idCound) this._idCound = n.id + 1; 225 - this._notifications.set(n.id, n); 226 - }); 227 - } catch (error) { 228 - print("There were no cached notifications found!"); 229 - print( 230 - "If you want your notifications to be cached run with --file flag", 231 - ); 232 - } 233 - } 209 + _readFromFile() { 210 + try { 211 + const file = Gio.File.new_for_path(CACHE_PATH + "notifications.json"); 212 + const [, contents, etag] = file.load_contents(null); 213 + const json = JSON.parse(new TextDecoder("utf-8").decode(contents)); 214 + json.notifications.forEach((n) => { 215 + if (n.id > this._idCound) this._idCound = n.id + 1; 216 + this._notifications.set(n.id, n); 217 + }); 218 + } catch (error) { 219 + print("There were no cached notifications found!"); 220 + print( 221 + "If you want your notifications to be cached run with --file flag", 222 + ); 223 + } 224 + } 234 225 235 - _parseImage(image_data, name) { 236 - if (!image_data) return; 237 - MkDirectory(); 238 - let fileName = this._filterName(name); 239 - let image = image_data.recursiveUnpack(); 240 - let pixbuf = GdkPixbuf.Pixbuf.new_from_bytes( 241 - image[6], 242 - GdkPixbuf.Colorspace.RGB, 243 - image[3], 244 - image[4], 245 - image[0], 246 - image[1], 247 - image[2], 248 - ); 226 + _parseImage(image_data, name) { 227 + if (!image_data) return; 228 + MkDirectory(); 229 + let fileName = this._filterName(name); 230 + let image = image_data.recursiveUnpack(); 231 + let pixbuf = GdkPixbuf.Pixbuf.new_from_bytes( 232 + image[6], 233 + GdkPixbuf.Colorspace.RGB, 234 + image[3], 235 + image[4], 236 + image[0], 237 + image[1], 238 + image[2], 239 + ); 249 240 250 - let output_stream = Gio.File.new_for_path(fileName).replace( 251 - null, 252 - false, 253 - Gio.FileCreateFlags.NONE, 254 - null, 255 - ); 241 + let output_stream = Gio.File.new_for_path(fileName).replace( 242 + null, 243 + false, 244 + Gio.FileCreateFlags.NONE, 245 + null, 246 + ); 256 247 257 - pixbuf.save_to_streamv(output_stream, "png", null, null, null); 258 - output_stream.close(null); 248 + pixbuf.save_to_streamv(output_stream, "png", null, null, null); 249 + output_stream.close(null); 259 250 260 - return fileName; 261 - } 251 + return fileName; 252 + } 262 253 263 - _sync() { 264 - let notifications = [], 265 - popups = []; 266 - for (const [_, notification] of this._notifications) 267 - notifications.push(notification); 254 + _sync() { 255 + let notifications = [], 256 + popups = []; 257 + for (const [_, notification] of this._notifications) 258 + notifications.push(notification); 268 259 269 - for (const [_, notification] of this._popups) 270 - popups.push(notification); 260 + for (const [_, notification] of this._popups) popups.push(notification); 271 261 272 - this._json = { 273 - dnd: { 274 - enabled: this._dnd, 275 - state: this._dnd ? "on" : "off", 276 - icon: this._dnd ? "󰂛" : "󰂚", 277 - }, 278 - count: notifications.length, 279 - icon: this._dnd ? "󰂛" : notifications.length > 0 ? "󱅫" : "󰂚", 280 - notifications, 281 - popups, 282 - }; 283 - this.emit("sync"); 284 - } 285 - }, 262 + this._json = { 263 + dnd: { 264 + enabled: this._dnd, 265 + state: this._dnd ? "on" : "off", 266 + icon: this._dnd ? "󰂛" : "󰂚", 267 + }, 268 + count: notifications.length, 269 + icon: this._dnd ? "󰂛" : notifications.length > 0 ? "󱅫" : "󰂚", 270 + notifications, 271 + popups, 272 + }; 273 + this.emit("sync"); 274 + } 275 + }, 286 276 );
+344 -351
home/isabel/programs/configs/gui/bars/eww/config/scripts/todo
··· 3 3 4 4 const { Gio, GLib } = imports.gi; 5 5 const SUBSTITUTES_PATH = 6 - GLib.get_home_dir() + "/.local/share/todo/substitutes.json"; 6 + GLib.get_home_dir() + "/.local/share/todo/substitutes.json"; 7 7 const TASKS_PATH = GLib.get_home_dir() + "/Documents/tasks.json"; 8 8 const TERMINAL_WIDTH = 50; 9 9 10 10 function getSubstitutes() { 11 - try { 12 - let file = Gio.File.new_for_path(SUBSTITUTES_PATH); 13 - let [, contents] = file.load_contents(null); 14 - return JSON.parse(new TextDecoder().decode(contents)); 15 - } catch { 16 - return { days: [], months: [] }; 17 - } 11 + try { 12 + let file = Gio.File.new_for_path(SUBSTITUTES_PATH); 13 + let [, contents] = file.load_contents(null); 14 + return JSON.parse(new TextDecoder().decode(contents)); 15 + } catch { 16 + return { days: [], months: [] }; 17 + } 18 18 } 19 19 20 20 function getTasks() { 21 - try { 22 - let file = Gio.File.new_for_path(TASKS_PATH); 23 - let [, contents] = file.load_contents(null); 24 - let list = JSON.parse(new TextDecoder().decode(contents)); 25 - let tasks = []; 26 - list.forEach((t) => tasks.push(new Task(t))); 27 - return tasks; 28 - } catch { 29 - return []; 30 - } 21 + try { 22 + let file = Gio.File.new_for_path(TASKS_PATH); 23 + let [, contents] = file.load_contents(null); 24 + let list = JSON.parse(new TextDecoder().decode(contents)); 25 + let tasks = []; 26 + list.forEach((t) => tasks.push(new Task(t))); 27 + return tasks; 28 + } catch { 29 + return []; 30 + } 31 31 } 32 32 33 33 function writeFile(tasks) { 34 - let file = Gio.File.new_for_path(TASKS_PATH); 35 - if (!GLib.file_test(TASKS_PATH, GLib.FileTest.EXISTS)) 36 - file.create(Gio.FileCreateFlags.NONE, null); 34 + let file = Gio.File.new_for_path(TASKS_PATH); 35 + if (!GLib.file_test(TASKS_PATH, GLib.FileTest.EXISTS)) 36 + file.create(Gio.FileCreateFlags.NONE, null); 37 37 38 - file.replace_contents( 39 - JSON.stringify(tasks, null, 4), 40 - null, 41 - false, 42 - Gio.FileCreateFlags.REPLACE_DESTINATION, 43 - null, 44 - ); 38 + file.replace_contents( 39 + JSON.stringify(tasks, null, 4), 40 + null, 41 + false, 42 + Gio.FileCreateFlags.REPLACE_DESTINATION, 43 + null, 44 + ); 45 45 } 46 46 47 47 class Date { 48 - constructor(p) { 49 - this.year = p?.year; 50 - this.month = p?.month; 51 - this.day = p?.day; 52 - this.hour = p?.hour; 53 - this.minutes = p?.minutes; 54 - this.asap = p?.asap || false; 48 + constructor(p) { 49 + this.year = p?.year; 50 + this.month = p?.month; 51 + this.day = p?.day; 52 + this.hour = p?.hour; 53 + this.minutes = p?.minutes; 54 + this.asap = p?.asap || false; 55 55 56 - if (typeof p === "string") this.fromString(p); 57 - } 56 + if (typeof p === "string") this.fromString(p); 57 + } 58 58 59 - isEmpty() { 60 - return ( 61 - !this.year && 62 - !this.month && 63 - !this.day && 64 - !this.hour && 65 - !this.minutes 66 - ); 67 - } 59 + isEmpty() { 60 + return ( 61 + !this.year && !this.month && !this.day && !this.hour && !this.minutes 62 + ); 63 + } 68 64 69 - isLate() { 70 - let d = GLib.DateTime.new_now_local(); 71 - if ( 72 - this.compare( 73 - new Date({ 74 - year: d.get_year(), 75 - month: d.get_month(), 76 - day: d.get_day_of_month(), 77 - hour: d.get_hour(), 78 - minutes: d.get_minute(), 79 - }), 80 - ) < 0 81 - ) { 82 - return true; 83 - } 84 - return false; 85 - } 65 + isLate() { 66 + let d = GLib.DateTime.new_now_local(); 67 + if ( 68 + this.compare( 69 + new Date({ 70 + year: d.get_year(), 71 + month: d.get_month(), 72 + day: d.get_day_of_month(), 73 + hour: d.get_hour(), 74 + minutes: d.get_minute(), 75 + }), 76 + ) < 0 77 + ) { 78 + return true; 79 + } 80 + return false; 81 + } 86 82 87 - isToday() { 88 - let now = GLib.DateTime.new_now_local(); 89 - return ( 90 - this.month === now.get_month() && 91 - this.day === now.get_day_of_month() 92 - ); 93 - } 83 + isToday() { 84 + let now = GLib.DateTime.new_now_local(); 85 + return ( 86 + this.month === now.get_month() && this.day === now.get_day_of_month() 87 + ); 88 + } 94 89 95 - toString() { 96 - if (this.asap) return " asap! "; 90 + toString() { 91 + if (this.asap) return " asap! "; 97 92 98 - let m, d, h, min, md, hm; 99 - if (this.month) 100 - m = `${this.month < 10 ? `0${this.month}` : this.month}`; 101 - else m = "--"; 93 + let m, d, h, min, md, hm; 94 + if (this.month) m = `${this.month < 10 ? `0${this.month}` : this.month}`; 95 + else m = "--"; 102 96 103 - if (this.day) d = `${this.day < 10 ? `0${this.day}` : this.day}`; 104 - else d = "--"; 97 + if (this.day) d = `${this.day < 10 ? `0${this.day}` : this.day}`; 98 + else d = "--"; 105 99 106 - if (this.hour) h = `${this.hour < 10 ? `0${this.hour}` : this.hour}`; 107 - else h = "--"; 100 + if (this.hour) h = `${this.hour < 10 ? `0${this.hour}` : this.hour}`; 101 + else h = "--"; 108 102 109 - if (this.minutes) 110 - min = `${this.minutes < 10 ? `0${this.minutes}` : this.minutes}`; 111 - else min = "00"; 103 + if (this.minutes) 104 + min = `${this.minutes < 10 ? `0${this.minutes}` : this.minutes}`; 105 + else min = "00"; 112 106 113 - md = `${m}/${d}`; 114 - hm = `${h}:${min}`; 115 - if (!this.month && !this.day) md = " "; 116 - if (!this.hour && !this.minutes) hm = " "; 117 - if (md === " " && (this.hour || this.minutes)) md = "today"; 118 - if (this.isToday()) md = "today"; 107 + md = `${m}/${d}`; 108 + hm = `${h}:${min}`; 109 + if (!this.month && !this.day) md = " "; 110 + if (!this.hour && !this.minutes) hm = " "; 111 + if (md === " " && (this.hour || this.minutes)) md = "today"; 112 + if (this.isToday()) md = "today"; 119 113 120 - return `${md} ${hm}`; 121 - } 114 + return `${md} ${hm}`; 115 + } 122 116 123 - valid() { 124 - let now = GLib.DateTime.new_now_local(); 125 - let year = this?.year || now.get_year(); 126 - let month = this?.month || now.get_month(); 127 - let day = this?.day || now.get_day_of_month(); 128 - let hour = this?.hour || now.get_hour(); 129 - let minutes = this?.minutes || now.get_minute(); 130 - return GLib.DateTime.new_local(year, month, day, hour, minutes, 0); 131 - } 117 + valid() { 118 + let now = GLib.DateTime.new_now_local(); 119 + let year = this?.year || now.get_year(); 120 + let month = this?.month || now.get_month(); 121 + let day = this?.day || now.get_day_of_month(); 122 + let hour = this?.hour || now.get_hour(); 123 + let minutes = this?.minutes || now.get_minute(); 124 + return GLib.DateTime.new_local(year, month, day, hour, minutes, 0); 125 + } 132 126 133 - compare(d2) { 134 - if (this.asap) return -1; 135 - if (d2.asap) return 1; 136 - if (this.isEmpty() && d2.isEmpty()) return 0; 137 - if (this.isEmpty()) return 1; 138 - if (d2.isEmpty()) return -1; 127 + compare(d2) { 128 + if (this.asap) return -1; 129 + if (d2.asap) return 1; 130 + if (this.isEmpty() && d2.isEmpty()) return 0; 131 + if (this.isEmpty()) return 1; 132 + if (d2.isEmpty()) return -1; 139 133 140 - if (this.year > d2.year) return 1; 141 - else if (this.year < d2.year) return -1; 142 - else if (this.month > d2.month) return 1; 143 - else if (this.month < d2.month) return -1; 144 - else if (this.day > d2.day) return 1; 145 - else if (this.day < d2.day) return -1; 146 - else if (this.hour > d2.hour) return 1; 147 - else if (this.hour < d2.hour) return -1; 148 - else if (this.minutes > d2.minutes) return 1; 149 - else if (this.minutes < d2.minutes) return -1; 134 + if (this.year > d2.year) return 1; 135 + else if (this.year < d2.year) return -1; 136 + else if (this.month > d2.month) return 1; 137 + else if (this.month < d2.month) return -1; 138 + else if (this.day > d2.day) return 1; 139 + else if (this.day < d2.day) return -1; 140 + else if (this.hour > d2.hour) return 1; 141 + else if (this.hour < d2.hour) return -1; 142 + else if (this.minutes > d2.minutes) return 1; 143 + else if (this.minutes < d2.minutes) return -1; 150 144 151 - return 0; 152 - } 145 + return 0; 146 + } 153 147 154 - fromString(str) { 155 - let substitutes = getSubstitutes(); 156 - let days = substitutes.days; 157 - let months = substitutes.months; 148 + fromString(str) { 149 + let substitutes = getSubstitutes(); 150 + let days = substitutes.days; 151 + let months = substitutes.months; 158 152 159 - str.split(" ").forEach((e) => { 160 - if (e.toLowerCase() === "asap") this.asap = true; 161 - if (days[e]) this.day = days[e]; 162 - if (months[e]) this.month = months[e]; 163 - let md = e.split("/"); 164 - if (md.length === 2) { 165 - this.month = Number(md[0]); 166 - this.day = Number(md[1]); 167 - } 168 - let hm = e.split(":"); 169 - if (hm.length === 2) { 170 - this.hour = Number(hm[0]); 171 - this.minutes = Number(hm[1]); 172 - } 173 - let ymd = e.split("/"); 174 - if (ymd.length === 3) { 175 - this.year = Number(md[0]); 176 - this.month = Number(md[1]); 177 - this.day = Number(md[2]); 178 - } 179 - if (e.toLowerCase() === "today") { 180 - let now = GLib.DateTime.new_now_local(); 181 - this.month = now.get_month(); 182 - this.day = now.get_day_of_month(); 183 - } 184 - }); 153 + str.split(" ").forEach((e) => { 154 + if (e.toLowerCase() === "asap") this.asap = true; 155 + if (days[e]) this.day = days[e]; 156 + if (months[e]) this.month = months[e]; 157 + let md = e.split("/"); 158 + if (md.length === 2) { 159 + this.month = Number(md[0]); 160 + this.day = Number(md[1]); 161 + } 162 + let hm = e.split(":"); 163 + if (hm.length === 2) { 164 + this.hour = Number(hm[0]); 165 + this.minutes = Number(hm[1]); 166 + } 167 + let ymd = e.split("/"); 168 + if (ymd.length === 3) { 169 + this.year = Number(md[0]); 170 + this.month = Number(md[1]); 171 + this.day = Number(md[2]); 172 + } 173 + if (e.toLowerCase() === "today") { 174 + let now = GLib.DateTime.new_now_local(); 175 + this.month = now.get_month(); 176 + this.day = now.get_day_of_month(); 177 + } 178 + }); 185 179 186 - if (this.year == NaN) this.year = undefined; 187 - if (this.month == NaN) this.month = undefined; 188 - if (this.day == NaN) this.day = undefined; 189 - if (this.hour == NaN) this.hour = undefined; 190 - if (this.minutes == NaN) this.minutes = undefined; 180 + if (this.year == NaN) this.year = undefined; 181 + if (this.month == NaN) this.month = undefined; 182 + if (this.day == NaN) this.day = undefined; 183 + if (this.hour == NaN) this.hour = undefined; 184 + if (this.minutes == NaN) this.minutes = undefined; 191 185 192 - if (!this.valid()) { 193 - throw new Error("Wrong date"); 194 - } 186 + if (!this.valid()) { 187 + throw new Error("Wrong date"); 188 + } 195 189 196 - return this; 197 - } 190 + return this; 191 + } 198 192 } 199 193 200 194 class Task { 201 - constructor(p) { 202 - (this.title = p?.title), 203 - (this.desc = p?.desc), 204 - (this.date = new Date(p?.date)); 205 - } 195 + constructor(p) { 196 + (this.title = p?.title), 197 + (this.desc = p?.desc), 198 + (this.date = new Date(p?.date)); 199 + } 206 200 207 - parseDate(date) { 208 - this.date.fromString(date); 209 - } 201 + parseDate(date) { 202 + this.date.fromString(date); 203 + } 210 204 } 211 205 212 206 function add(input = {}) { 213 - if (!input.title) throw new Error("Needs a title"); 214 - let tasks = getTasks(); 215 - tasks.push(new Task(input)); 216 - tasks.sort((a, b) => a.date.compare(b.date)); 217 - writeFile(tasks); 207 + if (!input.title) throw new Error("Needs a title"); 208 + let tasks = getTasks(); 209 + tasks.push(new Task(input)); 210 + tasks.sort((a, b) => a.date.compare(b.date)); 211 + writeFile(tasks); 218 212 } 219 213 220 214 function remove(input = {}) { 221 - let tasks = getTasks(); 222 - input.remove.split(" ").forEach((i) => { 223 - if (!tasks[i - 1]) throw new Error("Index not found."); 224 - tasks[i - 1] = null; 225 - }); 226 - writeFile(tasks.filter((t) => t != null)); 215 + let tasks = getTasks(); 216 + input.remove.split(" ").forEach((i) => { 217 + if (!tasks[i - 1]) throw new Error("Index not found."); 218 + tasks[i - 1] = null; 219 + }); 220 + writeFile(tasks.filter((t) => t != null)); 227 221 } 228 222 229 223 function mod(input = {}) { 230 - let tasks = getTasks(); 224 + let tasks = getTasks(); 231 225 232 - if (isNaN(Number(input.mod)) || !tasks[Number(input.mod) - 1]) 233 - throw new Error("Index not found."); 226 + if (isNaN(Number(input.mod)) || !tasks[Number(input.mod) - 1]) 227 + throw new Error("Index not found."); 234 228 235 - let task = tasks[Number(input.mod) - 1]; 236 - if (input.title) task.title = input.title; 237 - if (input.date) task.date = new Date().fromString(input.date); 238 - if (input.desc) task.desc = input.desc; 239 - tasks.sort((a, b) => a.date.compare(b.date)); 240 - writeFile(tasks); 229 + let task = tasks[Number(input.mod) - 1]; 230 + if (input.title) task.title = input.title; 231 + if (input.date) task.date = new Date().fromString(input.date); 232 + if (input.desc) task.desc = input.desc; 233 + tasks.sort((a, b) => a.date.compare(b.date)); 234 + writeFile(tasks); 241 235 } 242 236 243 237 function printTasks(input = {}) { 244 - let width = input.terminal_width || TERMINAL_WIDTH; 245 - let sepLine = "", 246 - sepSpace = ""; 247 - for (let i = 0; i < width; i++) { 248 - sepLine += "─"; 249 - sepSpace += " "; 250 - } 251 - let tasks = getTasks(); 238 + let width = input.terminal_width || TERMINAL_WIDTH; 239 + let sepLine = "", 240 + sepSpace = ""; 241 + for (let i = 0; i < width; i++) { 242 + sepLine += "─"; 243 + sepSpace += " "; 244 + } 245 + let tasks = getTasks(); 252 246 253 - print(""); 254 - print(` ╭${sepLine.substring(3)}╮`); 255 - print(` │ Deadline Task${sepSpace.substring(27)}│`); 256 - print(` ├${sepLine.substring(3)}┤`); 257 - for (let i = 0; i < tasks.length; ++i) { 258 - let title = tasks[i].title; 259 - let date = tasks[i].date.toString(); 260 - let w = width - 24; 247 + print(""); 248 + print(` ╭${sepLine.substring(3)}╮`); 249 + print(` │ Deadline Task${sepSpace.substring(27)}│`); 250 + print(` ├${sepLine.substring(3)}┤`); 251 + for (let i = 0; i < tasks.length; ++i) { 252 + let title = tasks[i].title; 253 + let date = tasks[i].date.toString(); 254 + let w = width - 24; 261 255 262 - print( 263 - ` │ ${date} ${i + 1}.${i < 9 ? " " : ""} ${title.substring( 264 - 0, 265 - w, 266 - )}${sepSpace.substring(title.length + 24)} │`, 267 - ); 256 + print( 257 + ` │ ${date} ${i + 1}.${i < 9 ? " " : ""} ${title.substring( 258 + 0, 259 + w, 260 + )}${sepSpace.substring(title.length + 24)} │`, 261 + ); 268 262 269 - // line break if title exceeds width 270 - title = title.substring(w); 271 - for (let i = 0; i < Math.floor(title.length / w) + 1; ++i) { 272 - if (title[i * w] === " ") 273 - //dont start line with space 274 - title = title.substring(0, i * w - 1) + title.substring(i * w); 263 + // line break if title exceeds width 264 + title = title.substring(w); 265 + for (let i = 0; i < Math.floor(title.length / w) + 1; ++i) { 266 + if (title[i * w] === " ") 267 + //dont start line with space 268 + title = title.substring(0, i * w - 1) + title.substring(i * w); 275 269 276 - let line = title.substring(i * w, (i + 1) * w); 277 - let spaceBefore = sepSpace.substring(0, width - w - 6); 278 - if (line !== "") 279 - print( 280 - ` │ ${spaceBefore} ${line}${sepSpace.substring( 281 - spaceBefore.length + line.length + 6, 282 - )} │`, 283 - ); 284 - } 285 - } 286 - print(` ╰${sepLine.substring(3)}╯`); 270 + let line = title.substring(i * w, (i + 1) * w); 271 + let spaceBefore = sepSpace.substring(0, width - w - 6); 272 + if (line !== "") 273 + print( 274 + ` │ ${spaceBefore} ${line}${sepSpace.substring( 275 + spaceBefore.length + line.length + 6, 276 + )} │`, 277 + ); 278 + } 279 + } 280 + print(` ╰${sepLine.substring(3)}╯`); 287 281 } 288 282 289 283 function eww() { 290 - let out = [], 291 - id = 1; 292 - let tasks = getTasks(); 293 - tasks.forEach((t) => (t.id = id++)); 294 - tasks 295 - .filter((t) => t.date.month || t.date.day || t.date.hour || t.date.asap) 296 - .forEach((t) => 297 - out.push({ 298 - asap: t.date.asap || t.date.isLate(), 299 - date: t.date.toString(), 300 - title: t.title, 301 - id: t.id, 302 - }), 303 - ); 284 + let out = [], 285 + id = 1; 286 + let tasks = getTasks(); 287 + tasks.forEach((t) => (t.id = id++)); 288 + tasks 289 + .filter((t) => t.date.month || t.date.day || t.date.hour || t.date.asap) 290 + .forEach((t) => 291 + out.push({ 292 + asap: t.date.asap || t.date.isLate(), 293 + date: t.date.toString(), 294 + title: t.title, 295 + id: t.id, 296 + }), 297 + ); 304 298 305 - print(JSON.stringify(out, null, 3)); 299 + print(JSON.stringify(out, null, 3)); 306 300 } 307 301 308 302 function getDesc(input = {}) { 309 - let tasks = getTasks(); 310 - if (!tasks[input.get_desc - 1]) throw new Error("Index not found."); 303 + let tasks = getTasks(); 304 + if (!tasks[input.get_desc - 1]) throw new Error("Index not found."); 311 305 312 - let width = input.terminal_width || TERMINAL_WIDTH; 313 - let sepLine = "", 314 - sepSpace = ""; 315 - for (let i = 0; i < width; i++) { 316 - sepLine += "─"; 317 - sepSpace += " "; 318 - } 306 + let width = input.terminal_width || TERMINAL_WIDTH; 307 + let sepLine = "", 308 + sepSpace = ""; 309 + for (let i = 0; i < width; i++) { 310 + sepLine += "─"; 311 + sepSpace += " "; 312 + } 319 313 320 - let title = tasks[input.get_desc - 1].title; 321 - let desc = 322 - tasks[input.get_desc - 1].desc || "No description for this task."; 323 - print(""); 324 - print(` ╭${sepLine.substring(3)}╮`); 325 - print(` │ ${title}${sepSpace.substring(title.length + 4)}│`); 326 - print(` ├${sepLine.substring(3)}┤`); 314 + let title = tasks[input.get_desc - 1].title; 315 + let desc = tasks[input.get_desc - 1].desc || "No description for this task."; 316 + print(""); 317 + print(` ╭${sepLine.substring(3)}╮`); 318 + print(` │ ${title}${sepSpace.substring(title.length + 4)}│`); 319 + print(` ├${sepLine.substring(3)}┤`); 327 320 328 - let w = width - 5; 329 - for (let i = 0; i < Math.floor(desc.length / w) + 1; ++i) { 330 - if (desc[i * w] === " ") 331 - //dont start line with space 332 - desc = desc.substring(0, i * w - 1) + desc.substring(i * w); 321 + let w = width - 5; 322 + for (let i = 0; i < Math.floor(desc.length / w) + 1; ++i) { 323 + if (desc[i * w] === " ") 324 + //dont start line with space 325 + desc = desc.substring(0, i * w - 1) + desc.substring(i * w); 333 326 334 - let line = desc.substring(i * w, (i + 1) * w); 335 - print(` │ ${line}${sepSpace.substring(line.length + 4)}│`); 336 - } 337 - print(` ╰${sepLine.substring(3)}╯`); 327 + let line = desc.substring(i * w, (i + 1) * w); 328 + print(` │ ${line}${sepSpace.substring(line.length + 4)}│`); 329 + } 330 + print(` ╰${sepLine.substring(3)}╯`); 338 331 } 339 332 340 333 function main() { 341 - if (!ARGV[0]) return printTasks(); 334 + if (!ARGV[0]) return printTasks(); 342 335 343 - let input = {}; 336 + let input = {}; 344 337 345 - for (let i = 0; i < ARGV.length; ++i) { 346 - let arg = []; 347 - let cmd = ARGV[i]; 348 - for (let j = i + 1; j < ARGV.length && ARGV[j][0] !== "-"; ++j) 349 - arg.push(ARGV[j]); 338 + for (let i = 0; i < ARGV.length; ++i) { 339 + let arg = []; 340 + let cmd = ARGV[i]; 341 + for (let j = i + 1; j < ARGV.length && ARGV[j][0] !== "-"; ++j) 342 + arg.push(ARGV[j]); 350 343 351 - switch (cmd) { 352 - case "--eww": 353 - input.eww = true; 354 - break; 355 - case "-m": 356 - input.mod = arg.join(" "); 357 - break; 358 - case "--mod": 359 - input.mod = arg.join(" "); 360 - break; 361 - case "-t": 362 - input.title = arg.join(" "); 363 - break; 364 - case "--title": 365 - input.title = arg.join(" "); 366 - break; 367 - case "-a": 368 - input.title = arg.join(" "); 369 - break; 370 - case "--add": 371 - input.title = arg.join(" "); 372 - break; 373 - case "-D": 374 - input.desc = arg.join(" "); 375 - break; 376 - case "--description": 377 - input.desc = arg.join(" "); 378 - break; 379 - case "--desc": 380 - input.desc = arg.join(" "); 381 - break; 382 - case "-d": 383 - input.date = arg.join(" "); 384 - break; 385 - case "--date": 386 - input.date = arg.join(" "); 387 - break; 388 - case "--due": 389 - input.date = arg.join(" "); 390 - break; 391 - case "-r": 392 - input.remove = arg.join(" "); 393 - break; 394 - case "--remove": 395 - input.remove = arg.join(" "); 396 - break; 397 - case "--rem": 398 - input.remove = arg.join(" "); 399 - break; 400 - case "-w": 401 - input.terminal_width = arg.join(" "); 402 - break; 403 - case "--width": 404 - input.terminal_width = arg.join(" "); 405 - break; 406 - case "-w": 407 - input.terminal_width = arg.join(" "); 408 - break; 409 - case "--width": 410 - input.terminal_width = arg.join(" "); 411 - break; 412 - case "-g": 413 - input.get_desc = arg.join(" "); 414 - break; 415 - case "--get-desc": 416 - input.get_desc = arg.join(" "); 417 - break; 418 - default: 419 - input.title = cmd + " " + arg.join(" "); 420 - break; 421 - } 422 - i += arg.length; 423 - } 344 + switch (cmd) { 345 + case "--eww": 346 + input.eww = true; 347 + break; 348 + case "-m": 349 + input.mod = arg.join(" "); 350 + break; 351 + case "--mod": 352 + input.mod = arg.join(" "); 353 + break; 354 + case "-t": 355 + input.title = arg.join(" "); 356 + break; 357 + case "--title": 358 + input.title = arg.join(" "); 359 + break; 360 + case "-a": 361 + input.title = arg.join(" "); 362 + break; 363 + case "--add": 364 + input.title = arg.join(" "); 365 + break; 366 + case "-D": 367 + input.desc = arg.join(" "); 368 + break; 369 + case "--description": 370 + input.desc = arg.join(" "); 371 + break; 372 + case "--desc": 373 + input.desc = arg.join(" "); 374 + break; 375 + case "-d": 376 + input.date = arg.join(" "); 377 + break; 378 + case "--date": 379 + input.date = arg.join(" "); 380 + break; 381 + case "--due": 382 + input.date = arg.join(" "); 383 + break; 384 + case "-r": 385 + input.remove = arg.join(" "); 386 + break; 387 + case "--remove": 388 + input.remove = arg.join(" "); 389 + break; 390 + case "--rem": 391 + input.remove = arg.join(" "); 392 + break; 393 + case "-w": 394 + input.terminal_width = arg.join(" "); 395 + break; 396 + case "--width": 397 + input.terminal_width = arg.join(" "); 398 + break; 399 + case "-w": 400 + input.terminal_width = arg.join(" "); 401 + break; 402 + case "--width": 403 + input.terminal_width = arg.join(" "); 404 + break; 405 + case "-g": 406 + input.get_desc = arg.join(" "); 407 + break; 408 + case "--get-desc": 409 + input.get_desc = arg.join(" "); 410 + break; 411 + default: 412 + input.title = cmd + " " + arg.join(" "); 413 + break; 414 + } 415 + i += arg.length; 416 + } 424 417 425 - if (input.remove) remove(input); 426 - else if (input.mod) mod(input); 427 - else if (input.eww) eww(); 428 - else if (input.get_desc) getDesc(input); 429 - else if (input.title) add(input); 418 + if (input.remove) remove(input); 419 + else if (input.mod) mod(input); 420 + else if (input.eww) eww(); 421 + else if (input.get_desc) getDesc(input); 422 + else if (input.title) add(input); 430 423 431 - if (!input.eww && !input.get_desc) printTasks(input); 424 + if (!input.eww && !input.get_desc) printTasks(input); 432 425 } 433 426 434 427 main();
+122 -128
home/isabel/programs/configs/gui/bars/eww/config/scss/common.scss
··· 1 1 @mixin widget($radii: $widget_radius) { 2 - border-radius: $radii; 3 - color: $fg_color; 4 - background-color: $widget_bg; 5 - box-shadow: inset 0 0 0 $border_width $border_color; 2 + border-radius: $radii; 3 + color: $fg_color; 4 + background-color: $widget_bg; 5 + box-shadow: inset 0 0 0 $border_width $border_color; 6 6 } 7 7 8 8 @mixin button( 9 - $flat: false, 10 - $interactive: true, 11 - $radii: $radii, 12 - $focusable: false 9 + $flat: false, 10 + $interactive: true, 11 + $radii: $radii, 12 + $focusable: false 13 13 ) { 14 - border-radius: $radii; 15 - color: $fg_color; 14 + border-radius: $radii; 15 + color: $fg_color; 16 16 17 - @if $flat { 18 - background-color: transparent; 19 - background-image: none; 20 - box-shadow: none; 21 - } @else { 22 - background-color: $button_bg; 23 - box-shadow: inset 0 0 0 $border_width $border_color; 24 - } 17 + @if $flat { 18 + background-color: transparent; 19 + background-image: none; 20 + box-shadow: none; 21 + } @else { 22 + background-color: $button_bg; 23 + box-shadow: inset 0 0 0 $border_width $border_color; 24 + } 25 25 26 - @if $interactive { 27 - @if $focusable { 28 - &:focus { 29 - box-shadow: inset 0 0 0 $border_width $accent; 30 - background-color: $hover; 31 - color: $hover_fg; 32 - } 33 - } 26 + @if $interactive { 27 + @if $focusable { 28 + &:focus { 29 + box-shadow: inset 0 0 0 $border_width $accent; 30 + background-color: $hover; 31 + color: $hover_fg; 32 + } 33 + } 34 34 35 - &:hover { 36 - box-shadow: inset 0 0 0 $border_width $border_color; 37 - background-color: $hover; 38 - color: $hover_fg; 39 - } 35 + &:hover { 36 + box-shadow: inset 0 0 0 $border_width $border_color; 37 + background-color: $hover; 38 + color: $hover_fg; 39 + } 40 40 41 - &:active { 42 - box-shadow: inset 0 0 0 $border_width $border_color; 43 - background-color: $accent; 44 - color: $accent_fg; 45 - } 46 - } 41 + &:active { 42 + box-shadow: inset 0 0 0 $border_width $border_color; 43 + background-color: $accent; 44 + color: $accent_fg; 45 + } 46 + } 47 47 } 48 48 49 49 @mixin floating_widget($shadow: true, $padding: $popover_padding) { 50 - @if $shadow { 51 - box-shadow: 52 - 0 0 5px 0 rgba(0, 0, 0, 0.6), 53 - inset 0 0 0 $border_width $popover_border_color; 54 - } @else { 55 - box-shadow: inset 0 0 0 $border_width $popover_border_color; 56 - } 50 + @if $shadow { 51 + box-shadow: 52 + 0 0 5px 0 rgba(0, 0, 0, 0.6), 53 + inset 0 0 0 $border_width $popover_border_color; 54 + } @else { 55 + box-shadow: inset 0 0 0 $border_width $popover_border_color; 56 + } 57 57 58 - border-radius: $popover_radius; 59 - margin: $wm_gaps; 60 - background-color: $bg_color; 61 - color: $fg_color; 62 - padding: $padding; 58 + border-radius: $popover_radius; 59 + margin: $wm_gaps; 60 + background-color: $bg_color; 61 + color: $fg_color; 62 + padding: $padding; 63 63 } 64 64 65 65 @mixin slider( 66 - $width: 0.4em, 67 - $color: $accent, 68 - $slider: true, 69 - $focusable: false 66 + $width: 0.4em, 67 + $color: $accent, 68 + $slider: true, 69 + $focusable: false 70 70 ) { 71 - trough { 72 - border-radius: $button_radius; 73 - border: $border; 74 - background-color: $button_bg; 75 - min-height: $width; 76 - min-width: $width; 71 + trough { 72 + border-radius: $button_radius; 73 + border: $border; 74 + background-color: $button_bg; 75 + min-height: $width; 76 + min-width: $width; 77 77 78 - highlight, 79 - progress { 80 - border-radius: $popover_radius * 0.8; 81 - background-color: $color; 82 - min-height: $width; 83 - min-width: $width; 84 - } 78 + highlight, 79 + progress { 80 + border-radius: $popover_radius * 0.8; 81 + background-color: $color; 82 + min-height: $width; 83 + min-width: $width; 84 + } 85 85 86 - slider { 87 - @if $slider { 88 - background-color: $fg_color; 89 - border-radius: $button_radius; 90 - border: $border; 91 - min-height: $width; 92 - min-width: $width; 93 - } 94 - } 95 - } 86 + slider { 87 + @if $slider { 88 + background-color: $fg_color; 89 + border-radius: $button_radius; 90 + border: $border; 91 + min-height: $width; 92 + min-width: $width; 93 + } 94 + } 95 + } 96 96 97 - &:hover trough { 98 - background-color: $hover; 99 - } 97 + &:hover trough { 98 + background-color: $hover; 99 + } 100 100 101 - @if $focusable { 102 - trough:focus { 103 - background-color: $hover; 104 - box-shadow: inset 0 0 0 $border_width $accent; 101 + @if $focusable { 102 + trough:focus { 103 + background-color: $hover; 104 + box-shadow: inset 0 0 0 $border_width $accent; 105 105 106 - highlight, 107 - progress { 108 - background-color: transparentize($color, 0.3); 109 - } 110 - } 111 - } 106 + highlight, 107 + progress { 108 + background-color: transparentize($color, 0.3); 109 + } 110 + } 111 + } 112 112 } 113 113 114 114 @mixin darkened($radii: 0) { 115 - border-radius: $radii * 0.99; 115 + border-radius: $radii * 0.99; 116 116 117 - @if $theme == "dark" { 118 - box-shadow: inset 0 0 3em 1em transparentize($bg_color, 0.1); 119 - } 117 + @if $theme == "dark" { 118 + box-shadow: inset 0 0 3em 1em transparentize($bg_color, 0.1); 119 + } 120 120 121 - @if $theme == "light" { 122 - background-color: transparentize($bg_color, 0.5); 123 - } 121 + @if $theme == "light" { 122 + background-color: transparentize($bg_color, 0.5); 123 + } 124 124 } 125 125 126 126 @mixin tooltip { 127 - > * > * { 128 - background-color: $bg_color; 129 - border-radius: $button_radius; 130 - border: $border_width solid $popover_border_color; 131 - color: $fg_color; 132 - padding: 8px; 133 - margin: 4px; 134 - box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4); 135 - } 127 + > * > * { 128 + background-color: $bg_color; 129 + border-radius: $button_radius; 130 + border: $border_width solid $popover_border_color; 131 + color: $fg_color; 132 + padding: 8px; 133 + margin: 4px; 134 + box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4); 135 + } 136 136 } 137 137 138 138 @mixin scrollbar { 139 - scrollbar.vertical { 140 - slider { 141 - background: $widget_bg; 142 - border-radius: $radii; 143 - min-width: 0.6em; 144 - min-height: 2em; 145 - } 146 - } 147 - overshoot { 148 - border-radius: $radii; 149 - &.top { 150 - background: linear-gradient( 151 - transparentize($bg_color, 0.6), 152 - transparent 153 - ); 154 - } 155 - &.bottom { 156 - background: linear-gradient( 157 - transparent, 158 - transparentize($bg_color, 0.6) 159 - ); 160 - } 161 - } 139 + scrollbar.vertical { 140 + slider { 141 + background: $widget_bg; 142 + border-radius: $radii; 143 + min-width: 0.6em; 144 + min-height: 2em; 145 + } 146 + } 147 + overshoot { 148 + border-radius: $radii; 149 + &.top { 150 + background: linear-gradient(transparentize($bg_color, 0.6), transparent); 151 + } 152 + &.bottom { 153 + background: linear-gradient(transparent, transparentize($bg_color, 0.6)); 154 + } 155 + } 162 156 }
+4 -4
home/isabel/programs/configs/gui/bars/eww/config/scss/variables.scss
··· 31 31 $popover_padding: 14px; 32 32 33 33 * { 34 - all: unset; 35 - font-size: 14px; 36 - font-family: "Ubuntu Nerd Font"; 37 - transition: 200ms; 34 + all: unset; 35 + font-size: 14px; 36 + font-family: "Ubuntu Nerd Font"; 37 + transition: 200ms; 38 38 } 39 39 40 40 $mono_font: "mononoki Nerd Font";
+94 -94
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/bar_widget.scss
··· 1 1 @mixin system-indicators($orientation) { 2 - @include button($flat: false, $radii: $panel_button_radius); 3 - .reveal { 4 - @if $orientation == "v" { 5 - padding-top: 0.5em; 6 - } 7 - @if $orientation == "h" { 8 - padding-left: 0.2em; 9 - } 10 - } 11 - .slider { 12 - @include slider($width: 1em, $slider: false); 13 - @if $orientation == "v" { 14 - > * { 15 - min-height: 80px; 16 - } 17 - } 18 - @if $orientation == "h" { 19 - > * { 20 - min-width: 90px; 21 - } 22 - } 23 - } 24 - .icon { 25 - margin: 0.1em 0; 26 - &.battery { 27 - &.low { 28 - color: $destructive; 29 - } 30 - &.charging { 31 - color: $succes; 32 - } 33 - &.charged { 34 - color: $succes; 35 - } 36 - } 37 - &.notifications.active { 38 - color: $yellow; 39 - } 40 - &.network { 41 - &.none, 42 - &.low { 43 - color: $red; 44 - } 45 - &.medium { 46 - } 47 - &.high { 48 - color: $blue; 49 - } 50 - } 51 - &.bluetooth, 52 - &.bt_speaker { 53 - color: $blue; 54 - } 55 - } 2 + @include button($flat: false, $radii: $panel_button_radius); 3 + .reveal { 4 + @if $orientation == "v" { 5 + padding-top: 0.5em; 6 + } 7 + @if $orientation == "h" { 8 + padding-left: 0.2em; 9 + } 10 + } 11 + .slider { 12 + @include slider($width: 1em, $slider: false); 13 + @if $orientation == "v" { 14 + > * { 15 + min-height: 80px; 16 + } 17 + } 18 + @if $orientation == "h" { 19 + > * { 20 + min-width: 90px; 21 + } 22 + } 23 + } 24 + .icon { 25 + margin: 0.1em 0; 26 + &.battery { 27 + &.low { 28 + color: $destructive; 29 + } 30 + &.charging { 31 + color: $succes; 32 + } 33 + &.charged { 34 + color: $succes; 35 + } 36 + } 37 + &.notifications.active { 38 + color: $yellow; 39 + } 40 + &.network { 41 + &.none, 42 + &.low { 43 + color: $red; 44 + } 45 + &.medium { 46 + } 47 + &.high { 48 + color: $blue; 49 + } 50 + } 51 + &.bluetooth, 52 + &.bt_speaker { 53 + color: $blue; 54 + } 55 + } 56 56 } 57 57 58 58 @mixin panel_media() { 59 - .player { 60 - @include button($flat: true, $radii: $panel_button_radius); 61 - } 62 - .controls { 63 - @include button($radii: $panel_button_radius); 64 - button { 65 - &.prev, 66 - &.next, 67 - &.play-pause { 68 - color: transparentize($fg_color, 0.3); 69 - &:hover { 70 - color: transparentize($fg_color, 0.15); 71 - } 72 - &:active { 73 - color: $fg_color; 74 - } 75 - } 76 - } 77 - } 78 - .icon { 79 - &.spotify { 80 - color: $green; 81 - } 82 - &.firefox { 83 - color: $orange; 84 - } 85 - &.mpv { 86 - color: $magenta; 87 - } 88 - } 59 + .player { 60 + @include button($flat: true, $radii: $panel_button_radius); 61 + } 62 + .controls { 63 + @include button($radii: $panel_button_radius); 64 + button { 65 + &.prev, 66 + &.next, 67 + &.play-pause { 68 + color: transparentize($fg_color, 0.3); 69 + &:hover { 70 + color: transparentize($fg_color, 0.15); 71 + } 72 + &:active { 73 + color: $fg_color; 74 + } 75 + } 76 + } 77 + } 78 + .icon { 79 + &.spotify { 80 + color: $green; 81 + } 82 + &.firefox { 83 + color: $orange; 84 + } 85 + &.mpv { 86 + color: $magenta; 87 + } 88 + } 89 89 } 90 90 91 91 @mixin workspaces() { 92 - @include button($flat: false, $radii: $panel_button_radius); 93 - .workspace-btn { 94 - color: $fg_color; 95 - .focus { 96 - color: $accent; 97 - } 98 - &:hover { 99 - color: darken($fg_color, 0.3); 100 - } 101 - } 92 + @include button($flat: false, $radii: $panel_button_radius); 93 + .workspace-btn { 94 + color: $fg_color; 95 + .focus { 96 + color: $accent; 97 + } 98 + &:hover { 99 + color: darken($fg_color, 0.3); 100 + } 101 + } 102 102 }
+24 -24
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/calendar.scss
··· 1 1 @mixin calendar() { 2 - calendar { 3 - &.button { 4 - @include button($flat: true); 5 - margin: 1em; 6 - } 2 + calendar { 3 + &.button { 4 + @include button($flat: true); 5 + margin: 1em; 6 + } 7 7 8 - &:selected { 9 - border: 2px solid $accent; 10 - border-radius: $button_radius; 11 - } 8 + &:selected { 9 + border: 2px solid $accent; 10 + border-radius: $button_radius; 11 + } 12 12 13 - &.header { 14 - background-color: transparent; 15 - border: none; 16 - color: transparentize($fg_color, 0.5); 17 - } 13 + &.header { 14 + background-color: transparent; 15 + border: none; 16 + color: transparentize($fg_color, 0.5); 17 + } 18 18 19 - &.highlight { 20 - background-color: transparent; 21 - color: transparentize($accent, 0.5); 22 - } 19 + &.highlight { 20 + background-color: transparent; 21 + color: transparentize($accent, 0.5); 22 + } 23 23 24 - &:indeterminate { 25 - color: transparentize($fg_color, 0.9); 26 - } 24 + &:indeterminate { 25 + color: transparentize($fg_color, 0.9); 26 + } 27 27 28 - font-size: 1.2em; 29 - padding: 0.2em; 30 - } 28 + font-size: 1.2em; 29 + padding: 0.2em; 30 + } 31 31 }
+38 -38
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/events.scss
··· 1 1 @mixin events { 2 - label { 3 - font-size: 1.1em; 4 - } 2 + label { 3 + font-size: 1.1em; 4 + } 5 5 6 - .title-box { 7 - padding: $spacing; 8 - border-bottom: 1px solid transparentize($fg_color, 0.9); 6 + .title-box { 7 + padding: $spacing; 8 + border-bottom: 1px solid transparentize($fg_color, 0.9); 9 9 10 - label { 11 - font-size: 1.1em; 12 - } 13 - } 10 + label { 11 + font-size: 1.1em; 12 + } 13 + } 14 14 15 - .events-box { 16 - padding: $spacing; 17 - } 15 + .events-box { 16 + padding: $spacing; 17 + } 18 18 19 - .event { 20 - .deadline { 21 - color: transparentize($fg_color, 0.5); 22 - font-family: $mono_font; 23 - } 19 + .event { 20 + .deadline { 21 + color: transparentize($fg_color, 0.5); 22 + font-family: $mono_font; 23 + } 24 24 25 - &.done { 26 - label { 27 - text-decoration: line-through; 28 - } 25 + &.done { 26 + label { 27 + text-decoration: line-through; 28 + } 29 29 30 - .title { 31 - color: $green; 32 - } 30 + .title { 31 + color: $green; 32 + } 33 33 34 - .deadline { 35 - color: transparentize($green, 0.5); 36 - } 37 - } 34 + .deadline { 35 + color: transparentize($green, 0.5); 36 + } 37 + } 38 38 39 - &.upcoming { 40 - .title { 41 - color: $red; 42 - } 39 + &.upcoming { 40 + .title { 41 + color: $red; 42 + } 43 43 44 - .deadline { 45 - color: transparentize($red, 0.5); 46 - } 47 - } 48 - } 44 + .deadline { 45 + color: transparentize($red, 0.5); 46 + } 47 + } 48 + } 49 49 }
+145 -145
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/media.scss
··· 1 1 @mixin media($style: "widget", $height: 12em) { 2 - @if $style == "widget" { 3 - @include widget; 4 - } 5 - @if $style == "popover" { 6 - @include floating_widget; 7 - } 8 - border-radius: $radii; 9 - margin: $spacing; 10 - min-height: $height; 11 - padding: 0; 12 - text-shadow: $text_shadow; 13 - .cover { 14 - @if $style == "widget" { 15 - @include widget; 16 - } 17 - @if $style == "popover" { 18 - border-radius: $radii; 19 - } 20 - background-size: cover; 21 - background-position: center; 22 - .darkened { 23 - @if $style == "widget" { 24 - @include darkened($radii: $button_radius); 25 - } 26 - @if $style == "popover" { 27 - @include darkened($radii: $radii); 28 - } 29 - } 30 - .slider { 31 - @include slider( 32 - $width: 0.4em, 33 - $slider: false, 34 - $color: transparentize($fg_color, 0.3) 35 - ); 36 - scale > contents { 37 - trough { 38 - border-radius: 0; 39 - border: 0; 40 - highlight { 41 - border-radius: 0; 42 - } 43 - } 44 - } 45 - } 46 - .box { 47 - margin: $spacing; 48 - } 49 - .artist { 50 - font-size: 1.2em; 51 - } 52 - .title, 53 - .position { 54 - color: transparentize($fg_color, 0.2); 55 - } 56 - .icon.player { 57 - font-size: 1.4em; 58 - margin-left: 0.6em; 59 - } 60 - .controls { 61 - margin: $spacing; 62 - button { 63 - label { 64 - font-size: 2em; 65 - } 66 - &.loop, 67 - &.shuffle { 68 - label { 69 - font-size: 1.2em; 70 - } 71 - } 72 - color: transparentize($fg_color, 0.3); 73 - &:hover { 74 - color: $fg_color; 75 - } 76 - &.active { 77 - color: $accent; 78 - } 79 - &.inactive { 80 - color: transparentize($fg_color, 0.7); 81 - text-shadow: none; 82 - } 83 - &.loop { 84 - &.Playlist { 85 - color: transparentize($accent, 0.2); 86 - } 87 - &.Track { 88 - color: $accent; 89 - } 90 - } 91 - } 92 - } 93 - } 94 - .sidebar { 95 - .slider { 96 - @include slider($width: 0.6em, $slider: false); 97 - } 98 - margin: $spacing * 2; 99 - } 2 + @if $style == "widget" { 3 + @include widget; 4 + } 5 + @if $style == "popover" { 6 + @include floating_widget; 7 + } 8 + border-radius: $radii; 9 + margin: $spacing; 10 + min-height: $height; 11 + padding: 0; 12 + text-shadow: $text_shadow; 13 + .cover { 14 + @if $style == "widget" { 15 + @include widget; 16 + } 17 + @if $style == "popover" { 18 + border-radius: $radii; 19 + } 20 + background-size: cover; 21 + background-position: center; 22 + .darkened { 23 + @if $style == "widget" { 24 + @include darkened($radii: $button_radius); 25 + } 26 + @if $style == "popover" { 27 + @include darkened($radii: $radii); 28 + } 29 + } 30 + .slider { 31 + @include slider( 32 + $width: 0.4em, 33 + $slider: false, 34 + $color: transparentize($fg_color, 0.3) 35 + ); 36 + scale > contents { 37 + trough { 38 + border-radius: 0; 39 + border: 0; 40 + highlight { 41 + border-radius: 0; 42 + } 43 + } 44 + } 45 + } 46 + .box { 47 + margin: $spacing; 48 + } 49 + .artist { 50 + font-size: 1.2em; 51 + } 52 + .title, 53 + .position { 54 + color: transparentize($fg_color, 0.2); 55 + } 56 + .icon.player { 57 + font-size: 1.4em; 58 + margin-left: 0.6em; 59 + } 60 + .controls { 61 + margin: $spacing; 62 + button { 63 + label { 64 + font-size: 2em; 65 + } 66 + &.loop, 67 + &.shuffle { 68 + label { 69 + font-size: 1.2em; 70 + } 71 + } 72 + color: transparentize($fg_color, 0.3); 73 + &:hover { 74 + color: $fg_color; 75 + } 76 + &.active { 77 + color: $accent; 78 + } 79 + &.inactive { 80 + color: transparentize($fg_color, 0.7); 81 + text-shadow: none; 82 + } 83 + &.loop { 84 + &.Playlist { 85 + color: transparentize($accent, 0.2); 86 + } 87 + &.Track { 88 + color: $accent; 89 + } 90 + } 91 + } 92 + } 93 + } 94 + .sidebar { 95 + .slider { 96 + @include slider($width: 0.6em, $slider: false); 97 + } 98 + margin: $spacing * 2; 99 + } 100 100 101 - &.spotify { 102 - .icon.player { 103 - color: $green; 104 - } 105 - .sidebar .slider { 106 - @include slider($width: 0.6em, $slider: false, $color: $green); 107 - } 108 - .controls button { 109 - &.active { 110 - color: $green; 111 - } 112 - &.loop { 113 - &.Playlist { 114 - color: transparentize($green, 0.2); 115 - } 116 - &.Track { 117 - color: $green; 118 - } 119 - } 120 - } 121 - } 101 + &.spotify { 102 + .icon.player { 103 + color: $green; 104 + } 105 + .sidebar .slider { 106 + @include slider($width: 0.6em, $slider: false, $color: $green); 107 + } 108 + .controls button { 109 + &.active { 110 + color: $green; 111 + } 112 + &.loop { 113 + &.Playlist { 114 + color: transparentize($green, 0.2); 115 + } 116 + &.Track { 117 + color: $green; 118 + } 119 + } 120 + } 121 + } 122 122 123 - &.firefox { 124 - .icon.player { 125 - color: $orange; 126 - } 127 - } 123 + &.firefox { 124 + .icon.player { 125 + color: $orange; 126 + } 127 + } 128 128 129 - &.mpv { 130 - .icon.player { 131 - color: $magenta; 132 - } 133 - .sidebar .slider { 134 - @include slider($width: 0.6em, $slider: false, $color: $magenta); 135 - } 136 - .controls button { 137 - &.active { 138 - color: $magenta; 139 - } 140 - &.loop { 141 - &.Playlist { 142 - color: transparentize($magenta, 0.2); 143 - } 144 - &.Track { 145 - color: $magenta; 146 - } 147 - } 148 - } 149 - } 129 + &.mpv { 130 + .icon.player { 131 + color: $magenta; 132 + } 133 + .sidebar .slider { 134 + @include slider($width: 0.6em, $slider: false, $color: $magenta); 135 + } 136 + .controls button { 137 + &.active { 138 + color: $magenta; 139 + } 140 + &.loop { 141 + &.Playlist { 142 + color: transparentize($magenta, 0.2); 143 + } 144 + &.Track { 145 + color: $magenta; 146 + } 147 + } 148 + } 149 + } 150 150 }
+54 -54
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/notification.scss
··· 1 1 @mixin notification() { 2 - .notification-content { 3 - padding: $popover_padding; 4 - .title { 5 - font-size: 1.2em; 6 - font-weight: 600; 7 - margin-bottom: $popover_padding/2; 8 - } 9 - .image { 10 - min-width: 80px; 11 - min-height: 80px; 12 - background-size: cover; 13 - margin-right: $popover_padding; 14 - border-radius: $button_radius; 15 - } 16 - .action-button { 17 - @include button; 18 - font-size: 1.1em; 19 - font-weight: 500; 20 - padding: 0.5em; 21 - margin-top: $popover_padding; 22 - &:first-child { 23 - margin-right: $popover_padding/2; 24 - } 25 - &:last-child { 26 - margin-left: $popover_padding/2; 27 - } 28 - &:first-child:last-child { 29 - margin-left: 0; 30 - margin-right: 0; 31 - } 32 - } 33 - .close-button { 34 - min-width: 1.4em; 35 - min-height: 1.4em; 36 - } 37 - .time { 38 - color: transparentize($fg_color, 0.4); 39 - margin-right: 0.4em; 40 - } 41 - } 42 - &:hover { 43 - .notification-content { 44 - .close-button { 45 - @include button; 46 - background-color: transparentize($red, 0.5); 47 - &:hover { 48 - background-color: transparentize($red, 0.3); 49 - } 50 - &:active { 51 - background-color: transparentize($red, 0.1); 52 - } 53 - } 54 - } 55 - } 2 + .notification-content { 3 + padding: $popover_padding; 4 + .title { 5 + font-size: 1.2em; 6 + font-weight: 600; 7 + margin-bottom: $popover_padding/2; 8 + } 9 + .image { 10 + min-width: 80px; 11 + min-height: 80px; 12 + background-size: cover; 13 + margin-right: $popover_padding; 14 + border-radius: $button_radius; 15 + } 16 + .action-button { 17 + @include button; 18 + font-size: 1.1em; 19 + font-weight: 500; 20 + padding: 0.5em; 21 + margin-top: $popover_padding; 22 + &:first-child { 23 + margin-right: $popover_padding/2; 24 + } 25 + &:last-child { 26 + margin-left: $popover_padding/2; 27 + } 28 + &:first-child:last-child { 29 + margin-left: 0; 30 + margin-right: 0; 31 + } 32 + } 33 + .close-button { 34 + min-width: 1.4em; 35 + min-height: 1.4em; 36 + } 37 + .time { 38 + color: transparentize($fg_color, 0.4); 39 + margin-right: 0.4em; 40 + } 41 + } 42 + &:hover { 43 + .notification-content { 44 + .close-button { 45 + @include button; 46 + background-color: transparentize($red, 0.5); 47 + &:hover { 48 + background-color: transparentize($red, 0.3); 49 + } 50 + &:active { 51 + background-color: transparentize($red, 0.1); 52 + } 53 + } 54 + } 55 + } 56 56 }
+20 -20
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/sys_sliders.scss
··· 1 1 @mixin sys-sliders() { 2 - .slider { 3 - @include slider($width: 0.8em, $slider: false); 4 - } 5 - .percent { 6 - margin: $spacing; 7 - min-width: 2.6em; 8 - } 9 - .icon { 10 - margin: $spacing; 11 - &:first-child { 12 - font-size: 1.4em; 13 - } 14 - } 15 - button { 16 - @include button($flat: true); 17 - margin-right: $spacing; 18 - .icon { 19 - margin: 0; 20 - } 21 - } 2 + .slider { 3 + @include slider($width: 0.8em, $slider: false); 4 + } 5 + .percent { 6 + margin: $spacing; 7 + min-width: 2.6em; 8 + } 9 + .icon { 10 + margin: $spacing; 11 + &:first-child { 12 + font-size: 1.4em; 13 + } 14 + } 15 + button { 16 + @include button($flat: true); 17 + margin-right: $spacing; 18 + .icon { 19 + margin: 0; 20 + } 21 + } 22 22 }
+48 -48
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/toggle_button.scss
··· 1 1 @mixin toggle_button($toggle_radius: $radii * 2.4) { 2 - @include button($radii: $toggle_radius); 3 - &.small { 4 - @include button($radii: $toggle_radius * 1.1); 5 - } 6 - margin: $spacing; 7 - .separator { 8 - background-color: $fg_color; 9 - min-width: 2px; 10 - min-height: 1.4em; 11 - } 12 - .half { 13 - @include button($flat: true); 14 - min-height: 3.4em; 15 - &:first-child { 16 - border-radius: $toggle_radius 0 0 $toggle_radius; 17 - } 18 - &:last-child { 19 - border-radius: 0 $toggle_radius $toggle_radius 0; 20 - } 21 - &:hover { 22 - background-color: $hover; 23 - } 24 - } 25 - &.active { 26 - * { 27 - color: $accent_fg; 28 - } 29 - background-color: $accent; 30 - .separator { 31 - background-color: $accent_fg; 32 - } 33 - &:hover { 34 - background-color: transparentize($accent, 0.15); 35 - * { 36 - color: $accent_fg; 37 - } 38 - } 39 - &:focus { 40 - background-color: transparentize($accent, 0.4); 41 - box-shadow: inset 0 0 0 $border_width * 2 $accent; 42 - } 43 - } 44 - .icon { 45 - font-size: 2em; 46 - &.arrow { 47 - font-size: 1.8em; 48 - } 49 - } 2 + @include button($radii: $toggle_radius); 3 + &.small { 4 + @include button($radii: $toggle_radius * 1.1); 5 + } 6 + margin: $spacing; 7 + .separator { 8 + background-color: $fg_color; 9 + min-width: 2px; 10 + min-height: 1.4em; 11 + } 12 + .half { 13 + @include button($flat: true); 14 + min-height: 3.4em; 15 + &:first-child { 16 + border-radius: $toggle_radius 0 0 $toggle_radius; 17 + } 18 + &:last-child { 19 + border-radius: 0 $toggle_radius $toggle_radius 0; 20 + } 21 + &:hover { 22 + background-color: $hover; 23 + } 24 + } 25 + &.active { 26 + * { 27 + color: $accent_fg; 28 + } 29 + background-color: $accent; 30 + .separator { 31 + background-color: $accent_fg; 32 + } 33 + &:hover { 34 + background-color: transparentize($accent, 0.15); 35 + * { 36 + color: $accent_fg; 37 + } 38 + } 39 + &:focus { 40 + background-color: transparentize($accent, 0.4); 41 + box-shadow: inset 0 0 0 $border_width * 2 $accent; 42 + } 43 + } 44 + .icon { 45 + font-size: 2em; 46 + &.arrow { 47 + font-size: 1.8em; 48 + } 49 + } 50 50 }
+20 -20
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/user.scss
··· 1 1 @mixin user($width: 10em, $height: 10em) { 2 - padding: 0; 3 - min-height: 10em; 4 - min-width: 10em; 5 - background-image: url($avatar); 6 - background-size: cover; 2 + padding: 0; 3 + min-height: 10em; 4 + min-width: 10em; 5 + background-image: url($avatar); 6 + background-size: cover; 7 7 8 - .darkened { 9 - @include darkened($radii: $button_radius); 10 - padding: 0.3em; 8 + .darkened { 9 + @include darkened($radii: $button_radius); 10 + padding: 0.3em; 11 11 12 - label { 13 - text-shadow: $text_shadow; 12 + label { 13 + text-shadow: $text_shadow; 14 14 15 - &:first-child { 16 - color: transparentize($fg_color, 0.1); 17 - font-size: 1.3em; 18 - } 15 + &:first-child { 16 + color: transparentize($fg_color, 0.1); 17 + font-size: 1.3em; 18 + } 19 19 20 - &:last-child { 21 - color: transparentize($fg_color, 0.3); 22 - font-size: 1.1em; 23 - } 24 - } 25 - } 20 + &:last-child { 21 + color: transparentize($fg_color, 0.3); 22 + font-size: 1.1em; 23 + } 24 + } 25 + } 26 26 }
+45 -45
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/weather.scss
··· 1 1 @mixin weather { 2 - .info { 3 - .place { 4 - label { 5 - font-size: 1.2em; 6 - } 7 - .icon { 8 - font-size: 0.9em; 9 - margin-right: 0.2em; 10 - color: transparentize($accent, 0); 11 - } 12 - } 13 - .feels { 14 - color: transparentize($fg_color, 0.3); 15 - } 16 - .temp { 17 - font-size: 1.2em; 18 - } 19 - } 20 - .icon { 21 - font-size: 2.6em; 2 + .info { 3 + .place { 4 + label { 5 + font-size: 1.2em; 6 + } 7 + .icon { 8 + font-size: 0.9em; 9 + margin-right: 0.2em; 10 + color: transparentize($accent, 0); 11 + } 12 + } 13 + .feels { 14 + color: transparentize($fg_color, 0.3); 15 + } 16 + .temp { 17 + font-size: 1.2em; 18 + } 19 + } 20 + .icon { 21 + font-size: 2.6em; 22 22 23 - &.clear.d { 24 - color: transparentize($yellow, 0.6); 25 - } 26 - &.clear.n { 27 - color: transparentize($blue, 0.6); 28 - } 23 + &.clear.d { 24 + color: transparentize($yellow, 0.6); 25 + } 26 + &.clear.n { 27 + color: transparentize($blue, 0.6); 28 + } 29 29 30 - &.clouds.d { 31 - color: transparentize($fg_color, 0.6); 32 - } 33 - &.clouds.n { 34 - color: transparentize($blue, 0.6); 35 - } 30 + &.clouds.d { 31 + color: transparentize($fg_color, 0.6); 32 + } 33 + &.clouds.n { 34 + color: transparentize($blue, 0.6); 35 + } 36 36 37 - &.rain { 38 - color: transparentize($blue, 0.6); 39 - } 40 - &.thunderstorm { 41 - color: transparentize($yellow, 0.6); 42 - } 43 - &.snow { 44 - color: transparentize($fg_color, 0.6); 45 - } 46 - &.mist { 47 - color: transparentize($teal, 0.6); 48 - } 49 - } 37 + &.rain { 38 + color: transparentize($blue, 0.6); 39 + } 40 + &.thunderstorm { 41 + color: transparentize($yellow, 0.6); 42 + } 43 + &.snow { 44 + color: transparentize($fg_color, 0.6); 45 + } 46 + &.mist { 47 + color: transparentize($teal, 0.6); 48 + } 49 + } 50 50 }
+52 -52
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/app_laucher.scss
··· 1 1 .app-launcher { 2 - @include floating_widget; 3 - min-height: 530px; 4 - min-width: 530px; 5 - padding: 3em; 2 + @include floating_widget; 3 + min-height: 530px; 4 + min-width: 530px; 5 + padding: 3em; 6 6 7 - .search { 8 - min-height: 1.4em; 9 - padding: 2em; 10 - border-radius: $radii; 11 - background-image: url($wallpaper); 12 - background-size: cover; 13 - background-position: right bottom; 14 - margin-bottom: 3em; 15 - .icon, 16 - .input { 17 - @include button; 18 - background-color: transparentize($bg_color, 0.1); 19 - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.4); 20 - } 21 - .icon { 22 - min-width: 2.4em; 23 - margin-right: $spacing; 24 - } 25 - .input { 26 - padding: 0.6em 0.8em; 27 - } 28 - } 7 + .search { 8 + min-height: 1.4em; 9 + padding: 2em; 10 + border-radius: $radii; 11 + background-image: url($wallpaper); 12 + background-size: cover; 13 + background-position: right bottom; 14 + margin-bottom: 3em; 15 + .icon, 16 + .input { 17 + @include button; 18 + background-color: transparentize($bg_color, 0.1); 19 + box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.4); 20 + } 21 + .icon { 22 + min-width: 2.4em; 23 + margin-right: $spacing; 24 + } 25 + .input { 26 + padding: 0.6em 0.8em; 27 + } 28 + } 29 29 30 - .separator { 31 - min-height: 1px; 32 - background-color: transparentize($fg_color, 0.94); 33 - margin: 0.2em; 34 - } 30 + .separator { 31 + min-height: 1px; 32 + background-color: transparentize($fg_color, 0.94); 33 + margin: 0.2em; 34 + } 35 35 36 - .app { 37 - @include button($flat: true, $focusable: true); 38 - .app-content { 39 - .name { 40 - font-size: 1.1em; 41 - } 42 - .description { 43 - color: transparentize($fg_color, 0.3); 44 - } 45 - .appicon { 46 - background-size: cover; 47 - min-width: 2.4em; 48 - min-height: 2.4em; 49 - margin-right: 1em; 50 - } 51 - padding: 0.6em; 52 - } 53 - } 36 + .app { 37 + @include button($flat: true, $focusable: true); 38 + .app-content { 39 + .name { 40 + font-size: 1.1em; 41 + } 42 + .description { 43 + color: transparentize($fg_color, 0.3); 44 + } 45 + .appicon { 46 + background-size: cover; 47 + min-width: 2.4em; 48 + min-height: 2.4em; 49 + margin-right: 1em; 50 + } 51 + padding: 0.6em; 52 + } 53 + } 54 54 55 - .scroll { 56 - @include scrollbar; 57 - } 55 + .scroll { 56 + @include scrollbar; 57 + } 58 58 }
+59 -59
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/datemenu.scss
··· 1 1 .datemenu { 2 - @include floating_widget; 2 + @include floating_widget; 3 3 4 - .widget { 5 - @include widget; 6 - margin: $spacing; 7 - padding: $spacing; 8 - } 4 + .widget { 5 + @include widget; 6 + margin: $spacing; 7 + padding: $spacing; 8 + } 9 9 10 - .clock * { 11 - margin-top: $spacing; 12 - text-shadow: $text_shadow; 13 - font-size: 7em; 14 - } 10 + .clock * { 11 + margin-top: $spacing; 12 + text-shadow: $text_shadow; 13 + font-size: 7em; 14 + } 15 15 16 - .uptime { 17 - margin-bottom: $spacing * 2; 18 - font-size: 1.1em; 19 - text-shadow: $text_shadow; 20 - color: transparentize($fg_color, 0.3); 21 - } 16 + .uptime { 17 + margin-bottom: $spacing * 2; 18 + font-size: 1.1em; 19 + text-shadow: $text_shadow; 20 + color: transparentize($fg_color, 0.3); 21 + } 22 22 23 - .calendar-bin { 24 - padding: 1em 2em 0.4em 2em; 25 - @include calendar; 26 - } 23 + .calendar-bin { 24 + padding: 1em 2em 0.4em 2em; 25 + @include calendar; 26 + } 27 27 28 - .system { 29 - > * { 30 - @include widget; 31 - margin: $spacing; 32 - padding: 5px; 33 - min-width: 3.4em; 34 - min-height: 3.4em; 35 - } 36 - circular-progress { 37 - background-color: $bg_color; 38 - color: $accent; 39 - &.battery { 40 - &.low { 41 - color: $red; 42 - } 43 - } 44 - .icon { 45 - font-size: 1.3em; 46 - } 47 - } 48 - } 28 + .system { 29 + > * { 30 + @include widget; 31 + margin: $spacing; 32 + padding: 5px; 33 + min-width: 3.4em; 34 + min-height: 3.4em; 35 + } 36 + circular-progress { 37 + background-color: $bg_color; 38 + color: $accent; 39 + &.battery { 40 + &.low { 41 + color: $red; 42 + } 43 + } 44 + .icon { 45 + font-size: 1.3em; 46 + } 47 + } 48 + } 49 49 50 - .media { 51 - @include media($style: "widget"); 52 - } 50 + .media { 51 + @include media($style: "widget"); 52 + } 53 53 54 - .events.widget { 55 - padding: 0; 56 - .events { 57 - @include events; 58 - } 59 - } 54 + .events.widget { 55 + padding: 0; 56 + .events { 57 + @include events; 58 + } 59 + } 60 60 61 - .weather { 62 - @include weather; 63 - } 61 + .weather { 62 + @include weather; 63 + } 64 64 65 - .wallpaper { 66 - min-height: 13em; 67 - background-image: url($assets + "wallpaper.png"); 68 - background-size: cover; 69 - } 65 + .wallpaper { 66 + min-height: 13em; 67 + background-image: url($assets + "wallpaper.png"); 68 + background-size: cover; 69 + } 70 70 }
+38 -38
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/desktop.scss
··· 1 1 .desktop { 2 - background-image: url($wallpaper); 3 - background-size: cover; 2 + background-image: url($wallpaper); 3 + background-size: cover; 4 4 5 - .clock { 6 - color: white; 7 - text-shadow: 4px 4px 4px black; 5 + .clock { 6 + color: white; 7 + text-shadow: 4px 4px 4px black; 8 8 9 - .time { 10 - border: 3px solid $fg_color; 11 - box-shadow: inset 0 0 0 3px $bg_color; 12 - border-radius: $popover_radius; 13 - padding: 0.5em 1.3em; 9 + .time { 10 + border: 3px solid $fg_color; 11 + box-shadow: inset 0 0 0 3px $bg_color; 12 + border-radius: $popover_radius; 13 + padding: 0.5em 1.3em; 14 14 15 - .hour, 16 - .minutes, 17 - .separator { 18 - font-size: 10em; 19 - font-family: $mono_font; 20 - } 21 - } 15 + .hour, 16 + .minutes, 17 + .separator { 18 + font-size: 10em; 19 + font-family: $mono_font; 20 + } 21 + } 22 22 23 - .date { 24 - font-size: 2em; 25 - } 26 - } 23 + .date { 24 + font-size: 2em; 25 + } 26 + } 27 27 28 - .system { 29 - > * { 30 - padding: 8px; 31 - } 28 + .system { 29 + > * { 30 + padding: 8px; 31 + } 32 32 33 - circular-progress { 34 - background-color: transparentize($bg_color, 0.5); 35 - color: $fg_color; 33 + circular-progress { 34 + background-color: transparentize($bg_color, 0.5); 35 + color: $fg_color; 36 36 37 - &.battery { 38 - &.low { 39 - color: $red; 40 - } 41 - } 37 + &.battery { 38 + &.low { 39 + color: $red; 40 + } 41 + } 42 42 43 - .icon { 44 - font-size: 3em; 45 - } 46 - } 47 - } 43 + .icon { 44 + font-size: 3em; 45 + } 46 + } 47 + } 48 48 }
+70 -70
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/dock.scss
··· 1 1 $dock_icon_size: 6em; 2 2 3 3 .dock { 4 - .container { 5 - min-width: $dock_icon_size * 11.5; 6 - min-height: $dock_icon_size * 1.3; 7 - &.hovered { 8 - min-width: $dock_icon_size * 11.7; 9 - } 10 - } 4 + .container { 5 + min-width: $dock_icon_size * 11.5; 6 + min-height: $dock_icon_size * 1.3; 7 + &.hovered { 8 + min-width: $dock_icon_size * 11.7; 9 + } 10 + } 11 11 12 - .foot { 13 - @include floating_widget; 14 - margin: 0 1.5em; 15 - padding: 0; 16 - border-radius: $popover_radius $popover_radius 0 0; 17 - border-bottom: none; 18 - min-height: 1.5em; //footer height 19 - } 12 + .foot { 13 + @include floating_widget; 14 + margin: 0 1.5em; 15 + padding: 0; 16 + border-radius: $popover_radius $popover_radius 0 0; 17 + border-bottom: none; 18 + min-height: 1.5em; //footer height 19 + } 20 20 21 - .laucher { 22 - .indicator { 23 - min-height: 0.4em; //indicator height 24 - min-width: 2em; //indicator width 25 - border-radius: $button_radius; 26 - } 27 - .icon { 28 - min-width: $dock_icon_size; 29 - min-height: $dock_icon_size; 30 - background-size: contain; 31 - background-repeat: no-repeat; 32 - } 33 - &:hover { 34 - background-image: linear-gradient( 35 - transparent, 36 - transparentize($fg_color, 0.94) 37 - ); 38 - .icon { 39 - min-width: $dock_icon_size * 1.2; 40 - min-height: $dock_icon_size * 1.2; 41 - } 42 - } 43 - &:active { 44 - .indicator { 45 - background-color: $accent; 46 - } 47 - } 48 - &.firefox .icon { 49 - background-image: url($assets + "apps/firefox.png"); 50 - } 51 - &.terminal .icon { 52 - background-image: url($assets + "apps/terminal.png"); 53 - } 54 - &.file-manager .icon { 55 - background-image: url($assets + "apps/file-manager.png"); 56 - } 57 - &.editor .icon { 58 - background-image: url($assets + "apps/editor.png"); 59 - } 60 - &.spotify .icon { 61 - background-image: url($assets + "apps/spotify.png"); 62 - } 63 - &.caprine .icon { 64 - background-image: url($assets + "apps/caprine.png"); 65 - } 66 - &.bitwig .icon { 67 - background-image: url($assets + "apps/bitwig.png"); 68 - } 69 - &.battle .icon { 70 - background-image: url($assets + "apps/battle.png"); 71 - } 72 - &.bottles .icon { 73 - background-image: url($assets + "apps/bottles.png"); 74 - } 75 - } 21 + .laucher { 22 + .indicator { 23 + min-height: 0.4em; //indicator height 24 + min-width: 2em; //indicator width 25 + border-radius: $button_radius; 26 + } 27 + .icon { 28 + min-width: $dock_icon_size; 29 + min-height: $dock_icon_size; 30 + background-size: contain; 31 + background-repeat: no-repeat; 32 + } 33 + &:hover { 34 + background-image: linear-gradient( 35 + transparent, 36 + transparentize($fg_color, 0.94) 37 + ); 38 + .icon { 39 + min-width: $dock_icon_size * 1.2; 40 + min-height: $dock_icon_size * 1.2; 41 + } 42 + } 43 + &:active { 44 + .indicator { 45 + background-color: $accent; 46 + } 47 + } 48 + &.firefox .icon { 49 + background-image: url($assets + "apps/firefox.png"); 50 + } 51 + &.terminal .icon { 52 + background-image: url($assets + "apps/terminal.png"); 53 + } 54 + &.file-manager .icon { 55 + background-image: url($assets + "apps/file-manager.png"); 56 + } 57 + &.editor .icon { 58 + background-image: url($assets + "apps/editor.png"); 59 + } 60 + &.spotify .icon { 61 + background-image: url($assets + "apps/spotify.png"); 62 + } 63 + &.caprine .icon { 64 + background-image: url($assets + "apps/caprine.png"); 65 + } 66 + &.bitwig .icon { 67 + background-image: url($assets + "apps/bitwig.png"); 68 + } 69 + &.battle .icon { 70 + background-image: url($assets + "apps/battle.png"); 71 + } 72 + &.bottles .icon { 73 + background-image: url($assets + "apps/bottles.png"); 74 + } 75 + } 76 76 }
+87 -87
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/hbar.scss
··· 1 1 .hpanel { 2 - min-height: 2.2em; 3 - font-weight: bold; 4 - font-size: 1.1em; 5 - color: $fg_color; 6 - background-color: transparent; 7 - border-bottom: $border_width solid $popover_border_color; 8 - box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.8); 2 + min-height: 2.2em; 3 + font-weight: bold; 4 + font-size: 1.1em; 5 + color: $fg_color; 6 + background-color: transparent; 7 + border-bottom: $border_width solid $popover_border_color; 8 + box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.8); 9 9 10 - .button-bin { 11 - margin: 3px 2px; 12 - background-color: $bg_color; 13 - border-radius: $button_radius; 10 + .button-bin { 11 + margin: 3px 2px; 12 + background-color: $bg_color; 13 + border-radius: $button_radius; 14 14 15 - &.launcher { 16 - margin-left: 4px; 17 - } 15 + &.launcher { 16 + margin-left: 4px; 17 + } 18 18 19 - &.powermenu { 20 - margin-right: 4px; 21 - } 22 - } 19 + &.powermenu { 20 + margin-right: 4px; 21 + } 22 + } 23 23 24 - .button { 25 - .icon { 26 - font-size: 1.2em; 27 - } 24 + .button { 25 + .icon { 26 + font-size: 1.2em; 27 + } 28 28 29 - @include button($flat: true, $radii: $panel_button_radius); 29 + @include button($flat: true, $radii: $panel_button_radius); 30 30 31 - > * { 32 - padding: 0 0.7em; 33 - } 31 + > * { 32 + padding: 0 0.7em; 33 + } 34 34 35 - &.launcher { 36 - color: $accent; 37 - } 35 + &.launcher { 36 + color: $accent; 37 + } 38 38 39 - &.powermenu { 40 - color: $red; 41 - } 39 + &.powermenu { 40 + color: $red; 41 + } 42 42 43 - &.window { 44 - @include button($flat: true, $interactive: false); 45 - } 43 + &.window { 44 + @include button($flat: true, $interactive: false); 45 + } 46 46 47 - &.workspaces { 48 - @include button($flat: false, $radii: $panel_button_radius); 49 - background-color: $bg_color; 50 - border-radius: $button_radius; 47 + &.workspaces { 48 + @include button($flat: false, $radii: $panel_button_radius); 49 + background-color: $bg_color; 50 + border-radius: $button_radius; 51 51 52 - .workspace-btn { 53 - label { 54 - font-size: 1.2em; 55 - } 52 + .workspace-btn { 53 + label { 54 + font-size: 1.2em; 55 + } 56 56 57 - margin: 2px; 57 + margin: 2px; 58 58 59 - &.empty { 60 - color: transparentize($fg_color, 0.34); 61 - } 59 + &.empty { 60 + color: transparentize($fg_color, 0.34); 61 + } 62 62 63 - &.occupied { 64 - color: transparentize($fg_color, 0.18); 65 - } 63 + &.occupied { 64 + color: transparentize($fg_color, 0.18); 65 + } 66 66 67 - &.active { 68 - color: $fg_color; 69 - } 67 + &.active { 68 + color: $fg_color; 69 + } 70 70 71 - &:hover { 72 - &.empty { 73 - color: transparentize($fg_color, 0.18); 74 - } 71 + &:hover { 72 + &.empty { 73 + color: transparentize($fg_color, 0.18); 74 + } 75 75 76 - &.occupied { 77 - color: $fg_color; 78 - } 79 - } 76 + &.occupied { 77 + color: $fg_color; 78 + } 79 + } 80 80 81 - &:active { 82 - color: $accent; 83 - } 84 - } 85 - } 81 + &:active { 82 + color: $accent; 83 + } 84 + } 85 + } 86 86 87 - &.system-indicators { 88 - @include system-indicators($orientation: "h"); 87 + &.system-indicators { 88 + @include system-indicators($orientation: "h"); 89 89 90 - > * > * > * { 91 - padding: 0 0.3em; 92 - } 93 - } 90 + > * > * > * { 91 + padding: 0 0.3em; 92 + } 93 + } 94 94 95 - &.media { 96 - .icon { 97 - margin-right: 0.2em; 95 + &.media { 96 + .icon { 97 + margin-right: 0.2em; 98 98 99 - &.spotify { 100 - color: $green; 101 - } 99 + &.spotify { 100 + color: $green; 101 + } 102 102 103 - &.firefox { 104 - color: $orange; 105 - } 103 + &.firefox { 104 + color: $orange; 105 + } 106 106 107 - &.mpv { 108 - color: $magenta; 109 - } 110 - } 111 - } 112 - } 107 + &.mpv { 108 + color: $magenta; 109 + } 110 + } 111 + } 112 + } 113 113 }
+8 -8
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/media.scss
··· 1 1 .media-window { 2 - padding: 0; 3 - .media { 4 - @include media($height: 20em, $style: "popover"); 5 - padding: 0; 6 - .cover { 7 - min-width: 20em; 8 - } 9 - } 2 + padding: 0; 3 + .media { 4 + @include media($height: 20em, $style: "popover"); 5 + padding: 0; 6 + .cover { 7 + min-width: 20em; 8 + } 9 + } 10 10 }
+55 -55
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/noti_center.scss
··· 1 1 .notification-center { 2 - min-width: 400px; 3 - @include floating_widget; 2 + min-width: 400px; 3 + @include floating_widget; 4 4 5 - .title { 6 - button { 7 - font-size: 1em; 8 - padding: 0.4em 1em; 9 - @include button; 10 - } 5 + .title { 6 + button { 7 + font-size: 1em; 8 + padding: 0.4em 1em; 9 + @include button; 10 + } 11 11 12 - label { 13 - font-size: 1.4em; 14 - } 12 + label { 13 + font-size: 1.4em; 14 + } 15 15 16 - margin-bottom: $spacing; 17 - } 16 + margin-bottom: $spacing; 17 + } 18 18 19 - .notifications-list { 20 - @include scrollbar; 19 + .notifications-list { 20 + @include scrollbar; 21 21 22 - .placeholder { 23 - .icon { 24 - font-size: 8em; 25 - } 22 + .placeholder { 23 + .icon { 24 + font-size: 8em; 25 + } 26 26 27 - label { 28 - font-size: 2em; 29 - } 30 - } 27 + label { 28 + font-size: 2em; 29 + } 30 + } 31 31 32 - .notification { 33 - @include notification; 32 + .notification { 33 + @include notification; 34 34 35 - .notification-content { 36 - @include widget; 37 - margin-bottom: $spacing; 38 - border-radius: $widget_radius * 0.3; 39 - } 35 + .notification-content { 36 + @include widget; 37 + margin-bottom: $spacing; 38 + border-radius: $widget_radius * 0.3; 39 + } 40 40 41 - &:first-child .notification-content { 42 - border-radius: $widget_radius $widget_radius $widget_radius * 43 - 0.3 $widget_radius * 0.3; 44 - } 41 + &:first-child .notification-content { 42 + border-radius: $widget_radius $widget_radius $widget_radius * 0.3 43 + $widget_radius * 0.3; 44 + } 45 45 46 - &:last-child .notification-content { 47 - border-radius: $widget_radius * 0.3 $widget_radius * 0.3 48 - $widget_radius $widget_radius; 49 - } 46 + &:last-child .notification-content { 47 + border-radius: $widget_radius * 0.3 $widget_radius * 0.3 $widget_radius 48 + $widget_radius; 49 + } 50 50 51 - &:first-child:last-child .notification-content { 52 - border-radius: $widget_radius; 53 - } 54 - } 51 + &:first-child:last-child .notification-content { 52 + border-radius: $widget_radius; 53 + } 54 + } 55 55 56 - margin-bottom: $spacing; 57 - } 56 + margin-bottom: $spacing; 57 + } 58 58 59 - .controls { 60 - @include widget; 61 - padding: $popover_padding * 0.5; 59 + .controls { 60 + @include widget; 61 + padding: $popover_padding * 0.5; 62 62 63 - .sys-sliders { 64 - @include sys-sliders; 65 - } 63 + .sys-sliders { 64 + @include sys-sliders; 65 + } 66 66 67 - .toggle { 68 - min-height: 3.4em; 69 - @include toggle_button($toggle_radius: $radii * 1.4); 70 - } 71 - } 67 + .toggle { 68 + min-height: 3.4em; 69 + @include toggle_button($toggle_radius: $radii * 1.4); 70 + } 71 + } 72 72 }
+7 -7
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/notifications.scss
··· 1 1 .notifications-window-box { 2 - .notification { 3 - @include notification; 4 - .notification-content { 5 - min-width: 450px; 6 - @include floating_widget; 7 - } 8 - } 2 + .notification { 3 + @include notification; 4 + .notification-content { 5 + min-width: 450px; 6 + @include floating_widget; 7 + } 8 + } 9 9 }
+16 -16
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/osd.scss
··· 1 1 .osd-widget { 2 - @include floating_widget; 3 - padding: 0.3em; 4 - .icon { 5 - font-size: 40px; 6 - color: $accent_fg; 7 - min-width: 30px; 8 - min-height: 30px; 9 - } 10 - .scale { 11 - min-height: 14em; 12 - @include slider($width: 3em); 13 - trough { 14 - background-color: transparent; 15 - border: none; 16 - } 17 - } 2 + @include floating_widget; 3 + padding: 0.3em; 4 + .icon { 5 + font-size: 40px; 6 + color: $accent_fg; 7 + min-width: 30px; 8 + min-height: 30px; 9 + } 10 + .scale { 11 + min-height: 14em; 12 + @include slider($width: 3em); 13 + trough { 14 + background-color: transparent; 15 + border: none; 16 + } 17 + } 18 18 }
+73 -73
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/powermenu.scss
··· 1 1 .background.powermenu { 2 - background-color: rgba(0, 0, 0, 0.5); 3 - .content { 4 - @include floating_widget; 5 - .user { 6 - @include user; 7 - } 8 - .clock { 9 - text-shadow: $text_shadow; 10 - margin-bottom: 2.2em; 11 - .hour * { 12 - font-size: 9em; 13 - } 14 - .date { 15 - font-size: 2em; 16 - } 17 - } 18 - .power-menu { 19 - border-radius: $radii * 3; 20 - padding: 15px; 21 - } 22 - .button-bin { 23 - margin: 15px; 24 - margin-bottom: 0; 25 - .button { 26 - @include button($focusable: true); 27 - border-radius: $radii * 2.4; 28 - font-size: 60px; 29 - min-width: 130px; 30 - min-height: 130px; 31 - .icon { 32 - background-size: contain; 33 - margin: 24px; 34 - @if $theme == "light" { 35 - &.shutdown { 36 - background-image: url($assets + "powermenu/light-shutdown.png"); 37 - } 38 - &.reboot { 39 - background-image: url($assets + "powermenu/light-reboot.png"); 40 - } 41 - &.logout { 42 - background-image: url($assets + "powermenu/light-logout.png"); 43 - } 44 - &.suspend { 45 - background-image: url($assets + "powermenu/light-suspend.png"); 46 - } 47 - &.lock { 48 - background-image: url($assets + "powermenu/light-lock.png"); 49 - } 50 - } @else { 51 - &.shutdown { 52 - background-image: url($assets + "powermenu/shutdown.png"); 53 - } 54 - &.reboot { 55 - background-image: url($assets + "powermenu/reboot.png"); 56 - } 57 - &.logout { 58 - background-image: url($assets + "powermenu/logout.png"); 59 - } 60 - &.suspend { 61 - background-image: url($assets + "powermenu/suspend.png"); 62 - } 63 - &.lock { 64 - background-image: url($assets + "powermenu/lock.png"); 65 - } 66 - } 67 - } 68 - } 69 - .label { 70 - font-size: 20px; 71 - margin: 8px 0; 72 - } 73 - } 74 - } 2 + background-color: rgba(0, 0, 0, 0.5); 3 + .content { 4 + @include floating_widget; 5 + .user { 6 + @include user; 7 + } 8 + .clock { 9 + text-shadow: $text_shadow; 10 + margin-bottom: 2.2em; 11 + .hour * { 12 + font-size: 9em; 13 + } 14 + .date { 15 + font-size: 2em; 16 + } 17 + } 18 + .power-menu { 19 + border-radius: $radii * 3; 20 + padding: 15px; 21 + } 22 + .button-bin { 23 + margin: 15px; 24 + margin-bottom: 0; 25 + .button { 26 + @include button($focusable: true); 27 + border-radius: $radii * 2.4; 28 + font-size: 60px; 29 + min-width: 130px; 30 + min-height: 130px; 31 + .icon { 32 + background-size: contain; 33 + margin: 24px; 34 + @if $theme == "light" { 35 + &.shutdown { 36 + background-image: url($assets + "powermenu/light-shutdown.png"); 37 + } 38 + &.reboot { 39 + background-image: url($assets + "powermenu/light-reboot.png"); 40 + } 41 + &.logout { 42 + background-image: url($assets + "powermenu/light-logout.png"); 43 + } 44 + &.suspend { 45 + background-image: url($assets + "powermenu/light-suspend.png"); 46 + } 47 + &.lock { 48 + background-image: url($assets + "powermenu/light-lock.png"); 49 + } 50 + } @else { 51 + &.shutdown { 52 + background-image: url($assets + "powermenu/shutdown.png"); 53 + } 54 + &.reboot { 55 + background-image: url($assets + "powermenu/reboot.png"); 56 + } 57 + &.logout { 58 + background-image: url($assets + "powermenu/logout.png"); 59 + } 60 + &.suspend { 61 + background-image: url($assets + "powermenu/suspend.png"); 62 + } 63 + &.lock { 64 + background-image: url($assets + "powermenu/lock.png"); 65 + } 66 + } 67 + } 68 + } 69 + .label { 70 + font-size: 20px; 71 + margin: 8px 0; 72 + } 73 + } 74 + } 75 75 }
+58 -58
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/quicksettings.scss
··· 1 1 .quick-settings { 2 - @include floating_widget; 2 + @include floating_widget; 3 3 4 - .widget { 5 - @include widget; 6 - margin: $spacing; 7 - padding: $spacing; 8 - } 4 + .widget { 5 + @include widget; 6 + margin: $spacing; 7 + padding: $spacing; 8 + } 9 9 10 - .sys-sliders { 11 - @include sys-sliders; 12 - } 10 + .sys-sliders { 11 + @include sys-sliders; 12 + } 13 13 14 - .sys-actions { 15 - .user { 16 - @include user; 17 - } 18 - .sysactions { 19 - button { 20 - @include button($radii: 40%); 21 - margin: $spacing; 22 - padding: 0.4em; 23 - label { 24 - font-size: 2.4em; 25 - } 26 - &.power { 27 - color: $red; 28 - } 29 - } 30 - .uptime { 31 - font-size: 1.3em; 32 - color: transparentize($fg_color, 0.5); 33 - } 34 - } 35 - } 14 + .sys-actions { 15 + .user { 16 + @include user; 17 + } 18 + .sysactions { 19 + button { 20 + @include button($radii: 40%); 21 + margin: $spacing; 22 + padding: 0.4em; 23 + label { 24 + font-size: 2.4em; 25 + } 26 + &.power { 27 + color: $red; 28 + } 29 + } 30 + .uptime { 31 + font-size: 1.3em; 32 + color: transparentize($fg_color, 0.5); 33 + } 34 + } 35 + } 36 36 37 - .system { 38 - > * > * { 39 - @include widget; 40 - margin: $spacing; 41 - padding: 8px; 42 - min-width: 4.4em; 43 - min-height: 4.4em; 44 - } 45 - circular-progress { 46 - background-color: $bg_color; 47 - color: $accent; 48 - &.battery { 49 - &.low { 50 - color: $red; 51 - } 52 - } 53 - .icon { 54 - font-size: 1.8em; 55 - } 56 - } 57 - } 37 + .system { 38 + > * > * { 39 + @include widget; 40 + margin: $spacing; 41 + padding: 8px; 42 + min-width: 4.4em; 43 + min-height: 4.4em; 44 + } 45 + circular-progress { 46 + background-color: $bg_color; 47 + color: $accent; 48 + &.battery { 49 + &.low { 50 + color: $red; 51 + } 52 + } 53 + .icon { 54 + font-size: 1.8em; 55 + } 56 + } 57 + } 58 58 59 - .toggles .toggle { 60 - @include toggle_button($toggle_radius: $radii * 2.4); 61 - } 59 + .toggles .toggle { 60 + @include toggle_button($toggle_radius: $radii * 2.4); 61 + } 62 62 63 - .media { 64 - @include media($height: 12em); 65 - } 63 + .media { 64 + @include media($height: 12em); 65 + } 66 66 }
+76 -76
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/screenshot.scss
··· 1 1 .background.takeshot { 2 - background-color: rgba(0, 0, 0, 0.5); 2 + background-color: rgba(0, 0, 0, 0.5); 3 3 4 - .content { 5 - @include floating_widget; 4 + .content { 5 + @include floating_widget; 6 6 7 - .takeshot-menu { 8 - border-radius: $radii * 3; 9 - padding: 15px; 10 - } 7 + .takeshot-menu { 8 + border-radius: $radii * 3; 9 + padding: 15px; 10 + } 11 11 12 - .button-bin { 13 - margin: 15px; 14 - margin-bottom: 0; 15 - margin-top: 0; 12 + .button-bin { 13 + margin: 15px; 14 + margin-bottom: 0; 15 + margin-top: 0; 16 16 17 - .button { 18 - @include button($focusable: true); 19 - border-radius: $radii * 2.4; 20 - min-width: 130px; 21 - min-height: 130px; 22 - } 17 + .button { 18 + @include button($focusable: true); 19 + border-radius: $radii * 2.4; 20 + min-width: 130px; 21 + min-height: 130px; 22 + } 23 23 24 - .label { 25 - font-size: 20px; 26 - margin: 8px 0; 27 - } 28 - } 24 + .label { 25 + font-size: 20px; 26 + margin: 8px 0; 27 + } 28 + } 29 29 30 - .icon { 31 - font-size: 5rem; 32 - } 30 + .icon { 31 + font-size: 5rem; 32 + } 33 33 34 - .blue { 35 - color: $blue; 36 - } 34 + .blue { 35 + color: $blue; 36 + } 37 37 38 - .red { 39 - color: $red; 40 - } 38 + .red { 39 + color: $red; 40 + } 41 41 42 - .green { 43 - color: $green; 44 - } 45 - } 42 + .green { 43 + color: $green; 44 + } 45 + } 46 46 } 47 47 48 48 .background.previewshot { 49 - .content { 50 - @include floating_widget; 49 + .content { 50 + @include floating_widget; 51 51 52 - .previewshot-menu { 53 - border-radius: $radii * 3; 54 - padding: 15px; 55 - } 52 + .previewshot-menu { 53 + border-radius: $radii * 3; 54 + padding: 15px; 55 + } 56 56 57 - .button-bin { 58 - margin: 15px; 59 - margin-bottom: 0; 60 - margin-top: 0; 57 + .button-bin { 58 + margin: 15px; 59 + margin-bottom: 0; 60 + margin-top: 0; 61 61 62 - .button { 63 - @include button($focusable: true); 64 - border-radius: $radii; 65 - min-width: 15px; 66 - min-height: 50px; 67 - } 62 + .button { 63 + @include button($focusable: true); 64 + border-radius: $radii; 65 + min-width: 15px; 66 + min-height: 50px; 67 + } 68 68 69 - .label { 70 - font-size: 15px; 71 - margin: 8px 0; 72 - } 73 - } 69 + .label { 70 + font-size: 15px; 71 + margin: 8px 0; 72 + } 73 + } 74 74 75 - .icon { 76 - font-size: 1.5rem; 77 - } 75 + .icon { 76 + font-size: 1.5rem; 77 + } 78 78 79 - .blue { 80 - color: $blue; 81 - } 79 + .blue { 80 + color: $blue; 81 + } 82 82 83 - .red { 84 - color: $red; 85 - } 83 + .red { 84 + color: $red; 85 + } 86 86 87 - .green { 88 - color: $green; 89 - } 90 - } 87 + .green { 88 + color: $green; 89 + } 90 + } 91 91 92 - .preview { 93 - background-image: url("/tmp/screenshot.png"); 94 - background-size: contain; 95 - background-repeat: no-repeat; 96 - background-position: center; 97 - margin: 1rem; 98 - } 92 + .preview { 93 + background-image: url("/tmp/screenshot.png"); 94 + background-size: contain; 95 + background-repeat: no-repeat; 96 + background-position: center; 97 + margin: 1rem; 98 + } 99 99 }
+72 -72
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/vbar.scss
··· 1 1 .vpanel { 2 - min-width: 2.2em; 3 - font-weight: bold; 4 - color: $fg_color; 5 - background-color: $bg_color; 2 + min-width: 2.2em; 3 + font-weight: bold; 4 + color: $fg_color; 5 + background-color: $bg_color; 6 6 7 - // &.floating { 8 - margin: $wm_gaps; 9 - border-radius: $panel_radius; 10 - box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 11 - border: $border_width solid $popover_border_color; 12 - // } 7 + // &.floating { 8 + margin: $wm_gaps; 9 + border-radius: $panel_radius; 10 + box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); 11 + border: $border_width solid $popover_border_color; 12 + // } 13 13 14 - .leftBar .button-bin { 15 - margin: 0.4em 0.4em 0 0.4em; 16 - } 17 - .centerBar .button-bin { 18 - margin: 0.2em 0.4em; 19 - } 20 - .rightBar .button-bin { 21 - margin: 0 0.4em 0.4em 0.4em; 22 - } 14 + .leftBar .button-bin { 15 + margin: 0.4em 0.4em 0 0.4em; 16 + } 17 + .centerBar .button-bin { 18 + margin: 0.2em 0.4em; 19 + } 20 + .rightBar .button-bin { 21 + margin: 0 0.4em 0.4em 0.4em; 22 + } 23 23 24 - .media { 25 - @include panel_media(); 26 - .player { 27 - min-height: 2.6em; 28 - } 29 - } 24 + .media { 25 + @include panel_media(); 26 + .player { 27 + min-height: 2.6em; 28 + } 29 + } 30 30 31 - .icon { 32 - font-size: 1.3em; 33 - } 34 - .button { 35 - @include button($flat: true, $radii: $panel_button_radius); 36 - > * { 37 - padding: 0.4em; 38 - } 31 + .icon { 32 + font-size: 1.3em; 33 + } 34 + .button { 35 + @include button($flat: true, $radii: $panel_button_radius); 36 + > * { 37 + padding: 0.4em; 38 + } 39 39 40 - &.launcher { 41 - color: $blue; 42 - } 43 - &.powermenu { 44 - color: $red; 45 - } 40 + &.launcher { 41 + color: $blue; 42 + } 43 + &.powermenu { 44 + color: $red; 45 + } 46 46 47 - &.clock { 48 - @include button($flat: false, $interactive: true); 49 - label { 50 - font-size: 1.4em; 51 - } 52 - .separator { 53 - min-height: 0.2em; 54 - padding: 0 0.3em; 55 - .dot { 56 - min-height: 0.15em; 57 - min-width: 0.15em; 58 - border-radius: $radii; 59 - background-color: $fg_color; 60 - } 61 - } 62 - } 47 + &.clock { 48 + @include button($flat: false, $interactive: true); 49 + label { 50 + font-size: 1.4em; 51 + } 52 + .separator { 53 + min-height: 0.2em; 54 + padding: 0 0.3em; 55 + .dot { 56 + min-height: 0.15em; 57 + min-width: 0.15em; 58 + border-radius: $radii; 59 + background-color: $fg_color; 60 + } 61 + } 62 + } 63 63 64 - &.workspaces { 65 - @include workspaces; 66 - } 64 + &.workspaces { 65 + @include workspaces; 66 + } 67 67 68 - &.system-indicators { 69 - @include system-indicators($orientation: "v"); 70 - } 71 - } 68 + &.system-indicators { 69 + @include system-indicators($orientation: "v"); 70 + } 71 + } 72 72 73 - > * > .separator { 74 - margin: 0.3em 0; 75 - padding: 0 0.8em; 76 - .dot { 77 - min-height: 0.3em; 78 - min-width: 0.3em; 79 - border-radius: $radii; 80 - background-color: transparentize($fg_color, 0.6); 81 - } 82 - } 73 + > * > .separator { 74 + margin: 0.3em 0; 75 + padding: 0 0.8em; 76 + .dot { 77 + min-height: 0.3em; 78 + min-width: 0.3em; 79 + border-radius: $radii; 80 + background-color: transparentize($fg_color, 0.6); 81 + } 82 + } 83 83 }
+280 -280
modules/base/common/services/monitoring/grafana/dashboards/uptime-02.json
··· 1 1 { 2 - "annotations": { 3 - "list": [ 4 - { 5 - "builtIn": 1, 6 - "datasource": { 7 - "type": "grafana", 8 - "uid": "-- Grafana --" 9 - }, 10 - "enable": true, 11 - "hide": true, 12 - "iconColor": "rgba(0, 211, 255, 1)", 13 - "name": "Annotations & Alerts", 14 - "type": "dashboard" 15 - } 16 - ] 17 - }, 18 - "editable": true, 19 - "fiscalYearStartMonth": 0, 20 - "graphTooltip": 0, 21 - "id": 1, 22 - "links": [], 23 - "liveNow": false, 24 - "panels": [ 25 - { 26 - "datasource": { 27 - "type": "prometheus", 28 - "uid": "PBFA97CFB590B2093" 29 - }, 30 - "fieldConfig": { 31 - "defaults": { 32 - "color": { 33 - "mode": "palette-classic" 34 - }, 35 - "custom": { 36 - "axisBorderShow": false, 37 - "axisCenteredZero": false, 38 - "axisColorMode": "text", 39 - "axisLabel": "", 40 - "axisPlacement": "auto", 41 - "barAlignment": 0, 42 - "drawStyle": "line", 43 - "fillOpacity": 0, 44 - "gradientMode": "none", 45 - "hideFrom": { 46 - "legend": false, 47 - "tooltip": false, 48 - "viz": false 49 - }, 50 - "insertNulls": false, 51 - "lineInterpolation": "linear", 52 - "lineWidth": 4, 53 - "pointSize": 5, 54 - "scaleDistribution": { 55 - "type": "linear" 56 - }, 57 - "showPoints": "auto", 58 - "spanNulls": false, 59 - "stacking": { 60 - "group": "A", 61 - "mode": "none" 62 - }, 63 - "thresholdsStyle": { 64 - "mode": "off" 65 - } 66 - }, 67 - "mappings": [ 68 - { 69 - "options": { 70 - "from": 0.9, 71 - "result": { 72 - "color": "green", 73 - "index": 0, 74 - "text": "Active" 75 - }, 76 - "to": 1 77 - }, 78 - "type": "range" 79 - }, 80 - { 81 - "options": { 82 - "from": 0.3, 83 - "result": { 84 - "color": "yellow", 85 - "index": 1, 86 - "text": "Intermitant" 87 - }, 88 - "to": 0.9 89 - }, 90 - "type": "range" 91 - }, 92 - { 93 - "options": { 94 - "from": 0, 95 - "result": { 96 - "color": "red", 97 - "index": 2, 98 - "text": "Failing" 99 - }, 100 - "to": 0.3 101 - }, 102 - "type": "range" 103 - } 104 - ], 105 - "max": 1, 106 - "min": 0, 107 - "thresholds": { 108 - "mode": "percentage", 109 - "steps": [ 110 - { 111 - "color": "red", 112 - "value": null 113 - }, 114 - { 115 - "color": "green", 116 - "value": 80 117 - } 118 - ] 119 - } 120 - }, 121 - "overrides": [] 122 - }, 123 - "gridPos": { 124 - "h": 12, 125 - "w": 14, 126 - "x": 0, 127 - "y": 0 128 - }, 129 - "id": 1, 130 - "options": { 131 - "legend": { 132 - "calcs": [], 133 - "displayMode": "list", 134 - "placement": "bottom", 135 - "showLegend": true 136 - }, 137 - "tooltip": { 138 - "mode": "single", 139 - "sort": "none" 140 - } 141 - }, 142 - "targets": [ 143 - { 144 - "datasource": { 145 - "type": "prometheus", 146 - "uid": "PBFA97CFB590B2093" 147 - }, 148 - "disableTextWrap": false, 149 - "editorMode": "builder", 150 - "expr": "node_systemd_unit_state{name=\"docker-isabelroses-com.service\", state=\"active\"}", 151 - "fullMetaSearch": false, 152 - "includeNullMetadata": true, 153 - "instant": false, 154 - "legendFormat": "Isabelroses.com", 155 - "range": true, 156 - "refId": "Isabelroses.com", 157 - "useBackend": false 158 - }, 159 - { 160 - "datasource": { 161 - "type": "prometheus", 162 - "uid": "PBFA97CFB590B2093" 163 - }, 164 - "disableTextWrap": false, 165 - "editorMode": "builder", 166 - "expr": "node_systemd_unit_state{name=\"forgejo.service\", state=\"active\"}", 167 - "fullMetaSearch": false, 168 - "hide": false, 169 - "includeNullMetadata": true, 170 - "instant": false, 171 - "legendFormat": "forgejo", 172 - "range": true, 173 - "refId": "forgejo", 174 - "useBackend": false 175 - }, 176 - { 177 - "datasource": { 178 - "type": "prometheus", 179 - "uid": "PBFA97CFB590B2093" 180 - }, 181 - "disableTextWrap": false, 182 - "editorMode": "builder", 183 - "expr": "node_systemd_unit_state{name=\"opendkim.service\", state=\"active\"}", 184 - "fullMetaSearch": false, 185 - "hide": false, 186 - "includeNullMetadata": true, 187 - "instant": false, 188 - "legendFormat": "Mailserver", 189 - "range": true, 190 - "refId": "Mailserver", 191 - "useBackend": false 192 - }, 193 - { 194 - "datasource": { 195 - "type": "prometheus", 196 - "uid": "PBFA97CFB590B2093" 197 - }, 198 - "disableTextWrap": false, 199 - "editorMode": "builder", 200 - "expr": "node_systemd_unit_state{name=\"phpfpm-roundcube.service\", state=\"active\"}", 201 - "fullMetaSearch": false, 202 - "hide": false, 203 - "includeNullMetadata": true, 204 - "instant": false, 205 - "legendFormat": "Webmail", 206 - "range": true, 207 - "refId": "Webmail", 208 - "useBackend": false 209 - }, 210 - { 211 - "datasource": { 212 - "type": "prometheus", 213 - "uid": "PBFA97CFB590B2093" 214 - }, 215 - "disableTextWrap": false, 216 - "editorMode": "builder", 217 - "expr": "node_systemd_unit_state{name=\"matrix-synapse.service\", state=\"active\"}", 218 - "fullMetaSearch": false, 219 - "hide": false, 220 - "includeNullMetadata": true, 221 - "instant": false, 222 - "legendFormat": "Matrix", 223 - "range": true, 224 - "refId": "Matrix", 225 - "useBackend": false 226 - }, 227 - { 228 - "datasource": { 229 - "type": "prometheus", 230 - "uid": "PBFA97CFB590B2093" 231 - }, 232 - "disableTextWrap": false, 233 - "editorMode": "builder", 234 - "expr": "node_systemd_unit_state{name=\"vaultwarden.service\", state=\"active\"}", 235 - "fullMetaSearch": false, 236 - "hide": false, 237 - "includeNullMetadata": true, 238 - "instant": false, 239 - "legendFormat": "Vaultwarden", 240 - "range": true, 241 - "refId": "Vaultwarden", 242 - "useBackend": false 243 - }, 244 - { 245 - "datasource": { 246 - "type": "prometheus", 247 - "uid": "PBFA97CFB590B2093" 248 - }, 249 - "disableTextWrap": false, 250 - "editorMode": "builder", 251 - "expr": "node_systemd_unit_state{name=\"phpfpm-nextcloud.service\", state=\"active\"}", 252 - "fullMetaSearch": false, 253 - "hide": false, 254 - "includeNullMetadata": true, 255 - "instant": false, 256 - "legendFormat": "Nextcloud", 257 - "range": true, 258 - "refId": "Nextcloud", 259 - "useBackend": false 260 - } 261 - ], 262 - "title": "Uptime", 263 - "type": "timeseries" 264 - } 265 - ], 266 - "refresh": "", 267 - "schemaVersion": 38, 268 - "tags": [], 269 - "templating": { 270 - "list": [] 271 - }, 272 - "time": { 273 - "from": "now-6h", 274 - "to": "now" 275 - }, 276 - "timepicker": {}, 277 - "timezone": "", 278 - "title": "Uptime", 279 - "uid": "b71552d2-05a6-45f6-8cc2-668da897b591", 280 - "version": 3, 281 - "weekStart": "" 2 + "annotations": { 3 + "list": [ 4 + { 5 + "builtIn": 1, 6 + "datasource": { 7 + "type": "grafana", 8 + "uid": "-- Grafana --" 9 + }, 10 + "enable": true, 11 + "hide": true, 12 + "iconColor": "rgba(0, 211, 255, 1)", 13 + "name": "Annotations & Alerts", 14 + "type": "dashboard" 15 + } 16 + ] 17 + }, 18 + "editable": true, 19 + "fiscalYearStartMonth": 0, 20 + "graphTooltip": 0, 21 + "id": 1, 22 + "links": [], 23 + "liveNow": false, 24 + "panels": [ 25 + { 26 + "datasource": { 27 + "type": "prometheus", 28 + "uid": "PBFA97CFB590B2093" 29 + }, 30 + "fieldConfig": { 31 + "defaults": { 32 + "color": { 33 + "mode": "palette-classic" 34 + }, 35 + "custom": { 36 + "axisBorderShow": false, 37 + "axisCenteredZero": false, 38 + "axisColorMode": "text", 39 + "axisLabel": "", 40 + "axisPlacement": "auto", 41 + "barAlignment": 0, 42 + "drawStyle": "line", 43 + "fillOpacity": 0, 44 + "gradientMode": "none", 45 + "hideFrom": { 46 + "legend": false, 47 + "tooltip": false, 48 + "viz": false 49 + }, 50 + "insertNulls": false, 51 + "lineInterpolation": "linear", 52 + "lineWidth": 4, 53 + "pointSize": 5, 54 + "scaleDistribution": { 55 + "type": "linear" 56 + }, 57 + "showPoints": "auto", 58 + "spanNulls": false, 59 + "stacking": { 60 + "group": "A", 61 + "mode": "none" 62 + }, 63 + "thresholdsStyle": { 64 + "mode": "off" 65 + } 66 + }, 67 + "mappings": [ 68 + { 69 + "options": { 70 + "from": 0.9, 71 + "result": { 72 + "color": "green", 73 + "index": 0, 74 + "text": "Active" 75 + }, 76 + "to": 1 77 + }, 78 + "type": "range" 79 + }, 80 + { 81 + "options": { 82 + "from": 0.3, 83 + "result": { 84 + "color": "yellow", 85 + "index": 1, 86 + "text": "Intermitant" 87 + }, 88 + "to": 0.9 89 + }, 90 + "type": "range" 91 + }, 92 + { 93 + "options": { 94 + "from": 0, 95 + "result": { 96 + "color": "red", 97 + "index": 2, 98 + "text": "Failing" 99 + }, 100 + "to": 0.3 101 + }, 102 + "type": "range" 103 + } 104 + ], 105 + "max": 1, 106 + "min": 0, 107 + "thresholds": { 108 + "mode": "percentage", 109 + "steps": [ 110 + { 111 + "color": "red", 112 + "value": null 113 + }, 114 + { 115 + "color": "green", 116 + "value": 80 117 + } 118 + ] 119 + } 120 + }, 121 + "overrides": [] 122 + }, 123 + "gridPos": { 124 + "h": 12, 125 + "w": 14, 126 + "x": 0, 127 + "y": 0 128 + }, 129 + "id": 1, 130 + "options": { 131 + "legend": { 132 + "calcs": [], 133 + "displayMode": "list", 134 + "placement": "bottom", 135 + "showLegend": true 136 + }, 137 + "tooltip": { 138 + "mode": "single", 139 + "sort": "none" 140 + } 141 + }, 142 + "targets": [ 143 + { 144 + "datasource": { 145 + "type": "prometheus", 146 + "uid": "PBFA97CFB590B2093" 147 + }, 148 + "disableTextWrap": false, 149 + "editorMode": "builder", 150 + "expr": "node_systemd_unit_state{name=\"docker-isabelroses-com.service\", state=\"active\"}", 151 + "fullMetaSearch": false, 152 + "includeNullMetadata": true, 153 + "instant": false, 154 + "legendFormat": "Isabelroses.com", 155 + "range": true, 156 + "refId": "Isabelroses.com", 157 + "useBackend": false 158 + }, 159 + { 160 + "datasource": { 161 + "type": "prometheus", 162 + "uid": "PBFA97CFB590B2093" 163 + }, 164 + "disableTextWrap": false, 165 + "editorMode": "builder", 166 + "expr": "node_systemd_unit_state{name=\"forgejo.service\", state=\"active\"}", 167 + "fullMetaSearch": false, 168 + "hide": false, 169 + "includeNullMetadata": true, 170 + "instant": false, 171 + "legendFormat": "forgejo", 172 + "range": true, 173 + "refId": "forgejo", 174 + "useBackend": false 175 + }, 176 + { 177 + "datasource": { 178 + "type": "prometheus", 179 + "uid": "PBFA97CFB590B2093" 180 + }, 181 + "disableTextWrap": false, 182 + "editorMode": "builder", 183 + "expr": "node_systemd_unit_state{name=\"opendkim.service\", state=\"active\"}", 184 + "fullMetaSearch": false, 185 + "hide": false, 186 + "includeNullMetadata": true, 187 + "instant": false, 188 + "legendFormat": "Mailserver", 189 + "range": true, 190 + "refId": "Mailserver", 191 + "useBackend": false 192 + }, 193 + { 194 + "datasource": { 195 + "type": "prometheus", 196 + "uid": "PBFA97CFB590B2093" 197 + }, 198 + "disableTextWrap": false, 199 + "editorMode": "builder", 200 + "expr": "node_systemd_unit_state{name=\"phpfpm-roundcube.service\", state=\"active\"}", 201 + "fullMetaSearch": false, 202 + "hide": false, 203 + "includeNullMetadata": true, 204 + "instant": false, 205 + "legendFormat": "Webmail", 206 + "range": true, 207 + "refId": "Webmail", 208 + "useBackend": false 209 + }, 210 + { 211 + "datasource": { 212 + "type": "prometheus", 213 + "uid": "PBFA97CFB590B2093" 214 + }, 215 + "disableTextWrap": false, 216 + "editorMode": "builder", 217 + "expr": "node_systemd_unit_state{name=\"matrix-synapse.service\", state=\"active\"}", 218 + "fullMetaSearch": false, 219 + "hide": false, 220 + "includeNullMetadata": true, 221 + "instant": false, 222 + "legendFormat": "Matrix", 223 + "range": true, 224 + "refId": "Matrix", 225 + "useBackend": false 226 + }, 227 + { 228 + "datasource": { 229 + "type": "prometheus", 230 + "uid": "PBFA97CFB590B2093" 231 + }, 232 + "disableTextWrap": false, 233 + "editorMode": "builder", 234 + "expr": "node_systemd_unit_state{name=\"vaultwarden.service\", state=\"active\"}", 235 + "fullMetaSearch": false, 236 + "hide": false, 237 + "includeNullMetadata": true, 238 + "instant": false, 239 + "legendFormat": "Vaultwarden", 240 + "range": true, 241 + "refId": "Vaultwarden", 242 + "useBackend": false 243 + }, 244 + { 245 + "datasource": { 246 + "type": "prometheus", 247 + "uid": "PBFA97CFB590B2093" 248 + }, 249 + "disableTextWrap": false, 250 + "editorMode": "builder", 251 + "expr": "node_systemd_unit_state{name=\"phpfpm-nextcloud.service\", state=\"active\"}", 252 + "fullMetaSearch": false, 253 + "hide": false, 254 + "includeNullMetadata": true, 255 + "instant": false, 256 + "legendFormat": "Nextcloud", 257 + "range": true, 258 + "refId": "Nextcloud", 259 + "useBackend": false 260 + } 261 + ], 262 + "title": "Uptime", 263 + "type": "timeseries" 264 + } 265 + ], 266 + "refresh": "", 267 + "schemaVersion": 38, 268 + "tags": [], 269 + "templating": { 270 + "list": [] 271 + }, 272 + "time": { 273 + "from": "now-6h", 274 + "to": "now" 275 + }, 276 + "timepicker": {}, 277 + "timezone": "", 278 + "title": "Uptime", 279 + "uid": "b71552d2-05a6-45f6-8cc2-668da897b591", 280 + "version": 3, 281 + "weekStart": "" 282 282 }