Repository: RoccoRakete/hyprland-dots Branch: main Commit: a164395ea4a2 Files: 579 Total size: 1.1 MB Directory structure: gitextract_u_p066sk/ ├── .gitignore ├── README.md ├── backgrounds/ │ └── last/ │ └── .comments/ │ └── image_blurred.png.xml ├── cfg/ │ ├── anyrun/ │ │ ├── adwaita-dark/ │ │ │ ├── config.ron │ │ │ ├── launch.sh │ │ │ └── style-adwaita.scss │ │ └── catppuccin-mocha/ │ │ ├── config.ron │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ ├── hypr/ │ │ ├── adwaita-dark/ │ │ │ └── Decoration.conf │ │ └── catppuccin-mocha/ │ │ └── Decoration.conf │ ├── swaync/ │ │ ├── adwaita-dark/ │ │ │ ├── config.json │ │ │ ├── configSchema.json │ │ │ ├── launch.sh │ │ │ └── style-adwaita.scss │ │ └── catppuccin-mocha/ │ │ ├── config.json │ │ ├── configSchema.json │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ ├── themes/ │ │ ├── adwaita.scss │ │ └── catppuccin-mocha.scss │ ├── themeswitcher/ │ │ ├── config.jsonc │ │ └── styles.css │ ├── walker/ │ │ └── catppuccin-mocha/ │ │ ├── config.json │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ └── waybar/ │ ├── adwaita-dark/ │ │ ├── adwaita-colored-buttons.scss │ │ ├── config.jsonc │ │ ├── launch.sh │ │ └── style-adwaita.scss │ ├── catppuccin-mocha-docked/ │ │ ├── config.jsonc │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ ├── catppuccin-mocha-docked-color-buttons/ │ │ ├── catppuccin-mocha-colored-buttons.scss │ │ ├── config.jsonc │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ ├── catppuccin-mocha-docked-flat-buttons/ │ │ ├── catppuccin-mocha-flat-buttons.scss │ │ ├── config.jsonc │ │ ├── launch.sh │ │ └── style-catppuccin-mocha.scss │ └── scripts/ │ └── get_weather.sh ├── installers/ │ ├── install │ ├── thinkfan │ └── zsh ├── nixos/ │ ├── configs/ │ │ ├── home-configs/ │ │ │ ├── kitty.nix │ │ │ ├── styling.nix │ │ │ ├── waybar.nix │ │ │ └── zsh.nix │ │ └── nixos-configs/ │ │ ├── bluetooth.nix │ │ ├── nixvim/ │ │ │ ├── autopairs.nix │ │ │ ├── bufferline.nix │ │ │ ├── conform.nix │ │ │ ├── dashboard.nix │ │ │ ├── efmls.nix │ │ │ ├── keymaps.nix │ │ │ ├── lsp-format.nix │ │ │ ├── lsp-servers.nix │ │ │ ├── lsp.nix │ │ │ ├── neo-tree.nix │ │ │ ├── nvim-cmp.nix │ │ │ ├── nvim.nix │ │ │ ├── prettier.nix │ │ │ ├── telescope.nix │ │ │ ├── treesitter.nix │ │ │ └── whichkey.nix │ │ ├── programs.nix │ │ ├── services.nix │ │ └── tlp.nix │ ├── flake.nix │ ├── global-dotfiles/ │ │ ├── gtklock/ │ │ │ ├── config.ini │ │ │ └── style.css │ │ └── swaylock/ │ │ └── config │ ├── hosts/ │ │ ├── desktop/ │ │ │ ├── configuration-desktop.nix │ │ │ ├── hardware-configuration-desktop.nix │ │ │ ├── home-desktop.nix │ │ │ ├── home-dotfiles-desktop/ │ │ │ │ ├── ags/ │ │ │ │ │ ├── .eslintrc.yml │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── .stylelintrc.yml │ │ │ │ │ ├── config.js │ │ │ │ │ ├── js/ │ │ │ │ │ │ ├── about/ │ │ │ │ │ │ │ └── about.js │ │ │ │ │ │ ├── applauncher/ │ │ │ │ │ │ │ ├── AppItem.js │ │ │ │ │ │ │ └── Applauncher.js │ │ │ │ │ │ ├── bar/ │ │ │ │ │ │ │ ├── PanelButton.js │ │ │ │ │ │ │ ├── TopBar.js │ │ │ │ │ │ │ └── buttons/ │ │ │ │ │ │ │ ├── BatteryBar.js │ │ │ │ │ │ │ ├── ColorPicker.js │ │ │ │ │ │ │ ├── DateButton.js │ │ │ │ │ │ │ ├── FocusedClient.js │ │ │ │ │ │ │ ├── MediaIndicator.js │ │ │ │ │ │ │ ├── NotificationIndicator.js │ │ │ │ │ │ │ ├── OverviewButton.js │ │ │ │ │ │ │ ├── PowerMenu.js │ │ │ │ │ │ │ ├── ScreenRecord.js │ │ │ │ │ │ │ ├── SubMenu.js │ │ │ │ │ │ │ ├── SysTray.js │ │ │ │ │ │ │ ├── System.js │ │ │ │ │ │ │ ├── SystemIndicators.js │ │ │ │ │ │ │ ├── Taskbar.js │ │ │ │ │ │ │ └── Workspaces.js │ │ │ │ │ │ ├── dashboard/ │ │ │ │ │ │ │ ├── Dashboard.js │ │ │ │ │ │ │ ├── DateColumn.js │ │ │ │ │ │ │ └── NotificationColumn.js │ │ │ │ │ │ ├── desktop/ │ │ │ │ │ │ │ ├── Desktop.js │ │ │ │ │ │ │ └── DesktopMenu.js │ │ │ │ │ │ ├── dock/ │ │ │ │ │ │ │ ├── Dock.js │ │ │ │ │ │ │ └── FloatingDock.js │ │ │ │ │ │ ├── icons.js │ │ │ │ │ │ ├── lockscreen/ │ │ │ │ │ │ │ ├── Lockscreen.js │ │ │ │ │ │ │ └── auth.py │ │ │ │ │ │ ├── main.js │ │ │ │ │ │ ├── misc/ │ │ │ │ │ │ │ ├── Avatar.js │ │ │ │ │ │ │ ├── BatteryIcon.js │ │ │ │ │ │ │ ├── Clock.js │ │ │ │ │ │ │ ├── FontIcon.js │ │ │ │ │ │ │ ├── HoverRevealer.js │ │ │ │ │ │ │ ├── IconBrowser.js │ │ │ │ │ │ │ ├── Notification.js │ │ │ │ │ │ │ ├── PopupWindow.js │ │ │ │ │ │ │ ├── Progress.js │ │ │ │ │ │ │ ├── RegularWindow.js │ │ │ │ │ │ │ └── mpris.js │ │ │ │ │ │ ├── notifications/ │ │ │ │ │ │ │ └── Notifications.js │ │ │ │ │ │ ├── options.js │ │ │ │ │ │ ├── osd/ │ │ │ │ │ │ │ └── OSD.js │ │ │ │ │ │ ├── overview/ │ │ │ │ │ │ │ ├── Client.js │ │ │ │ │ │ │ ├── Overview.js │ │ │ │ │ │ │ └── Workspace.js │ │ │ │ │ │ ├── powermenu/ │ │ │ │ │ │ │ ├── PowerMenu.js │ │ │ │ │ │ │ ├── ShadedPopup.js │ │ │ │ │ │ │ └── Verification.js │ │ │ │ │ │ ├── quicksettings/ │ │ │ │ │ │ │ ├── QuickSettings.js │ │ │ │ │ │ │ ├── ToggleButton.js │ │ │ │ │ │ │ └── widgets/ │ │ │ │ │ │ │ ├── AsusProfile.js │ │ │ │ │ │ │ ├── Bluetooth.js │ │ │ │ │ │ │ ├── Brightness.js │ │ │ │ │ │ │ ├── DND.js │ │ │ │ │ │ │ ├── Header.js │ │ │ │ │ │ │ ├── Media.js │ │ │ │ │ │ │ ├── MicMute.js │ │ │ │ │ │ │ ├── Network.js │ │ │ │ │ │ │ ├── Theme.js │ │ │ │ │ │ │ └── Volume.js │ │ │ │ │ │ ├── screencorner/ │ │ │ │ │ │ │ └── ScreenCorners.js │ │ │ │ │ │ ├── services/ │ │ │ │ │ │ │ ├── asusctl.js │ │ │ │ │ │ │ ├── brightness.js │ │ │ │ │ │ │ ├── colorpicker.js │ │ │ │ │ │ │ ├── lockscreen.js │ │ │ │ │ │ │ ├── onScreenIndicator.js │ │ │ │ │ │ │ ├── powermenu.js │ │ │ │ │ │ │ └── screenrecord.js │ │ │ │ │ │ ├── settings/ │ │ │ │ │ │ │ ├── SettingsDialog.js │ │ │ │ │ │ │ ├── globals.js │ │ │ │ │ │ │ ├── hyprland.js │ │ │ │ │ │ │ ├── option.js │ │ │ │ │ │ │ ├── scss.js │ │ │ │ │ │ │ ├── setup.js │ │ │ │ │ │ │ ├── theme.js │ │ │ │ │ │ │ └── wallpaper.js │ │ │ │ │ │ ├── themes.js │ │ │ │ │ │ ├── utils.js │ │ │ │ │ │ └── variables.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── prepare_background.sh │ │ │ │ │ ├── scss/ │ │ │ │ │ │ ├── common/ │ │ │ │ │ │ │ ├── a11y-button.scss │ │ │ │ │ │ │ ├── button-workspaces.scss │ │ │ │ │ │ │ ├── button.scss │ │ │ │ │ │ │ ├── floating-widget.scss │ │ │ │ │ │ │ ├── hidden.scss │ │ │ │ │ │ │ ├── menu.scss │ │ │ │ │ │ │ ├── scrollable.scss │ │ │ │ │ │ │ ├── slider.scss │ │ │ │ │ │ │ ├── spacing.scss │ │ │ │ │ │ │ ├── switch.scss │ │ │ │ │ │ │ ├── text-border.scss │ │ │ │ │ │ │ ├── tooltip.scss │ │ │ │ │ │ │ ├── unset.scss │ │ │ │ │ │ │ └── widget.scss │ │ │ │ │ │ ├── main.scss │ │ │ │ │ │ ├── variables.scss │ │ │ │ │ │ └── widgets/ │ │ │ │ │ │ ├── about.scss │ │ │ │ │ │ ├── applauncher.scss │ │ │ │ │ │ ├── bar.scss │ │ │ │ │ │ ├── dashboard.scss │ │ │ │ │ │ ├── desktop.scss │ │ │ │ │ │ ├── dock.scss │ │ │ │ │ │ ├── lockscreen.scss │ │ │ │ │ │ ├── media.scss │ │ │ │ │ │ ├── notifications.scss │ │ │ │ │ │ ├── osd.scss │ │ │ │ │ │ ├── overview.scss │ │ │ │ │ │ ├── powermenu.scss │ │ │ │ │ │ ├── quicksettings.scss │ │ │ │ │ │ └── settings.scss │ │ │ │ │ └── tsconfig.json │ │ │ │ ├── hypr/ │ │ │ │ │ ├── Autostart.conf │ │ │ │ │ ├── Decoration.conf │ │ │ │ │ ├── KeyBinds.conf │ │ │ │ │ ├── Misc.conf │ │ │ │ │ ├── WindowRules.conf │ │ │ │ │ ├── hyprland.conf │ │ │ │ │ ├── monitors.conf │ │ │ │ │ ├── presets/ │ │ │ │ │ │ ├── monitors.exampleconf │ │ │ │ │ │ ├── monitors_external.conf │ │ │ │ │ │ └── monitors_internal.conf │ │ │ │ │ └── scripts/ │ │ │ │ │ ├── brightness │ │ │ │ │ ├── launch_ags.sh │ │ │ │ │ ├── monitor_attached.sh │ │ │ │ │ └── monitor_dettached.sh │ │ │ │ ├── kitty/ │ │ │ │ │ └── kitty.conf │ │ │ │ └── neofetch/ │ │ │ │ ├── ascii.txt │ │ │ │ └── config.conf │ │ │ ├── home-programs-desktop.nix │ │ │ └── link-dotfiles-desktop.nix │ │ └── laptop/ │ │ ├── configs-laptop/ │ │ │ └── thinkfan.nix │ │ ├── configuration-laptop.nix │ │ ├── hardware-configuration-laptop.nix │ │ ├── home-dotfiles-laptop/ │ │ │ ├── ags/ │ │ │ │ ├── .eslintrc.yml │ │ │ │ ├── .gitignore │ │ │ │ ├── config.js │ │ │ │ ├── default.nix │ │ │ │ ├── greeter/ │ │ │ │ │ ├── auth.ts │ │ │ │ │ ├── greeter.scss │ │ │ │ │ ├── greeter.ts │ │ │ │ │ ├── session.ts │ │ │ │ │ └── statusbar.ts │ │ │ │ ├── greeter.js │ │ │ │ ├── lib/ │ │ │ │ │ ├── battery.ts │ │ │ │ │ ├── experiments.ts │ │ │ │ │ ├── gtk.ts │ │ │ │ │ ├── hyprland.ts │ │ │ │ │ ├── icons.ts │ │ │ │ │ ├── init.ts │ │ │ │ │ ├── matugen.ts │ │ │ │ │ ├── notifications.ts │ │ │ │ │ ├── option.ts │ │ │ │ │ ├── session.ts │ │ │ │ │ ├── swww.ts │ │ │ │ │ ├── tmux.ts │ │ │ │ │ ├── utils.ts │ │ │ │ │ └── variables.ts │ │ │ │ ├── main.ts │ │ │ │ ├── options.ts │ │ │ │ ├── package.json │ │ │ │ ├── service/ │ │ │ │ │ ├── asusctl.ts │ │ │ │ │ ├── brightness.ts │ │ │ │ │ ├── colorpicker.ts │ │ │ │ │ ├── powermenu.ts │ │ │ │ │ └── screenrecord.ts │ │ │ │ ├── style/ │ │ │ │ │ ├── extra.scss │ │ │ │ │ ├── mixins/ │ │ │ │ │ │ ├── a11y-button.scss │ │ │ │ │ │ ├── button.scss │ │ │ │ │ │ ├── floating-widget.scss │ │ │ │ │ │ ├── hidden.scss │ │ │ │ │ │ ├── media.scss │ │ │ │ │ │ ├── scrollable.scss │ │ │ │ │ │ ├── slider.scss │ │ │ │ │ │ ├── spacing.scss │ │ │ │ │ │ ├── switch.scss │ │ │ │ │ │ ├── unset.scss │ │ │ │ │ │ └── widget.scss │ │ │ │ │ └── style.ts │ │ │ │ ├── tsconfig.json │ │ │ │ └── widget/ │ │ │ │ ├── PopupWindow.ts │ │ │ │ ├── RegularWindow.ts │ │ │ │ ├── applauncher/ │ │ │ │ │ ├── AppItem.ts │ │ │ │ │ ├── Applauncher.ts │ │ │ │ │ └── applauncher.scss │ │ │ │ ├── bar/ │ │ │ │ │ ├── Bar.ts │ │ │ │ │ ├── PanelButton.ts │ │ │ │ │ ├── ScreenCorners.ts │ │ │ │ │ ├── bar.scss │ │ │ │ │ ├── buttons/ │ │ │ │ │ │ ├── BatteryBar.ts │ │ │ │ │ │ ├── ColorPicker.ts │ │ │ │ │ │ ├── Date.ts │ │ │ │ │ │ ├── Launcher.ts │ │ │ │ │ │ ├── Media.ts │ │ │ │ │ │ ├── Messages.ts │ │ │ │ │ │ ├── PowerMenu.ts │ │ │ │ │ │ ├── ScreenRecord.ts │ │ │ │ │ │ ├── SysTray.ts │ │ │ │ │ │ ├── SystemIndicators.ts │ │ │ │ │ │ ├── Taskbar.ts │ │ │ │ │ │ └── Workspaces.ts │ │ │ │ │ └── screencorner.scss │ │ │ │ ├── datemenu/ │ │ │ │ │ ├── DateColumn.ts │ │ │ │ │ ├── DateMenu.ts │ │ │ │ │ ├── NotificationColumn.ts │ │ │ │ │ └── datemenu.scss │ │ │ │ ├── desktop/ │ │ │ │ │ └── Desktop.ts │ │ │ │ ├── notifications/ │ │ │ │ │ ├── Notification.ts │ │ │ │ │ ├── NotificationPopups.ts │ │ │ │ │ └── notifications.scss │ │ │ │ ├── osd/ │ │ │ │ │ ├── OSD.ts │ │ │ │ │ ├── Progress.ts │ │ │ │ │ └── osd.scss │ │ │ │ ├── overview/ │ │ │ │ │ ├── Overview.ts │ │ │ │ │ ├── Window.ts │ │ │ │ │ ├── Workspace.ts │ │ │ │ │ └── overview.scss │ │ │ │ ├── powermenu/ │ │ │ │ │ ├── PowerMenu.ts │ │ │ │ │ ├── Verification.ts │ │ │ │ │ └── powermenu.scss │ │ │ │ ├── quicksettings/ │ │ │ │ │ ├── QuickSettings.ts │ │ │ │ │ ├── ToggleButton.ts │ │ │ │ │ ├── quicksettings.scss │ │ │ │ │ └── widgets/ │ │ │ │ │ ├── AsusProfile.ts │ │ │ │ │ ├── Bluetooth.ts │ │ │ │ │ ├── Brightness.ts │ │ │ │ │ ├── DND.ts │ │ │ │ │ ├── DarkMode.ts │ │ │ │ │ ├── Header.ts │ │ │ │ │ ├── Media.ts │ │ │ │ │ ├── MicMute.ts │ │ │ │ │ ├── Network.ts │ │ │ │ │ └── Volume.ts │ │ │ │ └── settings/ │ │ │ │ ├── Group.ts │ │ │ │ ├── Page.ts │ │ │ │ ├── Row.ts │ │ │ │ ├── Setter.ts │ │ │ │ ├── SettingsDialog.ts │ │ │ │ ├── layout.ts │ │ │ │ └── settingsdialog.scss │ │ │ ├── ags_js/ │ │ │ │ ├── .eslintrc.yml │ │ │ │ ├── .gitignore │ │ │ │ ├── .stylelintrc.yml │ │ │ │ ├── config.js │ │ │ │ ├── js/ │ │ │ │ │ ├── about/ │ │ │ │ │ │ └── about.js │ │ │ │ │ ├── applauncher/ │ │ │ │ │ │ ├── AppItem.js │ │ │ │ │ │ └── Applauncher.js │ │ │ │ │ ├── bar/ │ │ │ │ │ │ ├── PanelButton.js │ │ │ │ │ │ ├── TopBar.js │ │ │ │ │ │ └── buttons/ │ │ │ │ │ │ ├── BatteryBar.js │ │ │ │ │ │ ├── ColorPicker.js │ │ │ │ │ │ ├── DateButton.js │ │ │ │ │ │ ├── FocusedClient.js │ │ │ │ │ │ ├── MediaIndicator.js │ │ │ │ │ │ ├── NotificationIndicator.js │ │ │ │ │ │ ├── OverviewButton.js │ │ │ │ │ │ ├── PowerMenu.js │ │ │ │ │ │ ├── ScreenRecord.js │ │ │ │ │ │ ├── SubMenu.js │ │ │ │ │ │ ├── SysTray.js │ │ │ │ │ │ ├── System.js │ │ │ │ │ │ ├── SystemIndicators.js │ │ │ │ │ │ ├── Taskbar.js │ │ │ │ │ │ └── Workspaces.js │ │ │ │ │ ├── dashboard/ │ │ │ │ │ │ ├── Dashboard.js │ │ │ │ │ │ ├── DateColumn.js │ │ │ │ │ │ └── NotificationColumn.js │ │ │ │ │ ├── desktop/ │ │ │ │ │ │ ├── Desktop.js │ │ │ │ │ │ └── DesktopMenu.js │ │ │ │ │ ├── dock/ │ │ │ │ │ │ ├── Dock.js │ │ │ │ │ │ └── FloatingDock.js │ │ │ │ │ ├── icons.js │ │ │ │ │ ├── lockscreen/ │ │ │ │ │ │ ├── Lockscreen.js │ │ │ │ │ │ └── auth.py │ │ │ │ │ ├── main.js │ │ │ │ │ ├── misc/ │ │ │ │ │ │ ├── Avatar.js │ │ │ │ │ │ ├── BatteryIcon.js │ │ │ │ │ │ ├── Clock.js │ │ │ │ │ │ ├── FontIcon.js │ │ │ │ │ │ ├── HoverRevealer.js │ │ │ │ │ │ ├── IconBrowser.js │ │ │ │ │ │ ├── Notification.js │ │ │ │ │ │ ├── PopupWindow.js │ │ │ │ │ │ ├── Progress.js │ │ │ │ │ │ ├── RegularWindow.js │ │ │ │ │ │ └── mpris.js │ │ │ │ │ ├── notifications/ │ │ │ │ │ │ └── Notifications.js │ │ │ │ │ ├── options.js │ │ │ │ │ ├── osd/ │ │ │ │ │ │ └── OSD.js │ │ │ │ │ ├── overview/ │ │ │ │ │ │ ├── Client.js │ │ │ │ │ │ ├── Overview.js │ │ │ │ │ │ └── Workspace.js │ │ │ │ │ ├── powermenu/ │ │ │ │ │ │ ├── PowerMenu.js │ │ │ │ │ │ ├── ShadedPopup.js │ │ │ │ │ │ └── Verification.js │ │ │ │ │ ├── quicksettings/ │ │ │ │ │ │ ├── QuickSettings.js │ │ │ │ │ │ ├── ToggleButton.js │ │ │ │ │ │ └── widgets/ │ │ │ │ │ │ ├── AsusProfile.js │ │ │ │ │ │ ├── Bluetooth.js │ │ │ │ │ │ ├── Brightness.js │ │ │ │ │ │ ├── DND.js │ │ │ │ │ │ ├── Header.js │ │ │ │ │ │ ├── Media.js │ │ │ │ │ │ ├── MicMute.js │ │ │ │ │ │ ├── Network.js │ │ │ │ │ │ ├── Theme.js │ │ │ │ │ │ └── Volume.js │ │ │ │ │ ├── screencorner/ │ │ │ │ │ │ └── ScreenCorners.js │ │ │ │ │ ├── services/ │ │ │ │ │ │ ├── asusctl.js │ │ │ │ │ │ ├── brightness.js │ │ │ │ │ │ ├── colorpicker.js │ │ │ │ │ │ ├── lockscreen.js │ │ │ │ │ │ ├── onScreenIndicator.js │ │ │ │ │ │ ├── powermenu.js │ │ │ │ │ │ └── screenrecord.js │ │ │ │ │ ├── settings/ │ │ │ │ │ │ ├── SettingsDialog.js │ │ │ │ │ │ ├── globals.js │ │ │ │ │ │ ├── hyprland.js │ │ │ │ │ │ ├── option.js │ │ │ │ │ │ ├── scss.js │ │ │ │ │ │ ├── setup.js │ │ │ │ │ │ ├── theme.js │ │ │ │ │ │ └── wallpaper.js │ │ │ │ │ ├── themes.js │ │ │ │ │ ├── utils.js │ │ │ │ │ └── variables.js │ │ │ │ ├── package.json │ │ │ │ ├── prepare_background.sh │ │ │ │ ├── scss/ │ │ │ │ │ ├── common/ │ │ │ │ │ │ ├── a11y-button.scss │ │ │ │ │ │ ├── button-workspaces.scss │ │ │ │ │ │ ├── button.scss │ │ │ │ │ │ ├── floating-widget.scss │ │ │ │ │ │ ├── hidden.scss │ │ │ │ │ │ ├── menu.scss │ │ │ │ │ │ ├── scrollable.scss │ │ │ │ │ │ ├── slider.scss │ │ │ │ │ │ ├── spacing.scss │ │ │ │ │ │ ├── switch.scss │ │ │ │ │ │ ├── text-border.scss │ │ │ │ │ │ ├── tooltip.scss │ │ │ │ │ │ ├── unset.scss │ │ │ │ │ │ └── widget.scss │ │ │ │ │ ├── main.scss │ │ │ │ │ ├── variables.scss │ │ │ │ │ └── widgets/ │ │ │ │ │ ├── about.scss │ │ │ │ │ ├── applauncher.scss │ │ │ │ │ ├── bar.scss │ │ │ │ │ ├── dashboard.scss │ │ │ │ │ ├── desktop.scss │ │ │ │ │ ├── dock.scss │ │ │ │ │ ├── lockscreen.scss │ │ │ │ │ ├── media.scss │ │ │ │ │ ├── notifications.scss │ │ │ │ │ ├── osd.scss │ │ │ │ │ ├── overview.scss │ │ │ │ │ ├── powermenu.scss │ │ │ │ │ ├── quicksettings.scss │ │ │ │ │ └── settings.scss │ │ │ │ └── tsconfig.json │ │ │ ├── ags_ts_old/ │ │ │ │ ├── .eslintrc.yml │ │ │ │ ├── .gitignore │ │ │ │ ├── config.js │ │ │ │ ├── default.nix │ │ │ │ ├── lib/ │ │ │ │ │ ├── battery.ts │ │ │ │ │ ├── experiments.ts │ │ │ │ │ ├── gtk.ts │ │ │ │ │ ├── hyprland.ts │ │ │ │ │ ├── icons.ts │ │ │ │ │ ├── init.ts │ │ │ │ │ ├── matugen.ts │ │ │ │ │ ├── option.ts │ │ │ │ │ ├── swww.ts │ │ │ │ │ ├── tmux.ts │ │ │ │ │ ├── utils.ts │ │ │ │ │ └── variables.ts │ │ │ │ ├── main.ts │ │ │ │ ├── options.ts │ │ │ │ ├── package.json │ │ │ │ ├── service/ │ │ │ │ │ ├── asusctl.ts │ │ │ │ │ ├── brightness.ts │ │ │ │ │ ├── colorpicker.ts │ │ │ │ │ ├── powermenu.ts │ │ │ │ │ └── screenrecord.ts │ │ │ │ ├── style/ │ │ │ │ │ ├── mixins/ │ │ │ │ │ │ ├── a11y-button.scss │ │ │ │ │ │ ├── button.scss │ │ │ │ │ │ ├── floating-widget.scss │ │ │ │ │ │ ├── hidden.scss │ │ │ │ │ │ ├── media.scss │ │ │ │ │ │ ├── scrollable.scss │ │ │ │ │ │ ├── slider.scss │ │ │ │ │ │ ├── spacing.scss │ │ │ │ │ │ ├── switch.scss │ │ │ │ │ │ ├── unset.scss │ │ │ │ │ │ └── widget.scss │ │ │ │ │ ├── style.ts │ │ │ │ │ └── widget/ │ │ │ │ │ ├── applauncher.scss │ │ │ │ │ ├── bar.scss │ │ │ │ │ ├── datemenu.scss │ │ │ │ │ ├── extra.scss │ │ │ │ │ ├── notifications.scss │ │ │ │ │ ├── osd.scss │ │ │ │ │ ├── overview.scss │ │ │ │ │ ├── powermenu.scss │ │ │ │ │ ├── quicksettings.scss │ │ │ │ │ ├── screencorner.scss │ │ │ │ │ └── settingsdialog.scss │ │ │ │ ├── tsconfig.json │ │ │ │ └── widget/ │ │ │ │ ├── PopupWindow.ts │ │ │ │ ├── applauncher/ │ │ │ │ │ ├── AppItem.ts │ │ │ │ │ └── Applauncher.ts │ │ │ │ ├── bar/ │ │ │ │ │ ├── Bar.ts │ │ │ │ │ ├── PanelButton.ts │ │ │ │ │ ├── ScreenCorners.ts │ │ │ │ │ └── buttons/ │ │ │ │ │ ├── BatteryBar.ts │ │ │ │ │ ├── ColorPicker.ts │ │ │ │ │ ├── Date.ts │ │ │ │ │ ├── Launcher.ts │ │ │ │ │ ├── Media.ts │ │ │ │ │ ├── Messages.ts │ │ │ │ │ ├── PowerMenu.ts │ │ │ │ │ ├── ScreenRecord.ts │ │ │ │ │ ├── SysTray.ts │ │ │ │ │ ├── SystemIndicators.ts │ │ │ │ │ ├── Taskbar.ts │ │ │ │ │ └── Workspaces.ts │ │ │ │ ├── datemenu/ │ │ │ │ │ ├── DateColumn.ts │ │ │ │ │ ├── DateMenu.ts │ │ │ │ │ └── NotificationColumn.ts │ │ │ │ ├── desktop/ │ │ │ │ │ └── Desktop.ts │ │ │ │ ├── notifications/ │ │ │ │ │ ├── Notification.ts │ │ │ │ │ └── NotificationPopups.ts │ │ │ │ ├── osd/ │ │ │ │ │ ├── OSD.ts │ │ │ │ │ └── Progress.ts │ │ │ │ ├── overview/ │ │ │ │ │ ├── Overview.ts │ │ │ │ │ ├── Window.ts │ │ │ │ │ └── Workspace.ts │ │ │ │ ├── powermenu/ │ │ │ │ │ ├── PowerMenu.ts │ │ │ │ │ └── Verification.ts │ │ │ │ ├── quicksettings/ │ │ │ │ │ ├── QuickSettings.ts │ │ │ │ │ ├── ToggleButton.ts │ │ │ │ │ └── widgets/ │ │ │ │ │ ├── AsusProfile.ts │ │ │ │ │ ├── Bluetooth.ts │ │ │ │ │ ├── Brightness.ts │ │ │ │ │ ├── DND.ts │ │ │ │ │ ├── DarkMode.ts │ │ │ │ │ ├── Header.ts │ │ │ │ │ ├── Media.ts │ │ │ │ │ ├── MicMute.ts │ │ │ │ │ ├── Network.ts │ │ │ │ │ └── Volume.ts │ │ │ │ └── settings/ │ │ │ │ ├── Group.ts │ │ │ │ ├── Page.ts │ │ │ │ ├── Row.ts │ │ │ │ ├── SettingsDialog.ts │ │ │ │ └── layout.ts │ │ │ ├── anyrun/ │ │ │ │ └── stylesheet.css │ │ │ ├── hypr/ │ │ │ │ ├── Autostart.conf │ │ │ │ ├── KeyBinds.conf │ │ │ │ ├── Misc.conf │ │ │ │ ├── WindowRules.conf │ │ │ │ ├── hypridle.conf │ │ │ │ ├── hyprland.conf │ │ │ │ ├── hyprlock.conf │ │ │ │ ├── monitors.conf │ │ │ │ ├── presets/ │ │ │ │ │ ├── monitors.exampleconf │ │ │ │ │ ├── monitors_external.conf │ │ │ │ │ └── monitors_internal.conf │ │ │ │ └── scripts/ │ │ │ │ ├── brightness │ │ │ │ ├── launch_ags.sh │ │ │ │ ├── logoutlaunch.sh │ │ │ │ ├── monitor_attached.sh │ │ │ │ ├── monitor_dettached.sh │ │ │ │ └── w2m.sh │ │ │ ├── neofetch/ │ │ │ │ ├── ascii.txt │ │ │ │ └── config.conf │ │ │ ├── screenlock/ │ │ │ │ ├── lock.sh │ │ │ │ ├── lock_config.conf │ │ │ │ └── lock_screen.sh │ │ │ └── waybar/ │ │ │ ├── config.jsonc │ │ │ └── launch.sh │ │ ├── home-laptop.nix │ │ ├── home-programs-laptop.nix │ │ └── link-dotfiles-laptop.nix │ ├── nixos.nix │ ├── overlays/ │ │ ├── betaflight-configurator.nix │ │ ├── blhelisuite32.nix │ │ ├── default.bkp │ │ └── test.nix │ ├── packages.nix │ ├── pkgs/ │ │ ├── default.nix │ │ └── kanagawa-gtk-theme.nix │ └── variables.nix └── scripts/ ├── blepower.sh ├── sleep.sh ├── update.sh └── wifipower.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ Backups/ dependencies.. backgrounds/last/image.png backgrounds/last/image_blurred.png hypr/monitors.conf hypr/Workspaces.conf Code/ ================================================ FILE: README.md ================================================ ![alt text](https://raw.githubusercontent.com/trinib/trinib/82213791fa9ff58d3ca768ddd6de2489ec23ffca/images/footer.svg) # 👀 **Screenshots** ![Hyprland_new](https://github.com/RoccoRakete/hyprland-dots/assets/44879342/0acf96c1-93b5-4c9a-9e71-7775172904d4) --- # ⏰ **Updates** * This has changed quiet a lot... * These dotfiles are now intended to be used with NixOS. * I removed the ability to set GTK-Themes/Icons due to weird behaviors... This styling is now to be done with home-manager. * More small changes has been made. * works with ags > 1.5.0! If you want to use it with ags < 1.5.0 please use: "ags_old_working_1.4.x" * Added the ability to set GTK-Themes/Icons directly from the ags config. -> This got removed! * Pywal-Themes can also be set from the ags config. * Needs Ags v1.4.0 to work correctly now... * Rofi Wallpaper switcher is now available. * Added a systemresource monitor to the bar. # 🔧 **Stuff used** * GTK-Theme: [Mostly Adwaita/adw-gtk3.](https://github.com/lassekongo83/adw-gtk3) * Icons: [MoreWaita](https://github.com/somepaulo/MoreWaita) * Compositor: [Hyprland](https://github.com/hyprwm/Hyprland) * Shell: [ags](https://github.com/Aylur/ags) * Terminal: [Kitty](https://github.com/kovidgoyal/kitty) * [Wallaper shown on the pictures](https://github.com/AngelJumbo/gruvbox-wallpapers/blob/main/wallpapers/irl/stairs.jpg) # 🎨 **The Ags-Shell** When I first started using ags I thought, OMG: Why is this so hard and complicated ... ... but it's really not. If you want to make some minor adjustments to the shell, it's highly recommended, that you learn some JavaScript and (S)CSS for styling. JavaScript is a quiet simple programming language and since you already have a useful project to work with, it's easy to try out and make changes on the fly :) There is also a nice [Wiki](https://github.com/Aylur/ags/wiki)! The volume is controlled by ags, with Hyprland like this: ``` bind = , XF86AudioRaiseVolume , exec , ags run-js "audio.speaker.volume += 0.05; indicator.speaker()" bind = , XF86AudioLowerVolume , exec , ags run-js "audio.speaker.volume -= 0.05; indicator.speaker()" ``` ... this triggers the OSD to show up too! This should work with brightness control too, but I can't verify this, since I'm not using Linux on a Laptop. # ⚙️ **!!obsolete!! GTK-Themes / GTK-Icons / PyWall-Themes** ![Screenshot_19-11-23_12-20](https://github.com/RoccoRakete/hyprland-dots/assets/44879342/0a197c8a-e0d8-40e4-acf2-7d17771c5bb7) * The refering options are: ```misc.pywal.theme:``` ```misc.gtk.theme:``` ```misc.gtkIcons.theme:``` ### Make sure these namings match exactly the themes you want to use! Otherwise the last used theme will be used. * Pywall-Themes can be found [here.](https://adamrutter.github.io/pywal-themes-preview/) Or simply by running ```wal --theme``` in your terminal and just picking one. GTK-Icons and GTK-Themes should have the exact same naming as found in ```~/.themes/``` for example. After you have set up everything, it's just a matter of chaning the themes from the settings panel! :) Have fun! # 📜 **Installation** If you still want to use this with anything other than NixOS, this is the stuff you need to install: If you install [ags](https://github.com/Aylur/ags/wiki/installation) and [Hyprland](https://wiki.hyprland.org/Getting-Started/Installation/) you're 99% ready to go. Forthermore I recommend installing the following things: * [playerctl](https://github.com/altdesktop/playerctl) for proper media control. * [A nerdfont](https://www.nerdfonts.com/) for displaying icons. * [Anyrun](https://github.com/Kirottu/anyrun) as an application launcher, web search and many more. Although ags has it's own application launcher, I like anyrun much more since It's capable of also doing websearches and much more! :D * [GTK-Lock](https://github.com/jovanlanik/gtklock) ... same thing goes with anyrun. I just like it much more, but this is totaly up to you! [![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=RoccoRakete&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only) ================================================ FILE: backgrounds/last/.comments/image_blurred.png.xml ================================================ rosé pine ================================================ FILE: cfg/anyrun/adwaita-dark/config.ron ================================================ Config( x: Fraction(0.500000), y: Fraction(0.300000), width: Fraction(0.250000), height: Absolute(0), hide_icons: false, ignore_exclusive_zones: true, layer: Overlay, hide_plugin_info: true, close_on_click: true, show_results_immediately: true, max_entries: None, plugins: ["/nix/store/78s37pd0a67zzwvvy9nf5c26yp98pcc3-applications-0.1.0/lib/libapplications.so"], ) ================================================ FILE: cfg/anyrun/adwaita-dark/launch.sh ================================================ #!/usr/bin/env sh # Adwaita sassc $HOME/.config/anyrun/style-adwaita.scss $HOME/.config/anyrun/style.css anyrun ================================================ FILE: cfg/anyrun/adwaita-dark/style-adwaita.scss ================================================ @import "./adwaita.scss"; window { background: transparent; /* rgba(0, 0, 0, 0.8);*/ } #match, #entry, #plugin, #main { background: transparent; } #match.activatable { padding: 12px 14px; border-radius: 12px; color: white; margin-top: 4px; border: 2px solid transparent; transition: all 0.3s ease; } #match.activatable:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; /* border-top: 2px solid rgba(255, 255, 255, 0.1); */ } #match.activatable #match-title { font-size: 1.3rem; font-weight: bolder; } #match.activatable:hover { background: $bg-color; } #match-title, #match-desc { color: inherit; } #match.activatable:hover, #match.activatable:selected { border-top-left-radius: 12px; border-top-right-radius: 12px; } #match.activatable:selected+#match.activatable, #match.activatable:hover+#match.activatable { border-top: 2px solid transparent; } #match.activatable:selected, #match.activatable:hover:selected { background: $bg-color; } #match, #plugin { box-shadow: none; } #entry { padding-left: 18px; font-size: 1.2rem; font-weight: bolder; color: $fg_color; background: $bg_color; box-shadow: none; border-radius: 12px; border: $border $selected_bg_color; } box#main { background: $widget-bg; border-radius: 20px; padding: 15px; /* box-shadow: 0px 2px 33px -5px rgba(0, 0, 0, 0.5); */ } row:first-child { margin-top: 6px; } ================================================ FILE: cfg/anyrun/catppuccin-mocha/config.ron ================================================ Config( x: Fraction(0.500000), y: Fraction(0.300000), width: Fraction(0.250000), height: Absolute(0), hide_icons: false, ignore_exclusive_zones: true, layer: Overlay, hide_plugin_info: true, close_on_click: true, show_results_immediately: true, max_entries: None, plugins: ["libapplications.so"], ) ================================================ FILE: cfg/anyrun/catppuccin-mocha/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha sassc $HOME/.config/anyrun/style-catppuccin-mocha.scss $HOME/.config/anyrun/style.css anyrun ================================================ FILE: cfg/anyrun/catppuccin-mocha/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; window { background: transparent; /* rgba(0, 0, 0, 0.8);*/ } #match, #entry, #plugin, #main { background: transparent; } #match.activatable { padding: 12px 14px; border-radius: 12px; color: white; margin-top: 4px; border: 2px solid transparent; transition: all 0.3s ease; } #match.activatable:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; /* border-top: 2px solid rgba(255, 255, 255, 0.1); */ } #match.activatable #match-title { font-size: 1.3rem; font-weight: bolder; } #match.activatable:hover { background: $bg_color; } #match-title, #match-desc { color: inherit; } #match.activatable:hover, #match.activatable:selected { border-top-left-radius: 12px; border-top-right-radius: 12px; } #match.activatable:selected+#match.activatable, #match.activatable:hover+#match.activatable { border-top: 2px solid transparent; } #match.activatable:selected, #match.activatable:hover:selected { color: $color-fg; background: $selected_bg_color; } #match, #plugin { box-shadow: none; } #entry { padding-left: 18px; font-size: 1.2rem; font-weight: bolder; color: $fg_color; background: $bg_color; box-shadow: none; border-radius: 12px; border: $border $selected_bg_color; background-color: $grid-bg; } box#main { background: $widget-bg; border-radius: 20px; padding: 15px; /* box-shadow: 0px 2px 33px -5px rgba(0, 0, 0, 0.5); */ } row:first-child { margin-top: 6px; } ================================================ FILE: cfg/hypr/adwaita-dark/Decoration.conf ================================================ # ############################################################################# # # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # # ############################################################################# # # See https://wiki.hyprland.org/Configuring/Variables/ for more general { gaps_in = 3 gaps_out = 10 border_size = 0 col.active_border = rgba(b4befecc) col.inactive_border = rgba(77767bcc) layout = dwindle resize_on_border = true allow_tearing = true } # See https://wiki.hyprland.org/Configuring/Variables/ for more decoration { # rounding rounding = 10 dim_inactive = true dim_strength = 0.3 blur { # blur enabled = false new_optimizations = true #enabled = true #brightness = 1.0 #contrast = 1.0 #noise = 2.0e-2 #passes = 3 #popups = true #size = 10 #new_optimizations = true } # shadow drop_shadow = true shadow_range = 10 shadow_ignore_window = true shadow_offset = 0 2 shadow_range = 30 shadow_render_power = 3 col.shadow = rgba(00000055) } animations { enabled = true bezier = fluent_decel , 0 , 0.2 , 0.4 , 1 bezier = easeOutCirc , 0 , 0.55 , 0.45 , 1 bezier = easeOutCubic , 0.33 , 1 , 0.68 , 1 bezier = easeinoutsine , 0.37 , 0 , 0.63 , 1 # Windows animation = windowsIn , 1 , 3 , fluent_decel , # window open animation = windowsOut , 1 , 5 , fluent_decel , # window close. animation = windowsMove , 1 , 2 , easeinoutsine , slide # everything in between, moving, dragging, resizing. # Fade animation = fadeIn , 1 , 3 , easeOutCubic # fade in (open) -> layers and windows animation = fadeOut , 1 , 1.7 , easeOutCubic # fade out (close) -> layers and windows animation = fadeSwitch , 0 , 1 , easeOutCirc # fade on changing activewindow and its opacity animation = fadeShadow , 1 , 10 , easeOutCirc # fade on changing activewindow for shadows animation = fadeDim , 1 , 4 , fluent_decel # the easing of the dimming of inactive windows animation = border , 1 , 2.7 , easeOutCirc # for animating the border's color switch speed animation = borderangle , 1 , 30 , fluent_decel , once # for animating the border's gradient angle - styles: once (default), loop animation = workspaces , 1 , 2 , easeOutCubic } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = false preserve_split = true # you probably want this force_split = 2 smart_split = false smart_resizing = true } # Layerrules #layerrule = blur, waybar layerrule = animation workspaces, swaync-control-center ================================================ FILE: cfg/hypr/catppuccin-mocha/Decoration.conf ================================================ # ############################################################################# # # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # # ############################################################################# # # See https://wiki.hyprland.org/Configuring/Variables/ for more general { gaps_in = 3 gaps_out = 10 border_size = 3 col.active_border = rgba(b4befecc) col.inactive_border = rgba(77767bcc) layout = dwindle resize_on_border = true allow_tearing = true } # See https://wiki.hyprland.org/Configuring/Variables/ for more decoration { # rounding rounding = 10 dim_inactive = true dim_strength = 0.2 blur { # blur #enabled = false #new_optimizations = true enabled = true brightness = 1.0 contrast = 1.0 noise = 2.0e-2 passes = 3 popups = true size = 10 new_optimizations = true } # shadow drop_shadow = true shadow_range = 10 shadow_ignore_window = true shadow_offset = 0 2 shadow_range = 30 shadow_render_power = 3 col.shadow = rgba(00000055) } animations { enabled = true bezier = fluent_decel , 0 , 0.2 , 0.4 , 1 bezier = easeOutCirc , 0 , 0.55 , 0.45 , 1 bezier = easeOutCubic , 0.33 , 1 , 0.68 , 1 bezier = easeinoutsine , 0.37 , 0 , 0.63 , 1 # Windows animation = windowsIn , 1 , 3 , fluent_decel , # window open animation = windowsOut , 1 , 5 , fluent_decel , # window close. animation = windowsMove , 1 , 2 , easeinoutsine , slide # everything in between, moving, dragging, resizing. # Fade animation = fadeIn , 1 , 3 , easeOutCubic # fade in (open) -> layers and windows animation = fadeOut , 1 , 1.7 , easeOutCubic # fade out (close) -> layers and windows animation = fadeSwitch , 0 , 1 , easeOutCirc # fade on changing activewindow and its opacity animation = fadeShadow , 1 , 10 , easeOutCirc # fade on changing activewindow for shadows animation = fadeDim , 1 , 4 , fluent_decel # the easing of the dimming of inactive windows animation = border , 1 , 2.7 , easeOutCirc # for animating the border's color switch speed animation = borderangle , 1 , 30 , fluent_decel , once # for animating the border's gradient angle - styles: once (default), loop animation = workspaces , 1 , 2 , easeOutCubic } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = false preserve_split = true # you probably want this force_split = 2 smart_split = false smart_resizing = true } # Layerrules layerrule = blur, waybar layerrule = animation workspaces, swaync-control-center ================================================ FILE: cfg/swaync/adwaita-dark/config.json ================================================ { "$schema": "./configSchema.json", "positionX": "right", "positionY": "top", "control-center-margin-top": 0, "control-center-margin-bottom": 0, "control-center-margin-right": 0, "control-center-margin-left": 0, "notification-icon-size": 64, "notification-body-image-height": 100, "notification-body-image-width": 200, "timeout": 10, "timeout-low": 5, "timeout-critical": 0, "fit-to-screen": false, "control-center-width": 500, "control-center-height": 800, "notification-window-width": 500, "keyboard-shortcuts": true, "image-visibility": "when-available", "transition-time": 200, "hide-on-clear": false, "hide-on-action": true, "script-fail-notify": true, "scripts": { "example-script": { "exec": "echo 'Do something...'", "urgency": "Normal" } }, "notification-visibility": { "example-name": { "state": "muted", "urgency": "Low", "app-name": "Spotify" } }, "widgets": [ "label", "buttons-grid", "volume", "backlight", "title", "dnd", "notifications", "mpris" ], "widget-config": { "title": { "text": "Notifications", "clear-all-button": true, "button-text": "Clear All" }, "dnd": { "text": "Do Not Disturb" }, "label": { "max-lines": 1, "text": "Control Center" }, "mpris": { "image-size": 96, "image-radius": 12 }, "backlight": { "label": "", "device": "intel_backlight", "min": 10 }, "backlight#KB": { "label": " ", "device": "asus::kbd_backlight", "subsystem": "leds" }, "volume": { "label": "" }, "menubar#label": { "menu#power-buttons": { "label": "", "position": "right", "actions": [ { "label": " Reboot", "command": "systemctl reboot" }, { "label": " Lock", "command": "hyprlock" }, { "label": " Logout", "command": "hyprctl exit" }, { "label": " Shut down", "command": "systemctl poweroff" } ] }, "buttons#topbar-buttons": { "position": "left", "actions": [ { "label": "", "command": "grim" }, { "label": "", "command": "grim" } ] } }, "buttons-grid": { "actions": [ { "label": "", "command": "/home/martin/.dots/scripts/wifipower.sh" }, { "label": "", "command": "/home/martin/.dots/scripts/blepower.sh" }, { "label": "󰒲", "command": "/home/martin/.dots/scripts/sleep.sh" }, { "label": "󰚰", "command": "/home/martin/.dots/scripts/update.sh" }, { "label": "", "command": "/home/martin/.dots/scripts/update.sh" }, { "label": "󰚰", "command": "/home/martin/.dots/scripts/update.sh" } ] } } } ================================================ FILE: cfg/swaync/adwaita-dark/configSchema.json ================================================ { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "SwayNotificationCenter JSON schema", "type": "object", "additionalProperties": false, "properties": { "$schema": { "type": "string", "description": "Pointer to the schema against which this document should be validated." }, "positionX": { "type": "string", "description": "Horizontal position of control center and notification window", "default": "right", "enum": ["right", "left", "center"] }, "layer": { "type": "string", "description": "Layer of notification window", "default": "overlay", "enum": ["background", "bottom", "top", "overlay"] }, "layer-shell": { "type": "boolean", "description": "Wether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply", "default": true }, "cssPriority": { "type": "string", "description": "Which GTK priority to use when loading the default and user CSS files. Pick \"user\" to override XDG_CONFIG_HOME/gtk-3.0/gtk.css", "default": "user", "enum": ["user"] }, "positionY": { "type": "string", "description": "Vertical position of control center and notification window", "default": "top", "enum": ["top", "center", "bottom"] }, "control-center-positionX": { "type": "string", "description": "Optional: Horizontal position of the control center. Supersedes positionX if not set to `none`", "default": "none", "enum": ["right", "left", "center", "none"] }, "control-center-positionY": { "type": "string", "description": "Optional: Vertical position of the control center. Supersedes positionY if not set to `none`", "default": "none", "enum": ["top", "bottom", "none"] }, "control-center-margin-top": { "type": "integer", "description": "The margin (in pixels) at the top of the control center. 0 to disable", "default": 0 }, "control-center-margin-bottom": { "type": "integer", "description": "The margin (in pixels) at the bottom of the control center. 0 to disable", "default": 0 }, "control-center-margin-right": { "type": "integer", "description": "The margin (in pixels) at the right of the control center. 0 to disable", "default": 0 }, "control-center-margin-left": { "type": "integer", "description": "The margin (in pixels) at the left of the control center. 0 to disable", "default": 0 }, "control-center-layer": { "type": "string", "description": "Layer of control center window", "default": "none", "enum": ["background", "bottom", "top", "overlay", "none"] }, "control-center-exclusive-zone": { "type": "boolean", "description": "Whether or not the control center should follow the compositors exclusive zones. An example would be setting it to \"false\" to cover your panel/dock.", "default": true }, "notification-2fa-action": { "type": "boolean", "description": "If each notification should display a 'COPY \"1234\"' action", "default": true }, "notification-inline-replies": { "type": "boolean", "description": "If notifications should display a text field to reply if the sender requests it. NOTE: Replying in popup notifications is only available if the compositor supports GTK Layer-Shell ON_DEMAND keyboard interactivity.", "default": false }, "notification-icon-size": { "type": "integer", "description": "The notification icon size (in pixels). The app icon size is 1/3", "default": 64, "minimum": 16 }, "notification-body-image-height": { "type": "integer", "description": "The notification body image height (in pixels)", "default": 100, "minimum": 100 }, "notification-body-image-width": { "type": "integer", "description": "The notification body image width (in pixels)", "default": 200, "minimum": 200 }, "timeout": { "type": "integer", "description": "The notification timeout for notifications with normal priority", "default": 10 }, "timeout-low": { "type": "integer", "description": "The notification timeout for notifications with low priority", "default": 5 }, "timeout-critical": { "type": "integer", "description": "The notification timeout for notifications with critical priority. 0 to disable", "default": 0 }, "notification-window-width": { "type": "integer", "description": "Width of the notification in pixels", "default": 500 }, "fit-to-screen": { "type": "boolean", "description": "If the control center should expand to both edges of the screen", "default": true }, "relative-timestamps": { "type": "boolean", "description": "Display notification timestamps relative to now e.g. \"26 minutes ago\". If false, a local iso8601-formatted absolute timestamp is displayed.", "default": true }, "control-center-height": { "type": "integer", "description": "Height of the control center in pixels. Ignored when 'fit-to-screen' is set to 'true'", "default": 600, "minimum": 300 }, "control-center-width": { "type": "integer", "description": "Width of the control center in pixels", "default": 500, "minimum": 300 }, "keyboard-shortcuts": { "type": "boolean", "description": "If control center should use keyboard shortcuts", "default": true }, "image-visibility": { "type": "string", "description": "The notification image visibility when no icon is available.", "default": "when-available", "enum": ["always", "when-available", "never"] }, "transition-time": { "type": "integer", "description": "The notification animation duration. 0 to disable", "default": 200 }, "hide-on-clear": { "type": "boolean", "description": "Hides the control center after pressing \"Clear All\"", "default": false }, "hide-on-action": { "type": "boolean", "description": "Hides the control center when clicking on notification action", "default": true }, "script-fail-notify": { "type": "boolean", "description": "Sends a notification if a script fails to run", "default": true }, "scripts": { "type": "object", "description": "Which scripts to check and potentially run for every notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for exec) use regex. If all properties match the given notification, the script will be run. Only the first matching script will be run.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^.{1,}$": { "type": "object", "description": "Your script object.", "required": ["exec"], "minProperties": 2, "additionalProperties": false, "properties": { "exec": { "type": "string", "description": "The script to run. Can also run regular shell commands." }, "app-name": { "type": "string", "description": "The app-name. Uses Regex." }, "desktop-entry": { "type": "string", "description": "The desktop-entry. Uses Regex." }, "summary": { "type": "string", "description": "The summary of the notification. Uses Regex." }, "body": { "type": "string", "description": "The body of the notification. Uses Regex." }, "urgency": { "type": "string", "description": "The urgency of the notification.", "default": "Normal", "enum": ["Low", "Normal", "Critical"] }, "category": { "type": "string", "description": "Which category the notification belongs to. Uses Regex." }, "run-on": { "type": "string", "description": "Whether to run the script on an action being activated, or when the notification is received.", "enum": ["action", "receive"], "default": "receive" } } } } }, "notification-visibility": { "type": "object", "description": "Set the visibility of each incoming notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for state) use regex. If all properties match the given notification, the notification will be follow the provided state. Only the first matching object will be used.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^.{1,}$": { "type": "object", "description": "Your script object.", "required": ["state"], "minProperties": 2, "additionalProperties": false, "properties": { "state": { "type": "string", "description": "The notification visibility state.", "default": "enabled", "enum": ["ignored", "muted", "enabled", "transient"] }, "app-name": { "type": "string", "description": "The app-name. Uses Regex." }, "desktop-entry": { "type": "string", "description": "The desktop-entry. Uses Regex." }, "summary": { "type": "string", "description": "The summary of the notification. Uses Regex." }, "body": { "type": "string", "description": "The body of the notification. Uses Regex." }, "urgency": { "type": "string", "description": "The urgency of the notification.", "default": "Normal", "enum": ["Low", "Normal", "Critical"] }, "override-urgency": { "type": "string", "description": "The new urgency of the notification (optional)", "default": "unset", "enum": ["unset", "low", "normal", "critical"] }, "category": { "type": "string", "description": "Which category the notification belongs to. Uses Regex." } } } } }, "widgets": { "type": "array", "description": "Which order and which widgets to display. If the \"notifications\" widget isn't specified, it will be placed at the bottom.", "default": ["inhibitors", "title", "dnd", "notifications"], "items": { "type": "string", "$comment": "Sadly can't use regex and enums at the same time. Fix in the future?", "pattern": "^[a-zA-Z0-9_-]{1,}(#[a-zA-Z0-9_-]{1,}){0,1}?$" } }, "widget-config": { "type": "object", "description": "Configure specific widget properties.", "additionalProperties": false, "$comment": "New widgets go here in \"patternProperties\" ↓", "patternProperties": { "^title(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$comment": "References the widget structure from \"widgets\" below", "$ref": "#/widgets/title" }, "^dnd(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/dnd" }, "^label(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/label" }, "^mpris(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/mpris" }, "^buttons-grid(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/buttons-grid" }, "^menubar(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/menubar" }, "^volume(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/volume" }, "^backlight(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/backlight" }, "^inhibitors(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$comment": "References the widget structure from \"widgets\" below", "$ref": "#/widgets/inhibitors" } } } }, "widgets": { "$comment": "New widgets go here", "title": { "type": "object", "description": "Control Center Title Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Notifications" }, "clear-all-button": { "type": "boolean", "description": "Wether to display a \"Clear All\" button", "default": true }, "button-text": { "type": "string", "description": "\"Clear All\" button text", "default": "Clear All" } } }, "dnd": { "type": "object", "description": "Control Center Do Not Disturb Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Do Not Disturb" } } }, "label": { "type": "object", "description": "A generic widget that allows the user to add custom text", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The text content of the widget", "default": "Label Text" }, "max-lines": { "type": "integer", "description": "The maximum lines", "default": 5 } } }, "mpris": { "type": "object", "description": "A widget that displays multiple music players", "additionalProperties": false, "properties": { "image-size": { "type": "integer", "description": "The size of the album art", "default": 96 }, "image-radius": { "type": "integer", "description": "The border radius of the album art. Will be overriden by setting the border-radius in the style.css for the \".widget-mpris-album-art\" class", "default": 12 }, "blur": { "type": "bool", "description": "Appy the artwork as the MPRIS background and blur it", "default": true } } }, "buttons-grid": { "type": "object", "description": "A widget to add a grid of buttons that execute shell commands", "additionalProperties": false, "properties": { "actions": { "type": "array", "description": "A list of actions containing a label and a command", "items": { "type": "object", "properties": { "label": { "type": "string", "description": "Text to be displayed in button", "default": "label" }, "command": { "type": "string", "description": "Command to be executed on click", "default": "" }, "type": { "type": "string", "description": "Type of the button; toggle buttons receive the .active css class and an env variable 'SWAYNC_TOGGLE_STATE' is set. See example in the default config.json", "default": "normal", "enum": ["normal", "toggle"] }, "update-command": { "type": "string", "description": "Command to be executed on visibility change of cc to update the active state of the toggle button (should echo true or false)", "default": "" }, "active": { "type": "bool", "description": "Wether the toggle button is active as default or not", "default": false } } } } } }, "menubar": { "type": "object", "description": "A bar that contains action-buttons and buttons to open a dropdown with action-buttons", "additionalProperties": false, "patternProperties": { "^menu(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "type": "object", "description": "A button that opens a dropdown with action-buttons", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text to be displayed in button", "default": "Menu" }, "position": { "type": "string", "description": "Horizontal position of the button in the bar", "default": "right", "enum": ["right", "left"] }, "animation-type": { "type": "string", "default": "slide_down", "description": "Animation type for menu", "enum": ["slide_down", "slide_up", "none"] }, "animation-duration":{ "type": "integer", "default": 250, "description": "Duration of animation in milliseconds" }, "actions": { "$ref" : "#/widgets/buttons-grid/properties/actions" } } }, "^buttons(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "type": "object", "description": "A list of action-buttons to be displayed in the topbar", "additionalProperties": false, "properties": { "position": { "type": "string", "description": "Horizontal position of the button in the bar", "default": "right", "enum": ["right", "left"] }, "actions": { "$ref" : "#/widgets/buttons-grid/properties/actions" } } } } }, "volume": { "type": "object", "description": "Slider to control pulse volume", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text displayed in front of the volume slider", "default": "Volume" }, "show-per-app": { "type": "boolean", "default": false, "description": "Show per app volume control" }, "show-per-app-icon": { "type": "boolean", "default": true, "description": "Show application icon in per app control" }, "show-per-app-label": { "type": "boolean", "default": false, "description": "Show application name in per app control" }, "empty-list-label": { "type": "string", "default": "No active sink input", "description": "Text displayed when there are not active sink inputs" }, "expand-button-label": { "type": "string", "default": "⇧", "description": "Label displayed on button to show per app volume control" }, "collapse-button-label": { "type": "string", "default": "⇩", "description": "Label displayed on button to hide per app volume control" }, "icon-size": { "type": "integer", "default": 24, "description": "Size of the application icon in per app volume control" }, "animation-type": { "type": "string", "default": "slide_down", "description": "Animation type for menu", "enum": ["slide_down", "slide_up", "none"] }, "animation-duration":{ "type": "integer", "default": 250, "description": "Duration of animation in milliseconds" } } }, "backlight": { "type": "object", "description": "Slider to control monitor brightness", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text displayed in front of the backlight slider", "default": "Brightness" }, "device": { "type": "string", "description": "Name of monitor (find possible devices using `ls /sys/class/backlight` or `ls /sys/class/leds`)", "default": "intel_backlight" }, "subsystem": { "type": "string", "description": "Kernel subsystem for brightness control", "default": "backlight", "enum": ["backlight", "leds"] }, "min": { "type": "integer", "default": 0, "description": "Lowest possible value for brightness" } } }, "inhibitors": { "type": "object", "description": "Control Center Inhibitors Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Inhibitors" }, "clear-all-button": { "type": "boolean", "description": "Wether to display a \"Clear All\" button", "default": true }, "button-text": { "type": "string", "description": "\"Clear All\" button text", "default": "Clear All" } } } } } ================================================ FILE: cfg/swaync/adwaita-dark/launch.sh ================================================ #!/usr/bin/env sh # Adwaita sassc $HOME/.config/swaync/style-adwaita.scss $HOME/.config/swaync/style.css swaync-client -R swaync-client -rs swaync-client -t ================================================ FILE: cfg/swaync/adwaita-dark/style-adwaita.scss ================================================ @import "./catppuccin-mocha.scss"; .text-button:hover, .text-button.control-center-clear-all:hover { color: $color-fg; background-color: $button-bg-focus; transition: linear 0.25s; } .notification-row { outline: none; } .notification-row:focus, .notification-row:hover { background: $button-bg-focus; } .notification-row .notification-background { padding: $widget-margin $widget-margin; } .notification-row .notification-background .close-button { /* The notification Close Button */ background: $grid-bg; color: $text-color; text-shadow: none; padding: 0; border-radius: 100%; margin-top: $spacing; margin-right: $spacing; box-shadow: none; border: none; min-width: $font-size*1.5; min-height: $font-size*1.5; } .notification-row .notification-background .close-button:hover { box-shadow: none; background: $close-button-bg; transition: background 0.15s ease-in-out; border: none; } .notification-row .notification-background .notification { /* The actual notification */ border-radius: $radii; border: $widget-border; border-radius: $radii; padding: 0; transition: background 0.15s ease-in-out; background: $widget-bg; } .notification-row .notification-background .notification.low { /* Low Priority Notification */ } .notification-row .notification-background .notification.normal { /* Normal Priority Notification */ } .notification-row .notification-background .notification.critical { /* Critical Priority Notification */ } .notification-row .notification-background .notification .notification-action, .notification-row .notification-background .notification .notification-default-action { padding: 0px; margin: 0; box-shadow: none; background: transparent; border: none; color: $text-color; transition: background 0.15s ease-in-out; } .notification-row .notification-background .notification .notification-action:hover, .notification-row .notification-background .notification .notification-default-action:hover { -gtk-icon-effect: none; background: $button-bg; } .notification-row .notification-background .notification .notification-default-action { /* The large action that also displays the notification summary and body */ border-radius: $radii; } .notification-row .notification-background .notification .notification-default-action:not(:only-child) { /* When alternative actions are visible */ border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; } .notification-row .notification-background .notification .notification-default-action .notification-content { background: transparent; border-radius: $radii; padding: $spacing; padding-right: $spacing*3; } .notification-row .notification-background .notification .notification-default-action .notification-content .image { /* Notification Primary Image */ -gtk-icon-effect: none; border-radius: $radii; /* Size in px */ margin: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .app-icon { /* Notification app icon (only visible when the primary image is set) */ -gtk-icon-effect: none; -gtk-icon-shadow: 0 1px 4px black; margin: $spacing*2; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .summary { /* Notification summary/title */ font-size: 1.1em; font-weight: bolder; background: transparent; color: $text-color; text-shadow: none; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .time { /* Notification time-ago */ font-size: 1.1em; font-weight: bolder; background: transparent; color: $text-color; text-shadow: none; margin-right: $spacing*10; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body { /* Notification body */ font-size: 1.1em; font-weight: normal; background: transparent; color: $text-color; text-shadow: none; } .notification-row .notification-background .notification .notification-default-action .notification-content progressbar { /* The optional notification progress bar */ margin-top: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .body-image { /* The "extra" optional bottom notification image */ margin-top: $spacing; background-color: $text-color; border-radius: $radii; -gtk-icon-effect: none; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply { /* The inline reply section */ margin-top: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-entry { background: $button-bg-darker; color: $text-color; caret-color: $text-color; border: 1px solid $dark_1; border-radius: $radii; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button { margin-left: $spacing; background: $grid-bg; border: 1px solid $dark_1; border-radius: $radii; color: $text-color; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button:disabled { background: initial; color: $text-color-disabled; border: 1px solid $dark_1; border-color: transparent; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button:hover { background: $button-bg; } .notification-row .notification-background .notification .notification-action { /* The alternative actions below the default action */ border-top: 1px solid $dark_1; border-radius: 0px; border-right: 1px solid $dark_1; } .notification-row .notification-background .notification .notification-action:first-child { /* add bottom border radius to eliminate clipping */ border-bottom-left-radius: $radii; } .notification-row .notification-background .notification .notification-action:last-child { border-bottom-right-radius: $radii; border-right: none; } .notification-group { /* Styling only for Grouped Notifications */ } .notification-group.low { /* Low Priority Group */ } .notification-group.normal { /* Low Priority Group */ } .notification-group.critical { /* Low Priority Group */ } .notification-group .notification-group-buttons, .notification-group .notification-group-headers { margin: 0 16px; color: $text-color; } .notification-group .notification-group-headers { /* Notification Group Headers */ } .notification-group .notification-group-headers .notification-group-icon { color: $text-color; } .notification-group .notification-group-headers .notification-group-header { color: $text-color; } .notification-group .notification-group-buttons { /* Notification Group Buttons */ } .notification-group.collapsed .notification-row .notification { background-color: $button-bg; } .notification-group.collapsed .notification-row:not(:last-child) { /* Top notification in stack */ /* Set lower stacked notifications opacity to 0 */ } .notification-group.collapsed .notification-row:not(:last-child) .notification-action, .notification-group.collapsed .notification-row:not(:last-child) .notification-default-action { opacity: 0; } .notification-group.collapsed:hover .notification-row:not(:only-child) .notification { background-color: $button-bg; } .control-center { /* The Control Center which contains the old notifications + widgets */ background: $widget-bg; color: $text-color; margin: $widget-margin; border: $widget-border; border-radius: $widget-radii; } .control-center .control-center-list-placeholder { /* The placeholder when there are no notifications */ opacity: 0.5; } .control-center .control-center-list { /* List of notifications */ background: transparent; } .control-center .control-center-list .notification { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), 0 2px 6px 2px rgba(0, 0, 0, 0.3); } .control-center .control-center-list .notification .notification-default-action, .control-center .control-center-list .notification .notification-action { transition: opacity 400ms ease-in-out, background 0.15s ease-in-out; } .control-center .control-center-list .notification .notification-default-action:hover, .control-center .control-center-list .notification .notification-action:hover { background-color: $button-bg; } .blank-window { /* Window behind control center and on all other monitors */ background: transparent; } .floating-notifications { background: transparent; } .floating-notifications .notification { box-shadow: none; } /*** Widgets ***/ /* Title widget */ .widget-title { color: $text-color; margin: $widget-margin; font-size: 1.5rem; } .widget-title>button { font-size: initial; color: $text-color; text-shadow: none; background: $button-bg; border: 1px solid $dark_1; box-shadow: none; border-radius: $radii; } .widget-title>button:hover { background: $button-bg; } /* DND widget */ .widget-dnd { color: $text-color; margin: $widget-margin; font-size: 1.1rem; } .widget-dnd>switch { font-size: initial; border-radius: $radii; background: $grid-bg; border: 1px solid $dark_1; box-shadow: none; } .widget-dnd>switch:checked { background: $bg-selected; color: white; } .widget-dnd>switch slider { background: $button-bg; border-radius: $radii; } /* Label widget */ .widget-label { margin: $widget-margin; margin-left: $widget-margin*2; } .widget-label>label { font-weight: bold; font-size: 1.5em; } /* Mpris widget */ $mpris-album-art-overlay: rgba(0, 0, 0, 0.55); $mpris-button-hover: rgba(0, 0, 0, 0.50); .widget-mpris { /* The parent to all players */ } .widget-mpris .widget-mpris-player { padding: $widget-padding; margin: $widget-margin $widget-margin; background-color: $mpris-album-art-overlay; border-radius: $widget-radii; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); } .widget-mpris .widget-mpris-player button:hover { /* The media player buttons (play, pause, next, etc...) */ background: $button-bg; } .widget-mpris .widget-mpris-player .widget-mpris-album-art { border-radius: $radii; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); } .widget-mpris .widget-mpris-player .widget-mpris-title { font-weight: bold; font-size: 1.25rem; } .widget-mpris .widget-mpris-player .widget-mpris-subtitle { font-size: 1.1rem; } .widget-mpris .widget-mpris-player>box>button { /* Change player control buttons */ } .widget-mpris .widget-mpris-player>box>button:hover { background-color: $mpris-button-hover; } .widget-mpris>box>button { /* Change player side buttons */ } .widget-mpris>box>button:disabled { /* Change player side buttons insensitive */ } /* Buttons widget */ .widget-buttons-grid { padding: $widget-padding; margin: $widget-margin; border-radius: $widget-radii; background-color: $grid-bg; } .widget-buttons-grid>flowbox>flowboxchild>button { background: $button-bg; border-radius: $radii; } .widget-buttons-grid>flowbox>flowboxchild>button.toggle:checked { /* style given to the active toggle button */ } /* Menubar widget */ .widget-menubar>box>.menu-button-bar>button { border: none; background: transparent; } /* .AnyName { Name defined in config after # background-color: $noti-bg; padding: 8px; margin: 8px; border-radius: 12px; } .AnyName>button { background: transparent; border: none; } .AnyName>button:hover { background-color: $noti-bg-hover; } */ .topbar-buttons>button { /* Name defined in config after # */ border: none; background: transparent; } /* Volume widget */ .widget-volume, .widget-backlight { background-color: $grid-bg; padding: $widget-padding; padding-left: $widget-padding*2; margin: $widget-margin; margin-left: $widget-margin; margin-right: $widget-margin; border-radius: $widget-radii; } .widget-volume { margin-top: 0; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .widget-backlight { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; } .widget-volume>box>button { background: transparent; border: none; } .per-app-volume { padding: 4px 8px 8px 8px; margin: 0px 8px 8px 8px; border-radius: $radii; } /* Inhibitors widget */ .widget-inhibitors { margin: $widget-margin; font-size: 1.5rem; } .widget-inhibitors>button { font-size: initial; color: $text-color; text-shadow: none; background: $grid-bg; border: 1px solid $dark_1; box-shadow: none; border-radius: $radii; } .widget-inhibitors>button:hover { background: $button-bg; } ================================================ FILE: cfg/swaync/catppuccin-mocha/config.json ================================================ { "$schema": "./configSchema.json", "positionX": "right", "positionY": "top", "control-center-margin-top": 0, "control-center-margin-bottom": 0, "control-center-margin-right": 0, "control-center-margin-left": 0, "notification-icon-size": 64, "notification-body-image-height": 100, "notification-body-image-width": 200, "timeout": 10, "timeout-low": 5, "timeout-critical": 0, "fit-to-screen": false, "control-center-width": 500, "control-center-height": 800, "notification-window-width": 500, "keyboard-shortcuts": true, "image-visibility": "when-available", "transition-time": 200, "hide-on-clear": false, "hide-on-action": true, "script-fail-notify": true, "scripts": { "example-script": { "exec": "echo 'Do something...'", "urgency": "Normal" } }, "notification-visibility": { "example-name": { "state": "muted", "urgency": "Low", "app-name": "Spotify" } }, "widgets": [ "label", "buttons-grid", "volume", "backlight", "title", "dnd", "notifications", "mpris" ], "widget-config": { "title": { "text": "Notifications", "clear-all-button": true, "button-text": "Clear All" }, "dnd": { "text": "Do Not Disturb" }, "label": { "max-lines": 1, "text": "Control Center" }, "mpris": { "image-size": 96, "image-radius": 12 }, "backlight": { "label": "", "device": "intel_backlight", "min": 10 }, "backlight#KB": { "label": " ", "device": "asus::kbd_backlight", "subsystem": "leds" }, "volume": { "label": "" }, "menubar#label": { "menu#power-buttons": { "label": "", "position": "right", "actions": [ { "label": " Reboot", "command": "systemctl reboot" }, { "label": " Lock", "command": "hyprlock" }, { "label": " Logout", "command": "hyprctl exit" }, { "label": " Shut down", "command": "systemctl poweroff" } ] }, "buttons#topbar-buttons": { "position": "left", "actions": [ { "label": "", "command": "grim" }, { "label": "", "command": "grim" } ] } }, "buttons-grid": { "actions": [ { "label": "", "command": "/home/martin/.dots/scripts/wifipower.sh" }, { "label": "", "command": "/home/martin/.dots/scripts/blepower.sh" }, { "label": "󰒲", "command": "/home/martin/.dots/scripts/sleep.sh" }, { "label": "󰚰", "command": "/home/martin/.dots/scripts/update.sh" }, { "label": "", "command": "/home/martin/.dots/scripts/update.sh" }, { "label": "󰚰", "command": "/home/martin/.dots/scripts/update.sh" } ] } } } ================================================ FILE: cfg/swaync/catppuccin-mocha/configSchema.json ================================================ { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "SwayNotificationCenter JSON schema", "type": "object", "additionalProperties": false, "properties": { "$schema": { "type": "string", "description": "Pointer to the schema against which this document should be validated." }, "positionX": { "type": "string", "description": "Horizontal position of control center and notification window", "default": "right", "enum": ["right", "left", "center"] }, "layer": { "type": "string", "description": "Layer of notification window", "default": "overlay", "enum": ["background", "bottom", "top", "overlay"] }, "layer-shell": { "type": "boolean", "description": "Wether or not the windows should be opened as layer-shell surfaces. Note: Requires swaync restart to apply", "default": true }, "cssPriority": { "type": "string", "description": "Which GTK priority to use when loading the default and user CSS files. Pick \"user\" to override XDG_CONFIG_HOME/gtk-3.0/gtk.css", "default": "user", "enum": ["user"] }, "positionY": { "type": "string", "description": "Vertical position of control center and notification window", "default": "top", "enum": ["top", "center", "bottom"] }, "control-center-positionX": { "type": "string", "description": "Optional: Horizontal position of the control center. Supersedes positionX if not set to `none`", "default": "none", "enum": ["right", "left", "center", "none"] }, "control-center-positionY": { "type": "string", "description": "Optional: Vertical position of the control center. Supersedes positionY if not set to `none`", "default": "none", "enum": ["top", "bottom", "none"] }, "control-center-margin-top": { "type": "integer", "description": "The margin (in pixels) at the top of the control center. 0 to disable", "default": 0 }, "control-center-margin-bottom": { "type": "integer", "description": "The margin (in pixels) at the bottom of the control center. 0 to disable", "default": 0 }, "control-center-margin-right": { "type": "integer", "description": "The margin (in pixels) at the right of the control center. 0 to disable", "default": 0 }, "control-center-margin-left": { "type": "integer", "description": "The margin (in pixels) at the left of the control center. 0 to disable", "default": 0 }, "control-center-layer": { "type": "string", "description": "Layer of control center window", "default": "none", "enum": ["background", "bottom", "top", "overlay", "none"] }, "control-center-exclusive-zone": { "type": "boolean", "description": "Whether or not the control center should follow the compositors exclusive zones. An example would be setting it to \"false\" to cover your panel/dock.", "default": true }, "notification-2fa-action": { "type": "boolean", "description": "If each notification should display a 'COPY \"1234\"' action", "default": true }, "notification-inline-replies": { "type": "boolean", "description": "If notifications should display a text field to reply if the sender requests it. NOTE: Replying in popup notifications is only available if the compositor supports GTK Layer-Shell ON_DEMAND keyboard interactivity.", "default": false }, "notification-icon-size": { "type": "integer", "description": "The notification icon size (in pixels). The app icon size is 1/3", "default": 64, "minimum": 16 }, "notification-body-image-height": { "type": "integer", "description": "The notification body image height (in pixels)", "default": 100, "minimum": 100 }, "notification-body-image-width": { "type": "integer", "description": "The notification body image width (in pixels)", "default": 200, "minimum": 200 }, "timeout": { "type": "integer", "description": "The notification timeout for notifications with normal priority", "default": 10 }, "timeout-low": { "type": "integer", "description": "The notification timeout for notifications with low priority", "default": 5 }, "timeout-critical": { "type": "integer", "description": "The notification timeout for notifications with critical priority. 0 to disable", "default": 0 }, "notification-window-width": { "type": "integer", "description": "Width of the notification in pixels", "default": 500 }, "fit-to-screen": { "type": "boolean", "description": "If the control center should expand to both edges of the screen", "default": true }, "relative-timestamps": { "type": "boolean", "description": "Display notification timestamps relative to now e.g. \"26 minutes ago\". If false, a local iso8601-formatted absolute timestamp is displayed.", "default": true }, "control-center-height": { "type": "integer", "description": "Height of the control center in pixels. Ignored when 'fit-to-screen' is set to 'true'", "default": 600, "minimum": 300 }, "control-center-width": { "type": "integer", "description": "Width of the control center in pixels", "default": 500, "minimum": 300 }, "keyboard-shortcuts": { "type": "boolean", "description": "If control center should use keyboard shortcuts", "default": true }, "image-visibility": { "type": "string", "description": "The notification image visibility when no icon is available.", "default": "when-available", "enum": ["always", "when-available", "never"] }, "transition-time": { "type": "integer", "description": "The notification animation duration. 0 to disable", "default": 200 }, "hide-on-clear": { "type": "boolean", "description": "Hides the control center after pressing \"Clear All\"", "default": false }, "hide-on-action": { "type": "boolean", "description": "Hides the control center when clicking on notification action", "default": true }, "script-fail-notify": { "type": "boolean", "description": "Sends a notification if a script fails to run", "default": true }, "scripts": { "type": "object", "description": "Which scripts to check and potentially run for every notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for exec) use regex. If all properties match the given notification, the script will be run. Only the first matching script will be run.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^.{1,}$": { "type": "object", "description": "Your script object.", "required": ["exec"], "minProperties": 2, "additionalProperties": false, "properties": { "exec": { "type": "string", "description": "The script to run. Can also run regular shell commands." }, "app-name": { "type": "string", "description": "The app-name. Uses Regex." }, "desktop-entry": { "type": "string", "description": "The desktop-entry. Uses Regex." }, "summary": { "type": "string", "description": "The summary of the notification. Uses Regex." }, "body": { "type": "string", "description": "The body of the notification. Uses Regex." }, "urgency": { "type": "string", "description": "The urgency of the notification.", "default": "Normal", "enum": ["Low", "Normal", "Critical"] }, "category": { "type": "string", "description": "Which category the notification belongs to. Uses Regex." }, "run-on": { "type": "string", "description": "Whether to run the script on an action being activated, or when the notification is received.", "enum": ["action", "receive"], "default": "receive" } } } } }, "notification-visibility": { "type": "object", "description": "Set the visibility of each incoming notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for state) use regex. If all properties match the given notification, the notification will be follow the provided state. Only the first matching object will be used.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^.{1,}$": { "type": "object", "description": "Your script object.", "required": ["state"], "minProperties": 2, "additionalProperties": false, "properties": { "state": { "type": "string", "description": "The notification visibility state.", "default": "enabled", "enum": ["ignored", "muted", "enabled", "transient"] }, "app-name": { "type": "string", "description": "The app-name. Uses Regex." }, "desktop-entry": { "type": "string", "description": "The desktop-entry. Uses Regex." }, "summary": { "type": "string", "description": "The summary of the notification. Uses Regex." }, "body": { "type": "string", "description": "The body of the notification. Uses Regex." }, "urgency": { "type": "string", "description": "The urgency of the notification.", "default": "Normal", "enum": ["Low", "Normal", "Critical"] }, "override-urgency": { "type": "string", "description": "The new urgency of the notification (optional)", "default": "unset", "enum": ["unset", "low", "normal", "critical"] }, "category": { "type": "string", "description": "Which category the notification belongs to. Uses Regex." } } } } }, "widgets": { "type": "array", "description": "Which order and which widgets to display. If the \"notifications\" widget isn't specified, it will be placed at the bottom.", "default": ["inhibitors", "title", "dnd", "notifications"], "items": { "type": "string", "$comment": "Sadly can't use regex and enums at the same time. Fix in the future?", "pattern": "^[a-zA-Z0-9_-]{1,}(#[a-zA-Z0-9_-]{1,}){0,1}?$" } }, "widget-config": { "type": "object", "description": "Configure specific widget properties.", "additionalProperties": false, "$comment": "New widgets go here in \"patternProperties\" ↓", "patternProperties": { "^title(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$comment": "References the widget structure from \"widgets\" below", "$ref": "#/widgets/title" }, "^dnd(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/dnd" }, "^label(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/label" }, "^mpris(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/mpris" }, "^buttons-grid(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/buttons-grid" }, "^menubar(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/menubar" }, "^volume(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/volume" }, "^backlight(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$ref": "#/widgets/backlight" }, "^inhibitors(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "$comment": "References the widget structure from \"widgets\" below", "$ref": "#/widgets/inhibitors" } } } }, "widgets": { "$comment": "New widgets go here", "title": { "type": "object", "description": "Control Center Title Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Notifications" }, "clear-all-button": { "type": "boolean", "description": "Wether to display a \"Clear All\" button", "default": true }, "button-text": { "type": "string", "description": "\"Clear All\" button text", "default": "Clear All" } } }, "dnd": { "type": "object", "description": "Control Center Do Not Disturb Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Do Not Disturb" } } }, "label": { "type": "object", "description": "A generic widget that allows the user to add custom text", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The text content of the widget", "default": "Label Text" }, "max-lines": { "type": "integer", "description": "The maximum lines", "default": 5 } } }, "mpris": { "type": "object", "description": "A widget that displays multiple music players", "additionalProperties": false, "properties": { "image-size": { "type": "integer", "description": "The size of the album art", "default": 96 }, "image-radius": { "type": "integer", "description": "The border radius of the album art. Will be overriden by setting the border-radius in the style.css for the \".widget-mpris-album-art\" class", "default": 12 }, "blur": { "type": "bool", "description": "Appy the artwork as the MPRIS background and blur it", "default": true } } }, "buttons-grid": { "type": "object", "description": "A widget to add a grid of buttons that execute shell commands", "additionalProperties": false, "properties": { "actions": { "type": "array", "description": "A list of actions containing a label and a command", "items": { "type": "object", "properties": { "label": { "type": "string", "description": "Text to be displayed in button", "default": "label" }, "command": { "type": "string", "description": "Command to be executed on click", "default": "" }, "type": { "type": "string", "description": "Type of the button; toggle buttons receive the .active css class and an env variable 'SWAYNC_TOGGLE_STATE' is set. See example in the default config.json", "default": "normal", "enum": ["normal", "toggle"] }, "update-command": { "type": "string", "description": "Command to be executed on visibility change of cc to update the active state of the toggle button (should echo true or false)", "default": "" }, "active": { "type": "bool", "description": "Wether the toggle button is active as default or not", "default": false } } } } } }, "menubar": { "type": "object", "description": "A bar that contains action-buttons and buttons to open a dropdown with action-buttons", "additionalProperties": false, "patternProperties": { "^menu(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "type": "object", "description": "A button that opens a dropdown with action-buttons", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text to be displayed in button", "default": "Menu" }, "position": { "type": "string", "description": "Horizontal position of the button in the bar", "default": "right", "enum": ["right", "left"] }, "animation-type": { "type": "string", "default": "slide_down", "description": "Animation type for menu", "enum": ["slide_down", "slide_up", "none"] }, "animation-duration":{ "type": "integer", "default": 250, "description": "Duration of animation in milliseconds" }, "actions": { "$ref" : "#/widgets/buttons-grid/properties/actions" } } }, "^buttons(#[a-zA-Z0-9_-]{1,}){0,1}?$": { "type": "object", "description": "A list of action-buttons to be displayed in the topbar", "additionalProperties": false, "properties": { "position": { "type": "string", "description": "Horizontal position of the button in the bar", "default": "right", "enum": ["right", "left"] }, "actions": { "$ref" : "#/widgets/buttons-grid/properties/actions" } } } } }, "volume": { "type": "object", "description": "Slider to control pulse volume", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text displayed in front of the volume slider", "default": "Volume" }, "show-per-app": { "type": "boolean", "default": false, "description": "Show per app volume control" }, "show-per-app-icon": { "type": "boolean", "default": true, "description": "Show application icon in per app control" }, "show-per-app-label": { "type": "boolean", "default": false, "description": "Show application name in per app control" }, "empty-list-label": { "type": "string", "default": "No active sink input", "description": "Text displayed when there are not active sink inputs" }, "expand-button-label": { "type": "string", "default": "⇧", "description": "Label displayed on button to show per app volume control" }, "collapse-button-label": { "type": "string", "default": "⇩", "description": "Label displayed on button to hide per app volume control" }, "icon-size": { "type": "integer", "default": 24, "description": "Size of the application icon in per app volume control" }, "animation-type": { "type": "string", "default": "slide_down", "description": "Animation type for menu", "enum": ["slide_down", "slide_up", "none"] }, "animation-duration":{ "type": "integer", "default": 250, "description": "Duration of animation in milliseconds" } } }, "backlight": { "type": "object", "description": "Slider to control monitor brightness", "additionalProperties": false, "properties": { "label": { "type": "string", "description": "Text displayed in front of the backlight slider", "default": "Brightness" }, "device": { "type": "string", "description": "Name of monitor (find possible devices using `ls /sys/class/backlight` or `ls /sys/class/leds`)", "default": "intel_backlight" }, "subsystem": { "type": "string", "description": "Kernel subsystem for brightness control", "default": "backlight", "enum": ["backlight", "leds"] }, "min": { "type": "integer", "default": 0, "description": "Lowest possible value for brightness" } } }, "inhibitors": { "type": "object", "description": "Control Center Inhibitors Widget", "additionalProperties": false, "properties": { "text": { "type": "string", "description": "The title of the widget", "default": "Inhibitors" }, "clear-all-button": { "type": "boolean", "description": "Wether to display a \"Clear All\" button", "default": true }, "button-text": { "type": "string", "description": "\"Clear All\" button text", "default": "Clear All" } } } } } ================================================ FILE: cfg/swaync/catppuccin-mocha/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha sassc $HOME/.config/swaync/style-catppuccin-mocha.scss $HOME/.config/swaync/style.css swaync-client -R swaync-client -rs swaync-client -t ================================================ FILE: cfg/swaync/catppuccin-mocha/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; .text-button:hover, .text-button.control-center-clear-all:hover { color: $color-fg; background-color: $button-bg-focus; transition: linear 0.25s; } .notification-row { outline: none; } .notification-row:focus, .notification-row:hover { background: $button-bg-focus; } .notification-row .notification-background { padding: $widget-margin $widget-margin; } .notification-row .notification-background .close-button { /* The notification Close Button */ background: $grid-bg; color: $text-color; text-shadow: none; padding: 0; border-radius: 100%; margin-top: $spacing; margin-right: $spacing; box-shadow: none; border: none; min-width: $font-size*1.5; min-height: $font-size*1.5; } .notification-row .notification-background .close-button:hover { box-shadow: none; background: $close-button-bg; transition: background 0.15s ease-in-out; border: none; } .notification-row .notification-background .notification { /* The actual notification */ border-radius: $radii; border: $widget-border; border-radius: $radii; padding: 0; transition: background 0.15s ease-in-out; background: $widget-bg; } .notification-row .notification-background .notification.low { /* Low Priority Notification */ } .notification-row .notification-background .notification.normal { /* Normal Priority Notification */ } .notification-row .notification-background .notification.critical { /* Critical Priority Notification */ } .notification-row .notification-background .notification .notification-action, .notification-row .notification-background .notification .notification-default-action { padding: 0px; margin: 0; box-shadow: none; background: transparent; border: none; color: $text-color; transition: background 0.15s ease-in-out; } .notification-row .notification-background .notification .notification-action:hover, .notification-row .notification-background .notification .notification-default-action:hover { -gtk-icon-effect: none; background: $button-bg; } .notification-row .notification-background .notification .notification-default-action { /* The large action that also displays the notification summary and body */ border-radius: $radii; } .notification-row .notification-background .notification .notification-default-action:not(:only-child) { /* When alternative actions are visible */ border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; } .notification-row .notification-background .notification .notification-default-action .notification-content { background: transparent; border-radius: $radii; padding: $spacing; padding-right: $spacing*3; } .notification-row .notification-background .notification .notification-default-action .notification-content .image { /* Notification Primary Image */ -gtk-icon-effect: none; border-radius: $radii; /* Size in px */ margin: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .app-icon { /* Notification app icon (only visible when the primary image is set) */ -gtk-icon-effect: none; -gtk-icon-shadow: 0 1px 4px black; margin: $spacing*2; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .summary { /* Notification summary/title */ font-size: 1.1em; font-weight: bolder; background: transparent; color: $text-color; text-shadow: none; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .time { /* Notification time-ago */ font-size: 1.1em; font-weight: bolder; background: transparent; color: $text-color; text-shadow: none; margin-right: $spacing*10; } .notification-row .notification-background .notification .notification-default-action .notification-content .text-box .body { /* Notification body */ font-size: 1.1em; font-weight: normal; background: transparent; color: $text-color; text-shadow: none; } .notification-row .notification-background .notification .notification-default-action .notification-content progressbar { /* The optional notification progress bar */ margin-top: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .body-image { /* The "extra" optional bottom notification image */ margin-top: $spacing; background-color: $text-color; border-radius: $radii; -gtk-icon-effect: none; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply { /* The inline reply section */ margin-top: $spacing; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-entry { background: $button-bg-darker; color: $text-color; caret-color: $text-color; border: 1px solid $dark_1; border-radius: $radii; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button { margin-left: $spacing; background: $grid-bg; border: 1px solid $dark_1; border-radius: $radii; color: $text-color; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button:disabled { background: initial; color: $text-color-disabled; border: 1px solid $dark_1; border-color: transparent; } .notification-row .notification-background .notification .notification-default-action .notification-content .inline-reply .inline-reply-button:hover { background: $button-bg; } .notification-row .notification-background .notification .notification-action { /* The alternative actions below the default action */ border-top: 1px solid $dark_1; border-radius: 0px; border-right: 1px solid $dark_1; } .notification-row .notification-background .notification .notification-action:first-child { /* add bottom border radius to eliminate clipping */ border-bottom-left-radius: $radii; } .notification-row .notification-background .notification .notification-action:last-child { border-bottom-right-radius: $radii; border-right: none; } .notification-group { /* Styling only for Grouped Notifications */ } .notification-group.low { /* Low Priority Group */ } .notification-group.normal { /* Low Priority Group */ } .notification-group.critical { /* Low Priority Group */ } .notification-group .notification-group-buttons, .notification-group .notification-group-headers { margin: 0 16px; color: $text-color; } .notification-group .notification-group-headers { /* Notification Group Headers */ } .notification-group .notification-group-headers .notification-group-icon { color: $text-color; } .notification-group .notification-group-headers .notification-group-header { color: $text-color; } .notification-group .notification-group-buttons { /* Notification Group Buttons */ } .notification-group.collapsed .notification-row .notification { background-color: $button-bg; } .notification-group.collapsed .notification-row:not(:last-child) { /* Top notification in stack */ /* Set lower stacked notifications opacity to 0 */ } .notification-group.collapsed .notification-row:not(:last-child) .notification-action, .notification-group.collapsed .notification-row:not(:last-child) .notification-default-action { opacity: 0; } .notification-group.collapsed:hover .notification-row:not(:only-child) .notification { background-color: $button-bg; } .control-center { /* The Control Center which contains the old notifications + widgets */ background: $widget-bg; color: $text-color; margin: $widget-margin; border: $widget-border; border-radius: $widget-radii; } .control-center .control-center-list-placeholder { /* The placeholder when there are no notifications */ opacity: 0.5; } .control-center .control-center-list { /* List of notifications */ background: transparent; } .control-center .control-center-list .notification { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), 0 2px 6px 2px rgba(0, 0, 0, 0.3); } .control-center .control-center-list .notification .notification-default-action, .control-center .control-center-list .notification .notification-action { transition: opacity 400ms ease-in-out, background 0.15s ease-in-out; } .control-center .control-center-list .notification .notification-default-action:hover, .control-center .control-center-list .notification .notification-action:hover { background-color: $button-bg; } .blank-window { /* Window behind control center and on all other monitors */ background: transparent; } .floating-notifications { background: transparent; } .floating-notifications .notification { box-shadow: none; } /*** Widgets ***/ /* Title widget */ .widget-title { color: $text-color; margin: $widget-margin; font-size: 1.5rem; } .widget-title>button { font-size: initial; color: $text-color; text-shadow: none; background: $button-bg; border: 1px solid $dark_1; box-shadow: none; border-radius: $radii; } .widget-title>button:hover { background: $button-bg; } /* DND widget */ .widget-dnd { color: $text-color; margin: $widget-margin; font-size: 1.1rem; } .widget-dnd>switch { font-size: initial; border-radius: $radii; background: $grid-bg; border: 1px solid $dark_1; box-shadow: none; } .widget-dnd>switch:checked { background: $bg-selected; color: white; } .widget-dnd>switch slider { background: $button-bg; border-radius: $radii; } /* Label widget */ .widget-label { margin: $widget-margin; margin-left: $widget-margin*2; } .widget-label>label { font-weight: bold; font-size: 1.5em; } /* Mpris widget */ $mpris-album-art-overlay: rgba(0, 0, 0, 0.55); $mpris-button-hover: rgba(0, 0, 0, 0.50); .widget-mpris { /* The parent to all players */ } .widget-mpris .widget-mpris-player { padding: $widget-padding; margin: $widget-margin $widget-margin; background-color: $mpris-album-art-overlay; border-radius: $widget-radii; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); } .widget-mpris .widget-mpris-player button:hover { /* The media player buttons (play, pause, next, etc...) */ background: $button-bg; } .widget-mpris .widget-mpris-player .widget-mpris-album-art { border-radius: $radii; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75); } .widget-mpris .widget-mpris-player .widget-mpris-title { font-weight: bold; font-size: 1.25rem; } .widget-mpris .widget-mpris-player .widget-mpris-subtitle { font-size: 1.1rem; } .widget-mpris .widget-mpris-player>box>button { /* Change player control buttons */ } .widget-mpris .widget-mpris-player>box>button:hover { background-color: $mpris-button-hover; } .widget-mpris>box>button { /* Change player side buttons */ } .widget-mpris>box>button:disabled { /* Change player side buttons insensitive */ } /* Buttons widget */ .widget-buttons-grid { padding: $widget-padding; margin: $widget-margin; border-radius: $widget-radii; background-color: $grid-bg; } .widget-buttons-grid>flowbox>flowboxchild>button { background: $button-bg; border-radius: $radii; } .widget-buttons-grid>flowbox>flowboxchild>button.toggle:checked { /* style given to the active toggle button */ } /* Menubar widget */ .widget-menubar>box>.menu-button-bar>button { border: none; background: transparent; } /* .AnyName { Name defined in config after # background-color: $noti-bg; padding: 8px; margin: 8px; border-radius: 12px; } .AnyName>button { background: transparent; border: none; } .AnyName>button:hover { background-color: $noti-bg-hover; } */ .topbar-buttons>button { /* Name defined in config after # */ border: none; background: transparent; } /* Volume widget */ .widget-volume, .widget-backlight { background-color: $grid-bg; padding: $widget-padding; padding-left: $widget-padding*2; margin: $widget-margin; margin-left: $widget-margin; margin-right: $widget-margin; border-radius: $widget-radii; } .widget-volume { margin-top: 0; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .widget-backlight { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; } .widget-volume>box>button { background: transparent; border: none; } .per-app-volume { padding: 4px 8px 8px 8px; margin: 0px 8px 8px 8px; border-radius: $radii; } /* Inhibitors widget */ .widget-inhibitors { margin: $widget-margin; font-size: 1.5rem; } .widget-inhibitors>button { font-size: initial; color: $text-color; text-shadow: none; background: $grid-bg; border: 1px solid $dark_1; box-shadow: none; border-radius: $radii; } .widget-inhibitors>button:hover { background: $button-bg; } ================================================ FILE: cfg/themes/adwaita.scss ================================================ // When color definition differs for dark and light variant // it gets @if ed depending on $variant $variant: 'dark'; $font-size: 13pt; $blue: #3584e4; $green: #33d17a; $yellow: #f6d32d; $orange: #ff7800; $red: #e01b24; $purple: #9141ac; $brown: #986a44; $dark_1: #77767b; $dark_3 :#3d3846; $radii: 10px; $widget-radii: $radii*2.5; $spacing: 3px; $border: solid 2px; $widget-margin: $spacing*4; $widget-padding: $spacing*3; $bar-bg: #171717; $widget-bg: #171717; $grid-bg: lighten(#171717, 7%); $button-bg: lighten(#171717, 15%); $button-bg-darker: #171717; $button-bg-focus: #9A9A9A; $close-button-bg:#666666; $widget-border: $border $dark_1; $color-fg: #171717; $text-color-disabled: #000000; $bg-selected: $blue; $base_color: if($variant == 'light', #ffffff, lighten(desaturate(#241f31, 100%), 2%)); $text_color: if($variant == 'light', black, white); $bg_color: if($variant == 'light', #f6f5f4, darken(desaturate(#3d3846, 100%), 4%)); $fg_color: if($variant == 'light', #2e3436, #eeeeec); $selected_fg_color: #ffffff; $selected_bg_color: if($variant == 'light', #3584e4, darken(#3584e4, 20%)); $selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%)); $borders_color: if($variant == 'light', darken($bg_color, 18%), darken($bg_color, 10%)); $alt_borders_color: if($variant == 'light', darken($bg_color, 24%), darken($bg_color, 18%)); $borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93)); $link_color: if($variant == 'light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 20%)); $link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), lighten($selected_bg_color, 10%)); $top_hilight: $borders_edge; $dark_fill: mix($borders_color, $bg_color, 50%); $headerbar_color: if($variant == 'light', lighten($bg_color, 5%), darken($bg_color, 3%)); $menu_color: if($variant == 'light', $base_color, mix($bg_color, $base_color, 20%)); $popover_bg_color: $bg_color; $popover_hover_color: lighten($bg_color, 5%); $scrollbar_bg_color: if($variant == 'light', mix($bg_color, $fg_color, 80%), mix($base_color, $bg_color, 50%)); $scrollbar_slider_color: mix($fg_color, $bg_color, 60%); $scrollbar_slider_hover_color: mix($fg_color, $bg_color, 80%); $scrollbar_slider_active_color: if($variant=='light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 10%)); $warning_color: #f57900; $error_color: #cc0000; $success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%)); $destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%)); $osd_fg_color: #eeeeec; $osd_text_color: white; $osd_bg_color: if($variant == 'light', transparentize(darken(desaturate(#3d3846, 100%), 4%),0.1), transparentize(darken(desaturate(#3d3846, 100%), 10%),0.1)); $osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5); $osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%); $osd_borders_color: transparentize(black, 0.3); $sidebar_bg_color: mix($bg_color, $base_color, 50%); $base_hover_color: transparentize($fg_color, 0.95); $tooltip_borders_color: transparentize(white, 0.9); $shadow_color: transparentize(black, 0.9); $drop_target_color: #4e9a06; //insensitive state derived colors $insensitive_fg_color: mix($fg_color, $bg_color, 50%); $insensitive_bg_color: mix($bg_color, $base_color, 60%); $insensitive_borders_color: $borders_color; //colors for the backdrop state, derived from the main colors. $backdrop_base_color: if($variant == 'light', darken($base_color, 1%), lighten($base_color, 1%)); $backdrop_text_color: mix($text_color, $backdrop_base_color, 80%); $backdrop_bg_color: $bg_color; $backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 50%); $backdrop_insensitive_color: if($variant == 'light', darken($backdrop_bg_color, 15%), lighten($backdrop_bg_color, 15%)); $backdrop_selected_fg_color: if($variant == 'light', $backdrop_base_color, $backdrop_text_color); $backdrop_borders_color: mix($borders_color, $bg_color, 80%); $backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%); $backdrop_sidebar_bg_color: mix($backdrop_bg_color, $backdrop_base_color, 50%); $backdrop_scrollbar_bg_color: darken($backdrop_bg_color, 3%); $backdrop_scrollbar_slider_color: mix($backdrop_fg_color, $backdrop_bg_color, 40%); $backdrop_menu_color: if($variant == 'light', $backdrop_base_color, mix($backdrop_bg_color, $backdrop_base_color, 20%)); //special cased widget colors $suggested_bg_color: $selected_bg_color; $suggested_border_color: $selected_borders_color; $progress_bg_color: $selected_bg_color; $progress_border_color: $selected_borders_color; $checkradio_bg_color: if($variant == 'light', $selected_bg_color, lighten($selected_bg_color,10%)); $checkradio_fg_color: $selected_fg_color; $checkradio_borders_color: if($variant == 'light', darken($checkradio_bg_color,20%), darken($checkradio_bg_color,40%)); ================================================ FILE: cfg/themes/catppuccin-mocha.scss ================================================ $variant: "dark"; $font-size: 13pt; $orange: #ff7800; $purple: #9141ac; $brown: #986a44; $dark_1: #77767b; $dark_3: #3d3846; $blue: #89b4fa; $lavender: #b4befe; $sapphire: #74c7ec; $sky: #89dceb; $teal: #94e2d5; $green: #a6e3a1; $yellow: #f9e2af; $peach: #fab387; $maroon: #eba0ac; $red: #f38ba8; $mauve: #cba6f7; $pink: #f5c2e7; $flamingo: #f2cdcd; $rosewater: #f5e0dc; $base: #1e1e2e; $mantle: #181825; $crust: #11111b; $text: #cdd6f4; $subtext0: #a6adc8; $subtext1: #bac2de; $surface0: #313244; $surface1: #45475a; $surface2: #585b70; $overlay0: #6c7086; $overlay1: #7f849c; $overlay2: #9399b2; $radii: 10px; $widget-radii: $radii*2.5; $spacing: 3px; $border: solid 2px; $widget-margin: $spacing*4; $widget-padding: $spacing*3; $bar-bg: $crust; $widget-bg: $crust; $grid-bg: lighten($crust, 7%); $button-bg: lighten($crust, 15%); $button-bg-darker: $crust; $button-bg-focus: $overlay2; $close-button-bg: $overlay2; $widget-border: $border $blue; $color-fg: $crust; $text-color-disabled: #000000; $bg-selected: $blue; $selected-bg-color: $overlay2; $base_color: if($variant =='light', #ffffff, lighten(desaturate(#241f31, 100%), 2%)); $text_color: if($variant =='light', black, white); $bg_color: if($variant =='light', #f6f5f4, darken(desaturate(#3d3846, 100%), 4%)); $fg_color: if($variant =='light', #2e3436, #eeeeec); ================================================ FILE: cfg/themeswitcher/config.jsonc ================================================ { "title": "ThemeSwitcher", "name": "Rocco Rakete", "menus": [ { "name": "Waybar Themes", "options": [ "Catppuccin-Mocha - docked bar - color buttons", "Catppuccin-Mocha - docked bar - flat butons", "Catppuccin-Mocha - docked bar", "Adwaita-dark - floating bar" ], "commands": [ [ "sh -c \"rm -rf ~/.config/waybar/*\"", "sh -c \"cp -r ~/.dots/cfg/waybar/scripts/ ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/waybar/catppuccin-mocha-docked-color-buttons/* ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/waybar/catppuccin-mocha.scss\"" ], [ "sh -c \"rm -rf ~/.config/waybar/*\"", "sh -c \"cp -r ~/.dots/cfg/waybar/scripts/ ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/waybar/catppuccin-mocha-docked-flat-buttons/* ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/waybar/catppuccin-mocha.scss\"" ], [ "sh -c \"rm -rf ~/.config/waybar/*\"", "sh -c \"cp -r ~/.dots/cfg/waybar/scripts/ ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/waybar/catppuccin-mocha-docked/* ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/waybar/catppuccin-mocha.scss\"" ], [ "sh -c \"rm -rf ~/.config/waybar/*\"", "sh -c \"cp -r ~/.dots/cfg/waybar/scripts/ ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/waybar/adwaita-dark/* ~/.config/waybar/\"", "sh -c \"cp ~/.dots/cfg/themes/adwaita.scss ~/.config/waybar/adwaita.scss\"" ] ] }, { "name": "Anyrun Themes", "options": [ "Catppuccin-Mocha", "Adwaita-dark" ], "commands": [ [ "sh -c \"rm -rf ~/.config/anyrun/*\"", "sh -c \"cp -r ~/.dots/cfg/anyrun/plugins/ ~/.config/anyrun/\"", "sh -c \"cp ~/.dots/cfg/anyrun/catppuccin-mocha/* ~/.config/anyrun/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/anyrun/catppuccin-mocha.scss\"" ], [ "sh -c \"rm -rf ~/.config/anyrun/*\"", "sh -c \"cp -r ~/.dots/cfg/anyrun/plugins/ ~/.config/anyrun/\"", "sh -c \"cp ~/.dots/cfg/anyrun/adwaita-dark/* ~/.config/anyrun/\"", "sh -c \"cp ~/.dots/cfg/themes/adwaita.scss ~/.config/anyrun/adwaita.scss\"" ] ] }, { "name": "Walker Themes", "options": [ "Catppuccin-Mocha" ], "commands": [ [ "sh -c \"rm -rf ~/.config/walker/*\"", "sh -c \"cp -r ~/.dots/cfg/walker/plugins/ ~/.config/walker/\"", "sh -c \"cp ~/.dots/cfg/walker/catppuccin-mocha/* ~/.config/walker/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/walker/catppuccin-mocha.scss\"" ] ] }, { "name": "SwayNC Themes", "options": [ "Catppuccin-Mocha", "Adwaita-dark" ], "commands": [ [ "sh -c \"rm -rf ~/.config/swaync/*\"", "sh -c \"cp ~/.dots/cfg/swaync/catppuccin-mocha/* ~/.config/swaync/\"", "sh -c \"cp ~/.dots/cfg/themes/catppuccin-mocha.scss ~/.config/swaync/catppuccin-mocha.scss\"" ], [ "sh -c \"rm -rf ~/.config/swaync/*\"", "sh -c \"cp ~/.dots/cfg/swaync/adwaita-dark/* ~/.config/swaync/\"", "sh -c \"cp ~/.dots/cfg/themes/adwaita.scss ~/.config/swaync/adwaita.scss\"" ] ] }, { "name": "Hyprland Themes", "options": [ "Catppuccin-Mocha", "Adwaita-dark" ], "commands": [ [ "sh -c \"cp ~/.dots/cfg/hypr/catppuccin-mocha/* ~/.config/hypr/\"" ], [ "sh -c \"cp ~/.dots/cfg/hypr/adwaita-dark/* ~/.config/hypr/\"" ] ] } ] } ================================================ FILE: cfg/themeswitcher/styles.css ================================================ .menu-label { font-size: 1.2em; font-weight: bolder; padding-left: 20px; padding-right: 20px; } .menu-dropdown { padding: 10px; padding-left: 20px; padding-right: 20px; } .title-label { padding: 10px; font-size: 2em; font-weight: bolder; background-color: #11111B; } .menu-bar { padding-top: 10px; margin: 0; background-color: #11111B; } ================================================ FILE: cfg/walker/catppuccin-mocha/config.json ================================================ { "activation_mode": { "disabled": false, "use_alt": false }, "align": { "anchors": { "bottom": false, "left": false, "right": false, "top": false }, "horizontal": "center", "ignore_exlusive": true, "margins": { "bottom": 0, "end": 0, "start": 0, "top": 0 }, "vertical": "center", "width": 500 }, "clipboard": { "image_height": 300, "max_entries": 10 }, "enable_typeahead": false, "fullscreen": false, "icons": { "hide": false, "image_height": 200, "size": 32 }, "ignore_mouse": false, "keep_open": false, "list": { "always_show": true, "height": 400, "hide_sub": false, "margin_top": 10 }, "modules": [{ "name": "runner", "prefix": "" }, { "name": "applications", "prefix": "" }, { "name": "ssh", "prefix": "", "switcher_exclusive": true }, { "name": "finder", "prefix": "", "switcher_exclusive": true }, { "name": "commands", "prefix": "", "switcher_exclusive": true }, { "name": "websearch", "prefix": "?" }, { "name": "switcher", "prefix": "/" }], "orientation": "vertical", "placeholder": "Search...", "runner": { "excludes": [ "rm" ] }, "scrollbar_policy": "automatic", "search": { "delay": 0, "hide_icons": false, "hide_spinner": true, "margin_spinner": 10 }, "show_initial_entries": true, "ssh_host_file": "" } ================================================ FILE: cfg/walker/catppuccin-mocha/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha sassc $HOME/.config/walker/style-catppuccin-mocha.scss $HOME/.config/walker/style.css walker ================================================ FILE: cfg/walker/catppuccin-mocha/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; * { font-weight: bolder; } #window { border-radius: $widget-radii; border: $widget-border; } #box { padding: $widget-padding*1.5; } #searchwrapper {} #search, #typeahead { outline: none; outline-width: 0px; box-shadow: none; border-bottom: none; border: none; padding-left: $widget-padding; padding-right: $widget-padding; padding-top: 0px; padding-bottom: 0px; border-radius: $radii/3; } #typeahead { background: none; opacity: 0.5; } #search placeholder { opacity: 0.5; } #list {} row:selected { border-radius: $radii; background-color: transparentize($color: $text, $amount: 0.75); color: black; } .item { padding: $spacing; border-radius: 2px; } .icon { padding-right: $spacing; } .textwrapper {} .label {} .sub { opacity: 0.5; } .activationlabel { opacity: 0.25; } .activation .activationlabel { opacity: 1; color: $green; } .activation .textwrapper, .activation .icon, .activation .search { opacity: 0.5; } #search { border-radius: $radii; } ================================================ FILE: cfg/waybar/adwaita-dark/adwaita-colored-buttons.scss ================================================ @import "./adwaita.scss"; #cpu, #memory, #temperature, #backlight { background-color: transparentize($color: $blue, $amount: 0.3); color: $color-fg; } #battery { background-color: transparentize($color: $red, $amount: 0.3); color: $color-fg; } #tray { background-color: transparentize($color: $yellow, $amount: 0.3); } #network, #pulseaudio, #bluetooth, #custom-notification { background-color: transparentize($color: $purple, $amount: 0.3); color: $color-fg; } #custom-power { background-color: transparentize($color: $green, $amount: 0.3); } ================================================ FILE: cfg/waybar/adwaita-dark/config.jsonc ================================================ { "spacing": 0, "margin-left": 10, "margin-right": 10, "margin-top": 10, //"margin-left": 0, //"margin-right": 0, //"margin-top": 0, "layer": "top", "reload_style_on_change": true, "modules-left": [ "image", "hyprland/workspaces" ], "modules-center": [ "clock" ], "modules-right": [ "cpu", "memory", "temperature", "backlight", "battery", "tray", "network", "bluetooth", "pulseaudio", "custom/notification", "custom/power" ], "image": { "path": "/home/martin/Dokumente/Backgrounds/nixos.png", "size": 20, "interval": 86400, // once every day "on-click": "mpc toggle" }, "hyprland/workspaces": { "format": "{icon}", "tooltip": false, "all-outputs": false, "current-only": true, "sort-by-number": true, "persistent-workspaces": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "format-icons": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "active": "", "default": "" } }, "clock": { "format": "{:%H:%M}", "tooltip-format": "{:%Y %B}\n{calendar}", "format-alt": "{:%d.%m.%y - %H:%M}" }, "cpu": { "format": "{icon}", "format-icons": [ "󰝦", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥" ], "tooltip": false, "interval": 1 }, "memory": { "tooltip": false, "format": "󰆼{used:.1f} GiB" }, "temperature": { "tooltip": false, "thermal-zone": 6, "critical-threshold": 90, "format": "{temperatureC}°C", "interval": 1 }, "backlight": { "tooltip": false, "format": "{icon}{percent}%", "format-icons": [ "", "", "", "", "", "", "", "", "" ] }, "battery": { "states": { "warning": 30, "critical": 15 }, "format": "{icon}", "format-full": "󱐥", "format-charging": "󱐋{capacity}%", "format-plugged": "󱐋{capacity}%", "format-alt": "{icon} {capacity}%", "format-icons": [ " ", " ", " ", " ", " " ], "interval": 1 }, "tray": { "spacing": 6 }, "network": { "format-wifi": "", "format-ethernet": "󰈀", "tooltip-format": "{ifname} ({ipaddr}) via {gwaddr} at\n{essid}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "󰖪", "on-click": "swaync-client -t -sw" }, "bluetooth": { "format": "", "format-disabled": "󰂲", "format-connected": "󰂱", "tooltip-format": "{controller_alias}\t{controller_address}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "on-click": "swaync-client -t -sw" }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{icon} {format_source}", "format-bluetooth": "{icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": "󰸈 {format_source}", "format-source": "", "format-source-muted": "", "format-icons": { "headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", "default": [ "", "", "" ] }, "on-click": "swaync-client -t -sw", "on-click-right": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "󰂟", "none": "", "dnd-notification": "󰺁", "dnd-none": "", "inhibited-notification": "󰂟", "inhibited-none": "", "dnd-inhibited-notification": "󰺁", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, "custom/power": { "format": "", "on-click": "wlogout -b 5 -c 0 -r 0 -T 0 -B 0", "interval": 86400, // once every day "tooltip": true } } ================================================ FILE: cfg/waybar/adwaita-dark/launch.sh ================================================ #!/usr/bin/env sh # Adwaita-Dark is_swww_daemon_running() { if pgrep -x "swww-daemon" > /dev/null then return 0 else exec swww-daemon & return 1 fi } # wait for the swww-daemon while ! is_swww_daemon_running; do echo "wait for swww-daemon" sleep 1 done swww img ~/.config/backgrounds/minimal_landscape.jpg pkill waybar sassc $HOME/.config/waybar/style-adwaita.scss $HOME/.config/waybar/style.css waybar ================================================ FILE: cfg/waybar/adwaita-dark/style-adwaita.scss ================================================ @import "./adwaita.scss"; @import "./adwaita-colored-buttons.scss"; * { padding: 0; margin: 0; font-weight: bolder; } window#waybar { font-size: $font-size; background: $bar-bg; border-radius: $radii; box-shadow: inset -2px -2px 5px 1px (transparentize($color: #000000, $amount: 0.6)), 2px 2px 5px 1px transparentize($color: #000000, $amount: 0.6) inset; } #cpu, #memory, #temperature, #backlight, #network, #bluetooth, #pulseaudio, #custom-notification { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing; margin-bottom: $spacing; } #cpu, #network { padding-left: $spacing*2; border-top-left-radius: $radii/2; border-bottom-left-radius: $radii/2; } #backlight, #custom-notification { margin-right: $spacing*2; padding-right: $spacing*2; border-top-right-radius: $radii/2; border-bottom-right-radius: $radii/2; } #cpu { font-size: 1.1em; font-weight: bolder; color: $orange; transition: 400ms; animation: ws_normal 20s ease-out 10; } #bluetooth.connected { font-size: 1.15em; color: darken($color: $blue, $amount: 10); } #pulseaudio { padding-left: 0; } #image, #workspaces, #clock, #battery, #tray, #custom-power { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing; margin-bottom: $spacing; margin-right: $spacing*2; border-radius: $radii/2; } #workspaces button { font-size: 0; min-width: $font-size*0.85; min-height: $font-size*0.85; margin: $spacing*1.5; border-radius: $spacing*10; background-color: $fg_color; transition: 100ms; animation: ws_normal 20s ease-out 10; } #workspaces button.empty { background-color: $dark_1; } #workspaces button.active { min-width: $font-size*2; background-color: $selected_bg_color; transition: 100ms; } #battery.full { font-size: 1.15em; } #custom-power { color: $red; margin-right: $spacing; border-top-right-radius: $radii; border-bottom-right-radius: $radii; } .modules-left { margin-left: $spacing; } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked/config.jsonc ================================================ { "spacing": 0, "margin-left": 0, "margin-right": 0, "margin-top": 0, "layer": "top", "reload_style_on_change": true, "modules-left": [ "image", "hyprland/workspaces" ], "modules-center": [ "clock", "custom/weather" ], "modules-right": [ "network#speed", "memory", "temperature", "cpu", "backlight", "battery", "tray", "network", "bluetooth", "pulseaudio", "custom/notification", "custom/power" ], "image": { "path": "/home/martin/Dokumente/Backgrounds/nixos.png", "size": 23, "interval": 86400, // once every day "on-click": "mpc toggle" }, "hyprland/workspaces": { "format": "{icon}", "tooltip": false, "all-outputs": false, "current-only": true, "sort-by-number": true, "persistent-workspaces": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "format-icons": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "active": "", "default": "" } }, "clock": { "format": "{:%a. | %H:%M |}", "tooltip-format": "{:%Y %B}\n{calendar}", "format-alt": "{:%d.%m.%y - %H:%M}" }, "custom/weather": { "exec": "${HOME}/.config/waybar/scripts/get_weather.sh", "return-type": "json", "format": "{}", "tooltip": true, "interval": 900 }, "cpu": { "format": "{icon}", "format-icons": [ "󰝦", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥" ], "tooltip": false, "interval": 1 }, "memory": { "tooltip": false, "format": "󰆼{used:.1f} GiB" }, "temperature": { "tooltip": false, "thermal-zone": 6, "critical-threshold": 90, "format": "{temperatureC}°C", "interval": 1 }, "backlight": { "tooltip": false, "format": "{icon}{percent}%", "format-icons": [ "", "", "", "", "", "", "", "", "" ] }, "battery": { "states": { "warning": 30, "critical": 15, "full-at": 98 }, "format": "{icon}", "format-full": "󱐥", "format-charging": "󱐋{capacity}%", "format-plugged": "󱐋{capacity}%", "format-alt": "{icon} {capacity}%", "format-icons": [ " ", " ", " ", " ", " " ], "interval": 1 }, "tray": { "spacing": 6 }, "network": { "format-wifi": "", "format-ethernet": "󰈀", "tooltip-format": "{ifname} ({ipaddr}) via {gwaddr} at\n{essid}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "󰖪", "on-click": "swaync-client -t -sw" }, "network#speed": { "format": " {bandwidthUpBytes}\n {bandwidthDownBytes}", "interval": 1 }, "bluetooth": { "format": "", "format-disabled": "󰂲", "format-connected": "󰂱", "tooltip-format": "{controller_alias}\t{controller_address}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "on-click": "swaync-client -t -sw" }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{icon} {format_source}", "format-bluetooth": "{icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": "󰸈 {format_source}", "format-source": "", "format-source-muted": "", "format-icons": { "headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", "default": [ "", "", " " ] }, "on-click": "swaync-client -t -sw", "on-click-right": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "󰂟", "none": "", "dnd-notification": "󰺁", "dnd-none": "", "inhibited-notification": "󰂟", "inhibited-none": "", "dnd-inhibited-notification": "󰺁", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, "custom/power": { "format": "", "on-click": "wlogout -b 5 -c 0 -r 0 -T 0 -B 0", "interval": 86400, // once every day "tooltip": true } } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha is_swww_daemon_running() { if pgrep -x "swww-daemon" > /dev/null then return 0 else exec swww-daemon & return 1 fi } # wait for the swww-daemon while ! is_swww_daemon_running; do echo "wait for swww-daemon" sleep 1 done swww img ~/.config/backgrounds/mocha-mountains.png pkill waybar sassc $HOME/.config/waybar/style-catppuccin-mocha.scss $HOME/.config/waybar/style.css waybar ================================================ FILE: cfg/waybar/catppuccin-mocha-docked/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; * { padding: 0; margin: 0; font-weight: bolder; } window#waybar { font-size: $font-size; /*border-radius: $radii; */ background: transparentize($color: $bar-bg, $amount: 0.2); } #clock, #custom-weather, #cpu, #memory, #temperature, #backlight, #network, #network.speed, #bluetooth, #pulseaudio, #custom-notification { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing * 1.5; margin-bottom: $spacing * 1.5; } #clock, #network { padding-left: $spacing * 2; border-top-left-radius: $radii/2; border-bottom-left-radius: $radii/2; } #custom-weather, #backlight, #custom-notification { margin-right: $spacing * 2; padding-right: $spacing * 2; border-top-right-radius: $radii/2; border-bottom-right-radius: $radii/2; } #cpu { font-size: 1.1em; font-weight: bolder; color: $peach; transition: 400ms; animation: ws_normal 20s ease-out 10; } #bluetooth.connected { font-size: 1.15em; color: darken($color: $blue, $amount: 10); } #pulseaudio { padding-left: 0; } #image, #workspaces, #battery, #tray, #custom-power { padding-left: $spacing * 1.5; padding-right: $spacing * 1.5; margin-top: $spacing * 1.5; margin-bottom: $spacing * 1.5; margin-right: $spacing * 2; border-radius: $radii/2; } #workspaces { padding-left: 0; } #workspaces button { font-size: 0; min-width: $font-size * 1; min-height: $font-size * 1; margin: $spacing * 1.5; margin-top: $spacing * 1.5; margin-bottom: $spacing * 1.5; border-radius: $spacing * 10; background-color: $fg_color; transition: 100ms; animation: ws_normal 20s ease-out 10; } #workspaces button.empty { background-color: $dark_1; } #workspaces button.active { min-width: $font-size * 2.2; background-color: darken($color: $blue, $amount: 5); transition: 100ms; } #battery.full { font-size: 1.15em; } #custom-power { color: darken($color: $red, $amount: 10); margin-right: $spacing * 1.5; } .modules-left { margin-left: $spacing; } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-color-buttons/catppuccin-mocha-colored-buttons.scss ================================================ @import "./catppuccin-mocha.scss"; #cpu, #memory, #temperature, #backlight { background-color: darken($color: $blue, $amount: 5); color: $color-fg; } #battery { background-color: darken($color: $teal, $amount: 5); color: $color-fg; } #tray { background-color: darken($color: $lavender, $amount: 0); } #network, #pulseaudio, #bluetooth, #custom-notification { background-color: darken($color: $mauve, $amount: 15); color: $color-fg; } #custom-power { background-color: darken($color: $green, $amount: 40); } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-color-buttons/config.jsonc ================================================ { "spacing": 0, //"margin-left": 10, //"margin-right": 10, //"margin-top": 10, "margin-left": 0, "margin-right": 0, "margin-top": 0, "layer": "top", "reload_style_on_change": true, "modules-left": [ "image", "hyprland/workspaces" ], "modules-center": [ "clock" ], "modules-right": [ "cpu", "memory", "temperature", "backlight", "battery", "tray", "network", "bluetooth", "pulseaudio", "custom/notification", "custom/power" ], "image": { "path": "/home/martin/Dokumente/Backgrounds/nixos.png", "size": 20, "interval": 86400, // once every day "on-click": "mpc toggle" }, "hyprland/workspaces": { "format": "{icon}", "tooltip": false, "all-outputs": false, "current-only": true, "sort-by-number": true, "persistent-workspaces": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "format-icons": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "active": "", "default": "" } }, "clock": { "format": "{:%H:%M}", "tooltip-format": "{:%Y %B}\n{calendar}", "format-alt": "{:%d.%m.%y - %H:%M}" }, "cpu": { "format": "{icon}", "format-icons": [ "󰝦", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥" ], "tooltip": false, "interval": 1 }, "memory": { "tooltip": false, "format": "󰆼{used:.1f} GiB" }, "temperature": { "tooltip": false, "thermal-zone": 6, "critical-threshold": 90, "format": "{temperatureC}°C", "interval": 1 }, "backlight": { "tooltip": false, "format": "{icon}{percent}%", "format-icons": [ "", "", "", "", "", "", "", "", "" ] }, "battery": { "states": { "warning": 30, "critical": 15 }, "format": "{icon}", "format-full": "󱐥", "format-charging": "󱐋{capacity}%", "format-plugged": "󱐋{capacity}%", "format-alt": "{icon} {capacity}%", "format-icons": [ " ", " ", " ", " ", " " ], "interval": 1 }, "tray": { "spacing": 6 }, "network": { "format-wifi": "", "format-ethernet": "󰈀", "tooltip-format": "{ifname} ({ipaddr}) via {gwaddr} at\n{essid}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "󰖪", "on-click": "swaync-client -t -sw" }, "bluetooth": { "format": "", "format-disabled": "󰂲", "format-connected": "󰂱", "tooltip-format": "{controller_alias}\t{controller_address}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "on-click": "swaync-client -t -sw" }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{icon} {format_source}", "format-bluetooth": "{icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": "󰸈 {format_source}", "format-source": "", "format-source-muted": "", "format-icons": { "headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", "default": [ "", "", "" ] }, "on-click": "swaync-client -t -sw", "on-click-right": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "󰂟", "none": "", "dnd-notification": "󰺁", "dnd-none": "", "inhibited-notification": "󰂟", "inhibited-none": "", "dnd-inhibited-notification": "󰺁", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, "custom/power": { "format": "", "on-click": "wlogout -b 5 -c 0 -r 0 -T 0 -B 0", "interval": 86400, // once every day "tooltip": true } } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-color-buttons/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha is_swww_daemon_running() { if pgrep -x "swww-daemon" > /dev/null then return 0 else exec swww-daemon & return 1 fi } # wait for the swww-daemon while ! is_swww_daemon_running; do echo "wait for swww-daemon" sleep 1 done swww img ~/.config/backgrounds/mocha-mountains.png pkill waybar sassc $HOME/.config/waybar/style-catppuccin-mocha.scss $HOME/.config/waybar/style.css waybar ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-color-buttons/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; @import "./catppuccin-mocha-colored-buttons.scss"; * { padding: 0; margin: 0; font-weight: bolder; } window#waybar { font-size: $font-size; /*border-radius: $radii; */ background: transparentize($color: $bar-bg, $amount: 0.2); } #cpu, #memory, #temperature, #backlight, #network, #bluetooth, #pulseaudio, #custom-notification { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; } #cpu, #network { padding-left: $spacing*2; border-top-left-radius: $radii/2; border-bottom-left-radius: $radii/2; } #backlight, #custom-notification { margin-right: $spacing*2; padding-right: $spacing*2; border-top-right-radius: $radii/2; border-bottom-right-radius: $radii/2; } #cpu { font-size: 1.1em; font-weight: bolder; color: $peach; transition: 400ms; animation: ws_normal 20s ease-out 10; } #bluetooth.connected { font-size: 1.15em; color: darken($color: $blue, $amount: 10); } #pulseaudio { padding-left: 0; } #image, #workspaces, #clock, #battery, #tray, #custom-power { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; margin-right: $spacing*2.0; border-radius: $radii/2; } #workspaces button { font-size: 0; min-width: $font-size*0.85; min-height: $font-size*0.85; margin: $spacing*1.5; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; border-radius: $spacing*10; background-color: $fg_color; transition: 100ms; animation: ws_normal 20s ease-out 10; } #workspaces button.empty { background-color: $dark_1; } #workspaces button.active { min-width: $font-size*2; background-color: darken($color: $blue, $amount: 5); transition: 100ms; } #battery.full { font-size: 1.15em; } #custom-power { color: darken($color: $red, $amount: 10); margin-right: $spacing*1.5; /*border-top-right-radius: $radii; border-bottom-right-radius: $radii; */ } .modules-left { margin-left: $spacing; } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-flat-buttons/catppuccin-mocha-flat-buttons.scss ================================================ @import "./catppuccin-mocha.scss"; #cpu, #memory, #temperature, #backlight, #battery, #tray, #network, #pulseaudio, #bluetooth, #custom-notification, #custom-power, #clock, #custom-weather { background-color: transparentize($color: $text, $amount: 0.75); color: $color-fg; } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-flat-buttons/config.jsonc ================================================ { "spacing": 0, "margin-left": 0, "margin-right": 0, "margin-top": 0, "layer": "bottom", "reload_style_on_change": true, "modules-left": [ "image", "hyprland/workspaces" ], "modules-center": [ "clock" //"custom/weather" ], "modules-right": [ "network#speed", "memory", "temperature", "cpu", "backlight", "battery", "tray", "network", "bluetooth", "pulseaudio", "custom/notification", "custom/power" ], "image": { "path": "/home/martin/Dokumente/Backgrounds/nixos.png", "size": 23, "interval": 86400, // once every day "on-click": "mpc toggle" }, "hyprland/workspaces": { "format": "{icon}", "tooltip": false, "all-outputs": false, "current-only": true, "sort-by-number": true, "persistent-workspaces": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "format-icons": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "active": "", "default": "" } }, "clock": { "format": "{:%a. | %H:%M}", "tooltip-format": "{:%Y %B}\n{calendar}", "format-alt": "{:%a. %d.%m.%y | %H:%M |}" }, "custom/weather": { "exec": "${HOME}/.config/waybar/scripts/get_weather.sh", "return-type": "json", "format": "{}", "tooltip": true, "interval": 900 }, "cpu": { "format": "{icon}", "format-icons": [ "󰝦", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥" ], "tooltip": false, "interval": 1 }, "memory": { "tooltip": false, "format": " {used:.1f} GiB" }, "temperature": { "tooltip": false, "thermal-zone": 6, "critical-threshold": 90, "format": "{temperatureC}°C", "interval": 1 }, "backlight": { "tooltip": false, "format": "{icon}{percent}%", "format-icons": [ "", "", "", "", "", "", "", "", "" ] }, "battery": { "states": { "warning": 30, "critical": 15, "full-at": 98 }, "format": "{icon}", "format-full": "󱐥", "format-charging": "󱐋{capacity}%", "format-plugged": "󱐋{capacity}%", "format-alt": "{icon} {capacity}%", "format-icons": [ "󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹" ], "interval": 1 }, "tray": { "spacing": 6 }, "network": { "format-wifi": "", "format-ethernet": "󰈀", "tooltip-format": "{ifname} ({ipaddr}) via {gwaddr} at\n{essid}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "󰖪", "on-click": "swaync-client -t -sw" }, "network#speed": { "format": " {bandwidthUpBytes}\n {bandwidthDownBytes}", "interval": 1 }, "bluetooth": { "format": "", "format-disabled": "󰂲", "format-connected": "󰂱", "tooltip-format": "{controller_alias}\t{controller_address}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "on-click": "swaync-client -t -sw" }, "pulseaudio": { "format": "{icon} {format_source}", "format-bluetooth": "{icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": "󰸈 {format_source}", "format-source": "", "format-source-muted": "", "format-icons": { "headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", "default": [ "", "", " " ] }, "on-click": "swaync-client -t -sw", "on-click-right": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "󰂟", "none": "", "dnd-notification": "󰺁", "dnd-none": "", "inhibited-notification": "󰂟", "inhibited-none": "", "dnd-inhibited-notification": "󰺁", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, "custom/power": { "format": "", "on-click": "wlogout -b 5 -c 0 -r 0 -T 0 -B 0", "interval": 86400, // once every day "tooltip": true } } ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-flat-buttons/launch.sh ================================================ #!/usr/bin/env sh # Catppuccin-Mocha is_swww_daemon_running() { if pgrep -x "swww-daemon" > /dev/null then return 0 else exec swww-daemon & return 1 fi } # wait for the swww-daemon while ! is_swww_daemon_running; do echo "wait for swww-daemon" sleep 1 done swww img ~/.config/backgrounds/mocha-mountains.png pkill waybar sassc $HOME/.config/waybar/style-catppuccin-mocha.scss $HOME/.config/waybar/style.css waybar ================================================ FILE: cfg/waybar/catppuccin-mocha-docked-flat-buttons/style-catppuccin-mocha.scss ================================================ @import "./catppuccin-mocha.scss"; @import "./catppuccin-mocha-flat-buttons.scss"; * { padding: 0; margin: 0; font-weight: bolder; } window#waybar { font-size: $font-size; /*border-radius: $radii; */ background: transparentize($color: $bar-bg, $amount: 0.2); } #clock, #custom-weather, #cpu, #memory, #temperature, #backlight, #network, #network.speed, #bluetooth, #pulseaudio, #custom-notification { padding-left: $spacing; padding-right: $spacing; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; } #clock, #network { padding-left: $spacing*2; border-top-left-radius: $radii/2; border-bottom-left-radius: $radii/2; } #clock, #backlight, #custom-notification { margin-right: $spacing*2; padding-right: $spacing*2; border-top-right-radius: $radii/2; border-bottom-right-radius: $radii/2; } #cpu { font-size: 1.1em; font-weight: bolder; color: $peach; transition: 400ms; animation: ws_normal 20s ease-out 10; } #bluetooth.connected { font-size: 1.15em; color: darken($color: $blue, $amount: 10); } #pulseaudio { padding-left: 0; } #image, #workspaces, #battery, #tray, #custom-power { padding-left: $spacing*1.5; padding-right: $spacing*1.5; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; margin-right: $spacing*2.0; border-radius: $radii/2; } #workspaces { padding-left: 0; } #workspaces button { font-size: 0; min-width: $font-size*0.95; min-height: $font-size*0.95; margin: $spacing*1.5; margin-top: $spacing*1.5; margin-bottom: $spacing*1.5; border-radius: $spacing*10; background-color: $fg_color; transition: 100ms; animation: ws_normal 20s ease-out 10; } #workspaces button.empty { background-color: $dark_1; } #workspaces button.active { min-width: $font-size*2; background-color: darken($color: $blue, $amount: 5); transition: 100ms; } #battery.full { font-size: 1.15em; } #custom-power { color: darken($color: $red, $amount: 10); margin-right: $spacing*1.5; } .modules-left { margin-left: $spacing; } ================================================ FILE: cfg/waybar/scripts/get_weather.sh ================================================ #!/usr/bin/env bash for i in {1..5}; do text=$(curl -s "de.wttr.in/Chemnitz?nonce=$RANDOM\&format=1") if [[ $? == 0 ]]; then text=$(echo "$text" | sed -E "s|[+ ]||g") tooltip=$(curl -s "de.wttr.in/~50.8322608,12.9252977?nonce=$RANDOM\&format=4") if [[ $? == 0 ]]; then tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g") echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}" exit fi fi sleep 2 done echo "{\"text\":\"error\", \"tooltip\":\"error\"}" ================================================ FILE: installers/install ================================================ #!/bin/bash # Check if the system is an Arch Linux-based distribution if [ -f /etc/os-release ]; then source /etc/os-release if [ "$ID" != "arch" ]; then echo "This script is intended for Arch Linux or Arch-based distributions only." read -p "Do you want to run this script anyway? (y/n): " run_script if [ "$run_script" != "y" ]; then exit 1 fi fi else echo "Unable to determine the distribution. Proceeding with the script..." fi git_dir=~/git if [ -d "$git_dir" ]; then echo "$git_dir exists." cd "$git_dir" else echo "$git_dir does not exist." echo "Creating $git_dir..." mkdir -p "$git_dir" cd "$git_dir" echo "$git_dir was created." fi # Check if Yay is installed if [ -n "$(command -v yay)" ]; then echo "Yay (AUR Helper) is already installed." else # Prompt the user to install Yay read -p "Yay (AUR Helper) is required. Do you want to install Yay? (y/n): " install_yay if [ "$install_yay" == "y" ]; then sudo pacman -S --needed git base-devel git clone https://aur.archlinux.org/yay.git cd yay makepkg -si else echo "Yay is required for this script. Exiting." exit 1 fi fi if [ -d "$git_dir" ]; then echo "$git_dir exists." cd "$git_dir" else echo "$git_dir does not exist." echo "Creating $git_dir..." mkdir -p "$git_dir" cd "$git_dir" echo "$git_dir was created." fi # needed packages needed_pacman_packages=( "wget" "hyprland" "nano" "lshw" "bluez" "bluez-utils" "brightnessctl" "file-roller" "grim" "imagemagick" "gvfs" "inotify-tools" "libinput" "lm_sensors" "pavucontrol" "python-pam" "slurp" "swayidle" "playerctl" "wl-clipboard" "tracker3" "tracker3-miners" "qt5-base" "qt6-base" "gnome-bluetooth" "gnome-control-center" "kitty" "sassc" ) needed_aur_packages=( "aylurs-gtk-shell-git" "grimblast-git" "gtklock" "gtklock-userinfo-module" "hyprpicker" "ttf-ubuntu-nerd" "ttf-ubuntu-mono-nerd" "sway-audio-idle-inhibit-git" "swww-git" "pywal-16-colors" "xdg-desktop-portal-hyprland" "wf-recorder" "wl-clip-persist-git" "wayshot-bin" ) # optional packages optional_pacman_packages=( "discord" "btop" "firefox" "flatpak" "fprintd" "fwupd" "cifs-utils" "gdm" "gimp" "gnome-calculator" "gnome-disk-utility" "gnome-keyring" "gnome-software" "gnome-sound-recorder" "gnome-tweaks" "intel-gpu-tools" "gvfs-smb" "libgnome-keyring" "mpv" "neofetch" "network-manager-applet" "nextcloud-client" "obs-studio" "smbclient" "seahorse" "polkit-gnome" "nautilus" "thunar" "tlp" "obsidian" "neovim" "neovide" "fzf" "wireguard-tools" ) optional_aur_packages=( "spotify" "gdm-settings" "wev" "tlpui" "git-credential-manager-core" "overskride " ) # print packages echo "Available packages:" echo "1) Install only needed packages (both offical Arch and AUR)" echo "2) Install needed and optional packages (both offical Arch and AUR)" read -p "Enter the number of your choice: " choice if [ "$choice" == "1" ]; then # Installation of needed packages (Pacman) for package in "${needed_pacman_packages[@]}"; do sudo pacman -S --needed --noconfirm "$package" done # Installation of needd packages (AUR) for package in "${needed_aur_packages[@]}"; do yay -S --noconfirm "$package" done elif [ "$choice" == "2" ]; then # Installation of needed packages (Pacman) for package in "${needed_pacman_packages[@]}"; do sudo pacman -S --needed --noconfirm "$package" done # Installation of needed packages (AUR) for package in "${needed_aur_packages[@]}"; do yay -S --noconfirm "$package" done # Installation of optional packages (Pacman) for package in "${optional_pacman_packages[@]}"; do sudo pacman -S --noconfirm "$package" done # Installation of packages (AUR) for package in "${optional_aur_packages[@]}"; do yay -S --noconfirm "$package" done else echo "Invalid choice. No packages were installed." fi git clone https://github.com/RoccoRakete/hyprland-dots.git git clone https://github.com/RoccoRakete/hyprland-gtk-themes.git git clone https://github.com/RoccoRakete/hyprland-icons.git # Check if the directories exist if [ -d ~/.config ]; then echo "~/.config directory exists." echo "Do you want to create a backup of the existing ~/.config directory and copy the new config? (y/n): " read create_config_backup if [ "$create_config_backup" == "y" ]; then mv ~/.config ~/.config_bak echo "~/.config_bak was created!" mkdir -p ~/.config mkdir -p ~/.dots echo "~/.config was created!" cp -r ./hyprland-dots/* ~/.dots ln -s ~/.dots/* ~/.config fi else echo "~/.config directory does not exist." echo "Do you want to create it and copy the new config? (y/n): " read create_config if [ "$create_config" == "y" ]; then mkdir -p ~/.config mkdir -p ~/.dots echo "~/.config was created!" cp -r ./hyprland-dots/* ~/.dots ln -s ~/.dots/* ~/.config fi fi if [ -d ~/.icons ]; then echo "~/.icons directory exists." echo "Do you want to create a backup of the existing ~/.icons directory and copy the new icons? (y/n): " read create_icons_backup if [ "$create_icons_backup" == "y" ]; then mv ~/.icons ~/.icons_bak echo "~/.icons_bak was created!" mkdir -p ~/.icons echo "~/.icons was created!" cp -r ./hyprland-icons/* ~/.icons fi else echo "~/.icons directory does not exist." echo "Do you want to create it and copy the new icons? (y/n): " read create_icons if [ "$create_icons" == "y" ]; then mkdir -p ~/.icons echo "~/.icons was created!" cp -r ./hyprland-icons/* ~/.icons fi fi if [ -d ~/.themes ]; then echo "~/.themes directory exists." echo "Do you want to create a backup of the existing ~/.themes directory and copy the new themes? (y/n): " read create_themes_backup if [ "$create_themes_backup" == "y" ]; then mv ~/.themes ~/.themes_bak echo "~/.themes_bak was created!" mkdir -p ~/.themes echo "~/.themes was created!" cp -r ./hyprland-gtk-themes/* ~/.themes fi else echo "~/.themes directory does not exist." echo "Do you want to create it and copy the new themes? (y/n): " read create_themes if [ "$create_themes" == "y" ]; then mkdir -p ~/.themes echo "~/.themes was created!" cp -r ./hyprland-gtk-themes/* ~/.themes fi fi # install git version of Hyprland read -p "Do you want to install the Git-Version of Hyprland? (Y/n): " choice if [[ $choice == "n" || $choice == "N" ]]; then echo "hyprland-git was not installed!" else echo "installing 'hyprland-git' ..." yay -S hyprland-git --noconfirm if [ $? -eq 0 ]; then echo "hyprland-git was installed!" else echo "Installation was aborted! Make sure you have 'yay' installed! " fi fi # install libadwaita-without-adwaita-git read -p "Install libadwaita-without-adwaita? This is needed to run GTK4/Adwaita applications with a GTK3 theme... (Y/n): " choice if [[ $choice == "n" || $choice == "N" ]]; then echo "libadwaita-without-adwaita-git was not installed!" else echo "installing 'libadwaita-without-adwaita-git' ..." yay -S libadwaita-without-adwaita-git --noconfirm if [ $? -eq 0 ]; then echo "libadwaita-without-adwaita-git was installed!" else echo "Installation was aborted! Make sure you have 'yay' installed! " fi fi # install nvChad read -p "Install nvChad? (Y/n): " choice if [[ $choice == "n" || $choice == "N" ]]; then echo "nvChad was not installed!" else echo "installing 'nvChad' ..." git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 if [ $? -eq 0 ]; then echo "nvChad was installed ... to set it up start 'neovim'" else echo "Installation was aborted!" fi fi # Download and install Hermit Nerd Font wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hermit.zip unzip Hermit.zip -d Hermit sudo cp -r ./Hermit /usr/share/fonts # Edit monitors example config example_conf_file="$HOME/.dots/hypr/presets/monitors.exampleconf" conf_file="$HOME/.dots/hypr/monitors.conf" # Check if file exists if [ -e "$example_conf_file" ]; then read -p "Do you want so edit the monitors config now? Hyprland wouldn't work correctly otherwise! (y/n): " choice if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then nano "$example_conf_file" if [ -e "$example_conf_file" ]; then cp "$example_conf_file" "$conf_file" echo "The file has been edited and copied to $conf_file successfully." else echo "The file doesn't exist!?" fi else echo "The file hasn't be edited!" fi else echo "The exampleconfig doesn't exist!" fi sudo systemctl enable --now tlp.service # Prompt the user to restart the computer read -p "Installation has now completed. Do you want to reboot now? (y/n): " restart_pc if [ "$restart_pc" == "y" ]; then reboot fi ================================================ FILE: installers/thinkfan ================================================ #!/bin/bash # Hardware detect hardware_info=$(sudo lshw 2>/dev/null) if [[ $hardware_info == *"Lenovo"* ]]; then echo "Lenovo-Laptop detected." echo "Do you want to install thinkfan? (y/n): " read install_thinkfan if [ "$install_thinkfan" == "y" ]; then yay -S thinkfan echo "Thinkfan has been installed." if [ -e /etc/thinkfan.yaml ]; then echo "Do you want to rename the existing thinkfan.yaml to thinkfan.bak? (y/n): " read rename_config if [ "$rename_config" == "y" ]; then sudo mv /etc/thinkfan.yaml /etc/thinkfan.bak echo "Existing thinkfan.yaml has been renamed to thinkfan.bak." fi fi echo "Do you want to copy the new thinkfan configuration? (y/n): " read copy_config if [ "$copy_config" == "y" ]; then sudo cp ~/.dots/scriptsnstuff/thinkfan.yaml /etc/thinkfan.yaml echo "New thinkfan configuration has been copied." fi else echo "Thinkfan config has not been copied." fi else echo "No Lenovo-Laptop detected..." fi if [ -n "$(command -v thinkfan)" ]; then echo "Thinkfan is installed." read -p "Do you want to enable and start Thinkfan now? (y/n): " enable_thinkfan if [ "$enable_thinkfan" == "y" ]; then sudo systemctl enable thinkfan sudo systemctl start thinkfan echo "Thinkfan has been enabled and started." fi fi ================================================ FILE: installers/zsh ================================================ #!/bin/bash echo "Do you want to install ZSH and related extensions and configure Oh My Zsh? (y/n): " read install_zsh if [ "$install_zsh" == "y" ]; then sudo pacman --noconfirm -S zsh yay -S --noconfirm -S zsh-theme-powerlevel10k-git sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" sudo git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting sudo git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting sudo git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete cp ./hyprland-dots/.zshrc ~/.zshrc echo "ZSH and related extensions have been installed and configured." else echo "ZSH and related extensions have not been installed." fi ================================================ FILE: nixos/configs/home-configs/kitty.nix ================================================ { ... }: { programs.kitty = { enable = true; theme = "Catppuccin-Mocha"; settings = { font_family = "Hurmit Nerd Font"; font_size = "14.0"; #background = "#1E1E1E"; background_opacity = "0.9"; #foreground = "#DEDDDA"; #tab_bar_background = "#1E1E1E"; scrollback_lines = 10000; show_hyperlink_targets = "yes"; focus_follows_mouse = "no"; enable_audio_bell = false; tab_bar_min_tabs = 1; tab_bar_edge = "bottom"; tab_bar_style = "powerline"; tab_powerline_style = "slanted"; tab_title_template = "{title}{' :{}:'.format(num_windows) if num_windows > 1 else ''}"; url_style = "none"; underline_hyperlinks = "never"; }; extraConfig = "modify_font underline_position 3" + "\n" + "modify_font underline_thickness 300%" + "\n" + "modify_font strikethrough_position 2px"; }; } ================================================ FILE: nixos/configs/home-configs/styling.nix ================================================ { pkgs, ... }: { imports = [ ../../pkgs ]; home = { # Cursor pointerCursor = { gtk.enable = true; package = pkgs.bibata-cursors; name = "Bibata-Modern-Classic"; size = 24; }; }; gtk = { enable = true; # GTK-Icons # Yaru #iconTheme.package = pkgs.yaru-theme; #iconTheme.name = "Yaru"; # MoreWaita iconTheme.package = pkgs.morewaita-icon-theme; iconTheme.name = "MoreWaita"; # GTK-Colors # Catppuccin theme.name = "Catppuccin-Mocha-Standard-Blue-Dark"; theme.package = pkgs.catppuccin-gtk.override { accents = [ "blue" ]; size = "standard"; variant = "mocha"; }; # Kanagawa #theme.name = "Kanagawa-B"; #theme.package = pkgs.kanagawa-gtk-theme.override { }; # Fonts font = { name = "Ubuntu Nerd Font"; size = 13; }; }; # QT qt = { enable = true; platformTheme = "gtk"; style.name = "Catppuccin-Mocha-Standard-Blue-Dark"; }; } ================================================ FILE: nixos/configs/home-configs/waybar.nix ================================================ { inputs, pkgs, ... }: { programs = { waybar = { enable = true; package = inputs.waybar.packages.${pkgs.system}.waybar; }; }; } ================================================ FILE: nixos/configs/home-configs/zsh.nix ================================================ { pkgs, lib, config, ... }: { programs.zsh = { enable = true; initExtraFirst = #"wal -R" + "\n" + "clear"; initExtra = "source ~/.p10k.zsh" + "\n" + "neofetch" + "\n" + "export TERM=xterm" + "\n" + "export EDITOR=nvim" + "\n" + "bindkey '^[[A' menu-complete" ; shellAliases = { #ll = "ls -lah"; ll = "eza -loah --icons=always --no-permissions --git"; v = "nvim"; editd = "nvim ~/.dots"; pushd = "cd ~/.dots && git add -A && git commit && git push --repo https://github.com/RoccoRakete/hyprland-dots.git && cd ~"; addd = "cd ~/.dots && git add -A && cd ~"; update = "sudo nixos-rebuild switch"; flake-update = "nix flake update ~/.dots/nixos"; fwup = "sudo fwupdmgr refresh --force && sudo fwupdmgr get-updates && sudo fwupdmgr update"; upgrade-desktop = "sudo nixos-rebuild switch --upgrade --flake ~/.dots/nixos#OptiPlex3060"; home-upgrade-desktop = "home-manager switch --flake ~/.dots/nixos#OptiPlex3060"; news-desktop = "home-manager news --flake ~/.dots/nixos#OptiPlex3060"; upgrade-laptop = "nh os switch -H ThinkPad"; home-upgrade-laptop = "nh home switch -c ThinkPad"; news-laptop = "home-manager news --flake ~/.dots/nixos#ThinkPad"; }; enableCompletion = false; syntaxHighlighting.enable = true; autosuggestion.enable = true; historySubstringSearch = { enable = true; searchUpKey = [ "\\eOA" ]; searchDownKey = [ "\\eOB" ]; }; history.size = 10000; history.path = "${config.xdg.dataHome}/zsh/history"; zplug = { enable = true; plugins = [ { name = "zsh-users/zsh-autosuggestions"; } { name = "marlonrichert/zsh-autocomplete"; } { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } ]; }; oh-my-zsh = { enable = false; plugins = [ "git" "colored-man-pages" ]; }; }; } ================================================ FILE: nixos/configs/nixos-configs/bluetooth.nix ================================================ { ... }: { hardware = { bluetooth.enable = true; bluetooth.powerOnBoot = true; bluetooth = { settings = { General = { ControllerMode = "dual"; FastConnectable = "true"; Experimental = "true"; }; Policy = { AutoEnable = "true"; }; }; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/autopairs.nix ================================================ { ... }: { programs.nixvim.plugins.nvim-autopairs = { enable = true; settings = { checkTs = true; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/bufferline.nix ================================================ { ... }: { programs.nixvim.plugins.bufferline = { enable = true; mode = "buffers"; diagnostics = "nvim_lsp"; indicator.style = null; #separatorStyle = "slant"; closeIcon = "󰅚"; bufferCloseIcon = "󰅙"; modifiedIcon = "󰀨"; offsets = [ { filetype = "neo-tree"; text = "File Explorer"; text_align = "center"; separator = false; } ]; highlights = { indicatorSelected.fg = "#89b4fa"; #tabSeparatorSelected.fg = "#89b4fa"; }; highlights = rec { # # Tab bar fill #fill.bg = "#ffffff"; # fill.fg = "#5a5b64"; # # Tab fill # background.fg = "#5a5b64"; # background.bg = "#000000"; # background.sp = fill.bg; # Tab separator # separator = background // { fg = fill.bg; }; # separatorVisible = background // { fg = fill.bg; }; # # Path name # duplicate = background // { fg = "#5a5b64"; }; # # buffer = { fg = "#5a5b64"; } // background; # #modified = background // { fg = "#f38ba8"; }; # closeButton = background; # duplicate.bg = "#21222a"; #pick.bg = "#89b4fa"; # hint.bg = "#000000"; #error.bg = "#f38ba8"; #warning.bg = "#eba0ac"; #info.bg = "#f9e2af"; # hint.bg = "#21222a"; # hintDiagnostic.bg = "#89b4fa"; # infoDiagnostic.bg = "#f9e2af"; # errorDiagnostic.bg = "#f38ba8"; # warningDiagnostic.bg = "#eba0ac"; # numbers.bg = "#21222a"; # icon = background; # bufferSelected.fg = "#ecedfa"; # separatorSelected.fg = separator.fg; # separatorSelected.fg = "#000000"; # closeButtonSelected.fg = "#ecedfa"; # nameVisible.fg = "#ecedfa"; # modifiedSelected.fg = "#f38ba8"; # modified.bg = "#000000"; # bufferVisible.fg = "#5a5b64"; # infoVisible.fg = "#eba0ac"; }; diagnosticsIndicator = '' function(count, level) local icon = level:match("error") and " " or "" return " " .. icon .. count end ''; #extraOptions = { # highlights = { # tab_separator_selected = { # underline = "#89b4fa"; # }; # }; #}; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/conform.nix ================================================ { ... }: { programs.nixvim.plugins.conform-nvim = { enable = true; formattersByFt = { "*" = [ "codespell" ]; "_" = [ "trim_whitespace" ]; #go = [ "goimports" "golines" "gofmt" "gofumpt" ]; javascript = [ "prettierd" ]; typescript = [ "prettierd" ]; yaml = [ "prettierd" ]; json = [ "jq" ]; lua = [ "stylua" ]; scss = [ "prettierd" ]; css = [ "prettierd" ]; python = [ "isort" "black" ]; rust = [ "rustfmt" ]; sh = [ "shfmt" ]; #terraform = [ "terraform_fmt" ]; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/dashboard.nix ================================================ { ... }: { programs.nixvim.plugins.dashboard = { enable = true; header = [ "███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗" "████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║" "██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║" "██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║" "██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║" "╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝" ]; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/efmls.nix ================================================ { ... }: { programs.nixvim.plugins.efmls-configs = { enable = false; setup.nix.formatter = "nixfmt"; setup.scss.formatter = "prettier"; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/keymaps.nix ================================================ { ... }: { programs = { nixvim = { keymaps = [ { key = "lf"; action = "lua require('conform').format({ lsp_fallback = true, async = false, timeout_ms = 500 })"; options = { silent = true; }; } { key = "."; action = ":"; } { key = "bb"; action = "Telescope file_browser"; } { key = "t"; action = "Neotree"; } { key = "w"; action = "WhichKey"; } { key = ""; action = ":bnext"; } { key = "c"; action = ":bp | bd #"; } { key = "c"; action = ":bp | bd #"; } ]; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/lsp-format.nix ================================================ { ... }: { programs.nixvim.plugins.lsp-format = { enable = false; lspServersToEnable = [ "nixd" "efm" ]; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/lsp-servers.nix ================================================ { ... }: { programs = { nixvim = { plugins = { lsp.servers.nixd.enable = true; lsp.servers.cssls.enable = true; lsp.servers.java-language-server.enable = true; lsp.servers.jsonls.enable = true; lsp.servers.lua-ls.enable = true; #lsp.servers.pylsp.enable = true; lsp.servers.rust-analyzer.enable = true; lsp.servers.rust-analyzer.installCargo = true; lsp.servers.rust-analyzer.installRustc = true; lsp.servers.tsserver.enable = false; lsp.servers.yamlls.enable = true; lsp.servers.efm.enable = true; }; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/lsp.nix ================================================ { ... }: { programs.nixvim.plugins.lsp = { enable = true; #keymaps.lspBuf = { # "fm" = "format"; #}; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/neo-tree.nix ================================================ { ... }: { programs.nixvim.plugins.neo-tree = { enable = true; autoCleanAfterSessionRestore = true; closeIfLastWindow = true; window = { position = "left"; }; filesystem = { followCurrentFile.enabled = true; filteredItems = { hideHidden = false; hideDotfiles = false; forceVisibleInEmptyFolder = true; hideGitignored = false; }; }; window.mappings = { "" = "navigate_up"; "." = "set_root"; "f" = "fuzzy_finder"; "/" = "filter_on_submit"; "h" = "show_help"; }; eventHandlers = { neo_tree_buffer_enter = '' function() vim.cmd 'highlight! Cursor blend=100' end ''; neo_tree_buffer_leave = '' function() vim.cmd 'highlight! Cursor guibg=#5f87af blend=0' end ''; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/nvim-cmp.nix ================================================ { ... }: { programs.nixvim.plugins = { cmp = { enable = true; extraOptions.sources = [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } { name = "luasnip"; } { name = "cmdline"; } ]; settings.mapping = { "" = "cmp.mapping.confirm({ select = true })"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.close()"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; }; settings.snippet.expand = '' function(args) require('luasnip').lsp_expand(args.body) end ''; }; cmp-cmdline.enable = true; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/nvim.nix ================================================ { pkgs, ... }: { imports = [ ./keymaps.nix ./nvim-cmp.nix ./lsp.nix ./bufferline.nix ./telescope.nix ./neo-tree.nix ./prettier.nix ./lsp-servers.nix ./treesitter.nix ./autopairs.nix ./whichkey.nix ./dashboard.nix ./efmls.nix ./lsp-format.nix ./conform.nix ]; programs = { nixvim = { enable = true; globals.mapleader = " "; clipboard.providers.wl-copy.enable = true; options = { number = true; relativenumber = false; shiftwidth = 2; }; plugins = { nix.enable = true; lsp-lines.enable = true; lspkind.enable = true; neogit.enable = true; cmp-zsh.enable = true; noice.enable = true; nvim-colorizer.enable = true; luasnip.enable = true; rust-tools.enable = true; notify = { enable = true; #backgroundColour = "#000000"; timeout = 2000; fps = 120; stages = "fade"; }; airline = { enable = true; #powerline = true; settings = { theme = "catppuccin"; }; }; }; #autoCmd = [ # { # event = [ "BufWrite" ]; # pattern = [ "" ]; # command = "lua require('conform').format({ lsp_fallback = true, async = false, timeout_ms = 500 })"; # } #]; extraPlugins = with pkgs.vimPlugins; [ telescope-ui-select-nvim #vim-autoformat vim-jsbeautify ]; extraConfigLua = ''if vim.g.neovide then'' + "\n" + ''vim.o.guifont = "Hurmit Nerd Font:h14"'' + "\n" + ''vim.keymap.set('n', '', ':w') -- Save'' + "\n" + ''vim.keymap.set('v', '', '"+y') -- Copy'' + "\n" + ''vim.keymap.set('n', '', '"+P') -- Paste normal mode'' + "\n" + ''vim.keymap.set('v', '', '"+P') -- Paste visual mode'' + "\n" + ''vim.keymap.set('c', '', '+') -- Paste command mode'' + "\n" + ''vim.keymap.set('i', '', 'l"+Pli') -- Paste insert mode'' + "\n" + "end"; #colorschemes.kanagawa = { # enable = true; # terminalColors = true; #}; #colorschemes.ayu = { # enable = true; # mirage = true; #}; colorschemes.catppuccin = { enable = true; settings = { flavour = "mocha"; transparentBackground = false; }; }; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/prettier.nix ================================================ { ... }: { programs.nixvim.plugins.none-ls.sources.formatting.prettier = { enable = true; disableTsServerFormatter = true; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/telescope.nix ================================================ { ... }: { programs.nixvim.plugins.telescope = { enable = true; enabledExtensions = [ "ui-select" ]; extensions.ui-select.enable = true; extensions.frecency.enable = false; extensions.fzf-native.enable = true; extensions.file-browser = { enable = true; settings.hidden = true; settings.depth = 9999999999; settings.auto_depth = true; }; keymaps = { "ff" = "find_files"; "fs" = "grep_string"; "fg" = "live_grep"; }; settings = { pickers = { find_files = { hidden = true; }; }; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/treesitter.nix ================================================ { ... }: { programs.nixvim.plugins = { cmp-treesitter.enable = true; treesitter.enable = true; treesitter-refactor = { enable = true; highlightCurrentScope.enable = true; highlightCurrentScope.disable = [ "nix" ]; highlightDefinitions.enable = true; navigation.enable = true; smartRename.enable = true; }; }; } ================================================ FILE: nixos/configs/nixos-configs/nixvim/whichkey.nix ================================================ { ... }: { programs.nixvim.plugins.which-key = { enable = true; icons = { separator = ""; group = ""; }; keyLabels = { "" = "SPC"; }; registrations = { "c" = "󰅙 Close Buffer"; "t" = "󰙅 FileExplorer"; "f" = " Telescope"; "w" = " WhichKey?!"; "ff" = " Find Files"; "l" = " LSP"; "lf" = "󰉡 Format Buffer"; }; }; } ================================================ FILE: nixos/configs/nixos-configs/programs.nix ================================================ { pkgs, inputs, ... }: { programs = { hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.hyprland; }; thunar = { plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]; enable = true; }; virt-manager = { enable = true; }; dconf.enable = true; zsh.enable = true; direnv.enable = true; nano.enable = false; ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; }; } ================================================ FILE: nixos/configs/nixos-configs/services.nix ================================================ { pkgs, ... }: { imports = [ ]; services = { blueman.enable = true; fwupd.enable = true; tumbler.enable = true; gvfs.enable = true; gnome.core-utilities.enable = true; gnome.core-shell.enable = true; upower.enable = true; xserver.desktopManager.xfce.enable = true; power-profiles-daemon.enable = false; xserver.displayManager.gdm.enable = true; gnome.gnome-keyring.enable = true; gnome.tracker.enable = true; gnome.tracker-miners.enable = true; xserver = { enable = true; xkb.layout = "de"; xkb.variant = ""; excludePackages = [ pkgs.xterm ]; }; pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; }; printing.enable = true; acpid.enable = true; flatpak.enable = true; openssh = { enable = true; settings = { PasswordAuthentication = false; }; }; udev.extraRules = '' # DFU (Internal bootloader for STM32 and AT32 MCUs) ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev" ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev" ''; }; } ================================================ FILE: nixos/configs/nixos-configs/tlp.nix ================================================ { ... }: { services = { tlp.enable = true; tlp.settings = { PLATFORM_PROFILE_ON_BAT = "low-power"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; CPU_BOOST_ON_BAT = 1; CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; MEM_SLEEP_ON_BAT = "deep"; PLATFORM_PROFILE_ON_AC = "performance"; CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; CPU_BOOST_ON_AC = 1; CPU_SCALING_GOVERNOR_ON_AC = "performance"; WOL_DISABLE = "Y"; }; }; } ================================================ FILE: nixos/flake.nix ================================================ { description = "Martin's Nix-Flakes Config"; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-software-center = { url = "github:snowfallorg/nix-software-center"; inputs.nixpkgs.follows = "nixpkgs"; }; nixos-conf-editor = { url = "github:snowfallorg/nixos-conf-editor"; inputs.nixpkgs.follows = "nixpkgs"; }; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; eza = { url = "github:eza-community/eza"; inputs.nixpkgs.follows = "nixpkgs"; }; nh = { url = "github:viperML/nh"; inputs.nixpkgs.follows = "nixpkgs"; }; ags = { url = "github:Aylur/ags"; inputs.nixpkgs.follows = "nixpkgs"; }; waybar = { url = "github:alexays/waybar"; inputs.nixpkgs.follows = "nixpkgs"; }; anyrun = { url = "github:Kirottu/anyrun"; inputs.nixpkgs.follows = "nixpkgs"; }; walker = { url = "github:abenz1267/walker"; inputs.nixpkgs.follows = "nixpkgs"; }; hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; }; hyprlock = { url = "github:hyprwm/Hyprlock"; }; hypridle = { url = "github:hyprwm/Hypridle"; }; hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; }; outputs = { nixpkgs, home-manager, nixvim, ... }@inputs: let vars = import ./variables.nix; system = "x86_64-linux"; lib = nixpkgs.lib; pkgs = nixpkgs.legacyPackages.${system}; in { # system configurations # desktop nixosConfigurations = { ${vars.desktop} = lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ ./hosts/desktop/configuration-desktop.nix inputs.nixvim.nixosModules.nixvim ]; }; # laptop ${vars.laptop} = lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ ./hosts/laptop/configuration-laptop.nix inputs.nixvim.nixosModules.nixvim ]; }; }; # home configurations # desktop homeConfigurations = { ${vars.desktop} = home-manager.lib.homeManagerConfiguration { extraSpecialArgs = { inherit inputs; }; inherit pkgs; modules = [ ./hosts/desktop/home-desktop.nix ]; }; }; # laptop homeConfigurations = { ${vars.laptop} = home-manager.lib.homeManagerConfiguration { extraSpecialArgs = { inherit inputs; }; inherit pkgs; modules = [ ./hosts/laptop/home-laptop.nix ]; }; }; }; } ================================================ FILE: nixos/global-dotfiles/gtklock/config.ini ================================================ [main] modules=/home/martin/.dots/gtklock/userinfo-module.so [userinfo] image-size=128 under-clock=true ================================================ FILE: nixos/global-dotfiles/gtklock/style.css ================================================ * { } window { background-image: url("../backgrounds/last/image_blurred.png"); background-size: cover; background-repeat: no-repeat; background-position: center; } box#window-box { padding-bottom: 5em; } label#clock-label { font-size: 5em; padding-bottom: 3em; color: @theme_fg_color; } label#input-label { font-size: 0px; } entry#input-field { color: @theme_fg_color; background-color: @theme_bg_color; } button { color: @theme_fg_color; background-color: @theme_bg_color; } image#user-image { } ================================================ FILE: nixos/global-dotfiles/swaylock/config ================================================ # ____ _ _ # / ___|_ ____ _ _ _| | ___ ___| | __ # \___ \ \ /\ / / _` | | | | |/ _ \ / __| |/ / # ___) \ V V / (_| | |_| | | (_) | (__| < # |____/ \_/\_/ \__,_|\__, |_|\___/ \___|_|\_\ # |___/ # # ----------------------------------------------------- ignore-empty-password font="Ubuntu Nerd Font" clock timestr=%R datestr=%a, %d. %B # Add an image as a background image=/tmp/hypr/latest_screenshot/latest_blur.png # Fade in time fade-in=0 # Show/Hide indicator circle indicator # smaller indicator indicator-radius=150 # bigger indicator # indicator-radius=300 indicator-thickness=5 indicator-caps-lock # Define all colors key-hl-color=00000066 separator-color=00000000 inside-color=00000033 inside-clear-color=ffffff00 inside-caps-lock-color=ffffff00 inside-ver-color=ffffff00 inside-wrong-color=ffffff00 ring-color=ffffff00 ring-clear-color=ffffff ring-caps-lock-color=CC241D ring-ver-color=ffffff ring-wrong-color=ffffff line-color=00000000 line-clear-color=ffffffFF line-caps-lock-color=ffffffFF line-ver-color=ffffffFF line-wrong-color=ffffffFF text-color=ffffff text-clear-color=ffffff text-ver-color=ffffff text-wrong-color=ffffff bs-hl-color=ffffff caps-lock-key-hl-color=ffffffFF caps-lock-bs-hl-color=ffffffFF text-caps-lock-color=ffffff ================================================ FILE: nixos/hosts/desktop/configuration-desktop.nix ================================================ { lib, ... }: let vars = import ../../variables.nix; in { imports = [ ./hardware-configuration-desktop.nix ../../configs/global-configs/services.nix ../../configs/global-configs/programs.nix ../../configs/global-configs/bluetooth.nix ../../configs/global-configs/tlp.nix ../../nixos.nix ../../packages.nix ]; # Networking networking = { hostName = vars.desktop; useDHCP = lib.mkDefault true; networkmanager.enable = true; }; #networking.interfaces.enp1s0.useDHCP = true; #networking.interfaces.br0.useDHCP = false; #networking.bridges = { # "br0" = { # interfaces = [ "enp1s0" ]; # }; #}; } ================================================ FILE: nixos/hosts/desktop/hardware-configuration-desktop.nix ================================================ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { config, lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/2be747cf-511f-4204-b1ad-73719edac311"; fsType = "ext4"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/4376-E3AB"; fsType = "vfat"; }; swapDevices = [ { device = "/dev/disk/by-uuid/2e974971-b9ed-460b-9e62-696b59bdfb37"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } ================================================ FILE: nixos/hosts/desktop/home-desktop.nix ================================================ { pkgs, ... }: let vars = import ../../variables.nix; in { imports = [ ../../configs/home-configs/styling.nix ../../configs/home-configs/zsh.nix ./link-dotfiles-desktop.nix ./home-programs-desktop.nix ]; home.username = vars.user1; home.homeDirectory = vars.homeDirectoryUser1; services.gpg-agent = { enable = true; defaultCacheTtl = 1800; enableSshSupport = true; }; dconf.settings = { "org/virt-manager/virt-manager/connections" = { autoconnect = [ "qemu:///system" ]; uris = [ "qemu:///system" ]; }; }; xdg.desktopEntries."org.gnome.Settings" = { name = "Settings"; comment = "Gnome Control Center"; icon = "org.gnome.Settings"; exec = "env XDG_CURRENT_DESKTOP=gnome ${pkgs.gnome.gnome-control-center}/bin/gnome-control-center"; categories = [ "X-Preferences" ]; terminal = false; }; home.file = { }; home.sessionVariables = { }; home.sessionPath = [ "$HOME/.local/bin" ]; home.stateVersion = "23.11"; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/.eslintrc.yml ================================================ env: es2021: true extends: eslint:recommended overrides: [] parserOptions: ecmaVersion: latest sourceType: 'module' rules: arrow-parens: - error - as-needed comma-dangle: - error - always-multiline comma-spacing: - error - before: false after: true comma-style: - error - last curly: - error - multi-or-nest - consistent dot-location: - error - property eol-last: error indent: - error - 4 - SwitchCase: 1 keyword-spacing: - error - before: true lines-between-class-members: - error - always - exceptAfterSingleLine: true padded-blocks: - error - never - allowSingleLineBlocks: false prefer-const: error quotes: - error - single - avoidEscape: true semi: - error - always nonblock-statement-body-position: - error - below no-trailing-spaces: - error array-bracket-spacing: - error - never key-spacing: - error - beforeColon: false afterColon: true object-curly-spacing: - error - always no-useless-escape: - off globals: pkg: readonly ags: readonly ARGV: readonly imports: readonly print: readonly console: readonly logError: readonly ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/.gitignore ================================================ node_modules types package-lock.json weather_key setup.sh ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/.stylelintrc.yml ================================================ extends: stylelint-config-standard-scss ignoreFiles: - "**/*.js" - "**/*.ts" rules: selector-type-no-unknown: null declaration-empty-line-before: null no-descending-specificity: null selector-pseudo-class-no-unknown: null color-function-notation: legacy alpha-value-notation: number scss/operator-no-unspaced: null scss/no-global-function-names: null scss/dollar-variable-empty-line-before: null ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/config.js ================================================ import { readFile } from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; const pkgjson = JSON.parse(readFile(App.configDir + '/package.json')); const v = { ags: `v${pkg.version}`, expected: `v${pkgjson.version}`, }; function mismatch() { print(`my config expects ${v.expected}, but your ags is ${v.ags}`); App.connect('config-parsed', app => app.Quit()); return {}; } export default v.ags === v.expected ? (await import('./js/main.js')).default : mismatch(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/about/about.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PopupWindow from '../misc/PopupWindow.js'; import icons from '../icons.js'; const pkg = JSON.parse(Utils.readFile(App.configDir + '/package.json')); const show = JSON.parse(Utils.readFile(Utils.CACHE_DIR + '/show_about') || 'true'); const dontShow = () => Utils.writeFile('false', Utils.CACHE_DIR + '/show_about'); const avatar = App.configDir + '/assets/od_fsociety.png'; /** * @param {Object} o * @param {string} o.label * @param {string} o.link */ const LinkButton = ({ label, link }) => Widget.Button({ on_clicked: () => Utils.execAsync(['xdg-open', link]), child: Widget.Box({ children: [ Widget.Label({ label, hexpand: true, xalign: 0 }), Widget.Icon(icons.ui.link), ], }), }); export default () => PopupWindow({ name: 'about', transition: 'slide_down', child: Widget.Box({ vertical: true, class_name: 'window-content', children: [ Widget.Box({ class_name: 'avatar', hpack: 'center', css: `background-image: url('${avatar}');`, }), Widget.Box({ vertical: true, class_name: 'labels vertical', children: [ Widget.Label({ class_name: 'title', label: pkg.description, }), Widget.Label({ class_name: 'author', label: pkg.author, }), Widget.Label({ class_name: 'version', hpack: 'center', label: pkg.version, }), ], }), Widget.Box({ class_name: 'buttons', vertical: true, vexpand: true, vpack: 'end', children: [ LinkButton({ label: 'Support me on Ko-fi', link: pkg.kofi, }), LinkButton({ label: 'Report an Issue', link: pkg.bugs.url, }), ], }), Widget.Button({ class_name: 'dont-show', on_clicked: () => { dontShow(); App.toggleWindow('about'); }, child: Widget.Box({ children: [ Widget.Label("Don't show again"), Widget.Box({ hexpand: true }), Widget.Icon(icons.ui.close), ], }), }), ], }), }); export function showAbout(force = false) { if (show || force) App.toggleWindow('about'); } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/applauncher/AppItem.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import options from '../options.js'; import { lookUpIcon } from 'resource:///com/github/Aylur/ags/utils.js'; /** @param {import('resource:///com/github/Aylur/ags/service/applications.js').Application} app */ export default app => { const title = Widget.Label({ class_name: 'title', label: app.name, xalign: 0, vpack: 'center', truncate: 'end', }); const description = Widget.Label({ class_name: 'description', label: app.description || '', wrap: true, xalign: 0, justification: 'left', vpack: 'center', }); const icon = Widget.Icon({ icon: lookUpIcon(app.icon_name || '') ? app.icon_name || '' : '', binds: [['size', options.applauncher.icon_size]], }); const textBox = Widget.Box({ vertical: true, vpack: 'center', children: app.description ? [title, description] : [title], }); return Widget.Button({ class_name: 'app-item', setup: self => self.app = app, on_clicked: () => { App.closeWindow('applauncher'); app.launch(); }, child: Widget.Box({ children: [icon, textBox], }), }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/applauncher/Applauncher.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import PopupWindow from '../misc/PopupWindow.js'; import AppItem from './AppItem.js'; import icons from '../icons.js'; import { launchApp } from '../utils.js'; const WINDOW_NAME = 'applauncher'; const Applauncher = () => { const children = () => [ ...Applications.query('').flatMap(app => { const item = AppItem(app); return [ Widget.Separator({ hexpand: true, binds: [['visible', item, 'visible']], }), item, ]; }), Widget.Separator({ hexpand: true }), ]; const list = Widget.Box({ vertical: true, children: children(), }); const entry = Widget.Entry({ hexpand: true, primary_icon_name: icons.apps.search, // set some text so on-change works the first time text: '-', on_accept: ({ text }) => { const list = Applications.query(text || ''); if (list[0]) { App.toggleWindow(WINDOW_NAME); launchApp(list[0]); } }, on_change: ({ text }) => list.children.map(item => { if (item.app) item.visible = item.app.match(text); }), }); return Widget.Box({ vertical: true, children: [ entry, Widget.Scrollable({ hscroll: 'never', child: list, }), ], connections: [[App, (_, name, visible) => { if (name !== WINDOW_NAME) return; entry.text = ''; if (visible) entry.grab_focus(); else list.children = children(); }]], }); }; export default () => PopupWindow({ name: WINDOW_NAME, transition: 'slide_down', child: Applauncher(), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/PanelButton.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; /** * @typedef {Object} PanelButtonProps * @property {any} content * @property {string=} window */ /** * @param {import('types/widgets/button').ButtonProps & PanelButtonProps} o */ export default ({ class_name, content, window = '', connections = [], ...rest }) => { let open = false; const connection = [App, (self, win, visible) => { if (win !== window) return; if (open && !visible) { open = false; self.toggleClassName('active', false); } if (visible) { open = true; self.toggleClassName('active'); } }]; return Widget.Button({ class_name: `panel-button ${class_name}`, child: Widget.Box({ children: [content] }), connections: connections.concat([connection]), ...rest, }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/TopBar.js ================================================ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import OverviewButton from './buttons/OverviewButton.js'; import Workspaces from './buttons/Workspaces.js'; import DateButton from './buttons/DateButton.js'; import SysTray from './buttons/SysTray.js'; import ColorPicker from './buttons/ColorPicker.js'; import SystemIndicators from './buttons/SystemIndicators.js'; import PowerMenu from './buttons/PowerMenu.js'; import ScreenRecord from './buttons/ScreenRecord.js'; import BatteryBar from './buttons/BatteryBar.js'; import SubMenu from './buttons/SubMenu.js'; import Recorder from '../services/screenrecord.js'; import options from '../options.js'; import * as vars from '../variables.js'; const submenuItems = Variable(1); SystemTray.connect('changed', () => { submenuItems.setValue(SystemTray.items.length + 1); }); /** * @template T * @param {T=} service * @param {(self: T) => boolean=} condition */ const SeparatorDot = (service, condition) => { const visibility = self => { if (!options.bar.separators.value) return self.visible = false; self.visible = condition && service ? condition(service) : options.bar.separators.value; }; const conn = service ? [[service, visibility]] : []; return Widget.Separator({ connections: [['draw', visibility], ...conn], binds: [['visible', options.bar.separators]], vpack: 'center', }); }; const Start = () => Widget.Box({ class_name: 'start', children: [ OverviewButton(), SeparatorDot(), Workspaces(), Widget.Box({ hexpand: true }), ], }); const Center = () => Widget.Box({ class_name: 'center', children: [ DateButton(), ], }); const SysProgress = (type, title, unit) => Widget.Box({ class_name: `circular-progress-box ${type}`, hexpand: false, binds: [['tooltipText', vars[type], 'value', v => `${title}: ${Math.floor(v * 100)}${unit}`]], child: Widget.CircularProgress({ hexpand: true, inverted: false, class_name: `circular-progress ${type}`, binds: [['value', vars[type]]], start_at: 0.75, }), }); const End = () => Widget.Box({ class_name: 'end', children: [ Widget.Box({ hexpand: true }), SubMenu({ items: submenuItems, children: [ SysTray(), ColorPicker(), ], }), Widget.Box({ class_name: 'system-info horizontal', children: [ SysProgress('cpu', 'Cpu', '%'), SysProgress('ram', 'Ram', '%'), SysProgress('temp', 'Temperature', '°'), ], }), SeparatorDot(), ScreenRecord(), SeparatorDot(Recorder, r => r.recording), BatteryBar(Battery, b => b.available), SeparatorDot(Battery, b => b.available), SystemIndicators(), SeparatorDot(), PowerMenu(), ], }); /** @param {number} monitor */ export default monitor => Widget.Window({ name: `bar${monitor}`, class_name: 'transparent', exclusivity: 'exclusive', monitor, binds: [['anchor', options.bar.position, 'value', pos => ([ pos, 'left', 'right', ])]], child: Widget.CenterBox({ class_name: 'panel', start_widget: Start(), center_widget: Center(), end_widget: End(), }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/BatteryBar.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import icons from '../../icons.js'; import FontIcon from '../../misc/FontIcon.js'; import options from '../../options.js'; import PanelButton from '../PanelButton.js'; const Indicator = () => Widget.Stack({ items: [ ['true', FontIcon(icons.battery.charging)], ], binds: [['visible', options.battery.bar.show_icon]], connections: [[Battery, stack => { stack.shown = `${Battery.charging || Battery.charged}`; }]], }); const PercentLabel = () => Widget.Revealer({ transition: 'slide_right', binds: [['reveal-child', options.battery.show_percentage]], child: Widget.Label({ binds: [['label', Battery, 'percent', p => `${p}%`]], }), }); const LevelBar = () => Widget.LevelBar({ connections: [[options.battery.bar.full, self => { const full = options.battery.bar.full.value; self.vpack = full ? 'fill' : 'center'; self.hpack = full ? 'fill' : 'center'; }]], binds: [['value', Battery, 'percent', p => p / 100]], }); const WholeButton = () => Widget.Overlay({ class_name: 'whole-button', child: LevelBar(), pass_through: true, overlays: [Widget.Box({ hpack: 'center', children: [ FontIcon({ icon: icons.battery.charging, binds: [['visible', Battery, 'charging']], }), Widget.Box({ hpack: 'center', vpack: 'center', child: PercentLabel(), }), ], })], }); export default () => PanelButton({ class_name: 'battery-bar', on_clicked: () => { const v = options.battery.show_percentage.value; options.battery.show_percentage.value = !v; }, content: Widget.Box({ connections: [ [Battery, w => { w.toggleClassName('charging', Battery.charging || Battery.charged); w.toggleClassName('medium', Battery.percent < options.battery.medium.value); w.toggleClassName('low', Battery.percent < options.battery.low.value); w.toggleClassName('half', Battery.percent < 48); }], ], binds: [ ['visible', Battery, 'available'], ['children', options.battery.bar.full, 'value', full => full ? [WholeButton()] : [ Indicator(), PercentLabel(), LevelBar(), ]], ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/ColorPicker.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Colors from '../../services/colorpicker.js'; import PanelButton from '../PanelButton.js'; import Gdk from 'gi://Gdk'; export default () => PanelButton({ class_name: 'color-picker', content: Widget.Icon('color-select-symbolic'), binds: [['tooltip-text', Colors, 'colors', v => `${v.length} colors`]], on_clicked: () => Colors.pick(), on_secondary_click: btn => { if (Colors.colors.length === 0) return; Widget.Menu({ class_name: 'colorpicker', children: Colors.colors.map(color => Widget.MenuItem({ child: Widget.Label(color), css: `background-color: ${color}`, on_activate: () => Colors.wlCopy(color), })), }).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null); }, }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/DateButton.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Clock from '../../misc/Clock.js'; import PanelButton from '../PanelButton.js'; export default ({ format = '%d.%m.%y - %H:%M' } = {}) => PanelButton({ class_name: 'dashboard panel-button', on_clicked: () => App.toggleWindow('dashboard'), window: 'dashboard', content: Clock({ format }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/FocusedClient.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import PanelButton from '../PanelButton.js'; import options from '../../options.js'; import { substitute } from '../../utils.js'; export const ClientLabel = () => Widget.Label({ binds: [['label', Hyprland.active.client, 'class', c => { const { titles } = options.substitutions; return substitute(titles, c); }]], }); export const ClientIcon = () => Widget.Icon({ connections: [[Hyprland.active.client, self => { const { icons } = options.substitutions; const { client } = Hyprland.active; const classIcon = substitute(icons, client.class) + '-symbolic'; const titleIcon = substitute(icons, client.class) + '-symbolic'; const hasTitleIcon = Utils.lookUpIcon(titleIcon); const hasClassIcon = Utils.lookUpIcon(classIcon); if (hasClassIcon) self.icon = classIcon; if (hasTitleIcon) self.icon = titleIcon; self.visible = !!(hasTitleIcon || hasClassIcon); }]], }); export default () => PanelButton({ class_name: 'focused-client', content: Widget.Box({ children: [ ClientIcon(), ClientLabel(), ], binds: [['tooltip-text', Hyprland.active, 'client', c => c.title]], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/MediaIndicator.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; import * as mpris from '../../misc/mpris.js'; import options from '../../options.js'; export const getPlayer = (name = options.mpris.preferred.value) => Mpris.getPlayer(name) || Mpris.players[0] || null; /** * @param {Object} o * @param {import('types/service/mpris').MprisPlayer} o.player * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ const Indicator = ({ player, direction = 'right' }) => HoverRevealer({ class_name: `media panel-button ${player.name}`, direction, on_primary_click: () => player.playPause(), on_scroll_up: () => player.next(), on_scroll_down: () => player.previous(), on_secondary_click: () => player.playPause(), indicator: mpris.PlayerIcon(player), child: Widget.Label({ vexpand: true, truncate: 'end', max_width_chars: 40, connections: [[player, label => { label.label = `${player.track_artists.join(', ')} - ${player.track_title}`; }]], }), connections: [[player, revealer => { if (revealer._current === player.track_title) return; revealer._current = player.track_title; revealer.reveal_child = true; Utils.timeout(3000, () => { revealer.reveal_child = false; }); }]], }); /** * @param {Object} o * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ export default ({ direction = 'right' } = {}) => { let current = null; const update = box => { const player = getPlayer(); box.visible = !!player; if (!player) { current = null; return; } if (current === player) return; current = player; box.children = [Indicator({ player, direction })]; }; return Widget.Box({ connections: [ [options.mpris.preferred, update], [Mpris, update, 'notify::players'], ], }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/NotificationIndicator.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; /** * @param {Object} o * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ export default ({ direction = 'left' } = {}) => HoverRevealer({ class_name: 'notifications panel-button', eventboxConnections: [ ['button-press-event', () => App.openWindow('dashboard')], [Notifications, box => box.visible = Notifications.notifications.length > 0 || Notifications.dnd], ], connections: [[Notifications, revealer => { const title = Notifications.notifications[0]?.summary; if (revealer._title === title) return; revealer._title = title; revealer.reveal_child = true; Utils.timeout(3000, () => { revealer.reveal_child = false; }); }]], direction, indicator: Widget.Icon({ binds: [['icon', Notifications, 'dnd', dnd => dnd ? icons.notifications.silent : icons.notifications.noisy, ]], }), child: Widget.Label({ truncate: 'end', max_width_chars: 40, binds: [['label', Notifications, 'notifications', n => n.reverse()[0]?.summary || '']], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/OverviewButton.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import PanelButton from '../PanelButton.js'; import FontIcon from '../../misc/FontIcon.js'; import { distroIcon } from '../../variables.js'; import options from '../../options.js'; export default () => PanelButton({ class_name: 'overview', window: 'overview', on_clicked: () => App.toggleWindow('overview'), content: FontIcon({ binds: [['icon', options.bar.icon, 'value', v => { return v === 'distro-icon' ? distroIcon : v; }]], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/PowerMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import icons from '../../icons.js'; import PanelButton from '../PanelButton.js'; export default () => PanelButton({ class_name: 'powermenu', content: Widget.Icon(icons.powermenu.shutdown), on_clicked: () => App.openWindow('powermenu'), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/ScreenRecord.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import Recorder from '../../services/screenrecord.js'; import icons from '../../icons.js'; export default () => PanelButton({ class_name: 'recorder', on_clicked: () => Recorder.stop(), binds: [['visible', Recorder, 'recording']], content: Widget.Box({ children: [ Widget.Icon(icons.recorder.recording), Widget.Label({ binds: [['label', Recorder, 'timer', time => { const sec = time % 60; const min = Math.floor(time / 60); return `${min}:${sec < 10 ? '0' + sec : sec}`; }]], }), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/SubMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import icons from '../../icons.js'; import options from '../../options.js'; /** * @param {import('types/widgets/revealer').default} revealer * @param {'left' | 'right' | 'up' | 'down'} direction * @param {import('types/variable').Variable} items */ const Arrow = (revealer, direction, items) => { let deg = 0; const icon = Widget.Icon({ icon: icons.ui.arrow[direction], }); const animate = () => { const t = options.transition.value / 20; const step = revealer.reveal_child ? 10 : -10; for (let i = 0; i < 18; ++i) { Utils.timeout(t * i, () => { deg += step; icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); }); } }; return Widget.Button({ class_name: 'panel-button sub-menu', connections: [[items, btn => { btn.tooltip_text = `${items.value} Items`; }]], on_clicked: () => { animate(); revealer.reveal_child = !revealer.reveal_child; }, child: icon, }); }; /** * @param {Object} o * @param {import('types/widgets/box').default['children']} o.children * @param {'left' | 'right' | 'up' | 'down'=} o.direction * @param {import('types/variable').Variable} o.items */ export default ({ children, direction = 'left', items = Variable(0) }) => { const posStart = direction === 'up' || direction === 'left'; const posEnd = direction === 'down' || direction === 'right'; const revealer = Widget.Revealer({ transition: `slide_${direction}`, child: Widget.Box({ children, }), }); return Widget.Box({ vertical: direction === 'up' || direction === 'down', children: [ posStart && revealer, Arrow(revealer, direction, items), posEnd && revealer, ], }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/SysTray.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; import PanelButton from '../PanelButton.js'; import Gdk from 'gi://Gdk'; /** @param {import('types/service/systemtray').TrayItem} item */ const SysTrayItem = item => PanelButton({ class_name: 'tray-item', content: Widget.Icon({ binds: [['icon', item, 'icon']] }), binds: [['tooltipMarkup', item, 'tooltip-markup']], setup: self => { const id = item.menu?.connect('popped-up', menu => { self.toggleClassName('active'); menu.connect('notify::visible', menu => { self.toggleClassName('active', menu.visible); }); menu.disconnect(id); }); if (id) self.connect('destroy', () => item.menu?.disconnect(id)); }, // @ts-expect-error popup_at_widget missing from types? on_primary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), // @ts-expect-error popup_at_widget missing from types? on_secondary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), }); export default () => Widget.Box({ binds: [['children', SystemTray, 'items', i => i.map(SysTrayItem)]], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/System.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import * as variables from '../../variables.js'; import icons from '../../icons.js'; /** @param {'cpu' | 'ram'} type */ const System = type => { const icon = Widget.Icon({ class_name: 'icon', icon: icons.system[type], }); const progress = Widget.Box({ class_name: 'progress', child: Widget.CircularProgress({ binds: [['value', variables[type]]], }), }); const revealer = Widget.Revealer({ transition: 'slide_right', child: Widget.Label({ binds: [['label', variables[type], 'value', v => { return ` ${type}: ${Math.round(v * 100)}%`; }]], }), }); return PanelButton({ class_name: `system ${type}`, on_clicked: () => revealer.reveal_child = !revealer.reveal_child, content: Widget.EventBox({ on_hover: () => revealer.reveal_child = true, on_hover_lost: () => revealer.reveal_child = false, child: Widget.Box({ children: [ icon, Widget.Box({ class_name: 'revealer', child: revealer, }), progress, ], }), }), }); }; export const CPU = () => System('cpu'); export const RAM = () => System('ram'); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/SystemIndicators.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Network from 'resource:///com/github/Aylur/ags/service/network.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; import PanelButton from '../PanelButton.js'; import Asusctl from '../../services/asusctl.js'; import Indicator from '../../services/onScreenIndicator.js'; import icons from '../../icons.js'; import FontIcon from '../../misc/FontIcon.js'; const ProfileIndicator = () => Widget.Icon() .bind('visible', Asusctl, 'profile', p => p !== 'Balanced') .bind('icon', Asusctl, 'profile', i => icons.asusctl.profile[i]); const ModeIndicator = () => FontIcon() .bind('visible', Asusctl, 'mode', m => m !== 'Hybrid') .bind('icon', Asusctl, 'mode', i => icons.asusctl.mode[i]); const MicrophoneIndicator = () => Widget.Icon().hook(Audio, icon => { if (!Audio.microphone) return; const { muted, low, medium, high } = icons.audio.mic; if (Audio.microphone.is_muted) return icon.icon = muted; /** @type {Array<[number, string]>} */ const cons = [[67, high], [34, medium], [1, low], [0, muted]]; icon.icon = cons.find(([n]) => n <= Audio.microphone.volume * 100)?.[1] || ''; icon.visible = Audio.recorders.length > 0 || Audio.microphone.is_muted; }, 'speaker-changed'); const DNDIndicator = () => Widget.Icon({ visible: Notifications.bind('dnd'), icon: icons.notifications.silent, }); const BluetoothDevicesIndicator = () => Widget.Box().hook(Bluetooth, box => { box.children = Bluetooth.connectedDevices .map(({ iconName, name }) => HoverRevealer({ indicator: Widget.Icon(iconName + '-symbolic'), child: Widget.Label(name), })); box.visible = Bluetooth.connectedDevices.length > 0; }, 'notify::connected-devices'); const BluetoothIndicator = () => Widget.Icon({ class_name: 'bluetooth', icon: icons.bluetooth.enabled, visible: Bluetooth.bind('enabled'), }); const NetworkIndicator = () => Widget.Icon().hook(Network, self => { const icon = Network[Network.primary || 'wifi']?.iconName; self.icon = icon || ''; self.visible = !!icon; }); const AudioIndicator = () => Widget.Icon().hook(Audio, self => { if (!Audio.speaker) return; const { muted, low, medium, high, overamplified } = icons.audio.volume; if (Audio.speaker.is_muted) return self.icon = muted; /** @type {Array<[number, string]>} */ const cons = [[101, overamplified], [67, high], [34, medium], [1, low], [0, muted]]; self.icon = cons.find(([n]) => n <= Audio.speaker.volume * 100)?.[1] || ''; }, 'speaker-changed'); export default () => PanelButton({ class_name: 'quicksettings panel-button', on_clicked: () => App.toggleWindow('quicksettings'), setup: self => self .hook(App, (_, win, visible) => { self.toggleClassName('active', win === 'quicksettings' && visible); }), on_scroll_up: () => { Audio.speaker.volume += 0.02; Indicator.speaker(); }, on_scroll_down: () => { Audio.speaker.volume -= 0.02; Indicator.speaker(); }, content: Widget.Box({ children: [ Asusctl?.available && ProfileIndicator(), Asusctl?.available && ModeIndicator(), DNDIndicator(), BluetoothDevicesIndicator(), BluetoothIndicator(), NetworkIndicator(), AudioIndicator(), MicrophoneIndicator(), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/Taskbar.js ================================================ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import { launchApp } from '../../utils.js'; import icons from '../../icons.js'; const focus = ({ address }) => Hyprland.sendMessage(`dispatch focuswindow address:${address}`); /** @param {import('types/widgets/box').default} box */ const setChildren = box => box.children = Hyprland.clients.map(client => { if (Hyprland.active.workspace.id !== client.workspace.id) return; for (const app of Applications.list) { if (client.class && app.match(client.class)) { return PanelButton({ content: Widget.Icon(app.icon_name || icons.fallback.executable), tooltip_text: app.name, on_primary_click: () => focus(client), on_middle_click: () => launchApp(app), }); } } }); export default () => Widget.Box({ connections: [ [Hyprland, setChildren, 'notify::clients'], [Hyprland, setChildren, 'notify::active'], ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/bar/buttons/Workspaces.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import options from '../../options.js'; import { range } from '../../utils.js'; /** @param {any} arg */ const dispatch = arg => Utils.execAsync(`hyprctl dispatch workspace ${arg}`); const Workspaces = () => { const ws = options.workspaces.value; return Widget.Box({ children: range(ws || 20).map(i => Widget.Button({ setup: btn => btn.id = i, on_clicked: () => dispatch(i), child: Widget.Label({ label: `${i}`, class_name: 'indicator', vpack: 'center', }), connections: [[Hyprland, btn => { btn.toggleClassName('active', Hyprland.active.workspace.id === i); btn.toggleClassName('occupied', Hyprland.getWorkspace(i)?.windows > 0); }]], })), connections: ws ? [] : [[Hyprland.active.workspace, box => box.children.map(btn => { btn.visible = Hyprland.workspaces.some(ws => ws.id === btn.id); })]], }); }; export default () => Widget.EventBox({ class_name: 'workspaces panel-button', child: Widget.Box({ // its nested like this to keep it consistent with other PanelButton widgets child: Widget.EventBox({ on_scroll_up: () => dispatch('m+1'), on_scroll_down: () => dispatch('m-1'), class_name: 'eventbox', binds: [['child', options.workspaces, 'value', Workspaces]], }), }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/dashboard/Dashboard.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import DateColumn from './DateColumn.js'; import NotificationColumn from './NotificationColumn.js'; import PopupWindow from '../misc/PopupWindow.js'; import options from '../options.js'; export default () => PopupWindow({ name: 'dashboard', connections: [[options.bar.position, self => { self.anchor = [options.bar.position.value]; self.transition = 'crossfade'; }]], child: Widget.Box({ children: [ NotificationColumn(), Widget.Separator({ orientation: 1 }), DateColumn(), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/dashboard/DateColumn.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Clock from '../misc/Clock.js'; import * as vars from '../variables.js'; export default () => Widget.Box({ vertical: true, class_name: 'datemenu vertical', children: [ Widget.Box({ class_name: 'clock-box', vertical: true, children: [ Clock({ format: '%H:%M' }), Widget.Label({ class_name: 'uptime', binds: [['label', vars.uptime, 'value', t => `uptime: ${t}`]], }), ], }), Widget.Box({ class_name: 'calendar', children: [ Widget.Calendar({ hexpand: true, hpack: 'center', }), ], }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/dashboard/NotificationColumn.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import icons from '../icons.js'; import Notification from '../misc/Notification.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; const ClearButton = () => Widget.Button({ on_clicked: () => { const list = Array.from(Notifications.notifications); for (let i = 0; i < list.length; i++) timeout(50 * i, () => list[i]?.close()); }, binds: [['sensitive', Notifications, 'notifications', n => n.length > 0]], child: Widget.Box({ children: [ Widget.Label('Clear '), Widget.Icon({ binds: [['icon', Notifications, 'notifications', n => n.length > 0 ? icons.trash.full : icons.trash.empty]], }), ], }), }); const Header = () => Widget.Box({ class_name: 'header', children: [ Widget.Label({ label: 'Notifications', hexpand: true, xalign: 0 }), ClearButton(), ], }); const NotificationList = () => Widget.Box({ vertical: true, vexpand: true, connections: [[Notifications, box => { box.children = Notifications.notifications .reverse().map(Notification); box.visible = Notifications.notifications.length > 0; }]], }); const Placeholder = () => Widget.Box({ class_name: 'placeholder', vertical: true, vpack: 'center', hpack: 'center', vexpand: true, hexpand: true, children: [ Widget.Icon(icons.notifications.silent), Widget.Label('Your inbox is empty'), ], binds: [['visible', Notifications, 'notifications', n => n.length === 0]], }); export default () => Widget.Box({ class_name: 'notifications', vertical: true, children: [ Header(), Widget.Scrollable({ vexpand: true, class_name: 'notification-scrollable', child: Widget.Box({ class_name: 'notification-list', vertical: true, children: [ NotificationList(), Placeholder(), ], }), }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/desktop/Desktop.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Clock from '../misc/Clock.js'; import DesktopMenu from './DesktopMenu.js'; import options from '../options.js'; const DesktopClock = () => Widget.Box({ class_name: 'clock-box-shadow', child: Widget.CenterBox({ class_name: 'clock-box', children: [ Clock({ class_name: 'clock', hpack: 'center', format: '%H', }), Widget.Box({ class_name: 'separator-box', vertical: true, hexpand: true, hpack: 'center', children: [ Widget.Separator({ vpack: 'center', vexpand: true }), Widget.Separator({ vpack: 'center', vexpand: true }), ], }), Clock({ class_name: 'clock', hpack: 'center', format: '%M', }), ], }), }); const Desktop = () => Widget.EventBox({ on_secondary_click: (_, event) => DesktopMenu().popup_at_pointer(event), child: Widget.Box({ vertical: true, vexpand: true, hexpand: true, binds: [['visible', options.desktop.clock.enable]], connections: [[options.desktop.clock.position, box => { const [hpack = 'center', vpack = 'center', offset = 64] = options.desktop.clock.position.value.split(' ') || []; // @ts-expect-error box.hpack = hpack; box.vpack = vpack; box.setCss(`margin: ${Number(offset)}px;`); }]], children: [ DesktopClock(), Clock({ format: '%B %e. %A', class_name: 'date' }), ], }), }); /** @param {number} monitor */ export default monitor => Widget.Window({ monitor, name: `desktop${monitor}`, layer: 'background', class_name: 'desktop', anchor: ['top', 'bottom', 'left', 'right'], child: Desktop(), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/desktop/DesktopMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import PowerMenu from '../services/powermenu.js'; import icons from '../icons.js'; import Gtk from 'gi://Gtk'; import { openSettings } from '../settings/theme.js'; /** * @param {string} label * @param {string} icon * @param {import('types/widgets/menu').MenuItemProps['on_activate']} on_activate */ const Item = (label, icon, on_activate) => Widget.MenuItem({ on_activate, child: Widget.Box({ children: [ Widget.Icon(icon), Widget.Label({ label, hexpand: true, xalign: 0, }), ], }), }); export default () => Widget.Menu({ class_name: 'desktop-menu', children: [ Widget.MenuItem({ child: Widget.Box({ children: [ Widget.Icon(icons.powermenu.shutdown), Widget.Label({ label: 'System', hexpand: true, xalign: 0, }), ], }), submenu: Widget.Menu({ children: [ Item('Shutdown', icons.powermenu.shutdown, () => PowerMenu.action('shutdown')), Item('Log Out', icons.powermenu.logout, () => PowerMenu.action('logout')), Item('Reboot', icons.powermenu.reboot, () => PowerMenu.action('reboot')), Item('Sleep', icons.powermenu.sleep, () => PowerMenu.action('reboot')), ], }), }), Item('Applications', icons.apps.apps, () => App.openWindow('applauncher')), new Gtk.SeparatorMenuItem, Item('Settings', icons.ui.settings, openSettings), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/dock/Dock.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../icons.js'; import options from '../options.js'; import { launchApp, range } from '../utils.js'; const focus = ({ address }) => Hyprland.sendMessage(`dispatch focuswindow address:${address}`); /** @param {import('types/widgets/button').ButtonProps & { icon: string, pinned?: boolean }} o */ const AppButton = ({ icon, pinned = false, ...rest }) => { const indicators = Widget.Box({ vpack: 'end', hpack: 'center', children: range(5, 0).map(() => Widget.Box({ class_name: 'indicator', visible: false, })), }); const button = Widget.Button({ ...rest, child: Widget.Box({ class_name: 'box', child: Widget.Overlay({ child: Widget.Icon({ icon, binds: [['size', options.desktop.dock.icon_size]], }), pass_through: true, overlays: pinned ? [indicators] : [], }), }), }); return Object.assign(button, { indicators }); }; const Taskbar = () => Widget.Box({ binds: [['children', Hyprland, 'clients', c => c.map(client => { for (const appName of options.desktop.dock.pinned_apps.value) { if (client.class.toLowerCase().includes(appName.toLowerCase())) return null; } for (const app of Applications.list) { if (client.title && app.match(client.title) || client.class && app.match(client.class)) { return AppButton({ icon: app.icon_name || '', tooltip_text: app.name, on_primary_click: () => focus(client), on_middle_click: () => launchApp(app), }); } } })]], }); const PinnedApps = () => Widget.Box({ class_name: 'pins', homogeneous: true, binds: [['children', options.desktop.dock.pinned_apps, 'value', v => v .map(term => ({ app: Applications.query(term)?.[0], term })) .filter(({ app }) => app) .map(({ app, term = true }) => AppButton({ pinned: true, icon: app.icon_name || '', on_primary_click: () => { for (const client of Hyprland.clients) { if (client.class.toLowerCase().includes(term)) return focus(client); } launchApp(app); }, on_middle_click: () => launchApp(app), tooltip_text: app.name, connections: [[Hyprland, button => { const running = Hyprland.clients .filter(client => client.class.toLowerCase().includes(term)); const focused = running.find(client => client.address === Hyprland.active.client.address); const index = running.findIndex(c => c === focused); for (let i = 0; i < 5; ++i) { const indicator = button.indicators.children[i]; indicator.visible = i < running.length; indicator.toggleClassName('focused', i === index); } button.set_tooltip_text(running.length === 1 ? running[0].title : app.name); }]], })), ]], }); export default () => { const pinnedapps = PinnedApps(); const taskbar = Taskbar(); const applauncher = AppButton({ class_name: 'launcher nonrunning', icon: icons.apps.apps, tooltip_text: 'Applications', on_clicked: () => App.toggleWindow('applauncher'), }); const separator = Widget.Separator({ vpack: 'center', hpack: 'center', orientation: 1, connections: [[Hyprland, box => box.visible = taskbar.children.length > 0]], }); return Widget.Box({ class_name: 'dock', children: [applauncher, pinnedapps, separator, taskbar], }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/dock/FloatingDock.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Dock from './Dock.js'; import options from '../options.js'; /** @param {number} monitor */ export default monitor => { const revealer = Widget.Revealer({ transition: 'slide_up', child: Dock(), setup: self => { const update = () => { const ws = Hyprland.getWorkspace(Hyprland.active.workspace.id); if (Hyprland.getMonitor(monitor)?.name === ws?.monitor) self.reveal_child = ws?.windows === 0; }; self .hook(Hyprland, update, 'client-added') .hook(Hyprland, update, 'client-removed') .hook(Hyprland.active.workspace, update); }, }); return Widget.Window({ monitor, name: `dock${monitor}`, class_name: 'floating-dock', anchor: ['bottom'], child: Widget.Box({ children: [ revealer, Widget.Box({ class_name: 'padding', css: 'padding: 2px;', }), ], }), connections: [ ['enter-notify-event', () => { revealer.reveal_child = true; }], ['leave-notify-event', () => { revealer.reveal_child = false; }], ], binds: [['visible', options.bar.position, 'value', v => v !== 'bottom']], }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/icons.js ================================================ export default { lock: 'system-lock-screen-symbolic', fallback: { executable: 'application-x-executable-symbolic', }, audio: { mic: { muted: 'microphone-disabled-symbolic', low: 'microphone-sensitivity-low-symbolic', medium: 'microphone-sensitivity-medium-symbolic', high: 'microphone-sensitivity-high-symbolic', }, volume: { muted: 'audio-volume-muted-symbolic', low: 'audio-volume-low-symbolic', medium: 'audio-volume-medium-symbolic', high: 'audio-volume-high-symbolic', overamplified: 'audio-volume-overamplified-symbolic', }, type: { headset: 'audio-headphones-symbolic', speaker: 'audio-speakers-symbolic', card: 'audio-card-symbolic', }, mixer: '', }, asusctl: { profile: { Balanced: 'power-profile-balanced-symbolic', Quiet: 'power-profile-power-saver-symbolic', Performance: 'power-profile-performance-symbolic', }, mode: { Integrated: '', Hybrid: '󰢮', }, }, apps: { apps: 'view-app-grid-symbolic', search: 'folder-saved-search-symbolic', }, battery: { charging: '󱐋', warning: 'battery-empty-symbolic', }, bluetooth: { enabled: 'bluetooth-active-symbolic', disabled: 'bluetooth-disabled-symbolic', }, brightness: { indicator: 'display-brightness-symbolic', keyboard: 'keyboard-brightness-symbolic', screen: 'display-brightness-symbolic', }, powermenu: { sleep: 'weather-clear-night-symbolic', reboot: 'system-reboot-symbolic', logout: 'system-log-out-symbolic', shutdown: 'system-shutdown-symbolic', }, recorder: { recording: 'media-record-symbolic', }, notifications: { noisy: 'preferences-system-notifications-symbolic', silent: 'notifications-disabled-symbolic', }, trash: { full: 'user-trash-full-symbolic', empty: 'user-trash-symbolic', }, mpris: { fallback: 'audio-x-generic-symbolic', shuffle: { enabled: '󰒟', disabled: '󰒟', }, loop: { none: '󰓦', track: '󰓦', playlist: '󰑐', }, playing: '󰏦', paused: '󰐍', stopped: '󰐍', prev: '󰒮', next: '󰒭', }, ui: { close: 'window-close-symbolic', info: 'info-symbolic', menu: 'open-menu-symbolic', link: 'web-browser-symbolic', settings: 'emblem-system-symbolic', tick: 'object-select-symbolic', arrow: { right: 'pan-end-symbolic', left: 'pan-start-symbolic', down: 'pan-down-symbolic', up: 'pan-up-symbolic', }, }, system: { cpu: 'org.gnome.SystemMonitor-symbolic', ram: 'drive-harddisk-solidstate-symbolic', temp: 'temperature-symbolic', }, dialog: { Search: '', Applauncher: '󰵆', Bar: '', Border: '󰃇', Color: '󰏘', Desktop: '', Font: '', General: '󰒓', Miscellaneous: '󰠱', Theme: '󰃟', Notifications: '󰂚 ', }, }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/lockscreen/Lockscreen.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Avatar from '../misc/Avatar.js'; import Lockscreen from '../services/lockscreen.js'; import Layer from 'gi://GtkLayerShell'; const PasswordEntry = () => Widget.Box({ children: [ Widget.Entry({ connections: [[Lockscreen, entry => entry.text = '', 'lock']], visibility: false, placeholder_text: 'Password', on_accept: ({ text }) => Lockscreen.auth(text || ''), hpack: 'center', hexpand: true, }), Widget.Spinner({ active: true, vpack: 'center', connections: [[Lockscreen, (w, auth) => w.visible = auth, 'authenticating']], }), ], }); /** @param {number} monitor */ export default monitor => { const win = Widget.Window({ name: `lockscreen${monitor}`, class_name: 'lockscreen', monitor, layer: 'overlay', visible: false, connections: [[Lockscreen, (w, lock) => w.visible = lock, 'lock']], child: Widget.Box({ css: 'min-width: 3000px; min-height: 2000px;', class_name: 'shader', child: Widget.Box({ class_name: 'content', vertical: true, hexpand: true, vexpand: true, hpack: 'center', vpack: 'center', children: [ Avatar({ hpack: 'center', vpack: 'center', }), PasswordEntry(), ], }), }), }); Layer.set_keyboard_mode(win, Layer.KeyboardMode.EXCLUSIVE); return win; }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/lockscreen/auth.py ================================================ #! /usr/bin/env python import pam import sys import getpass print(pam.authenticate(getpass.getuser(), sys.argv[1])); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/main.js ================================================ import Applauncher from './applauncher/Applauncher.js'; import Dashboard from './dashboard/Dashboard.js'; import Desktop from './desktop/Desktop.js'; import FloatingDock from './dock/FloatingDock.js'; import Lockscreen from './lockscreen/Lockscreen.js'; import Notifications from './notifications/Notifications.js'; import OSD from './osd/OSD.js'; import Overview from './overview/Overview.js'; import PowerMenu from './powermenu/PowerMenu.js'; import QuickSettings from './quicksettings/QuickSettings.js'; import ScreenCorners from './screencorner/ScreenCorners.js'; import TopBar from './bar/TopBar.js'; import Verification from './powermenu/Verification.js'; import About from './about/about.js'; import { init } from './settings/setup.js'; import { forMonitors } from './utils.js'; import { initWallpaper } from './settings/wallpaper.js'; import options from './options.js'; initWallpaper(); const windows = () => [ forMonitors(FloatingDock), forMonitors(Lockscreen), forMonitors(Notifications), forMonitors(OSD), forMonitors(ScreenCorners), forMonitors(TopBar), Applauncher(), Dashboard(), Overview(), PowerMenu(), QuickSettings(), Verification(), About(), ]; export default { onConfigParsed: init, windows: windows().flat(1), maxStreamVolume: 1.05, cacheNotificationActions: false, closeWindowDelay: { 'quicksettings': options.transition.value, 'dashboard': options.transition.value, }, }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/Avatar.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import options from '../options.js'; /** @param {import('types/widgets/box').BoxProps=} props */ export default props => Widget.Box({ ...props, class_name: 'avatar', connections: [ [options.desktop.avatar, box => box.setCss(` background-image: url('${options.desktop.avatar.value}'); background-size: cover; `)], ['draw', box => { const h = box.get_allocated_height(); box.set_size_request(Math.ceil(h * 1.1), -1); }], ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/BatteryIcon.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; export default () => Widget.Icon({ class_name: 'battery', binds: [['icon', Battery, 'icon-name']], connections: [[Battery, icon => { icon.toggleClassName('charging', Battery.charging); icon.toggleClassName('charged', Battery.charged); icon.toggleClassName('low', Battery.percent < 30); }]], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/Clock.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import GLib from 'gi://GLib'; /** * @param {import('types/widgets/label').Props & { * format?: string, * interval?: number, * }} o */ export default ({ format = '%H:%M:%S %B %e. %A', interval = 1000, ...rest } = {}) => Widget.Label({ class_name: 'clock', ...rest, connections: [[interval, label => label.label = GLib.DateTime.new_now_local().format(format) || 'wrong format', ]], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/FontIcon.js ================================================ import Gtk from 'gi://Gtk'; import { createCtor } from 'resource:///com/github/Aylur/ags/widget.js'; import AgsLabel from 'resource:///com/github/Aylur/ags/widgets/label.js'; import GObject from 'gi://GObject'; export default createCtor(class FontIcon extends AgsLabel { static { GObject.registerClass(this); } /** @param {string | import('types/widgets/label').Props & { icon?: string }} params */ constructor(params = '') { // @ts-expect-error const { icon = '', ...rest } = params; super(typeof params === 'string' ? {} : rest); this.toggleClassName('font-icon'); if (typeof params === 'object') this.icon = icon; if (typeof params === 'string') this.icon = params; } get icon() { return this.label; } set icon(icon) { this.label = icon; } get size() { return this.get_style_context() .get_property('font-size', Gtk.StateFlags.NORMAL); } /** @returns {[number, number]} */ vfunc_get_preferred_height() { return [this.size, this.size]; } /** @returns {[number, number]} */ vfunc_get_preferred_width() { return [this.size, this.size]; } }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/HoverRevealer.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; /** * @typedef {import('types/widgets/eventbox').EventBoxProps & { * indicator?: import('types/widgets/box').BoxProps['child'] * direction?: 'left' | 'right' | 'down' | 'up' * duration?: number * eventboxConnections?: import('types/widgets/box').BoxProps['connections'] * connections?: import('types/widgets/revealer').RevealerProps['connections'] * }} HoverRevealProps */ /** * @param {HoverRevealProps} props */ export default ({ indicator, child, direction = 'left', duration = 300, connections = [], eventboxConnections = [], binds = [], ...rest }) => { let open = false; const vertical = direction === 'down' || direction === 'up'; const posStart = direction === 'down' || direction === 'right'; const posEnd = direction === 'up' || direction === 'left'; const revealer = Widget.Revealer({ transition: `slide_${direction}`, connections, binds, transition_duration: duration, child, }); const eventbox = Widget.EventBox({ ...rest, connections: eventboxConnections, on_hover: () => { if (open) return; revealer.reveal_child = true; Utils.timeout(duration, () => open = true); }, on_hover_lost: () => { if (!open) return; revealer.reveal_child = false; open = false; }, child: Widget.Box({ vertical, children: [ posStart && indicator, revealer, posEnd && indicator, ], }), }); return Widget.Box({ children: [eventbox], }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/IconBrowser.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import RegularWindow from './RegularWindow.js'; import Gtk from 'gi://Gtk'; export default () => { const selected = Widget.Label({ css: 'font-size: 1.2em;', }); const flowbox = Widget.FlowBox({ min_children_per_line: 10, setup: self => { self.connect('child-activated', (_, child) => { selected.label = child.get_child().iconName; }); Gtk.IconTheme.get_default().list_icons(null).sort().map(icon => { !icon.endsWith('.symbolic') && self.insert(Widget.Icon({ icon, size: 38, }), -1); }); self.show_all(); }, }); const entry = Widget.Entry({ on_change: ({ text }) => flowbox.get_children().forEach(child => { child.visible = child.get_child().iconName.includes(text); }), }); return RegularWindow({ name: 'icons', visible: true, child: Widget.Box({ css: 'padding: 30px;', spacing: 20, vertical: true, children: [ entry, Widget.Scrollable({ hscroll: 'never', vscroll: 'always', hexpand: true, vexpand: true, css: 'min-width: 500px;' + 'min-height: 500px;', child: flowbox, }), selected, ], }), }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/Notification.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import GLib from 'gi://GLib'; /** @param {import('types/service/notifications').Notification} n */ const NotificationIcon = ({ app_entry, app_icon, image }) => { if (image) { return Widget.Box({ vpack: 'start', hexpand: false, class_name: 'icon img', css: ` background-image: url("${image}"); background-size: cover; background-repeat: no-repeat; background-position: center; min-width: 78px; min-height: 78px; `, }); } let icon = 'dialog-information-symbolic'; if (Utils.lookUpIcon(app_icon)) icon = app_icon; if (Utils.lookUpIcon(app_entry || '')) icon = app_entry || ''; return Widget.Box({ vpack: 'start', hexpand: false, class_name: 'icon', css: ` min-width: 78px; min-height: 78px; `, child: Widget.Icon({ icon, size: 58, hpack: 'center', hexpand: true, vpack: 'center', vexpand: true, }), }); }; /** @param {import('types/service/notifications').Notification} notification */ export default notification => { const content = Widget.Box({ class_name: 'content', children: [ NotificationIcon(notification), Widget.Box({ hexpand: true, vertical: true, children: [ Widget.Box({ children: [ Widget.Label({ class_name: 'title', xalign: 0, justification: 'left', hexpand: true, max_width_chars: 24, truncate: 'end', wrap: true, label: notification.summary, use_markup: true, }), Widget.Label({ class_name: 'time', vpack: 'start', label: GLib.DateTime.new_from_unix_local(notification.time).format('%H:%M'), }), Widget.Button({ class_name: 'close-button', vpack: 'start', child: Widget.Icon('window-close-symbolic'), on_clicked: () => notification.close(), }), ], }), Widget.Label({ class_name: 'description', hexpand: true, use_markup: true, xalign: 0, justification: 'left', label: notification.body, wrap: true, }), ], }), ], }); const actionsbox = Widget.Revealer({ transition: 'slide_down', child: Widget.EventBox({ child: Widget.Box({ class_name: 'actions horizontal', children: notification.actions.map(action => Widget.Button({ class_name: 'action-button', on_clicked: () => notification.invoke(action.id), hexpand: true, child: Widget.Label(action.label), })), }), }), }); return Widget.EventBox({ class_name: `notification ${notification.urgency}`, vexpand: false, on_primary_click: () => notification.dismiss(), on_hover() { actionsbox.reveal_child = true; }, on_hover_lost() { actionsbox.reveal_child = true; notification.dismiss(); }, child: Widget.Box({ vertical: true, children: [ content, notification.actions.length > 0 && actionsbox, ], }), }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/PopupWindow.js ================================================ import AgsWindow from 'resource:///com/github/Aylur/ags/widgets/window.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import options from '../options.js'; import GObject from 'gi://GObject'; class PopupWindow extends AgsWindow { static { GObject.registerClass(this); } /** @param {import('types/widgets/window').WindowProps & { * name: string * child: import('types/widgets/box').default * transition?: import('types/widgets/revealer').RevealerProps['transition'] * }} o */ constructor({ name, child, transition = 'none', visible = false, ...rest }) { super({ ...rest, name, popup: true, focusable: true, class_names: ['popup-window', name], }); child.toggleClassName('window-content'); this.revealer = Widget.Revealer({ transition, child, transitionDuration: options.transition.value, connections: [[App, (_, wname, visible) => { if (wname === name) this.revealer.reveal_child = visible; }]], }); this.child = Widget.Box({ css: 'padding: 1px;', child: this.revealer, }); this.show_all(); this.visible = visible; } set transition(dir) { this.revealer.transition = dir; } get transition() { return this.revealer.transition; } } /** @param {import('types/widgets/window').WindowProps & { * name: string * child: import('types/widgets/box').default * transition?: import('types/widgets/revealer').RevealerProps['transition'] * }} config */ export default config => new PopupWindow(config); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/Progress.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; export default ({ height = 18, width = 180, vertical = false, child, ...props }) => { const fill = Widget.Box({ class_name: 'fill', hexpand: vertical, vexpand: !vertical, hpack: vertical ? 'fill' : 'start', vpack: vertical ? 'end' : 'fill', children: [child], }); let fill_size = 0; return Widget.Box({ ...props, class_name: 'progress', css: ` min-width: ${width}px; min-height: ${height}px; `, children: [fill], setup: progress => progress.setValue = value => { if (value < 0) return; const axis = vertical ? 'height' : 'width'; const axisv = vertical ? height : width; const min = vertical ? width : height; const preferred = (axisv - min) * value + min; if (!fill_size) { fill_size = preferred; fill.setCss(`min-${axis}: ${preferred}px;`); return; } const frames = 10; const goal = preferred - fill_size; const step = goal / frames; for (let i = 0; i < frames; ++i) { Utils.timeout(5 * i, () => { fill_size += step; fill.setCss(`min-${axis}: ${fill_size}px`); }); } }, }); }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/RegularWindow.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Gtk from 'gi://Gtk'; import AgsWidget from 'resource:///com/github/Aylur/ags/widgets/widget.js'; class RegularWindow extends AgsWidget(Gtk.Window, 'RegularWindow') { static { AgsWidget.register(this); } /** * @param {import('types/widgets/widget').BaseProps< * RegularWindow, Gtk.Window.ConstructorProperties * >} params */ constructor(params) { // @ts-expect-error super(params); } } export default Widget.createCtor(RegularWindow); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/misc/mpris.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../icons.js'; import { blurImg } from '../utils.js'; /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/box').BoxProps=} props */ export const CoverArt = (player, props) => Widget.Box({ ...props, class_name: 'cover', binds: [['css', player, 'cover-path', path => `background-image: url("${path}")`]], }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/box').BoxProps=} props */ export const BlurredCoverArt = (player, props) => Widget.Box({ ...props, class_name: 'blurred-cover', connections: [[player, box => blurImg(player.cover_path).then(img => { img && box.setCss(`background-image: url("${img}")`); }), 'notify::cover-path']], }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/label').Props=} props */ export const TitleLabel = (player, props) => Widget.Label({ ...props, class_name: 'title', binds: [['label', player, 'track-title']], }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/label').Props=} props */ export const ArtistLabel = (player, props) => Widget.Label({ ...props, class_name: 'artist', binds: [['label', player, 'track-artists', a => a.join(', ') || '']], }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/icon').Props & { symbolic?: boolean }=} props */ export const PlayerIcon = (player, { symbolic = true, ...props } = {}) => Widget.Icon({ ...props, class_name: 'player-icon', tooltip_text: player.identity || '', connections: [[player, icon => { const name = `${player.entry}${symbolic ? '-symbolic' : ''}`; Utils.lookUpIcon(name) ? icon.icon = name : icon.icon = icons.mpris.fallback; }]], }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/slider').SliderProps=} props */ export const PositionSlider = (player, props) => Widget.Slider({ ...props, class_name: 'position-slider', draw_value: false, on_change: ({ value }) => { player.position = player.length * value; }, properties: [['update', slider => { if (slider.dragging) return; slider.visible = player.length > 0; if (player.length > 0) slider.value = player.position / player.length; }]], connections: [ [player, s => s._update(s)], [player, s => s._update(s), 'position'], [1000, s => s._update(s)], ], }); /** @param {number} length */ function lengthStr(length) { const min = Math.floor(length / 60); const sec = Math.floor(length % 60); const sec0 = sec < 10 ? '0' : ''; return `${min}:${sec0}${sec}`; } /** @param {import('types/service/mpris').MprisPlayer} player */ export const PositionLabel = player => Widget.Label({ properties: [['update', (label, time) => { player.length > 0 ? label.label = lengthStr(time || player.position) : label.visible = !!player; }]], connections: [ [player, (l, time) => l._update(l, time), 'position'], [1000, l => l._update(l)], ], }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const LengthLabel = player => Widget.Label({ connections: [[player, label => { player.length > 0 ? label.label = lengthStr(player.length) : label.visible = !!player; }]], }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const Slash = player => Widget.Label({ label: '/', connections: [[player, label => { label.visible = player.length > 0; }]], }); /** * @param {Object} o * @param {import('types/service/mpris').MprisPlayer} o.player * @param {import('types/widgets/stack').StackProps['items']} o.items * @param {'shuffle' | 'loop' | 'playPause' | 'previous' | 'next'} o.onClick * @param {string} o.prop * @param {string} o.canProp * @param {any} o.cantValue */ const PlayerButton = ({ player, items, onClick, prop, canProp, cantValue }) => Widget.Button({ child: Widget.Stack({ items, binds: [['shown', player, prop, p => `${p}`]], }), on_clicked: player[onClick].bind(player), binds: [['visible', player, canProp, c => c !== cantValue]], }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const ShuffleButton = player => PlayerButton({ player, items: [ ['true', Widget.Label({ class_name: 'shuffle enabled', label: icons.mpris.shuffle.enabled, })], ['false', Widget.Label({ class_name: 'shuffle disabled', label: icons.mpris.shuffle.disabled, })], ], onClick: 'shuffle', prop: 'shuffle-status', canProp: 'shuffle-status', cantValue: null, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const LoopButton = player => PlayerButton({ player, items: [ ['None', Widget.Label({ class_name: 'loop none', label: icons.mpris.loop.none, })], ['Track', Widget.Label({ class_name: 'loop track', label: icons.mpris.loop.track, })], ['Playlist', Widget.Label({ class_name: 'loop playlist', label: icons.mpris.loop.playlist, })], ], onClick: 'loop', prop: 'loop-status', canProp: 'loop-status', cantValue: null, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const PlayPauseButton = player => PlayerButton({ player, items: [ ['Playing', Widget.Label({ class_name: 'playing', label: icons.mpris.playing, })], ['Paused', Widget.Label({ class_name: 'paused', label: icons.mpris.paused, })], ['Stopped', Widget.Label({ class_name: 'stopped', label: icons.mpris.stopped, })], ], onClick: 'playPause', prop: 'play-back-status', canProp: 'can-play', cantValue: false, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const PreviousButton = player => PlayerButton({ player, items: [ ['true', Widget.Label({ class_name: 'previous', label: icons.mpris.prev, })], ], onClick: 'previous', prop: 'can-go-prev', canProp: 'can-go-prev', cantValue: false, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const NextButton = player => PlayerButton({ player, items: [ ['true', Widget.Label({ class_name: 'next', label: icons.mpris.next, })], ], onClick: 'next', prop: 'can-go-next', canProp: 'can-go-next', cantValue: false, }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/notifications/Notifications.js ================================================ import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Notification from '../misc/Notification.js'; import options from '../options.js'; /** @param {import('types/widgets/revealer').default} parent */ const Popups = parent => { const map = new Map(); const onDismissed = (_, id, force = false) => { if (!id || !map.has(id)) return; if (map.get(id).isHovered() && !force) return; if (map.size - 1 === 0) parent.reveal_child = false; Utils.timeout(200, () => { map.get(id)?.destroy(); map.delete(id); }); }; /** @param {import('types/widgets/box').default} box */ const onNotified = (box, id) => { if (!id || Notifications.dnd) return; const n = Notifications.getNotification(id); if (!n) return; if (options.notifications.black_list.value.includes(n.app_name || '')) return; map.delete(id); map.set(id, Notification(n)); box.children = Array.from(map.values()).reverse(); Utils.timeout(10, () => { parent.reveal_child = true; }); }; return Widget.Box({ vertical: true, connections: [ [Notifications, onNotified, 'notified'], [Notifications, onDismissed, 'dismissed'], [Notifications, (box, id) => onDismissed(box, id, true), 'closed'], ], }); }; /** @param {import('types/widgets/revealer').RevealerProps['transition']} transition */ const PopupList = (transition = 'slide_down') => Widget.Box({ css: 'padding: 1px', children: [ Widget.Revealer({ transition, setup: self => self.child = Popups(self), }), ], }); /** @param {number} monitor */ export default monitor => Widget.Window({ monitor, name: `notifications${monitor}`, class_name: 'notifications', binds: [['anchor', options.notifications.position]], child: PopupList(), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/options.js ================================================ /** * An object holding Options that are Variables with cached values. * * to update an option at runtime simply run * ags -r "options.path.to.option.setValue('value')" * * resetting: * ags -r "options.reset()" */ import { Option, resetOptions, getValues, apply, getOptions } from './settings/option.js'; import { USER } from 'resource:///com/github/Aylur/ags/utils.js'; import themes from './themes.js'; import { Theme, WP, HOME } from './settings/theme.js'; export default { reset: resetOptions, values: getValues, apply: apply, list: getOptions, spacing: Option(2), padding: Option(8), radii: Option(5), popover_padding_multiplier: Option(1.4, { 'category': 'General', 'note': 'popover-padding: padding × this', 'type': 'float', 'unit': '', }), misc: { pywal: { theme: Option('base16-default', { 'scss': 'exclude', }) }, gtk: { theme: Option('adw-gtk3-dark', { 'scss': 'exclude', }) }, gtkIcons: { theme: Option('Adwaita', { 'scss': 'exclude', }) }, }, color: { red: Option('#c01c28', { 'scss': 'red' }), green: Option('#2ec27e', { 'scss': 'green' }), yellow: Option('#f5c211', { 'scss': 'yellow' }), blue: Option('#3584e4', { 'scss': 'blue' }), magenta: Option('#813d9c', { 'scss': 'magenta' }), teal: Option('#99c1f1', { 'scss': 'teal' }), orange: Option('#e66100', { 'scss': 'orange' }), }, theme: { name: Option(themes[0].name, { 'category': 'exclude', 'note': 'Name to show as active in quicktoggles', }), icon: Option(themes[0].icon, { 'category': 'exclude', 'note': 'Icon to show as active in quicktoggles', }), scheme: Option('dark', { 'enums': ['dark', 'light'], 'type': 'enum', 'note': "Color scheme to set on Gtk apps: 'ligth' or 'dark'", 'title': 'Color Scheme', 'scss': 'color-scheme', }), bg: Option('#1E1E1E', { 'title': 'Background Color', 'scss': 'bg-color', }), fg: Option('#deddda', { 'title': 'Foreground Color', 'scss': 'fg-color', }), accent: { accent: Option('$blue', { 'category': 'Theme', 'title': 'Accent Color', 'scss': 'accent', }), fg: Option('#141414', { 'category': 'Theme', 'title': 'Accent Foreground Color', 'scss': 'accent-fg', }), gradient: Option('to right, $accent, lighten($accent, 6%)', { 'category': 'Theme', 'title': 'Accent Linear Gradient', 'scss': 'accent-gradient', }), }, widget: { bg: Option('$fg-color', { 'category': 'Theme', 'title': 'Widget Background Color', 'scss': '_widget-bg', }), opacity: Option(94, { 'category': 'Theme', 'title': 'Widget Background Opacity', 'unit': '', 'scss': 'widget-opacity', }), }, }, border: { color: Option('$fg-color', { 'category': 'Border', 'title': 'Border Color', 'scss': '_border-color', }), opacity: Option(97, { 'category': 'Border', 'title': 'Border Opacity', 'unit': '', }), width: Option(0, { 'category': 'Border', 'title': 'Border Width', }), barcolor: Option('#ffffff', { 'category': 'Border', 'title': 'Bar Border color', 'scss': 'bar-border-color', }), }, hypr: { inactive_border: Option('rgba(333333ff)', { 'category': 'Border', 'title': 'Border on Inactive Windows', 'scss': 'exclude', }), wm_gaps: Option(3, { 'category': 'General', 'scss': 'wm-gaps', 'note': 'wm-gaps', 'type': 'float', 'unit': '', }), }, // TODO: use this on revealers transition: Option(100, { 'category': 'exclude', 'note': 'Transition time on aminations in ms, e.g on hover', 'unit': 'ms', }), font: { font: Option('Ubuntu Nerd Font', { 'type': 'font', 'title': 'Font', 'scss': 'font', }), mono: Option('Mononoki Nerd Font', { 'title': 'Monospaced Font', 'scss': 'mono-font', }), size: Option(13, { 'scss': 'font-size', 'unit': 'pt', }), }, applauncher: { width: Option(500), height: Option(500), icon_size: Option(42), }, bar: { position: Option('top', { 'enums': ['top', 'bottom'], 'type': 'enum', }), style: Option('floating', { 'enums': ['floating', 'normal', 'separated'], 'type': 'enum', }), flat_buttons: Option(true, { 'scss': 'bar-flat-buttons' }), separators: Option(true), icon: Option('distro-icon', { 'note': '"distro-icon" or a single font', }), }, battery: { show_percentage: Option(true, { 'persist': true, 'noReload': false, 'category': 'exclude', }), bar: { show_icon: Option(false, { 'category': 'Bar' }), width: Option(70, { 'category': 'Bar' }), height: Option(14, { 'category': 'Bar' }), full: Option(false, { 'category': 'Bar' }), }, low: Option(30, { 'category': 'Bar' }), medium: Option(50, { 'category': 'Bar' }), }, desktop: { wallpaper: { fg: Option('#fff', { 'scss': 'wallpaper-fg' }), img: Option(themes[0].options['desktop.wallpaper.img'], { 'scssFormat': v => `"${v}"`, 'type': 'img', }), }, avatar: Option(`${HOME}/face.png`, { 'scssFormat': v => `"${v}"`, 'type': 'img', 'note': 'displayed in quicksettings and locksreen', }), screen_corners: Option(true, { 'scss': 'screen-corners' }), clock: { enable: Option(true), position: Option('center center', { 'note': 'halign valign', }), }, drop_shadow: Option(false, { 'scss': 'drop-shadow' }), shadow: Option('rgba(0, 0, 0, .6)', { 'scss': 'shadow' }), dock: { icon_size: Option(42), pinned_apps: Option([ "brave", "Visual Studio Code", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software" ], { 'scss': 'exclude' }), }, }, notifications: { black_list: Option(['Spotify'], { 'note': 'app-name | entry' }), position: Option(['top'], { 'note': 'anchor' }), width: Option(450), }, dashboard: { sys_info_size: Option(70, { 'category': 'Desktop', 'scss': 'sys-info-size', }), }, mpris: { black_list: Option(['Caprine'], { 'category': 'Bar', 'title': 'List of blacklisted mpris players', 'note': 'filters for bus-name, name, identity, entry', }), preferred: Option('spotify', { 'category': 'Bar', 'title': 'Preferred player', }), }, workspaces: Option(10, { 'category': 'Bar', 'title': 'No. workspaces on bar and overview', 'note': 'Set it to 0 to make it dynamic', }), temperature: '/sys/class/thermal/thermal_zone6/temp', systemFetchInterval: 1000, brightnessctlKBD: 'asus::kbd_backlight', substitutions: { icons: [ ['transmission-gtk', 'transmission'], ['blueberry.py', 'bluetooth'], ['Caprine', 'facebook-messenger'], ['', 'preferences-desktop-display'], ], titles: [ ['com.github.Aylur.ags', 'AGS'], ['transmission-gtk', 'Transmission'], ['com.obsproject.Studio', 'OBS'], ['com.usebottles.bottles', 'Bottles'], ['com.github.wwmm.easyeffects', 'Easy Effects'], ['org.gnome.TextEditor', 'Text Editor'], ['org.gnome.design.IconLibrary', 'Icon Library'], ['blueberry.py', 'Blueberry'], ['org.wezfurlong.wezterm', 'Wezterm'], ['com.raggesilver.BlackBox', 'BlackBox'], ['firefox', 'Firefox'], ['org.gnome.Nautilus', 'Files'], ['libreoffice-writer', 'Writer'], ['', 'Desktop'], ], }, }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/osd/OSD.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import FontIcon from '../misc/FontIcon.js'; import Progress from '../misc/Progress.js'; import Indicator from '../services/onScreenIndicator.js'; export const OnScreenIndicator = ({ height = 200, width = 32 } = {}) => Widget.Box({ class_name: 'indicator', css: 'padding: 1px;', child: Widget.Revealer({ transition: 'slide_left', connections: [[Indicator, (revealer, value) => { revealer.reveal_child = value > -1; }]], child: Progress({ width, height, vertical: true, connections: [[Indicator, (progress, value) => progress.setValue(value)]], child: Widget.Stack({ vpack: 'start', hpack: 'center', hexpand: false, items: [ ['true', Widget.Icon({ hpack: 'center', size: width, connections: [[Indicator, (icon, _v, name) => icon.icon = name || '']], })], ['false', FontIcon({ hpack: 'center', hexpand: true, css: `font-size: ${width}px;`, connections: [[Indicator, (icon, _v, name) => icon.icon = name || '']], })], ], connections: [[Indicator, (stack, _v, name) => { stack.shown = `${!!Utils.lookUpIcon(name)}`; }]], }), }), }), }); /** @param {number} monitor */ export default monitor => Widget.Window({ name: `indicator${monitor}`, monitor, class_name: 'indicator', layer: 'overlay', anchor: ['right'], child: OnScreenIndicator(), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/overview/Client.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import { createSurfaceFromWidget, substitute } from '../utils.js'; import Gdk from 'gi://Gdk'; import Gtk from 'gi://Gtk'; import options from '../options.js'; const SCALE = 0.08; const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)]; /** @param {string} args */ const dispatch = args => Utils.execAsync(`hyprctl dispatch ${args}`); /** @param {string} str */ const icon = str => substitute(options.substitutions.icons, str); export default ({ address, size: [w, h], class: c, title }) => Widget.Button({ class_name: 'client', tooltip_text: `${title}`, child: Widget.Icon({ css: ` min-width: ${w * SCALE}px; min-height: ${h * SCALE}px; `, icon: icon(c), }), on_secondary_click: () => dispatch(`closewindow address:${address}`), on_clicked: () => dispatch(`focuswindow address:${address}`) .then(() => App.closeWindow('overview')), setup: btn => { btn.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, TARGET, Gdk.DragAction.COPY); btn.connect('drag-data-get', (_w, _c, data) => data.set_text(address, address.length)); btn.connect('drag-begin', (_, context) => { Gtk.drag_set_icon_surface(context, createSurfaceFromWidget(btn)); btn.toggleClassName('hidden', true); }); btn.connect('drag-end', () => btn.toggleClassName('hidden', false)); }, }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/overview/Overview.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import PopupWindow from '../misc/PopupWindow.js'; import Workspace from './Workspace.js'; import options from '../options.js'; import { range } from '../utils.js'; const ws = options.workspaces; /** @param {import('types/widgets/box').default} box */ const update = box => { if (App.windows.has('overview') && !App.getWindow('overview')?.visible) return; Utils.execAsync('hyprctl -j clients') .then(clients => { const json = JSON.parse(clients); box.children.forEach(ch => ch.update(json)); }) .catch(console.error); }; /** @param {import('types/widgets/box').default} box */ const children = box => { if (ws.value === 0) { box.children = Hyprland.workspaces .sort((ws1, ws2) => ws1.id > ws2.id) .map(({ id }) => Workspace(id)); } }; export default () => PopupWindow({ name: 'overview', child: Widget.Box({ setup: update, connections: [ [ws, box => { box.children = range(ws.value).map(Workspace); update(box); children(box); }], [Hyprland, update], [Hyprland, children, 'notify::workspaces'], ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/overview/Workspace.js ================================================ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Gdk from 'gi://Gdk'; import Gtk from 'gi://Gtk'; import Client from './Client.js'; const SCALE = 0.08; const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)]; /** @param {string} args */ const dispatch = args => Utils.execAsync(`hyprctl dispatch ${args}`); /** @param {number} index */ export default index => { const fixed = Gtk.Fixed.new(); const widget = Widget.Box({ class_name: 'workspace', vpack: 'center', css: ` min-width: ${1920 * SCALE}px; min-height: ${1080 * SCALE}px; `, connections: [[Hyprland, box => { box.toggleClassName('active', Hyprland.active.workspace.id === index); }]], child: Widget.EventBox({ hexpand: true, vexpand: true, on_primary_click: () => dispatch(`workspace ${index}`), setup: eventbox => { eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY); eventbox.connect('drag-data-received', (_w, _c, _x, _y, data) => { dispatch(`movetoworkspacesilent ${index},address:${data.get_text()}`); }); }, child: fixed, }), }); widget.update = clients => { fixed.get_children().forEach(ch => ch.destroy()); clients .filter(({ workspace: { id } }) => id === index) .forEach(c => { c.at[0] -= Hyprland.getMonitor(c.monitor)?.x || 0; c.at[1] -= Hyprland.getMonitor(c.monitor)?.y || 0; c.mapped && fixed.put(Client(c), c.at[0] * SCALE, c.at[1] * SCALE); }); fixed.show_all(); }; return widget; }; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/powermenu/PowerMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../icons.js'; import PowerMenu from '../services/powermenu.js'; import ShadedPopup from './ShadedPopup.js'; /** * @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action * @param {string} label */ const SysButton = (action, label) => Widget.Button({ on_clicked: () => PowerMenu.action(action), child: Widget.Box({ vertical: true, children: [ Widget.Icon(icons.powermenu[action]), Widget.Label(label), ], }), }); export default () => ShadedPopup({ name: 'powermenu', expand: true, child: Widget.Box({ children: [ SysButton('sleep', 'Sleep'), SysButton('reboot', 'Reboot'), SysButton('logout', 'Log Out'), SysButton('shutdown', 'Shutdown'), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/powermenu/ShadedPopup.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; /** @param {string} windowName */ const Padding = windowName => Widget.EventBox({ class_name: 'padding', hexpand: true, vexpand: true, connections: [['button-press-event', () => App.toggleWindow(windowName)]], }); /** * @param {import('types/widgets/window').WindowProps & { * name: string * child: import('types/widgets/box').default * }} o */ export default ({ name, child, ...rest }) => Widget.Window({ ...rest, class_names: ['popup-window', name], name, visible: false, popup: true, focusable: true, setup() { child.toggleClassName('window-content'); }, child: Widget.CenterBox({ class_name: 'shader', css: 'min-width: 5000px; min-height: 3000px;', children: [ Padding(name), Widget.CenterBox({ vertical: true, children: [ Padding(name), child, Padding(name), ], }), Padding(name), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/powermenu/Verification.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import PowerMenu from '../services/powermenu.js'; import ShadedPopup from './ShadedPopup.js'; export default () => ShadedPopup({ name: 'verification', expand: true, child: Widget.Box({ vertical: true, children: [ Widget.Box({ class_name: 'text-box', vertical: true, children: [ Widget.Label({ class_name: 'title', binds: [['label', PowerMenu, 'title']], }), Widget.Label({ class_name: 'desc', label: 'Are you sure?', }), ], }), Widget.Box({ class_name: 'buttons horizontal', vexpand: true, vpack: 'end', homogeneous: true, children: [ Widget.Button({ child: Widget.Label('No'), on_clicked: () => App.toggleWindow('verification'), }), Widget.Button({ child: Widget.Label('Yes'), on_clicked: () => Utils.exec(PowerMenu.cmd), }), ], }), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/QuickSettings.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Header from './widgets/Header.js'; import PopupWindow from '../misc/PopupWindow.js'; import { Volume, Microhone, SinkSelector, AppMixer } from './widgets/Volume.js'; import { NetworkToggle, WifiSelection } from './widgets/Network.js'; import { BluetoothToggle, BluetoothDevices } from './widgets/Bluetooth.js'; import { ThemeToggle, ThemeSelector } from './widgets/Theme.js'; import Media from './widgets/Media.js'; import Brightness from './widgets/Brightness.js'; import DND from './widgets/DND.js'; import MicMute from './widgets/MicMute.js'; import options from '../options.js'; const Row = (toggles = [], menus = []) => Widget.Box({ vertical: true, children: [ Widget.Box({ class_name: 'row horizontal', children: toggles, }), ...menus, ], }); const Homogeneous = toggles => Widget.Box({ homogeneous: true, children: toggles, }); export default () => PopupWindow({ name: 'quicksettings', connections: [[options.bar.position, self => { self.anchor = ['right', options.bar.position.value]; self.transition = 'crossfade'; }]], child: Widget.Box({ vertical: true, children: [ Header(), Widget.Box({ class_name: 'sliders-box vertical', vertical: true, children: [ Row( [Volume()], [SinkSelector(), AppMixer()], ), Microhone(), Brightness(), ], }), Row( [Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()], [WifiSelection(), BluetoothDevices()], ), Row( [Homogeneous([ThemeToggle()]), MicMute()], [ThemeSelector()], ), Media(), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/ToggleButton.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../icons.js'; /** name of the currently opened menu */ export const opened = Variable(''); App.connect('window-toggled', (_, name, visible) => { if (name === 'quicksettings' && !visible) Utils.timeout(500, () => opened.value = ''); }); /** * @param {string} name - menu name * @param {(() => void) | false=} activate */ export const Arrow = (name, activate) => { let deg = 0; let iconOpened = false; return Widget.Button({ child: Widget.Icon({ icon: icons.ui.arrow.right, connections: [[opened, icon => { if (opened.value === name && !iconOpened || opened.value !== name && iconOpened) { const step = opened.value === name ? 10 : -10; iconOpened = !iconOpened; for (let i = 0; i < 9; ++i) { Utils.timeout(15 * i, () => { deg += step; icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); }); } } }]], }), on_clicked: () => { opened.value = opened.value === name ? '' : name; if (typeof activate === 'function') activate(); }, }); }; /** * @param {Object} o * @param {string} o.name - menu name * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {import('gi://Gtk').Gtk.Widget} o.label * @param {() => void} o.activate * @param {() => void} o.deactivate * @param {boolean=} o.activateOnArrow * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection */ export const ArrowToggleButton = ({ name, icon, label, activate, deactivate, activateOnArrow = true, connection: [service, condition], }) => Widget.Box({ class_name: 'toggle-button', connections: [[service, box => { box.toggleClassName('active', condition()); }]], children: [ Widget.Button({ child: Widget.Box({ hexpand: true, class_name: 'label-box horizontal', children: [icon, label], }), on_clicked: () => { if (condition()) { deactivate(); if (opened.value === name) opened.value = ''; } else { activate(); } }, }), Arrow(name, activateOnArrow && activate), ], }); /** * @param {Object} o * @param {string} o.name - menu name * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {import('gi://Gtk').Gtk.Widget} o.title * @param {import('gi://Gtk').Gtk.Widget[]} o.content */ export const Menu = ({ name, icon, title, content }) => Widget.Revealer({ transition: 'slide_down', binds: [['reveal-child', opened, 'value', v => v === name]], child: Widget.Box({ class_names: ['menu', name], vertical: true, children: [ Widget.Box({ class_name: 'title horizontal', children: [icon, title], }), Widget.Separator(), ...content, ], }), }); /** * @param {Object} o * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {() => void} o.toggle * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection */ export const SimpleToggleButton = ({ icon, toggle, connection: [service, condition], }) => Widget.Button({ class_name: 'simple-toggle', connections: [[service, box => { box.toggleClassName('active', condition()); }]], child: icon, on_clicked: toggle, }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/AsusProfile.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import Asusctl from '../../services/asusctl.js'; import { ArrowToggleButton, Menu } from '../ToggleButton.js'; export const ProfileToggle = () => ArrowToggleButton({ name: 'asusctl-profile', icon: Widget.Icon({ binds: [['icon', Asusctl, 'profile', p => icons.asusctl.profile[p]]], }), label: Widget.Label({ binds: [['label', Asusctl, 'profile']], }), connection: [Asusctl, () => Asusctl.profile !== 'Balanced'], activate: () => Asusctl.setProfile('Quiet'), deactivate: () => Asusctl.setProfile('Balanced'), activateOnArrow: false, }); export const ProfileSelector = () => Menu({ name: 'asusctl-profile', icon: Widget.Icon({ binds: [['icon', Asusctl, 'profile', p => icons.asusctl.profile[p]]], }), title: Widget.Label('Profile Selector'), content: [ Widget.Box({ vertical: true, hexpand: true, children: [ Widget.Box({ vertical: true, children: Asusctl.profiles.map(prof => Widget.Button({ on_clicked: () => Asusctl.setProfile(prof), child: Widget.Box({ children: [ Widget.Icon(icons.asusctl.profile[prof]), Widget.Label(prof), ], }), })), }), ], }), Widget.Separator(), Widget.Button({ on_clicked: () => Utils.execAsync('rog-control-center'), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Rog Control Center'), ], }), }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Bluetooth.js ================================================ import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import { Menu, ArrowToggleButton } from '../ToggleButton.js'; export const BluetoothToggle = () => ArrowToggleButton({ name: 'bluetooth', icon: Widget.Icon({ connections: [[Bluetooth, icon => { icon.icon = Bluetooth.enabled ? icons.bluetooth.enabled : icons.bluetooth.disabled; }]], }), label: Widget.Label({ truncate: 'end', connections: [[Bluetooth, label => { if (!Bluetooth.enabled) return label.label = 'Disabled'; if (Bluetooth.connectedDevices.length === 0) return label.label = 'Not Connected'; if (Bluetooth.connectedDevices.length === 1) return label.label = Bluetooth.connectedDevices[0].alias; label.label = `${Bluetooth.connectedDevices.length} Connected`; }]], }), connection: [Bluetooth, () => Bluetooth.enabled], deactivate: () => Bluetooth.enabled = false, activate: () => Bluetooth.enabled = true, }); const DeviceItem = device => Widget.Box({ children: [ Widget.Icon(device.icon_name + '-symbolic'), Widget.Label(device.name), Widget.Label({ label: `${device.battery_percentage}%`, binds: [['visible', device, 'battery-percentage', p => p > 0]], }), Widget.Box({ hexpand: true }), Widget.Spinner({ binds: [ ['active', device, 'connecting'], ['visible', device, 'connecting'], ], }), Widget.Switch({ active: device.connected, binds: [['visible', device, 'connecting', c => !c]], connections: [['notify::active', ({ active }) => { device.setConnection(active); }]], }), ], }); export const BluetoothDevices = () => Menu({ name: 'bluetooth', icon: Widget.Icon(icons.bluetooth.disabled), title: Widget.Label('Bluetooth'), content: [ Widget.Box({ hexpand: true, vertical: true, binds: [['children', Bluetooth, 'devices', ds => ds .filter(d => d.name) .map(DeviceItem)]], }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Brightness.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import Brightness from '../../services/brightness.js'; const BrightnessSlider = () => Widget.Slider({ draw_value: false, hexpand: true, binds: [['value', Brightness, 'screen']], on_change: ({ value }) => Brightness.screen = value, }); export default () => Widget.Box({ children: [ Widget.Button({ child: Widget.Icon(icons.brightness.indicator), binds: [['tooltip-text', Brightness, 'screen', v => `Screen Brightness: ${Math.floor(v * 100)}%`]], }), BrightnessSlider(), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/DND.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import icons from '../../icons.js'; import { SimpleToggleButton } from '../ToggleButton.js'; export default () => SimpleToggleButton({ icon: Widget.Icon({ connections: [[Notifications, icon => { icon.icon = Notifications.dnd ? icons.notifications.silent : icons.notifications.noisy; }, 'notify::dnd']], }), toggle: () => Notifications.dnd = !Notifications.dnd, connection: [Notifications, () => Notifications.dnd], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Header.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import PowerMenu from '../../services/powermenu.js'; import Lockscreen from '../../services/lockscreen.js'; import Avatar from '../../misc/Avatar.js'; import icons from '../../icons.js'; import { openSettings } from '../../settings/theme.js'; import { uptime } from '../../variables.js'; export default () => Widget.Box({ class_name: 'header horizontal', children: [ Avatar(), Widget.Box({ hpack: 'end', vpack: 'center', hexpand: true, children: [ Widget.Box({ class_name: 'battery horizontal', children: [ Widget.Icon({ binds: [['icon', Battery, 'icon-name']] }), Widget.Label({ binds: [['label', Battery, 'percent', p => `${p}%`]] }), ], }), Widget.Label({ class_name: 'uptime', binds: [['label', uptime, 'value', v => `up: ${v}`]], }), Widget.Button({ on_clicked: openSettings, child: Widget.Icon(icons.ui.settings), }), Widget.Button({ on_clicked: () => Lockscreen.lockscreen(), child: Widget.Icon(icons.lock), }), Widget.Button({ on_clicked: () => PowerMenu.action('shutdown'), child: Widget.Icon(icons.powermenu.shutdown), }), ], }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Media.js ================================================ import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as mpris from '../../misc/mpris.js'; import options from '../../options.js'; /** @param {import('types/service/mpris').MprisPlayer} player */ const Footer = player => Widget.CenterBox({ class_name: 'footer-box', children: [ Widget.Box({ class_name: 'position', children: [ mpris.PositionLabel(player), mpris.Slash(player), mpris.LengthLabel(player), ], }), Widget.Box({ class_name: 'controls', children: [ mpris.ShuffleButton(player), mpris.PreviousButton(player), mpris.PlayPauseButton(player), mpris.NextButton(player), mpris.LoopButton(player), ], }), mpris.PlayerIcon(player, { symbolic: false, hexpand: true, hpack: 'end', }), ], }); /** @param {import('types/service/mpris').MprisPlayer} player */ const TextBox = player => Widget.Box({ children: [ mpris.CoverArt(player, { hpack: 'end', hexpand: false, }), Widget.Box({ hexpand: true, vertical: true, class_name: 'labels', children: [ mpris.TitleLabel(player, { xalign: 0, justification: 'left', wrap: true, }), mpris.ArtistLabel(player, { xalign: 0, justification: 'left', wrap: true, }), ], }), ], }); /** @param {import('types/service/mpris').MprisPlayer} player */ const PlayerBox = player => Widget.Box({ class_name: `player ${player.name}`, child: mpris.BlurredCoverArt(player, { hexpand: true, child: Widget.Box({ hexpand: true, vertical: true, children: [ TextBox(player), mpris.PositionSlider(player), Footer(player), ], }), }), }); export default () => Widget.Box({ vertical: true, class_name: 'media vertical', connections: [['draw', self => { self.visible = Mpris.players.length > 0; }]], binds: [ ['children', Mpris, 'players', ps => ps.filter(p => !options.mpris.black_list.value .includes(p.identity)).map(PlayerBox)], ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/MicMute.js ================================================ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import { SimpleToggleButton } from '../ToggleButton.js'; export default () => SimpleToggleButton({ icon: Widget.Icon({ connections: [[Audio, icon => { icon.icon = Audio.microphone?.is_muted ? icons.audio.mic.muted : icons.audio.mic.high; }, 'microphone-changed']], }), toggle: () => Audio.microphone.is_muted = !Audio.microphone.is_muted, connection: [Audio, () => Audio.microphone?.is_muted], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Network.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Network from 'resource:///com/github/Aylur/ags/service/network.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import { Menu, ArrowToggleButton } from '../ToggleButton.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; export const NetworkToggle = () => ArrowToggleButton({ name: 'network', icon: Widget.Icon({ connections: [[Network, icon => { icon.icon = Network.wifi.icon_name || ''; }]], }), label: Widget.Label({ truncate: 'end', connections: [[Network, label => { label.label = Network.wifi.ssid || 'Not Connected'; }]], }), connection: [Network, () => Network.wifi.enabled], deactivate: () => Network.wifi.enabled = false, activate: () => { Network.wifi.enabled = true; Network.wifi.scan(); }, }); export const WifiSelection = () => Menu({ name: 'network', icon: Widget.Icon({ connections: [[Network, icon => { icon.icon = Network.wifi.icon_name; }]], }), title: Widget.Label('Wifi Selection'), content: [ Widget.Box({ vertical: true, connections: [[Network, box => box.children = Network.wifi?.access_points.map(ap => Widget.Button({ on_clicked: () => Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`), child: Widget.Box({ children: [ Widget.Icon(ap.iconName), Widget.Label(ap.ssid || ''), ap.active && Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', }), ], }), })), ]], }), Widget.Separator(), Widget.Button({ on_clicked: () => Applications.query('gnome-control-center')?.[0].launch(), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Network'), ], }), }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Theme.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import { ArrowToggleButton, Menu, opened } from '../ToggleButton.js'; import themes from '../../themes.js'; import icons from '../../icons.js'; import options from '../../options.js'; import { setTheme, openSettings } from '../../settings/theme.js'; export const ThemeToggle = () => ArrowToggleButton({ name: 'theme', icon: Widget.Label({ binds: [['label', options.theme.icon]] }), label: Widget.Label({ binds: [['label', options.theme.name]] }), connection: [opened, () => opened.value === 'theme'], activate: () => opened.setValue('theme'), activateOnArrow: false, deactivate: () => { }, }); export const ThemeSelector = () => Menu({ name: 'theme', icon: Widget.Label({ binds: [['label', options.theme.icon]], }), title: Widget.Label('Theme Selector'), content: [ ...themes.map(({ name, icon }) => Widget.Button({ on_clicked: () => setTheme(name), child: Widget.Box({ children: [ Widget.Label(icon), Widget.Label(name), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', binds: [['visible', options.theme.name, 'value', v => v === name]], }), ], }), })), Widget.Separator(), Widget.Button({ on_clicked: openSettings, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Theme Settings'), ], }), }), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/quicksettings/widgets/Volume.js ================================================ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import FontIcon from '../../misc/FontIcon.js'; import { getAudioTypeIcon } from '../../utils.js'; import { Arrow } from '../ToggleButton.js'; import { Menu } from '../ToggleButton.js'; /** @param {'speaker' | 'microphone'=} type */ const VolumeIndicator = (type = 'speaker') => Widget.Button({ on_clicked: () => Audio[type].is_muted = !Audio[type].is_muted, child: Widget.Icon({ connections: [[Audio, icon => { if (!Audio[type]) return; icon.icon = type === 'speaker' ? getAudioTypeIcon(Audio[type].icon_name || '') : icons.audio.mic.high; icon.tooltip_text = `Volume ${Math.floor(Audio[type].volume * 100)}%`; }, `${type}-changed`]], }), }); /** @param {'speaker' | 'microphone'=} type */ const VolumeSlider = (type = 'speaker') => Widget.Slider({ hexpand: true, draw_value: false, on_change: ({ value }) => Audio[type].volume = value, connections: [[Audio, slider => { slider.value = Audio[type]?.volume; }, `${type}-changed`]], }); export const Volume = () => Widget.Box({ children: [ VolumeIndicator('speaker'), VolumeSlider('speaker'), Widget.Box({ vpack: 'center', child: Arrow('sink-selector'), }), Widget.Box({ vpack: 'center', child: Arrow('app-mixer'), connections: [[Audio, box => { box.visible = Audio.apps.length > 0; }]], }), ], }); export const Microhone = () => Widget.Box({ class_name: 'slider horizontal', binds: [['visible', Audio, 'recorders', r => r.length > 0]], children: [ VolumeIndicator('microphone'), VolumeSlider('microphone'), ], }); /** @param {import('types/service/audio').Stream} stream */ const MixerItem = stream => Widget.Box({ hexpand: true, class_name: 'mixer-item horizontal', children: [ Widget.Icon({ binds: [['tooltipText', stream, 'name']], connections: [[stream, icon => { icon.icon = Utils.lookUpIcon(stream.name || '') ? (stream.name || '') : icons.mpris.fallback; }]], }), Widget.Box({ vertical: true, children: [ Widget.Label({ xalign: 0, truncate: 'end', binds: [['label', stream, 'description']], }), Widget.Slider({ hexpand: true, draw_value: false, binds: [['value', stream, 'volume']], on_change: ({ value }) => stream.volume = value, }), ], }), Widget.Label({ xalign: 1, connections: [[stream, l => { l.label = `${Math.floor(stream.volume * 100)}%`; }]], }), ], }); /** @param {import('types/service/audio').Stream} stream */ const SinkItem = stream => Widget.Button({ hexpand: true, on_clicked: () => Audio.speaker = stream, child: Widget.Box({ children: [ Widget.Icon({ icon: getAudioTypeIcon(stream.icon_name || ''), tooltip_text: stream.icon_name, }), Widget.Label((stream.description || '').split(' ').slice(0, 4).join(' ')), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', binds: [['visible', Audio, 'speaker', s => s === stream]], }), ], }), }); const SettingsButton = () => Widget.Button({ on_clicked: () => Utils.execAsync('pavucontrol'), hexpand: true, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Settings'), ], }), }); export const AppMixer = () => Menu({ name: 'app-mixer', icon: FontIcon(icons.audio.mixer), title: Widget.Label('App Mixer'), content: [ Widget.Box({ vertical: true, binds: [['children', Audio, 'apps', a => a.map(MixerItem)]], }), Widget.Separator(), SettingsButton(), ], }); export const SinkSelector = () => Menu({ name: 'sink-selector', icon: Widget.Icon(icons.audio.type.headset), title: Widget.Label('Sink Selector'), content: [ Widget.Box({ vertical: true, binds: [['children', Audio, 'speakers', s => s.map(SinkItem)]], }), Widget.Separator(), SettingsButton(), ], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/screencorner/ScreenCorners.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Gtk from 'gi://Gtk'; import options from '../options.js'; /** @param {'topleft' | 'topright' | 'bottomleft' | 'bottomright'} place */ const Corner = place => Widget.DrawingArea({ class_name: 'corner', hexpand: true, vexpand: true, hpack: place.includes('left') ? 'start' : 'end', vpack: place.includes('top') ? 'start' : 'end', connections: [[options.radii, self => { const r = options.radii.value * 2; self.set_size_request(r, r); }]], setup: self => self.connect('draw', (self, cr) => { const context = self.get_style_context(); const c = context.get_property('background-color', Gtk.StateFlags.NORMAL); const r = context.get_property('border-radius', Gtk.StateFlags.NORMAL); switch (place) { case 'topleft': cr.arc(r, r, r, Math.PI, 3 * Math.PI / 2); cr.lineTo(0, 0); break; case 'topright': cr.arc(0, r, r, 3 * Math.PI / 2, 2 * Math.PI); cr.lineTo(r, 0); break; case 'bottomleft': cr.arc(r, 0, r, Math.PI / 2, Math.PI); cr.lineTo(0, r); break; case 'bottomright': cr.arc(0, 0, r, 0, Math.PI / 2); cr.lineTo(r, r); break; } cr.closePath(); cr.setSourceRGBA(c.red, c.green, c.blue, c.alpha); cr.fill(); }), }); /** @type {Array<'topleft' | 'topright' | 'bottomleft' | 'bottomright'>} */ const places = ['topleft', 'topright', 'bottomleft', 'bottomright']; /** @param {number} monitor */ export default monitor => places.map(place => Widget.Window({ name: `corner${monitor}${place}`, monitor, class_name: 'corner', anchor: [place.includes('top') ? 'top' : 'bottom', place.includes('right') ? 'right' : 'left'], binds: [['visible', options.desktop.screen_corners]], child: Corner(place), })); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/asusctl.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; class Asusctl extends Service { static { Service.register(this, {}, { 'profile': ['string', 'r'], 'mode': ['string', 'r'], }); } profiles = Object.freeze(['Performance', 'Balanced', 'Quiet']); #profile = 'Balanced'; #mode = 'Hyprid'; nextProfile() { Utils.execAsync('asusctl profile -n') .then(() => { this.#profile = Utils.exec('asusctl profile -p').split(' ')[3]; this.changed('profile'); }) .catch(console.error); } /** @param {'Performance' | 'Balanced' | 'Quiet'} prof */ setProfile(prof) { Utils.execAsync(`asusctl profile --profile-set ${prof}`) .then(() => { this.#profile = prof; this.changed('profile'); }) .catch(console.error); } nextMode() { Utils.execAsync(`supergfxctl -m ${this.#mode === 'Hybrid' ? 'Integrated' : 'Hybrid'}`) .then(() => { this.#mode = Utils.exec('supergfxctl -g'); this.changed('profile'); }) .catch(console.error); } constructor() { super(); if (Utils.exec('which asusctl')) { this.available = true; this.#profile = Utils.exec('asusctl profile -p').split(' ')[3]; Utils.execAsync('supergfxctl -g').then(mode => this.#mode = mode); } else { this.available = false; } } get profile() { return this.#profile; } get mode() { return this.#mode; } } export default new Asusctl(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/brightness.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import options from '../options.js'; import { dependencies } from '../utils.js'; const KBD = options.brightnessctlKBD; class Brightness extends Service { static { Service.register(this, {}, { 'screen': ['float', 'rw'], 'kbd': ['int', 'rw'], }); } #kbd = 0; #kbdMax = 3; #screen = 0; get kbd() { return this.#kbd; } get screen() { return this.#screen; } set kbd(value) { if (!dependencies(['brightnessctl'])) return; if (value < 0 || value > this.#kbdMax) return; Utils.execAsync(`brightnessctl -d ${KBD} s ${value} -q`) .then(() => { this.#kbd = value; this.changed('kbd'); }) .catch(console.error); } set screen(percent) { if (!dependencies(['brightnessctl'])) return; if (percent < 0) percent = 0; if (percent > 1) percent = 1; Utils.execAsync(`brightnessctl s ${percent * 100}% -q`) .then(() => { this.#screen = percent; this.changed('screen'); }) .catch(console.error); } constructor() { super(); if (dependencies(['brightnessctl'])) { this.#kbd = Number(Utils.exec(`brightnessctl -d ${KBD} g`)); this.#kbdMax = Number(Utils.exec(`brightnessctl -d ${KBD} m`)); this.#screen = Number(Utils.exec('brightnessctl g')) / Number(Utils.exec('brightnessctl m')); } } } export default new Brightness(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/colorpicker.js ================================================ import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import { Variable } from 'resource:///com/github/Aylur/ags/variable.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import { dependencies } from '../utils.js'; const COLORS_CACHE = Utils.CACHE_DIR + '/colorpicker.json'; class Colors extends Service { static { Service.register(this, {}, { 'colors': ['jsobject'], }); } /** @type {Variable} */ #colors = new Variable([]); get colors() { return this.#colors.value; } #notifID = 0; constructor() { super(); this.#colors.connect('changed', () => this.changed('colors')); Utils.readFileAsync(COLORS_CACHE) .then(out => this.#colors.setValue(JSON.parse(out || '[]'))) .catch(() => print('no colorpicker cache found')); } /** @param {string} color */ wlCopy(color) { Utils.execAsync(['wl-copy', color]) .catch(err => console.error(err)); } async pick() { if (!dependencies(['hyprpicker'])) return; const color = await Utils.execAsync('hyprpicker'); if (!color) return; this.wlCopy(color); const list = this.#colors.value; if (!list.includes(color)) { list.push(color); if (list.length > 10) list.shift(); this.#colors.value = list; Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE) .catch(err => console.error(err)); } this.#notifID = Notifications.Notify( 'Color Picker', this.#notifID, 'color-select-symbolic', color, '', [], {}, ); } } export default new Colors; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/lockscreen.js ================================================ import Service from 'resource:///com/github/Aylur/ags/service.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; const authpy = App.configDir + '/js/lockscreen/auth.py'; class Lockscreen extends Service { static { Service.register(this, { 'lock': ['boolean'], 'authenticating': ['boolean'], }); } lockscreen() { this.emit('lock', true); } /** @param {string} password */ auth(password) { this.emit('authenticating', true); Utils.execAsync([authpy, password]) .then(out => { this.emit('lock', out !== 'True'); this.emit('authenticating', false); }) .catch(err => console.error(err)); } } export default new Lockscreen(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/onScreenIndicator.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import icons from '../icons.js'; import { getAudioTypeIcon } from '../utils.js'; import Brightness from './brightness.js'; class Indicator extends Service { static { Service.register(this, { 'popup': ['double', 'string'], }); } #delay = 1500; #count = 0; /** * @param {number} value - 0 < v < 1 * @param {string} icon */ popup(value, icon) { this.emit('popup', value, icon); this.#count++; Utils.timeout(this.#delay, () => { this.#count--; if (this.#count === 0) this.emit('popup', -1, icon); }); } speaker() { this.popup( Audio.speaker?.volume || 0, getAudioTypeIcon(Audio.speaker?.icon_name || ''), ); } display() { // brightness is async, so lets wait a bit Utils.timeout(10, () => this.popup( Brightness.screen, icons.brightness.screen)); } kbd() { // brightness is async, so lets wait a bit Utils.timeout(10, () => this.popup( (Brightness.kbd * 33 + 1) / 100, icons.brightness.keyboard)); } connect(event = 'popup', callback) { return super.connect(event, callback); } } export default new Indicator(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/powermenu.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; class PowerMenu extends Service { static { Service.register(this, {}, { 'title': ['string'], 'cmd': ['string'], }); } #title = ''; #cmd = ''; get title() { return this.#title; } get cmd() { return this.#cmd; } /** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */ action(action) { [this.#cmd, this.#title] = { 'sleep': ['systemctl suspend', 'Sleep'], 'reboot': ['systemctl reboot', 'Reboot'], 'logout': ['pkill Hyprland', 'Log Out'], 'shutdown': ['shutdown now', 'Shutdown'], }[action]; this.notify('cmd'); this.notify('title'); this.emit('changed'); App.closeWindow('powermenu'); App.openWindow('verification'); } } export default new PowerMenu(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/services/screenrecord.js ================================================ import Service from 'resource:///com/github/Aylur/ags/service.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import GLib from 'gi://GLib'; import { dependencies } from '../utils.js'; const now = () => GLib.DateTime.new_now_local().format('%Y-%m-%d_%H-%M-%S'); class Recorder extends Service { static { Service.register(this, {}, { 'timer': ['int'], 'recording': ['boolean'], }); } #path = GLib.get_home_dir() + '/Videos/Screencasting'; #file = ''; #interval = 0; recording = false; timer = 0; async start() { if (!dependencies(['slurp', 'wf-recorder'])) return; if (this.recording) return; const area = await Utils.execAsync('slurp'); Utils.ensureDirectory(this.#path); this.#file = `${this.#path}/${now()}.mp4`; Utils.execAsync(['wf-recorder', '-g', area, '-f', this.#file]); this.recording = true; this.changed('recording'); this.timer = 0; this.#interval = Utils.interval(1000, () => { this.changed('timer'); this.timer++; }); } async stop() { if (!dependencies(['notify-send'])) return; if (!this.recording) return; Utils.execAsync('killall -INT wf-recorder'); this.recording = false; this.changed('recording'); GLib.source_remove(this.#interval); const res = await Utils.execAsync([ 'notify-send', '-A', 'files=Show in Files', '-A', 'view=View', '-i', 'video-x-generic-symbolic', 'Screenrecord', this.#file, ]); if (res === 'files') Utils.execAsync('xdg-open ' + this.#path); if (res === 'view') Utils.execAsync('xdg-open ' + this.#file); } async screenshot(full = false) { if (!dependencies(['slurp', 'wayshot'])) return; const path = GLib.get_home_dir() + '/Pictures/Screenshots'; const file = `${path}/${now()}.png`; Utils.ensureDirectory(path); await Utils.execAsync([ 'wayshot', '-f', file, ].concat(full ? [] : [ '-s', await Utils.execAsync('slurp'), ])); Utils.execAsync(['bash', '-c', `wl-copy < ${file}`]); const res = await Utils.execAsync([ 'notify-send', '-A', 'files=Show in Files', '-A', 'view=View', '-A', 'edit=Edit', '-i', file, 'Screenshot', file, ]); if (res === 'files') Utils.execAsync('xdg-open ' + path); if (res === 'view') Utils.execAsync('xdg-open ' + file); if (res === 'edit') Utils.execAsync(['swappy', '-f', file]); App.closeWindow('dashboard'); } } export default new Recorder(); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/SettingsDialog.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import RegularWindow from '../misc/RegularWindow.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import icons from '../icons.js'; import { getOptions, getValues } from './option.js'; import options from '../options.js'; const optionsList = getOptions(); const categories = Array.from(new Set(optionsList.map(opt => opt.category))) .filter(category => category !== 'exclude'); const currentPage = Variable(categories[0]); const search = Variable(''); const showSearch = Variable(false); showSearch.connect('changed', ({ value }) => { if (!value) search.value = ''; }); /** @param {import('./option.js').Opt} opt */ const EnumSetter = opt => { const lbl = Widget.Label({ binds: [['label', opt]] }); const step = (dir = 1) => { const i = opt.enums.findIndex(i => i === lbl.label); opt.setValue(dir > 0 ? i + dir > opt.enums.length - 1 ? opt.enums[0] : opt.enums[i + dir] : i + dir < 0 ? opt.enums[opt.enums.length - 1] : opt.enums[i + dir], true); }; const next = Widget.Button({ child: Widget.Icon(icons.ui.arrow.right), on_clicked: () => step(+1), }); const prev = Widget.Button({ child: Widget.Icon(icons.ui.arrow.left), on_clicked: () => step(-1), }); return Widget.Box({ class_name: 'enum-setter', children: [prev, lbl, next], }); }; /** @param {import('./option.js').Opt} opt */ const Setter = opt => { switch (opt.type) { case 'number': return Widget.SpinButton({ setup(self) { self.set_range(0, 1000); self.set_increments(1, 5); }, connections: [ ['value-changed', self => opt.setValue(self.value, true)], [opt, self => self.value = opt.value], ], }); case 'float': case 'object': return Widget.Entry({ on_accept: self => opt.setValue(JSON.parse(self.text || ''), true), connections: [[opt, self => self.text = JSON.stringify(opt.value)]], }); case 'string': return Widget.Entry({ on_accept: self => opt.setValue(self.text, true), connections: [[opt, self => self.text = opt.value]], }); case 'enum': return EnumSetter(opt); case 'boolean': return Widget.Switch({ connections: [ ['notify::active', self => opt.setValue(self.active, true)], [opt, self => self.active = opt.value], ], }); case 'img': return Widget.FileChooserButton({ connections: [['selection-changed', self => { opt.setValue(self.get_uri()?.replace('file://', ''), true); }]], }); case 'font': return Widget.FontButton({ show_size: false, use_size: false, connections: [ ['notify::font', ({ font }) => opt.setValue(font, true)], [opt, self => self.font = opt.value], ], }); default: return Widget.Label({ label: 'no setter with type ' + opt.type, }); } }; /** @param {import('./option.js').Opt} opt */ const Row = opt => Widget.Box({ class_name: 'row', setup: self => self.opt = opt, children: [ Widget.Box({ vertical: true, vpack: 'center', children: [ opt.title && Widget.Label({ xalign: 0, class_name: 'summary', label: opt.title, }), Widget.Label({ xalign: 0, class_name: 'id', label: `id: "${opt.id}"`, }), ], }), Widget.Box({ hexpand: true }), Widget.Box({ vpack: 'center', vertical: true, children: [ Widget.Box({ hpack: 'end', child: Setter(opt), }), opt.note && Widget.Label({ xalign: 1, class_name: 'note', label: opt.note, }), ], }), ], }); /** @param {string} category */ const Page = category => Widget.Scrollable({ vexpand: true, class_name: 'page', child: Widget.Box({ class_name: 'page-content vertical', vertical: true, connections: [[search, self => { for (const child of self.children) { child.visible = child.opt.id.includes(search.value) || child.opt.title.includes(search.value) || child.opt.note.includes(search.value); } }]], children: optionsList .filter(opt => opt.category.includes(category)) .map(Row), }), }); const sidebar = Widget.Revealer({ binds: [['reveal-child', search, 'value', v => !v]], transition: 'slide_right', child: Widget.Box({ hexpand: false, vertical: true, children: [ Widget.Box({ class_name: 'sidebar-header', children: [ Widget.Button({ hexpand: true, label: icons.dialog.Search + ' Search', on_clicked: () => showSearch.value = !showSearch.value, }), Widget.Button({ hpack: 'end', child: Widget.Icon(icons.ui.info), on_clicked: () => App.toggleWindow('about'), }), ], }), Widget.Scrollable({ vexpand: true, hscroll: 'never', child: Widget.Box({ class_name: 'sidebar-box vertical', vertical: true, children: [ ...categories.map(name => Widget.Button({ label: (icons.dialog[name] || '') + ' ' + name, xalign: 0, binds: [['class-name', currentPage, 'value', v => v === name ? 'active' : '']], on_clicked: () => currentPage.setValue(name), })), ], }), }), Widget.Box({ class_name: 'sidebar-footer', child: Widget.Button({ class_name: 'copy', child: Widget.Label({ label: ' Save', xalign: 0, }), hexpand: true, on_clicked: () => { Utils.execAsync([ 'wl-copy', getValues(), ]); Utils.execAsync([ 'notify-send', '-i', 'preferences-desktop-theme-symbolic', 'Theme copied to clipboard', 'To save it permanently, make a new theme in themes.js', ]); }, }), }), ], }), }); const searchEntry = Widget.Revealer({ transition: 'slide_down', binds: [ ['reveal-child', showSearch], ['transition-duration', options.transition], ], child: Widget.Entry({ connections: [[showSearch, self => { if (!showSearch.value) self.text = ''; if (showSearch.value) self.grab_focus(); }]], hexpand: true, class_name: 'search', placeholder_text: 'Search Options', secondary_icon_name: icons.apps.search, on_change: ({ text }) => search.value = text || '', }), }); const categoriesStack = Widget.Stack({ transition: 'slide_left_right', items: categories.map(name => [name, Page(name)]), binds: [ ['shown', currentPage], ['visible', search, 'value', v => !v], ], }); const searchPage = Widget.Box({ binds: [['visible', search, 'value', v => !!v]], child: Page(''), }); export default RegularWindow({ name: 'settings-dialog', title: 'Settings', setup: win => win.set_default_size(800, 500), connections: [ ['delete-event', win => { win.hide(); return true; }], ['key-press-event', (self, event) => { if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) { self.text = ''; showSearch.setValue(false); search.setValue(''); } }], ], child: Widget.Box({ children: [ sidebar, Widget.Box({ vertical: true, children: [ searchEntry, categoriesStack, searchPage, ], }), ], }), }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/globals.js ================================================ import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; export async function globals() { try { globalThis.options = (await import('../options.js')).default; globalThis.iconBrowser = (await import('../misc/IconBrowser.js')).default; globalThis.app = (await import('resource:///com/github/Aylur/ags/app.js')).default; globalThis.audio = (await import('resource:///com/github/Aylur/ags/service/audio.js')).default; globalThis.recorder = (await import('../services/screenrecord.js')).default; globalThis.brightness = (await import('../services/brightness.js')).default; globalThis.indicator = (await import('../services/onScreenIndicator.js')).default; Mpris.players.forEach(player => { player.connect('changed', player => { globalThis.mpris = player || Mpris.players[0]; }); }); Mpris.connect('player-added', (mpris, bus) => { mpris.getPlayer(bus)?.connect('changed', player => { globalThis.mpris = player || Mpris.players[0]; }); }); Mpris.connect('player-closed', () => { globalThis.mpris = Mpris.players[0]; }); } catch (error) { logError(error); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/hyprland.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import options from '../options.js'; import { readFile, writeFile } from 'resource:///com/github/Aylur/ags/utils.js'; const noIgnorealpha = ['verification', 'powermenu', 'lockscreen']; /** @param {Array} batch */ function sendBatch(batch) { const cmd = batch .filter(x => !!x) .map(x => `keyword ${x}`) .join('; '); Hyprland.sendMessage(`[[BATCH]]/${cmd}`); } /** @param {string} scss */ function getColor(scss) { if (scss.includes('#')) return scss.replace('#', ''); if (scss.includes('$')) { const opt = options.list().find(opt => opt.scss === scss.replace('$', '')); return opt?.value.replace('#', '') || 'ff0000'; } } export function hyprlandInit() { if (readFile('/tmp/ags/hyprland-init')) return; sendBatch(Array.from(App.windows).flatMap(([name]) => [ `layerrule blur, ${name}`, noIgnorealpha.some(skip => name.includes(skip)) ? '' : `layerrule ignorealpha 0.6, ${name}`, ])); writeFile('init', '/tmp/ags/hyprland-init'); } export async function setupHyprland() { const wm_gaps = Math.floor(options.hypr.wm_gaps_multiplier.value * options.spacing.value); const border_width = options.border.width.value; const radii = options.radii.value; const drop_shadow = options.desktop.drop_shadow.value; const bar_style = options.bar.style.value; const bar_pos = options.bar.position.value; const inactive_border = options.hypr.inactive_border.value; const accent = getColor(options.theme.accent.accent.value); const batch = []; JSON.parse(await Hyprland.sendMessage('j/monitors')).forEach(({ name }) => { const v = bar_pos === 'top' ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`; if (bar_style !== 'normal') batch.push(`monitor ${name},addreserved,${v}`); else batch.push(`monitor ${name},addreserved,0,0,0,0`); }); batch.push( `general:border_size ${border_width}`, `general:gaps_out ${wm_gaps}`, `general:gaps_in ${Math.floor(wm_gaps / 2)}`, `general:col.active_border rgba(${accent}ff)`, `general:col.inactive_border ${inactive_border}`, `decoration:rounding ${radii}`, `decoration:drop_shadow ${drop_shadow ? 'yes' : 'no'}`, ); sendBatch(batch); } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/option.js ================================================ import { CACHE_DIR, readFile, writeFile } from 'resource:///com/github/Aylur/ags/utils.js'; import { exec } from 'resource:///com/github/Aylur/ags/utils.js'; import options from '../options.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import { reloadScss } from './scss.js'; import { setupHyprland } from './hyprland.js'; const CACHE_FILE = CACHE_DIR + '/options.json'; /** object that holds the overriedden values */ let cacheObj = JSON.parse(readFile(CACHE_FILE) || '{}'); /** * @template T * @typedef {Object} OptionConfig * @property {string=} scss - name of scss variable set to "exclude" to not include it in the generated scss file * @property {string=} unit - scss unit on numbers, default is "px" * @property {string=} title * @property {string=} note * @property {string=} category * @property {boolean=} noReload - don't reload css & hyprland on change * @property {boolean=} persist - ignore reset call * @property {'object' | 'string' | 'img' | 'number' | 'float' | 'font' | 'enum' =} type * @property {Array =} enums * @property {(value: T) => any=} format * @property {(value: T) => any=} scssFormat */ /** @template T */ export class Opt extends Service { static { Service.register(this, {}, { 'value': ['jsobject'], }); } #value; #scss = ''; unit = 'px'; noReload = false; persist = false; id = ''; title = ''; note = ''; type = ''; category = ''; /** @type {Array} */ enums = []; /** @type {(v: T) => any} */ format = v => v; /** @type {(v: T) => any} */ scssFormat = v => v; /** * @param {T} value * @param {OptionConfig =} config */ constructor(value, config) { super(); this.#value = value; this.defaultValue = value; this.type = typeof value; if (config) Object.keys(config).forEach(c => this[c] = config[c]); import('../options.js').then(this.#init.bind(this)); } set scss(scss) { this.#scss = scss; } get scss() { return this.#scss || this.id .split('.') .join('-') .split('_') .join('-'); } #init() { getOptions(); // sets the ids as a side effect if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]); const words = this.id .split('.') .flatMap(w => w.split('_')) .map(word => word.charAt(0).toUpperCase() + word.slice(1)); this.title ||= words.join(' '); this.category ||= words.length === 1 ? 'General' : words.at(0) || 'General'; this.connect('changed', () => { cacheObj[this.id] = this.value; writeFile( JSON.stringify(cacheObj, null, 2), CACHE_FILE, ); }); } get value() { return this.#value; } set value(value) { this.setValue(value); } /** @param {T} value */ setValue(value, reload = false) { if (typeof value !== typeof this.defaultValue) { console.error(Error(`WrongType: Option "${this.id}" can't be set to ${value}, ` + `expected "${typeof this.defaultValue}", but got "${typeof value}"`)); return; } if (this.value !== value) { this.#value = this.format(value); this.changed('value'); if (reload && !this.noReload) { reloadScss(); setupHyprland(); } } } reset(reload = false) { if (!this.persist) this.setValue(this.defaultValue, reload); } } /** * @template T * @param {T} value * @param {OptionConfig =} config * @returns {Opt} */ export function Option(value, config) { return new Opt(value, config); } /** @returns {Array>} */ export function getOptions(object = options, path = '') { return Object.keys(object).flatMap(key => { /** @type Option */ const obj = object[key]; const id = path ? path + '.' + key : key; if (obj instanceof Opt) { obj.id = id; return obj; } if (typeof obj === 'object') return getOptions(obj, id); return []; }); } export function resetOptions() { exec(`rm -rf ${CACHE_FILE}`); cacheObj = {}; getOptions().forEach(opt => opt.reset()); } export function getValues() { const obj = {}; for (const opt of getOptions()) { if (opt.category !== 'exclude') obj[opt.id] = opt.value; } return JSON.stringify(obj, null, 2); } /** @param {string | object} config */ export function apply(config) { const options = getOptions(); const settings = typeof config === 'string' ? JSON.parse(config) : config; for (const id of Object.keys(settings)) { const opt = options.find(opt => opt.id === id); if (!opt) { print(`No option with id: "${id}"`); continue; } opt.setValue(settings[id]); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/scss.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import { getOptions } from './option.js'; import { dependencies } from '../utils.js'; export function scssWatcher() { return Utils.subprocess( [ 'inotifywait', '--recursive', '--event', 'create,modify', '-m', App.configDir + '/scss', ], reloadScss, () => print('missing dependancy for css hotreload: inotify-tools'), ); } /** * generate an scss file that makes every option available as a variable * based on the passed scss parameter or the path in the object * * e.g * options.bar.style.value => $bar-style */ export async function reloadScss() { if (!dependencies(['sassc'])) return; const opts = getOptions(); const vars = opts.map(opt => { if (opt.scss === 'exclude') return ''; const unit = typeof opt.value === 'number' ? opt.unit : ''; const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value; return `$${opt.scss}: ${value}${unit};`; }); const bar_style = opts.find(opt => opt.id === 'bar.style')?.value || ''; const additional = bar_style === 'normal' ? '//' : ` window#quicksettings .window-content { margin-right: $wm-gaps; } `; try { const tmp = '/tmp/ags/scss'; Utils.ensureDirectory(tmp); await Utils.writeFile(vars.join('\n'), `${tmp}/options.scss`); await Utils.writeFile(additional, `${tmp}/additional.scss`); await Utils.execAsync(`sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`); App.resetCss(); App.applyCss(`${tmp}/style.css`); } catch (error) { if (error instanceof Error) console.error(error.message); if (typeof error === 'string') console.error(error); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/setup.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import options from '../options.js'; import icons from '../icons.js'; import { reloadScss, scssWatcher } from './scss.js'; import { initWallpaper, wallpaper } from './wallpaper.js'; import { hyprlandInit } from './hyprland.js'; import { globals } from './globals.js'; import Gtk from 'gi://Gtk'; import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; export function init() { initWallpaper(); notificationBlacklist(); warnOnLowBattery(); globals(); tmux(); gsettigsColorScheme(); gtkFontSettings(); scssWatcher(); App.connect('config-parsed', () => { reloadScss(); hyprlandInit(); wallpaper(); pywal(); gtkTheme(); gtkIcons(); }); } function tmux() { if (!Utils.exec('which tmux')) return; /** @param {string} scss */ function getColor(scss) { if (scss.includes('#')) return scss; if (scss.includes('$')) { const opt = options.list().find(opt => opt.scss === scss.replace('$', '')); return opt?.value; } } options.theme.accent.accent.connect('changed', ({ value }) => Utils .execAsync(`tmux set @main_accent ${getColor(value)}`) .catch(err => console.error(err.message))); } function gsettigsColorScheme() { if (!Utils.exec('which gsettings')) return; options.theme.scheme.connect('changed', ({ value }) => { const gsettings = 'gsettings set org.gnome.desktop.interface color-scheme'; Utils.execAsync(`${gsettings} "prefer-${value}"`) .catch(err => console.error(err.message)); }); } function gtkFontSettings() { const settings = Gtk.Settings.get_default(); if (!settings) { console.error(Error('Gtk.Settings unavailable')); return; } const callback = () => { const { size, font } = options.font; settings.gtk_font_name = `${font.value} ${size.value}`; }; options.font.font.connect('notify::value', callback); options.font.size.connect('notify::value', callback); } function notificationBlacklist() { Notifications.connect('notified', (_, id) => { const n = Notifications.getNotification(id); options.notifications.black_list.value.forEach(item => { if (n?.app_name.includes(item) || n?.app_entry?.includes(item)) n.close(); }); }); } function warnOnLowBattery() { Battery.connect('notify::percent', () => { const low = options.battery.low.value; if (Battery.percent !== low || Battery.percent !== low / 2 || !Battery.charging) return; Utils.execAsync([ 'notify-send', `${Battery.percent}% Battery Percentage`, '-i', icons.battery.warning, '-u', 'critical', ]); }); } export function pywal() { if (!exec('which wal')) return print('missing dependancy: pywal'); execAsync([ 'wal', '--theme', options.misc.pywal.theme.value, ]).catch(err => console.error(err)); } export function gtkTheme() { if (!exec('which gsettings')) return print('missing dependancy: Gnome-Settings'); execAsync([ 'gsettings', 'set', 'org.gnome.desktop.interface', 'gtk-theme', options.misc.gtk.theme.value, ]).catch(err => console.error(err)); } export function gtkIcons() { if (!exec('which gsettings')) return print('missing dependancy: Gnome-Settings'); execAsync([ 'gsettings', 'set', 'org.gnome.desktop.interface', 'icon-theme', options.misc.gtkIcons.theme.value, ]).catch(err => console.error(err)); } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/theme.js ================================================ import options from '../options.js'; import themes from '../themes.js'; import { reloadScss } from './scss.js'; import { setupHyprland } from './hyprland.js'; import { wallpaper } from './wallpaper.js'; import { gtkIcons, gtkTheme, pywal } from './setup.js'; import GLib from 'gi://GLib'; /** @param {string} name */ export function setTheme(name) { options.reset(); const theme = themes.find(t => t.name === name); if (!theme) return print('No theme named ' + name); options.apply(theme.options); reloadScss(); setupHyprland(); wallpaper(); pywal(); gtkIcons(); gtkTheme(); } export const WP = GLib.get_home_dir() + '/.config/backgrounds/'; export const HOME = GLib.get_home_dir() + '/'; export const lightColors = { 'theme.scheme': 'light', 'color.red': '#e55f86', 'color.green': '#00D787', 'color.yellow': '#EBFF71', 'color.blue': '#51a4e7', 'color.magenta': '#9077e7', 'color.teal': '#51e6e6', 'color.orange': '#E79E64', 'theme.bg': '#fffffa', 'theme.fg': '#141414', }; export const Theme = ({ name, icon = ' ', ...options }) => ({ name, icon, options: { 'theme.name': name, 'theme.icon': icon, ...options, }, }); let settingsDialog; export async function openSettings() { if (settingsDialog) return settingsDialog.present(); try { settingsDialog = (await import('./SettingsDialog.js')).default; settingsDialog.present(); } catch (error) { if (error instanceof Error) console.error(error.message); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/settings/wallpaper.js ================================================ import options from '../options.js'; import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; import { dependencies } from '../utils.js'; export function initWallpaper() { if (dependencies(['swww'])) { exec('swww init'); options.desktop.wallpaper.img.connect('changed', wallpaper); } } export function wallpaper() { if (!dependencies(['swww'])) return; execAsync([ 'swww', 'img', '--transition-type', 'grow', '--transition-pos', exec('hyprctl cursorpos').replace(' ', ''), options.desktop.wallpaper.img.value, ]).catch(err => console.error(err)); } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/themes.js ================================================ /** * A Theme is a set of options that will be applied * ontop of the default values. see options.js for possible options */ import { Theme, WP, HOME } from './settings/theme.js'; export default [ Theme({ name: 'Adwaita Dark', icon: '󰊬 ', "workspaces": 10, "misc.pywal.theme": "base16-default", "misc.gtk.theme": "adw-gtk3-dark", "misc.gtkIcons.theme": "Adwaita", "desktop.wallpaper.img": WP + "topography_hyprland_bright.png", "desktop.avatar": HOME + "face.png", "spacing": 2, "padding": 8, "radii": 5, "popover_padding_multiplier": 1.4, "color.red": "#c01c28", "color.green": "#2ec27e", "color.yellow": "#f5c211", "color.blue": "#3584e4", "color.magenta": "#813d9c", "color.teal": "#99c1f1", "color.orange": "#e66100", "theme.scheme": "dark", "theme.bg": "#1E1E1E", "theme.fg": "#deddda", "theme.accent.accent": "$blue", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 42, "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "desktop.dock.icon_size": 42, "desktop.dock.pinned_apps": [ "brave", "Visual Studio Code", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], "notifications.black_list": [ "Spotify" ], "notifications.position": [ "top" ], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": [ "firefox" ], "mpris.preferred": "spotify", }), Theme({ name: 'Gruvbox Dark', icon: ' ', "workspaces": 10, "misc.pywal.theme": "base16-gruvbox-hard", "misc.gtk.theme": "Gruvbox-Dark-B", "misc.gtkIcons.theme": "gruvbox_icons", "desktop.wallpaper.img": WP + "stairs.png", "desktop.avatar": HOME + "face.png", "spacing": 2, "padding": 8, "radii": 5, "popover_padding_multiplier": 1.4, "color.red": "#CC241D", "color.green": "#476C43", "color.yellow": "#D79921", "color.blue": "#458588", "color.magenta": "#B16286", "color.teal": "#689D6A", "color.orange": "#D65D0E", "theme.scheme": "dark", "theme.bg": "#1D2021", "theme.fg": "#FBF1C7", "theme.accent.accent": "$blue", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$green", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "notifications.black_list": [ "Spotify" ], "notifications.position": [ "top" ], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": [ "Caprine" ], "mpris.preferred": "spotify", }), Theme({ name: 'Catppuccin Mocha', icon: '󰄛 ', "workspaces": 10, "misc.pywal.theme": "base16-seti", "misc.gtk.theme": "Catppuccin_Mocha", "misc.gtkIcons.theme": "catppuccin_mocha", "desktop.wallpaper.img": WP + "oled-mountains.jpg", "desktop.avatar": HOME + "face.png", "spacing": 2, "padding": 8, "radii": 5, "popover_padding_multiplier": 1.4, "color.red": "#F38BA8", "color.green": "#A6E3A1", "color.yellow": "#F9E2AF", "color.blue": "#89B4FA", "color.magenta": "#CBA6F7", "color.teal": "#94E2D5", "color.orange": "#FAB387", "theme.scheme": "dark", "theme.bg": "#181825", "theme.fg": "#CDD6F4", "theme.accent.accent": "$teal", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "notifications.black_list": [ "Spotify" ], "notifications.position": [ "top" ], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": [ "Caprine" ], "mpris.preferred": "spotify", }), Theme({ name: 'Rosé Pine', icon: '󰐅 ', "workspaces": 10, "misc.pywal.theme": "base16-default", "misc.gtk.theme": "rose-pine-gtk", "misc.gtkIcons.theme": "rose-pine-icons", "desktop.wallpaper.img": WP + "leafy-moon.png", "desktop.avatar": HOME + "face.png", "spacing": 2, "padding": 8, "radii": 5, "popover_padding_multiplier": 1.4, "color.red": "#eb6f92", "color.green": "#9ccfd8", "color.yellow": "#f6c177", "color.blue": "#3e8fb0", "color.magenta": "#c4a7e7", "color.teal": "#31748f", "color.orange": "#ebbcba", "theme.scheme": "dark", "theme.bg": "#191724", "theme.fg": "#e0def4", "theme.accent.accent": "$teal", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "notifications.black_list": [ "Spotify" ], "notifications.position": [ "top" ], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": [ "Caprine" ], "mpris.preferred": "spotify", }), ]; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/utils.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import cairo from 'cairo'; import icons from './icons.js'; import Gdk from 'gi://Gdk'; import GLib from 'gi://GLib'; /** * @param {number} length * @param {number=} start * @returns {Array} */ export function range(length, start = 1) { return Array.from({ length }, (_, i) => i + start); } /** * @param {Array<[string, string] | string[]>} collection * @param {string} item * @returns {string} */ export function substitute(collection, item) { return collection.find(([from]) => from === item)?.[1] || item; } /** * @param {(monitor: number) => any} widget * @returns {Array} */ export function forMonitors(widget) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1; return range(n, 0).map(widget).flat(1); } /** * @param {import('gi://Gtk').Gtk.Widget} widget * @returns {any} - missing cairo type */ export function createSurfaceFromWidget(widget) { const alloc = widget.get_allocation(); const surface = new cairo.ImageSurface( cairo.Format.ARGB32, alloc.width, alloc.height, ); const cr = new cairo.Context(surface); cr.setSourceRGBA(255, 255, 255, 0); cr.rectangle(0, 0, alloc.width, alloc.height); cr.fill(); widget.draw(cr); return surface; } /** @param {string} icon */ export function getAudioTypeIcon(icon) { const substitues = [ ['audio-headset-bluetooth', icons.audio.type.headset], ['audio-card-analog-usb', icons.audio.type.speaker], ['audio-card-analog-pci', icons.audio.type.card], ]; return substitute(substitues, icon); } /** @param {import('types/service/applications').Application} app */ export function launchApp(app) { Utils.execAsync(['hyprctl', 'dispatch', 'exec', `sh -c ${app.executable}`]); app.frequency += 1; } /** @param {Array} bins */ export function dependencies(bins) { const deps = bins.map(bin => { const has = Utils.exec(`which ${bin}`); if (!has) print(`missing dependency: ${bin}`); return !!has; }); return deps.every(has => has); } /** @param {string} img - path to an img file */ export function blurImg(img) { const cache = Utils.CACHE_DIR + '/media'; return new Promise(resolve => { if (!img) resolve(''); const dir = cache + '/blurred'; const blurred = dir + img.substring(cache.length); if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) return resolve(blurred); Utils.ensureDirectory(dir); Utils.execAsync(['convert', img, '-blur', '0x22', blurred]) .then(() => resolve(blurred)) .catch(() => resolve('')); }); } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/js/variables.js ================================================ import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import GLib from 'gi://GLib'; import options from './options.js'; const intval = options.systemFetchInterval; export const uptime = Variable('', { poll: [60_000, 'cat /proc/uptime', line => { const uptime = Number.parseInt(line.split('.')[0]) / 60; if (uptime > 18 * 60) return 'Go Sleep'; const h = Math.floor(uptime / 60); const s = Math.floor(uptime % 60); return `${h}:${s < 10 ? '0' + s : s}`; }], }); export const distro = GLib.get_os_info('ID'); export const distroIcon = (() => { switch (distro) { case 'fedora': return ''; case 'arch': return ''; case 'nixos': return ''; case 'debian': return ''; case 'opensuse-tumbleweed': return ''; case 'ubuntu': return ''; case 'endeavouros': return ''; default: return ''; } })(); /** @type {function([string, string] | string[]): number} */ const divide = ([total, free]) => Number.parseInt(free) / Number.parseInt(total); export const cpu = Variable(0, { poll: [intval, 'top -b -n 1', out => divide(['100', out.split('\n') .find(line => line.includes('Cpu(s)')) ?.split(/\s+/)[1] .replace(',', '.') || '0'])], }); export const ram = Variable(0, { poll: [intval, 'free', out => divide(out.split('\n') .find(line => line.includes('Mem:')) ?.split(/\s+/) .splice(1, 2) || ['1', '1'])], }); export const temp = Variable(0, { poll: [intval, 'cat ' + options.temperature, n => { return Number.parseInt(n) / 100_000; }], }); ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/package.json ================================================ { "name": "ags-dotfiles", "version": "1.6.3", "description": "An extensible GTK-Shell", "main": "config.js", "scripts": { "lint": "eslint . --fix", "stylelint": "stylelint ./scss --fix" }, "repository": { "type": "git", "url": "git+https://github.com/RoccoRakete/hyprland-dots.git" }, "author": "RoccoRakete", "bugs": { "url": "https://github.com/RoccoRakete/hyprland-dots/issues" }, "homepage": "https://github.com/RoccoRakete/hyprland-dots/blob/main/README.md", "kofi": "https://ko-fi.com/roccorakete", "devDependencies": { "@girs/dbusmenugtk3-0.4": "^0.4.0-3.2.0", "@girs/gobject-2.0": "^2.76.1-3.2.3", "@girs/gtk-3.0": "^3.24.39-3.2.2", "@girs/gvc-1.0": "^1.0.0-3.1.0", "@girs/nm-1.0": "^1.43.1-3.1.0", "stylelint-config-standard-scss": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.44.0" } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/prepare_background.sh ================================================ #!/usr/bin/env sh convert -scale 1920x1080 -blur 0x10 ~/.config/backgrounds/last/image.png ~/.config/backgrounds/last/image_blurred.png ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/a11y-button.scss ================================================ @import './button'; @mixin accs-button($flat: false, $reactive: true){ @include button($flat: true, $reactive: false, $focusable: false); color: $fg-color; > * { border-radius: $radii; transition: $transition; @if $flat{ background-color: transparent; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } } @if $reactive{ &:focus > *, &.focused > * { @include button-focus; } &:hover > * { @include button-hover; } &:active, &.active, &.on, &:checked { > * { @include button-active; } &:hover > * { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/button-workspaces.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $accent; background-color: $hover; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $bg-color; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $accent; color: $accent-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg-color, 0.7); } @mixin button-workspaces($flat: false, $reactive: true, $radii: $radii, $focusable: true){ all: unset; transition: $transition; border-radius: $radii; color: $fg-color; @if $flat{ background-color: transparent; background-image: none; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive{ @if $focusable { &:focus{ @include button-focus; } } &:hover{ @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/button.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $accent; background-color: $hover; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $hover; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $accent; color: $accent-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg-color, 0.7); } @mixin button($flat: false, $reactive: true, $radii: $radii, $focusable: true){ all: unset; transition: $transition; border-radius: $radii; color: $fg-color; @if $flat{ background-color: transparent; background-image: none; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive{ @if $focusable { &:focus{ @include button-focus; } } &:hover{ @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/floating-widget.scss ================================================ @mixin floating-widget { @if $drop-shadow { box-shadow: 0 0 5px 0 $shadow; } margin: max($spacing, 8px); border: $border-width solid $popover-border-color; background-color: $bg-color; color: $fg-color; border-radius: $popover-radius; padding: $popover-padding; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/hidden.scss ================================================ @mixin hidden { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); * { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/menu.scss ================================================ window.popup { > * { border: none; box-shadow: none; } menu { border-radius: $popover-radius; background-color: $bg-color; padding: $popover-padding; border: $border-width solid $popover-border-color; separator { background-color: $border-color; } menuitem { @include button; padding: $spacing/2; margin: $spacing/2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/scrollable.scss ================================================ @mixin scrollable { scrollbar, scrollbar * { all: unset; } scrollbar.vertical { transition: $transition; background-color: transparentize($bg-color, 0.7); &:hover { background-color: transparentize($bg-color, 0.3); slider { background-color: transparentize($fg-color, 0.3); min-width: .6em; } } } scrollbar.vertical slider { background-color: transparentize($fg-color, 0.5); border-radius: $radii; min-width: .4em; min-height: 2em; transition: $transition; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/slider.scss ================================================ @import './unset'; @mixin slider($width: 0.7em, $slider-width: .5em, $gradient: $active-gradient, $slider: true, $focusable: true, $radii: $radii){ @include unset($rec: true); trough{ transition: $transition; border-radius: $radii; border: $border; background-color: $widget-bg; min-height: $width; min-width: $width; highlight, progress{ border-radius: max($radii - $border-width, 0); background-image: $gradient; min-height: $width; min-width: $width; } } slider { box-shadow: none; background-color: transparent; border: $border-width solid transparent; transition: $transition; border-radius: $radii; min-height: $width; min-width: $width; margin: -$slider-width; } &:hover { trough { background-color: $hover; } slider { @if $slider{ background-color: $fg-color; border-color: $border-color; @if $drop-shadow { box-shadow: 0 0 3px 0 $shadow; } } } } &:disabled { highlight, progress{ background-color: transparentize($fg-color, 0.4); background-image: none; } } @if $focusable { trough:focus{ background-color: $hover; box-shadow: inset 0 0 0 $border-width $accent; slider { @if $slider { background-color: $fg-color; box-shadow: inset 0 0 0 $border-width $accent; } } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/spacing.scss ================================================ @mixin spacing($multiplier: 6, $spacing: $spacing, $rec: false) { &.horizontal > * { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical > * { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } @if $rec { box { &.horizontal > * { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical > * { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/switch.scss ================================================ @import './button'; @mixin switch { @include button; slider { background-color: $accent-fg; border-radius: $radii; min-width: 24px; min-height: 24px; } image { color: transparent; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/text-border.scss ================================================ @mixin text-border{ text-shadow: -1 * $border-width -1 * $border-width 0 $border-color, $border-width $border-width 0 $border-color, -1 * $border-width $border-width 0 $border-color, $border-width -1 * $border-width 0 $border-color; -gtk-icon-shadow: -1 * $border-width -1 * $border-width 0 $border-color, $border-width $border-width 0 $border-color, -1 * $border-width $border-width 0 $border-color, $border-width -1 * $border-width 0 $border-color; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/tooltip.scss ================================================ tooltip { * { all: unset; } background-color: transparent; border: none; > * > *{ background-color: $bg-color; border-radius: $radii; border: $border-width solid $popover-border-color; color: $fg-color; padding: 8px; margin: 4px; box-shadow: 0 0 3px 0 $shadow; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/unset.scss ================================================ @mixin unset($rec: false){ all: unset; @if $rec { * { all: unset }; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/common/widget.scss ================================================ @mixin widget{ transition: $transition; border-radius: $radii; color: $fg-color; background-color: $widget-bg; border: $border; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/main.scss ================================================ @import '/tmp/ags/scss/options'; @import './variables'; // common @import './common/unset'; @import './common/widget'; @import './common/button'; @import './common/button-workspaces.scss'; @import './common/a11y-button'; @import './common/floating-widget'; @import './common/slider'; @import './common/scrollable'; @import './common/switch'; @import './common/hidden'; @import './common/text-border'; @import './common/tooltip'; @import './common/menu'; @import './common/spacing'; // widgets @import './widgets/about'; @import './widgets/applauncher'; @import './widgets/bar'; @import './widgets/desktop'; @import './widgets/notifications'; @import './widgets/overview'; @import './widgets/osd'; @import './widgets/dashboard'; @import './widgets/dock'; @import './widgets/powermenu'; @import './widgets/lockscreen'; @import './widgets/media'; @import './widgets/quicksettings'; @import './widgets/settings'; // additional overrides @import '/tmp/ags/scss/additional'; ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/variables.scss ================================================ // variables are defined in options.js // these ones are derived from those $hover: transparentize($_widget-bg, ($widget-opacity * 0.9) / 100); $widget-bg: transparentize($_widget-bg, $widget-opacity / 100); $active-gradient: linear-gradient($accent-gradient); $hover-fg: if($color-scheme == 'dark', lighten($fg-color, 10%), darken($fg-color, 8%)); $border-color: transparentize($_border-color, $border-opacity / 100); $border: $border-width solid $border-color; $text-shadow: 2px 2px 2px $shadow; $popover-border-color: transparentize($_border-color, max(($border-opacity - 1) / 100, 0)); $popover-padding: $padding * $popover-padding-multiplier; $popover-radius: if($radii == 0, 0, $radii + $popover-padding); $bar-border: $border-width solid $bar-border-color; $shader-fg: #fff; * { font-size: $font-size; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/about.scss ================================================ window#about { @include unset; .window-content { @include floating-widget; min-width: 300px; } .avatar { min-width: 200px; min-height: 200px; background-size: cover; border: $border; margin: $spacing 0; } .labels { .title { font-size: 1.2em; } .author { color: transparentize($fg-color, 0.2) } .version { margin-top: $spacing; margin-bottom: $spacing * 2; border-radius: $radii; background-color: $widget-bg; color: $accent; padding: $padding; } } .buttons { padding-bottom: $popover-padding; button { @include button; padding: $padding; &:first-child { border-radius: $radii $radii 0 0; } &:last-child { border-radius: 0 0 $radii $radii; } } } .dont-show { @include button; padding: $padding; image { font-size: 1.4em; color: $red; } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/applauncher.scss ================================================ window#applauncher .window-content { @include floating_widget; entry { @include button; padding: $padding; margin-bottom: $spacing; label, image { color: $fg-color; } } separator { min-height: 1px; background-color: $hover; } scrolledwindow { @include scrollable; min-width: $applauncher-width; min-height: $applauncher-height; } button.app-item { @include button($flat: true, $reactive: false); > box { @include spacing(0.5); } transition: $transition; padding: $padding; label { transition: $transition; &.title { color: $fg-color; } &.description { color: transparentize($fg-color, 0.3); } } image { transition: $transition; } &:hover, &:focus { .title { color: $accent; } image { -gtk-icon-shadow: 2px 2px $accent; } } &:active { background-color: transparentize($accent, 0.5); border-radius: $radii; box-shadow: inset 0 0 0 $border-width $border-color; .title { color: $fg-color; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/bar.scss ================================================ $bar-spacing: $spacing / 2; $button-radius: if($bar-style == "floating", max(0, $radii - $bar-spacing), $radii); @mixin panel-button($flat: $bar-flat-buttons, $reactive: true) { @include unset; @if $bar-style == "separated" { transition: $transition; > * { @include floating-widget; border-radius: $radii; margin: $wm-gaps $bar-spacing; transition: $transition; } &:hover > * { color: $hover-fg; @if $drop-shadow { box-shadow: 0 0 min(6px, $spacing/2) 0 $shadow, inset 0 0 0 99px $hover; } @else { box-shadow: inset 0 0 0 99px $hover; } } &:active > *, &.active > * { label, image { color: $accent-fg; } background-image: $active-gradient; background-color: $accent; } } @else { @include accs-button($flat, $reactive); > * { border-radius: $button-radius; margin: $bar-spacing; } } label, image { font-weight: bold; } > * { padding: $padding * 0.4 $padding * 0.8; } } .panel { .cpu { padding-left: $spacing/2; color: $accent; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-left: $spacing/4; margin-right: 0; padding: $spacing; padding-left: $spacing * 3; background-color: $bg-color; } } .ram { color: $yellow; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-radius: 0; margin-left: 0; margin-right: 0; padding: $spacing; background-color: $bg-color; } } .temp { padding-right: $spacing * 2; color: $magenta; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-right: $spacing/4; margin-left: 0; padding: $spacing; padding-right: $spacing * 3; background-color: $bg-color; } } .circular-progress-box { .circular-progress { margin: $spacing/2.5; background-color: $widget-bg; font-size: 1em; @if $bar_style == "separated" { padding: $wm_gaps $wm_gaps + 5px $wm_gaps $wm_gaps + 5px; border-radius: max($radii - $border_width, 0); margin-left: $spacing/4; margin-right: $spacing/4; } } } @if $bar-style == "normal" { background-color: $bg-color; } @if not $screen-corners and $bar-style == "normal" { @if $bar-position == "bottom" { border-top: $border; } @else { border-bottom: $border; } } @if $bar-style == "floating" { @include floating-widget; border-radius: $radii; margin-top: $wm-gaps; margin-left: $wm-gaps; margin-right: $wm-gaps; margin-bottom: 0; padding: 0; } @if $bar-style == "separated" { > .end > button:last-child > * { margin-right: $wm-gaps; } > .start > button:first-child > * { margin-left: $wm-gaps; } margin-bottom: 0; } .panel-button { @include panel-button; } .battery_percentage { padding-bottom: 2px; } .tray-item, .color-picker { @include panel-button($flat: true); } separator { background-color: transparentize($fg-color, 0.86); border-radius: $radii; min-height: 5px; min-width: 5px; } .overview { label { color: transparentize($accent, 0.2); } &:hover label { color: $accent; } &:active label, &.active label { color: $accent-fg; } } .powermenu, .recorder { image { color: transparentize($red, 0.3); } &:hover image { color: transparentize($red, 0.15); } &:active image { color: $red; } } .focused-client > box > box, .quicksettings > box > box { @include spacing($spacing: if($bar-spacing == 0, $padding / 2, $bar-spacing)); } /* stylelint-disable-next-line selector-not-notation */ .quicksettings:not(.active):not(:active) { .bluetooth { color: $blue; } .battery { &.low { color: $red; } &.charged, &.charging { color: $green; } } } .media { &.spotify image { color: $green; } &.firefox image { color: $orange; } &.mpv image { color: $magenta; } } .notifications { image { color: $yellow; } } .battery-bar { label { margin-right: $bar-spacing * 3; } .font-icon { font-size: 1.15em; } @if $battery-bar-full { > box { padding: 0; } } image, .font-icon { margin-right: $bar-spacing * 0.5; } levelbar trough { @include widget; min-width: $battery-bar-width; min-height: $battery-bar-height; block.filled { border-radius: max($radii - $border-width, 0); background-image: $active-gradient; } } @mixin color($color) { image, label { color: $fg_color; } block.filled { background-image: linear-gradient(to right, $color, lighten($color, 6%)); } } .medium { @include color($yellow); } .low { @include color($red); } .charging { @include color($green); } &:active { @include color($accent-fg); } .whole-button { label { color: $fg-color; text-shadow: $text-shadow; } trough, block.filled { border-radius: $button-radius; } @if $bar-style == "separated" { trough { border: none; } } } } .workspaces { .horizontal { background-color: $bg-color; } > * { padding: 0; } .eventbox { transition: $transition; @if $bar-style == "separated" { border-radius: max($radii - $border-width, 0); } @else { @include button($flat: true); } } button { all: unset; background-color: $bg-color; border-radius: $radii; .indicator { font-size: 0; min-width: $font_size * 0.9; min-height: $font_size * 0.9; border-radius: $font_size; box-shadow: inset 0 0 0 $border-width $border-color; margin: 0 $padding/2; transition: $transition/2; background-color: transparentize($fg-color, 0.8); } &:last-child .indicator { margin-right: $padding; } &:first-child .indicator { margin-left: $padding; } &.occupied .indicator { background-color: transparentize($fg-color, 0.2); } &:hover .indicator { box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8); } &.active .indicator, &:active .indicator { background-color: $accent; } &.active .indicator { min-width: $font_size * 2.5; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/dashboard.scss ================================================ @mixin calendar { @include widget; padding: $padding*2 $padding*2 0; calendar{ all: unset; &.button{ @include button($flat: true); } &:selected{ box-shadow: inset 0 -8px 0 0 transparentize($accent, 0.5), inset 0 0 0 1px $accent; border-radius: $radii*0.6; } &.header{ background-color: transparent; border: none; color: transparentize($fg-color, 0.5); } &.highlight{ background-color: transparent; color: transparentize($accent, 0.5); } &:indeterminate { color: transparentize($fg-color, 0.9); } font-size: 1.1em; padding: .2em; } } window#dashboard .window-content { @include floating-widget; .notifications { min-width: $notifications-width; .header { margin-bottom: $spacing; margin-right: $spacing; > label { margin-left: $radii / 2; } button { @include button; padding: $padding/2 $padding; } } .notification-scrollable { @include scrollable; } .notification-list { margin-right: $spacing; } .notification { @include notification; > box { @include widget; padding: $padding; margin-bottom: $spacing; } } .placeholder { image { font-size: 7em; } label { font-size: 1.2em; } } } separator { background-color: $popover-border-color; min-width: 2px; border-radius: $radii; margin-right: $spacing; } .datemenu, .system-info { @include spacing; } .clock-box { padding: $padding; .clock { font-size: 5em; } .uptime { color: transparentize($fg-color, 0.2); } } .calendar { @include calendar; } .circular-progress-box { @include widget; padding: $padding; .circular-progress { min-height: $sys-info-size; min-width: $sys-info-size; margin: $padding/2; font-size: $padding; background-color: $bg-color; color: $accent; image { font-size: 1.8em; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/desktop.scss ================================================ window.corner .corner { background-color: $bg-color; border-radius: $radii * 2; min-width: 2px; min-height: 2px; } window.desktop { @if $bar-style == 'normal' { border-radius: if($screen-corners, $radii * 2, 0); box-shadow: inset 0 0 $wm-gaps / 2 0 $shadow; } .clock-box-shadow { border: 5px solid $wallpaper-fg; border-radius: $radii; .clock-box { border-radius: max($radii - 5px, 0); padding: 0 14px; .clock { color: $wallpaper-fg; font-size: 140px; font-family: $mono-font; } .separator-box { padding: 24px 12px; separator { border-radius: $radii; min-width: 16px; min-height: 16px; background-color: $wallpaper-fg; } } } } .date { color: $wallpaper-fg; font-size: 48px; } @if $drop-shadow { .clock-box-shadow, separator { box-shadow: 2px 2px 2px 0 $shadow; } .clock-box { box-shadow: inset 2px 2px 2px 0 $shadow; } label { text-shadow: $text-shadow; } } @else { .clock-box-shadow{ box-shadow: 0 0 0 $border-width $border-color, inset 0 0 0 $border-width $border-color; } separator { border: $border; } label { @include text-border; } } } .desktop-menu { image { margin-left: -14px; margin-right: 6px; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/dock.scss ================================================ @mixin dock($spacing: $spacing * 0.7) { separator { border-radius: $radii; background-color: transparentize($fg-color, 0.8); margin: 0 $spacing; min-width: 2px; min-height: 2em; } button { @include accs-button($flat: true); .box { margin: $spacing / 2; } image { margin: $padding; margin-bottom: $padding * 1.5; @if $color-scheme == 'light' { -gtk-icon-shadow: $text-shadow; } } .indicator { min-width: 6px; min-height: 6px; background-color: $fg-color; border-radius: $radii; margin-bottom: $padding/4; &.focused { background-image: $active-gradient; } } } } window.floating-dock .dock { @include dock; @include floating-widget; border-radius: if($radii == 0, 0, $radii + $spacing / 2); padding: $spacing / 2; } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/lockscreen.scss ================================================ window.lockscreen { background-color: rgba(0, 0, 0, 0.25); .avatar { @include widget; border-radius: $radii * 2; min-height: 200px; min-width: 200px; } .content { @include floating-widget; padding: $spacing * 4; } spinner { margin-top: $spacing * 2; } entry { @include button; margin-top: $spacing * 2; padding: $spacing; min-height: 20px; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/media.scss ================================================ @mixin player-color($color) { button { .shuffle.enabled { color: $color; } .loop { &.playlist, &.track { color: $color; } } &:active label { color: $color; } } .position-slider:hover trough { background-color: transparentize($color, 0.5); } .player-icon { color: $color; } } @mixin media() { @include widget; label { color: $shader-fg; text-shadow: $text-shadow; } .blurred-cover, .cover { background-size: cover; background-position: center; border-radius: $radii*0.8; opacity: 0.8; } .cover { min-height: 100px; min-width: 100px; box-shadow: 2px 2px 2px 0 $shadow; margin: $padding; opacity: 0.9; } .labels { margin-top: $padding; label { font-size: 1.1em; text-shadow: $text-shadow; &.title { font-weight: bold; } } } .position-slider { @include slider($width: .4em, $slider: false, $gradient: linear-gradient($shader-fg, $shader-fg), $radii: 0); margin-bottom: $padding/2; trough { border: none; background-color: transparentize($shader-fg, 0.7); } } .footer-box { margin: -$padding/2 $padding $padding/2; image { -gtk-icon-shadow: $text-shadow; } } .controls button { @include unset; label { font-size: 2em; color: transparentize($shader-fg, 0.2); transition: $transition; &.shuffle, &.loop { font-size: 1.4em; } } &:hover label { color: transparentize($shader-fg, 0.1); } &:active label { color: $shader-fg; } } &.spotify { @include player-color($green); } &.firefox { @include player-color($orange); } &.mpv { @include player-color($magenta); } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/notifications.scss ================================================ @mixin notification() { &.critical > box { box-shadow: inset 0 0 .5em 0 $red; } &:hover button.close-button{ @include button-hover; background-color: transparentize($red, .5); } .content { .title { margin-right: $spacing; color: $fg-color; font-size: 1.1em; } .time { color: transparentize($fg-color, .2); } .description { font-size: .9em; color: transparentize($fg-color, .2); } .icon { border-radius: $radii*0.8; margin-right: $spacing; &.img { border: $border; } } } box.actions { @include spacing(0.5); margin-top: $spacing; button { @include button; border-radius: $radii*0.8; font-size: 1.2em; padding: $padding * 0.7; } } button.close-button { @include button($flat: true); margin-left: $spacing / 2; border-radius: $radii*0.8; min-width: 1.2em; min-height: 1.2em; &:hover { background-color: transparentize($red, .2); } &:active { background-image: linear-gradient($red, $red); } } } window.notifications { @include unset; .notification { @include notification; > box { @include floating-widget; border-radius: $radii; } .description { min-width: 350px; } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/osd.scss ================================================ window.indicator .progress { @include floating-widget; padding: $padding / 2; border-radius: if($radii == 0, 0, $radii + $padding / 2); .fill { border-radius: $radii; background-color: $accent; color: $accent-fg; image { -gtk-icon-transform: scale(0.7); } .font-icon { font-size: 34px; } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/overview.scss ================================================ window#overview .window-content { @include floating-widget; @include spacing; .workspace { &.active > widget { border-color: $accent } > widget { @include widget; border-radius: if($radii == 0, 0, $radii + $padding); &:drop(active) { border-color: $accent; } } } .client { @include button; border-radius: $radii; margin: $padding; &.hidden { @include hidden; transition: 0; } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/powermenu.scss ================================================ window#powermenu, window#verification { .shader { background-color: rgba(0, 0, 0, 0.05); } } window#verification .window-content { @include floating-widget; min-width: 300px; min-height: 100px; .text-box { .title { font-size: 1.6em; } .desc { color: transparentize($fg-color, 0.1); font-size: 1.1em; } } .buttons { @include spacing; margin-top: $padding; button { @include button; font-size: 1.5em; padding: $padding; } } } window#powermenu .window-content { @include floating-widget; @include spacing(2); padding: $popover-padding + $spacing * 1.5; border-radius: if($radii == 0, 0, $popover-radius + ($popover-padding + $spacing * 1.5)); button { @include unset; image { @include button; border-radius: $popover-radius; min-width: 1.7em; min-height: 1.7em; font-size: 4em; } label, image { color: transparentize($fg-color, 0.1); } &:hover { image{ @include button-hover; } label{ color: $fg-color; } } &:focus image { @include button-focus; } &:active image { @include button-active; } &:focus, &:active { label{ color: $accent; } } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/quicksettings.scss ================================================ window#quicksettings .window-content { @include floating-widget; @include spacing; .avatar { @include widget; opacity: 0.9; border-radius: $popover-radius; } .header { @include spacing($rec: true); button, .uptime, .battery { @include button; padding: $padding; font-weight: bold; min-height: 20px; min-width: 20px; border-radius: $popover-radius; image { font-size: 1.2em; } } .battery { @include spacing($multiplier: 0.5); } } .battery-progress { label { color: $accent-fg; font-weight: bold; } &.charging label { font-size: $padding*2; } &.half label { color: $fg-color; } progressbar { @include slider($width: $padding*3.6); } &.low progressbar { @include slider($width: $padding*3.6, $gradient: linear-gradient(to right, $red, $red)); } } .sliders-box { @include widget; @include spacing($rec: true); @include spacing(0); padding: $padding; border-radius: $popover-radius; button { @include button($flat: true); padding: $padding / 2; } scale { @include slider; margin-left: $spacing * -0.5; } .menu { margin: $spacing 0; background-color: $bg-color; border: $border-width solid $popover-border-color; border-radius: $radii; } } .mixer-item { scale { @include slider($width: 7px); } image { font-size: 1.2em; } } .row { @include spacing($rec: true); border-radius: $popover-radius; } .menu { @include unset; @include widget; @include spacing($rec: true); padding: $padding; margin-top: $spacing; border-radius: $popover-radius; .title { @include spacing(.5); } separator { margin: 0 $radii / 2; } button { @include button($flat: true); padding: $padding / 2; } switch { @include switch; } } .toggle-button { @include button; font-weight: bold; border-radius: $popover-radius; .label-box { @include spacing(.5); } button { @include button($flat: true); padding: $padding; border-radius: $popover-radius; &:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } &:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } } &.active { background-color: $accent; label, image { color: $accent-fg; } } } .simple-toggle { @include button; padding: $padding $padding * 1.1; border-radius: $popover-radius; } .media { @include spacing; .player { @include media; } } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/scss/widgets/settings.scss ================================================ window#settings-dialog { background-color: $bg-color; .page { @include scrollable; } .page-content { margin: $spacing; } .sidebar-box { @include spacing($rec: true); background-color: $widget-bg; border-right: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding * 2; } scrolledwindow { @include scrollable; } } .sidebar-header { background-color: $widget-bg; border-right: $border; border-bottom: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding; } button:last-child { margin-left: $spacing / 2; } } .sidebar-footer { background-color: $widget-bg; border-right: $border; border-top: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding; } } entry.search { @include button; border-radius: 0; padding: $padding; } .row { @include widget; border-radius: 0; border-bottom-width: 0; padding: $padding; transition: border-radius 0; &:last-child { border-radius: 0 0 $radii $radii; border-bottom-width: $border-width; } &:first-child { border-radius: $radii $radii 0 0; } &:first-child:last-child { border-radius: $radii; } .overlay-padding { min-height: $font-size * 3; } &:hover { background-color: $hover; } entry, button { @include button; padding: $padding; } switch { @include switch; } spinbutton { @include unset; entry { border-radius: $radii 0 0 $radii; } button { border-radius: 0; } button:last-child { border-radius: 0 $radii $radii 0; } } .enum-setter { label { background-color: $widget-bg; border-top: $border; border-bottom: $border; padding: 0 $padding; } button:first-child { border-radius: $radii 0 0 $radii; } button:last-child { border-radius: 0 $radii $radii 0; } } } .id, .note { font-size: .8em; color: transparentize($fg-color, $amount: 0.5); } .id { font-family: $mono-font; } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/ags/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2022", "module": "ES2022", "lib": [ "ES2022" ], "allowJs": true, "checkJs": true, "strict": true, "noImplicitAny": false, "baseUrl": ".", "typeRoots": [ "./types/ags.d.ts", "./node_modules/@girs" ], "skipLibCheck": true, "forceConsistentCasingInFileNames": true } } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/Autostart.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# # See https://wiki.hyprland.org/Configuring/Keywords/ for more exec = ~/.config/hypr/scripts/launch_ags.sh exec-once = dbus-update-activation-environment --all exec-once = sway-audio-idle-inhibit exec-once = swayidle -w timeout 300 '~/.config/hypr/scripts/brightness off' resume '~/.config/hypr/scripts/brightness on' exec-once = swayidle -w timeout 600 'gtklock -d' exec-once = swayidle -w timeout 900 'systemctl suspend' exec-once = nextcloud --background #exec-once = celeste --background exec = /nix/store/$(ls -la /nix/store | grep 'mate-polkit' | grep '4096' | awk '{print $9}' | sed -n '$p')/libexec/polkit-mate-authentication-agent-1 & exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = nm-applet exec-once = wl-paste -p --watch clipman store -P --histpath="~/.local/share/clipman-primary.json" exec-once = wl-clip-persist --clipboard regular --read-timeout 50 --write-timeout 1000 exec-once = hyprctl setcursor Bibata-Modern-Classic 24 #exec-once = ~/.dots/hypr/lid_open.sh exec-once = /usr/bin/hyprland-monitor-attached ~/.dots/hypr/scripts/monitor_attached.sh ~/.dots/hypr/scripts/monitor_dettached.sh #exec-once = ~/.dots/hypr/check_lid.sh #exec-once = [workspace 10 silent] firefox #exec-once = [workspace 10 silent] code #exec-once = [workspace 10 silent] obsidian #exec-once = [workspace 10 silent] nautilus #exec-once = [workspace 10 silent] spotify #exec-once = [workspace 10 silent] discord #exec-once = [workspace 10 silent] wezterm ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/Decoration.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# # See https://wiki.hyprland.org/Configuring/Variables/ for more general { gaps_in = 2 gaps_out = 2 border_size = 0 col.active_border = rgba(476C43ff) col.inactive_border = rgba(EBDBB2ff) layout = dwindle resize_on_border = true extend_border_grab_area = 10 allow_tearing = true } # See https://wiki.hyprland.org/Configuring/Variables/ for more decoration { # rounding rounding = 5 dim_inactive = true dim_strength = 0.4 blur { # blur enabled = true size = 8 passes = 2 noise = 0 contrast = 1 new_optimizations = true } # shadow drop_shadow = false shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) } animations { enabled = true bezier = fluent_decel , 0 , 0.2 , 0.4 , 1 bezier = easeOutCirc , 0 , 0.55 , 0.45 , 1 bezier = easeOutCubic , 0.33 , 1 , 0.68 , 1 bezier = easeinoutsine , 0.37 , 0 , 0.63 , 1 # Windows animation = windowsIn , 1 , 3 , easeOutCubic , popin 30% # window open animation = windowsOut , 1 , 3 , fluent_decel , popin 70% # window close. animation = windowsMove , 1 , 2 , easeinoutsine , slide # everything in between, moving, dragging, resizing. # Fade animation = fadeIn , 1 , 3 , easeOutCubic # fade in (open) -> layers and windows animation = fadeOut , 1 , 1.7 , easeOutCubic # fade out (close) -> layers and windows animation = fadeSwitch , 0 , 1 , easeOutCirc # fade on changing activewindow and its opacity animation = fadeShadow , 1 , 10 , easeOutCirc # fade on changing activewindow for shadows animation = fadeDim , 1 , 4 , fluent_decel # the easing of the dimming of inactive windows animation = border , 1 , 2.7 , easeOutCirc # for animating the border's color switch speed animation = borderangle , 1 , 30 , fluent_decel , once # for animating the border's gradient angle - styles: once (default), loop animation = workspaces , 1 , 2 , easeOutCubic } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = false # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # you probably want this force_split = 2 smart_split = false smart_resizing = true } ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/KeyBinds.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # KeyBinds # Apps bind = $mainMod , return , exec , kitty bind = $mainMod SHIFT , return , exec , kitty --title kitty_float bind = $mainMod , F , exec , nautilus bind = $mainMod , B , exec , brave bind = $mainMod , C , exec , code bind = CONTROL SHIFT , Escape , exec , missioncenter bind = , XF86Keyboard , exec , gnome-calculator bind = $mainMod , D , exec , discord bind = $mainMod , O , exec , obsidian #AGS bind = $mainMod , SPACE , exec , ags toggle-window applauncher bind = $mainMod SHIFT , S , exec , ags -r "recorder.start()" bind = $mainMod CONTROL , P , exec , ags toggle-window powermenu bind = $mainMod , R , exec , ~/.config/hypr/scripts/launch_ags.sh # System bind = $mainMod , L , exec , gtklock bind = , Home , exec , grimblast --notify copysave area ~/Bilder/$(date +'Screenshot_%d-%m-%y_%H-%M.png') bind = , XF86Launch2 , exec , grimblast --notify copysave output ~/Bilder/$(date +'Screenshot_%d-%m-%y_%H-%M.png') #NixOS bind = $mainMod Alt_L , R , exec , hyprctl reload # Virtual Machine bind = ISO_Level3_Shift , Alt_L, submap, passthrough submap = passthrough bind = ISO_Level3_Shift , Alt_L, submap, reset submap = reset #Window management bind = $mainMod , Q , killactive , bind = $mainMod , T , togglefloating , bind = $mainMod , P , pseudo , # dwindle bind = $mainMod , J , togglesplit , # dwindle bind = ALT , Tab , cyclenext , bind = $mainMod , Tab , bringactivetotop , # Move focus with mainMod + arrow keys bind = $mainMod , left , movefocus, l bind = $mainMod , right , movefocus, r bind = $mainMod , up , movefocus, u bind = $mainMod , down , movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod , 1 , workspace , 1 bind = $mainMod , 2 , workspace , 2 bind = $mainMod , 3 , workspace , 3 bind = $mainMod , 4 , workspace , 4 bind = $mainMod , 5 , workspace , 5 bind = $mainMod , 6 , workspace , 6 bind = $mainMod , 7 , workspace , 7 bind = $mainMod , 8 , workspace , 8 bind = $mainMod , 9 , workspace , 9 bind = $mainMod , 0 , workspace , 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT , 1 , movetoworkspace , 1 bind = $mainMod SHIFT , 2 , movetoworkspace , 2 bind = $mainMod SHIFT , 3 , movetoworkspace , 3 bind = $mainMod SHIFT , 4 , movetoworkspace , 4 bind = $mainMod SHIFT , 5 , movetoworkspace , 5 bind = $mainMod SHIFT , 6 , movetoworkspace , 6 bind = $mainMod SHIFT , 7 , movetoworkspace , 7 bind = $mainMod SHIFT , 8 , movetoworkspace , 8 bind = $mainMod SHIFT , 9 , movetoworkspace , 9 bind = $mainMod SHIFT , 0 , movetoworkspace , 10 # Move active window in workspace bind = $mainMod ALT , left , movewindow, l bind = $mainMod ALT , right , movewindow, r bind = $mainMod ALT , up , movewindow, u bind = $mainMod ALT , down , movewindow, d # Mediacontrol with mediakeys bind = , XF86AudioPrev , exec , playerctl previous bind = , XF86AudioPlay , exec , playerctl play-pause bind = , XF86AudioNext , exec , playerctl next # Audiocontrol with ags bind = , XF86AudioRaiseVolume , exec , ags run-js "audio.speaker.volume += 0.05; indicator.speaker()" bind = , XF86AudioLowerVolume , exec , ags run-js "audio.speaker.volume -= 0.05; indicator.speaker()" bind = , XF86AudioMute , exec , pamixer -t && ags run-js "ags.Service.Indicator.speaker()" # Resize windows with mainMod CTRL + arrowkeys bind = $mainMod CONTROL , Right , resizeactive , 30 0 bind = $mainMod CONTROL , Left , resizeactive , -30 0 bind = $mainMod CONTROL , Up , resizeactive , 0 -30 bind = $mainMod CONTROL , Down , resizeactive , 0 30 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod , mouse:272 , movewindow bindm = $mainMod , mouse:273 , resizewindow ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/Misc.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = de kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 natural_scroll = false touchpad { natural_scroll = true scroll_factor = 0.2 tap-to-click = false tap_button_map = l clickfinger_behavior = true } } gestures { workspace_swipe = true workspace_swipe_fingers = 3 workspace_swipe_distance = 1500 workspace_swipe_min_speed_to_force = 10 workspace_swipe_use_r = true } # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device:mx-master-2s-mouse { sensitivity = 0.3 } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_is_master = true } # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more misc { vfr = true vrr = 0 animate_manual_resizes = false focus_on_activate = false render_ahead_of_time = false disable_hyprland_logo = true focus_on_activate = true key_press_enables_dpms = true } debug { overlay = false } # Variables env = XCURSOR_THEME, Bibata-Modern-Classic env = XCURSOR_SIZE, 24 env = WLR_DRM_NO_ATOMIC,1 env = export TERM=kitty ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/WindowRules.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# windowrulev2 = float , class:(BLHeliSuite32xl) windowrulev2 = size 70% 70% , class:(BLHeliSuite32xl) windowrulev2 = center , class:(BLHeliSuite32xl) windowrulev2 = float , class:(betaflight-configurator) windowrulev2 = size 70% 80% , class:(betaflight-configurator) windowrulev2 = center , class:(betaflight-configurator) windowrulev2 = float , class:(pavucontrol) windowrulev2 = float , class:(solaar) windowrulev2 = float , class:(missioncenter) windowrulev2 = size 70% 70% , class:(missioncenter) windowrulev2 = center , class:(missioncenter) windowrulev2 = float , class:(ags) windowrulev2 = size 70% 70% , class:(ags) windowrulev2 = center , class:(ags) windowrulev2 = float , class:(thunar) windowrulev2 = size 70% 70% , class:(thunar) windowrulev2 = center , class:(thunar) windowrulev2 = float , title:(kitty_float) windowrulev2 = size 70% 70% , title:(kitty_float) windowrulev2 = center , title:(kitty_float) windowrulev2 = float , class:(org.gnome.Nautilus) windowrulev2 = size 70% 70% , class:(org.gnome.Nautilus) windowrulev2 = center , class:(org.gnome.Nautilus) windowrulev2 = float , title:(Raspberry Pi Imager) windowrulev2 = size 70% 70% , title:(Raspberry Pi Imager) windowrulev2 = center , title:(Raspberry Pi Imager) windowrulev2 = float , title:(Open Folder) windowrulev2 = float , title:(Open File) windowrulev2 = size 70% 70% , title:(Open Folder) windowrulev2 = size 70% 70% , title:(Open File) windowrulev2 = center , class:(Open Folder) windowrulev2 = center , class:(Open File) windowrulev2 = float , class:(com.nextcloud.desktopclient.nextcloud) windowrulev2 = size 30% 50% , class:(com.nextcloud.desktopclient.nextcloud) windowrulev2 = center , class:(com.nextcloud.desktopclient.nextcloud) windowrulev2 = float , class:(gthumb) windowrulev2 = size 70% 80% , class:(gthumb) windowrulev2 = center , class:(gthumb) windowrulev2 = float , class:(obsidian) windowrulev2 = size 70% 80% , class:(obsidian) windowrulev2 = center , class:(obsidian) windowrulev2 = float , class:(Bitwarden) windowrulev2 = size 70% 80% , class:(Bitwarden) windowrulev2 = center , class:(Bitwarden) windowrulev2 = float , class:(Anydesk) windowrulev2 = size 70% 80% , class:(Anydesk) windowrulev2 = center , class:(Anydesk) windowrulev2 = float , class:(com.hunterwittenborn.Celeste) windowrulev2 = size 60% 70% , class:(com.hunterwittenborn.Celeste) windowrulev2 = center , class:(com.hunterwittenborn.Celeste) windowrulev2 = float , class:(celeste) windowrulev2 = size 50% 60% , class:(celeste) windowrulev2 = center , class:(celeste) windowrulev2 = float , class:(io.github.kaii_lb.Overskride) windowrulev2 = size 50% 60% , class:(io.github.kaii_lb.Overskride) windowrulev2 = center , class:(io.github.kaii_lb.Overskride) windowrulev2 = float , class:(org.gnome.Calculator) ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/hyprland.conf ================================================ ######################################################################################## # _ _ _ _ ____ __ _ # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # |___/|_| |___/ # ######################################################################################### # Source files source = ~/.config/hypr/monitors.conf source = ~/.config/hypr/Autostart.conf source = ~/.config/hypr/Misc.conf source = ~/.config/hypr/KeyBinds.conf source = ~/.config/hypr/Decoration.conf source = ~/.config/hypr/WindowRules.conf ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/monitors.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = DP-1 , 2560x1440@120.0 , 0x0 , 1.0 #monitor = HDMI-A-2 , 1920x1080@120.0 , 0x-1080 , 1.0 ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/presets/monitors.exampleconf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = DP-1 , 2560x1440@120.0 , 0x0 , 1.0 #monitor = HDMI-A-2 , 1920x1080@120.0 , 0x-1080 , 1.0 ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/presets/monitors_external.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = eDP-1 , 1920x1080@60.0 , 0x0 , 1.0 monitor = HDMI-A-2 , 1920x1080@120.0 , 0x-1080 , 1.0 workspace = HDMI-A-2 , 0 , persistent:true workspace = HDMI-A-2 , 1 , persistent:true workspace = HDMI-A-2 , 2 , persistent:true workspace = HDMI-A-2 , 3 , persistent:true workspace = HDMI-A-2 , 4 , persistent:true workspace = HDMI-A-2 , 5 , persistent:true workspace = HDMI-A-2 , 6 , persistent:true workspace = HDMI-A-2 , 7 , persistent:true workspace = HDMI-A-2 , 8 , persistent:true workspace = HDMI-A-2 , 9 , persistent:true workspace = eDP-1 , 10 , persistent:true workspace = eDP-1 , 11 , persistent:true workspace = eDP-1 , 12 , persistent:true workspace = eDP-1 , 13 , persistent:true workspace = eDP-1 , 14 , persistent:true workspace = eDP-1 , 15 , persistent:true workspace = eDP-1 , 16 , persistent:true workspace = eDP-1 , 17 , persistent:true workspace = eDP-1 , 18 , persistent:true workspace = eDP-1 , 19 , persistent:true # Switch workspaces with mainMod + [0-9] bind = $mainMod CTRL , 1 , workspace , 11 bind = $mainMod CTRL , 2 , workspace , 12 bind = $mainMod CTRL , 3 , workspace , 13 bind = $mainMod CTRL , 4 , workspace , 14 bind = $mainMod CTRL , 5 , workspace , 15 bind = $mainMod CTRL , 6 , workspace , 16 bind = $mainMod CTRL , 7 , workspace , 17 bind = $mainMod CTRL , 8 , workspace , 18 bind = $mainMod CTRL , 9 , workspace , 19 bind = $mainMod CTRL , 0 , workspace , 20 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod CTRL SHIFT , 1 , movetoworkspace , 11 bind = $mainMod CTRL SHIFT , 2 , movetoworkspace , 12 bind = $mainMod CTRL SHIFT , 3 , movetoworkspace , 13 bind = $mainMod CTRL SHIFT , 4 , movetoworkspace , 14 bind = $mainMod CTRL SHIFT , 5 , movetoworkspace , 15 bind = $mainMod CTRL SHIFT , 6 , movetoworkspace , 16 bind = $mainMod CTRL SHIFT , 7 , movetoworkspace , 17 bind = $mainMod CTRL SHIFT , 8 , movetoworkspace , 18 bind = $mainMod CTRL SHIFT , 9 , movetoworkspace , 19 bind = $mainMod CTRL SHIFT , 0 , movetoworkspace , 20 exec = hyprctl dispatch focusmonitor 1 bindl = , switch:Lid Switch , exec , ~/.dots/ags/launch.sh #monitor = eDP-1, disable ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/presets/monitors_internal.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = eDP-1 , 1920x1080@60.0 , 0x0 , 1.0 workspace = eDP-1 , 0 , persistent:true workspace = eDP-1 , 1 , persistent:true workspace = eDP-1 , 2 , persistent:true workspace = eDP-1 , 3 , persistent:true workspace = eDP-1 , 4 , persistent:true workspace = eDP-1 , 5 , persistent:true workspace = eDP-1 , 6 , persistent:true workspace = eDP-1 , 7 , persistent:true workspace = eDP-1 , 8 , persistent:true workspace = eDP-1 , 9 , persistent:true # lock screen if lid is closed bindl = , switch:Lid Switch , exec , gtklock ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/scripts/brightness ================================================ #!/bin/sh previous_brightness=$(brightnessctl g) case $1 in off) brightnessctl -s -q previous_brightness=$(brightnessctl g) current_brightness=$previous_brightness while [ "$current_brightness" -gt 1 ]; do current_brightness=$((current_brightness - 1200)) brightnessctl s -q $current_brightness sleep 0.01 done ;; on) brightnessctl -r -q ;; esac ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/scripts/launch_ags.sh ================================================ #!/usr/bin/env zsh pkill ags # Launch ags echo "---" | tee -a /tmp/ags.log ags 2>&1 | tee -a /tmp/ags.log & disown echo "shell launched..." ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/scripts/monitor_attached.sh ================================================ #!/bin/sh #hyprctl monitors | grep HDMI-A-2 || exit rm ~/.dots/hypr/monitors.conf cp ~/.dots/hypr/presets/monitors_external.conf ~/.dots/hypr/monitors.conf hyprctl dispatch moveworkspacetomonitor 1 1 hyprctl dispatch moveworkspacetomonitor 2 1 hyprctl dispatch moveworkspacetomonitor 3 1 hyprctl dispatch moveworkspacetomonitor 4 1 hyprctl dispatch moveworkspacetomonitor 5 1 hyprctl dispatch moveworkspacetomonitor 6 1 hyprctl dispatch moveworkspacetomonitor 7 1 hyprctl dispatch moveworkspacetomonitor 8 1 hyprctl dispatch moveworkspacetomonitor 9 1 hyprctl dispatch moveworkspacetomonitor 10 1 hyprctl dispatch moveworkspacetomonitor 11 0 hyprctl dispatch moveworkspacetomonitor 12 0 hyprctl dispatch moveworkspacetomonitor 13 0 hyprctl dispatch moveworkspacetomonitor 14 0 hyprctl dispatch moveworkspacetomonitor 15 0 hyprctl dispatch moveworkspacetomonitor 16 0 hyprctl dispatch moveworkspacetomonitor 17 0 hyprctl dispatch moveworkspacetomonitor 18 0 hyprctl dispatch moveworkspacetomonitor 19 0 hyprctl dispatch moveworkspacetomonitor 20 0 hyprctl dispatch workspace 1 ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/hypr/scripts/monitor_dettached.sh ================================================ #!/bin/sh rm ~/.dots/hypr/monitors.conf cp ~/.dots/hypr/presets/monitors_internal.conf ~/.dots/hypr/monitors.conf hyprctl dispatch moveworkspacetomonitor 1 0 hyprctl dispatch moveworkspacetomonitor 2 0 hyprctl dispatch moveworkspacetomonitor 3 0 hyprctl dispatch moveworkspacetomonitor 4 0 hyprctl dispatch moveworkspacetomonitor 5 0 hyprctl dispatch moveworkspacetomonitor 6 0 hyprctl dispatch moveworkspacetomonitor 7 0 hyprctl dispatch moveworkspacetomonitor 8 0 hyprctl dispatch moveworkspacetomonitor 9 0 hyprctl dispatch moveworkspacetomonitor 10 0 hyprctl dispatch workspace 1 ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/kitty/kitty.conf ================================================ # vim:fileencoding=utf-8:foldmethod=marker #: Fonts {{{ #: kitty has very powerful font management. You can configure #: individual font faces and even specify special fonts for particular #: characters. font_family Hurmit Nerd Font # bold_font auto # italic_font auto # bold_italic_font auto #: You can specify different fonts for the bold/italic/bold-italic #: variants. To get a full list of supported fonts use the `kitty #: +list-fonts` command. By default they are derived automatically, by #: the OSes font system. When bold_font or bold_italic_font is set to #: auto on macOS, the priority of bold fonts is semi-bold, bold, #: heavy. Setting them manually is useful for font families that have #: many weight variants like Book, Medium, Thick, etc. For example:: #: font_family Operator Mono Book #: bold_font Operator Mono Medium #: italic_font Operator Mono Book Italic #: bold_italic_font Operator Mono Medium Italic font_size 16.0 #: Font size (in pts) # force_ltr no #: kitty does not support BIDI (bidirectional text), however, for RTL #: scripts, words are automatically displayed in RTL. That is to say, #: in an RTL script, the words "HELLO WORLD" display in kitty as #: "WORLD HELLO", and if you try to select a substring of an RTL- #: shaped string, you will get the character that would be there had #: the the string been LTR. For example, assuming the Hebrew word #: ירושלים, selecting the character that on the screen appears to be ם #: actually writes into the selection buffer the character י. kitty's #: default behaviorbehavior is useful in conjunction with a filter to reverse #: the word order, however, if you wish to manipulate RTL glyphs, it #: can be very challenging to work with, so this option is provided to #: turn it off. Furthermore, this option can be used with the command #: line program GNU FriBidi #: to get BIDI #: support, because it will force kitty to always treat the text as #: LTR, which FriBidi expects for terminals. # symbol_map #: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols #: Map the specified Unicode codepoints to a particular font. Useful #: if you need special rendering for some symbols, such as for #: Powerline. Avoids the need for patched fonts. Each Unicode code #: point is specified in the form `U+`. You #: can specify multiple code points, separated by commas and ranges #: separated by hyphens. This option can be specified multiple times. #: The syntax is:: #: symbol_map codepoints Font Family Name # narrow_symbols #: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 #: Usually, for Private Use Unicode characters and some symbol/dingbat #: characters, if the character is followed by one or more spaces, #: kitty will use those extra cells to render the character larger, if #: the character in the font has a wide aspect ratio. Using this #: option you can force kitty to restrict the specified code points to #: render in the specified number of cells (defaulting to one cell). #: This option can be specified multiple times. The syntax is:: #: narrow_symbols codepoints [optionally the number of cells] # disable_ligatures never #: Choose how you want to handle multi-character ligatures. The #: default is to always render them. You can tell kitty to not render #: them when the cursor is over them by using cursor to make editing #: easier, or have kitty never render them at all by using always, if #: you don't like them. The ligature strategy can be set per-window #: either using the kitty remote control facility or by defining #: shortcuts for it in kitty.conf, for example:: #: map alt+1 disable_ligatures_in active always #: map alt+2 disable_ligatures_in all never #: map alt+3 disable_ligatures_in tab cursor #: Note that this refers to programming ligatures, typically #: implemented using the calt OpenType feature. For disabling general #: ligatures, use the font_features option. # font_features #: E.g. font_features none #: Choose exactly which OpenType features to enable or disable. This #: is useful as some fonts might have features worthwhile in a #: terminal. For example, Fira Code includes a discretionary feature, #: zero, which in that font changes the appearance of the zero (0), to #: make it more easily distinguishable from Ø. Fira Code also includes #: other discretionary features known as Stylistic Sets which have the #: tags ss01 through ss20. #: For the exact syntax to use for individual features, see the #: HarfBuzz documentation . #: Note that this code is indexed by PostScript name, and not the font #: family. This allows you to define very precise feature settings; #: e.g. you can disable a feature in the italic font but not in the #: regular font. #: On Linux, font features are first read from the FontConfig database #: and then this option is applied, so they can be configured in a #: single, central place. #: To get the PostScript name for a font, use `kitty +list-fonts #: --psnames`: #: .. code-block:: sh #: $ kitty +list-fonts --psnames | grep Fira #: Fira Code #: Fira Code Bold (FiraCode-Bold) #: Fira Code Light (FiraCode-Light) #: Fira Code Medium (FiraCode-Medium) #: Fira Code Regular (FiraCode-Regular) #: Fira Code Retina (FiraCode-Retina) #: The part in brackets is the PostScript name. #: Enable alternate zero and oldstyle numerals:: #: font_features FiraCode-Retina +zero +onum #: Enable only alternate zero in the bold font:: #: font_features FiraCode-Bold +zero #: Disable the normal ligatures, but keep the calt feature which (in #: this font) breaks up monotony:: #: font_features TT2020StyleB-Regular -liga +calt #: In conjunction with force_ltr, you may want to disable Arabic #: shaping entirely, and only look at their isolated forms if they #: show up in a document. You can do this with e.g.:: #: font_features UnifontMedium +isol -medi -fina -init # modify_font #: Modify font characteristics such as the position or thickness of #: the underline and strikethrough. The modifications can have the #: suffix px for pixels or % for percentage of original value. No #: suffix means use pts. For example:: #: modify_font underline_position -2 #: modify_font underline_thickness 150% #: modify_font strikethrough_position 2px #: Additionally, you can modify the size of the cell in which each #: font glyph is rendered and the baseline at which the glyph is #: placed in the cell. For example:: #: modify_font cell_width 80% #: modify_font cell_height -2px #: modify_font baseline 3 #: Note that modifying the baseline will automatically adjust the #: underline and strikethrough positions by the same amount. #: Increasing the baseline raises glyphs inside the cell and #: decreasing it lowers them. Decreasing the cell size might cause #: rendering artifacts, so use with care. # box_drawing_scale 0.001, 1, 1.5, 2 #: The sizes of the lines used for the box drawing Unicode characters. #: These values are in pts. They will be scaled by the monitor DPI to #: arrive at a pixel value. There must be four values corresponding to #: thin, normal, thick, and very thick lines. # undercurl_style thin-sparse #: The style with which undercurls are rendered. This option takes the #: form (thin|thick)-(sparse|dense). Thin and thick control the #: thickness of the undercurl. Sparse and dense control how often the #: curl oscillates. With sparse the curl will peak once per character, #: with dense twice. # text_composition_strategy platform #: Control how kitty composites text glyphs onto the background color. #: The default value of platform tries for text rendering as close to #: "native" for the platform kitty is running on as possible. #: A value of legacy uses the old (pre kitty 0.28) strategy for how #: glyphs are composited. This will make dark text on light #: backgrounds look thicker and light text on dark backgrounds #: thinner. It might also make some text appear like the strokes are #: uneven. #: You can fine tune the actual contrast curve used for glyph #: composition by specifying two space separated numbers for this #: setting. #: The first number is the gamma adjustment, which controls the #: thickness of dark text on light backgrounds. Increasing the value #: will make text appear thicker. The default value for this is 1.0 on #: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result #: is scaled based on the luminance difference between the background #: and the foreground. Dark text on light backgrounds receives the #: full impact of the curve while light text on dark backgrounds is #: affected very little. #: The second number is an additional multiplicative contrast. It is #: percentage ranging from 0 to 100. The default value is 0 on Linux #: and 30 on macOS. #: }}} #: Cursor customization {{{ # cursor #cccccc #: Default cursor color. If set to the special value none the cursor #: will be rendered with a "reverse video" effect. It's color will be #: the color of the text in the cell it is over and the text will be #: rendered with the background color of the cell. Note that if the #: program running in the terminal sets a cursor color, this takes #: precedence. Also, the cursor colors are modified if the cell #: background and foreground colors have very low contrast. # cursor_text_color #111111 #: The color of text under the cursor. If you want it rendered with #: the background color of the cell underneath instead, use the #: special keyword: background. Note that if cursor is set to none #: then this option is ignored. # cursor_shape block #: The cursor shape can be one of block, beam, underline. Note that #: when reloading the config this will be changed only if the cursor #: shape has not been set by the program running in the terminal. This #: sets the default cursor shape, applications running in the terminal #: can override it. In particular, shell integration #: in kitty sets #: the cursor shape to beam at shell prompts. You can avoid this by #: setting shell_integration to no-cursor. # cursor_beam_thickness 1.5 #: The thickness of the beam cursor (in pts). # cursor_underline_thickness 2.0 #: The thickness of the underline cursor (in pts). # cursor_blink_interval -1 #: The interval to blink the cursor (in seconds). Set to zero to #: disable blinking. Negative values mean use system default. Note #: that the minimum interval will be limited to repaint_delay. # cursor_stop_blinking_after 15.0 #: Stop blinking cursor after the specified number of seconds of #: keyboard inactivity. Set to zero to never stop blinking. #: }}} #: Scrollback {{{ # scrollback_lines 2000 #: Number of lines of history to keep in memory for scrolling back. #: Memory is allocated on demand. Negative numbers are (effectively) #: infinite scrollback. Note that using very large scrollback is not #: recommended as it can slow down performance of the terminal and #: also use large amounts of RAM. Instead, consider using #: scrollback_pager_history_size. Note that on config reload if this #: is changed it will only affect newly created windows, not existing #: ones. # scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER #: Program with which to view scrollback in a new window. The #: scrollback buffer is passed as STDIN to this program. If you change #: it, make sure the program you use can handle ANSI escape sequences #: for colors and text formatting. INPUT_LINE_NUMBER in the command #: line above will be replaced by an integer representing which line #: should be at the top of the screen. Similarly CURSOR_LINE and #: CURSOR_COLUMN will be replaced by the current cursor position or #: set to 0 if there is no cursor, for example, when showing the last #: command output. # scrollback_pager_history_size 0 #: Separate scrollback history size (in MB), used only for browsing #: the scrollback buffer with pager. This separate buffer is not #: available for interactive scrolling but will be piped to the pager #: program when viewing scrollback buffer in a separate window. The #: current implementation stores the data in UTF-8, so approximatively #: 10000 lines per megabyte at 100 chars per line, for pure ASCII, #: unformatted text. A value of zero or less disables this feature. #: The maximum allowed size is 4GB. Note that on config reload if this #: is changed it will only affect newly created windows, not existing #: ones. # scrollback_fill_enlarged_window no #: Fill new space with lines from the scrollback buffer after #: enlarging a window. # wheel_scroll_multiplier 5.0 #: Multiplier for the number of lines scrolled by the mouse wheel. #: Note that this is only used for low precision scrolling devices, #: not for high precision scrolling devices on platforms such as macOS #: and Wayland. Use negative numbers to change scroll direction. See #: also wheel_scroll_min_lines. # wheel_scroll_min_lines 1 #: The minimum number of lines scrolled by the mouse wheel. The scroll #: multiplier wheel_scroll_multiplier only takes effect after it #: reaches this number. Note that this is only used for low precision #: scrolling devices like wheel mice that scroll by very small amounts #: when using the wheel. With a negative number, the minimum number of #: lines will always be added. # touch_scroll_multiplier 1.0 #: Multiplier for the number of lines scrolled by a touchpad. Note #: that this is only used for high precision scrolling devices on #: platforms such as macOS and Wayland. Use negative numbers to change #: scroll direction. #: }}} Mouse {{{ # mouse_hide_wait 3.0 #: Hide mouse cursor after the specified number of seconds of the #: mouse not being used. Set to zero to disable mouse cursor hiding. #: Set to a negative value to hide the mouse cursor immediately when #: typing text. Disabled by default on macOS as getting it to work #: robustly with the ever-changing sea of bugs that is Cocoa is too #: much effort. # url_color #0087bd # url_style curly #: The color and style for highlighting URLs on mouse-over. url_style #: can be one of: none, straight, double, curly, dotted, dashed. # open_url_with default #: The program to open clicked URLs. The special value default with #: first look for any URL handlers defined via the open_actions #: facility and if non #: are found, it will use the Operating System's default URL handler #: (open on macOS and xdg-open on Linux). # url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh #: The set of URL prefixes to look for when detecting a URL under the #: mouse cursor. # detect_urls yes #: Detect URLs under the mouse. Detected URLs are highlighted with an #: underline and the mouse cursor becomes a hand over them. Even if #: this option is disabled, URLs are still clickable. # url_excluded_characters #: Additional characters to be disallowed from URLs, when detecting #: URLs under the mouse cursor. By default, all characters that are #: legal in URLs are allowed. Additionally, newlines are allowed (but #: stripped). This is to accommodate programs such as mutt that add #: hard line breaks even for continued lines. \n can be added to this #: option to disable this behavior. Special characters can be #: specified using backslash escapes, to specify a backslash use a #: double backslash. show_hyperlink_targets yes #: When the mouse hovers over a terminal hyperlink, show the actual #: URL that will be activated when the hyperlink is clicked. # copy_on_select no #: Copy to clipboard or a private buffer on select. With this set to #: clipboard, selecting text with the mouse will cause the text to be #: copied to clipboard. Useful on platforms such as macOS that do not #: have the concept of primary selection. You can instead specify a #: name such as a1 to copy to a private kitty buffer. Map a shortcut #: with the paste_from_buffer action to paste from this private #: buffer. For example:: #: copy_on_select a1 #: map shift+cmd+v paste_from_buffer a1 #: Note that copying to the clipboard is a security risk, as all #: programs, including websites open in your browser can read the #: contents of the system clipboard. # paste_actions quote-urls-at-prompt #: A comma separated list of actions to take when pasting text into #: the terminal. The supported paste actions are: #: quote-urls-at-prompt: #: If the text being pasted is a URL and the cursor is at a shell prompt, #: automatically quote the URL (needs shell_integration). #: confirm: #: Confirm the paste if bracketed paste mode is not active or there is more #: a large amount of text being pasted. #: filter: #: Run the filter_paste() function from the file paste-actions.py in #: the kitty config directory on the pasted text. The text returned by the #: function will be actually pasted. # strip_trailing_spaces never #: Remove spaces at the end of lines when copying to clipboard. A #: value of smart will do it when using normal selections, but not #: rectangle selections. A value of always will always do it. # select_by_word_characters @-./_~?&=%+# #: Characters considered part of a word when double clicking. In #: addition to these characters any character that is marked as an #: alphanumeric character in the Unicode database will be matched. # select_by_word_characters_forward #: Characters considered part of a word when extending the selection #: forward on double clicking. In addition to these characters any #: character that is marked as an alphanumeric character in the #: Unicode database will be matched. #: If empty (default) select_by_word_characters will be used for both #: directions. # click_interval -1.0 #: The interval between successive clicks to detect double/triple #: clicks (in seconds). Negative numbers will use the system default #: instead, if available, or fallback to 0.5. focus_follows_mouse no #: Set the active window to the window under the mouse when moving the #: mouse around. # pointer_shape_when_grabbed arrow #: The shape of the mouse pointer when the program running in the #: terminal grabs the mouse. Valid values are: arrow, beam and hand. # default_pointer_shape beam #: The default shape of the mouse pointer. Valid values are: arrow, #: beam and hand. # pointer_shape_when_dragging beam #: The default shape of the mouse pointer when dragging across text. #: Valid values are: arrow, beam and hand. Mouse actions {{{ #: Mouse buttons can be mapped to perform arbitrary actions. The #: syntax is: #: .. code-block:: none #: mouse_map button-name event-type modes action #: Where button-name is one of left, middle, right, b1 ... b8 with #: added keyboard modifiers. For example: ctrl+shift+left refers to #: holding the Ctrl+Shift keys while clicking with the left mouse #: button. The value b1 ... b8 can be used to refer to up to eight #: buttons on a mouse. #: event-type is one of press, release, doublepress, triplepress, #: click, doubleclick. modes indicates whether the action is performed #: when the mouse is grabbed by the program running in the terminal, #: or not. The values are grabbed or ungrabbed or a comma separated #: combination of them. grabbed refers to when the program running in #: the terminal has requested mouse events. Note that the click and #: double click events have a delay of click_interval to disambiguate #: from double and triple presses. #: You can run kitty with the kitty --debug-input command line option #: to see mouse events. See the builtin actions below to get a sense #: of what is possible. #: If you want to unmap an action, map it to no_op. For example, to #: disable opening of URLs with a plain click:: #: mouse_map left click ungrabbed no_op #: See all the mappable actions including mouse actions here #: . #: .. note:: #: Once a selection is started, releasing the button that started it will #: automatically end it and no release event will be dispatched. # clear_all_mouse_actions no #: Remove all mouse action definitions up to this point. Useful, for #: instance, to remove the default mouse actions. #: Click the link under the mouse or move the cursor # mouse_map left click ungrabbed mouse_handle_click selection link prompt #:: First check for a selection and if one exists do nothing. Then #:: check for a link under the mouse cursor and if one exists, click #:: it. Finally check if the click happened at the current shell #:: prompt and if so, move the cursor to the click location. Note #:: that this requires shell integration #:: to work. #: Click the link under the mouse or move the cursor even when grabbed # mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt #:: Same as above, except that the action is performed even when the #:: mouse is grabbed by the program running in the terminal. #: Click the link under the mouse cursor # mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link #:: Variant with Ctrl+Shift is present because the simple click based #:: version has an unavoidable delay of click_interval, to #:: disambiguate clicks from double clicks. #: Discard press event for link click # mouse_map ctrl+shift+left press grabbed discard_event #:: Prevent this press event from being sent to the program that has #:: grabbed the mouse, as the corresponding release event is used to #:: open a URL. #: Paste from the primary selection # mouse_map middle release ungrabbed paste_from_selection #: Start selecting text # mouse_map left press ungrabbed mouse_selection normal #: Start selecting text in a rectangle # mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle #: Select a word # mouse_map left doublepress ungrabbed mouse_selection word #: Select a line # mouse_map left triplepress ungrabbed mouse_selection line #: Select line from point # mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point #:: Select from the clicked point to the end of the line. #: Extend the current selection # mouse_map right press ungrabbed mouse_selection extend #:: If you want only the end of the selection to be moved instead of #:: the nearest boundary, use move-end instead of extend. #: Paste from the primary selection even when grabbed # mouse_map shift+middle release ungrabbed,grabbed paste_selection # mouse_map shift+middle press grabbed discard_event #: Start selecting text even when grabbed # mouse_map shift+left press ungrabbed,grabbed mouse_selection normal #: Start selecting text in a rectangle even when grabbed # mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle #: Select a word even when grabbed # mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word #: Select a line even when grabbed # mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line #: Select line from point even when grabbed # mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point #:: Select from the clicked point to the end of the line even when #:: grabbed. #: Extend the current selection even when grabbed # mouse_map shift+right press ungrabbed,grabbed mouse_selection extend #: Show clicked command output in pager # mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output #:: Requires shell integration #:: to work. }}} }}} #: Performance tuning {{{ # repaint_delay 10 #: Delay between screen updates (in milliseconds). Decreasing it, #: increases frames-per-second (FPS) at the cost of more CPU usage. #: The default value yields ~100 FPS which is more than sufficient for #: most uses. Note that to actually achieve 100 FPS, you have to #: either set sync_to_monitor to no or use a monitor with a high #: refresh rate. Also, to minimize latency when there is pending input #: to be processed, this option is ignored. # input_delay 3 #: Delay before input from the program running in the terminal is #: processed (in milliseconds). Note that decreasing it will increase #: responsiveness, but also increase CPU usage and might cause flicker #: in full screen programs that redraw the entire screen on each loop, #: because kitty is so fast that partial screen updates will be drawn. # sync_to_monitor yes #: Sync screen updates to the refresh rate of the monitor. This #: prevents screen tearing #: when scrolling. #: However, it limits the rendering speed to the refresh rate of your #: monitor. With a very high speed mouse/high keyboard repeat rate, #: you may notice some slight input latency. If so, set this to no. #: }}} #: Terminal bell {{{ # enable_audio_bell yes #: The audio bell. Useful to disable it in environments that require #: silence. # visual_bell_duration 0.0 #: The visual bell duration (in seconds). Flash the screen when a bell #: occurs for the specified number of seconds. Set to zero to disable. # visual_bell_color none #: The color used by visual bell. Set to none will fall back to #: selection background color. If you feel that the visual bell is too #: bright, you can set it to a darker color. # window_alert_on_bell yes #: Request window attention on bell. Makes the dock icon bounce on #: macOS or the taskbar flash on linux. # bell_on_tab "🔔 " #: Some text or a Unicode symbol to show on the tab if a window in the #: tab that does not have focus has a bell. If you want to use leading #: or trailing spaces, surround the text with quotes. See #: tab_title_template for how this is rendered. #: For backwards compatibility, values of yes, y and true are #: converted to the default bell symbol and no, n, false and none are #: converted to the empty string. # command_on_bell none #: Program to run when a bell occurs. The environment variable #: KITTY_CHILD_CMDLINE can be used to get the program running in the #: window in which the bell occurred. # bell_path none #: Path to a sound file to play as the bell sound. If set to none, the #: system default bell sound is used. Must be in a format supported by #: the operating systems sound API, such as WAV or OGA on Linux #: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound) # linux_bell_theme __custom #: The XDG Sound Theme kitty will use to play the bell sound. Defaults #: to the custom theme name used by GNOME and Budgie, falling back to #: the default freedesktop theme if it does not exist. This option may #: be removed if Linux ever provides desktop-agnostic support for #: setting system sound themes. #: }}} #: Window layout {{{ # remember_window_size yes # initial_window_width 640 # initial_window_height 400 #: If enabled, the OS Window size will be remembered so that new #: instances of kitty will have the same size as the previous #: instance. If disabled, the OS Window will initially have size #: configured by initial_window_width/height, in pixels. You can use a #: suffix of "c" on the width/height values to have them interpreted #: as number of cells instead of pixels. # enabled_layouts * #: The enabled window layouts. A comma separated list of layout names. #: The special value all means all layouts. The first listed layout #: will be used as the startup layout. Default configuration is all #: layouts in alphabetical order. For a list of available layouts, see #: the layouts . # window_resize_step_cells 2 # window_resize_step_lines 2 #: The step size (in units of cell width/cell height) to use when #: resizing kitty windows in a layout with the shortcut #: start_resizing_window. The cells value is used for horizontal #: resizing, and the lines value is used for vertical resizing. window_border_width 0pt #: The width of window borders. Can be either in pixels (px) or pts #: (pt). Values in pts will be rounded to the nearest number of pixels #: based on screen resolution. If not specified, the unit is assumed #: to be pts. Note that borders are displayed only when more than one #: window is visible. They are meant to separate multiple windows. draw_minimal_borders no #: Draw only the minimum borders needed. This means that only the #: borders that separate the window from a neighbor are drawn. Note #: that setting a non-zero window_margin_width overrides this and #: causes all borders to be drawn. window_margin_width 0 #: The window margin (in pts) (blank area outside the border). A #: single value sets all four sides. Two values set the vertical and #: horizontal sides. Three values set top, horizontal and bottom. Four #: values set top, right, bottom and left. single_window_margin_width 0 #: The window margin to use when only a single window is visible (in #: pts). Negative values will cause the value of window_margin_width #: to be used instead. A single value sets all four sides. Two values #: set the vertical and horizontal sides. Three values set top, #: horizontal and bottom. Four values set top, right, bottom and left. # window_padding_width 0 #: The window padding (in pts) (blank area between the text and the #: window border). A single value sets all four sides. Two values set #: the vertical and horizontal sides. Three values set top, horizontal #: and bottom. Four values set top, right, bottom and left. # placement_strategy center #: When the window size is not an exact multiple of the cell size, the #: cell area of the terminal window will have some extra padding on #: the sides. You can control how that padding is distributed with #: this option. Using a value of center means the cell area will be #: placed centrally. A value of top-left means the padding will be #: only at the bottom and right edges. #active_border_color #88c0d0 #: The color for the border of the active window. Set this to none to #: not draw borders around the active window. # inactive_border_color #cccccc #: The color for the border of inactive windows. # bell_border_color #ff5a00 #: The color for the border of inactive windows in which a bell has #: occurred. #: Fade the text in inactive windows by the specified amount (a number #: between zero and one, with zero being fully faded). hide_window_decorations yes #: Hide the window decorations (title-bar and window borders) with #: yes. On macOS, titlebar-only can be used to only hide the titlebar. #: Whether this works and exactly what effect it has depends on the #: window manager/operating system. Note that the effects of changing #: this option when reloading config are undefined. # window_logo_path none #: Path to a logo image. Must be in PNG format. Relative paths are #: interpreted relative to the kitty config directory. The logo is #: displayed in a corner of every kitty window. The position is #: controlled by window_logo_position. Individual windows can be #: configured to have different logos either using the launch action #: or the remote control facility. # window_logo_position bottom-right #: Where to position the window logo in the window. The value can be #: one of: top-left, top, top-right, left, center, right, bottom-left, #: bottom, bottom-right. # window_logo_alpha 0.5 #: The amount the logo should be faded into the background. With zero #: being fully faded and one being fully opaque. # resize_debounce_time 0.1 #: The time to wait before redrawing the screen when a resize event is #: received (in seconds). On platforms such as macOS, where the #: operating system sends events corresponding to the start and end of #: a resize, this number is ignored. # resize_draw_strategy static #: Choose how kitty draws a window while a resize is in progress. A #: value of static means draw the current window contents, mostly #: unchanged. A value of scale means draw the current window contents #: scaled. A value of blank means draw a blank window. A value of size #: means show the window size in cells. # resize_in_steps no #: Resize the OS window in steps as large as the cells, instead of #: with the usual pixel accuracy. Combined with initial_window_width #: and initial_window_height in number of cells, this option can be #: used to keep the margins as small as possible when resizing the OS #: window. Note that this does not currently work on Wayland. # visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ #: The list of characters for visual window selection. For example, #: for selecting a window to focus on with focus_visible_window. The #: value should be a series of unique numbers or alphabets, case #: insensitive, from the set [0-9A-Z]. Specify your preference as a #: string of characters. # confirm_os_window_close -1 #: Ask for confirmation when closing an OS window or a tab with at #: least this number of kitty windows in it by window manager (e.g. #: clicking the window close button or pressing the operating system #: shortcut to close windows) or by the close_tab action. A value of #: zero disables confirmation. This confirmation also applies to #: requests to quit the entire application (all OS windows, via the #: quit action). Negative values are converted to positive ones, #: however, with shell_integration enabled, using negative values #: means windows sitting at a shell prompt are not counted, only #: windows where some command is currently running. Note that if you #: want confirmation when closing individual windows, you can map the #: close_window_with_confirmation action. #: }}} Tab bar {{{ # tab_bar_edge bottom #: The edge to show the tab bar on, top or bottom. # tab_bar_margin_width 0.0 #: The margin to the left and right of the tab bar (in pts). # tab_bar_margin_height 0.0 0.0 #: The margin above and below the tab bar (in pts). The first number #: is the margin between the edge of the OS Window and the tab bar. #: The second number is the margin between the tab bar and the #: contents of the current tab. tab_bar_style separator #: The tab bar style, can be one of: #: fade #: Each tab's edges fade into the background color. (See also tab_fade) #: slant #: Tabs look like the tabs in a physical file. #: separator #: Tabs are separated by a configurable separator. (See also #: tab_separator) #: powerline #: Tabs are shown as a continuous line with "fancy" separators. #: (See also tab_powerline_style) #: custom #: A user-supplied Python function called draw_tab is loaded from the file #: tab_bar.py in the kitty config directory. For examples of how to #: write such a function, see the functions named draw_tab_with_* in #: kitty's source code: kitty/tab_bar.py. See also #: this discussion #: for examples from kitty users. #: hidden #: The tab bar is hidden. If you use this, you might want to create #: a mapping for the select_tab action which presents you with a list of #: tabs and allows for easy switching to a tab. # tab_bar_align left #: The horizontal alignment of the tab bar, can be one of: left, #: center, right. # tab_bar_min_tabs 2 #: The minimum number of tabs that must exist before the tab bar is #: shown. # tab_switch_strategy previous #: The algorithm to use when switching to a tab when the current tab #: is closed. The default of previous will switch to the last used #: tab. A value of left will switch to the tab to the left of the #: closed tab. A value of right will switch to the tab to the right of #: the closed tab. A value of last will switch to the right-most tab. # tab_fade 0.25 0.5 0.75 1 #: Control how each tab fades into the background when using fade for #: the tab_bar_style. Each number is an alpha (between zero and one) #: that controls how much the corresponding cell fades into the #: background, with zero being no fade and one being full fade. You #: can change the number of cells used by adding/removing entries to #: this list. tab_separator " " #: The separator between tabs in the tab bar when using separator as #: the tab_bar_style. tab_powerline_style round #: The powerline separator style between tabs in the tab bar when #: using powerline as the tab_bar_style, can be one of: angled, #: slanted, round. # tab_activity_symbol none #: Some text or a Unicode symbol to show on the tab if a window in the #: tab that does not have focus has some activity. If you want to use #: leading or trailing spaces, surround the text with quotes. See #: tab_title_template for how this is rendered. # tab_title_max_length 0 #: The maximum number of cells that can be used to render the text in #: a tab. A value of zero means that no limit is applied. # tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" #: A template to render the tab title. The default just renders the #: title with optional symbols for bell and activity. If you wish to #: include the tab-index as well, use something like: {index}:{title}. #: Useful if you have shortcuts mapped for goto_tab N. If you prefer #: to see the index as a superscript, use {sup.index}. All data #: available is: #: title #: The current tab title. #: index #: The tab index useable with goto_tab N goto_tab shortcuts. #: layout_name #: The current layout name. #: num_windows #: The number of windows in the tab. #: num_window_groups #: The number of window groups (not counting overlay windows) in the tab. #: tab.active_wd #: The working directory of the currently active window in the tab #: (expensive, requires syscall). Use active_oldest_wd to get #: the directory of the oldest foreground process rather than the newest. #: tab.active_exe #: The name of the executable running in the foreground of the currently #: active window in the tab (expensive, requires syscall). Use #: active_oldest_exe for the oldest foreground process. #: max_title_length #: The maximum title length available. #: Note that formatting is done by Python's string formatting #: machinery, so you can use, for instance, {layout_name[:2].upper()} #: to show only the first two letters of the layout name, upper-cased. #: If you want to style the text, you can use styling directives, for #: example: #: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. #: Similarly, for bold and italic: #: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. #: Note that for backward compatibility, if {bell_symbol} or #: {activity_symbol} are not present in the template, they are #: prepended to it. # active_tab_title_template none #: Template to use for active tabs. If not specified falls back to #: tab_title_template. # active_tab_foreground #000 # active_tab_background #eee # active_tab_font_style bold-italic # inactive_tab_foreground #444 # inactive_tab_background #999 # inactive_tab_font_style normal #: Tab bar colors and styles. # tab_bar_background none #: Background color for the tab bar. Defaults to using the terminal #: background color. # tab_bar_margin_color none #: Color for the tab bar margin area. Defaults to using the terminal #: background color for margins above and below the tab bar. For side #: margins the default color is chosen to match the background color #: of the neighboring tab. }}} # Color scheme {{{ foreground #dddddd background #282c34 #: The foreground and background colors. background_opacity 1 #: The opacity of the background. A number between zero and one, where #: one is opaque and zero is fully transparent. This will only work if #: supported by the OS (for instance, when using a compositor under #: X11). Note that it only sets the background color's opacity in #: cells that have the same background color as the default terminal #: background, so that things like the status bar in vim, powerline #: prompts, etc. still look good. But it means that if you use a color #: theme with a background color in your editor, it will not be #: rendered as transparent. Instead you should change the default #: background color in your kitty config and not use a background #: color in the editor color scheme. Or use the escape codes to set #: the terminals default colors in a shell script to launch your #: editor. Be aware that using a value less than 1.0 is a (possibly #: significant) performance hit. If you want to dynamically change #: transparency of windows, set dynamic_background_opacity to yes #: (this is off by default as it has a performance cost). Changing #: this option when reloading the config will only work if #: dynamic_background_opacity was enabled in the original config. # background_image none #: Path to a background image. Must be in PNG format. # background_image_layout tiled #: Whether to tile, scale or clamp the background image. The value can #: be one of tiled, mirror-tiled, scaled, clamped or centered. background_image_linear yes #: When background image is scaled, whether linear interpolation #: should be used. # dynamic_background_opacity no #: Allow changing of the background_opacity dynamically, using either #: keyboard shortcuts (increase_background_opacity and #: decrease_background_opacity) or the remote control facility. #: Changing this option by reloading the config is not supported. background_tint 1.0 #: How much to tint the background image by the background color. This #: option makes it easier to read the text. Tinting is done using the #: current background color for each window. This option applies only #: if background_opacity is set and transparent windows are supported #: or background_image is set. # background_tint_gaps 1.0 #: How much to tint the background image at the window gaps by the #: background color, after applying background_tint. Since this is #: multiplicative with background_tint, it can be used to lighten the #: tint over the window gaps for a *separated* look. # dim_opacity 0.75 #: How much to dim text that has the DIM/FAINT attribute set. One #: means no dimming and zero means fully dimmed (i.e. invisible). # selection_foreground #000000 # selection_background #fffacd #: The foreground and background colors for text selected with the #: mouse. Setting both of these to none will cause a "reverse video" #: effect for selections, where the selection will be the cell text #: color and the text will become the cell background color. Setting #: only selection_foreground to none will cause the foreground color #: to be used unchanged. Note that these colors can be overridden by #: the program running in the terminal. #: The color table {{{ #: The 256 terminal colors. There are 8 basic colors, each color has a #: dull and bright version, for the first 16 colors. You can set the #: remaining 240 colors as color16 to color255. # color0 #000000 # color8 #767676 #: black # color1 #cc0403 # color9 #f2201f #: red # color2 #19cb00 # color10 #23fd00 #: green # color3 #cecb00 # color11 #fffd00 #: yellow # color4 #0d73cc # color12 #1a8fff #: blue # color5 #cb1ed1 # color13 #fd28ff #: magenta # color6 #0dcdcd # color14 #14ffff #: cyan # color7 #dddddd # color15 #ffffff #: white # mark1_foreground black #: Color for marks of type 1 # mark1_background #98d3cb #: Color for marks of type 1 (light steel blue) # mark2_foreground black #: Color for marks of type 2 # mark2_background #f2dcd3 #: Color for marks of type 1 (beige) # mark3_foreground black #: Color for marks of type 3 # mark3_background #f274bc #: Color for marks of type 3 (violet) # }}} Advanced {{{ # shell . #: The shell program to execute. The default value of . means to use #: whatever shell is set as the default shell for the current user. #: Note that on macOS if you change this, you might need to add #: --login and --interactive to ensure that the shell starts in #: interactive mode and reads its startup rc files. # editor . #: The terminal based text editor (such as vim or nano) to use when #: editing the kitty config file or similar tasks. #: The default value of . means to use the environment variables #: VISUAL and EDITOR in that order. If these variables aren't set, #: kitty will run your shell ($SHELL -l -i -c env) to see if your #: shell startup rc files set VISUAL or EDITOR. If that doesn't work, #: kitty will cycle through various known editors (vim, emacs, etc.) #: and take the first one that exists on your system. # close_on_child_death no #: Close the window when the child process (shell) exits. With the #: default value no, the terminal will remain open when the child #: exits as long as there are still processes outputting to the #: terminal (for example disowned or backgrounded processes). When #: enabled with yes, the window will close as soon as the child #: process exits. Note that setting it to yes means that any #: background processes still using the terminal can fail silently #: because their stdout/stderr/stdin no longer work. # remote_control_password #: Allow other programs to control kitty using passwords. This option #: can be specified multiple times to add multiple passwords. If no #: passwords are present kitty will ask the user for permission if a #: program tries to use remote control with a password. A password can #: also *optionally* be associated with a set of allowed remote #: control actions. For example:: #: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab #: Only the specified actions will be allowed when using this #: password. Glob patterns can be used too, for example:: #: remote_control_password "my passphrase" set-tab-* resize-* #: To get a list of available actions, run:: #: kitty @ --help #: A set of actions to be allowed when no password is sent can be #: specified by using an empty password. For example:: #: remote_control_password "" *-colors #: Finally, the path to a python module can be specified that provides #: a function is_cmd_allowed that is used to check every remote #: control command. For example:: #: remote_control_password "my passphrase" my_rc_command_checker.py #: Relative paths are resolved from the kitty configuration directory. #: See rc_custom_auth for details. # allow_remote_control no #: Allow other programs to control kitty. If you turn this on, other #: programs can control all aspects of kitty, including sending text #: to kitty windows, opening new windows, closing windows, reading the #: content of windows, etc. Note that this even works over SSH #: connections. The default setting of no prevents any form of remote #: control. The meaning of the various values are: #: password #: Remote control requests received over both the TTY device and the socket #: are confirmed based on passwords, see remote_control_password. #: socket-only #: Remote control requests received over a socket are accepted #: unconditionally. Requests received over the TTY are denied. #: See listen_on. #: socket #: Remote control requests received over a socket are accepted #: unconditionally. Requests received over the TTY are confirmed based on #: password. #: no #: Remote control is completely disabled. #: yes #: Remote control requests are always accepted. # listen_on none #: Listen to the specified UNIX socket for remote control connections. #: Note that this will apply to all kitty instances. It can be #: overridden by the kitty --listen-on command line option, which also #: supports listening on a TCP socket. This option accepts only UNIX #: sockets, such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). #: Environment variables are expanded and relative paths are resolved #: with respect to the temporary directory. If {kitty_pid} is present, #: then it is replaced by the PID of the kitty process, otherwise the #: PID of the kitty process is appended to the value, with a hyphen. #: See the help for kitty --listen-on for more details. Note that this #: will be ignored unless allow_remote_control is set to either: yes, #: socket or socket-only. Changing this option by reloading the config #: is not supported. # env #: Specify the environment variables to be set in all child processes. #: Using the name with an equal sign (e.g. env VAR=) will set it to #: the empty string. Specifying only the name (e.g. env VAR) will #: remove the variable from the child process' environment. Note that #: environment variables are expanded recursively, for example:: #: env VAR1=a #: env VAR2=${HOME}/${VAR1}/b #: The value of VAR2 will be /a/b. # watcher #: Path to python file which will be loaded for watchers #: . Can be #: specified more than once to load multiple watchers. The watchers #: will be added to every kitty window. Relative paths are resolved #: relative to the kitty config directory. Note that reloading the #: config will only affect windows created after the reload. # exe_search_path #: Control where kitty finds the programs to run. The default search #: order is: First search the system wide PATH, then ~/.local/bin and #: ~/bin. If still not found, the PATH defined in the login shell #: after sourcing all its startup files is tried. Finally, if present, #: the PATH specified by the env option is tried. #: This option allows you to prepend, append, or remove paths from #: this search order. It can be specified multiple times for multiple #: paths. A simple path will be prepended to the search order. A path #: that starts with the + sign will be append to the search order, #: after ~/bin above. A path that starts with the - sign will be #: removed from the entire search order. For example:: #: exe_search_path /some/prepended/path #: exe_search_path +/some/appended/path #: exe_search_path -/some/excluded/path # update_check_interval 24 #: The interval to periodically check if an update to kitty is #: available (in hours). If an update is found, a system notification #: is displayed informing you of the available update. The default is #: to check every 24 hours, set to zero to disable. Update checking is #: only done by the official binary builds. Distro packages or source #: builds do not do update checking. Changing this option by reloading #: the config is not supported. # startup_session none #: Path to a session file to use for all kitty instances. Can be #: overridden by using the kitty --session =none command line option #: for individual instances. See sessions #: in the kitty #: documentation for details. Note that relative paths are interpreted #: with respect to the kitty config directory. Environment variables #: in the path are expanded. Changing this option by reloading the #: config is not supported. # clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask #: Allow programs running in kitty to read and write from the #: clipboard. You can control exactly which actions are allowed. The #: possible actions are: write-clipboard, read-clipboard, write- #: primary, read-primary, read-clipboard-ask, read-primary-ask. The #: default is to allow writing to the clipboard and primary selection #: and to ask for permission when a program tries to read from the #: clipboard. Note that disabling the read confirmation is a security #: risk as it means that any program, even the ones running on a #: remote server via SSH can read your clipboard. See also #: clipboard_max_size. # clipboard_max_size 512 #: The maximum size (in MB) of data from programs running in kitty #: that will be stored for writing to the system clipboard. A value of #: zero means no size limit is applied. See also clipboard_control. # file_transfer_confirmation_bypass #: The password that can be supplied to the file transfer kitten #: to skip the #: transfer confirmation prompt. This should only be used when #: initiating transfers from trusted computers, over trusted networks #: or encrypted transports, as it allows any programs running on the #: remote machine to read/write to the local filesystem, without #: permission. # allow_hyperlinks yes #: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 #: escape sequences are ignored. Otherwise they become clickable #: links, that you can click with the mouse or by using the hints #: kitten . The #: special value of ask means that kitty will ask before opening the #: link when clicked. shell_integration enabled #: Enable shell integration on supported shells. This enables features #: such as jumping to previous prompts, browsing the output of the #: previous command in a pager, etc. on supported shells. Set to #: disabled to turn off shell integration, completely. It is also #: possible to disable individual features, set to a space separated #: list of these values: no-rc, no-cursor, no-title, no-cwd, no- #: prompt-mark, no-complete. See Shell integration #: for details. # allow_cloning ask #: Control whether programs running in the terminal can request new #: windows to be created. The canonical example is clone-in-kitty #: . #: By default, kitty will ask for permission for each clone request. #: Allowing cloning unconditionally gives programs running in the #: terminal (including over SSH) permission to execute arbitrary code, #: as the user who is running the terminal, on the computer that the #: terminal is running on. # clone_source_strategies venv,conda,env_var,path #: Control what shell code is sourced when running clone-in-kitty in #: the newly cloned window. The supported strategies are: #: venv #: Source the file $VIRTUAL_ENV/bin/activate. This is used by the #: Python stdlib venv module and allows cloning venvs automatically. #: conda #: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual #: environments created by conda. #: env_var #: Execute the contents of the environment variable #: KITTY_CLONE_SOURCE_CODE with eval. #: path #: Source the file pointed to by the environment variable #: KITTY_CLONE_SOURCE_PATH. #: This option must be a comma separated list of the above values. #: This only source the first valid one in the above order. term xterm-kitty #: The value of the TERM environment variable to set. Changing this #: can break many terminal programs, only change it if you know what #: you are doing, not because you read some advice on "Stack Overflow" #: to change it. The TERM variable is used by various programs to get #: information about the capabilities and behavior of the terminal. If #: you change it, depending on what programs you run, and how #: different the terminal you are changing it to is, various things #: from key-presses, to colors, to various advanced features may not #: work. Changing this option by reloading the config will only affect #: newly created windows. }}} #: OS specific tweaks {{{ # wayland_titlebar_color system #: The color of the kitty window's titlebar on Wayland systems with #: client side window decorations such as GNOME. A value of system #: means to use the default system color, a value of background means #: to use the background color of the currently active window and #: finally you can use an arbitrary color, such as #12af59 or red. # macos_titlebar_color system #: The color of the kitty window's titlebar on macOS. A value of #: system means to use the default system color, light or dark can #: also be used to set it explicitly. A value of background means to #: use the background color of the currently active window and finally #: you can use an arbitrary color, such as #12af59 or red. WARNING: #: This option works by using a hack when arbitrary color (or #: background) is configured, as there is no proper Cocoa API for it. #: It sets the background color of the entire window and makes the #: titlebar transparent. As such it is incompatible with #: background_opacity. If you want to use both, you are probably #: better off just hiding the titlebar with hide_window_decorations. # macos_option_as_alt no #: Use the Option key as an Alt key on macOS. With this set to no, #: kitty will use the macOS native Option+Key to enter Unicode #: character behavior. This will break any Alt+Key keyboard shortcuts #: in your terminal programs, but you can use the macOS Unicode input #: technique. You can use the values: left, right or both to use only #: the left, right or both Option keys as Alt, instead. Note that #: kitty itself always treats Option the same as Alt. This means you #: cannot use this option to configure different kitty shortcuts for #: Option+Key vs. Alt+Key. Also, any kitty shortcuts using #: Option/Alt+Key will take priority, so that any such key presses #: will not be passed to terminal programs running inside kitty. #: Changing this option by reloading the config is not supported. # macos_hide_from_tasks no #: Hide the kitty window from running tasks on macOS (⌘+Tab and the #: Dock). Changing this option by reloading the config is not #: supported. # macos_quit_when_last_window_closed no #: Have kitty quit when all the top-level windows are closed on macOS. #: By default, kitty will stay running, even with no open windows, as #: is the expected behavior on macOS. # macos_window_resizable yes #: Disable this if you want kitty top-level OS windows to not be #: resizable on macOS. Changing this option by reloading the config #: will only affect newly created OS windows. # macos_thicken_font 0 #: Draw an extra border around the font with the given width, to #: increase legibility at small font sizes on macOS. For example, a #: value of 0.75 will result in rendering that looks similar to sub- #: pixel antialiasing at common font sizes. Note that in modern kitty, #: this option is obsolete (although still supported). Consider using #: text_composition_strategy instead. # macos_traditional_fullscreen no #: Use the macOS traditional full-screen transition, that is faster, #: but less pretty. # macos_show_window_title_in all #: Control where the window title is displayed on macOS. A value of #: window will show the title of the currently active window at the #: top of the macOS window. A value of menubar will show the title of #: the currently active window in the macOS global menu bar, making #: use of otherwise wasted space. A value of all will show the title #: in both places, and none hides the title. See #: macos_menubar_title_max_length for how to control the length of the #: title in the menu bar. # macos_menubar_title_max_length 0 #: The maximum number of characters from the window title to show in #: the macOS global menu bar. Values less than one means that there is #: no maximum limit. # macos_custom_beam_cursor no #: Use a custom mouse cursor for macOS that is easier to see on both #: light and dark backgrounds. Nowadays, the default macOS cursor #: already comes with a white border. WARNING: this might make your #: mouse cursor invisible on dual GPU machines. Changing this option #: by reloading the config is not supported. # macos_colorspace srgb #: The colorspace in which to interpret terminal colors. The default #: of srgb will cause colors to match those seen in web browsers. The #: value of default will use whatever the native colorspace of the #: display is. The value of displayp3 will use Apple's special #: snowflake display P3 color space, which will result in over #: saturated (brighter) colors with some color shift. Reloading #: configuration will change this value only for newly created OS #: windows. # linux_display_server auto #: Choose between Wayland and X11 backends. By default, an appropriate #: backend based on the system state is chosen automatically. Set it #: to x11 or wayland to force the choice. Changing this option by #: reloading the config is not supported. #: }}} #: Keyboard shortcuts {{{ #: Keys are identified simply by their lowercase Unicode characters. #: For example: a for the A key, [ for the left square bracket key, #: etc. For functional keys, such as Enter or Escape, the names are #: present at Functional key definitions #: . #: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt #: (opt, option, ⌥), super (cmd, command, ⌘). See also: GLFW mods #: #: On Linux you can also use XKB key names to bind keys that are not #: supported by GLFW. See XKB keys #: for a list of key names. The name to use is the part #: after the XKB_KEY_ prefix. Note that you can only use an XKB key #: name for keys that are not known as GLFW keys. #: Finally, you can use raw system key codes to map keys, again only #: for keys that are not known as GLFW keys. To see the system key #: code for a key, start kitty with the kitty --debug-input option, #: kitty will output some debug text for every key event. In that text #: look for native_code, the value of that becomes the key name in the #: shortcut. For example: #: .. code-block:: none #: on_key_input: glfw key: 0x61 native_code: 0x61 action: PRESS mods: none text: 'a' #: Here, the key name for the A key is 0x61 and you can use it with:: #: map ctrl+0x61 something #: to map Ctrl+A to something. #: You can use the special action no_op to unmap a keyboard shortcut #: that is assigned in the default configuration:: #: map kitty_mod+space no_op #: If you would like kitty to completely ignore a key event, not even #: sending it to the program running in the terminal, map it to #: discard_event:: #: map kitty_mod+f1 discard_event #: You can combine multiple actions to be triggered by a single #: shortcut with combine action, using the syntax below:: #: map key combine action1 action2 action3 ... #: For example:: #: map kitty_mod+e combine : new_window : next_layout #: This will create a new window and switch to the next available #: layout. #: You can use multi-key shortcuts with the syntax shown below:: #: map key1>key2>key3 action #: For example:: #: map ctrl+f>2 set_font_size 20 #: The full list of actions that can be mapped to key presses is #: available here . kitty_mod ctrl+shift #: Special modifier key alias for default shortcuts. You can change #: the value of this option to alter all default shortcuts that use #: kitty_mod. # clear_all_shortcuts no #: Remove all shortcut definitions up to this point. Useful, for #: instance, to remove the default shortcuts. # action_alias #: E.g. action_alias launch_tab launch --type=tab --cwd=current #: Define action aliases to avoid repeating the same options in #: multiple mappings. Aliases can be defined for any action and will #: be expanded recursively. For example, the above alias allows you to #: create mappings to launch a new tab in the current working #: directory without duplication:: #: map f1 launch_tab vim #: map f2 launch_tab emacs #: Similarly, to alias kitten invocation:: #: action_alias hints kitten hints --hints-offset=0 # kitten_alias #: E.g. kitten_alias hints hints --hints-offset=0 #: Like action_alias above, but specifically for kittens. Generally, #: prefer to use action_alias. This option is a legacy version, #: present for backwards compatibility. It causes all invocations of #: the aliased kitten to be substituted. So the example above will #: cause all invocations of the hints kitten to have the --hints- #: offset=0 option applied. #: Clipboard {{{ #: Copy to clipboard # map kitty_mod+c copy_to_clipboard # map cmd+c copy_to_clipboard #:: There is also a copy_or_interrupt action that can be optionally #:: mapped to Ctrl+C. It will copy only if there is a selection and #:: send an interrupt otherwise. Similarly, #:: copy_and_clear_or_interrupt will copy and clear the selection or #:: send an interrupt if there is no selection. #: Paste from clipboard # map kitty_mod+v paste_from_clipboard # map cmd+v paste_from_clipboard #: Paste from selection # map kitty_mod+s paste_from_selection # map shift+insert paste_from_selection #: Pass selection to program # map kitty_mod+o pass_selection_to_program #:: You can also pass the contents of the current selection to any #:: program with pass_selection_to_program. By default, the system's #:: open program is used, but you can specify your own, the selection #:: will be passed as a command line argument to the program. For #:: example:: #:: map kitty_mod+o pass_selection_to_program firefox #:: You can pass the current selection to a terminal program running #:: in a new kitty window, by using the @selection placeholder:: #:: map kitty_mod+y new_window less @selection #: }}} #: Scrolling {{{ #: Scroll line up # map kitty_mod+up scroll_line_up # map kitty_mod+k scroll_line_up # map opt+cmd+page_up scroll_line_up # map cmd+up scroll_line_up #: Scroll line down # map kitty_mod+down scroll_line_down # map kitty_mod+j scroll_line_down # map opt+cmd+page_down scroll_line_down # map cmd+down scroll_line_down #: Scroll page up # map kitty_mod+page_up scroll_page_up # map cmd+page_up scroll_page_up #: Scroll page down # map kitty_mod+page_down scroll_page_down # map cmd+page_down scroll_page_down #: Scroll to top # map kitty_mod+home scroll_home # map cmd+home scroll_home #: Scroll to bottom # map kitty_mod+end scroll_end # map cmd+end scroll_end #: Scroll to previous shell prompt # map kitty_mod+z scroll_to_prompt -1 #:: Use a parameter of 0 for scroll_to_prompt to scroll to the last #:: jumped to or the last clicked position. Requires shell #:: integration #:: to work. #: Scroll to next shell prompt # map kitty_mod+x scroll_to_prompt 1 #: Browse scrollback buffer in pager # map kitty_mod+h show_scrollback #:: You can pipe the contents of the current screen and history #:: buffer as STDIN to an arbitrary program using launch --stdin- #:: source. For example, the following opens the scrollback buffer in #:: less in an overlay window:: #:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R #:: For more details on piping screen and buffer contents to external #:: programs, see launch . #: Browse output of the last shell command in pager # map kitty_mod+g show_last_command_output #:: You can also define additional shortcuts to get the command #:: output. For example, to get the first command output on screen:: #:: map f1 show_first_command_output_on_screen #:: To get the command output that was last accessed by a keyboard #:: action or mouse action:: #:: map f1 show_last_visited_command_output #:: You can pipe the output of the last command run in the shell #:: using the launch action. For example, the following opens the #:: output in less in an overlay window:: #:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R #:: To get the output of the first command on the screen, use #:: @first_cmd_output_on_screen. To get the output of the last jumped #:: to command, use @last_visited_cmd_output. #:: Requires shell integration #:: to work. #: }}} #: Window management {{{ #: New window # map kitty_mod+enter new_window # map cmd+enter new_window #:: You can open a new kitty window running an arbitrary program, for #:: example:: #:: map kitty_mod+y launch mutt #:: You can open a new window with the current working directory set #:: to the working directory of the current window using:: #:: map ctrl+alt+enter launch --cwd=current #:: You can open a new window that is allowed to control kitty via #:: the kitty remote control facility with launch --allow-remote- #:: control. Any programs running in that window will be allowed to #:: control kitty. For example:: #:: map ctrl+enter launch --allow-remote-control some_program #:: You can open a new window next to the currently active window or #:: as the first window, with:: #:: map ctrl+n launch --location=neighbor #:: map ctrl+f launch --location=first #:: For more details, see launch #:: . #: New OS window # map kitty_mod+n new_os_window # map cmd+n new_os_window #:: Works like new_window above, except that it opens a top-level OS #:: window. In particular you can use new_os_window_with_cwd to open #:: a window with the current working directory. #: Close window # map kitty_mod+w close_window # map shift+cmd+d close_window #: Next window # map kitty_mod+] next_window #: Previous window # map kitty_mod+[ previous_window #: Move window forward # map kitty_mod+f move_window_forward #: Move window backward # map kitty_mod+b move_window_backward #: Move window to top # map kitty_mod+` move_window_to_top #: Start resizing window # map kitty_mod+r start_resizing_window # map cmd+r start_resizing_window #: First window # map kitty_mod+1 first_window # map cmd+1 first_window #: Second window # map kitty_mod+2 second_window # map cmd+2 second_window #: Third window # map kitty_mod+3 third_window # map cmd+3 third_window #: Fourth window # map kitty_mod+4 fourth_window # map cmd+4 fourth_window #: Fifth window # map kitty_mod+5 fifth_window # map cmd+5 fifth_window #: Sixth window # map kitty_mod+6 sixth_window # map cmd+6 sixth_window #: Seventh window # map kitty_mod+7 seventh_window # map cmd+7 seventh_window #: Eight window # map kitty_mod+8 eighth_window # map cmd+8 eighth_window #: Ninth window # map kitty_mod+9 ninth_window # map cmd+9 ninth_window #: Tenth window # map kitty_mod+0 tenth_window #: Visually select and focus window # map kitty_mod+f7 focus_visible_window #:: Display overlay numbers and alphabets on the window, and switch #:: the focus to the window when you press the key. When there are #:: only two windows, the focus will be switched directly without #:: displaying the overlay. You can change the overlay characters and #:: their order with option visual_window_select_characters. #: Visually swap window with another # map kitty_mod+f8 swap_with_window #:: Works like focus_visible_window above, but swaps the window. #: }}} #: Tab management {{{ #: Next tab # map kitty_mod+right next_tab # map shift+cmd+] next_tab # map ctrl+tab next_tab #: Previous tab # map kitty_mod+left previous_tab # map shift+cmd+[ previous_tab # map ctrl+shift+tab previous_tab #: New tab # map kitty_mod+t new_tab # map cmd+t new_tab #: Close tab # map kitty_mod+q close_tab # map cmd+w close_tab #: Close OS window # map shift+cmd+w close_os_window #: Move tab forward # map kitty_mod+. move_tab_forward #: Move tab backward # map kitty_mod+, move_tab_backward #: Set tab title # map kitty_mod+alt+t set_tab_title # map shift+cmd+i set_tab_title #: You can also create shortcuts to go to specific tabs, with 1 being #: the first tab, 2 the second tab and -1 being the previously active #: tab, and any number larger than the last tab being the last tab:: #: map ctrl+alt+1 goto_tab 1 #: map ctrl+alt+2 goto_tab 2 #: Just as with new_window above, you can also pass the name of #: arbitrary commands to run when using new_tab and new_tab_with_cwd. #: Finally, if you want the new tab to open next to the current tab #: rather than at the end of the tabs list, use:: #: map ctrl+t new_tab !neighbor [optional cmd to run] #: }}} #: Layout management {{{ #: Next layout # map kitty_mod+l next_layout #: You can also create shortcuts to switch to specific layouts:: #: map ctrl+alt+t goto_layout tall #: map ctrl+alt+s goto_layout stack #: Similarly, to switch back to the previous layout:: #: map ctrl+alt+p last_used_layout #: There is also a toggle_layout action that switches to the named #: layout or back to the previous layout if in the named layout. #: Useful to temporarily "zoom" the active window by switching to the #: stack layout:: #: map ctrl+alt+z toggle_layout stack #: }}} : Font sizes {{{ #: You can change the font size for all top-level kitty OS windows at #: a time or only the current one. #: Increase font size # map kitty_mod+equal change_font_size all +2.0 map kitty_mod+plus change_font_size all +2.0 # map kitty_mod+kp_add change_font_size all +2.0 # map cmd+plus change_font_size all +2.0 # map cmd+equal change_font_size all +2.0 # map shift+cmd+equal change_font_size all +2.0 #: Decrease font size map kitty_mod+minus change_font_size all -2.0 # map kitty_mod+kp_subtract change_font_size all -2.0 # map cmd+minus change_font_size all -2.0 # map shift+cmd+minus change_font_size all -2.0 #: Reset font size # map kitty_mod+backspace change_font_size all 0 # map cmd+0 change_font_size all 0 #: To setup shortcuts for specific font sizes:: #: map kitty_mod+f6 change_font_size all 10.0 #: To setup shortcuts to change only the current OS window's font #: size:: #: map kitty_mod+f6 change_font_size current 10.0 : }}} #: Select and act on visible text {{{ #: Use the hints kitten to select text and either pass it to an #: external program or insert it into the terminal or copy it to the #: clipboard. #: Open URL # map kitty_mod+e open_url_with_hints #:: Open a currently visible URL using the keyboard. The program used #:: to open the URL is specified in open_url_with. #: Insert selected path # map kitty_mod+p>f kitten hints --type path --program - #:: Select a path/filename and insert it into the terminal. Useful, #:: for instance to run git commands on a filename output from a #:: previous git command. #: Open selected path # map kitty_mod+p>shift+f kitten hints --type path #:: Select a path/filename and open it with the default open program. #: Insert selected line # map kitty_mod+p>l kitten hints --type line --program - #:: Select a line of text and insert it into the terminal. Useful for #:: the output of things like: `ls -1`. #: Insert selected word # map kitty_mod+p>w kitten hints --type word --program - #:: Select words and insert into terminal. #: Insert selected hash # map kitty_mod+p>h kitten hints --type hash --program - #:: Select something that looks like a hash and insert it into the #:: terminal. Useful with git, which uses SHA1 hashes to identify #:: commits. #: Open the selected file at the selected line # map kitty_mod+p>n kitten hints --type linenum #:: Select something that looks like filename:linenum and open it in #:: vim at the specified line number. #: Open the selected hyperlink # map kitty_mod+p>y kitten hints --type hyperlink #:: Select a hyperlink (i.e. a URL that has been marked as such by #:: the terminal program, for example, by `ls --hyperlink=auto`). #: The hints kitten has many more modes of operation that you can map #: to different shortcuts. For a full description see hints kitten #: . #: }}} #: Miscellaneous {{{ #: Show documentation # map kitty_mod+f1 show_kitty_doc overview #: Toggle fullscreen # map kitty_mod+f11 toggle_fullscreen # map ctrl+cmd+f toggle_fullscreen #: Toggle maximized # map kitty_mod+f10 toggle_maximized #: Toggle macOS secure keyboard entry # map opt+cmd+s toggle_macos_secure_keyboard_entry #: Unicode input # map kitty_mod+u kitten unicode_input # map ctrl+cmd+space kitten unicode_input #: Edit config file # map kitty_mod+f2 edit_config_file # map cmd+, edit_config_file #: Open the kitty command shell # map kitty_mod+escape kitty_shell window #:: Open the kitty shell in a new window / tab / overlay / os_window #:: to control kitty using commands. #: Increase background opacity # map kitty_mod+a>m set_background_opacity +0.1 #: Decrease background opacity # map kitty_mod+a>l set_background_opacity -0.1 #: Make background fully opaque # map kitty_mod+a>1 set_background_opacity 1 #: Reset background opacity # map kitty_mod+a>d set_background_opacity default #: Reset the terminal # map kitty_mod+delete clear_terminal reset active # map opt+cmd+r clear_terminal reset active #:: You can create shortcuts to clear/reset the terminal. For #:: example:: #:: # Reset the terminal #:: map f1 clear_terminal reset active #:: # Clear the terminal screen by erasing all contents #:: map f1 clear_terminal clear active #:: # Clear the terminal scrollback by erasing it #:: map f1 clear_terminal scrollback active #:: # Scroll the contents of the screen into the scrollback #:: map f1 clear_terminal scroll active #:: # Clear everything up to the line with the cursor #:: map f1 clear_terminal to_cursor active #:: If you want to operate on all kitty windows instead of just the #:: current one, use all instead of active. #:: It is also possible to remap Ctrl+L to both scroll the current #:: screen contents into the scrollback buffer and clear the screen, #:: instead of just clearing the screen, for example, for ZSH add the #:: following to ~/.zshrc: #:: .. code-block:: zsh #:: scroll-and-clear-screen() { #:: printf '\n%.0s' {1..$LINES} #:: zle clear-screen #:: } #:: zle -N scroll-and-clear-screen #:: bindkey '^l' scroll-and-clear-screen #: Clear up to cursor line # map cmd+k clear_terminal to_cursor active #: Reload kitty.conf # map kitty_mod+f5 load_config_file # map ctrl+cmd+, load_config_file #:: Reload kitty.conf, applying any changes since the last time it #:: was loaded. Note that a handful of options cannot be dynamically #:: changed and require a full restart of kitty. Particularly, when #:: changing shortcuts for actions located on the macOS global menu #:: bar, a full restart is needed. You can also map a keybinding to #:: load a different config file, for example:: #:: map f5 load_config /path/to/alternative/kitty.conf #:: Note that all options from the original kitty.conf are discarded, #:: in other words the new configuration *replace* the old ones. #: Debug kitty configuration # map kitty_mod+f6 debug_config # map opt+cmd+, debug_config #:: Show details about exactly what configuration kitty is running #:: with and its host environment. Useful for debugging issues. #: Send arbitrary text on key presses #:: E.g. map ctrl+shift+alt+h send_text all Hello World #:: You can tell kitty to send arbitrary (UTF-8) encoded text to the #:: client program when pressing specified shortcut keys. For #:: example:: #:: map ctrl+alt+a send_text all Special text #:: This will send "Special text" when you press the Ctrl+Alt+A key #:: combination. The text to be sent decodes ANSI C escapes #:: so you can use escapes like \e to send control #:: codes or \u21fb to send Unicode characters (or you can just input #:: the Unicode characters directly as UTF-8 text). You can use #:: `kitty +kitten show_key` to get the key escape codes you want to #:: emulate. #:: The first argument to send_text is the keyboard modes in which to #:: activate the shortcut. The possible values are normal, #:: application, kitty or a comma separated combination of them. The #:: modes normal and application refer to the DECCKM cursor key mode #:: for terminals, and kitty refers to the kitty extended keyboard #:: protocol. The special value all means all of them. #:: Some more examples:: #:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) #:: map ctrl+alt+a send_text normal Word\e[H #:: map ctrl+alt+a send_text application Word\eOH #:: # Run a command at a shell prompt (like typing the command and pressing Enter) #:: map ctrl+alt+a send_text normal,application some command with arguments\r #: Open kitty Website # map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ #: Hide macOS kitty application # map cmd+h hide_macos_app #: Hide macOS other applications # map opt+cmd+h hide_macos_other_apps #: Minimize macOS window # map cmd+m minimize_macos_window #: Quit kitty # map cmd+q quit #: }}} #: }}} ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/neofetch/ascii.txt ================================================ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/ ================================================ FILE: nixos/hosts/desktop/home-dotfiles-desktop/neofetch/config.conf ================================================ print_info() { prin "" prin "$(color 6)󰌢 ""OptiPlex 3060" info underline info "$(color 7)┌"$(color 1)"󰣇 " distro info "$(color 7)├"$(color 2)" " kernel info "$(color 7)├"$(color 3)" " uptime info "$(color 7)├"$(color 5)" " de info "$(color 7)├"$(color 4)" " packages info "$(color 7)├"$(color 6)"󰞱 " cpu info "$(color 7)└"$(color 2)"󰍛 " memory prin "" prin "$(color 3)󰮯 $(color 2) $(color 1) $(color 4) $(color 5) $(color 6) $(color 7)󰊠" #prin "" prin "$(color 3)Hi$(color 7), $(color 2)M$(color 1)o$(color 4)m $(color 5)=$(color 6)) " } # Title # Hide/Show Fully qualified domain name. # # Default: 'off' # Values: 'on', 'off' # Flag: --title_fqdn title_fqdn="off" # Kernel # Shorten the output of the kernel function. # # Default: 'on' # Values: 'on', 'off' # Flag: --kernel_shorthand # Supports: Everything except *BSDs (except PacBSD and PC-BSD) # # Example: # on: '4.8.9-1-ARCH' # off: 'Linux 4.8.9-1-ARCH' kernel_shorthand="on" # Distro # Shorten the output of the distro function # # Default: 'off' # Values: 'on', 'tiny', 'off' # Flag: --distro_shorthand # Supports: Everything except Windows and Haiku distro_shorthand="off" # Show/Hide OS Architecture. # Show 'x86_64', 'x86' and etc in 'Distro:' output. # # Default: 'on' # Values: 'on', 'off' # Flag: --os_arch # # Example: # on: 'Arch Linux x86_64' # off: 'Arch Linux' os_arch="on" # Uptime # Shorten the output of the uptime function # # Default: 'on' # Values: 'on', 'tiny', 'off' # Flag: --uptime_shorthand # # Example: # on: '2 days, 10 hours, 3 mins' # tiny: '2d 10h 3m' # off: '2 days, 10 hours, 3 minutes' uptime_shorthand="on" # Memory # Show memory pecentage in output. # # Default: 'off' # Values: 'on', 'off' # Flag: --memory_percent # # Example: # on: '1801MiB / 7881MiB (22%)' # off: '1801MiB / 7881MiB' memory_percent="off" # Change memory output unit. # # Default: 'mib' # Values: 'kib', 'mib', 'gib' # Flag: --memory_unit # # Example: # kib '1020928KiB / 7117824KiB' # mib '1042MiB / 6951MiB' # gib: ' 0.98GiB / 6.79GiB' memory_unit="gib" # Packages # Show/Hide Package Manager names. # # Default: 'tiny' # Values: 'on', 'tiny' 'off' # Flag: --package_managers # # Example: # on: '998 (pacman), 8 (flatpak), 4 (snap)' # tiny: '908 (pacman, flatpak, snap)' # off: '908' package_managers="on" # Shell # Show the path to $SHELL # # Default: 'off' # Values: 'on', 'off' # Flag: --shell_path # # Example: # on: '/bin/bash' # off: 'bash' shell_path="off" # Show $SHELL version # # Default: 'on' # Values: 'on', 'off' # Flag: --shell_version # # Example: # on: 'bash 4.4.5' # off: 'bash' shell_version="on" # CPU # CPU speed type # # Default: 'bios_limit' # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. # Flag: --speed_type # Supports: Linux with 'cpufreq' # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. speed_type="bios_limit" # CPU speed shorthand # # Default: 'off' # Values: 'on', 'off'. # Flag: --speed_shorthand # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz # # Example: # on: 'i7-6500U (4) @ 3.1GHz' # off: 'i7-6500U (4) @ 3.100GHz' speed_shorthand="off" # Enable/Disable CPU brand in output. # # Default: 'on' # Values: 'on', 'off' # Flag: --cpu_brand # # Example: # on: 'Intel i7-6500U' # off: 'i7-6500U (4)' cpu_brand="on" # CPU Speed # Hide/Show CPU speed. # # Default: 'on' # Values: 'on', 'off' # Flag: --cpu_speed # # Example: # on: 'Intel i7-6500U (4) @ 3.1GHz' # off: 'Intel i7-6500U (4)' cpu_speed="on" # CPU Cores # Display CPU cores in output # # Default: 'logical' # Values: 'logical', 'physical', 'off' # Flag: --cpu_cores # Support: 'physical' doesn't work on BSD. # # Example: # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) # off: 'Intel i7-6500U @ 3.1GHz' cpu_cores="logical" # CPU Temperature # Hide/Show CPU temperature. # Note the temperature is added to the regular CPU function. # # Default: 'off' # Values: 'C', 'F', 'off' # Flag: --cpu_temp # Supports: Linux, BSD # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable # coretemp kernel module. This only supports newer Intel processors. # # Example: # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' # off: 'Intel i7-6500U (4) @ 3.1GHz' cpu_temp="off" # GPU # Enable/Disable GPU Brand # # Default: 'on' # Values: 'on', 'off' # Flag: --gpu_brand # # Example: # on: 'AMD HD 7950' # off: 'HD 7950' gpu_brand="on" # Which GPU to display # # Default: 'all' # Values: 'all', 'dedicated', 'integrated' # Flag: --gpu_type # Supports: Linux # # Example: # all: # GPU1: AMD HD 7950 # GPU2: Intel Integrated Graphics # # dedicated: # GPU1: AMD HD 7950 # # integrated: # GPU1: Intel Integrated Graphics gpu_type="dedicated" # Resolution # Display refresh rate next to each monitor # Default: 'off' # Values: 'on', 'off' # Flag: --refresh_rate # Supports: Doesn't work on Windows. # # Example: # on: '1920x1080 @ 60Hz' # off: '1920x1080' refresh_rate="off" # Gtk Theme / Icons / Font # Shorten output of GTK Theme / Icons / Font # # Default: 'off' # Values: 'on', 'off' # Flag: --gtk_shorthand # # Example: # on: 'Numix, Adwaita' # off: 'Numix [GTK2], Adwaita [GTK3]' gtk_shorthand="off" # Enable/Disable gtk2 Theme / Icons / Font # # Default: 'on' # Values: 'on', 'off' # Flag: --gtk2 # # Example: # on: 'Numix [GTK2], Adwaita [GTK3]' # off: 'Adwaita [GTK3]' gtk2="on" # Enable/Disable gtk3 Theme / Icons / Font # # Default: 'on' # Values: 'on', 'off' # Flag: --gtk3 # # Example: # on: 'Numix [GTK2], Adwaita [GTK3]' # off: 'Numix [GTK2]' gtk3="on" # IP Address # Website to ping for the public IP # # Default: 'http://ident.me' # Values: 'url' # Flag: --ip_host public_ip_host="http://ident.me" # Public IP timeout. # # Default: '2' # Values: 'int' # Flag: --ip_timeout public_ip_timeout=2 # Desktop Environment # Show Desktop Environment version # # Default: 'on' # Values: 'on', 'off' # Flag: --de_version de_version="on" # Disk # Which disks to display. # The values can be any /dev/sdXX, mount point or directory. # NOTE: By default we only show the disk info for '/'. # # Default: '/' # Values: '/', '/dev/sdXX', '/path/to/drive'. # Flag: --disk_show # # Example: # disk_show=('/' '/dev/sdb1'): # 'Disk (/): 74G / 118G (66%)' # 'Disk (/mnt/Videos): 823G / 893G (93%)' # # disk_show=('/'): # 'Disk (/): 74G / 118G (66%)' # disk_show=('/') # Disk subtitle. # What to append to the Disk subtitle. # # Default: 'mount' # Values: 'mount', 'name', 'dir', 'none' # Flag: --disk_subtitle # # Example: # name: 'Disk (/dev/sda1): 74G / 118G (66%)' # 'Disk (/dev/sdb2): 74G / 118G (66%)' # # mount: 'Disk (/): 74G / 118G (66%)' # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' # 'Disk (/mnt/Videos): 74G / 118G (66%)' # # dir: 'Disk (/): 74G / 118G (66%)' # 'Disk (Local Disk): 74G / 118G (66%)' # 'Disk (Videos): 74G / 118G (66%)' # # none: 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' disk_subtitle="mount" # Disk percent. # Show/Hide disk percent. # # Default: 'on' # Values: 'on', 'off' # Flag: --disk_percent # # Example: # on: 'Disk (/): 74G / 118G (66%)' # off: 'Disk (/): 74G / 118G' disk_percent="on" # Song # Manually specify a music player. # # Default: 'auto' # Values: 'auto', 'player-name' # Flag: --music_player # # Available values for 'player-name': # # amarok # audacious # banshee # bluemindo # clementine # cmus # deadbeef # deepin-music # dragon # elisa # exaile # gnome-music # gmusicbrowser # gogglesmm # guayadeque # io.elementary.music # iTunes # juk # lollypop # mocp # mopidy # mpd # muine # netease-cloud-music # olivia # playerctl # pogo # pragha # qmmp # quodlibet # rhythmbox # sayonara # smplayer # spotify # strawberry # tauonmb # tomahawk # vlc # xmms2d # xnoise # yarock music_player="mpd" # Format to display song information. # # Default: '%artist% - %album% - %title%' # Values: '%artist%', '%album%', '%title%' # Flag: --song_format # # Example: # default: 'Song: Jet - Get Born - Sgt Major' song_format="%artist% - %album% - %title%" # Print the Artist, Album and Title on separate lines # # Default: 'off' # Values: 'on', 'off' # Flag: --song_shorthand # # Example: # on: 'Artist: The Fratellis' # 'Album: Costello Music' # 'Song: Chelsea Dagger' # # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' song_shorthand="off" # 'mpc' arguments (specify a host, password etc). # # Default: '' # Example: mpc_args=(-h HOST -P PASSWORD) mpc_args=() # Text Colors # Text Colors # # Default: 'distro' # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' # Flag: --colors # # Each number represents a different part of the text in # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' # # Example: # colors=(distro) - Text is colored based on Distro colors. # colors=(4 6 1 8 8 6) - Text is colored in the order above. colors=(distro) # Text Options # Toggle bold text # # Default: 'on' # Values: 'on', 'off' # Flag: --bold bold="on" # Enable/Disable Underline # # Default: 'on' # Values: 'on', 'off' # Flag: --underline underline_enabled="on" # Underline character # # Default: '-' # Values: 'string' # Flag: --underline_char underline_char="-" # Info Separator # Replace the default separator with the specified string. # # Default: ':' # Flag: --separator # # Example: # separator="->": 'Shell-> bash' # separator=" =": 'WM = dwm' separator="󰇙" # Color Blocks # Color block range # The range of colors to print. # # Default: '0', '15' # Values: 'num' # Flag: --block_range # # Example: # # Display colors 0-7 in the blocks. (8 colors) # neofetch --block_range 0 7 # # Display colors 0-15 in the blocks. (16 colors) # neofetch --block_range 0 15 block_range=(0 15) # Toggle color blocks # # Default: 'on' # Values: 'on', 'off' # Flag: --color_blocks color_blocks="on" # Color block width in spaces # # Default: '3' # Values: 'num' # Flag: --block_width block_width=3 # Color block height in lines # # Default: '1' # Values: 'num' # Flag: --block_height block_height=1 # Color Alignment # # Default: 'auto' # Values: 'auto', 'num' # Flag: --col_offset # # Number specifies how far from the left side of the terminal (in spaces) to # begin printing the columns, in case you want to e.g. center them under your # text. # Example: # col_offset="auto" - Default behavior of neofetch # col_offset=7 - Leave 7 spaces then print the colors col_offset="auto" # Progress Bars # Bar characters # # Default: '-', '=' # Values: 'string', 'string' # Flag: --bar_char # # Example: # neofetch --bar_char 'elapsed' 'total' # neofetch --bar_char '-' '=' bar_char_elapsed="-" bar_char_total="=" # Toggle Bar border # # Default: 'on' # Values: 'on', 'off' # Flag: --bar_border bar_border="on" # Progress bar length in spaces # Number of chars long to make the progress bars. # # Default: '15' # Values: 'num' # Flag: --bar_length bar_length=15 # Progress bar colors # When set to distro, uses your distro's logo colors. # # Default: 'distro', 'distro' # Values: 'distro', 'num' # Flag: --bar_colors # # Example: # neofetch --bar_colors 3 4 # neofetch --bar_colors distro 5 bar_color_elapsed="distro" bar_color_total="distro" # Info display # Display a bar with the info. # # Default: 'off' # Values: 'bar', 'infobar', 'barinfo', 'off' # Flags: --cpu_display # --memory_display # --battery_display # --disk_display # # Example: # bar: '[---=======]' # infobar: 'info [---=======]' # barinfo: '[---=======] info' # off: 'info' cpu_display="off" memory_display="off" battery_display="off" disk_display="off" # Backend Settings # Image backend. # # Default: 'ascii' # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # Flag: --backend image_backend="kitty" # Image Source # # Which image or ascii file to display. # # Default: 'auto' # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' # Flag: --source # # NOTE: 'auto' will pick the best image source for whatever image backend is used. # In ascii mode, distro ascii art will be used and in an image mode, your # wallpaper will be used. image_source="$HOME/.dots/backgrounds/hl.png" # Ascii Options # Ascii distro # Which distro's ascii art to display. # # Default: 'auto' # Values: 'auto', 'distro_name' # Flag: --ascii_distro # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", # "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, # ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, # Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, # DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, # FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, # gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, # NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, # OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, # Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, # popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, # Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, # Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, # Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, # SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, # openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, # Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, # Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, # and IRIX have ascii logos # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. # Use '{distro name}_old' to use the old logos. # NOTE: Ubuntu has flavor variants. # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, # postmarketOS, and Void have a smaller logo variant. # Use '{distro name}_small' to use the small variants. ascii_distro="arch_small" # Ascii Colors # # Default: 'distro' # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' # Flag: --ascii_colors # # Example: # ascii_colors=(distro) - Ascii is colored based on Distro colors. # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. ascii_colors=(distro) # Bold ascii logo # Whether or not to bold the ascii logo. # # Default: 'on' # Values: 'on', 'off' # Flag: --ascii_bold ascii_bold="on" # Image Options # Image loop # Setting this to on will make neofetch redraw the image constantly until # Ctrl+C is pressed. This fixes display issues in some terminal emulators. # # Default: 'off' # Values: 'on', 'off' # Flag: --loop image_loop="off" # Thumbnail directory # # Default: '~/.cache/thumbnails/neofetch' # Values: 'dir' thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" # Crop mode # # Default: 'normal' # Values: 'normal', 'fit', 'fill' # Flag: --crop_mode # # See this wiki page to learn about the fit and fill options. # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F crop_mode="fit" # Crop offset # Note: Only affects 'normal' crop mode. # # Default: 'center' # Values: 'northwest', 'north', 'northeast', 'west', 'center' # 'east', 'southwest', 'south', 'southeast' # Flag: --crop_offset crop_offset="center" # Image size # The image is half the terminal width by default. # # Default: 'auto' # Values: 'auto', '00px', '00%', 'none' # Flags: --image_size # --size image_size="218px" # Gap between image and text # # Default: '3' # Values: 'num', '-num' # Flag: --gap gap=0 # Image offsets # Only works with the w3m backend. # # Default: '0' # Values: 'px' # Flags: --xoffset # --yoffset yoffset=2 xoffset=0 # Image background color # Only works with the w3m backend. # # Default: '' # Values: 'color', 'blue' # Flag: --b ================================================ FILE: nixos/hosts/desktop/home-programs-desktop.nix ================================================ { inputs, config, pkgs, ... }: { imports = [ inputs.ags.homeManagerModules.default ]; nixpkgs.config.allowUnfree = true; programs.home-manager.enable = true; programs = { ags = { enable = true; configDir = ./home-dotfiles-desktop/ags; extraPackages = [ pkgs.libsoup_3 ]; }; kitty = { enable = true; extraConfig = builtins.readFile ./home-dotfiles-desktop/kitty/kitty.conf; }; vscode = { enable = true; extensions = with pkgs.vscode-extensions; [ bbenoist.nix jnoortheen.nix-ide piousdeer.adwaita-theme pkief.material-product-icons #asvetliakov.vscode-neovim ]; userSettings = { }; }; git = { enable = true; userName = "RoccoRakete"; userEmail = "m.schaumann@mscloud.uk"; extraConfig = { credential.helper = "${ pkgs.git.override { withLibsecret = true; } }/bin/git-credential-libsecret"; }; }; }; # Packages that should be installed to the user profile. home.packages = [ pkgs.htop ]; } ================================================ FILE: nixos/hosts/desktop/link-dotfiles-desktop.nix ================================================ { config, ... }: { # neofetch home.file."${config.xdg.configHome}/neofetch" = { source = ./home-dotfiles-desktop/neofetch; recursive = true; enable = true; }; # Hyprland home.file."${config.xdg.configHome}/hypr" = { source = ./home-dotfiles-desktop/hypr; recursive = true; enable = true; }; # gtklock home.file."${config.xdg.configHome}/gtklock" = { source = ../../global-dotfiles/gtklock; recursive = true; enable = true; }; # neovim home.file."${config.xdg.configHome}/nvim" = { source = ../../global-dotfiles/nvim; recursive = true; enable = true; }; } ================================================ FILE: nixos/hosts/laptop/configs-laptop/thinkfan.nix ================================================ { ... }: { services = { thinkfan.enable = true; thinkfan.extraArgs = [ "-b" "-10" "-s" "1" ]; thinkfan.sensors = [ { query = "/proc/acpi/ibm/thermal"; type = "tpacpi"; #indices= [0]; } ]; thinkfan.fans = [ { query = "/proc/acpi/ibm/fan"; type = "tpacpi"; } ]; thinkfan.levels = [ [ 0 0 75 ] [ 1 72 90 ] [ 2 86 95 ] [ "level auto" 92 32767 ] ]; }; } ================================================ FILE: nixos/hosts/laptop/configuration-laptop.nix ================================================ { lib, ... }: let vars = import ../../variables.nix; in { imports = [ ./hardware-configuration-laptop.nix ./configs-laptop/thinkfan.nix ../../configs/nixos-configs/services.nix ../../configs/nixos-configs/services.nix ../../configs/nixos-configs/programs.nix ../../configs/nixos-configs/nixvim/nvim.nix ../../configs/nixos-configs/bluetooth.nix ../../configs/nixos-configs/tlp.nix ../../nixos.nix ../../packages.nix ]; services.logind = { lidSwitchDocked = "ignore"; #lidSwitch = "ignore"; }; # Networking networking = { hostName = vars.laptop; useDHCP = lib.mkDefault true; networkmanager.enable = true; firewall = { enable = true; allowedTCPPorts = [ 53317 ]; allowedUDPPorts = [ 53317 ]; }; }; } ================================================ FILE: nixos/hosts/laptop/hardware-configuration-laptop.nix ================================================ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { config, lib, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/ad644324-dbe0-423c-a4ca-632ac0d5b75a"; fsType = "ext4"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/7D4A-11C2"; fsType = "vfat"; }; swapDevices = [{ device = "/dev/disk/by-uuid/3c634ef4-fe2b-48e6-a67e-e92bcf1a6975"; }]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.opengl.driSupport = true; # This is already enabled by default hardware.opengl.driSupport32Bit = true; # For 32 bit applications hardware.xpadneo.enable = true; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/.eslintrc.yml ================================================ env: es2022: true extends: - "eslint:recommended" - "plugin:@typescript-eslint/recommended" parser: "@typescript-eslint/parser" parserOptions: ecmaVersion: 2022 sourceType: "module" project: "./tsconfig.json" warnOnUnsupportedTypeScriptVersion: false root: true ignorePatterns: - types/ plugins: - "@typescript-eslint" rules: "@typescript-eslint/ban-ts-comment": - "off" "@typescript-eslint/no-non-null-assertion": - "off" # "@typescript-eslint/no-explicit-any": # - "off" "@typescript-eslint/no-unused-vars": - error - varsIgnorePattern: (^unused|_$) argsIgnorePattern: ^(unused|_) "@typescript-eslint/no-empty-interface": - "off" arrow-parens: - error - as-needed comma-dangle: - error - always-multiline comma-spacing: - error - before: false after: true comma-style: - error - last curly: - error - multi-or-nest - consistent dot-location: - error - property eol-last: - error eqeqeq: - error - always indent: - error - 4 - SwitchCase: 1 keyword-spacing: - error - before: true lines-between-class-members: - error - always - exceptAfterSingleLine: true padded-blocks: - error - never - allowSingleLineBlocks: false prefer-const: - error quotes: - error - double - avoidEscape: true semi: - error - never nonblock-statement-body-position: - error - below no-trailing-spaces: - error no-useless-escape: - off max-len: - error - code: 100 func-call-spacing: - error array-bracket-spacing: - error space-before-function-paren: - error - never space-before-blocks: - error key-spacing: - error object-curly-spacing: - error - always ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/.gitignore ================================================ node_modules types package-lock.json bun.lockb flake.lock ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/config.js ================================================ const v = { ags: pkg.version.split(".").map(Number), expect: [1, 8, 0], } function mismatch() { print(`my config needs at least v${v.expect.join(".")}, yours is v${v.ags.join(".")}`) App.connect("config-parsed", app => app.Quit()) return {} } function check() { if (v.ags[1] < v.expect[1]) return false if (v.ags[2] < v.expect[2]) return false return true } const main = "/tmp/ags/main.js" const outdir = `${App.configDir}/main.ts` try { await Utils.execAsync([ "bun", "build", outdir, "--outfile", main, "--external", "resource://*", "--external", "gi://*", "--external", "file://*", ]) } catch (error) { console.error(error) App.quit() } export default check() ? (await import(`file://${main}`)).default : mismatch() ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/default.nix ================================================ { inputs , system , stdenv , writeShellScriptBin , swww , bun , dart-sass , fd , brightnessctl , accountsservice }: let ags = inputs.ags.packages.${system}.default.override { extraPackages = [accountsservice]; }; pname = "asztal"; config = stdenv.mkDerivation { inherit pname; version = "1.7.6"; src = ./.; buildPhase = '' ${bun}/bin/bun build ./main.ts \ --outfile main.js \ --external "resource://*" \ --external "gi://*" ${bun}/bin/bun build ./greeter/greeter.ts \ --outfile greeter.js \ --external "resource://*" \ --external "gi://*" ''; installPhase = '' mkdir $out cp -r assets $out cp -r style $out cp -r greeter $out cp -r widget $out cp -f main.js $out/config.js cp -f greeter.js $out/greeter.js ''; }; in { desktop = { inherit config; script = writeShellScriptBin pname '' export PATH=$PATH:${dart-sass}/bin export PATH=$PATH:${fd}/bin export PATH=$PATH:${brightnessctl}/bin export PATH=$PATH:${swww}/bin ${ags}/bin/ags -b ${pname} -c ${config}/config.js $@ ''; }; greeter = { inherit config; script = writeShellScriptBin "greeter" '' export PATH=$PATH:${dart-sass}/bin export PATH=$PATH:${fd}/bin ${ags}/bin/ags -b ${pname} -c ${config}/greeter.js $@ ''; }; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter/auth.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import AccountsService from "gi://AccountsService?version=1.0" import icons from "lib/icons" const { iconFile, realName, userName } = AccountsService.UserManager.get_default().list_users()[0] const loggingin = Variable(false) async function login(password: string) { const greetd = await Service.import("greetd") return greetd.login(userName, password, "Hyprland", [ "WLR_NO_HARDWARE_CURSORS=1", "_JAVA_AWT_WM_NONREPARENTING=1", ]) } const avatar = Widget.Box({ class_name: "avatar", hpack: "center", css: `background-image: url('${iconFile}')`, }) const password = Widget.Entry({ placeholder_text: "Password", hexpand: true, visibility: false, on_accept: ({ text }) => { loggingin.value = true login(text!).catch(res => { loggingin.value = false response.label = res?.description || JSON.stringify(res) revealer.reveal_child = true }) }, }) const response = Widget.Label({ class_name: "response", wrap: true, max_width_chars: 35, hpack: "center", hexpand: true, xalign: .5, }) const revealer = Widget.Revealer({ transition: "slide_down", child: response, }) export default Widget.Box({ class_name: "auth", attribute: { password }, vertical: true, children: [ Widget.Overlay({ child: Widget.Box( { css: "min-width: 200px; min-height: 200px;", vertical: true, }, Widget.Box({ class_name: "wallpaper", css: `background-image: url('${WALLPAPER}')`, }), Widget.Box({ class_name: "wallpaper-contrast", vexpand: true, }), ), overlay: Widget.Box( { vpack: "end", vertical: true, }, avatar, Widget.Box({ hpack: "center", children: [ Widget.Icon(icons.ui.avatar), Widget.Label(realName || userName), ], }), Widget.Box( { class_name: "password", }, Widget.Spinner({ visible: loggingin.bind(), active: true, }), Widget.Icon({ visible: loggingin.bind().as(b => !b), icon: icons.ui.lock, }), password, ), ), }), Widget.Box( { class_name: "response-box" }, revealer, ), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter/greeter.scss ================================================ @import "../style/mixins/floating-widget.scss"; @import "../style/mixins/widget.scss"; @import "../style/mixins/spacing.scss"; @import "../style/mixins/unset.scss"; @import "../style/mixins/a11y-button.scss"; @import "../widget/bar/bar.scss"; window#greeter { background-color: lighten($bg, 6%); color: $fg; .bar { background-color: transparent; .date { @include unset($rec: true); @include panel-button($flat: true, $reactive: false); } } .auth { @include floating_widget; border-radius: $radius; min-width: 400px; padding: 0; .wallpaper { min-height: 220px; background-size: cover; border-top-left-radius: $radius; border-top-right-radius: $radius; } .wallpaper-contrast { min-height: 100px; } .avatar { border-radius: 99px; min-width: 140px; min-height: 140px; background-size: cover; box-shadow: 3px 3px 6px 0 $shadow-color; margin-bottom: $spacing; } .password { entry { @include button; padding: $padding*.7 $padding; margin-left: $spacing*.5; } margin: 0 $padding*4; margin-top: $spacing; } .response-box { color: $error-bg; margin: $spacing 0; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter/greeter.ts ================================================ import "./session" import GLib from "gi://GLib?version=2.0" import style from "style/style" import gtk from "lib/gtk" import RegularWindow from "widget/RegularWindow" import statusbar from "./statusbar" import auth from "./auth" const win = RegularWindow({ name: "greeter", setup: self => { self.set_default_size(500, 500) self.show_all() auth.attribute.password.grab_focus() }, child: Widget.Overlay({ child: Widget.Box({ expand: true }), overlays: [ Widget.Box({ vpack: "start", hpack: "fill", hexpand: true, child: statusbar, }), Widget.Box({ vpack: "center", hpack: "center", child: auth, }), ], }), }) export default { onConfigParsed() { style() gtk() }, icons: "./assets", windows: [win], cursorTheme: GLib.getenv("XCURSOR_THEME"), } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter/session.ts ================================================ import GLib from "gi://GLib?version=2.0" import AccountsService from "gi://AccountsService?version=1.0" const { userName } = AccountsService.UserManager.get_default().list_users()[0] declare global { const WALLPAPER: string } Object.assign(globalThis, { TMP: `${GLib.get_tmp_dir()}/greeter`, OPTIONS: "/var/cache/greeter/options.json", WALLPAPER: "/var/cache/greeter/background", // TMP: "/tmp/ags", // OPTIONS: Utils.CACHE_DIR + "/options.json", // WALLPAPER: Utils.HOME + "/.config/background", USER: userName, }) Utils.ensureDirectory(TMP) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter/statusbar.ts ================================================ import options from "options" import { clock } from "lib/variables" import icons from "lib/icons" import BatteryBar from "widget/bar/buttons/BatteryBar" import PanelButton from "widget/bar/PanelButton" const { scheme } = options.theme const { monochrome } = options.bar.powermenu const poweroff = PanelButton({ class_name: "powermenu", child: Widget.Icon(icons.powermenu.shutdown), on_clicked: () => Utils.exec("shutdown now"), setup: self => self.hook(monochrome, () => { self.toggleClassName("colored", !monochrome.value) self.toggleClassName("box") }), }) const date = PanelButton({ class_name: "date", child: Widget.Label({ label: clock.bind().as(c => c.format(options.bar.date.format.value) || ""), }), }) const darkmode = PanelButton({ class_name: "darkmode", child: Widget.Icon({ icon: scheme.bind().as(s => icons.color[s]) }), on_clicked: () => scheme.value = scheme.value === "dark" ? "light" : "dark", }) export default Widget.CenterBox({ class_name: "bar", hexpand: true, center_widget: date, end_widget: Widget.Box({ hpack: "end", children: [ darkmode, BatteryBar(), poweroff, ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/greeter.js ================================================ const main = "/tmp/ags/greeter.js" const entry = `${App.configDir}/greeter/greeter.ts` try { await Utils.execAsync([ "bun", "build", entry, "--outfile", main, "--external", "resource://*", "--external", "gi://*", "--external", "file://*", ]) } catch (error) { console.error(error) App.quit() } const { default: config } = await import(`file://${main}`) export default config ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/battery.ts ================================================ import icons from "./icons" export default async function init() { const bat = await Service.import("battery") bat.connect("notify::percent", ({ percent, charging }) => { const low = 30 if (percent !== low || percent !== low / 2 || !charging) return Utils.notify({ summary: `${percent}% Battery Percentage`, iconName: icons.battery.warning, urgency: "critical", }) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/experiments.ts ================================================ // these are functionalities that I might include in ags /* eslint-disable @typescript-eslint/no-explicit-any */ import { Binding } from "types/service" import { Variable } from "resource:///com/github/Aylur/ags/variable.js" import { App } from "resource:///com/github/Aylur/ags/app.js" import GObject from "gi://GObject?version=2.0" type GObj = GObject.Object | App type B = Binding, any, T> // eslint-disable-next-line max-len export function watch(init: T, objs: Array, callback: () => T): B export function watch(init: T, obj: GObj, signal: string, callback: () => T): B export function watch(init: T, obj: GObj, callback: () => T): B export function watch( init: T, objs: GObj | Array, sigOrFn: string | (() => T), callback?: () => T, ) { const v = new Variable(init) const f = typeof sigOrFn === "function" ? sigOrFn : callback ?? (() => v.value) const set = () => v.value = f() if (Array.isArray(objs)) { // multiple objects for (const obj of objs) { if (Array.isArray(obj)) { // obj signal pair const [o, s = "changed"] = obj o.connect(s, set) } else { // obj on changed obj.connect("changed", set) } } } else { // watch single object const signal = typeof sigOrFn === "string" ? sigOrFn : "changed" objs.connect(signal, set) } return v.bind() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/gtk.ts ================================================ import Gio from "gi://Gio" import options from "options" const settings = new Gio.Settings({ schema: "org.gnome.desktop.interface", }) function gtk() { const scheme = options.theme.scheme.value settings.set_string("color-scheme", `prefer-${scheme}`) } export default function init() { options.theme.scheme.connect("changed", gtk) gtk() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/hyprland.ts ================================================ import options from "options" const { messageAsync } = await Service.import("hyprland") const { hyprland } = options const { spacing, radius, border: { width }, blur, shadows, dark: { primary: { bg: darkActive } }, light: { primary: { bg: lightActive } }, scheme, } = options.theme const deps = [ "hyprland", spacing.id, radius.id, blur.id, width.id, shadows.id, darkActive.id, lightActive.id, scheme.id, ] export default function init() { options.handler(deps, setupHyprland) setupHyprland() } function activeBorder() { const color = scheme.value === "dark" ? darkActive.value : lightActive.value return color.replace("#", "") } function sendBatch(batch: string[]) { const cmd = batch .filter(x => !!x) .map(x => `keyword ${x}`) .join("; ") return messageAsync(`[[BATCH]]/${cmd}`) } async function setupHyprland() { const wm_gaps = Math.floor(hyprland.gaps.value * spacing.value) sendBatch([ `general:border_size ${width.value}`, `general:gaps_out ${wm_gaps}`, `general:gaps_in ${Math.floor(wm_gaps / 2)}`, `general:col.active_border rgba(${activeBorder()}ff)`, `general:col.inactive_border rgba(${hyprland.inactiveBorder.value})`, `decoration:rounding ${radius.value}`, `decoration:drop_shadow ${shadows.value ? "yes" : "no"}`, ]) await sendBatch(App.windows.map(({ name }) => `layerrule unset, ${name}`)) if (blur.value > 0) { sendBatch(App.windows.flatMap(({ name }) => [ `layerrule unset, ${name}`, `layerrule blur, ${name}`, `layerrule ignorealpha ${/* based on shadow color */.29}, ${name}`, ])) } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/icons.ts ================================================ export const substitutes = { "transmission-gtk": "transmission", "blueberry.py": "blueberry", "Caprine": "facebook-messenger", "com.raggesilver.BlackBox-symbolic": "terminal-symbolic", "org.wezfurlong.wezterm-symbolic": "terminal-symbolic", "audio-headset-bluetooth": "audio-headphones-symbolic", "audio-card-analog-usb": "audio-speakers-symbolic", "audio-card-analog-pci": "audio-card-symbolic", "preferences-system": "emblem-system-symbolic", "com.github.Aylur.ags-symbolic": "controls-symbolic", "com.github.Aylur.ags": "controls-symbolic", } export default { fallback: { executable: "application-x-executable-symbolic", notification: "dialog-information-symbolic", video: "video-x-generic-symbolic", audio: "audio-x-generic-symbolic", }, ui: { close: "window-close-symbolic", colorpicker: "color-select-symbolic", info: "info-symbolic", link: "external-link-symbolic", lock: "system-lock-screen-symbolic", menu: "open-menu-symbolic", refresh: "view-refresh-symbolic", search: "system-search-symbolic", settings: "emblem-system-symbolic", themes: "preferences-desktop-theme-symbolic", tick: "object-select-symbolic", time: "hourglass-symbolic", toolbars: "toolbars-symbolic", warning: "dialog-warning-symbolic", avatar: "avatar-default-symbolic", arrow: { right: "pan-end-symbolic", left: "pan-start-symbolic", down: "pan-down-symbolic", up: "pan-up-symbolic", }, }, audio: { mic: { muted: "microphone-disabled-symbolic", low: "microphone-sensitivity-low-symbolic", medium: "microphone-sensitivity-medium-symbolic", high: "microphone-sensitivity-high-symbolic", }, volume: { muted: "audio-volume-muted-symbolic", low: "audio-volume-low-symbolic", medium: "audio-volume-medium-symbolic", high: "audio-volume-high-symbolic", overamplified: "audio-volume-overamplified-symbolic", }, type: { headset: "audio-headphones-symbolic", speaker: "audio-speakers-symbolic", card: "audio-card-symbolic", }, mixer: "mixer-symbolic", }, asusctl: { profile: { Balanced: "power-profile-balanced-symbolic", Quiet: "power-profile-power-saver-symbolic", Performance: "power-profile-performance-symbolic", }, mode: { Integrated: "processor-symbolic", Hybrid: "controller-symbolic", }, }, battery: { charging: "battery-flash-symbolic", warning: "battery-empty-symbolic", }, bluetooth: { enabled: "bluetooth-active-symbolic", disabled: "bluetooth-disabled-symbolic", }, brightness: { indicator: "display-brightness-symbolic", keyboard: "keyboard-brightness-symbolic", screen: "display-brightness-symbolic", }, powermenu: { sleep: "weather-clear-night-symbolic", reboot: "system-reboot-symbolic", logout: "system-log-out-symbolic", shutdown: "system-shutdown-symbolic", }, recorder: { recording: "media-record-symbolic", }, notifications: { noisy: "org.gnome.Settings-notifications-symbolic", silent: "notifications-disabled-symbolic", message: "chat-bubbles-symbolic", }, trash: { full: "user-trash-full-symbolic", empty: "user-trash-symbolic", }, mpris: { shuffle: { enabled: "media-playlist-shuffle-symbolic", disabled: "media-playlist-consecutive-symbolic", }, loop: { none: "media-playlist-repeat-symbolic", track: "media-playlist-repeat-song-symbolic", playlist: "media-playlist-repeat-symbolic", }, playing: "media-playback-pause-symbolic", paused: "media-playback-start-symbolic", stopped: "media-playback-start-symbolic", prev: "media-skip-backward-symbolic", next: "media-skip-forward-symbolic", }, system: { cpu: "org.gnome.SystemMonitor-symbolic", ram: "drive-harddisk-solidstate-symbolic", temp: "temperature-symbolic", }, color: { dark: "dark-mode-symbolic", light: "light-mode-symbolic", }, } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/init.ts ================================================ import css from "style/style" import matugen from "./matugen" import hyprland from "./hyprland" import tmux from "./tmux" import gtk from "./gtk" import lowBattery from "./battery" import swww from "./swww" import notifications from "./notifications" export async function init() { try { gtk() css() tmux() matugen() lowBattery() notifications() hyprland() css() swww() } catch (error) { logError(error) } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/matugen.ts ================================================ import options from "options" import { sh, dependencies } from "./utils" export default function init() { options.wallpaper.connect("changed", () => matugen()) options.autotheme.connect("changed", () => matugen()) } function animate(...setters: Array<() => void>) { const delay = options.transition.value / 2 setters.forEach((fn, i) => Utils.timeout(delay * i, fn)) } export async function matugen( type: "image" | "color" = "image", arg = options.wallpaper.value, ) { if (!options.autotheme.value || !dependencies("matugen")) return const colors = await sh(`matugen --dry-run -j hex ${type} ${arg}`) const c = JSON.parse(colors).colors as { light: Colors, dark: Colors } const { dark, light } = options.theme animate( () => { dark.widget.value = c.dark.on_surface light.widget.value = c.light.on_surface }, () => { dark.border.value = c.dark.outline light.border.value = c.light.outline }, () => { dark.bg.value = c.dark.surface light.bg.value = c.light.surface }, () => { dark.fg.value = c.dark.on_surface light.fg.value = c.light.on_surface }, () => { dark.primary.bg.value = c.dark.primary light.primary.bg.value = c.light.primary options.bar.battery.charging.value = options.theme.scheme.value === "dark" ? c.dark.primary : c.light.primary }, () => { dark.primary.fg.value = c.dark.on_primary light.primary.fg.value = c.light.on_primary }, () => { dark.error.bg.value = c.dark.error light.error.bg.value = c.light.error }, () => { dark.error.fg.value = c.dark.on_error light.error.fg.value = c.light.on_error }, ) } type Colors = { background: string error: string error_container: string inverse_on_surface: string inverse_primary: string inverse_surface: string on_background: string on_error: string on_error_container: string on_primary: string on_primary_container: string on_primary_fixed: string on_primary_fixed_variant: string on_secondary: string on_secondary_container: string on_secondary_fixed: string on_secondary_fixed_variant: string on_surface: string on_surface_variant: string on_tertiary: string on_tertiary_container: string on_tertiary_fixed: string on_tertiary_fixed_variant: string outline: string outline_variant: string primary: string primary_container: string primary_fixed: string primary_fixed_dim: string scrim: string secondary: string secondary_container: string secondary_fixed: string secondary_fixed_dim: string shadow: string surface: string surface_bright: string surface_container: string surface_container_high: string surface_container_highest: string surface_container_low: string surface_container_lowest: string surface_dim: string surface_variant: string tertiary: string tertiary_container: string tertiary_fixed: string tertiary_fixed_dim: string } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/notifications.ts ================================================ import options from "options" const notifs = await Service.import("notifications") // TODO: consider adding this to upstream const { blacklist } = options.notifications export default function init() { const notify = notifs.constructor.prototype.Notify.bind(notifs) notifs.constructor.prototype.Notify = function(appName: string, ...rest: unknown[]) { if (blacklist.value.includes(appName)) return Number.MAX_SAFE_INTEGER return notify(appName, ...rest) } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/option.ts ================================================ import { Variable } from "resource:///com/github/Aylur/ags/variable.js" import { wait } from "./utils" import options from "options" type OptProps = { persistent?: boolean } export class Opt extends Variable { static { Service.register(this) } constructor(initial: T, { persistent = false }: OptProps = {}) { super(initial) this.initial = initial this.persistent = persistent } initial: T id = "" persistent: boolean toString() { return `${this.value}` } toJSON() { return `opt:${this.value}` } init(cacheFile: string) { const cacheV = JSON.parse(Utils.readFile(cacheFile) || "{}")[this.id] if (cacheV !== undefined) this.value = cacheV this.connect("changed", () => { const cache = JSON.parse(Utils.readFile(cacheFile) || "{}") cache[this.id] = this.value Utils.writeFileSync(JSON.stringify(cache, null, 2), cacheFile) }) } reset() { if (this.persistent) return if (JSON.stringify(this.value) !== JSON.stringify(this.initial)) { this.value = this.initial return this.id } } } export const opt = (initial: T, opts?: OptProps) => new Opt(initial, opts) function getOptions(object: object, path = ""): Opt[] { return Object.keys(object).flatMap(key => { const obj: Opt = object[key] const id = path ? path + "." + key : key if (obj instanceof Variable) { obj.id = id return obj } if (typeof obj === "object") return getOptions(obj, id) return [] }) } export function mkOptions(cacheFile: string, object: T) { for (const opt of getOptions(object)) opt.init(cacheFile) const configFile = `${TMP}/config.json` const values = getOptions(object).reduce((obj, { id, value }) => ({ [id]: value, ...obj }), {}) Utils.writeFileSync(JSON.stringify(values, null, 2), configFile) Utils.monitorFile(configFile, () => { const cache = JSON.parse(Utils.readFile(configFile) || "{}") for (const opt of getOptions(object)) { if (JSON.stringify(cache[opt.id]) !== JSON.stringify(opt.value)) opt.value = cache[opt.id] } }) async function reset( [opt, ...list] = getOptions(object), id = opt?.reset(), ): Promise> { if (!opt) return wait(0, () => []) return id ? [id, ...(await wait(50, () => reset(list)))] : await wait(0, () => reset(list)) } return Object.assign(object, { configFile, array: () => getOptions(object), async reset() { return (await reset()).join("\n") }, handler(deps: string[], callback: () => void) { for (const opt of getOptions(options)) { if (deps.some(i => opt.id.startsWith(i))) opt.connect("changed", callback) } }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/session.ts ================================================ import GLib from "gi://GLib?version=2.0" declare global { const OPTIONS: string const TMP: string const USER: string } Object.assign(globalThis, { OPTIONS: `${GLib.get_user_cache_dir()}/ags/options.json`, TMP: `${GLib.get_tmp_dir()}/asztal`, USER: GLib.get_user_name(), }) Utils.ensureDirectory(TMP) App.addIcons(`${App.configDir}/assets`) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/swww.ts ================================================ import options from "options" import { dependencies, sh } from "./utils" // this is where the gtk portal sets the wallpaper const WP = `/home/${Utils.USER}/.config/background` async function wallpaper() { const pos = await sh("hyprctl cursorpos") await sh([ "swww", "img", "--transition-type", "grow", "--transition-pos", pos.replace(" ", ""), options.wallpaper.value, ]) } export default async function init() { if (!dependencies("swww")) return Utils.monitorFile(WP, () => options.wallpaper.setValue(WP)) options.wallpaper.connect("changed", wallpaper) Utils.execAsync("swww init").catch(() => { }) wallpaper() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/tmux.ts ================================================ import options from "options" import { sh } from "./utils" export async function tmux() { const { scheme, dark, light } = options.theme const hex = scheme.value === "dark" ? dark.primary.bg.value : light.primary.bg.value if (await sh("which tmux")) sh(`tmux set @main_accent "${hex}"`) } export default function init() { options.theme.dark.primary.bg.connect("changed", tmux) options.theme.light.primary.bg.connect("changed", tmux) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/utils.ts ================================================ /* eslint-disable @typescript-eslint/no-explicit-any */ import { type Config } from "types/app" import { type Application } from "types/service/applications" import { substitutes } from "./icons" import Gtk from "gi://Gtk?version=3.0" import Gdk from "gi://Gdk" import GLib from "gi://GLib?version=2.0" export function config(config: Config) { return config } /** * @returns substitute icon || name || fallback icon */ export function icon(name: string | null, fallback = name) { if (!name) return fallback || "" if (GLib.file_test(name, GLib.FileTest.EXISTS)) return name const icon = (substitutes[name] || name) if (Utils.lookUpIcon(icon)) return icon print(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`) return fallback } /** * @returns execAsync(["bash", "-c", cmd]) */ export async function bash(strings: TemplateStringsArray | string, ...values: unknown[]) { const cmd = typeof strings === "string" ? strings : strings .flatMap((str, i) => str + `${values[i] ?? ""}`) .join("") return Utils.execAsync(["bash", "-c", cmd]).catch(err => { console.error(cmd, err) return "" }) } /** * @returns execAsync(cmd) */ export async function sh(cmd: string | string[]) { return Utils.execAsync(cmd).catch(err => { console.error(typeof cmd === "string" ? cmd : cmd.join(" "), err) return "" }) } export function forMonitors(widget: (monitor: number) => Gtk.Window) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1 return range(n, 0).map(widget).flat(1) } /** * @returns [start...length] */ export function range(length: number, start = 1) { return Array.from({ length }, (_, i) => i + start) } /** * promisified timeout */ export function wait(ms: number, callback: () => T): Promise { return new Promise(resolve => Utils.timeout(ms, () => { resolve(callback()) })) } /** * @returns true if all of the `bins` are found */ export function dependencies(...bins: string[]) { const missing = bins.filter(bin => { return !Utils.exec(`which ${bin}`) }) if (missing.length > 0) console.warn("missing dependencies:", missing.join(", ")) return missing.length === 0 } /** * run app detached */ export function launchApp(app: Application) { const exe = app.executable .split(/\s+/) .filter(str => !str.startsWith("%") && !str.startsWith("@")) .join(" ") bash(`${exe} &`) app.frequency += 1 } /** * to use with drag and drop */ export function createSurfaceFromWidget(widget: Gtk.Widget) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const cairo = imports.gi.cairo as any const alloc = widget.get_allocation() const surface = new cairo.ImageSurface( cairo.Format.ARGB32, alloc.width, alloc.height, ) const cr = new cairo.Context(surface) cr.setSourceRGBA(255, 255, 255, 0) cr.rectangle(0, 0, alloc.width, alloc.height) cr.fill() widget.draw(cr) return surface } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/lib/variables.ts ================================================ import GLib from "gi://GLib" // import options from "options" // // const intval = options.system.fetchInterval.value // const tempPath = options.system.temperature.value export const clock = Variable(GLib.DateTime.new_now_local(), { poll: [1000, () => GLib.DateTime.new_now_local()], }) export const uptime = Variable(0, { poll: [60_000, "cat /proc/uptime", line => Number.parseInt(line.split(".")[0]) / 60, ], }) // export const distro = GLib.get_os_info("ID") // const divide = ([total, free]: string[]) => Number.parseInt(free) / Number.parseInt(total) // // export const cpu = Variable(0, { // poll: [intval, "top -b -n 1", out => divide(["100", out.split("\n") // .find(line => line.includes("Cpu(s)")) // ?.split(/\s+/)[1] // .replace(",", ".") || "0"])], // }) // // export const ram = Variable(0, { // poll: [intval, "free", out => divide(out.split("\n") // .find(line => line.includes("Mem:")) // ?.split(/\s+/) // .splice(1, 2) || ["1", "1"])], // }) // // export const temperature = Variable(0, { // poll: [intval, `cat ${tempPath}`, n => { // return Number.parseInt(n) / 100_000 // }], // }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/main.ts ================================================ import "lib/session" import "lib/init" import options from "options" import Bar from "widget/bar/Bar" import Applauncher from "widget/applauncher/Applauncher" import Overview from "widget/overview/Overview" import PowerMenu from "widget/powermenu/PowerMenu" import Verification from "widget/powermenu/Verification" import NotificationPopups from "widget/notifications/NotificationPopups" import ScreenCorners from "widget/bar/ScreenCorners" import OSD from "widget/osd/OSD" import SettingsDialog from "widget/settings/SettingsDialog" import { config, forMonitors } from "lib/utils" import { setupQuickSettings } from "widget/quicksettings/QuickSettings" import { setupDateMenu } from "widget/datemenu/DateMenu" import { init } from "lib/init" export default config({ onConfigParsed: () => { setupQuickSettings() setupDateMenu() init() }, closeWindowDelay: { "applauncher": options.transition.value, "overview": options.transition.value, "quicksettings": options.transition.value, "datemenu": options.transition.value, }, windows: [ ...forMonitors(Bar), ...forMonitors(NotificationPopups), ...forMonitors(ScreenCorners), ...forMonitors(OSD), Applauncher(), Overview(), PowerMenu(), Verification(), SettingsDialog(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/options.ts ================================================ import { type BarWidget } from "widget/bar/Bar" import { opt, mkOptions } from "lib/option" const options = mkOptions(OPTIONS, { autotheme: opt(false), wallpaper: opt(`/home/${USER}/.config/background`, { persistent: true }), theme: { dark: { primary: { bg: opt("#51a4e7"), fg: opt("#141414"), }, error: { bg: opt("#e55f86"), fg: opt("#141414"), }, bg: opt("#171717"), fg: opt("#eeeeee"), widget: opt("#eeeeee"), border: opt("#eeeeee"), }, light: { primary: { bg: opt("#426ede"), fg: opt("#eeeeee"), }, error: { bg: opt("#b13558"), fg: opt("#eeeeee"), }, bg: opt("#fffffa"), fg: opt("#080808"), widget: opt("#080808"), border: opt("#080808"), }, blur: opt(0), scheme: opt<"dark" | "light">("dark"), widget: { opacity: opt(94) }, border: { width: opt(0), opacity: opt(96), }, shadows: opt(true), padding: opt(7), spacing: opt(5), radius: opt(15), }, transition: opt(200), font: { size: opt(13), name: opt("Ubuntu Nerd Font"), }, bar: { flatButtons: opt(true), position: opt<"top" | "bottom">("top"), corners: opt(false), layout: { start: opt([ "launcher", "workspaces", //"taskbar", "expander", //"messages", ]), center: opt([ "date", ]), end: opt([ //"media", "expander", "systray", "colorpicker", "screenrecord", "battery", "system", "powermenu", ]), }, launcher: { icon: { colored: opt(true), icon: opt("nixos"), }, label: { colored: opt(false), label: opt(" Applications"), }, action: opt(() => App.toggleWindow("applauncher")), }, date: { format: opt("%d.%m.%y - %H:%M"), action: opt(() => App.toggleWindow("datemenu")), }, battery: { bar: opt<"hidden" | "regular" | "whole">("hidden"), charging: opt("#00D787"), percentage: opt(true), blocks: opt(7), width: opt(50), low: opt(30), }, workspaces: { workspaces: opt(10), }, taskbar: { monochrome: opt(true), exclusive: opt(false), }, messages: { action: opt(() => App.toggleWindow("datemenu")), }, systray: { ignore: opt([ "KDE Connect Indicator", "spotify-client", ]), }, media: { monochrome: opt(true), preferred: opt("spotify"), direction: opt<"left" | "right">("right"), length: opt(40), }, powermenu: { monochrome: opt(false), action: opt(() => App.toggleWindow("powermenu")), }, }, applauncher: { iconSize: opt(62), width: opt(0), margin: opt(80), maxItem: opt(10), favorites: opt([ [ "firefox", "org.gnome.Nautilus", "obsidian", "spotify", "kitty" ], [ "betaflight-configurator", "org.gnome.Calendar", "discord", "neovide", "gimp", ], ]), }, overview: { scale: opt(9), workspaces: opt(10), monochromeIcon: opt(true), }, powermenu: { sleep: opt("systemctl suspend"), reboot: opt("systemctl reboot"), logout: opt("pkill Hyprland"), shutdown: opt("shutdown now"), layout: opt<"line" | "box">("line"), labels: opt(true), }, quicksettings: { avatar: { image: opt(`/var/lib/AccountsService/icons/${Utils.USER}`), size: opt(70), }, width: opt(380), position: opt<"left" | "center" | "right">("right"), networkSettings: opt("gtk-launch gnome-control-center"), media: { monochromeIcon: opt(true), coverSize: opt(100), }, }, datemenu: { position: opt<"left" | "center" | "right">("center"), }, osd: { progress: { vertical: opt(true), pack: { h: opt<"start" | "center" | "end">("end"), v: opt<"start" | "center" | "end">("center"), }, }, microphone: { pack: { h: opt<"start" | "center" | "end">("center"), v: opt<"start" | "center" | "end">("end"), }, }, }, notifications: { position: opt>(["top", "right"]), blacklist: opt(["Spotify"]), width: opt(440), }, hyprland: { gaps: opt(2.4), inactiveBorder: opt("333333ff"), }, }) globalThis["options"] = options export default options ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/package.json ================================================ { "name": "ags-dotfiles", "author": "Aylur", "kofi": "https://ko-fi.com/aylur", "repository": { "type": "git", "url": "git+https://github.com/Aylur/dotfiles.git" }, "devDependencies": { "@girs/accountsservice-1.0": "^1.0.0-3.2.7", "@typescript-eslint/eslint-plugin": "^6.20.0", "eslint": "^8.56.0", "eslint-config-standard-with-typescript": "^43.0.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", "typescript": "^5.3.3" } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/service/asusctl.ts ================================================ import { sh } from "lib/utils" type Profile = "Performance" | "Balanced" | "Quiet" type Mode = "Hybrid" | "Integrated" class Asusctl extends Service { static { Service.register(this, {}, { "profile": ["string", "r"], "mode": ["string", "r"], }) } available = !!Utils.exec("which asusctl") #profile: Profile = "Balanced" #mode: Mode = "Hybrid" async nextProfile() { await sh("asusctl profile -n") const profile = await sh("asusctl profile -p") const p = profile.split(" ")[3] as Profile this.#profile = p this.changed("profile") } async setProfile(prof: Profile) { await sh(`asusctl profile --profile-set ${prof}`) this.#profile = prof this.changed("profile") } async nextMode() { await sh(`supergfxctl -m ${this.#mode === "Hybrid" ? "Integrated" : "Hybrid"}`) this.#mode = await sh("supergfxctl -g") as Mode this.changed("profile") } constructor() { super() if (this.available) { sh("asusctl profile -p").then(p => this.#profile = p.split(" ")[3] as Profile) sh("supergfxctl -g").then(m => this.#mode = m as Mode) } } get profiles(): Profile[] { return ["Performance", "Balanced", "Quiet"] } get profile() { return this.#profile } get mode() { return this.#mode } } export default new Asusctl() ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/service/brightness.ts ================================================ import { bash, dependencies, sh } from "lib/utils" if (!dependencies("brightnessctl")) App.quit() const get = (args: string) => Number(Utils.exec(`brightnessctl ${args}`)) const screen = await bash`ls -w1 /sys/class/backlight | head -1` const kbd = await bash`ls -w1 /sys/class/leds | head -1` class Brightness extends Service { static { Service.register(this, {}, { "screen": ["float", "rw"], "kbd": ["int", "rw"], }) } #kbdMax = get(`--device ${kbd} max`) #kbd = get(`--device ${kbd} get`) #screenMax = get("max") #screen = get("get") / get("max") get kbd() { return this.#kbd } get screen() { return this.#screen } set kbd(value) { if (value < 0 || value > this.#kbdMax) return sh(`brightnessctl -d ${kbd} s ${value} -q`).then(() => { this.#kbd = value this.changed("kbd") }) } set screen(percent) { if (percent < 0) percent = 0 if (percent > 1) percent = 1 sh(`brightnessctl set ${Math.floor(percent * 100)}% -q`).then(() => { this.#screen = percent this.changed("screen") }) } constructor() { super() const screenPath = `/sys/class/backlight/${screen}/brightness` const kbdPath = `/sys/class/leds/${kbd}/brightness` Utils.monitorFile(screenPath, async f => { const v = await Utils.readFileAsync(f) this.#screen = Number(v) / this.#screenMax this.changed("screen") }) Utils.monitorFile(kbdPath, async f => { const v = await Utils.readFileAsync(f) this.#kbd = Number(v) / this.#kbdMax this.changed("kbd") }) } } export default new Brightness() ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/service/colorpicker.ts ================================================ import icons from "lib/icons" import { bash, dependencies } from "lib/utils" const COLORS_CACHE = Utils.CACHE_DIR + "/colorpicker.json" const MAX_NUM_COLORS = 10 class ColorPicker extends Service { static { Service.register(this, {}, { "colors": ["jsobject"], }) } notifID = 0 #colors = JSON.parse(Utils.readFile(COLORS_CACHE) || "[]") as string[] get colors() { return [...this.#colors] } set colors(colors) { this.#colors = colors this.changed("colors") } // TODO: doesn't work? async wlCopy(color: string) { if (dependencies("wl-copy")) bash(`wl-copy ${color}`) } async pick() { if (!dependencies("hyprpicker")) return const color = await bash("hyprpicker -a -r") if (!color) return colorpicker.wlCopy(color) const list = colorpicker.colors if (!list.includes(color)) { list.push(color) if (list.length > MAX_NUM_COLORS) list.shift() colorpicker.colors = list Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE) } colorpicker.notifID = await Utils.notify({ id: colorpicker.notifID, iconName: icons.ui.colorpicker, summary: color, }) } } const colorpicker = new ColorPicker export default colorpicker ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/service/powermenu.ts ================================================ import options from "options" const { sleep, reboot, logout, shutdown } = options.powermenu export type Action = "sleep" | "reboot" | "logout" | "shutdown" class PowerMenu extends Service { static { Service.register(this, {}, { "title": ["string"], "cmd": ["string"], }) } #title = "" #cmd = "" get title() { return this.#title } get cmd() { return this.#cmd } action(action: Action) { [this.#cmd, this.#title] = { sleep: [sleep.value, "Sleep"], reboot: [reboot.value, "Reboot"], logout: [logout.value, "Log Out"], shutdown: [shutdown.value, "Shutdown"], }[action] this.notify("cmd") this.notify("title") this.emit("changed") App.closeWindow("powermenu") App.openWindow("verification") } readonly shutdown = () => { this.action("shutdown") } } const powermenu = new PowerMenu globalThis["powermenu"] = powermenu export default powermenu ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/service/screenrecord.ts ================================================ import GLib from "gi://GLib" import icons from "lib/icons" import { dependencies, sh, bash } from "lib/utils" const now = () => GLib.DateTime.new_now_local().format("%Y-%m-%d_%H-%M-%S") class Recorder extends Service { static { Service.register(this, {}, { "timer": ["int"], "recording": ["boolean"], }) } #recordings = Utils.HOME + "/Videos/Screencasting" #screenshots = Utils.HOME + "/Pictures/Screenshots" #file = "" #interval = 0 recording = false timer = 0 async start() { if (!dependencies("slurp", "wf-recorder")) return if (this.recording) return Utils.ensureDirectory(this.#recordings) this.#file = `${this.#recordings}/${now()}.mp4` sh(`wf-recorder -g ${await sh("slurp")} -f ${this.#file} --pixel-format yuv420p`) this.recording = true this.changed("recording") this.timer = 0 this.#interval = Utils.interval(1000, () => { this.changed("timer") this.timer++ }) } async stop() { if (!this.recording) return await bash("killall -INT wf-recorder") this.recording = false this.changed("recording") GLib.source_remove(this.#interval) Utils.notify({ iconName: icons.fallback.video, summary: "Screenrecord", body: this.#file, actions: { "Show in Files": () => sh(`xdg-open ${this.#recordings}`), "View": () => sh(`xdg-open ${this.#file}`), }, }) } async screenshot(full = false) { if (!dependencies("slurp", "wayshot")) return const file = `${this.#screenshots}/${now()}.png` Utils.ensureDirectory(this.#screenshots) const wayshot = `wayshot -f ${file} ${full ? "" : `-s "${await sh("slurp")}"`}` await sh(wayshot) bash(`wl-copy < ${file}`) Utils.notify({ image: file, summary: "Screenshot", body: this.#file, actions: { "Show in Files": () => sh(`xdg-open ${this.#screenshots}`), "View": () => sh(`xdg-open ${file}`), "Edit": () => { if (dependencies("swappy")) sh(`swappy, -f ${file}`) }, }, }) } } const recorder = new Recorder globalThis["recorder"] = recorder export default recorder ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/extra.scss ================================================ @import './mixins/button.scss'; * { font-size: $font-size; font-family: $font-name; } separator { &.horizontal { min-height: $border-width; } &.vertical { min-width: $border-width; } } window.popup { >* { border: none; box-shadow: none; } menu { border-radius: $popover-radius; background-color: $bg; padding: $popover-padding; border: $border-width solid $popover-border-color; separator { background-color: $border-color; } menuitem { @include button; padding: $spacing * .5; margin: ($spacing * .5) 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } tooltip { * { all: unset; } background-color: transparent; border: none; >*>* { background-color: $bg; border-radius: $radius; border: $border-width solid $popover-border-color; color: $fg; padding: 8px; margin: 4px; box-shadow: 0 0 3px 0 $shadow-color; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/a11y-button.scss ================================================ @import './button'; @mixin accs-button($flat: false, $reactive: true) { @include unset; color: $fg; >* { border-radius: $radius; transition: $transition; @if $flat { background-color: transparent; box-shadow: none; } @else { background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } } @if $reactive { &:focus>*, &.focused>* { @include button-focus; } &:hover>* { @include button-hover; } &:active, &.active, &.on, &:checked { >* { @include button-active; } &:hover>* { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover-bg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/button.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $primary-bg; background-color: $hover-bg; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $hover-bg; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $primary-bg; color: $primary-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg, 0.7); } @mixin button($flat: false, $reactive: true, $radius: $radius, $focusable: true) { all: unset; transition: $transition; border-radius: $radius; color: $fg; @if $flat { background-color: transparent; background-image: none; box-shadow: none; } @else { background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive { @if $focusable { &:focus { @include button-focus; } } &:hover { @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover-bg; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/floating-widget.scss ================================================ @mixin floating-widget { @if $shadows { box-shadow: 0 0 5px 0 $shadow-color; } margin: max($spacing, 8px); border: $border-width solid $popover-border-color; background-color: $bg; color: $fg; border-radius: $popover-radius; padding: $popover-padding; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/hidden.scss ================================================ @mixin hidden { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); * { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/media.scss ================================================ @mixin media() { @include widget; padding: $padding; .cover { @if $shadows { box-shadow: 2px 2px 2px 0 $shadow-color; } background-size: cover; background-position: center; border-radius: $radius*0.8; margin-right: $spacing; } button { @include button($flat: true); padding: $padding * .5; &.play-pause { margin: 0 ($spacing * .5); } image { font-size: 1.2em; } } .artist { color: transparentize($fg, .2); font-size: .9em; } scale { @include slider($width: .5em, $slider: false, $gradient: linear-gradient($fg, $fg)); margin-bottom: $padding * .5; trough { border: none; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/scrollable.scss ================================================ @mixin scrollable { scrollbar, scrollbar * { all: unset; } scrollbar.vertical { transition: $transition; background-color: transparentize($bg, 0.7); &:hover { background-color: transparentize($bg, 0.3); slider { background-color: transparentize($fg, 0.3); min-width: .6em; } } } scrollbar.vertical slider { background-color: transparentize($fg, 0.5); border-radius: $radius; min-width: .4em; min-height: 2em; transition: $transition; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/slider.scss ================================================ @import './unset'; @mixin slider($width: 0.7em, $slider-width: .5em, $gradient: $active-gradient, $slider: true, $focusable: true, $radius: $radius) { @include unset($rec: true); trough { transition: $transition; border-radius: $radius; border: $border; background-color: $widget-bg; min-height: $width; min-width: $width; highlight, progress { border-radius: max($radius - $border-width, 0); background-image: $gradient; min-height: $width; min-width: $width; } } slider { box-shadow: none; background-color: transparent; border: $border-width solid transparent; transition: $transition; border-radius: $radius; min-height: $width; min-width: $width; margin: -$slider-width; } &:hover { trough { background-color: $hover-bg; } slider { @if $slider { background-color: $fg; border-color: $border-color; @if $shadows { box-shadow: 0 0 3px 0 $shadow-color; } } } } &:disabled { highlight, progress { background-color: transparentize($fg, 0.4); background-image: none; } } @if $focusable { trough:focus { background-color: $hover-bg; box-shadow: inset 0 0 0 $border-width $primary-bg; slider { @if $slider { background-color: $fg; box-shadow: inset 0 0 0 $border-width $primary-bg; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/spacing.scss ================================================ @mixin spacing($multiplier: 1, $spacing: $spacing, $rec: false) { &.horizontal > * { margin: 0 calc($spacing * $multiplier / 2); &:first-child { margin-left: 0; } &:last-child { margin-right: 0; margin-left: 0; } } &.vertical > * { margin: calc($spacing * $multiplier / 2) 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } @if $rec { box { &.horizontal > * { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical > * { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/switch.scss ================================================ @import './button'; @mixin switch { @include button; slider { background-color: $primary-fg; border-radius: $radius; min-width: 24px; min-height: 24px; } image { color: transparent; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/unset.scss ================================================ @mixin unset($rec: false) { all: unset; @if $rec { * { all: unset } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/mixins/widget.scss ================================================ @mixin widget { transition: $transition; border-radius: $radius; color: $fg; background-color: $widget-bg; border: $border; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/style/style.ts ================================================ /* eslint-disable max-len */ import { type Opt } from "lib/option" import options from "options" import { bash, dependencies, sh } from "lib/utils" const deps = [ "font", "theme", "bar.flatButtons", "bar.position", "bar.battery.charging", "bar.battery.blocks", ] const { dark, light, blur, scheme, padding, spacing, radius, shadows, widget, border, } = options.theme const popoverPaddingMultiplier = 1.6 // eslint-disable-next-line @typescript-eslint/no-explicit-any const t = (dark: Opt | string, light: Opt | string) => scheme.value === "dark" ? `${dark}` : `${light}` // eslint-disable-next-line @typescript-eslint/no-explicit-any const $ = (name: string, value: string | Opt) => `$${name}: ${value};` const variables = () => [ $("bg", blur.value ? `transparentize(${t(dark.bg, light.bg)}, ${blur.value / 100})` : t(dark.bg, light.bg)), $("fg", t(dark.fg, light.fg)), $("primary-bg", t(dark.primary.bg, light.primary.bg)), $("primary-fg", t(dark.primary.fg, light.primary.fg)), $("error-bg", t(dark.error.bg, light.error.bg)), $("error-fg", t(dark.error.fg, light.error.fg)), $("scheme", scheme), $("padding", `${padding}pt`), $("spacing", `${spacing}pt`), $("radius", `${radius}px`), $("transition", `${options.transition}ms`), $("shadows", `${shadows}`), $("widget-bg", `transparentize(${t(dark.widget, light.widget)}, ${widget.opacity.value / 100})`), $("hover-bg", `transparentize(${t(dark.widget, light.widget)}, ${(widget.opacity.value * .9) / 100})`), $("hover-fg", `lighten(${t(dark.fg, light.fg)}, 8%)`), $("border-width", `${border.width}px`), $("border-color", `transparentize(${t(dark.border, light.border)}, ${border.opacity.value / 100})`), $("border", "$border-width solid $border-color"), $("active-gradient", `linear-gradient(to right, ${t(dark.primary.bg, light.primary.bg)}, darken(${t(dark.primary.bg, light.primary.bg)}, 4%))`), $("shadow-color", t("rgba(0,0,0,.6)", "rgba(0,0,0,.4)")), $("text-shadow", t("2pt 2pt 2pt $shadow-color", "none")), $("popover-border-color", `transparentize(${t(dark.border, light.border)}, ${Math.max(((border.opacity.value - 1) / 100), 0)})`), $("popover-padding", `$padding * ${popoverPaddingMultiplier}`), $("popover-radius", radius.value === 0 ? "0" : "$radius + $popover-padding"), $("font-size", `${options.font.size}pt`), $("font-name", options.font.name), // etc $("charging-bg", options.bar.battery.charging), $("bar-battery-blocks", options.bar.battery.blocks), $("bar-position", options.bar.position), $("hyprland-gaps-multiplier", options.hyprland.gaps), ] async function resetCss() { if (!dependencies("sass", "fd")) return try { const vars = `${TMP}/variables.scss` await Utils.writeFile(variables().join("\n"), vars) const fd = await sh(`fd ".scss" ${App.configDir}`) const files = fd.split(/\s+/).map(f => `@import '${f}';`) const scss = [`@import '${vars}';`, ...files].join("\n") const css = await bash`echo "${scss}" | sass --stdin` const file = `${TMP}/style.css` await Utils.writeFile(css, file) App.resetCss() App.applyCss(file) } catch (error) { logError(error) } } export default function init() { Utils.monitorFile(App.configDir, resetCss) options.handler(deps, resetCss) resetCss() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2022", "module": "ES2022", "lib": [ "ES2022" ], "allowJs": true, "checkJs": true, "strict": true, "noImplicitAny": false, "baseUrl": ".", "typeRoots": [ "./types", "./node_modules/@girs" ], "skipLibCheck": true } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/PopupWindow.ts ================================================ import { type WindowProps } from "types/widgets/window" import { type RevealerProps } from "types/widgets/revealer" import { type EventBoxProps } from "types/widgets/eventbox" import type Gtk from "gi://Gtk?version=3.0" import options from "options" type Transition = RevealerProps["transition"] type Child = WindowProps["child"] type PopupWindowProps = Omit & { name: string layout?: keyof ReturnType transition?: Transition, } export const Padding = (name: string, { css = "", hexpand = true, vexpand = true, }: EventBoxProps = {}) => Widget.EventBox({ hexpand, vexpand, can_focus: false, child: Widget.Box({ css }), setup: w => w.on("button-press-event", () => App.toggleWindow(name)), }) const PopupRevealer = ( name: string, child: Child, transition: Transition = "slide_down", ) => Widget.Box( { css: "padding: 1px;" }, Widget.Revealer({ transition, child: Widget.Box({ class_name: "window-content", child, }), transitionDuration: options.transition.bind(), setup: self => self.hook(App, (_, wname, visible) => { if (wname === name) self.reveal_child = visible }), }), ) const Layout = (name: string, child: Child, transition?: Transition) => ({ "center": () => Widget.CenterBox({}, Padding(name), Widget.CenterBox( { vertical: true }, Padding(name), PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top": () => Widget.CenterBox({}, Padding(name), Widget.Box( { vertical: true }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top-right": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), ), "top-center": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top-left": () => Widget.Box({}, Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "bottom-left": () => Widget.Box({}, Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), Padding(name), ), "bottom-center": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), Padding(name), ), "bottom-right": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), ), }) export default ({ name, child, layout = "center", transition, exclusivity = "ignore", ...props }: PopupWindowProps) => Widget.Window({ name, class_names: [name, "popup-window"], setup: w => w.keybind("Escape", () => App.closeWindow(name)), visible: false, keymode: "on-demand", exclusivity, layer: "top", anchor: ["top", "bottom", "right", "left"], child: Layout(name, child, transition)[layout](), ...props, }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/RegularWindow.ts ================================================ import Gtk from "gi://Gtk?version=3.0" export default Widget.subclass(Gtk.Window) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/applauncher/AppItem.ts ================================================ import { type Application } from "types/service/applications" import options from "options" import { launchApp, icon } from "lib/utils" import icons from "lib/icons" const { iconSize } = options.applauncher export const QuickButton = (app: Application) => Widget.Button({ hexpand: true, tooltip_text: app.name, on_clicked: () => { App.closeWindow("applauncher") launchApp(app) }, child: Widget.Icon({ size: iconSize.bind(), icon: icon(app.icon_name, icons.fallback.executable), }), }) export const AppItem = (app: Application) => { const title = Widget.Label({ class_name: "title", label: app.name, hexpand: true, xalign: 0, vpack: "center", truncate: "end", }) const description = Widget.Label({ class_name: "description", label: app.description || "", hexpand: true, wrap: true, max_width_chars: 30, xalign: 0, justification: "left", vpack: "center", }) const appicon = Widget.Icon({ icon: icon(app.icon_name, icons.fallback.executable), size: iconSize.bind(), }) const textBox = Widget.Box({ vertical: true, vpack: "center", children: app.description ? [title, description] : [title], }) return Widget.Button({ class_name: "app-item", attribute: { app }, child: Widget.Box({ children: [appicon, textBox], }), on_clicked: () => { App.closeWindow("applauncher") launchApp(app) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/applauncher/Applauncher.ts ================================================ import PopupWindow, { Padding } from "widget/PopupWindow" import { AppItem, QuickButton } from "./AppItem" import icons from "lib/icons" import options from "options" import type Gtk from "gi://Gtk?version=3.0" import { launchApp } from "lib/utils" const apps = await Service.import("applications") const { query } = apps const { width, margin, maxItem, favorites } = options.applauncher const SeparatedAppItem = (app: Parameters[0]) => Widget.Revealer( { attribute: { app } }, Widget.Box( { vertical: true }, Widget.Separator(), AppItem(app), ), ) const Applauncher = () => { const applist = Variable(query("")) let first = applist.value[0] const list = Widget.Box({ vertical: true, children: applist.bind().as(list => list.map(SeparatedAppItem)), }) list.hook(apps, () => applist.value = query(""), "notify::frequents") const entry = Widget.Entry({ hexpand: true, primary_icon_name: icons.ui.search, on_accept: () => { entry.text !== "" && launchApp(first) App.toggleWindow("applauncher") }, on_change: ({ text }) => { first = query(text || "")[0] list.children.reduce((i, item) => { if (!text || i >= maxItem.value) { item.reveal_child = false return i } if (item.attribute.app.match(text)) { item.reveal_child = true return ++i } item.reveal_child = false return i }, 0) }, }) const quicklaunch = Widget.Revealer({ setup: self => self.hook(entry, () => self.reveal_child = !entry.text, "notify::text"), visible: favorites.bind().as(f => f.length > 0), child: Widget.Box({ vertical: true, children: favorites.bind().as(favs => favs.flatMap(fs => [ Widget.Separator(), Widget.Box({ class_name: "quicklaunch horizontal", children: fs .map(f => query(f)?.[0]) .filter(f => f) .map(QuickButton), }), ])), }), }) function focus() { entry.text = "Search" entry.set_position(-1) entry.select_region(0, -1) entry.grab_focus() quicklaunch.reveal_child = true } const layout = Widget.Box({ css: width.bind().as(v => `min-width: ${v}pt;`), class_name: "applauncher", vertical: true, vpack: "start", setup: self => self.hook(App, (_, win, visible) => { if (win !== "applauncher") return entry.text = "" if (visible) focus() }), children: [ entry, quicklaunch, list, ], }) return Widget.Box( { vertical: true, css: "padding: 1px" }, Padding("applauncher", { css: margin.bind().as(v => `min-height: ${v}pt;`), vexpand: false, }), layout, ) } export default () => PopupWindow({ name: "applauncher", layout: "top", child: Applauncher(), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/applauncher/applauncher.scss ================================================ @use "sass:math"; @use "sass:color"; window#applauncher .applauncher { @include floating_widget; .quicklaunch { @include spacing; button { @include button($flat: true); padding: $padding; } } entry { @include button; padding: $padding; margin: $spacing; selection { color: color.mix($fg, $bg, 50%); background-color: transparent; } label, image { color: $fg; } } separator { margin: 4pt 0; background-color: $popover-border-color; } button.app-item { @include button($flat: true, $reactive: false); >box { @include spacing(0.5); } transition: $transition; padding: $padding; label { transition: $transition; &.title { color: $fg; } &.description { color: transparentize($fg, 0.3); } } image { transition: $transition; } &:hover, &:focus { .title { color: $primary-bg; } .description { color: transparentize($primary-bg, .4); } image { -gtk-icon-shadow: 2px 2px $primary-bg; } } &:active { background-color: transparentize($primary-bg, 0.5); border-radius: $radius; box-shadow: inset 0 0 0 $border-width $border-color; .title { color: $fg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/Bar.ts ================================================ import BatteryBar from "./buttons/BatteryBar" import ColorPicker from "./buttons/ColorPicker" import Date from "./buttons/Date" import Launcher from "./buttons/Launcher" import Media from "./buttons/Media" import PowerMenu from "./buttons/PowerMenu" import SysTray from "./buttons/SysTray" import SystemIndicators from "./buttons/SystemIndicators" import Taskbar from "./buttons/Taskbar" import Workspaces from "./buttons/Workspaces" import ScreenRecord from "./buttons/ScreenRecord" import Messages from "./buttons/Messages" import options from "options" const { start, center, end } = options.bar.layout const pos = options.bar.position.bind() export type BarWidget = keyof typeof widget const widget = { battery: BatteryBar, colorpicker: ColorPicker, date: Date, launcher: Launcher, media: Media, powermenu: PowerMenu, systray: SysTray, system: SystemIndicators, taskbar: Taskbar, workspaces: Workspaces, screenrecord: ScreenRecord, messages: Messages, expander: () => Widget.Box({ expand: true }), } export default (monitor: number) => Widget.Window({ monitor, class_name: "bar", name: `bar${monitor}`, exclusivity: "exclusive", anchor: pos.as(pos => [pos, "right", "left"]), child: Widget.CenterBox({ css: "min-width: 2px; min-height: 2px;", startWidget: Widget.Box({ hexpand: true, children: start.bind().as(s => s.map(w => widget[w]())), }), centerWidget: Widget.Box({ hpack: "center", children: center.bind().as(c => c.map(w => widget[w]())), }), endWidget: Widget.Box({ hexpand: true, children: end.bind().as(e => e.map(w => widget[w]())), }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/PanelButton.ts ================================================ import options from "options" import { ButtonProps } from "types/widgets/button" type PanelButtonProps = ButtonProps & { window?: string, flat?: boolean } export default ({ window = "", flat, child, setup, ...rest }: PanelButtonProps) => Widget.Button({ child: Widget.Box({ child }), setup: self => { let open = false self.toggleClassName("panel-button") self.toggleClassName(window) self.hook(options.bar.flatButtons, () => { self.toggleClassName("flat", flat ?? options.bar.flatButtons.value) }) self.hook(App, (_, win, visible) => { if (win !== window) return if (open && !visible) { open = false self.toggleClassName("active", false) } if (visible) { open = true self.toggleClassName("active") } }) if (setup) setup(self) }, ...rest, }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/ScreenCorners.ts ================================================ import options from "options" const { corners } = options.bar export default (monitor: number) => Widget.Window({ monitor, name: `corner${monitor}`, class_name: "screen-corner", anchor: ["top", "bottom", "right", "left"], click_through: true, child: Widget.Box({ class_name: "shadow", child: Widget.Box({ class_name: "border", expand: true, child: Widget.Box({ class_name: "corner", expand: true, }), }), }), setup: self => self.hook(corners, () => { self.toggleClassName("corners", corners.value) }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/bar.scss ================================================ @use "sass:color"; $bar-spacing: $spacing * 0.3; $button-radius: $radius; @mixin panel-button($flat: true, $reactive: true) { @include accs-button($flat, $reactive); > * { border-radius: $button-radius; margin: $bar-spacing; } label, image { font-weight: bold; } > * { padding: $padding * 0.4 $padding * 0.8; } } .bar { background-color: $bg; .panel-button { @include panel-button; &:not(.flat) { @include accs-button($flat: false); } } .launcher { .colored { color: transparentize($primary-bg, 0.2); } &:hover .colored { color: $primary-bg; } &:active .colored, &.active .colored { color: $primary-fg; } } .workspaces { label { font-size: 0; min-width: 12pt; min-height: 12pt; border-radius: $radius * 0.6; box-shadow: inset 0 0 0 $border-width $border-color; margin: 0 $padding * 0.5; transition: $transition * 0.5; background-color: transparentize($fg, 0.8); &.occupied { background-color: transparentize($fg, 0.2); min-width: 12pt; min-height: 12pt; } &.active { // background-color: $primary-bg; background-image: $active-gradient; min-width: 25pt; min-height: 12pt; } } &.active, &:active { label { background-color: transparentize($primary-fg, 0.3); &.occupied { background-color: transparentize($primary-fg, 0.15); } &.active { background-color: $primary-fg; } } } } .media label { margin: 0 ($spacing * 0.5); } .taskbar .indicator.active { background-color: $primary-bg; border-radius: $radius; min-height: 4pt; min-width: 6pt; margin: 2pt; } .powermenu.colored, .recorder { image { color: transparentize($error-bg, 0.3); } &:hover image { color: transparentize($error-bg, 0.15); } &:active image { color: $primary-fg; } } .quicksettings > box > box { @include spacing( $spacing: if($bar-spacing==0, $padding / 2, $bar-spacing * 7) ); } .quicksettings:not(.active):not(:active) { .bluetooth { color: $primary-bg; label { font-size: $font-size * 0.7; color: $fg; text-shadow: $text-shadow; clicked { font-size: $font-size * 0.7; } } } } .battery-bar { > * { padding: 0; } &.bar-hidden > box { padding: 0 $spacing * 0.5; image { margin: 0; } } levelbar * { all: unset; transition: $transition; } .whole { @if $shadows { image { -gtk-icon-shadow: $text-shadow; } label { text-shadow: $text-shadow; } } } .regular image { margin-left: $spacing * 0.5; } trough { @include widget; min-height: 12pt; min-width: 12pt; } .regular trough { margin-right: $spacing * 0.5; } block { margin: 0; &:last-child { border-radius: 0 $button-radius $button-radius 0; } &:first-child { border-radius: $button-radius 0 0 $button-radius; } } .vertical { block { &:last-child { border-radius: 0 0 $button-radius $button-radius; } &:first-child { border-radius: $button-radius $button-radius 0 0; } } } @for $i from 1 through $bar-battery-blocks { block:nth-child(#{$i}).filled { background-color: color.mix($bg, $primary-bg, $i * 3); } &.low block:nth-child(#{$i}).filled { background-color: color.mix($bg, $error-bg, $i * 3); } &.charging block:nth-child(#{$i}).filled { background-color: color.mix($bg, $charging-bg, $i * 3); } &:active .regular block:nth-child(#{$i}).filled { background-color: color.mix($bg, $primary-fg, $i * 3); } } &.low image { color: $error-bg; } &.charging image { color: $charging-bg; } &:active image { color: $primary-fg; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/BatteryBar.ts ================================================ import icons from "lib/icons" import options from "options" import PanelButton from "../PanelButton" const battery = await Service.import("battery") const { bar, percentage, blocks, width, low } = options.bar.battery const Indicator = () => Widget.Icon({ setup: self => self.hook(battery, () => { self.icon = battery.charging || battery.charged ? icons.battery.charging : battery.icon_name }), }) const PercentLabel = () => Widget.Revealer({ transition: "slide_right", click_through: true, reveal_child: percentage.bind(), child: Widget.Label({ label: battery.bind("percent").as(p => `${p}%`), }), }) const LevelBar = () => { const level = Widget.LevelBar({ mode: 1, max_value: blocks.bind(), visible: bar.bind().as(b => b !== "hidden"), value: battery.bind("percent").as(p => (p / 100) * blocks.value), }) const update = () => { level.value = (battery.percent / 100) * blocks.value level.css = `block { min-width: ${width.value / blocks.value}pt; }` } return level .hook(width, update) .hook(blocks, update) .hook(bar, () => { level.vpack = bar.value === "whole" ? "fill" : "center" level.hpack = bar.value === "whole" ? "fill" : "center" }) } const WholeButton = () => Widget.Overlay({ vexpand: true, child: LevelBar(), class_name: "whole", pass_through: true, overlay: Widget.Box({ hpack: "center", children: [ Widget.Icon({ icon: icons.battery.charging, visible: Utils.merge([ battery.bind("charging"), battery.bind("charged"), ], (ing, ed) => ing || ed), }), Widget.Box({ hpack: "center", vpack: "center", child: PercentLabel(), }), ], }), }) const Regular = () => Widget.Box({ class_name: "regular", children: [ Indicator(), PercentLabel(), LevelBar(), ], }) export default () => PanelButton({ class_name: "battery-bar", hexpand: false, on_clicked: () => { percentage.value = !percentage.value }, visible: battery.bind("available"), child: Widget.Box({ expand: true, visible: battery.bind("available"), child: bar.bind().as(b => b === "whole" ? WholeButton() : Regular()), }), setup: self => self .hook(bar, w => w.toggleClassName("bar-hidden", bar.value === "hidden")) .hook(battery, w => { w.toggleClassName("charging", battery.charging || battery.charged) w.toggleClassName("low", battery.percent < low.value) }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/ColorPicker.ts ================================================ import PanelButton from "../PanelButton" import colorpicker from "service/colorpicker" import Gdk from "gi://Gdk" const css = (color: string) => ` * { background-color: ${color}; color: transparent; } *:hover { color: white; text-shadow: 2px 2px 3px rgba(0,0,0,.8); }` export default () => { const menu = Widget.Menu({ class_name: "colorpicker", children: colorpicker.bind("colors").as(c => c.map(color => Widget.MenuItem({ child: Widget.Label(color), css: css(color), on_activate: () => colorpicker.wlCopy(color), }))), }) return PanelButton({ class_name: "color-picker", child: Widget.Icon("color-select-symbolic"), tooltip_text: colorpicker.bind("colors").as(v => `${v.length} colors`), on_clicked: colorpicker.pick, on_secondary_click: self => { if (colorpicker.colors.length === 0) return menu.popup_at_widget(self, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Date.ts ================================================ import { clock } from "lib/variables" import PanelButton from "../PanelButton" import options from "options" const { format, action } = options.bar.date const time = Utils.derive([clock, format], (c, f) => c.format(f) || "") export default () => PanelButton({ window: "datemenu", on_clicked: action.bind(), child: Widget.Label({ label: time.bind() }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Launcher.ts ================================================ import PanelButton from "../PanelButton" import options from "options" const { icon, label, action } = options.bar.launcher export default () => PanelButton({ window: "launcher", on_clicked: action.bind(), child: Widget.Box([ Widget.Icon({ class_name: icon.colored.bind().as(c => c ? "colored" : ""), visible: icon.icon.bind().as(v => !!v), icon: icon.icon.bind(), }), Widget.Label({ class_name: label.colored.bind().as(c => c ? "colored" : ""), visible: label.label.bind().as(v => !!v), label: label.label.bind(), }), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Media.ts ================================================ import { type MprisPlayer } from "types/service/mpris" import PanelButton from "../PanelButton" import options from "options" import icons from "lib/icons" import { icon } from "lib/utils" const mpris = await Service.import("mpris") const { length, direction, preferred, monochrome } = options.bar.media const getPlayer = (name = preferred.value) => mpris.getPlayer(name) || mpris.players[0] || null const Content = (player: MprisPlayer) => { const revealer = Widget.Revealer({ click_through: true, visible: length.bind().as(l => l > 0), transition: direction.bind().as(d => `slide_${d}` as const), setup: self => { let current = "" self.hook(player, () => { if (current === player.track_title) return current = player.track_title self.reveal_child = true Utils.timeout(3000, () => { !self.is_destroyed && (self.reveal_child = false) }) }) }, child: Widget.Label({ truncate: "end", max_width_chars: length.bind(), label: player.bind("track_title").as(() => `${player.track_artists.join(", ")} - ${player.track_title}`), }), }) const playericon = Widget.Icon({ icon: Utils.merge([player.bind("entry"), monochrome.bind()], (entry => { const name = `${entry}${monochrome.value ? "-symbolic" : ""}` return icon(name, icons.fallback.audio) })), }) return Widget.Box({ attribute: { revealer }, children: direction.bind().as(d => d === "right" ? [playericon, revealer] : [revealer, playericon]), }) } export default () => { let player = getPlayer() const btn = PanelButton({ class_name: "media", child: Widget.Icon(icons.fallback.audio), }) const update = () => { player = getPlayer() btn.visible = !!player if (!player) return const content = Content(player) const { revealer } = content.attribute btn.child = content btn.on_primary_click = () => { player.playPause() } btn.on_secondary_click = () => { player.playPause() } btn.on_scroll_up = () => { player.next() } btn.on_scroll_down = () => { player.previous() } btn.on_hover = () => { revealer.reveal_child = true } btn.on_hover_lost = () => { revealer.reveal_child = false } } return btn .hook(preferred, update) .hook(mpris, update, "notify::players") } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Messages.ts ================================================ import icons from "lib/icons" import PanelButton from "../PanelButton" import options from "options" const n = await Service.import("notifications") const notifs = n.bind("notifications") const action = options.bar.messages.action.bind() export default () => PanelButton({ class_name: "messages", on_clicked: action, visible: notifs.as(n => n.length > 0), child: Widget.Box([ Widget.Icon(icons.notifications.message), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/PowerMenu.ts ================================================ import icons from "lib/icons" import PanelButton from "../PanelButton" import options from "options" const { monochrome, action } = options.bar.powermenu export default () => PanelButton({ window: "powermenu", on_clicked: action.bind(), child: Widget.Icon(icons.powermenu.shutdown), setup: self => self.hook(monochrome, () => { self.toggleClassName("colored", !monochrome.value) self.toggleClassName("box") }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/ScreenRecord.ts ================================================ import PanelButton from "../PanelButton" import screenrecord from "service/screenrecord" import icons from "lib/icons" export default () => PanelButton({ class_name: "recorder", on_clicked: () => screenrecord.stop(), visible: screenrecord.bind("recording"), child: Widget.Box({ children: [ Widget.Icon(icons.recorder.recording), Widget.Label({ label: screenrecord.bind("timer").as(time => { const sec = time % 60 const min = Math.floor(time / 60) return `${min}:${sec < 10 ? "0" + sec : sec}` }), }), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/SysTray.ts ================================================ import { type TrayItem } from "types/service/systemtray" import PanelButton from "../PanelButton" import Gdk from "gi://Gdk" import options from "options" const systemtray = await Service.import("systemtray") const { ignore } = options.bar.systray const SysTrayItem = (item: TrayItem) => PanelButton({ class_name: "tray-item", child: Widget.Icon({ icon: item.bind("icon") }), tooltip_markup: item.bind("tooltip_markup"), setup: self => { const menu = item.menu if (!menu) return const id = item.menu?.connect("popped-up", () => { self.toggleClassName("active") menu.connect("notify::visible", () => { self.toggleClassName("active", menu.visible) }) menu.disconnect(id!) }) if (id) self.connect("destroy", () => item.menu?.disconnect(id)) }, on_primary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), on_secondary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), }) export default () => Widget.Box() .bind("children", systemtray, "items", i => i .filter(({ id }) => !ignore.value.includes(id)) .map(SysTrayItem)) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/SystemIndicators.ts ================================================ import PanelButton from "../PanelButton" import icons from "lib/icons" import asusctl from "service/asusctl" const notifications = await Service.import("notifications") const bluetooth = await Service.import("bluetooth") const audio = await Service.import("audio") const network = await Service.import("network") const ProfileIndicator = () => Widget.Icon() .bind("visible", asusctl, "profile", p => p !== "Balanced") .bind("icon", asusctl, "profile", p => icons.asusctl.profile[p]) const ModeIndicator = () => Widget.Icon() .bind("visible", asusctl, "mode", m => m !== "Hybrid") .bind("icon", asusctl, "mode", m => icons.asusctl.mode[m]) const MicrophoneIndicator = () => Widget.Icon() .hook(audio, self => self.visible = audio.recorders.length > 0 || audio.microphone.stream?.is_muted || audio.microphone.is_muted) .hook(audio.microphone, self => { const vol = audio.microphone.stream!.is_muted ? 0 : audio.microphone.volume const { muted, low, medium, high } = icons.audio.mic const cons = [[67, high], [34, medium], [1, low], [0, muted]] as const self.icon = cons.find(([n]) => n <= vol * 100)?.[1] || "" }) const DNDIndicator = () => Widget.Icon({ visible: notifications.bind("dnd"), icon: icons.notifications.silent, }) const BluetoothIndicator = () => Widget.Overlay({ class_name: "bluetooth", passThrough: true, child: Widget.Icon({ icon: icons.bluetooth.enabled, visible: bluetooth.bind("enabled"), }), overlay: Widget.Label({ hpack: "end", vpack: "start", label: bluetooth.bind("connected_devices").as(c => `${c.length}`), visible: bluetooth.bind("connected_devices").as(c => c.length > 0), }), }) const NetworkIndicator = () => Widget.Icon().hook(network, self => { const icon = network[network.primary || "wifi"]?.icon_name self.icon = icon || "" self.visible = !!icon }) const AudioIndicator = () => Widget.Icon({ icon: audio.speaker.bind("volume").as(vol => { const { muted, low, medium, high, overamplified } = icons.audio.volume const cons = [[101, overamplified], [67, high], [34, medium], [1, low], [0, muted]] as const const icon = cons.find(([n]) => n <= vol * 100)?.[1] || "" return audio.speaker.is_muted ? muted : icon }), }) export default () => PanelButton({ window: "quicksettings", on_clicked: () => App.toggleWindow("quicksettings"), on_scroll_up: () => audio.speaker.volume += 0.02, on_scroll_down: () => audio.speaker.volume -= 0.02, child: Widget.Box([ // @ts-expect-error asusctl?.available && ProfileIndicator(), // @ts-expect-error asusctl?.available && ModeIndicator(), DNDIndicator(), BluetoothIndicator(), NetworkIndicator(), AudioIndicator(), MicrophoneIndicator(), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Taskbar.ts ================================================ import { launchApp, icon } from "lib/utils" import icons from "lib/icons" import options from "options" import PanelButton from "../PanelButton" const hyprland = await Service.import("hyprland") const apps = await Service.import("applications") const { monochrome, exclusive } = options.bar.taskbar const { position } = options.bar const focus = (address: string) => hyprland.messageAsync( `dispatch focuswindow address:${address}`) const DummyItem = (address: string) => Widget.Box({ attribute: { address }, visible: false, }) const AppItem = (address: string) => { const client = hyprland.getClient(address) if (!client || client.class === "") return DummyItem(address) const app = apps.list.find(app => app.match(client.class)) const btn = PanelButton({ class_name: "panel-button", tooltip_text: client.title, on_primary_click: () => focus(address), on_middle_click: () => app && launchApp(app), child: Widget.Icon({ icon: monochrome.bind().as(m => icon( (app?.icon_name || client.class) + (m ? "-symbolic" : ""), icons.fallback.executable, )), }), }) return Widget.Box( { attribute: { address }, visible: Utils.watch(true, [exclusive, hyprland], () => { return exclusive.value ? hyprland.active.workspace.id === client.workspace.id : true }), }, Widget.Overlay({ child: btn, pass_through: true, overlay: Widget.Box({ className: "indicator", hpack: "center", vpack: position.bind().as(p => p === "top" ? "start" : "end"), setup: w => w.hook(hyprland, () => { w.toggleClassName("active", hyprland.active.client.address === address) }), }), }), ) } function sortItems(arr: T[]) { return arr.sort(({ attribute: a }, { attribute: b }) => { const aclient = hyprland.getClient(a.address)! const bclient = hyprland.getClient(b.address)! return aclient.workspace.id - bclient.workspace.id }) } export default () => Widget.Box({ class_name: "taskbar", children: sortItems(hyprland.clients.map(c => AppItem(c.address))), setup: w => w .hook(hyprland, (w, address?: string) => { if (typeof address === "string") w.children = w.children.filter(ch => ch.attribute.address !== address) }, "client-removed") .hook(hyprland, (w, address?: string) => { if (typeof address === "string") w.children = sortItems([...w.children, AppItem(address)]) }, "client-added") .hook(hyprland, (w, event?: string) => { if (event === "movewindow") w.children = sortItems(w.children) }, "event"), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/buttons/Workspaces.ts ================================================ import PanelButton from "../PanelButton" import options from "options" import { sh, range } from "lib/utils" const hyprland = await Service.import("hyprland") const { workspaces } = options.bar.workspaces const dispatch = (arg: string | number) => { sh(`hyprctl dispatch workspace ${arg}`) } const Workspaces = (ws: number) => Widget.Box({ children: range(ws || 20).map(i => Widget.Label({ attribute: i, vpack: "center", label: `${i}`, setup: self => self.hook(hyprland, () => { self.toggleClassName("active", hyprland.active.workspace.id === i) self.toggleClassName("occupied", (hyprland.getWorkspace(i)?.windows || 0) > 0) }), })), setup: box => { if (ws === 0) { box.hook(hyprland.active.workspace, () => box.children.map(btn => { btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute) })) } }, }) export default () => PanelButton({ window: "overview", class_name: "workspaces", on_scroll_up: () => dispatch("m+1"), on_scroll_down: () => dispatch("m-1"), on_clicked: () => App.toggleWindow("overview"), child: workspaces.bind().as(Workspaces), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/bar/screencorner.scss ================================================ $_shadow-size: $padding; $_radius: $radius * $hyprland-gaps-multiplier; $_margin: 99px; window.screen-corner { box.shadow { margin-right: $_margin * -1; margin-left: $_margin * -1; @if $shadows { box-shadow: inset 0 0 $_shadow-size 0 $shadow-color; } @if $bar-position =="top" { margin-bottom: $_margin * -1; } @if $bar-position =="bottom" { margin-top: $_margin * -1; } } box.border { @if $bar-position =="top" { border-top: $border-width solid $bg; } @if $bar-position =="bottom" { border-bottom: $border-width solid $bg; } margin-right: $_margin; margin-left: $_margin; } box.corner { box-shadow: 0 0 0 $border-width $border-color; } &.corners { box.border { border-radius: if($radius>0, $radius * $hyprland-gaps-multiplier, 0); box-shadow: 0 0 0 $_radius $bg; } box.corner { border-radius: if($radius>0, $radius * $hyprland-gaps-multiplier, 0); } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/datemenu/DateColumn.ts ================================================ import { clock, uptime } from "lib/variables" function up(up: number) { const h = Math.floor(up / 60) const m = Math.floor(up % 60) return `uptime: ${h}:${m < 10 ? "0" + m : m}` } export default () => Widget.Box({ vertical: true, class_name: "date-column vertical", children: [ Widget.Box({ class_name: "clock-box", vertical: true, children: [ Widget.Label({ class_name: "clock", label: clock.bind().as(t => t.format("%H:%M")!), }), Widget.Label({ class_name: "uptime", label: uptime.bind().as(up), }), ], }), Widget.Box({ class_name: "calendar", children: [ Widget.Calendar({ hexpand: true, hpack: "center", }), ], }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/datemenu/DateMenu.ts ================================================ import PopupWindow from "widget/PopupWindow" import NotificationColumn from "./NotificationColumn" import DateColumn from "./DateColumn" import options from "options" const { bar, datemenu } = options const pos = bar.position.bind() const layout = Utils.derive([bar.position, datemenu.position], (bar, qs) => `${bar}-${qs}` as const, ) const Settings = () => Widget.Box({ class_name: "datemenu horizontal", vexpand: false, children: [ NotificationColumn(), Widget.Separator({ orientation: 1 }), DateColumn(), ], }) const DateMenu = () => PopupWindow({ name: "datemenu", exclusivity: "exclusive", transition: pos.as(pos => pos === "top" ? "slide_down" : "slide_up"), layout: layout.value, child: Settings(), }) export function setupDateMenu() { App.addWindow(DateMenu()) layout.connect("changed", () => { App.removeWindow("datemenu") App.addWindow(DateMenu()) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/datemenu/NotificationColumn.ts ================================================ import { type Notification as Notif } from "types/service/notifications" import Notification from "widget/notifications/Notification" import options from "options" import icons from "lib/icons" const notifications = await Service.import("notifications") const notifs = notifications.bind("notifications") const Animated = (n: Notif) => Widget.Revealer({ transition_duration: options.transition.value, transition: "slide_down", child: Notification(n), setup: self => Utils.timeout(options.transition.value, () => { if (!self.is_destroyed) self.reveal_child = true }), }) const ClearButton = () => Widget.Button({ on_clicked: notifications.clear, sensitive: notifs.as(n => n.length > 0), child: Widget.Box({ children: [ Widget.Label("Clear "), Widget.Icon({ icon: notifs.as(n => icons.trash[n.length > 0 ? "full" : "empty"]), }), ], }), }) const Header = () => Widget.Box({ class_name: "header", children: [ Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }), ClearButton(), ], }) const NotificationList = () => { const map: Map> = new Map const box = Widget.Box({ vertical: true, children: notifications.notifications.map(n => { const w = Animated(n) map.set(n.id, w) return w }), visible: notifs.as(n => n.length > 0), }) function remove(_: unknown, id: number) { const n = map.get(id) if (n) { n.reveal_child = false Utils.timeout(options.transition.value, () => { n.destroy() map.delete(id) }) } } return box .hook(notifications, remove, "closed") .hook(notifications, (_, id: number) => { if (id !== undefined) { if (map.has(id)) remove(null, id) const n = notifications.getNotification(id)! const w = Animated(n) map.set(id, w) box.children = [w, ...box.children] } }, "notified") } const Placeholder = () => Widget.Box({ class_name: "placeholder", vertical: true, vpack: "center", hpack: "center", vexpand: true, hexpand: true, visible: notifs.as(n => n.length === 0), children: [ Widget.Icon(icons.notifications.silent), Widget.Label("Your inbox is empty"), ], }) export default () => Widget.Box({ class_name: "notifications", css: options.notifications.width.bind().as(w => `min-width: ${w}px`), vertical: true, children: [ Header(), Widget.Scrollable({ vexpand: true, hscroll: "never", class_name: "notification-scrollable", child: Widget.Box({ class_name: "notification-list vertical", vertical: true, children: [ NotificationList(), Placeholder(), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/datemenu/datemenu.scss ================================================ @import "../notifications/notifications.scss"; @mixin calendar { @include widget; padding: $padding*2 $padding*2 0; calendar { all: unset; &.button { @include button($flat: true); } &:selected { box-shadow: inset 0 -8px 0 0 transparentize($primary-bg, 0.5), inset 0 0 0 1px $primary-bg; border-radius: $radius*0.6; } &.header { background-color: transparent; border: none; color: transparentize($fg, 0.5); } &.highlight { background-color: transparent; color: transparentize($primary-bg, 0.5); } &:indeterminate { color: transparentize($fg, 0.9); } font-size: 1.1em; padding: .2em; } } window#datemenu .datemenu { @include floating-widget; .notifications { .header { margin-bottom: $spacing; margin-right: $spacing; >label { margin-left: $radius * .5; } button { @include button; padding: $padding*.7 $padding; } } .notification-scrollable { @include scrollable; } .notification-list { margin-right: $spacing; } .notification { @include notification; @include widget; padding: $padding; margin-bottom: $spacing; } .placeholder { image { font-size: 7em; } label { font-size: 1.2em; } } } separator { background-color: $popover-border-color; border-radius: $radius; margin-right: $spacing; } .datemenu { @include spacing; } .clock-box { padding: $padding; .clock { font-size: 5em; } .uptime { color: transparentize($fg, 0.2); } } .calendar { @include calendar; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/desktop/Desktop.ts ================================================ import options from "options" import { matugen } from "lib/matugen" const mpris = await Service.import("mpris") const pref = () => options.bar.media.preferred.value export default (monitor: number) => Widget.Window({ monitor, layer: "bottom", name: `desktop${monitor}`, class_name: "desktop", anchor: ["top", "bottom", "left", "right"], child: Widget.Box({ expand: true, css: options.theme.dark.primary.bg.bind().as(c => ` transition: 500ms; background-color: ${c}`), child: Widget.Box({ class_name: "wallpaper", expand: true, vpack: "center", hpack: "center", setup: self => self .hook(mpris, () => { const img = mpris.getPlayer(pref())!.cover_path matugen("image", img) Utils.timeout(500, () => self.css = ` background-image: url('${img}'); background-size: contain; background-repeat: no-repeat; transition: 200ms; min-width: 700px; min-height: 700px; border-radius: 30px; box-shadow: 25px 25px 30px 0 rgba(0,0,0,0.5);`, ) }), }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/notifications/Notification.ts ================================================ import { type Notification } from "types/service/notifications" import GLib from "gi://GLib" import icons from "lib/icons" const time = (time: number, format = "%H:%M") => GLib.DateTime .new_from_unix_local(time) .format(format) const NotificationIcon = ({ app_entry, app_icon, image }: Notification) => { if (image) { return Widget.Box({ vpack: "start", hexpand: false, class_name: "icon img", css: ` background-image: url("${image}"); background-size: cover; background-repeat: no-repeat; background-position: center; min-width: 78px; min-height: 78px; `, }) } let icon = icons.fallback.notification if (Utils.lookUpIcon(app_icon)) icon = app_icon if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || "" return Widget.Box({ vpack: "start", hexpand: false, class_name: "icon", css: ` min-width: 78px; min-height: 78px; `, child: Widget.Icon({ icon, size: 58, hpack: "center", hexpand: true, vpack: "center", vexpand: true, }), }) } export default (notification: Notification) => { const content = Widget.Box({ class_name: "content", children: [ NotificationIcon(notification), Widget.Box({ hexpand: true, vertical: true, children: [ Widget.Box({ children: [ Widget.Label({ class_name: "title", xalign: 0, justification: "left", hexpand: true, max_width_chars: 24, truncate: "end", wrap: true, label: notification.summary.trim(), use_markup: true, }), Widget.Label({ class_name: "time", vpack: "start", label: time(notification.time), }), Widget.Button({ class_name: "close-button", vpack: "start", child: Widget.Icon("window-close-symbolic"), on_clicked: notification.close, }), ], }), Widget.Label({ class_name: "description", hexpand: true, use_markup: true, xalign: 0, justification: "left", label: notification.body.trim(), max_width_chars: 24, wrap: true, }), ], }), ], }) const actionsbox = notification.actions.length > 0 ? Widget.Revealer({ transition: "slide_down", child: Widget.EventBox({ child: Widget.Box({ class_name: "actions horizontal", children: notification.actions.map(action => Widget.Button({ class_name: "action-button", on_clicked: () => notification.invoke(action.id), hexpand: true, child: Widget.Label(action.label), })), }), }), }) : null const eventbox = Widget.EventBox({ vexpand: false, on_primary_click: notification.dismiss, on_hover() { if (actionsbox) actionsbox.reveal_child = true }, on_hover_lost() { if (actionsbox) actionsbox.reveal_child = true notification.dismiss() }, child: Widget.Box({ vertical: true, children: actionsbox ? [content, actionsbox] : [content], }), }) return Widget.Box({ class_name: `notification ${notification.urgency}`, child: eventbox, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/notifications/NotificationPopups.ts ================================================ import Notification from "./Notification" import options from "options" const notifications = await Service.import("notifications") const { transition } = options const { position } = options.notifications const { timeout, idle } = Utils function Animated(id: number) { const n = notifications.getNotification(id)! const widget = Notification(n) const inner = Widget.Revealer({ css: "border: 1px solid magenta;", transition: "slide_left", transition_duration: transition.value, child: widget, }) const outer = Widget.Revealer({ css: "border: 1px solid yellow;", transition: "slide_down", transition_duration: transition.value, child: inner, }) const box = Widget.Box({ hpack: "end", child: outer, }) idle(() => { outer.reveal_child = true timeout(transition.value, () => { inner.reveal_child = true }) }) return Object.assign(box, { dismiss() { inner.reveal_child = false timeout(transition.value, () => { outer.reveal_child = false timeout(transition.value, () => { box.destroy() }) }) }, }) } function PopupList() { const map: Map> = new Map const box = Widget.Box({ hpack: "end", vertical: true, css: options.notifications.width.bind().as(w => `min-width: ${w}px;`), }) function remove(_: unknown, id: number) { map.get(id)?.dismiss() map.delete(id) } return box .hook(notifications, (_, id: number) => { if (id !== undefined) { if (map.has(id)) remove(null, id) if (notifications.dnd) return const w = Animated(id) map.set(id, w) box.children = [w, ...box.children] } }, "notified") .hook(notifications, remove, "dismissed") .hook(notifications, remove, "closed") } export default (monitor: number) => Widget.Window({ monitor, name: `notifications${monitor}`, anchor: position.bind(), class_name: "notifications", child: Widget.Box({ css: "padding: 2px;", child: PopupList(), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/notifications/notifications.scss ================================================ @mixin notification() { &.critical { box-shadow: inset 0 0 .5em 0 $error-bg; } &:hover button.close-button { @include button-hover; background-color: transparentize($error-bg, .5); } .content { .title { margin-right: $spacing; color: $fg; font-size: 1.1em; } .time { color: transparentize($fg, .2); } .description { font-size: .9em; color: transparentize($fg, .2); } .icon { border-radius: $radius*0.8; margin-right: $spacing; &.img { border: $border; } } } box.actions { @include spacing(0.5); margin-top: $spacing; button { @include button; border-radius: $radius*0.8; font-size: 1.2em; padding: $padding * 0.7; } } button.close-button { @include button($flat: true); margin-left: $spacing / 2; border-radius: $radius*0.8; min-width: 1.2em; min-height: 1.2em; &:hover { background-color: transparentize($error-bg, .2); } &:active { background-image: none; background-color: $error-bg; } } } window.notifications { @include unset; .notification { @include notification; @include floating-widget; border-radius: $radius; .description { min-width: 350px; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/osd/OSD.ts ================================================ import { icon } from "lib/utils" import icons from "lib/icons" import Progress from "./Progress" import brightness from "service/brightness" import type Gtk from "gi://Gtk?version=3.0" import options from "options" const audio = await Service.import("audio") const { progress, microphone } = options.osd const DELAY = 2500 function OnScreenProgress(vertical: boolean) { const indicator = Widget.Icon({ size: 32, vpack: "start", }) const progress = Progress({ vertical, width: vertical ? 42 : 200, height: vertical ? 200 : 42, child: indicator, }) const revealer = Widget.Revealer({ transition: "slide_left", child: progress, }) let count = 0 function show(value: number, icon: string) { revealer.reveal_child = true indicator.icon = icon progress.setValue(value) count++ Utils.timeout(DELAY, () => { count-- if (count === 0) revealer.reveal_child = false }) } return revealer .hook(brightness, () => show( brightness.screen, icons.brightness.screen, ), "notify::screen") .hook(brightness, () => show( brightness.kbd, icons.brightness.keyboard, ), "notify::kbd") .hook(audio.speaker, () => show( audio.speaker.volume, icon(audio.speaker.icon_name || "", icons.audio.type.speaker), ), "notify::volume") } function MicrophoneMute() { const icon = Widget.Icon({ class_name: "microphone", }) const revealer = Widget.Revealer({ transition: "slide_up", child: icon, }) let count = 0 let mute = audio.microphone.stream?.is_muted ?? false return revealer.hook(audio.microphone, () => Utils.idle(() => { if (mute !== audio.microphone.stream?.is_muted) { mute = audio.microphone.stream!.is_muted icon.icon = icons.audio.mic[mute ? "muted" : "high"] revealer.reveal_child = true count++ Utils.timeout(DELAY, () => { count-- if (count === 0) revealer.reveal_child = false }) } })) } export default (monitor: number) => Widget.Window({ monitor, name: `indicator${monitor}`, class_name: "indicator", layer: "overlay", click_through: true, anchor: ["right", "left", "top", "bottom"], child: Widget.Box({ css: "padding: 2px;", expand: true, child: Widget.Overlay( { child: Widget.Box({ expand: true }) }, Widget.Box({ hpack: progress.pack.h.bind(), vpack: progress.pack.v.bind(), child: progress.vertical.bind().as(OnScreenProgress), }), Widget.Box({ hpack: microphone.pack.h.bind(), vpack: microphone.pack.v.bind(), child: MicrophoneMute(), }), ), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/osd/Progress.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import GLib from "gi://GLib?version=2.0" import { range } from "lib/utils" import options from "options" type ProgressProps = { height?: number width?: number vertical?: boolean child: Gtk.Widget } export default ({ height = 18, width = 180, vertical = false, child, }: ProgressProps) => { const fill = Widget.Box({ class_name: "fill", hexpand: vertical, vexpand: !vertical, hpack: vertical ? "fill" : "start", vpack: vertical ? "end" : "fill", child, }) const container = Widget.Box({ class_name: "progress", child: fill, css: ` min-width: ${width}px; min-height: ${height}px; `, }) let fill_size = 0 let animations: number[] = [] return Object.assign(container, { setValue(value: number) { if (value < 0) return if (animations.length > 0) { for (const id of animations) GLib.source_remove(id) animations = [] } const axis = vertical ? "height" : "width" const axisv = vertical ? height : width const min = vertical ? width : height const preferred = (axisv - min) * value + min if (!fill_size) { fill_size = preferred fill.css = `min-${axis}: ${preferred}px;` return } const frames = options.transition.value / 10 const goal = preferred - fill_size const step = goal / frames animations = range(frames, 0).map(i => Utils.timeout(5 * i, () => { fill_size += step fill.css = `min-${axis}: ${fill_size}px` animations.shift() })) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/osd/osd.scss ================================================ window.indicator { .progress { @include floating-widget; margin: max($spacing * 5, 8px); padding: $padding * 0.5; border-radius: if($radius >0, calc($radius + $padding * 0.5), 0); @debug $radius; .fill { border-radius: $radius; background-color: $primary-bg; color: $primary-fg; image { -gtk-icon-transform: scale(0.7); } } } .microphone { @include floating-widget; margin: $spacing * 2; padding: $popover-padding * 2; font-size: 58px; color: transparentize($fg, 0.1); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/overview/Overview.ts ================================================ import PopupWindow from "widget/PopupWindow" import Workspace from "./Workspace" import options from "options" import { range } from "lib/utils" const hyprland = await Service.import("hyprland") const Overview = (ws: number) => Widget.Box({ class_name: "overview horizontal", children: ws > 0 ? range(ws).map(Workspace) : hyprland.workspaces .map(({ id }) => Workspace(id)) .sort((a, b) => a.attribute.id - b.attribute.id), setup: w => { if (ws > 0) return w.hook(hyprland, (w, id?: number) => { if (id === undefined) return w.children = w.children .filter(ch => ch.attribute.id !== Number(id)) }, "workspace-removed") w.hook(hyprland, (w, id?: number) => { if (id === undefined) return w.children = [...w.children, Workspace(Number(id))] .sort((a, b) => a.attribute.id - b.attribute.id) }, "workspace-added") }, }) export default () => PopupWindow({ name: "overview", layout: "center", child: options.overview.workspaces.bind().as(Overview), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/overview/Window.ts ================================================ import { type Client } from "types/service/hyprland" import { createSurfaceFromWidget, icon } from "lib/utils" import Gdk from "gi://Gdk" import Gtk from "gi://Gtk?version=3.0" import options from "options" import icons from "lib/icons" const monochrome = options.overview.monochromeIcon const TARGET = [Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 0)] const scale = (size: number) => (options.overview.scale.value / 100) * size const hyprland = await Service.import("hyprland") const apps = await Service.import("applications") const dispatch = (args: string) => hyprland.messageAsync(`dispatch ${args}`) export default ({ address, size: [w, h], class: c, title }: Client) => Widget.Button({ class_name: "client", attribute: { address }, tooltip_text: `${title}`, child: Widget.Icon({ css: ` min-width: ${scale(w)}px; min-height: ${scale(h)}px; `, icon: monochrome.bind().as(m => { const app = apps.list.find(app => app.match(c)) if (!app) return icons.fallback.executable return icon( app.icon_name + (m ? "-symbolic" : ""), icons.fallback.executable, ) }), }), on_secondary_click: () => dispatch(`closewindow address:${address}`), on_clicked: () => { dispatch(`focuswindow address:${address}`) App.closeWindow("overview") }, setup: btn => btn .on("drag-data-get", (_w, _c, data) => data.set_text(address, address.length)) .on("drag-begin", (_, context) => { Gtk.drag_set_icon_surface(context, createSurfaceFromWidget(btn)) btn.toggleClassName("hidden", true) }) .on("drag-end", () => btn.toggleClassName("hidden", false)) .drag_source_set(Gdk.ModifierType.BUTTON1_MASK, TARGET, Gdk.DragAction.COPY), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/overview/Workspace.ts ================================================ import Window from "./Window" import Gdk from "gi://Gdk" import Gtk from "gi://Gtk?version=3.0" import options from "options" const TARGET = [Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 0)] const scale = (size: number) => (options.overview.scale.value / 100) * size const hyprland = await Service.import("hyprland") const dispatch = (args: string) => hyprland.messageAsync(`dispatch ${args}`) const size = (id: number) => { const def = { h: 1080, w: 1920 } const ws = hyprland.getWorkspace(id) if (!ws) return def const mon = hyprland.getMonitor(ws.monitorID) return mon ? { h: mon.height, w: mon.width } : def } export default (id: number) => Widget.Box({ attribute: { id }, tooltipText: `${id}`, class_name: "workspace", vpack: "center", css: ` min-width: ${scale(size(id).w)}px; min-height: ${scale(size(id).h)}px; `, setup: box => box.hook(hyprland, () => { box.toggleClassName("active", hyprland.active.workspace.id === id) }), child: Widget.EventBox({ expand: true, on_primary_click: () => { App.closeWindow("overview") dispatch(`workspace ${id}`) }, setup: eventbox => { eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY) eventbox.connect("drag-data-received", (_w, _c, _x, _y, data) => { const address = new TextDecoder().decode(data.get_data()) dispatch(`movetoworkspacesilent ${id},address:${address}`) }) }, child: Widget.Fixed().hook(hyprland, fixed => { fixed.get_children().forEach(ch => ch.destroy()) hyprland.clients .filter(({ workspace }) => workspace.id === id) .forEach(c => { const x = c.at[0] - (hyprland.getMonitor(c.monitor)?.x || 0) const y = c.at[1] - (hyprland.getMonitor(c.monitor)?.y || 0) c.mapped && fixed.put(Window(c), scale(x), scale(y)) }) fixed.show_all() }, "notify::clients"), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/overview/overview.scss ================================================ window#overview .overview { @include floating-widget; @include spacing; .workspace { &.active>widget { border-color: $primary-bg } >widget { @include widget; border-radius: if($radius ==0, 0, $radius + $padding); &:hover { background-color: $hover-bg; } &:drop(active) { border-color: $primary-bg; } } } .client { @include button; border-radius: $radius; margin: $padding; &.hidden { @include hidden; transition: 0; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/powermenu/PowerMenu.ts ================================================ import PopupWindow from "widget/PopupWindow" import powermenu, { type Action } from "service/powermenu" import icons from "lib/icons" import options from "options" import type Gtk from "gi://Gtk?version=3.0" const { layout, labels } = options.powermenu const SysButton = (action: Action, label: string) => Widget.Button({ on_clicked: () => powermenu.action(action), child: Widget.Box({ vertical: true, class_name: "system-button", children: [ Widget.Icon(icons.powermenu[action]), Widget.Label({ label, visible: labels.bind(), }), ], }), }) export default () => PopupWindow({ name: "powermenu", transition: "crossfade", child: Widget.Box({ class_name: "powermenu horizontal", setup: self => self.hook(layout, () => { self.toggleClassName("box", layout.value === "box") self.toggleClassName("line", layout.value === "line") }), children: layout.bind().as(layout => { switch (layout) { case "line": return [ SysButton("shutdown", "Shutdown"), SysButton("logout", "Log Out"), SysButton("reboot", "Reboot"), SysButton("sleep", "Sleep"), ] case "box": return [ Widget.Box( { vertical: true }, SysButton("shutdown", "Shutdown"), SysButton("logout", "Log Out"), ), Widget.Box( { vertical: true }, SysButton("reboot", "Reboot"), SysButton("sleep", "Sleep"), ), ] } }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/powermenu/Verification.ts ================================================ import PopupWindow from "widget/PopupWindow" import powermenu from "service/powermenu" export default () => PopupWindow({ name: "verification", transition: "crossfade", child: Widget.Box({ class_name: "verification", vertical: true, children: [ Widget.Box({ class_name: "text-box", vertical: true, children: [ Widget.Label({ class_name: "title", label: powermenu.bind("title"), }), Widget.Label({ class_name: "desc", label: "Are you sure?", }), ], }), Widget.Box({ class_name: "buttons horizontal", vexpand: true, vpack: "end", homogeneous: true, children: [ Widget.Button({ child: Widget.Label("No"), on_clicked: () => App.toggleWindow("verification"), setup: self => self.hook(App, (_, name: string, visible: boolean) => { if (name === "verification" && visible) self.grab_focus() }), }), Widget.Button({ child: Widget.Label("Yes"), on_clicked: () => Utils.exec(powermenu.cmd), }), ], }), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/powermenu/powermenu.scss ================================================ window#powermenu, window#verification { // the fraction has to be more than hyprland ignorealpha background-color: rgba(0, 0, 0, .4); } window#verification .verification { @include floating-widget; padding: $popover-padding * 1.5; min-width: 300px; min-height: 100px; .text-box { margin-bottom: $spacing; .title { font-size: 1.6em; } .desc { color: transparentize($fg, 0.1); font-size: 1.1em; } } .buttons { @include spacing; margin-top: $padding; button { @include button; font-size: 1.5em; padding: $padding; } } } window#powermenu .powermenu { @include floating-widget; &.line { padding: $popover-padding * 1.5; button { padding: $popover-padding; } label { margin-bottom: $spacing * -.5; } } &.box { padding: $popover-padding * 2; button { padding: $popover-padding * 1.5; } label { margin-bottom: $spacing * -1; } } button { @include unset; image { @include button; border-radius: $radius + ($popover-padding * 1.4); min-width: 1.7em; min-height: 1.7em; font-size: 4em; } label, image { color: transparentize($fg, 0.1); } label { margin-top: $spacing * .3; } &:hover { image { @include button-hover; } label { color: $fg; } } &:focus image { @include button-focus; } &:active image { @include button-active; } &:focus, &:active { label { color: $primary-bg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/QuickSettings.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import { ProfileSelector, ProfileToggle } from "./widgets/AsusProfile" import { Header } from "./widgets/Header" import { Volume, Microhone, SinkSelector, AppMixer } from "./widgets/Volume" import { Brightness } from "./widgets/Brightness" import { NetworkToggle, WifiSelection } from "./widgets/Network" import { BluetoothToggle, BluetoothDevices } from "./widgets/Bluetooth" import { DND } from "./widgets/DND" import { DarkModeToggle } from "./widgets/DarkMode" import { MicMute } from "./widgets/MicMute" import { Media } from "./widgets/Media" import PopupWindow from "widget/PopupWindow" import options from "options" const { bar, quicksettings } = options const media = (await Service.import("mpris")).bind("players") const layout = Utils.derive([bar.position, quicksettings.position], (bar, qs) => `${bar}-${qs}` as const, ) const Row = ( toggles: Array<() => Gtk.Widget> = [], menus: Array<() => Gtk.Widget> = [], ) => Widget.Box({ vertical: true, children: [ Widget.Box({ homogeneous: true, class_name: "row horizontal", children: toggles.map(w => w()), }), ...menus.map(w => w()), ], }) const Settings = () => Widget.Box({ vertical: true, class_name: "quicksettings vertical", css: quicksettings.width.bind().as(w => `min-width: ${w}px;`), children: [ Header(), Widget.Box({ class_name: "sliders-box vertical", vertical: true, children: [ Row( [Volume], [SinkSelector, AppMixer], ), Microhone(), Brightness(), ], }), Row( [NetworkToggle, BluetoothToggle], [WifiSelection, BluetoothDevices], ), Row( [ProfileToggle, DarkModeToggle], [ProfileSelector], ), Row([MicMute, DND]), Widget.Box({ visible: media.as(l => l.length > 0), child: Media(), }), ], }) const QuickSettings = () => PopupWindow({ name: "quicksettings", exclusivity: "exclusive", transition: bar.position.bind().as(pos => pos === "top" ? "slide_down" : "slide_up"), layout: layout.value, child: Settings(), }) export function setupQuickSettings() { App.addWindow(QuickSettings()) layout.connect("changed", () => { App.removeWindow("quicksettings") App.addWindow(QuickSettings()) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/ToggleButton.ts ================================================ import { type Props as IconProps } from "types/widgets/icon" import { type Props as LabelProps } from "types/widgets/label" import type GObject from "gi://GObject?version=2.0" import type Gtk from "gi://Gtk?version=3.0" import icons from "lib/icons" export const opened = Variable("") App.connect("window-toggled", (_, name: string, visible: boolean) => { if (name === "quicksettings" && !visible) Utils.timeout(500, () => opened.value = "") }) export const Arrow = (name: string, activate?: false | (() => void)) => { let deg = 0 let iconOpened = false const icon = Widget.Icon(icons.ui.arrow.right).hook(opened, () => { if (opened.value === name && !iconOpened || opened.value !== name && iconOpened) { const step = opened.value === name ? 10 : -10 iconOpened = !iconOpened for (let i = 0; i < 9; ++i) { Utils.timeout(15 * i, () => { deg += step icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`) }) } } }) return Widget.Button({ child: icon, class_name: "arrow", on_clicked: () => { opened.value = opened.value === name ? "" : name if (typeof activate === "function") activate() }, }) } type ArrowToggleButtonProps = { name: string icon: IconProps["icon"] label: LabelProps["label"] activate: () => void deactivate: () => void activateOnArrow?: boolean connection: [GObject.Object, () => boolean] } export const ArrowToggleButton = ({ name, icon, label, activate, deactivate, activateOnArrow = true, connection: [service, condition], }: ArrowToggleButtonProps) => Widget.Box({ class_name: "toggle-button", setup: self => self.hook(service, () => { self.toggleClassName("active", condition()) }), children: [ Widget.Button({ child: Widget.Box({ hexpand: true, children: [ Widget.Icon({ class_name: "icon", icon, }), Widget.Label({ class_name: "label", max_width_chars: 10, truncate: "end", label, }), ], }), on_clicked: () => { if (condition()) { deactivate() if (opened.value === name) opened.value = "" } else { activate() } }, }), Arrow(name, activateOnArrow && activate), ], }) type MenuProps = { name: string icon: IconProps["icon"] title: LabelProps["label"] content: Gtk.Widget[] } export const Menu = ({ name, icon, title, content }: MenuProps) => Widget.Revealer({ transition: "slide_down", reveal_child: opened.bind().as(v => v === name), child: Widget.Box({ class_names: ["menu", name], vertical: true, children: [ Widget.Box({ class_name: "title-box", children: [ Widget.Icon({ class_name: "icon", icon, }), Widget.Label({ class_name: "title", truncate: "end", label: title, }), ], }), Widget.Separator(), Widget.Box({ vertical: true, class_name: "content vertical", children: content, }), ], }), }) type SimpleToggleButtonProps = { icon: IconProps["icon"] label: LabelProps["label"] toggle: () => void connection: [GObject.Object, () => boolean] } export const SimpleToggleButton = ({ icon, label, toggle, connection: [service, condition], }: SimpleToggleButtonProps) => Widget.Button({ on_clicked: toggle, class_name: "simple-toggle", setup: self => self.hook(service, () => { self.toggleClassName("active", condition()) }), child: Widget.Box([ Widget.Icon({ icon }), Widget.Label({ max_width_chars: 10, truncate: "end", label, }), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/quicksettings.scss ================================================ window#quicksettings .quicksettings { @include floating-widget; @include spacing; padding: $popover-padding * 1.4; .avatar { @include widget; border-radius: $radius * 3; } .header { @include spacing(.5); color: transparentize($fg, .15); button { @include button; padding: $padding; image { font-size: 1.4em; } } } .sliders-box { @include widget; padding: $padding; button { @include button($flat: true); padding: $padding * .5; } .volume button.arrow:last-child { margin-left: $spacing * .4; } .volume, .brightness { padding: $padding * .5; } scale { @include slider; margin: 0 ($spacing * .5); } } .row { @include spacing; } .menu { @include unset; @include widget; padding: $padding; margin-top: $spacing; .icon { margin: 0 ($spacing * .5); margin-left: $spacing * .2; } .title { font-weight: bold; } separator { margin: ($radius * .5); background-color: $border-color; } button { @include button($flat: true); padding: ($padding * .5); image:first-child { margin-right: $spacing * .5; } } .bluetooth-devices { @include spacing(.5); } switch { @include switch; } } .sliders-box .menu { margin: ($spacing * .5) 0; &.app-mixer { .mixer-item { padding: $padding * .5; padding-left: 0; padding-right: $padding * 2; scale { @include slider($width: .5em); } image { font-size: 1.2em; margin: 0 $padding; } } } } .toggle-button { @include button; font-weight: bold; image { font-size: 1.3em; } label { margin-left: $spacing * .3; } button { @include button($flat: true); &:first-child { padding: $padding * 1.2; border-top-right-radius: 0; border-bottom-right-radius: 0; } &:last-child { padding: $padding * .5; border-top-left-radius: 0; border-bottom-left-radius: 0; } } &.active { background-color: $primary-bg; label, image { color: $primary-fg; } } } .simple-toggle { @include button; font-weight: bold; padding: $padding * 1.2; label { margin-left: $spacing * .3; } image { font-size: 1.3em; } } .media { @include spacing; .player { @include media; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/AsusProfile.ts ================================================ import { ArrowToggleButton, Menu } from "../ToggleButton" import icons from "lib/icons" import asusctl from "service/asusctl" const profile = asusctl.bind("profile") export const ProfileToggle = () => ArrowToggleButton({ name: "asusctl-profile", icon: profile.as(p => icons.asusctl.profile[p]), label: profile, connection: [asusctl, () => asusctl.profile !== "Balanced"], activate: () => asusctl.setProfile("Quiet"), deactivate: () => asusctl.setProfile("Balanced"), activateOnArrow: false, }) export const ProfileSelector = () => Menu({ name: "asusctl-profile", icon: profile.as(p => icons.asusctl.profile[p]), title: "Profile Selector", content: [ Widget.Box({ vertical: true, hexpand: true, children: [ Widget.Box({ vertical: true, children: asusctl.profiles.map(prof => Widget.Button({ on_clicked: () => asusctl.setProfile(prof), child: Widget.Box({ children: [ Widget.Icon(icons.asusctl.profile[prof]), Widget.Label(prof), ], }), })), }), ], }), Widget.Separator(), Widget.Button({ on_clicked: () => Utils.execAsync("rog-control-center"), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Rog Control Center"), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Bluetooth.ts ================================================ import { type BluetoothDevice } from "types/service/bluetooth" import { Menu, ArrowToggleButton } from "../ToggleButton" import icons from "lib/icons" const bluetooth = await Service.import("bluetooth") export const BluetoothToggle = () => ArrowToggleButton({ name: "bluetooth", icon: bluetooth.bind("enabled").as(p => icons.bluetooth[p ? "enabled" : "disabled"]), label: Utils.watch("Disabled", bluetooth, () => { if (!bluetooth.enabled) return "Disabled" if (bluetooth.connected_devices.length === 1) return bluetooth.connected_devices[0].alias return `${bluetooth.connected_devices.length} Connected` }), connection: [bluetooth, () => bluetooth.enabled], deactivate: () => bluetooth.enabled = false, activate: () => bluetooth.enabled = true, }) const DeviceItem = (device: BluetoothDevice) => Widget.Box({ children: [ Widget.Icon(device.icon_name + "-symbolic"), Widget.Label(device.name), Widget.Label({ label: `${device.battery_percentage}%`, visible: device.bind("battery_percentage").as(p => p > 0), }), Widget.Box({ hexpand: true }), Widget.Spinner({ active: device.bind("connecting"), visible: device.bind("connecting"), }), Widget.Switch({ active: device.connected, visible: device.bind("connecting").as(p => !p), setup: self => self.on("notify::active", () => { device.setConnection(self.active) }), }), ], }) export const BluetoothDevices = () => Menu({ name: "bluetooth", icon: icons.bluetooth.disabled, title: "Bluetooth", content: [ Widget.Box({ class_name: "bluetooth-devices", hexpand: true, vertical: true, children: bluetooth.bind("devices").as(ds => ds .filter(d => d.name) .map(DeviceItem)), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Brightness.ts ================================================ import icons from "lib/icons" import brightness from "service/brightness" const BrightnessSlider = () => Widget.Slider({ draw_value: false, hexpand: true, value: brightness.bind("screen"), on_change: ({ value }) => brightness.screen = value, }) export const Brightness = () => Widget.Box({ class_name: "brightness", children: [ Widget.Button({ vpack: "center", child: Widget.Icon(icons.brightness.indicator), on_clicked: () => brightness.screen = 0, tooltip_text: brightness.bind("screen").as(v => `Screen Brightness: ${Math.floor(v * 100)}%`), }), BrightnessSlider(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/DND.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" const n = await Service.import("notifications") const dnd = n.bind("dnd") export const DND = () => SimpleToggleButton({ icon: dnd.as(dnd => icons.notifications[dnd ? "silent" : "noisy"]), label: dnd.as(dnd => dnd ? "Silent" : "Noisy"), toggle: () => n.dnd = !n.dnd, connection: [n, () => n.dnd], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/DarkMode.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" import options from "options" const { scheme } = options.theme export const DarkModeToggle = () => SimpleToggleButton({ icon: scheme.bind().as(s => icons.color[s]), label: scheme.bind().as(s => s === "dark" ? "Dark" : "Light"), toggle: () => scheme.value = scheme.value === "dark" ? "light" : "dark", connection: [scheme, () => scheme.value === "dark"], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Header.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import icons from "lib/icons" import { uptime } from "lib/variables" import options from "options" import powermenu, { Action } from "service/powermenu" const battery = await Service.import("battery") const { image, size } = options.quicksettings.avatar function up(up: number) { const h = Math.floor(up / 60) const m = Math.floor(up % 60) return `${h}h ${m < 10 ? "0" + m : m}m` } const Avatar = () => Widget.Box({ class_name: "avatar", css: Utils.merge([image.bind(), size.bind()], (img, size) => ` min-width: ${size}px; min-height: ${size}px; background-image: url('${img}'); background-size: cover; `), }) const SysButton = (action: Action) => Widget.Button({ vpack: "center", child: Widget.Icon(icons.powermenu[action]), on_clicked: () => powermenu.action(action), }) export const Header = () => Widget.Box( { class_name: "header horizontal" }, Avatar(), Widget.Box({ vertical: true, vpack: "center", children: [ Widget.Box({ visible: battery.bind("available"), children: [ Widget.Icon({ icon: battery.bind("icon_name") }), Widget.Label({ label: battery.bind("percent").as(p => `${p}%`) }), ], }), Widget.Box([ Widget.Icon({ icon: icons.ui.time }), Widget.Label({ label: uptime.bind().as(up) }), ]), ], }), Widget.Box({ hexpand: true }), Widget.Button({ vpack: "center", child: Widget.Icon(icons.ui.settings), on_clicked: () => { App.closeWindow("quicksettings") App.closeWindow("settings-dialog") App.openWindow("settings-dialog") }, }), SysButton("logout"), SysButton("shutdown"), ) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Media.ts ================================================ import { type MprisPlayer } from "types/service/mpris" import icons from "lib/icons" import type Gtk from "gi://Gtk?version=3.0" import options from "options" import { icon } from "lib/utils" const mpris = await Service.import("mpris") const players = mpris.bind("players") const { media } = options.quicksettings function lengthStr(length: number) { const min = Math.floor(length / 60) const sec = Math.floor(length % 60) const sec0 = sec < 10 ? "0" : "" return `${min}:${sec0}${sec}` } const Player = (player: MprisPlayer) => { const cover = Widget.Box({ class_name: "cover", vpack: "start", css: Utils.merge([player.bind("cover_path"), media.coverSize.bind()], (path, size) => ` min-width: ${size}px; min-height: ${size}px; background-image: url('${path}'); `), }) const title = Widget.Label({ class_name: "title", max_width_chars: 20, truncate: "end", hpack: "start", label: player.bind("track_title"), }) const artist = Widget.Label({ class_name: "artist", max_width_chars: 20, truncate: "end", hpack: "start", label: player.bind("track_artists").as(a => a.join(", ")), }) const positionSlider = Widget.Slider({ class_name: "position", draw_value: false, on_change: ({ value }) => player.position = value * player.length, setup: self => { const update = () => { const { length, position } = player self.visible = length > 0 self.value = length > 0 ? position / length : 0 } self.hook(player, update) self.hook(player, update, "position") self.poll(1000, update) }, }) const positionLabel = Widget.Label({ class_name: "position", hpack: "start", setup: self => { const update = (_: unknown, time?: number) => { self.label = lengthStr(time || player.position) self.visible = player.length > 0 } self.hook(player, update, "position") self.poll(1000, update) }, }) const lengthLabel = Widget.Label({ class_name: "length", hpack: "end", visible: player.bind("length").as(l => l > 0), label: player.bind("length").as(lengthStr), }) const playericon = Widget.Icon({ class_name: "icon", hexpand: true, hpack: "end", vpack: "start", tooltip_text: player.identity || "", icon: Utils.merge([player.bind("entry"), media.monochromeIcon.bind()], (e, s) => { const name = `${e}${s ? "-symbolic" : ""}` return icon(name, icons.fallback.audio) }), }) const playPause = Widget.Button({ class_name: "play-pause", on_clicked: () => player.playPause(), visible: player.bind("can_play"), child: Widget.Icon({ icon: player.bind("play_back_status").as(s => { switch (s) { case "Playing": return icons.mpris.playing case "Paused": case "Stopped": return icons.mpris.stopped } }), }), }) const prev = Widget.Button({ on_clicked: () => player.previous(), visible: player.bind("can_go_prev"), child: Widget.Icon(icons.mpris.prev), }) const next = Widget.Button({ on_clicked: () => player.next(), visible: player.bind("can_go_next"), child: Widget.Icon(icons.mpris.next), }) return Widget.Box( { class_name: "player", vexpand: false }, cover, Widget.Box( { vertical: true }, Widget.Box([ title, playericon, ]), artist, Widget.Box({ vexpand: true }), positionSlider, Widget.CenterBox({ class_name: "footer horizontal", start_widget: positionLabel, center_widget: Widget.Box([ prev, playPause, next, ]), end_widget: lengthLabel, }), ), ) } export const Media = () => Widget.Box({ vertical: true, class_name: "media vertical", children: players.as(p => p.map(Player)), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/MicMute.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" const { microphone } = await Service.import("audio") const icon = () => microphone.is_muted || microphone.stream?.is_muted ? icons.audio.mic.muted : icons.audio.mic.high const label = () => microphone.is_muted || microphone.stream?.is_muted ? "Muted" : "Unmuted" export const MicMute = () => SimpleToggleButton({ icon: Utils.watch(icon(), microphone, icon), label: Utils.watch(label(), microphone, label), toggle: () => microphone.is_muted = !microphone.is_muted, connection: [microphone, () => microphone?.is_muted || false], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Network.ts ================================================ import { Menu, ArrowToggleButton } from "../ToggleButton" import icons from "lib/icons.js" import { dependencies, sh } from "lib/utils" import options from "options" const { wifi } = await Service.import("network") export const NetworkToggle = () => ArrowToggleButton({ name: "network", icon: wifi.bind("icon_name"), label: wifi.bind("ssid").as(ssid => ssid || "Not Connected"), connection: [wifi, () => wifi.enabled], deactivate: () => wifi.enabled = false, activate: () => { wifi.enabled = true wifi.scan() }, }) export const WifiSelection = () => Menu({ name: "network", icon: wifi.bind("icon_name"), title: "Wifi Selection", content: [ Widget.Box({ vertical: true, setup: self => self.hook(wifi, () => self.children = wifi.access_points.map(ap => Widget.Button({ on_clicked: () => { if (dependencies("nmcli")) Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`) }, child: Widget.Box({ children: [ Widget.Icon(ap.iconName), Widget.Label(ap.ssid || ""), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: "end", setup: self => Utils.idle(() => { if (!self.is_destroyed) self.visible = ap.active }), }), ], }), })), ), }), Widget.Separator(), Widget.Button({ on_clicked: () => sh(options.quicksettings.networkSettings.value), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Network"), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/quicksettings/widgets/Volume.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import { type Stream } from "types/service/audio" import { Arrow, Menu } from "../ToggleButton" import { dependencies, icon, sh } from "lib/utils" import icons from "lib/icons.js" const audio = await Service.import("audio") type Type = "microphone" | "speaker" const VolumeIndicator = (type: Type = "speaker") => Widget.Button({ vpack: "center", on_clicked: () => audio[type].is_muted = !audio[type].is_muted, child: Widget.Icon({ icon: audio[type].bind("icon_name") .as(i => icon(i || "", icons.audio.mic.high)), tooltipText: audio[type].bind("volume") .as(vol => `Volume: ${Math.floor(vol * 100)}%`), }), }) const VolumeSlider = (type: Type = "speaker") => Widget.Slider({ hexpand: true, draw_value: false, on_change: ({ value, dragging }) => dragging && (audio[type].volume = value), value: audio[type].bind("volume"), }) export const Volume = () => Widget.Box({ class_name: "volume", children: [ VolumeIndicator("speaker"), VolumeSlider("speaker"), Widget.Box({ vpack: "center", child: Arrow("sink-selector"), }), Widget.Box({ vpack: "center", child: Arrow("app-mixer"), visible: audio.bind("apps").as(a => a.length > 0), }), ], }) export const Microhone = () => Widget.Box({ class_name: "slider horizontal", visible: audio.bind("recorders").as(a => a.length > 0), children: [ VolumeIndicator("microphone"), VolumeSlider("microphone"), ], }) const MixerItem = (stream: Stream) => Widget.Box( { hexpand: true, class_name: "mixer-item horizontal", }, Widget.Icon({ tooltip_text: stream.bind("name").as(n => n || ""), icon: stream.bind("name").as(n => { return Utils.lookUpIcon(n || "") ? (n || "") : icons.fallback.audio }), }), Widget.Box( { vertical: true }, Widget.Label({ xalign: 0, truncate: "end", max_width_chars: 28, label: stream.bind("description").as(d => d || ""), }), Widget.Slider({ hexpand: true, draw_value: false, value: stream.bind("volume"), on_change: ({ value }) => stream.volume = value, }), ), ) const SinkItem = (stream: Stream) => Widget.Button({ hexpand: true, on_clicked: () => audio.speaker = stream, child: Widget.Box({ children: [ Widget.Icon({ icon: icon(stream.icon_name || "", icons.fallback.audio), tooltip_text: stream.icon_name || "", }), Widget.Label((stream.description || "").split(" ").slice(0, 4).join(" ")), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: "end", visible: audio.speaker.bind("stream").as(s => s === stream.stream), }), ], }), }) const SettingsButton = () => Widget.Button({ on_clicked: () => { if (dependencies("pavucontrol")) sh("pavucontrol") }, hexpand: true, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Settings"), ], }), }) export const AppMixer = () => Menu({ name: "app-mixer", icon: icons.audio.mixer, title: "App Mixer", content: [ Widget.Box({ vertical: true, class_name: "vertical mixer-item-box", children: audio.bind("apps").as(a => a.map(MixerItem)), }), Widget.Separator(), SettingsButton(), ], }) export const SinkSelector = () => Menu({ name: "sink-selector", icon: icons.audio.type.headset, title: "Sink Selector", content: [ Widget.Box({ vertical: true, children: audio.bind("speakers").as(a => a.map(SinkItem)), }), Widget.Separator(), SettingsButton(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/Group.ts ================================================ import Row from "./Row" export default (title: string, ...rows: ReturnType>[]) => Widget.Box({ class_name: "group", vertical: true, children: [ Widget.Label({ hpack: "start", class_name: "group-title", label: title, setup: w => Utils.idle(() => w.visible = !!title), }), Widget.Box({ vertical: true, children: rows, }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/Page.ts ================================================ import Group from "./Group" export default ( name: string, icon: string, ...groups: ReturnType>[] ) => Widget.Box({ class_name: "page", attribute: { name, icon }, child: Widget.Scrollable({ css: "min-height: 300px;", child: Widget.Box({ vexpand: true, vertical: true, children: groups, }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/Row.ts ================================================ import { Opt } from "lib/option" import Setter from "./Setter" import type Gtk from "gi://Gtk?version=3.0" import icons from "lib/icons" export type RowProps = { opt: Opt title: string note?: string type?: | "number" | "color" | "float" | "object" | "string" | "enum" | "boolean" | "img" | "font" enums?: string[] max?: number min?: number } export default (props: RowProps) => Widget.Box( { class_name: "row", tooltip_text: props.note ? `note: ${props.note}` : "", }, Widget.Box( { vertical: true, vpack: "center" }, Widget.Label({ xalign: 0, class_name: "row-title", label: props.title, }), Widget.Label({ xalign: 0, class_name: "id", label: props.opt.id, }), ), Widget.Box({ hexpand: true }), Widget.Box( { vpack: "center" }, Setter(props), ), Widget.Button({ vpack: "center", class_name: "reset", child: Widget.Icon(icons.ui.refresh), on_clicked: () => props.opt.reset(), sensitive: props.opt.bind().as(v => v !== props.opt.initial), }), ) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/Setter.ts ================================================ import { type RowProps } from "./Row" import { Opt } from "lib/option" import icons from "lib/icons" import Gdk from "gi://Gdk" function EnumSetter(opt: Opt, values: string[]) { const lbl = Widget.Label({ label: opt.bind().as(v => `${v}`) }) const step = (dir: 1 | -1) => { const i = values.findIndex(i => i === lbl.label) opt.setValue(dir > 0 ? i + dir > values.length - 1 ? values[0] : values[i + dir] : i + dir < 0 ? values[values.length - 1] : values[i + dir], ) } const next = Widget.Button({ child: Widget.Icon(icons.ui.arrow.right), on_clicked: () => step(+1), }) const prev = Widget.Button({ child: Widget.Icon(icons.ui.arrow.left), on_clicked: () => step(-1), }) return Widget.Box({ class_name: "enum-setter", children: [lbl, prev, next], }) } export default function Setter({ opt, type = typeof opt.value as RowProps["type"], enums, max = 1000, min = 0, }: RowProps) { switch (type) { case "number": return Widget.SpinButton({ setup(self) { self.set_range(min, max) self.set_increments(1, 5) self.on("value-changed", () => opt.value = self.value as T) self.hook(opt, () => self.value = opt.value as number) }, }) case "float": case "object": return Widget.Entry({ on_accept: self => opt.value = JSON.parse(self.text || ""), setup: self => self.hook(opt, () => self.text = JSON.stringify(opt.value)), }) case "string": return Widget.Entry({ on_accept: self => opt.value = self.text as T, setup: self => self.hook(opt, () => self.text = opt.value as string), }) case "enum": return EnumSetter(opt as unknown as Opt, enums!) case "boolean": return Widget.Switch() .on("notify::active", self => opt.value = self.active as T) .hook(opt, self => self.active = opt.value as boolean) case "img": return Widget.FileChooserButton() .on("selection-changed", self => { opt.value = self.get_uri()?.replace("file://", "") as T }) case "font": return Widget.FontButton({ show_size: false, use_size: false, setup: self => self .hook(opt, () => self.font = opt.value as string) .on("font-set", ({ font }) => opt.value = font! .split(" ").slice(0, -1).join(" ") as T), }) case "color": return Widget.ColorButton({ setup: self => self .hook(opt, () => { const rgba = new Gdk.RGBA() rgba.parse(opt.value as string) self.rgba = rgba }) .on("color-set", ({ rgba: { red, green, blue } }) => { const hex = (n: number) => { const c = Math.floor(255 * n).toString(16) return c.length === 1 ? `0${c}` : c } opt.value = `#${hex(red)}${hex(green)}${hex(blue)}` as T }), }) default: return Widget.Label({ label: `no setter with type ${type}`, }) } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/SettingsDialog.ts ================================================ import RegularWindow from "widget/RegularWindow" import layout from "./layout" import icons from "lib/icons" import options from "options" const current = Variable(layout[0].attribute.name) const Header = () => Widget.CenterBox({ class_name: "header", start_widget: Widget.Button({ class_name: "reset", on_clicked: options.reset, hpack: "start", vpack: "start", child: Widget.Icon(icons.ui.refresh), tooltip_text: "Reset", }), center_widget: Widget.Box({ class_name: "pager horizontal", children: layout.map(({ attribute: { name, icon } }) => Widget.Button({ xalign: 0, class_name: current.bind().as(v => `${v === name ? "active" : ""}`), on_clicked: () => current.value = name, child: Widget.Box([ Widget.Icon(icon), Widget.Label(name), ]), })), }), end_widget: Widget.Button({ class_name: "close", hpack: "end", vpack: "start", child: Widget.Icon(icons.ui.close), on_clicked: () => App.closeWindow("settings-dialog"), }), }) const PagesStack = () => Widget.Stack({ transition: "slide_left_right", children: layout.reduce((obj, page) => ({ ...obj, [page.attribute.name]: page }), {}), shown: current.bind() as never, }) export default () => RegularWindow({ name: "settings-dialog", class_name: "settings-dialog", title: "Settings", setup(win) { win.on("delete-event", () => { win.hide() return true }) win.set_default_size(500, 600) }, child: Widget.Box({ vertical: true, children: [ Header(), PagesStack(), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/layout.ts ================================================ /* eslint-disable max-len */ import Row from "./Row" import Group from "./Group" import Page from "./Page" import options from "options" import icons from "lib/icons" const { wallpaper: wp, autotheme: at, font, theme, bar: b, applauncher: al, overview: ov, powermenu: pm, quicksettings: qs, osd, } = options const { dark, light, blur, scheme, padding, spacing, radius, shadows, widget, border, } = theme export default [ Page("Theme", icons.ui.themes, Group("", Row({ opt: wp, title: "Wallpaper", type: "img" }), Row({ opt: at, title: "Auto Generate Color Scheme" }), Row({ opt: scheme, title: "Color Scheme", type: "enum", enums: ["dark", "light"] }), Row({ opt: blur, title: "Blur", note: "0 to disable", max: 70 }), ), Group("Dark Colors", Row({ opt: dark.bg, title: "Background", type: "color" }), Row({ opt: dark.fg, title: "Foreground", type: "color" }), Row({ opt: dark.primary.bg, title: "Primary", type: "color" }), Row({ opt: dark.primary.fg, title: "On Primary", type: "color" }), Row({ opt: dark.error.bg, title: "Error", type: "color" }), Row({ opt: dark.error.fg, title: "On Error", type: "color" }), Row({ opt: dark.widget, title: "Widget", type: "color" }), Row({ opt: dark.border, title: "Border", type: "color" }), ), Group("Light Colors", Row({ opt: light.bg, title: "Background", type: "color" }), Row({ opt: light.fg, title: "Foreground", type: "color" }), Row({ opt: light.primary.bg, title: "Primary", type: "color" }), Row({ opt: light.primary.fg, title: "On Primary", type: "color" }), Row({ opt: light.error.bg, title: "Error", type: "color" }), Row({ opt: light.error.fg, title: "On Error", type: "color" }), Row({ opt: light.widget, title: "Widget", type: "color" }), Row({ opt: light.border, title: "Border", type: "color" }), ), Group("Theme", Row({ opt: shadows, title: "Shadows" }), Row({ opt: widget.opacity, title: "Widget Opacity", max: 100 }), Row({ opt: border.opacity, title: "Border Opacity", max: 100 }), Row({ opt: border.width, title: "Border Width" }), ), Group("UI", Row({ opt: padding, title: "Padding" }), Row({ opt: spacing, title: "Spacing" }), Row({ opt: radius, title: "Roundness" }), Row({ opt: font.size, title: "Font Size" }), Row({ opt: font.name, title: "Font Name", type: "font" }), ), ), Page("Bar", icons.ui.toolbars, Group("General", Row({ opt: b.flatButtons, title: "Flat Buttons" }), Row({ opt: b.position, title: "Position", type: "enum", enums: ["top", "bottom"] }), Row({ opt: b.corners, title: "Corners" }), ), Group("Launcher", Row({ opt: b.launcher.icon.icon, title: "Icon" }), Row({ opt: b.launcher.icon.colored, title: "Colored Icon" }), Row({ opt: b.launcher.label.label, title: "Label" }), Row({ opt: b.launcher.label.colored, title: "Colored Label" }), ), Group("Workspaces", Row({ opt: b.workspaces.workspaces, title: "Number of Workspaces", note: "0 to make it dynamic" }), ), Group("Taskbar", Row({ opt: b.taskbar.monochrome, title: "Monochrome" }), Row({ opt: b.taskbar.exclusive, title: "Exclusive to workspaces" }), ), Group("Date", Row({ opt: b.date.format, title: "Date Format" }), ), Group("Media", Row({ opt: b.media.monochrome, title: "Monochrome" }), Row({ opt: b.media.preferred, title: "Preferred Player" }), Row({ opt: b.media.direction, title: "Slide Direction", type: "enum", enums: ["left", "right"] }), Row({ opt: b.media.length, title: "Max Length of Label" }), ), Group("Battery", Row({ opt: b.battery.bar, title: "Style", type: "enum", enums: ["hidden", "regular", "whole"] }), Row({ opt: b.battery.blocks, title: "Number of Blocks" }), Row({ opt: b.battery.width, title: "Width of Bar" }), Row({ opt: b.battery.charging, title: "Charging Color", type: "color" }), ), Group("Powermenu", Row({ opt: b.powermenu.monochrome, title: "Monochrome" }), ), ), Page("General", icons.ui.settings, Group("Applauncher", Row({ opt: al.iconSize, title: "Icon Size" }), Row({ opt: al.width, title: "Width" }), Row({ opt: al.maxItem, title: "Max Items" }), ), Group("Overview", Row({ opt: ov.scale, title: "Scale", max: 100 }), Row({ opt: ov.workspaces, title: "workspaces", max: 11, note: "set this to 0 to make it dynamic" }), Row({ opt: ov.monochromeIcon, title: "Monochrome Icons" }), ), Group("Powermenu", Row({ opt: pm.layout, title: "Layout", type: "enum", enums: ["box", "line"] }), Row({ opt: pm.labels, title: "Show Labels" }), ), Group("Quicksettings", Row({ opt: qs.avatar.image, title: "Avatar", type: "img" }), Row({ opt: qs.avatar.size, title: "Avatar Size" }), Row({ opt: qs.media.monochromeIcon, title: "Media Monochrome Icons" }), Row({ opt: qs.media.coverSize, title: "Media Cover Art Size" }), ), Group("On Screen Indicator", Row({ opt: osd.progress.vertical, title: "Vertical" }), Row({ opt: osd.progress.pack.h, title: "Horizontal Alignment", type: "enum", enums: ["start", "center", "end"] }), Row({ opt: osd.progress.pack.v, title: "Vertical Alignment", type: "enum", enums: ["start", "center", "end"] }), ), ), ] as const ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags/widget/settings/settingsdialog.scss ================================================ window.settings-dialog { background-color: $bg; color: $fg; .header { .pager { @include spacing(.5); } padding: $padding; button { @include button; font-weight: bold; padding: $padding*.5 $padding; box { @include spacing($spacing: .3em); } } button.close { padding: $padding * .4; } button.reset { @include button($flat: true); padding: $padding*.5; } } .page { padding: $padding*2; padding-top: 0; } .group { .group-title { color: $primary-bg; margin-bottom: $spacing*.5; } &:not(:first-child) { margin-top: $spacing; } } .row { background-color: $widget-bg; padding: $padding; border: $border; border-top: none; &:first-child { border-radius: $radius $radius 0 0; border: $border; } &:last-child { border-radius: 0 0 $radius $radius; } &:first-child:last-child { border-radius: $radius; border: $border; } button.reset { margin-left: $spacing; } label.id, label.note { color: transparentize($fg, .4) } entry, button { @include button; padding: $padding; } switch { @include switch; } spinbutton { @include unset; entry { border-radius: $radius 0 0 $radius; } button { border-radius: 0; } button:last-child { border-radius: 0 $radius $radius 0; } } .enum-setter { label { background-color: $widget-bg; border: $border; padding: 0 $padding; border-radius: $radius 0 0 $radius; } button { border-radius: 0; } button:last-child { border-radius: 0 $radius $radius 0; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/.eslintrc.yml ================================================ env: es2021: true extends: eslint:recommended overrides: [] parserOptions: ecmaVersion: latest sourceType: 'module' rules: arrow-parens: - error - as-needed comma-dangle: - error - always-multiline comma-spacing: - error - before: false after: true comma-style: - error - last curly: - error - multi-or-nest - consistent dot-location: - error - property eol-last: error indent: - error - 4 - SwitchCase: 1 keyword-spacing: - error - before: true lines-between-class-members: - error - always - exceptAfterSingleLine: true padded-blocks: - error - never - allowSingleLineBlocks: false prefer-const: error quotes: - error - single - avoidEscape: true semi: - error - always nonblock-statement-body-position: - error - below no-trailing-spaces: - error array-bracket-spacing: - error - never key-spacing: - error - beforeColon: false afterColon: true object-curly-spacing: - error - always no-useless-escape: - off globals: pkg: readonly ags: readonly ARGV: readonly imports: readonly print: readonly console: readonly logError: readonly ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/.gitignore ================================================ node_modules types package-lock.json weather_key setup.sh ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/.stylelintrc.yml ================================================ extends: stylelint-config-standard-scss ignoreFiles: - "**/*.js" - "**/*.ts" rules: selector-type-no-unknown: null declaration-empty-line-before: null no-descending-specificity: null selector-pseudo-class-no-unknown: null color-function-notation: legacy alpha-value-notation: number scss/operator-no-unspaced: null scss/no-global-function-names: null scss/dollar-variable-empty-line-before: null ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/config.js ================================================ import { readFile } from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; const pkgjson = JSON.parse(readFile(App.configDir + '/package.json')); import GLib from 'gi://GLib'; const SKIP_CHECK = 'AGS_SKIP_V_CHECK'; const v = { ags: `v${pkg.version}`, expected: `v${pkgjson.version}`, check: !GLib.getenv(SKIP_CHECK), }; function mismatch() { print(`my config expects ${v.expected}, but your ags is ${v.ags}`); print(`to skip the check run "${SKIP_CHECK}=true ags"`); App.connect('config-parsed', app => app.Quit()); return {}; } export default v.ags === v.expected || !v.check ? (await import('./js/main.js')).default : mismatch(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/about/about.js ================================================ import PopupWindow from '../misc/PopupWindow.js'; import icons from '../icons.js'; const pkg = JSON.parse(Utils.readFile(App.configDir + '/package.json')); const show = JSON.parse(Utils.readFile(Utils.CACHE_DIR + '/show_about') || 'true'); const dontShow = () => Utils.writeFile('false', Utils.CACHE_DIR + '/show_about'); const avatar = App.configDir + '/assets/od_fsociety.png'; /** * @param {Object} o * @param {string} o.label * @param {string} o.link */ const LinkButton = ({ label, link }) => Widget.Button({ on_clicked: () => Utils.execAsync(['xdg-open', link]), child: Widget.Box({ children: [ Widget.Label({ label, hexpand: true, xalign: 0 }), Widget.Icon(icons.ui.link), ], }), }); export default () => PopupWindow({ name: 'about', transition: 'slide_down', child: Widget.Box({ vertical: true, class_name: 'window-content', children: [ Widget.Box({ class_name: 'avatar', hpack: 'center', css: `background-image: url('${avatar}');`, }), Widget.Box({ vertical: true, class_name: 'labels vertical', children: [ Widget.Label({ class_name: 'title', label: pkg.description, }), Widget.Label({ class_name: 'author', label: pkg.author, }), Widget.Label({ class_name: 'version', hpack: 'center', label: pkg.version, }), ], }), Widget.Box({ class_name: 'buttons', vertical: true, vexpand: true, vpack: 'end', children: [ LinkButton({ label: 'Support me on Ko-fi', link: pkg.kofi, }), LinkButton({ label: 'Report an Issue', link: pkg.bugs.url, }), ], }), Widget.Button({ class_name: 'dont-show', on_clicked: () => { dontShow(); App.toggleWindow('about'); }, child: Widget.Box({ children: [ Widget.Label("Don't show again"), Widget.Box({ hexpand: true }), Widget.Icon(icons.ui.close), ], }), }), ], }), }); export function showAbout(force = false) { if (show || force) App.toggleWindow('about'); } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/applauncher/AppItem.js ================================================ import options from '../options.js'; /** @param {import('resource:///com/github/Aylur/ags/service/applications.js').Application} app */ export default app => { const title = Widget.Label({ class_name: 'title', label: app.name, xalign: 0, vpack: 'center', truncate: 'end', }); const description = Widget.Label({ class_name: 'description', label: app.description || '', wrap: true, xalign: 0, justification: 'left', vpack: 'center', }); const icon = Widget.Icon({ icon: Utils.lookUpIcon(app.icon_name || '') ? app.icon_name || '' : '', size: options.applauncher.icon_size.bind('value'), }); const textBox = Widget.Box({ vertical: true, vpack: 'center', children: app.description ? [title, description] : [title], }); return Widget.Button({ class_name: 'app-item', attribute: app, child: Widget.Box({ children: [icon, textBox], }), on_clicked: () => { App.closeWindow('applauncher'); app.launch(); }, }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/applauncher/Applauncher.js ================================================ import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import PopupWindow from '../misc/PopupWindow.js'; import AppItem from './AppItem.js'; import icons from '../icons.js'; import { launchApp } from '../utils.js'; import options from '../options.js'; const WINDOW_NAME = 'applauncher'; const Applauncher = () => { const mkItems = () => [ Widget.Separator({ hexpand: true }), ...Applications.query('').flatMap(app => Widget.Revealer({ setup: w => w.attribute = { app, revealer: w }, child: Widget.Box({ vertical: true, children: [ Widget.Separator({ hexpand: true }), AppItem(app), Widget.Separator({ hexpand: true }), ], }), })), Widget.Separator({ hexpand: true }), ]; let items = mkItems(); const list = Widget.Box({ class_name: 'app-list', vertical: true, children: items, }); const entry = Widget.Entry({ hexpand: true, primary_icon_name: icons.apps.search, // set some text so on-change works the first time text: '-', on_accept: ({ text }) => { const list = Applications.query(text || ''); if (list[0]) { App.toggleWindow(WINDOW_NAME); launchApp(list[0]); } }, on_change: ({ text }) => items.map(item => { if (item.attribute) { const { app, revealer } = item.attribute; revealer.reveal_child = app.match(text); } }), }); return Widget.Box({ vertical: true, children: [ entry, Widget.Scrollable({ hscroll: 'never', child: list, }), ], setup: self => self.hook(App, (_, win, visible) => { if (win !== WINDOW_NAME) return; entry.text = '-'; entry.text = ''; if (visible) { entry.grab_focus(); } else { items = mkItems(); list.children = items; } }), }); }; export default () => PopupWindow({ name: WINDOW_NAME, transition: 'slide_down', child: Applauncher(), anchor: options.applauncher.anchor.bind('value'), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/PanelButton.js ================================================ /** * @typedef {Object} PanelButtonProps * @property {import('types/widgets/button').ButtonProps['child']} content * @property {string=} window */ /** * @param {import('types/widgets/button').ButtonProps & PanelButtonProps} o */ export default ({ class_name, content, window = '', setup, ...rest }) => Widget.Button({ class_name: `panel-button ${class_name}`, child: Widget.Box({ children: [content] }), setup: self => { let open = false; self.hook(App, (_, win, visible) => { if (win !== window) return; if (open && !visible) { open = false; self.toggleClassName('active', false); } if (visible) { open = true; self.toggleClassName('active'); } }); if (setup) setup(self); }, ...rest, }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/TopBar.js ================================================ import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import OverviewButton from './buttons/OverviewButton.js'; import Workspaces from './buttons/Workspaces.js'; import DateButton from './buttons/DateButton.js'; import SysTray from './buttons/SysTray.js'; import ColorPicker from './buttons/ColorPicker.js'; import SystemIndicators from './buttons/SystemIndicators.js'; import PowerMenu from './buttons/PowerMenu.js'; import ScreenRecord from './buttons/ScreenRecord.js'; import BatteryBar from './buttons/BatteryBar.js'; import SubMenu from './buttons/SubMenu.js'; import Recorder from '../services/screenrecord.js'; import options from '../options.js'; import * as vars from '../variables.js'; const submenuItems = Variable(1); SystemTray.connect('changed', () => { submenuItems.setValue(SystemTray.items.length + 1); }); /** * @template {import('types/service').default} T * @param {T=} service * @param {(self: T) => boolean=} condition */ const SeparatorDot = (service, condition) => Widget.Separator({ vpack: 'center', setup: self => { const visibility = () => { if (!options.bar.separators.value) return self.visible = false; self.visible = condition && service ? condition(service) : options.bar.separators.value; }; if (service && condition) self.hook(service, visibility); self.on('draw', visibility); self.bind('visible', options.bar.separators); }, }); const Start = () => Widget.Box({ class_name: 'start', children: [ OverviewButton(), SeparatorDot(), Workspaces(), Widget.Box({ hexpand: true }), ], }); const Center = () => Widget.Box({ class_name: 'center', children: [ DateButton(), ], }); const SysProgress = (type, title, unit) => Widget.Box({ class_name: `circular-progress-box ${type}`, hexpand: false, binds: [['tooltipText', vars[type], 'value', v => `${title}: ${Math.floor(v * 100)}${unit}`]], child: Widget.CircularProgress({ hexpand: true, inverted: false, class_name: `circular-progress ${type}`, binds: [['value', vars[type]]], start_at: 0.75, }), }); const End = () => Widget.Box({ class_name: 'end', children: [ Widget.Box({ hexpand: true }), SubMenu({ items: submenuItems, children: [ SysTray(), ColorPicker(), ], }), Widget.Box({ class_name: 'system-info horizontal', children: [ SysProgress('cpu', 'Cpu', '%'), SysProgress('ram', 'Ram', '%'), SysProgress('temp', 'Temperature', '°'), ], }), SeparatorDot(), ScreenRecord(), SeparatorDot(Recorder, r => r.recording), BatteryBar(Battery, b => b.available), SeparatorDot(Battery, b => b.available), SystemIndicators(), SeparatorDot(), PowerMenu(), ], }); /** @param {number} monitor */ export default monitor => Widget.Window({ name: `bar${monitor}`, class_name: 'transparent', exclusivity: 'exclusive', monitor, anchor: options.bar.position.bind('value').transform(pos => ([ pos, 'left', 'right', ])), child: Widget.CenterBox({ class_name: 'panel', start_widget: Start(), center_widget: Center(), end_widget: End(), }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/BatteryBar.js ================================================ import Widget from "resource:///com/github/Aylur/ags/widget.js"; import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; import icons from "../../icons.js"; import FontIcon from "../../misc/FontIcon.js"; import options from "../../options.js"; import PanelButton from "../PanelButton.js"; const Indicator = () => Widget.Stack({ children: { true: FontIcon(icons.battery.charging) }, visible: options.battery.bar.show_icon.bind("value"), setup: (self) => self.hook(Battery, () => { self.shown = `${Battery.charging || Battery.charged}`; }), }); const PercentLabel = () => Widget.Revealer({ transition: "slide_right", binds: [["reveal-child", options.battery.show_percentage]], child: Widget.Label({ binds: [["label", Battery, "percent", (p) => `${p}%`]], }), }); const LevelBar = () => Widget.LevelBar({ connections: [ [ options.battery.bar.full, (self) => { const full = options.battery.bar.full.value; self.vpack = full ? "fill" : "center"; self.hpack = full ? "fill" : "center"; }, ], ], binds: [["value", Battery, "percent", (p) => p / 100]], }); const WholeButton = () => Widget.Overlay({ class_name: "whole-button", child: LevelBar(), pass_through: true, overlays: [ Widget.Box({ hpack: "center", children: [ FontIcon({ icon: icons.battery.charging, binds: [["visible", Battery, "charging"]], }), Widget.Box({ hpack: "center", vpack: "center", child: PercentLabel(), }), ], }), ], }); export default () => PanelButton({ class_name: "battery-bar", on_clicked: () => { const v = options.battery.show_percentage.value; options.battery.show_percentage.value = !v; }, content: Widget.Box({ connections: [ [ Battery, (w) => { w.toggleClassName("charging", Battery.charging || Battery.charged); w.toggleClassName( "medium", Battery.percent < options.battery.medium.value, ); w.toggleClassName( "low", Battery.percent < options.battery.low.value, ); w.toggleClassName("half", Battery.percent < 48); }, ], ], binds: [ ["visible", Battery, "available"], [ "children", options.battery.bar.full, "value", (full) => full ? [WholeButton()] : [Indicator(), PercentLabel(), LevelBar()], ], ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/ColorPicker.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Colors from '../../services/colorpicker.js'; import PanelButton from '../PanelButton.js'; import Gdk from 'gi://Gdk'; export default () => PanelButton({ class_name: 'color-picker', content: Widget.Icon('color-select-symbolic'), binds: [['tooltip-text', Colors, 'colors', v => `${v.length} colors`]], on_clicked: () => Colors.pick(), on_secondary_click: btn => { if (Colors.colors.length === 0) return; Widget.Menu({ class_name: 'colorpicker', children: Colors.colors.map(color => Widget.MenuItem({ child: Widget.Label(color), css: `background-color: ${color}`, on_activate: () => Colors.wlCopy(color), })), }).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null); }, }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/DateButton.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Clock from '../../misc/Clock.js'; import PanelButton from '../PanelButton.js'; export default ({ format = '%d.%m.%y - %H:%M' } = {}) => PanelButton({ class_name: 'dashboard panel-button', on_clicked: () => App.toggleWindow('dashboard'), window: 'dashboard', content: Clock({ format }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/FocusedClient.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import PanelButton from '../PanelButton.js'; import options from '../../options.js'; import { substitute } from '../../utils.js'; export const ClientLabel = () => Widget.Label({ binds: [['label', Hyprland.active.client, 'class', c => { const { titles } = options.substitutions; return substitute(titles, c); }]], }); export const ClientIcon = () => Widget.Icon({ connections: [[Hyprland.active.client, self => { const { icons } = options.substitutions; const { client } = Hyprland.active; const classIcon = substitute(icons, client.class) + '-symbolic'; const titleIcon = substitute(icons, client.class) + '-symbolic'; const hasTitleIcon = Utils.lookUpIcon(titleIcon); const hasClassIcon = Utils.lookUpIcon(classIcon); if (hasClassIcon) self.icon = classIcon; if (hasTitleIcon) self.icon = titleIcon; self.visible = !!(hasTitleIcon || hasClassIcon); }]], }); export default () => PanelButton({ class_name: 'focused-client', content: Widget.Box({ children: [ ClientIcon(), ClientLabel(), ], binds: [['tooltip-text', Hyprland.active, 'client', c => c.title]], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/MediaIndicator.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; import * as mpris from '../../misc/mpris.js'; import options from '../../options.js'; export const getPlayer = (name = options.mpris.preferred.value) => Mpris.getPlayer(name) || Mpris.players[0] || null; /** * @param {Object} o * @param {import('types/service/mpris').MprisPlayer} o.player * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ const Indicator = ({ player, direction = 'right' }) => HoverRevealer({ class_name: `media panel-button ${player.name}`, direction, on_primary_click: () => player.playPause(), on_scroll_up: () => player.next(), on_scroll_down: () => player.previous(), on_secondary_click: () => player.playPause(), indicator: mpris.PlayerIcon(player), child: Widget.Label({ vexpand: true, truncate: 'end', max_width_chars: 40, connections: [[player, label => { label.label = `${player.track_artists.join(', ')} - ${player.track_title}`; }]], }), connections: [[player, revealer => { if (revealer._current === player.track_title) return; revealer._current = player.track_title; revealer.reveal_child = true; Utils.timeout(3000, () => { revealer.reveal_child = false; }); }]], }); /** * @param {Object} o * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ export default ({ direction = 'right' } = {}) => { let current = null; const update = box => { const player = getPlayer(); box.visible = !!player; if (!player) { current = null; return; } if (current === player) return; current = player; box.children = [Indicator({ player, direction })]; }; return Widget.Box({ connections: [ [options.mpris.preferred, update], [Mpris, update, 'notify::players'], ], }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/NotificationIndicator.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; /** * @param {Object} o * @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction */ export default ({ direction = 'left' } = {}) => HoverRevealer({ class_name: 'notifications panel-button', eventboxConnections: [ ['button-press-event', () => App.openWindow('dashboard')], [Notifications, box => box.visible = Notifications.notifications.length > 0 || Notifications.dnd], ], connections: [[Notifications, revealer => { const title = Notifications.notifications[0]?.summary; if (revealer._title === title) return; revealer._title = title; revealer.reveal_child = true; Utils.timeout(3000, () => { revealer.reveal_child = false; }); }]], direction, indicator: Widget.Icon({ binds: [['icon', Notifications, 'dnd', dnd => dnd ? icons.notifications.silent : icons.notifications.noisy, ]], }), child: Widget.Label({ truncate: 'end', max_width_chars: 40, binds: [['label', Notifications, 'notifications', n => n.reverse()[0]?.summary || '']], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/OverviewButton.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import PanelButton from '../PanelButton.js'; import FontIcon from '../../misc/FontIcon.js'; import { distroIcon } from '../../variables.js'; import options from '../../options.js'; export default () => PanelButton({ class_name: 'overview', window: 'overview', on_clicked: () => App.toggleWindow('overview'), content: FontIcon({ binds: [['icon', options.bar.icon, 'value', v => { return v === 'distro-icon' ? distroIcon : v; }]], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/PowerMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import icons from '../../icons.js'; import PanelButton from '../PanelButton.js'; export default () => PanelButton({ class_name: 'powermenu', content: Widget.Icon(icons.powermenu.shutdown), on_clicked: () => App.openWindow('powermenu'), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/ScreenRecord.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import Recorder from '../../services/screenrecord.js'; import icons from '../../icons.js'; export default () => PanelButton({ class_name: 'recorder', on_clicked: () => Recorder.stop(), binds: [['visible', Recorder, 'recording']], content: Widget.Box({ children: [ Widget.Icon(icons.recorder.recording), Widget.Label({ binds: [['label', Recorder, 'timer', time => { const sec = time % 60; const min = Math.floor(time / 60); return `${min}:${sec < 10 ? '0' + sec : sec}`; }]], }), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/SubMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import icons from '../../icons.js'; import options from '../../options.js'; /** * @param {import('types/widgets/revealer').default} revealer * @param {'left' | 'right' | 'up' | 'down'} direction * @param {import('types/variable').Variable} items */ const Arrow = (revealer, direction, items) => { let deg = 0; const icon = Widget.Icon({ icon: icons.ui.arrow[direction], }); const animate = () => { const t = options.transition.value / 20; const step = revealer.reveal_child ? 10 : -10; for (let i = 0; i < 18; ++i) { Utils.timeout(t * i, () => { deg += step; icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); }); } }; return Widget.Button({ class_name: 'panel-button sub-menu', connections: [[items, btn => { btn.tooltip_text = `${items.value} Items`; }]], on_clicked: () => { animate(); revealer.reveal_child = !revealer.reveal_child; }, child: icon, }); }; /** * @param {Object} o * @param {import('types/widgets/box').default['children']} o.children * @param {'left' | 'right' | 'up' | 'down'=} o.direction * @param {import('types/variable').Variable} o.items */ export default ({ children, direction = 'left', items = Variable(0) }) => { const posStart = direction === 'up' || direction === 'left'; const posEnd = direction === 'down' || direction === 'right'; const revealer = Widget.Revealer({ transition: `slide_${direction}`, child: Widget.Box({ children, }), }); return Widget.Box({ vertical: direction === 'up' || direction === 'down', children: [ posStart && revealer, Arrow(revealer, direction, items), posEnd && revealer, ], }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/SysTray.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js'; import PanelButton from '../PanelButton.js'; import Gdk from 'gi://Gdk'; /** @param {import('types/service/systemtray').TrayItem} item */ const SysTrayItem = item => PanelButton({ class_name: 'tray-item', content: Widget.Icon({ binds: [['icon', item, 'icon']] }), binds: [['tooltipMarkup', item, 'tooltip-markup']], setup: self => { const id = item.menu?.connect('popped-up', menu => { self.toggleClassName('active'); menu.connect('notify::visible', menu => { self.toggleClassName('active', menu.visible); }); menu.disconnect(id); }); if (id) self.connect('destroy', () => item.menu?.disconnect(id)); }, // @ts-expect-error popup_at_widget missing from types? on_primary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), // @ts-expect-error popup_at_widget missing from types? on_secondary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), }); export default () => Widget.Box({ binds: [['children', SystemTray, 'items', i => i.map(SysTrayItem)]], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/System.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import * as variables from '../../variables.js'; import icons from '../../icons.js'; /** @param {'cpu' | 'ram'} type */ const System = type => { const icon = Widget.Icon({ class_name: 'icon', icon: icons.system[type], }); const progress = Widget.Box({ class_name: 'progress', child: Widget.CircularProgress({ binds: [['value', variables[type]]], }), }); const revealer = Widget.Revealer({ transition: 'slide_right', child: Widget.Label({ binds: [['label', variables[type], 'value', v => { return ` ${type}: ${Math.round(v * 100)}%`; }]], }), }); return PanelButton({ class_name: `system ${type}`, on_clicked: () => revealer.reveal_child = !revealer.reveal_child, content: Widget.EventBox({ on_hover: () => revealer.reveal_child = true, on_hover_lost: () => revealer.reveal_child = false, child: Widget.Box({ children: [ icon, Widget.Box({ class_name: 'revealer', child: revealer, }), progress, ], }), }), }); }; export const CPU = () => System('cpu'); export const RAM = () => System('ram'); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/SystemIndicators.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Network from 'resource:///com/github/Aylur/ags/service/network.js'; import HoverRevealer from '../../misc/HoverRevealer.js'; import PanelButton from '../PanelButton.js'; import Asusctl from '../../services/asusctl.js'; import Indicator from '../../services/onScreenIndicator.js'; import icons from '../../icons.js'; import FontIcon from '../../misc/FontIcon.js'; const ProfileIndicator = () => Widget.Icon() .bind('visible', Asusctl, 'profile', p => p !== 'Balanced') .bind('icon', Asusctl, 'profile', i => icons.asusctl.profile[i]); const ModeIndicator = () => FontIcon() .bind('visible', Asusctl, 'mode', m => m !== 'Hybrid') .bind('icon', Asusctl, 'mode', i => icons.asusctl.mode[i]); const MicrophoneIndicator = () => Widget.Icon().hook(Audio, icon => { if (!Audio.microphone) return; const { muted, low, medium, high } = icons.audio.mic; if (Audio.microphone.is_muted) return icon.icon = muted; /** @type {Array<[number, string]>} */ const cons = [[67, high], [34, medium], [1, low], [0, muted]]; icon.icon = cons.find(([n]) => n <= Audio.microphone.volume * 100)?.[1] || ''; icon.visible = Audio.recorders.length > 0 || Audio.microphone.is_muted; }, 'microphone-changed'); const DNDIndicator = () => Widget.Icon({ visible: Notifications.bind('dnd'), icon: icons.notifications.silent, }); const BluetoothDevicesIndicator = () => Widget.Box().hook(Bluetooth, box => { box.children = Bluetooth.connectedDevices .map(({ iconName, name }) => HoverRevealer({ indicator: Widget.Icon(iconName + '-symbolic'), child: Widget.Label(name), })); box.visible = Bluetooth.connectedDevices.length > 0; }, 'notify::connected-devices'); const BluetoothIndicator = () => Widget.Icon({ class_name: 'bluetooth', icon: icons.bluetooth.enabled, visible: Bluetooth.bind('enabled'), }); const NetworkIndicator = () => Widget.Icon().hook(Network, self => { const icon = Network[Network.primary || 'wifi']?.iconName; self.icon = icon || ''; self.visible = !!icon; }); const AudioIndicator = () => Widget.Icon().hook(Audio, self => { if (!Audio.speaker) return; const { muted, low, medium, high, overamplified } = icons.audio.volume; if (Audio.speaker.is_muted) return self.icon = muted; /** @type {Array<[number, string]>} */ const cons = [[101, overamplified], [67, high], [34, medium], [1, low], [0, muted]]; self.icon = cons.find(([n]) => n <= Audio.speaker.volume * 100)?.[1] || ''; }, 'speaker-changed'); export default () => PanelButton({ class_name: 'quicksettings panel-button', on_clicked: () => App.toggleWindow('quicksettings'), setup: self => self .hook(App, (_, win, visible) => { self.toggleClassName('active', win === 'quicksettings' && visible); }), on_scroll_up: () => { Audio.speaker.volume += 0.02; Indicator.speaker(); }, on_scroll_down: () => { Audio.speaker.volume -= 0.02; Indicator.speaker(); }, content: Widget.Box({ children: [ Asusctl?.available && ProfileIndicator(), Asusctl?.available && ModeIndicator(), DNDIndicator(), BluetoothDevicesIndicator(), BluetoothIndicator(), NetworkIndicator(), AudioIndicator(), MicrophoneIndicator(), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/Taskbar.js ================================================ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import PanelButton from '../PanelButton.js'; import { launchApp } from '../../utils.js'; import icons from '../../icons.js'; const focus = ({ address }) => Hyprland.sendMessage(`dispatch focuswindow address:${address}`); /** @param {import('types/widgets/box').default} box */ const setChildren = box => box.children = Hyprland.clients.map(client => { if (Hyprland.active.workspace.id !== client.workspace.id) return; for (const app of Applications.list) { if (client.class && app.match(client.class)) { return PanelButton({ content: Widget.Icon(app.icon_name || icons.fallback.executable), tooltip_text: app.name, on_primary_click: () => focus(client), on_middle_click: () => launchApp(app), }); } } }); export default () => Widget.Box({ connections: [ [Hyprland, setChildren, 'notify::clients'], [Hyprland, setChildren, 'notify::active'], ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/bar/buttons/Workspaces.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import options from '../../options.js'; import { range } from '../../utils.js'; /** @param {any} arg */ const dispatch = arg => Utils.execAsync(`hyprctl dispatch workspace ${arg}`); const Workspaces = () => { const ws = options.workspaces.value; return Widget.Box({ children: range(ws || 20).map(i => Widget.Button({ setup: btn => btn.id = i, on_clicked: () => dispatch(i), child: Widget.Label({ label: `${i}`, class_name: 'indicator', vpack: 'center', }), connections: [[Hyprland, btn => { btn.toggleClassName('active', Hyprland.active.workspace.id === i); btn.toggleClassName('occupied', Hyprland.getWorkspace(i)?.windows > 0); }]], })), connections: ws ? [] : [[Hyprland.active.workspace, box => box.children.map(btn => { btn.visible = Hyprland.workspaces.some(ws => ws.id === btn.id); })]], }); }; export default () => Widget.EventBox({ class_name: 'workspaces panel-button', child: Widget.Box({ // its nested like this to keep it consistent with other PanelButton widgets child: Widget.EventBox({ on_scroll_up: () => dispatch('m+1'), on_scroll_down: () => dispatch('m-1'), class_name: 'eventbox', binds: [['child', options.workspaces, 'value', Workspaces]], }), }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/dashboard/Dashboard.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import DateColumn from './DateColumn.js'; import NotificationColumn from './NotificationColumn.js'; import PopupWindow from '../misc/PopupWindow.js'; import options from '../options.js'; export default () => PopupWindow({ name: 'dashboard', setup: self => self.hook(options.bar.position, () => { self.anchor = [options.bar.position.value]; self.transition = 'crossfade'; }), child: Widget.Box({ children: [ NotificationColumn(), Widget.Separator({ orientation: 1 }), DateColumn(), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/dashboard/DateColumn.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Clock from '../misc/Clock.js'; import * as vars from '../variables.js'; export default () => Widget.Box({ vertical: true, class_name: 'datemenu vertical', children: [ Widget.Box({ class_name: 'clock-box', vertical: true, children: [ Clock({ format: '%H:%M' }), Widget.Label({ class_name: 'uptime', label: vars.uptime.bind('value').transform(t => `uptime: ${t}`), }), ], }), Widget.Box({ class_name: 'calendar', children: [ Widget.Calendar({ hexpand: true, hpack: 'center', }), ], }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/dashboard/NotificationColumn.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import icons from '../icons.js'; import Notification from '../misc/Notification.js'; import { timeout } from 'resource:///com/github/Aylur/ags/utils.js'; const ClearButton = () => Widget.Button({ on_clicked: () => { const list = Array.from(Notifications.notifications); for (let i = 0; i < list.length; i++) timeout(50 * i, () => list[i]?.close()); }, sensitive: Notifications.bind('notifications').transform(n => n.length > 0), child: Widget.Box({ children: [ Widget.Label('Clear '), Widget.Icon({ icon: Notifications.bind('notifications').transform(n => icons.trash[n.length > 0 ? 'full' : 'empty']), }), ], }), }); const Header = () => Widget.Box({ class_name: 'header', children: [ Widget.Label({ label: 'Notifications', hexpand: true, xalign: 0 }), ClearButton(), ], }); const NotificationList = () => Widget.Box({ vertical: true, vexpand: true, children: Notifications.bind('notifications').transform(n => n.reverse().map(Notification)), visible: Notifications.bind('notifications').transform(n => n.length > 0), }); const Placeholder = () => Widget.Box({ class_name: 'placeholder', vertical: true, vpack: 'center', hpack: 'center', vexpand: true, hexpand: true, visible: Notifications.bind('notifications').transform(n => n.length === 0), children: [ Widget.Icon(icons.notifications.silent), Widget.Label('Your inbox is empty'), ], }); export default () => Widget.Box({ class_name: 'notifications', vertical: true, children: [ Header(), Widget.Scrollable({ vexpand: true, class_name: 'notification-scrollable', child: Widget.Box({ class_name: 'notification-list', vertical: true, children: [ NotificationList(), Placeholder(), ], }), }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/desktop/Desktop.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Clock from '../misc/Clock.js'; import DesktopMenu from './DesktopMenu.js'; import options from '../options.js'; const DesktopClock = () => Widget.Box({ class_name: 'clock-box-shadow', child: Widget.CenterBox({ class_name: 'clock-box', start_widget: Clock({ class_name: 'clock', hpack: 'center', format: '%H', }), center_widget: Widget.Box({ class_name: 'separator-box', vertical: true, hexpand: true, hpack: 'center', children: [ Widget.Separator({ vpack: 'center', vexpand: true }), Widget.Separator({ vpack: 'center', vexpand: true }), ], }), end_widget: Clock({ class_name: 'clock', hpack: 'center', format: '%M', }), }), }); const Desktop = () => Widget.EventBox({ on_secondary_click: (_, event) => DesktopMenu().popup_at_pointer(event), child: Widget.Box({ vertical: true, vexpand: true, hexpand: true, visible: options.desktop.clock.enable.bind('value'), setup: self => self.hook(options.desktop.clock.position, () => { const [hpack = 'center', vpack = 'center', offset = 64] = options.desktop.clock.position.value.split(' ') || []; // @ts-expect-error self.hpack = hpack; self.vpack = vpack; self.setCss(`margin: ${Number(offset)}px;`); }), children: [ DesktopClock(), Clock({ format: '%B %e. %A', class_name: 'date' }), ], }), }); /** @param {number} monitor */ export default monitor => Widget.Window({ monitor, keymode: 'on-demand', name: `desktop${monitor}`, layer: 'background', class_name: 'desktop', anchor: ['top', 'bottom', 'left', 'right'], child: Desktop(), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/desktop/DesktopMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import PowerMenu from '../services/powermenu.js'; import icons from '../icons.js'; import Gtk from 'gi://Gtk'; import { openSettings } from '../settings/theme.js'; /** * @param {string} label * @param {string} icon * @param {import('types/widgets/menu').MenuItemProps['on_activate']} on_activate */ const Item = (label, icon, on_activate) => Widget.MenuItem({ on_activate, child: Widget.Box({ children: [ Widget.Icon(icon), Widget.Label({ label, hexpand: true, xalign: 0, }), ], }), }); export default () => Widget.Menu({ class_name: 'desktop-menu', children: [ Widget.MenuItem({ child: Widget.Box({ children: [ Widget.Icon(icons.powermenu.shutdown), Widget.Label({ label: 'System', hexpand: true, xalign: 0, }), ], }), submenu: Widget.Menu({ children: [ Item('Shutdown', icons.powermenu.shutdown, () => PowerMenu.action('shutdown')), Item('Log Out', icons.powermenu.logout, () => PowerMenu.action('logout')), Item('Reboot', icons.powermenu.reboot, () => PowerMenu.action('reboot')), Item('Sleep', icons.powermenu.sleep, () => PowerMenu.action('reboot')), ], }), }), Item('Applications', icons.apps.apps, () => App.openWindow('applauncher')), new Gtk.SeparatorMenuItem, Item('Settings', icons.ui.settings, openSettings), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/dock/Dock.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../icons.js'; import options from '../options.js'; import { launchApp, range } from '../utils.js'; const focus = ({ address }) => Hyprland.sendMessage(`dispatch focuswindow address:${address}`); /** @param {import('types/widgets/button').ButtonProps & { icon: string, pinned?: boolean }} o */ const AppButton = ({ icon, pinned = false, ...rest }) => { const indicators = Widget.Box({ vpack: 'end', hpack: 'center', children: range(5, 0).map(() => Widget.Box({ class_name: 'indicator', visible: false, })), }); return Widget.Button({ ...rest, attribute: indicators, child: Widget.Box({ class_name: 'box', child: Widget.Overlay({ child: Widget.Icon({ icon, size: options.desktop.dock.icon_size.bind('value'), }), pass_through: true, overlays: pinned ? [indicators] : [], }), }), }); }; const Taskbar = () => Widget.Box({ children: Hyprland.bind('clients').transform(c => c.map(client => { for (const appName of options.desktop.dock.pinned_apps.value) { if (client.class.toLowerCase().includes(appName.toLowerCase())) return null; } for (const app of Applications.list) { if (client.title && app.match(client.title) || client.class && app.match(client.class)) { return AppButton({ icon: app.icon_name || '', tooltip_text: app.name, on_primary_click: () => focus(client), on_middle_click: () => launchApp(app), }); } } })), }); const PinnedApps = () => Widget.Box({ class_name: 'pins', homogeneous: true, children: options.desktop.dock.pinned_apps.bind('value').transform(v => v .map(term => ({ app: Applications.query(term)?.[0], term })) .filter(({ app }) => app) .map(({ app, term }) => AppButton({ pinned: true, icon: app.icon_name || '', on_primary_click: () => { for (const client of Hyprland.clients) { if (client.class.toLowerCase().includes(term)) return focus(client); } launchApp(app); }, on_middle_click: () => launchApp(app), tooltip_text: app.name, setup: button => button.hook(Hyprland, () => { const running = Hyprland.clients .filter(client => client.class.toLowerCase().includes(term)); const focused = running.find(client => client.address === Hyprland.active.client.address); const index = running.findIndex(c => c === focused); for (let i = 0; i < 5; ++i) { const indicator = button.attribute.children[i]; indicator.visible = i < running.length; indicator.toggleClassName('focused', i === index); } button.set_tooltip_text(running.length === 1 ? running[0].title : app.name); }), })), ), }); export default () => { const pinnedapps = PinnedApps(); const taskbar = Taskbar(); const applauncher = AppButton({ class_name: 'launcher nonrunning', icon: icons.apps.apps, tooltip_text: 'Applications', on_clicked: () => App.toggleWindow('applauncher'), }); const separator = Widget.Separator({ vpack: 'center', hpack: 'center', orientation: 1, setup: self => self.hook(taskbar, () => { self.visible = taskbar.children.length > 0; }, 'notify::children'), }); return Widget.Box({ class_name: 'dock', children: [applauncher, pinnedapps, separator, taskbar], }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/dock/FloatingDock.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Dock from './Dock.js'; import options from '../options.js'; /** @param {number} monitor */ export default monitor => { const revealer = Widget.Revealer({ transition: 'slide_up', child: Dock(), setup: self => { const update = () => { const ws = Hyprland.getWorkspace(Hyprland.active.workspace.id); if (Hyprland.getMonitor(monitor)?.name === ws?.monitor) self.reveal_child = ws?.windows === 0; }; self .hook(Hyprland, update, 'client-added') .hook(Hyprland, update, 'client-removed') .hook(Hyprland.active.workspace, update); }, }); return Widget.Window({ monitor, name: `dock${monitor}`, class_name: 'floating-dock', anchor: ['bottom'], child: Widget.Box({ children: [ revealer, Widget.Box({ class_name: 'padding', css: 'padding: 2px;', }), ], }), setup: self => self .on('enter-notify-event', () => revealer.reveal_child = true) .on('leave-notify-event', () => revealer.reveal_child = false) .bind('visible', options.bar.position, 'value', v => v !== 'bottom'), }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/icons.js ================================================ export default { lock: 'system-lock-screen-symbolic', fallback: { executable: 'application-x-executable-symbolic', }, audio: { mic: { muted: 'microphone-disabled-symbolic', low: 'microphone-sensitivity-low-symbolic', medium: 'microphone-sensitivity-medium-symbolic', high: 'microphone-sensitivity-high-symbolic', }, volume: { muted: 'audio-volume-muted-symbolic', low: 'audio-volume-low-symbolic', medium: 'audio-volume-medium-symbolic', high: 'audio-volume-high-symbolic', overamplified: 'audio-volume-overamplified-symbolic', }, type: { headset: 'audio-headphones-symbolic', speaker: 'audio-speakers-symbolic', card: 'audio-card-symbolic', }, mixer: '', }, asusctl: { profile: { Balanced: 'power-profile-balanced-symbolic', Quiet: 'power-profile-power-saver-symbolic', Performance: 'power-profile-performance-symbolic', }, mode: { Integrated: '', Hybrid: '󰢮', }, }, apps: { apps: 'view-app-grid-symbolic', search: 'folder-saved-search-symbolic', }, battery: { charging: '󱐋', warning: 'battery-empty-symbolic', }, bluetooth: { enabled: 'bluetooth-active-symbolic', disabled: 'bluetooth-disabled-symbolic', }, brightness: { indicator: 'display-brightness-symbolic', keyboard: 'keyboard-brightness-symbolic', screen: 'display-brightness-symbolic', }, powermenu: { sleep: 'weather-clear-night-symbolic', reboot: 'system-reboot-symbolic', logout: 'system-log-out-symbolic', shutdown: 'system-shutdown-symbolic', }, recorder: { recording: 'media-record-symbolic', }, notifications: { noisy: 'preferences-system-notifications-symbolic', silent: 'notifications-disabled-symbolic', }, trash: { full: 'user-trash-full-symbolic', empty: 'user-trash-symbolic', }, mpris: { fallback: 'audio-x-generic-symbolic', shuffle: { enabled: '󰒟', disabled: '󰒟', }, loop: { none: '󰓦', track: '󰓦', playlist: '󰑐', }, playing: '󰏦', paused: '󰐍', stopped: '󰐍', prev: '󰒮', next: '󰒭', }, ui: { colorpicker: 'color-select-symbolic', close: 'window-close-symbolic', info: 'info-symbolic', menu: 'open-menu-symbolic', link: 'web-browser-symbolic', settings: 'emblem-system-symbolic', tick: 'object-select-symbolic', arrow: { right: 'pan-end-symbolic', left: 'pan-start-symbolic', down: 'pan-down-symbolic', up: 'pan-up-symbolic', }, }, system: { cpu: 'org.gnome.SystemMonitor-symbolic', ram: 'drive-harddisk-solidstate-symbolic', temp: 'temperature-symbolic', }, dialog: { Search: '', Applauncher: '󰵆', Bar: '', Border: '󰃇', Color: '󰏘', Desktop: '', Font: '', General: '󰒓', Miscellaneous: '󰠱', Theme: '󰃟', Notifications: '󰂚 ', }, }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/lockscreen/Lockscreen.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Avatar from '../misc/Avatar.js'; import Lockscreen from '../services/lockscreen.js'; import Layer from 'gi://GtkLayerShell'; const PasswordEntry = () => Widget.Box({ children: [ Widget.Entry({ setup: self => self.hook(Lockscreen, () => self.text = '', 'lock'), visibility: false, placeholder_text: 'Password', on_accept: ({ text }) => Lockscreen.auth(text || ''), hpack: 'center', hexpand: true, }), Widget.Spinner({ active: true, vpack: 'center', setup: self => self.hook(Lockscreen, (_, auth) => self.visible = auth, 'authenticating'), }), ], }); /** @param {number} monitor */ export default monitor => { const win = Widget.Window({ name: `lockscreen${monitor}`, class_name: 'lockscreen', monitor, layer: 'overlay', visible: false, setup: self => self.hook(Lockscreen, (_, lock) => self.visible = lock, 'lock'), child: Widget.Box({ css: 'min-width: 3000px; min-height: 2000px;', class_name: 'shader', child: Widget.Box({ class_name: 'content', vertical: true, hexpand: true, vexpand: true, hpack: 'center', vpack: 'center', children: [ Avatar({ hpack: 'center', vpack: 'center', }), PasswordEntry(), ], }), }), }); Layer.set_keyboard_mode(win, Layer.KeyboardMode.EXCLUSIVE); return win; }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/lockscreen/auth.py ================================================ #! /usr/bin/env python import pam import sys import getpass print(pam.authenticate(getpass.getuser(), sys.argv[1])); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/main.js ================================================ import Applauncher from './applauncher/Applauncher.js'; import Dashboard from './dashboard/Dashboard.js'; import Desktop from './desktop/Desktop.js'; import FloatingDock from './dock/FloatingDock.js'; import Lockscreen from './lockscreen/Lockscreen.js'; import Notifications from './notifications/Notifications.js'; import OSD from './osd/OSD.js'; import Overview from './overview/Overview.js'; import PowerMenu from './powermenu/PowerMenu.js'; import QuickSettings from './quicksettings/QuickSettings.js'; import ScreenCorners from './screencorner/ScreenCorners.js'; import TopBar from './bar/TopBar.js'; import Verification from './powermenu/Verification.js'; import About from './about/about.js'; import { init } from './settings/setup.js'; import { forMonitors } from './utils.js'; import { initWallpaper } from './settings/wallpaper.js'; import options from './options.js'; initWallpaper(); const windows = () => [ forMonitors(FloatingDock), forMonitors(Lockscreen), forMonitors(Notifications), forMonitors(OSD), forMonitors(ScreenCorners), forMonitors(TopBar), Applauncher(), Dashboard(), Overview(), PowerMenu(), QuickSettings(), Verification(), About(), ]; export default { onConfigParsed: init, windows: windows().flat(1), closeWindowDelay: { 'quicksettings': options.transition.value, 'dashboard': options.transition.value, }, }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/Avatar.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import options from '../options.js'; /** @param {import('types/widgets/box').BoxProps=} props */ export default props => Widget.Box({ ...props, class_name: 'avatar', connections: [ [options.desktop.avatar, box => box.setCss(` background-image: url('${options.desktop.avatar.value}'); background-size: cover; `)], ['draw', box => { const h = box.get_allocated_height(); box.set_size_request(Math.ceil(h * 1.1), -1); }], ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/BatteryIcon.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; export default () => Widget.Icon({ class_name: 'battery', setup: icon => icon.hook(Battery, () => { icon.toggleClassName('charging', Battery.charging); icon.toggleClassName('charged', Battery.charged); icon.toggleClassName('low', Battery.percent < 30); }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/Clock.js ================================================ import { clock } from '../variables.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; /** * @param {import('types/widgets/label').Props & { * format?: string, * interval?: number, * }} o */ export default ({ format = '%H:%M:%S %B %e. %A', interval = 1000, ...rest } = {}) => Widget.Label({ class_name: 'clock', label: clock.bind('value').transform(time => { return time.format(format) || 'wrong format'; }), ...rest, }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/FontIcon.js ================================================ import Gtk from 'gi://Gtk?version=3.0'; import { subclass, register } from 'resource:///com/github/Aylur/ags/widget.js'; import AgsLabel from 'resource:///com/github/Aylur/ags/widgets/label.js'; class FontIcon extends AgsLabel { static { register(this); } /** @param {string | import('types/widgets/label').Props & { icon?: string }} params */ constructor(params = '') { // @ts-expect-error const { icon = '', ...rest } = params; super(typeof params === 'string' ? {} : rest); this.toggleClassName('font-icon'); if (typeof params === 'object') this.icon = icon; if (typeof params === 'string') this.icon = params; } get icon() { return this.label; } set icon(icon) { this.label = icon; } get size() { return this.get_style_context() .get_property('font-size', Gtk.StateFlags.NORMAL); } /** @returns {[number, number]} */ vfunc_get_preferred_height() { return [this.size, this.size]; } /** @returns {[number, number]} */ vfunc_get_preferred_width() { return [this.size, this.size]; } } export default subclass(FontIcon); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/HoverRevealer.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; /** * @typedef {import('types/widgets/eventbox').EventBoxProps & { * indicator?: import('types/widgets/box').BoxProps['child'] * direction?: 'left' | 'right' | 'down' | 'up' * duration?: number * setupRevealer?: (rev: ReturnType) => void * setupEventBox?: (rev: ReturnType) => void * }} HoverRevealProps */ /** * @param {HoverRevealProps} props */ export default ({ indicator, child, direction = 'left', duration = 300, setupEventBox, setupRevealer, ...rest }) => { let open = false; const vertical = direction === 'down' || direction === 'up'; const posStart = direction === 'down' || direction === 'right'; const posEnd = direction === 'up' || direction === 'left'; const revealer = Widget.Revealer({ transition: `slide_${direction}`, setup: setupRevealer, transition_duration: duration, child, }); const eventbox = Widget.EventBox({ ...rest, setup: setupEventBox, on_hover: () => { if (open) return; revealer.reveal_child = true; Utils.timeout(duration, () => open = true); }, on_hover_lost: () => { if (!open) return; revealer.reveal_child = false; open = false; }, child: Widget.Box({ vertical, children: [ posStart && indicator, revealer, posEnd && indicator, ], }), }); return Widget.Box({ children: [eventbox], }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/IconBrowser.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import RegularWindow from './RegularWindow.js'; import Gtk from 'gi://Gtk'; export default () => { const selected = Widget.Label({ css: 'font-size: 1.2em;', }); const flowbox = Widget.FlowBox({ min_children_per_line: 10, setup: self => { self.connect('child-activated', (_, child) => { selected.label = child.get_child().iconName; }); Gtk.IconTheme.get_default().list_icons(null).sort().map(icon => { !icon.endsWith('.symbolic') && self.insert(Widget.Icon({ icon, size: 38, }), -1); }); self.show_all(); }, }); const entry = Widget.Entry({ on_change: ({ text }) => flowbox.get_children().forEach(child => { child.visible = child.get_child().iconName.includes(text); }), }); return RegularWindow({ name: 'icons', visible: true, child: Widget.Box({ css: 'padding: 30px;', spacing: 20, vertical: true, children: [ entry, Widget.Scrollable({ hscroll: 'never', vscroll: 'always', hexpand: true, vexpand: true, css: 'min-width: 500px;' + 'min-height: 500px;', child: flowbox, }), selected, ], }), }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/Notification.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import GLib from 'gi://GLib'; /** @param {import('types/service/notifications').Notification} n */ const NotificationIcon = ({ app_entry, app_icon, image }) => { if (image) { return Widget.Box({ vpack: 'start', hexpand: false, class_name: 'icon img', css: ` background-image: url("${image}"); background-size: cover; background-repeat: no-repeat; background-position: center; min-width: 78px; min-height: 78px; `, }); } let icon = 'dialog-information-symbolic'; if (Utils.lookUpIcon(app_icon)) icon = app_icon; if (Utils.lookUpIcon(app_entry || '')) icon = app_entry || ''; return Widget.Box({ vpack: 'start', hexpand: false, class_name: 'icon', css: ` min-width: 78px; min-height: 78px; `, child: Widget.Icon({ icon, size: 58, hpack: 'center', hexpand: true, vpack: 'center', vexpand: true, }), }); }; /** @param {import('types/service/notifications').Notification} notification */ export default notification => { const content = Widget.Box({ class_name: 'content', children: [ NotificationIcon(notification), Widget.Box({ hexpand: true, vertical: true, children: [ Widget.Box({ children: [ Widget.Label({ class_name: 'title', xalign: 0, justification: 'left', hexpand: true, max_width_chars: 24, truncate: 'end', wrap: true, label: notification.summary, use_markup: true, }), Widget.Label({ class_name: 'time', vpack: 'start', label: GLib.DateTime.new_from_unix_local(notification.time).format('%H:%M'), }), Widget.Button({ class_name: 'close-button', vpack: 'start', child: Widget.Icon('window-close-symbolic'), on_clicked: notification.close, }), ], }), Widget.Label({ class_name: 'description', hexpand: true, use_markup: true, xalign: 0, justification: 'left', label: notification.body, max_width_chars: 24, wrap: true, }), ], }), ], }); const actionsbox = notification.actions.length > 0 ? Widget.Revealer({ transition: 'slide_down', child: Widget.EventBox({ child: Widget.Box({ class_name: 'actions horizontal', children: notification.actions.map(action => Widget.Button({ class_name: 'action-button', on_clicked: () => notification.invoke(action.id), hexpand: true, child: Widget.Label(action.label), })), }), }), }) : null; return Widget.EventBox({ class_name: `notification ${notification.urgency}`, vexpand: false, on_primary_click: () => notification.dismiss(), on_hover() { if (actionsbox) actionsbox.reveal_child = true; }, on_hover_lost() { if (actionsbox) actionsbox.reveal_child = true; notification.dismiss(); }, child: Widget.Box({ vertical: true, children: actionsbox ? [content, actionsbox] : [content], }), }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/PopupWindow.js ================================================ import AgsWindow from 'resource:///com/github/Aylur/ags/widgets/window.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import options from '../options.js'; import GObject from 'gi://GObject'; const keyGrabber = Widget.Window({ name: 'key-grabber', popup: true, anchor: ['top', 'left', 'right', 'bottom'], css: 'background-color: transparent;', visible: false, exclusivity: 'ignore', keymode: 'on-demand', layer: 'top', attribute: { list: [] }, setup: self => self.on('notify::visible', ({ visible }) => { if (!visible) self.attribute?.list.forEach(name => App.closeWindow(name)); }), child: Widget.EventBox({ vexpand: true }).on('button-press-event', () => { App.closeWindow('key-grabber'); keyGrabber.attribute?.list.forEach(name => App.closeWindow(name)); }), }); // add before any PopupWindow is instantiated App.addWindow(keyGrabber); export class PopupWindow extends AgsWindow { static { GObject.registerClass(this); } constructor({ name, child, transition = 'none', visible = false, ...rest }) { super({ ...rest, name, popup: true, keymode: 'exclusive', layer: 'overlay', class_names: ['popup-window', name], }); child.toggleClassName('window-content'); this.revealer = Widget.Revealer({ transition, child, transition_duration: options.transition.value, setup: self => self.hook(App, (_, wname, visible) => { if (wname === name) this.revealer.reveal_child = visible; }), }); this.child = Widget.Box({ css: 'padding: 1px;', child: this.revealer, }); this.show_all(); this.visible = visible; keyGrabber.bind('visible', this, 'visible'); keyGrabber.attribute?.list.push(name); } set transition(dir) { this.revealer.transition = dir; } get transition() { return this.revealer.transition; } } /** @param {import('types/widgets/window').WindowProps & { * name: string * child: import('types/widgets/box').default * transition?: import('types/widgets/revealer').RevealerProps['transition'] * }} config */ export default config => new PopupWindow(config); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/Progress.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; /** @param {import('types/widgets/box').BoxProps & { * width: number * height: number * }} o */ export default ({ height = 18, width = 180, vertical = false, child, ...props }) => { const fill = Widget.Box({ class_name: 'fill', hexpand: vertical, vexpand: !vertical, hpack: vertical ? 'fill' : 'start', vpack: vertical ? 'end' : 'fill', children: [child], }); let fill_size = 0; return Widget.Box({ ...props, class_name: 'progress', css: ` min-width: ${width}px; min-height: ${height}px; `, children: [fill], attribute: value => { if (value < 0) return; const axis = vertical ? 'height' : 'width'; const axisv = vertical ? height : width; const min = vertical ? width : height; const preferred = (axisv - min) * value + min; if (!fill_size) { fill_size = preferred; fill.setCss(`min-${axis}: ${preferred}px;`); return; } const frames = 10; const goal = preferred - fill_size; const step = goal / frames; for (let i = 0; i < frames; ++i) { Utils.timeout(5 * i, () => { fill_size += step; fill.setCss(`min-${axis}: ${fill_size}px`); }); } }, }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/RegularWindow.js ================================================ import { subclass } from 'resource:///com/github/Aylur/ags/widget.js'; import Gtk from 'gi://Gtk'; export default subclass(Gtk.Window, 'RegularWindow'); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/misc/mpris.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../icons.js'; import { blurImg } from '../utils.js'; /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/box').BoxProps=} props */ export const CoverArt = (player, props) => Widget.Box({ ...props, class_name: 'cover', css: player.bind('cover_path').transform(p => `background-image: url("${p}")`), }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/box').BoxProps=} props */ export const BlurredCoverArt = (player, props) => Widget.Box({ ...props, class_name: 'blurred-cover', setup: self => self.hook(player, box => blurImg(player.cover_path).then(img => { img && box.setCss(`background-image: url("${img}")`); }), 'notify::cover-path'), }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/label').Props=} props */ export const TitleLabel = (player, props) => Widget.Label({ ...props, class_name: 'title', label: player.bind('track_title'), }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/label').Props=} props */ export const ArtistLabel = (player, props) => Widget.Label({ ...props, class_name: 'artist', label: player.bind('track_artists').transform(a => a.join(', ') || ''), }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/icon').Props & { symbolic?: boolean }=} props */ export const PlayerIcon = (player, { symbolic = true, ...props } = {}) => Widget.Icon({ ...props, class_name: 'player-icon', tooltip_text: player.identity || '', setup: self => self.hook(player, icon => { const name = `${player.entry}${symbolic ? '-symbolic' : ''}`; Utils.lookUpIcon(name) ? icon.icon = name : icon.icon = icons.mpris.fallback; }), }); /** * @param {import('types/service/mpris').MprisPlayer} player * @param {import('types/widgets/slider').SliderProps=} props */ export const PositionSlider = (player, props) => Widget.Slider({ ...props, class_name: 'position-slider', draw_value: false, on_change: ({ value }) => player.position = player.length * value, setup: self => { const update = () => { if (self.dragging) return; self.visible = player.length > 0; if (player.length > 0) self.value = player.position / player.length; }; self.hook(player, update); self.hook(player, update, 'position'); self.poll(1000, update); }, }); /** @param {number} length */ function lengthStr(length) { const min = Math.floor(length / 60); const sec = Math.floor(length % 60); const sec0 = sec < 10 ? '0' : ''; return `${min}:${sec0}${sec}`; } /** @param {import('types/service/mpris').MprisPlayer} player */ export const PositionLabel = player => Widget.Label({ setup: self => { const update = (_, time) => { player.length > 0 ? self.label = lengthStr(time || player.position) : self.visible = !!player; }; self.hook(player, update, 'position'); self.poll(1000, update); }, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const LengthLabel = player => Widget.Label({ label: player.bind('length').transform(l => lengthStr(l)), visible: player.bind('length').transform(l => l > 0), }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const Slash = player => Widget.Label({ label: '/', visible: player.bind('length').transform(l => l > 0), }); /** * @param {Object} o * @param {import('types/service/mpris').MprisPlayer} o.player * @param {import('types/widgets/stack').StackProps['children']} o.children * @param {'shuffle' | 'loop' | 'playPause' | 'previous' | 'next'} o.onClick * @param {string} o.prop * @param {string} o.canProp * @param {any} o.cantValue */ const PlayerButton = ({ player, children, onClick, prop, canProp, cantValue }) => Widget.Button({ child: Widget.Stack({ children }).bind('shown', player, prop, p => `${p}`), on_clicked: () => player[onClick](), visible: player.bind(canProp).transform(c => c !== cantValue), }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const ShuffleButton = player => PlayerButton({ player, children: { 'true': Widget.Label({ class_name: 'shuffle enabled', label: icons.mpris.shuffle.enabled, }), 'false': Widget.Label({ class_name: 'shuffle disabled', label: icons.mpris.shuffle.disabled, }), }, onClick: 'shuffle', prop: 'shuffle-status', canProp: 'shuffle-status', cantValue: null, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const LoopButton = player => PlayerButton({ player, children: { 'None': Widget.Label({ class_name: 'loop none', label: icons.mpris.loop.none, }), 'Track': Widget.Label({ class_name: 'loop track', label: icons.mpris.loop.track, }), 'Playlist': Widget.Label({ class_name: 'loop playlist', label: icons.mpris.loop.playlist, }), }, onClick: 'loop', prop: 'loop-status', canProp: 'loop-status', cantValue: null, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const PlayPauseButton = player => PlayerButton({ player, children: { 'Playing': Widget.Label({ class_name: 'playing', label: icons.mpris.playing, }), 'Paused': Widget.Label({ class_name: 'paused', label: icons.mpris.paused, }), 'Stopped': Widget.Label({ class_name: 'stopped', label: icons.mpris.stopped, }), }, onClick: 'playPause', prop: 'play-back-status', canProp: 'can-play', cantValue: false, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const PreviousButton = player => PlayerButton({ player, children: { 'true': Widget.Label({ class_name: 'previous', label: icons.mpris.prev, }), }, onClick: 'previous', prop: 'can-go-prev', canProp: 'can-go-prev', cantValue: false, }); /** @param {import('types/service/mpris').MprisPlayer} player */ export const NextButton = player => PlayerButton({ player, children: { 'true': Widget.Label({ class_name: 'next', label: icons.mpris.next, }), }, onClick: 'next', prop: 'can-go-next', canProp: 'can-go-next', cantValue: false, }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/notifications/Notifications.js ================================================ import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Notification from '../misc/Notification.js'; import options from '../options.js'; /** @param {import('types/widgets/revealer').default} parent */ const Popups = parent => { const map = new Map(); const onDismissed = (_, id, force = false) => { if (!id || !map.has(id)) return; if (map.get(id).isHovered() && !force) return; if (map.size - 1 === 0) parent.reveal_child = false; Utils.timeout(200, () => { map.get(id)?.destroy(); map.delete(id); }); }; /** @param {import('types/widgets/box').default} box */ const onNotified = (box, id) => { if (!id || Notifications.dnd) return; const n = Notifications.getNotification(id); if (!n) return; if (options.notifications.black_list.value.includes(n.app_name || '')) return; map.delete(id); map.set(id, Notification(n)); box.children = Array.from(map.values()).reverse(); Utils.timeout(10, () => { parent.reveal_child = true; }); }; return Widget.Box({ vertical: true }) .hook(Notifications, onNotified, 'notified') .hook(Notifications, onDismissed, 'dismissed') .hook(Notifications, (box, id) => onDismissed(box, id, true), 'closed'); }; /** @param {import('types/widgets/revealer').RevealerProps['transition']} transition */ const PopupList = (transition = 'slide_down') => Widget.Box({ css: 'padding: 1px', children: [ Widget.Revealer({ transition, setup: self => self.child = Popups(self), }), ], }); /** @param {number} monitor */ export default monitor => Widget.Window({ monitor, name: `notifications${monitor}`, class_name: 'notifications', anchor: options.notifications.position.bind('value'), child: PopupList(), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/options.js ================================================ /** * An object holding Options that are Variables with cached values. * * to update an option at runtime simply run * ags -r "options.path.to.option.setValue('value')" * * resetting: * ags -r "options.reset()" */ import { Option, resetOptions, getValues, apply, getOptions, } from "./settings/option.js"; import themes from "./themes.js"; import { HOME } from "./settings/theme.js"; export default { reset: resetOptions, values: getValues, apply: apply, list: getOptions, spacing: Option(2), padding: Option(8), radii: Option(5), popover_padding_multiplier: Option(1.4, { category: "General", note: "popover-padding: padding × this", type: "float", unit: "", }), misc: { gtk: { theme: Option("adw-gtk3-dark", { scss: "exclude", }), }, gtkIcons: { theme: Option("Adwaita", { scss: "exclude", }), }, }, color: { red: Option("#c01c28", { scss: "red" }), green: Option("#2ec27e", { scss: "green" }), yellow: Option("#f5c211", { scss: "yellow" }), blue: Option("#3584e4", { scss: "blue" }), magenta: Option("#813d9c", { scss: "magenta" }), teal: Option("#99c1f1", { scss: "teal" }), orange: Option("#e66100", { scss: "orange" }), }, theme: { name: Option(themes[0].name, { category: "exclude", note: "Name to show as active in quicktoggles", }), icon: Option(themes[0].icon, { category: "exclude", note: "Icon to show as active in quicktoggles", }), scheme: Option("dark", { enums: ["dark", "light"], type: "enum", note: "Color scheme to set on Gtk apps: 'ligth' or 'dark'", title: "Color Scheme", scss: "color-scheme", }), bg: Option("#1E1E1E", { title: "Background Color", scss: "bg-color", }), fg: Option("#deddda", { title: "Foreground Color", scss: "fg-color", }), accent: { accent: Option("$blue", { category: "Theme", title: "Accent Color", scss: "accent", }), fg: Option("#141414", { category: "Theme", title: "Accent Foreground Color", scss: "accent-fg", }), gradient: Option("to right, $accent, lighten($accent, 6%)", { category: "Theme", title: "Accent Linear Gradient", scss: "accent-gradient", }), }, widget: { bg: Option("$fg-color", { category: "Theme", title: "Widget Background Color", scss: "_widget-bg", }), opacity: Option(94, { category: "Theme", title: "Widget Background Opacity", unit: "", scss: "widget-opacity", }), borderwidth: Option(0, { category: "Theme", title: "Border Width", scss: "widget-border-width", }), }, }, border: { color: Option("$fg-color", { category: "Border", title: "Border Color", scss: "_border-color", }), opacity: Option(97, { category: "Border", title: "Border Opacity", unit: "", }), width: Option(0, { category: "Border", title: "Border Width", }), barcolor: Option("#ffffff", { category: "Border", title: "Bar Border color", scss: "bar-border-color", }), }, hypr: { inactive_border: Option("rgba(333333ff)", { category: "Border", title: "Border on Inactive Windows", scss: "exclude", }), wm_gaps: Option(3, { category: "General", scss: "wm-gaps", note: "wm-gaps", type: "float", unit: "", }), }, // TODO: use this on revealers transition: Option(100, { category: "exclude", note: "Transition time on aminations in ms, e.g on hover", unit: "ms", }), font: { font: Option("Ubuntu Nerd Font", { type: "font", title: "Font", scss: "font", }), mono: Option("Mononoki Nerd Font", { title: "Monospaced Font", scss: "mono-font", }), size: Option(13, { scss: "font-size", unit: "pt", }), }, applauncher: { width: Option(500), height: Option(500), icon_size: Option(42), anchor: Option(["center"]), }, bar: { position: Option("top", { enums: ["top", "bottom"], type: "enum", }), style: Option("floating", { enums: ["floating", "normal", "separated"], type: "enum", }), borderwidth: Option(0, { category: "Bar", title: "Border Width", scss: "bar-border-width", }), flat_buttons: Option(true, { scss: "bar-flat-buttons" }), separators: Option(true), icon: Option("distro-icon", { note: '"distro-icon" or a single font', }), }, battery: { show_percentage: Option(false, { persist: true, noReload: false, category: "exclude", }), bar: { show_icon: Option(false, { category: "Bar" }), width: Option(70, { category: "Bar" }), height: Option(14, { category: "Bar" }), full: Option(false, { category: "Bar" }), }, low: Option(30, { category: "Bar" }), medium: Option(50, { category: "Bar" }), }, desktop: { wallpaper: { fg: Option("#fff", { scss: "wallpaper-fg" }), img: Option(themes[0].options["desktop.wallpaper.img"], { scssFormat: (v) => `"${v}"`, type: "img", }), }, avatar: Option(`${HOME}/face.png`, { scssFormat: (v) => `"${v}"`, type: "img", note: "displayed in quicksettings and locksreen", }), screen_corners: Option(true, { scss: "screen-corners" }), clock: { enable: Option(true), position: Option("center center", { note: "halign valign", }), }, drop_shadow: Option(false, { scss: "drop-shadow" }), shadow: Option("rgba(0, 0, 0, .6)", { scss: "shadow" }), dock: { icon_size: Option(42), pinned_apps: Option( [ "brave", "Visual Studio Code", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], { scss: "exclude" }, ), }, }, notifications: { black_list: Option(["Spotify"], { note: "app-name | entry" }), position: Option(["top"], { note: "anchor" }), width: Option(450), }, dashboard: { sys_info_size: Option(70, { category: "Desktop", scss: "sys-info-size", }), }, mpris: { black_list: Option(["Caprine"], { category: "Bar", title: "List of blacklisted mpris players", note: "filters for bus-name, name, identity, entry", }), preferred: Option("spotify", { category: "Bar", title: "Preferred player", }), }, workspaces: Option(10, { category: "Bar", title: "No. workspaces on bar and overview", note: "Set it to 0 to make it dynamic", }), temperature: "/sys/class/thermal/thermal_zone6/temp", systemFetchInterval: 1000, brightnessctlKBD: "asus::kbd_backlight", substitutions: { icons: [ ["transmission-gtk", "transmission"], ["blueberry.py", "bluetooth"], ["Caprine", "facebook-messenger"], ["", "preferences-desktop-display"], ], titles: [ ["com.github.Aylur.ags", "AGS"], ["transmission-gtk", "Transmission"], ["com.obsproject.Studio", "OBS"], ["com.usebottles.bottles", "Bottles"], ["com.github.wwmm.easyeffects", "Easy Effects"], ["org.gnome.TextEditor", "Text Editor"], ["org.gnome.design.IconLibrary", "Icon Library"], ["blueberry.py", "Blueberry"], ["org.wezfurlong.wezterm", "Wezterm"], ["com.raggesilver.BlackBox", "BlackBox"], ["firefox", "Firefox"], ["org.gnome.Nautilus", "Files"], ["libreoffice-writer", "Writer"], ["", "Desktop"], ], }, }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/osd/OSD.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import FontIcon from '../misc/FontIcon.js'; import Progress from '../misc/Progress.js'; import Indicator from '../services/onScreenIndicator.js'; export const OnScreenIndicator = ({ height = 200, width = 32 } = {}) => Widget.Box({ class_name: 'indicator', css: 'padding: 1px;', child: Widget.Revealer({ transition: 'slide_left', setup: self => self.hook(Indicator, (_, value) => { self.reveal_child = value > -1; }), child: Progress({ width, height, vertical: true, setup: self => self.hook(Indicator, (_, value) => self.attribute(value)), child: Widget.Stack({ vpack: 'start', hpack: 'center', hexpand: false, children: { true: Widget.Icon({ hpack: 'center', size: width, setup: w => w.hook(Indicator, (_, _v, name) => w.icon = name || ''), }), false: FontIcon({ hpack: 'center', hexpand: true, css: `font-size: ${width}px;`, setup: w => w.hook(Indicator, (_, _v, name) => w.label = name || ''), }), }, setup: self => self.hook(Indicator, (_, _v, name) => { self.shown = `${!!Utils.lookUpIcon(name)}`; }), }), }), }), }); /** @param {number} monitor */ export default monitor => Widget.Window({ name: `indicator${monitor}`, monitor, class_name: 'indicator', layer: 'overlay', anchor: ['right'], child: OnScreenIndicator(), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/overview/Client.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import { createSurfaceFromWidget, substitute } from '../utils.js'; import Gdk from 'gi://Gdk'; import Gtk from 'gi://Gtk?version=3.0'; import options from '../options.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import icons from '../icons.js'; const SCALE = 0.08; const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)]; /** @param {string} args */ const dispatch = args => Hyprland.sendMessage(`dispatch ${args}`); /** @param {string} str */ const icon = str => { const icon = substitute(options.substitutions.icons, str); if (Utils.lookUpIcon(icon)) return icon; console.warn('no icon', icon); return icons.fallback.executable; } export default ({ address, size: [w, h], class: c, title }) => Widget.Button({ class_name: 'client', tooltip_text: `${title}`, child: Widget.Icon({ css: ` min-width: ${w * SCALE}px; min-height: ${h * SCALE}px; `, icon: icon(c), }), on_secondary_click: () => dispatch(`closewindow address:${address}`), on_clicked: () => dispatch(`focuswindow address:${address}`) .then(() => App.closeWindow('overview')), setup: btn => btn .on('drag-data-get', (_w, _c, data) => data.set_text(address, address.length)) .on('drag-begin', (_, context) => { Gtk.drag_set_icon_surface(context, createSurfaceFromWidget(btn)); btn.toggleClassName('hidden', true); }) .on('drag-end', () => btn.toggleClassName('hidden', false)) .drag_source_set(Gdk.ModifierType.BUTTON1_MASK, TARGET, Gdk.DragAction.COPY), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/overview/Overview.js ================================================ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import PopupWindow from '../misc/PopupWindow.js'; import Workspace from './Workspace.js'; import options from '../options.js'; import { range } from '../utils.js'; const ws = options.workspaces; const Overview = () => Widget.Box({ children: [Workspace(0)], // for type infer setup: self => Utils.idle(() => { self.hook(ws, () => { self.children = range(ws.value).map(Workspace); update(self); children(self); }); self.hook(Hyprland, update); self.hook(Hyprland, children, 'notify::workspaces'); update(self); children(self); }), }); /** @param {ReturnType} box */ const update = box => { if (!box.get_parent()?.visible) return; Hyprland.sendMessage('j/clients') .then(clients => { box.children.forEach(ws => { ws.attribute(JSON.parse(clients)); }); }) .catch(console.error); }; /** @param {import('types/widgets/box').default} box */ const children = box => { if (ws.value === 0) { box.children = Hyprland.workspaces .sort((ws1, ws2) => ws1.id - ws2.id) .map(({ id }) => Workspace(id)); } }; export default () => PopupWindow({ name: 'overview', child: Overview(), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/overview/Workspace.js ================================================ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Gdk from 'gi://Gdk'; import Gtk from 'gi://Gtk?version=3.0'; import Client from './Client.js'; const SCALE = 0.08; const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)]; /** @param {string} args */ const dispatch = args => Utils.execAsync(`hyprctl dispatch ${args}`); /** @param {number} index */ export default index => { const fixed = Gtk.Fixed.new(); return Widget.Box({ class_name: 'workspace', vpack: 'center', css: ` min-width: ${1920 * SCALE}px; min-height: ${1080 * SCALE}px; `, setup: box => box.hook(Hyprland, () => { box.toggleClassName('active', Hyprland.active.workspace.id === index); }), child: Widget.EventBox({ hexpand: true, vexpand: true, on_primary_click: () => dispatch(`workspace ${index}`), setup: eventbox => { eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY); eventbox.connect('drag-data-received', (_w, _c, _x, _y, data) => { dispatch(`movetoworkspacesilent ${index},address:${data.get_text()}`); }); }, child: fixed, }), /** @param {Array} clients */ attribute: clients => { fixed.get_children().forEach(ch => ch.destroy()); clients .filter(({ workspace: { id } }) => id === index) .forEach(c => { c.at[0] -= Hyprland.getMonitor(c.monitor)?.x || 0; c.at[1] -= Hyprland.getMonitor(c.monitor)?.y || 0; c.mapped && fixed.put(Client(c), c.at[0] * SCALE, c.at[1] * SCALE); }); fixed.show_all(); }, }); }; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/powermenu/PowerMenu.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../icons.js'; import PowerMenu from '../services/powermenu.js'; import ShadedPopup from './ShadedPopup.js'; /** * @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action * @param {string} label */ const SysButton = (action, label) => Widget.Button({ on_clicked: () => PowerMenu.action(action), child: Widget.Box({ vertical: true, children: [ Widget.Icon(icons.powermenu[action]), Widget.Label(label), ], }), }); export default () => ShadedPopup({ name: 'powermenu', expand: true, child: Widget.Box({ children: [ SysButton('sleep', 'Sleep'), SysButton('reboot', 'Reboot'), SysButton('logout', 'Log Out'), SysButton('shutdown', 'Shutdown'), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/powermenu/ShadedPopup.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; /** @param {string} windowName */ const Padding = windowName => Widget.EventBox({ class_name: 'padding', hexpand: true, vexpand: true, setup: w => w.on('button-press-event', () => App.toggleWindow(windowName)), }); /** * @template {import('gi://Gtk?version=3.0').default.Widget} T * @param {import('types/widgets/window').WindowProps & { * name: string * child: import('types/widgets/box').default * }} o */ export default ({ name, child, ...rest }) => Widget.Window({ ...rest, class_names: ['popup-window', name], name, visible: false, popup: true, keymode: 'on-demand', setup() { child.toggleClassName('window-content'); }, child: Widget.CenterBox({ class_name: 'shader', css: 'min-width: 5000px; min-height: 3000px;', start_widget: Padding(name), end_widget: Padding(name), center_widget: Widget.CenterBox({ vertical: true, start_widget: Padding(name), end_widget: Padding(name), center_widget: child, }), }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/powermenu/Verification.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import PowerMenu from '../services/powermenu.js'; import ShadedPopup from './ShadedPopup.js'; export default () => ShadedPopup({ name: 'verification', expand: true, child: Widget.Box({ vertical: true, children: [ Widget.Box({ class_name: 'text-box', vertical: true, children: [ Widget.Label({ class_name: 'title', label: PowerMenu.bind('title'), }), Widget.Label({ class_name: 'desc', label: 'Are you sure?', }), ], }), Widget.Box({ class_name: 'buttons horizontal', vexpand: true, vpack: 'end', homogeneous: true, children: [ Widget.Button({ child: Widget.Label('No'), on_clicked: () => App.toggleWindow('verification'), }), Widget.Button({ child: Widget.Label('Yes'), on_clicked: () => Utils.exec(PowerMenu.cmd), }), ], }), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/QuickSettings.js ================================================ import Widget from "resource:///com/github/Aylur/ags/widget.js"; import Header from "./widgets/Header.js"; import PopupWindow from "../misc/PopupWindow.js"; import { Volume, Microhone, SinkSelector, AppMixer } from "./widgets/Volume.js"; import { NetworkToggle, WifiSelection } from "./widgets/Network.js"; import { BluetoothToggle, BluetoothDevices } from "./widgets/Bluetooth.js"; import { ThemeToggle, ThemeSelector } from "./widgets/Theme.js"; import Media from "./widgets/Media.js"; import Brightness from "./widgets/Brightness.js"; import DND from "./widgets/DND.js"; import MicMute from "./widgets/MicMute.js"; import options from "../options.js"; const Row = (toggles = [], menus = []) => Widget.Box({ vertical: true, children: [ Widget.Box({ class_name: "row horizontal", children: toggles, }), ...menus, ], }); const Homogeneous = (toggles) => Widget.Box({ homogeneous: true, children: toggles, }); export default () => PopupWindow({ name: "quicksettings", setup: (self) => self.hook(options.bar.position, () => { self.anchor = ["right", options.bar.position.value]; self.transition = "crossfade"; }), child: Widget.Box({ vertical: true, children: [ Header(), Widget.Box({ class_name: "sliders-box vertical", vertical: true, children: [ Row([Volume()], [SinkSelector(), AppMixer()]), Microhone(), Brightness(), ], }), Row( [Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()], [WifiSelection(), BluetoothDevices()], ), Row([Homogeneous([ThemeToggle()]), MicMute()], [ThemeSelector()]), Media(), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/ToggleButton.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../icons.js'; /** name of the currently opened menu */ export const opened = Variable(''); App.connect('window-toggled', (_, name, visible) => { if (name === 'quicksettings' && !visible) Utils.timeout(500, () => opened.value = ''); }); /** * @param {string} name - menu name * @param {(() => void) | false=} activate */ export const Arrow = (name, activate) => { let deg = 0; let iconOpened = false; const icon = Widget.Icon(icons.ui.arrow.right).hook(opened, () => { if (opened.value === name && !iconOpened || opened.value !== name && iconOpened) { const step = opened.value === name ? 10 : -10; iconOpened = !iconOpened; for (let i = 0; i < 9; ++i) { Utils.timeout(15 * i, () => { deg += step; icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`); }); } } }); return Widget.Button({ child: icon, on_clicked: () => { opened.value = opened.value === name ? '' : name; if (typeof activate === 'function') activate(); }, }); }; /** * @param {Object} o * @param {string} o.name - menu name * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {import('gi://Gtk').Gtk.Widget} o.label * @param {() => void} o.activate * @param {() => void} o.deactivate * @param {boolean=} o.activateOnArrow * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection */ export const ArrowToggleButton = ({ name, icon, label, activate, deactivate, activateOnArrow = true, connection: [service, condition], }) => Widget.Box({ class_name: 'toggle-button', setup: self => self.hook(service, () => { self.toggleClassName('active', condition()); }), children: [ Widget.Button({ child: Widget.Box({ hexpand: true, class_name: 'label-box horizontal', children: [icon, label], }), on_clicked: () => { if (condition()) { deactivate(); if (opened.value === name) opened.value = ''; } else { activate(); } }, }), Arrow(name, activateOnArrow && activate), ], }); /** * @param {Object} o * @param {string} o.name - menu name * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {import('gi://Gtk').Gtk.Widget} o.title * @param {import('gi://Gtk').Gtk.Widget[]} o.content */ export const Menu = ({ name, icon, title, content }) => Widget.Revealer({ transition: 'slide_down', reveal_child: opened.bind().transform(v => v === name), child: Widget.Box({ class_names: ['menu', name], vertical: true, children: [ Widget.Box({ class_name: 'title horizontal', children: [icon, title], }), Widget.Separator(), ...content, ], }), }); /** * @param {Object} o * @param {import('gi://Gtk').Gtk.Widget} o.icon * @param {() => void} o.toggle * @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection */ export const SimpleToggleButton = ({ icon, toggle, connection: [service, condition], }) => Widget.Button({ class_name: 'simple-toggle', setup: self => self.hook(service, () => { self.toggleClassName('active', condition()); }), child: icon, on_clicked: toggle, }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/AsusProfile.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import Asusctl from '../../services/asusctl.js'; import { ArrowToggleButton, Menu } from '../ToggleButton.js'; export const ProfileToggle = () => ArrowToggleButton({ name: 'asusctl-profile', icon: Widget.Icon({ binds: [['icon', Asusctl, 'profile', p => icons.asusctl.profile[p]]], }), label: Widget.Label({ binds: [['label', Asusctl, 'profile']], }), connection: [Asusctl, () => Asusctl.profile !== 'Balanced'], activate: () => Asusctl.setProfile('Quiet'), deactivate: () => Asusctl.setProfile('Balanced'), activateOnArrow: false, }); export const ProfileSelector = () => Menu({ name: 'asusctl-profile', icon: Widget.Icon({ binds: [['icon', Asusctl, 'profile', p => icons.asusctl.profile[p]]], }), title: Widget.Label('Profile Selector'), content: [ Widget.Box({ vertical: true, hexpand: true, children: [ Widget.Box({ vertical: true, children: Asusctl.profiles.map(prof => Widget.Button({ on_clicked: () => Asusctl.setProfile(prof), child: Widget.Box({ children: [ Widget.Icon(icons.asusctl.profile[prof]), Widget.Label(prof), ], }), })), }), ], }), Widget.Separator(), Widget.Button({ on_clicked: () => Utils.execAsync('rog-control-center'), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Rog Control Center'), ], }), }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Bluetooth.js ================================================ import Bluetooth from 'resource:///com/github/Aylur/ags/service/bluetooth.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import { Menu, ArrowToggleButton } from '../ToggleButton.js'; export const BluetoothToggle = () => ArrowToggleButton({ name: 'bluetooth', icon: Widget.Icon({ icon: Bluetooth.bind('enabled').transform(p => icons.bluetooth[p ? 'enabled' : 'disabled']), }), label: Widget.Label({ truncate: 'end', setup: self => self.hook(Bluetooth, () => { if (!Bluetooth.enabled) return self.label = 'Disabled'; if (Bluetooth.connected_devices.length === 0) return self.label = 'Not Connected'; if (Bluetooth.connected_devices.length === 1) return self.label = Bluetooth.connected_devices[0].alias; self.label = `${Bluetooth.connected_devices.length} Connected`; }), }), connection: [Bluetooth, () => Bluetooth.enabled], deactivate: () => Bluetooth.enabled = false, activate: () => Bluetooth.enabled = true, }); /** @param {import('types/service/bluetooth').BluetoothDevice} device */ const DeviceItem = device => Widget.Box({ children: [ Widget.Icon(device.icon_name + '-symbolic'), Widget.Label(device.name), Widget.Label({ label: `${device.battery_percentage}%`, visible: device.bind('battery_percentage').transform(p => p > 0), }), Widget.Box({ hexpand: true }), Widget.Spinner({ active: device.bind('connecting'), visible: device.bind('connecting'), }), Widget.Switch({ active: device.connected, visible: device.bind('connecting').transform(p => !p), setup: self => self.on('notify::active', () => { device.setConnection(self.active); }), }), ], }); export const BluetoothDevices = () => Menu({ name: 'bluetooth', icon: Widget.Icon(icons.bluetooth.disabled), title: Widget.Label('Bluetooth'), content: [ Widget.Box({ hexpand: true, vertical: true, children: Bluetooth.bind('devices').transform(ds => ds .filter(d => d.name) .map(DeviceItem)), }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Brightness.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import Brightness from '../../services/brightness.js'; const BrightnessSlider = () => Widget.Slider({ draw_value: false, hexpand: true, value: Brightness.bind('screen'), on_change: ({ value }) => Brightness.screen = value, }); export default () => Widget.Box({ children: [ Widget.Button({ child: Widget.Icon(icons.brightness.indicator), tooltip_text: Brightness.bind('screen').transform(v => `Screen Brightness: ${Math.floor(v * 100)}%`), }), BrightnessSlider(), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/DND.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import icons from '../../icons.js'; import { SimpleToggleButton } from '../ToggleButton.js'; export default () => SimpleToggleButton({ icon: Widget.Icon({ icon: Notifications.bind('dnd').transform(dnd => icons.notifications[dnd ? 'silent' : 'noisy']), }), toggle: () => Notifications.dnd = !Notifications.dnd, connection: [Notifications, () => Notifications.dnd], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Header.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Battery from 'resource:///com/github/Aylur/ags/service/battery.js'; import PowerMenu from '../../services/powermenu.js'; import Lockscreen from '../../services/lockscreen.js'; import Avatar from '../../misc/Avatar.js'; import icons from '../../icons.js'; import { openSettings } from '../../settings/theme.js'; import { uptime } from '../../variables.js'; export default () => Widget.Box({ class_name: 'header horizontal', children: [ Avatar(), Widget.Box({ hpack: 'end', vpack: 'center', hexpand: true, children: [ Widget.Box({ class_name: 'battery horizontal', children: [ Widget.Icon({ icon: Battery.bind('icon_name') }), Widget.Label({ label: Battery.bind('percent').transform(p => `${p}%`) }), ], }), Widget.Label({ class_name: 'uptime', label: uptime.bind().transform(v => `up: ${v}`), }), Widget.Button({ on_clicked: openSettings, child: Widget.Icon(icons.ui.settings), }), Widget.Button({ on_clicked: () => Lockscreen.lockscreen(), child: Widget.Icon(icons.lock), }), Widget.Button({ on_clicked: () => PowerMenu.action('shutdown'), child: Widget.Icon(icons.powermenu.shutdown), }), ], }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Media.js ================================================ import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as mpris from '../../misc/mpris.js'; import options from '../../options.js'; /** @param {import('types/service/mpris').MprisPlayer} player */ const Footer = player => Widget.CenterBox({ class_name: 'footer-box', start_widget: Widget.Box({ class_name: 'position', children: [ mpris.PositionLabel(player), mpris.Slash(player), mpris.LengthLabel(player), ], }), center_widget: Widget.Box({ class_name: 'controls', children: [ mpris.ShuffleButton(player), mpris.PreviousButton(player), mpris.PlayPauseButton(player), mpris.NextButton(player), mpris.LoopButton(player), ], }), end_widget: mpris.PlayerIcon(player, { symbolic: false, hexpand: true, hpack: 'end', }), }); /** @param {import('types/service/mpris').MprisPlayer} player */ const TextBox = player => Widget.Box({ children: [ mpris.CoverArt(player, { hpack: 'end', hexpand: false, }), Widget.Box({ hexpand: true, vertical: true, class_name: 'labels', children: [ mpris.TitleLabel(player, { xalign: 0, justification: 'left', wrap: true, }), mpris.ArtistLabel(player, { xalign: 0, justification: 'left', wrap: true, }), ], }), ], }); /** @param {import('types/service/mpris').MprisPlayer} player */ const PlayerBox = player => Widget.Box({ class_name: `player ${player.name}`, child: mpris.BlurredCoverArt(player, { hexpand: true, child: Widget.Box({ hexpand: true, vertical: true, children: [ TextBox(player), mpris.PositionSlider(player), Footer(player), ], }), }), }); export default () => Widget.Box({ vertical: true, class_name: 'media vertical', visible: Mpris.bind('players').transform(p => p.length > 0), children: Mpris.bind('players').transform(ps => ps .filter(p => !options.mpris.black_list.value .includes(p.identity)).map(PlayerBox)), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/MicMute.js ================================================ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import icons from '../../icons.js'; import { SimpleToggleButton } from '../ToggleButton.js'; export default () => SimpleToggleButton({ icon: Widget.Icon() .hook(Audio, self => { self.icon = Audio.microphone?.is_muted ? icons.audio.mic.muted : icons.audio.mic.high; }, 'microphone-changed'), toggle: () => Audio.microphone.is_muted = !Audio.microphone.is_muted, connection: [Audio, () => Audio.microphone?.is_muted || false], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Network.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Network from 'resource:///com/github/Aylur/ags/service/network.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import { Menu, ArrowToggleButton } from '../ToggleButton.js'; import Applications from 'resource:///com/github/Aylur/ags/service/applications.js'; export const NetworkToggle = () => ArrowToggleButton({ name: 'network', icon: Widget.Icon({ icon: Network.wifi.bind('icon_name'), }), label: Widget.Label({ truncate: 'end', label: Network.wifi.bind('ssid').transform(ssid => ssid || 'Not Connected'), }), connection: [Network, () => Network.wifi.enabled], deactivate: () => Network.wifi.enabled = false, activate: () => { Network.wifi.enabled = true; Network.wifi.scan(); }, }); export const WifiSelection = () => Menu({ name: 'network', icon: Widget.Icon({ icon: Network.wifi.bind('icon_name'), }), title: Widget.Label('Wifi Selection'), content: [ Widget.Box({ vertical: true, setup: self => self.hook(Network, () => self.children = Network.wifi?.access_points.map(ap => Widget.Button({ on_clicked: () => Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`), child: Widget.Box({ children: [ Widget.Icon(ap.iconName), Widget.Label(ap.ssid || ''), ap.active && Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', }), ], }), })), ), }), Widget.Separator(), Widget.Button({ on_clicked: () => Applications.query('gnome-control-center')?.[0].launch(), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Network'), ], }), }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Theme.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import { ArrowToggleButton, Menu, opened } from '../ToggleButton.js'; import themes from '../../themes.js'; import icons from '../../icons.js'; import options from '../../options.js'; import { setTheme, openSettings } from '../../settings/theme.js'; export const ThemeToggle = () => ArrowToggleButton({ name: 'theme', icon: Widget.Label().bind('label', options.theme.icon), label: Widget.Label().bind('label', options.theme.name), connection: [opened, () => opened.value === 'theme'], activate: () => opened.setValue('theme'), activateOnArrow: false, deactivate: () => { }, }); export const ThemeSelector = () => Menu({ name: 'theme', icon: Widget.Label().bind('label', options.theme.icon), title: Widget.Label('Theme Selector'), content: [ ...themes.map(({ name, icon }) => Widget.Button({ on_clicked: () => setTheme(name), child: Widget.Box({ children: [ Widget.Label(icon), Widget.Label(name), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', visible: options.theme.name.bind('value').transform(v => v === name), }), ], }), })), Widget.Separator(), Widget.Button({ on_clicked: openSettings, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Theme Settings'), ], }), }), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/quicksettings/widgets/Volume.js ================================================ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import icons from '../../icons.js'; import FontIcon from '../../misc/FontIcon.js'; import { getAudioTypeIcon } from '../../utils.js'; import { Arrow } from '../ToggleButton.js'; import { Menu } from '../ToggleButton.js'; /** @param {'speaker' | 'microphone'=} type */ const VolumeIndicator = (type = 'speaker') => Widget.Button({ on_clicked: () => Audio[type].is_muted = !Audio[type].is_muted, child: Widget.Icon().hook(Audio[type], icon => { icon.icon = type === 'speaker' ? getAudioTypeIcon(Audio[type].icon_name || '') : icons.audio.mic.high; icon.tooltip_text = `Volume ${Math.floor(Audio[type].volume * 100)}%`; }), }); /** @param {'speaker' | 'microphone'=} type */ const VolumeSlider = (type = 'speaker') => Widget.Slider({ hexpand: true, draw_value: false, on_change: ({ value }) => Audio[type].volume = value, setup: self => self.hook(Audio[type], () => { self.value = Audio[type].volume || 0; }), }); export const Volume = () => Widget.Box({ children: [ VolumeIndicator('speaker'), VolumeSlider('speaker'), Widget.Box({ vpack: 'center', child: Arrow('sink-selector'), }), Widget.Box({ vpack: 'center', child: Arrow('app-mixer'), visible: Audio.bind('apps').transform(a => a.length > 0), }), ], }); export const Microhone = () => Widget.Box({ class_name: 'slider horizontal', visible: Audio.bind('recorders').transform(a => a.length > 0), children: [ VolumeIndicator('microphone'), VolumeSlider('microphone'), ], }); /** @param {import('types/service/audio').Stream} stream */ const MixerItem = stream => Widget.Box({ hexpand: true, class_name: 'mixer-item horizontal', children: [ Widget.Icon({ tooltip_text: stream.bind('name').transform(n => n || ''), icon: stream.bind('name').transform(n => { return Utils.lookUpIcon(n || '') ? (n || '') : icons.mpris.fallback; }), }), Widget.Box({ vertical: true, children: [ Widget.Label({ xalign: 0, truncate: 'end', label: stream.bind('description').transform(d => d || ''), }), Widget.Slider({ hexpand: true, draw_value: false, value: stream.bind('volume'), on_change: ({ value }) => stream.volume = value, }), ], }), Widget.Label({ xalign: 1, label: stream.bind('volume').transform(v => `${Math.floor(v * 100)}`), }), ], }); /** @param {import('types/service/audio').Stream} stream */ const SinkItem = stream => Widget.Button({ hexpand: true, on_clicked: () => Audio.speaker = stream, child: Widget.Box({ children: [ Widget.Icon({ icon: getAudioTypeIcon(stream.icon_name || ''), tooltip_text: stream.icon_name, }), Widget.Label((stream.description || '').split(' ').slice(0, 4).join(' ')), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: 'end', visible: Audio.speaker.bind('stream').transform(s => s === stream.stream), }), ], }), }); const SettingsButton = () => Widget.Button({ on_clicked: () => Utils.execAsync('pavucontrol'), hexpand: true, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label('Settings'), ], }), }); export const AppMixer = () => Menu({ name: 'app-mixer', icon: FontIcon(icons.audio.mixer), title: Widget.Label('App Mixer'), content: [ Widget.Box({ vertical: true, children: Audio.bind('apps').transform(a => a.map(MixerItem)), }), Widget.Separator(), SettingsButton(), ], }); export const SinkSelector = () => Menu({ name: 'sink-selector', icon: Widget.Icon(icons.audio.type.headset), title: Widget.Label('Sink Selector'), content: [ Widget.Box({ vertical: true, children: Audio.bind('speakers').transform(a => a.map(SinkItem)), }), Widget.Separator(), SettingsButton(), ], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/screencorner/ScreenCorners.js ================================================ import Widget from 'resource:///com/github/Aylur/ags/widget.js'; import Gtk from 'gi://Gtk'; import options from '../options.js'; /** @param {'topleft' | 'topright' | 'bottomleft' | 'bottomright'} place */ const Corner = place => Widget.DrawingArea({ class_name: 'corner', hexpand: true, vexpand: true, hpack: place.includes('left') ? 'start' : 'end', vpack: place.includes('top') ? 'start' : 'end', setup: self => self .hook(options.radii, () => { const r = options.radii.value * 2; self.set_size_request(r, r); }) .connect('draw', (self, cr) => { const context = self.get_style_context(); const c = context.get_property('background-color', Gtk.StateFlags.NORMAL); const r = context.get_property('border-radius', Gtk.StateFlags.NORMAL); switch (place) { case 'topleft': cr.arc(r, r, r, Math.PI, 3 * Math.PI / 2); cr.lineTo(0, 0); break; case 'topright': cr.arc(0, r, r, 3 * Math.PI / 2, 2 * Math.PI); cr.lineTo(r, 0); break; case 'bottomleft': cr.arc(r, 0, r, Math.PI / 2, Math.PI); cr.lineTo(0, r); break; case 'bottomright': cr.arc(0, 0, r, 0, Math.PI / 2); cr.lineTo(r, r); break; } cr.closePath(); cr.setSourceRGBA(c.red, c.green, c.blue, c.alpha); cr.fill(); }), }); /** @type {Array<'topleft' | 'topright' | 'bottomleft' | 'bottomright'>} */ const places = ['topleft', 'topright', 'bottomleft', 'bottomright']; /** @param {number} monitor */ export default monitor => places.map(place => Widget.Window({ name: `corner${monitor}${place}`, monitor, class_name: 'corner', anchor: [place.includes('top') ? 'top' : 'bottom', place.includes('right') ? 'right' : 'left'], visible: options.desktop.screen_corners.bind('value'), child: Corner(place), })); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/asusctl.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; class Asusctl extends Service { static { Service.register(this, {}, { 'profile': ['string', 'r'], 'mode': ['string', 'r'], }); } profiles = Object.freeze(['Performance', 'Balanced', 'Quiet']); #profile = 'Balanced'; #mode = 'Hyprid'; nextProfile() { Utils.execAsync('asusctl profile -n') .then(() => { this.#profile = Utils.exec('asusctl profile -p').split(' ')[3]; this.changed('profile'); }) .catch(console.error); } /** @param {'Performance' | 'Balanced' | 'Quiet'} prof */ setProfile(prof) { Utils.execAsync(`asusctl profile --profile-set ${prof}`) .then(() => { this.#profile = prof; this.changed('profile'); }) .catch(console.error); } nextMode() { Utils.execAsync(`supergfxctl -m ${this.#mode === 'Hybrid' ? 'Integrated' : 'Hybrid'}`) .then(() => { this.#mode = Utils.exec('supergfxctl -g'); this.changed('profile'); }) .catch(console.error); } constructor() { super(); if (Utils.exec('which asusctl')) { this.available = true; this.#profile = Utils.exec('asusctl profile -p').split(' ')[3]; Utils.execAsync('supergfxctl -g').then(mode => this.#mode = mode); } else { this.available = false; } } get profile() { return this.#profile; } get mode() { return this.#mode; } } export default new Asusctl(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/brightness.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import options from '../options.js'; import { dependencies } from '../utils.js'; const KBD = options.brightnessctlKBD; class Brightness extends Service { static { Service.register(this, {}, { 'screen': ['float', 'rw'], 'kbd': ['int', 'rw'], }); } #kbd = 0; #kbdMax = 3; #screen = 0; get kbd() { return this.#kbd; } get screen() { return this.#screen; } set kbd(value) { if (!dependencies(['brightnessctl'])) return; if (value < 0 || value > this.#kbdMax) return; Utils.execAsync(`brightnessctl -d ${KBD} s ${value} -q`) .then(() => { this.#kbd = value; this.changed('kbd'); }) .catch(console.error); } set screen(percent) { if (!dependencies(['brightnessctl'])) return; if (percent < 0) percent = 0; if (percent > 1) percent = 1; Utils.execAsync(`brightnessctl s ${percent * 100}% -q`) .then(() => { this.#screen = percent; this.changed('screen'); }) .catch(console.error); } constructor() { super(); if (dependencies(['brightnessctl'])) { this.#kbd = Number(Utils.exec(`brightnessctl -d ${KBD} g`)); this.#kbdMax = Number(Utils.exec(`brightnessctl -d ${KBD} m`)); this.#screen = Number(Utils.exec('brightnessctl g')) / Number(Utils.exec('brightnessctl m')); } } } export default new Brightness(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/colorpicker.js ================================================ import { Variable } from 'resource:///com/github/Aylur/ags/variable.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import { dependencies } from '../utils.js'; import icons from '../icons.js'; const COLORS_CACHE = Utils.CACHE_DIR + '/colorpicker.json'; class Colors extends Service { static { Service.register(this, {}, { 'colors': ['jsobject'], }); } /** @type {Variable} */ #colors = new Variable([]); get colors() { return this.#colors.value; } #notifID = 0; constructor() { super(); this.#colors.connect('changed', () => this.changed('colors')); Utils.readFileAsync(COLORS_CACHE) .then(out => this.#colors.setValue(JSON.parse(out || '[]'))) .catch(() => print('no colorpicker cache found')); } /** @param {string} color */ wlCopy(color) { Utils.execAsync(['wl-copy', color]) .catch(err => console.error(err)); } async pick() { if (!dependencies(['hyprpicker'])) return; const color = await Utils.execAsync('hyprpicker'); if (!color) return; this.wlCopy(color); const list = this.#colors.value; if (!list.includes(color)) { list.push(color); if (list.length > 10) list.shift(); this.#colors.value = list; Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE) .catch(err => console.error(err)); } const n = await Utils.notify({ id: this.#notifID, iconName: icons.ui.colorpicker, summary: color, actions: { 'Copy': () => this.wlCopy(color), }, }); this.#notifID = n.id; } } export default new Colors; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/lockscreen.js ================================================ import Service from 'resource:///com/github/Aylur/ags/service.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; const authpy = App.configDir + '/js/lockscreen/auth.py'; class Lockscreen extends Service { static { Service.register(this, { 'lock': ['boolean'], 'authenticating': ['boolean'], }); } lockscreen() { this.emit('lock', true); } /** @param {string} password */ auth(password) { this.emit('authenticating', true); Utils.execAsync([authpy, password]) .then(out => { this.emit('lock', out !== 'True'); this.emit('authenticating', false); }) .catch(err => console.error(err)); } } export default new Lockscreen(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/onScreenIndicator.js ================================================ import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import Audio from 'resource:///com/github/Aylur/ags/service/audio.js'; import icons from '../icons.js'; import { getAudioTypeIcon } from '../utils.js'; import Brightness from './brightness.js'; class Indicator extends Service { static { Service.register(this, { 'popup': ['double', 'string'], }); } #delay = 1500; #count = 0; /** * @param {number} value - 0 < v < 1 * @param {string} icon */ popup(value, icon) { this.emit('popup', value, icon); this.#count++; Utils.timeout(this.#delay, () => { this.#count--; if (this.#count === 0) this.emit('popup', -1, icon); }); } speaker() { this.popup( Audio.speaker?.volume || 0, getAudioTypeIcon(Audio.speaker?.icon_name || ''), ); } display() { // brightness is async, so lets wait a bit Utils.timeout(10, () => this.popup( Brightness.screen, icons.brightness.screen)); } kbd() { // brightness is async, so lets wait a bit Utils.timeout(10, () => this.popup( (Brightness.kbd * 33 + 1) / 100, icons.brightness.keyboard)); } connect(event = 'popup', callback) { return super.connect(event, callback); } } export default new Indicator(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/powermenu.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; class PowerMenu extends Service { static { Service.register(this, {}, { 'title': ['string'], 'cmd': ['string'], }); } #title = ''; #cmd = ''; get title() { return this.#title; } get cmd() { return this.#cmd; } /** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */ action(action) { [this.#cmd, this.#title] = { 'sleep': ['systemctl suspend', 'Sleep'], 'reboot': ['systemctl reboot', 'Reboot'], 'logout': ['pkill Hyprland', 'Log Out'], 'shutdown': ['shutdown now', 'Shutdown'], }[action]; this.notify('cmd'); this.notify('title'); this.emit('changed'); App.closeWindow('powermenu'); App.openWindow('verification'); } } export default new PowerMenu(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/services/screenrecord.js ================================================ import Service from 'resource:///com/github/Aylur/ags/service.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import App from 'resource:///com/github/Aylur/ags/app.js'; import GLib from 'gi://GLib'; import { dependencies } from '../utils.js'; const now = () => GLib.DateTime.new_now_local().format('%Y-%m-%d_%H-%M-%S'); class Recorder extends Service { static { Service.register(this, {}, { 'timer': ['int'], 'recording': ['boolean'], }); } #path = GLib.get_home_dir() + '/Videos/Screencasting'; #file = ''; #interval = 0; recording = false; timer = 0; async start() { if (!dependencies(['slurp', 'wf-recorder'])) return; if (this.recording) return; const area = await Utils.execAsync('slurp'); Utils.ensureDirectory(this.#path); this.#file = `${this.#path}/${now()}.mp4`; Utils.execAsync(['wf-recorder', '-g', area, '-f', this.#file]); this.recording = true; this.changed('recording'); this.timer = 0; this.#interval = Utils.interval(1000, () => { this.changed('timer'); this.timer++; }); } async stop() { if (!dependencies(['notify-send'])) return; if (!this.recording) return; Utils.execAsync('killall -INT wf-recorder'); this.recording = false; this.changed('recording'); GLib.source_remove(this.#interval); const res = await Utils.execAsync([ 'notify-send', '-A', 'files=Show in Files', '-A', 'view=View', '-i', 'video-x-generic-symbolic', 'Screenrecord', this.#file, ]); if (res === 'files') Utils.execAsync('xdg-open ' + this.#path); if (res === 'view') Utils.execAsync('xdg-open ' + this.#file); } async screenshot(full = false) { if (!dependencies(['slurp', 'wayshot'])) return; const path = GLib.get_home_dir() + '/Pictures/Screenshots'; const file = `${path}/${now()}.png`; Utils.ensureDirectory(path); await Utils.execAsync([ 'wayshot', '-f', file, ].concat(full ? [] : [ '-s', await Utils.execAsync('slurp'), ])); Utils.execAsync(['bash', '-c', `wl-copy < ${file}`]); const res = await Utils.execAsync([ 'notify-send', '-A', 'files=Show in Files', '-A', 'view=View', '-A', 'edit=Edit', '-i', file, 'Screenshot', file, ]); if (res === 'files') Utils.execAsync('xdg-open ' + path); if (res === 'view') Utils.execAsync('xdg-open ' + file); if (res === 'edit') Utils.execAsync(['swappy', '-f', file]); App.closeWindow('dashboard'); } } export default new Recorder(); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/SettingsDialog.js ================================================ import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; import App from "resource:///com/github/Aylur/ags/app.js"; import Widget from "resource:///com/github/Aylur/ags/widget.js"; import RegularWindow from "../misc/RegularWindow.js"; import Variable from "resource:///com/github/Aylur/ags/variable.js"; import icons from "../icons.js"; import { getOptions, getValues } from "./option.js"; import options from "../options.js"; const optionsList = getOptions(); const categories = Array.from( new Set(optionsList.map((opt) => opt.category)), ).filter((category) => category !== "exclude"); const currentPage = Variable(categories[0]); const search = Variable(""); const showSearch = Variable(false); showSearch.connect("changed", ({ value }) => { if (!value) search.value = ""; }); /** @param {import('./option.js').Opt} opt */ const EnumSetter = (opt) => { const lbl = Widget.Label().bind("label", opt); const step = (dir = 1) => { const i = opt.enums.findIndex((i) => i === lbl.label); opt.setValue( dir > 0 ? i + dir > opt.enums.length - 1 ? opt.enums[0] : opt.enums[i + dir] : i + dir < 0 ? opt.enums[opt.enums.length - 1] : opt.enums[i + dir], true, ); }; const next = Widget.Button({ child: Widget.Icon(icons.ui.arrow.right), on_clicked: () => step(+1), }); const prev = Widget.Button({ child: Widget.Icon(icons.ui.arrow.left), on_clicked: () => step(-1), }); return Widget.Box({ class_name: "enum-setter", children: [prev, lbl, next], }); }; /** @param {import('./option.js').Opt} opt */ const Setter = (opt) => { switch (opt.type) { case "number": return Widget.SpinButton({ setup(self) { self.set_range(0, 1000); self.set_increments(1, 5); self.on("value-changed", () => opt.setValue(self.value, true)); self.hook(opt, () => (self.value = opt.value)); }, }); case "float": case "object": return Widget.Entry({ on_accept: (self) => opt.setValue(JSON.parse(self.text || ""), true), setup: (self) => self.hook(opt, () => (self.text = JSON.stringify(opt.value))), }); case "string": return Widget.Entry({ on_accept: (self) => opt.setValue(self.text, true), setup: (self) => self.hook(opt, () => (self.text = opt.value)), }); case "enum": return EnumSetter(opt); case "boolean": return Widget.Switch() .on("notify::active", (self) => opt.setValue(self.active, true)) .hook(opt, (self) => (self.active = opt.value)); case "img": return Widget.FileChooserButton().on("selection-changed", (self) => { opt.setValue(self.get_uri()?.replace("file://", ""), true); }); case "font": return Widget.FontButton({ show_size: false, use_size: false, setup: (self) => self .on("notify::font", ({ font }) => opt.setValue(font, true)) .hook(opt, () => (self.font = opt.value)), }); default: return Widget.Label({ label: "no setter with type " + opt.type, }); } }; /** @param {import('./option.js').Opt} opt */ const Row = (opt) => Widget.Box({ class_name: "row", attribute: opt, children: [ Widget.Box({ vertical: true, vpack: "center", children: [ opt.title && Widget.Label({ xalign: 0, class_name: "summary", label: opt.title, }), Widget.Label({ xalign: 0, class_name: "id", label: `id: "${opt.id}"`, }), ], }), Widget.Box({ hexpand: true }), Widget.Box({ vpack: "center", vertical: true, children: [ Widget.Box({ hpack: "end", child: Setter(opt), }), opt.note && Widget.Label({ xalign: 1, class_name: "note", label: opt.note, }), ], }), ], }); /** @param {string} category */ const Page = (category) => Widget.Scrollable({ vexpand: true, class_name: "page", child: Widget.Box({ class_name: "page-content vertical", vertical: true, setup: (self) => self.hook(search, () => { for (const child of self.children) { child.visible = child.attribute.id.includes(search.value) || child.attribute.title.includes(search.value) || child.attribute.note.includes(search.value); } }), children: optionsList .filter((opt) => opt.category.includes(category)) .map(Row), }), }); const sidebar = Widget.Revealer({ reveal_child: search.bind().transform((v) => !v), transition: "slide_right", child: Widget.Box({ hexpand: false, vertical: true, children: [ Widget.Box({ class_name: "sidebar-header", children: [ Widget.Button({ hexpand: true, label: icons.dialog.Search + " Search", on_clicked: () => (showSearch.value = !showSearch.value), }), Widget.Button({ hpack: "end", child: Widget.Icon(icons.ui.info), on_clicked: () => App.toggleWindow("about"), }), ], }), Widget.Scrollable({ vexpand: true, hscroll: "never", child: Widget.Box({ class_name: "sidebar-box vertical", vertical: true, children: [ ...categories.map((name) => Widget.Button({ label: (icons.dialog[name] || "") + " " + name, xalign: 0, class_name: currentPage .bind() .transform((v) => `${v === name ? "active" : ""}`), on_clicked: () => currentPage.setValue(name), }), ), ], }), }), Widget.Box({ class_name: "sidebar-footer", child: Widget.Button({ class_name: "copy", child: Widget.Label({ label: " Save", xalign: 0, }), hexpand: true, on_clicked: () => { Utils.execAsync(["wl-copy", getValues()]); Utils.execAsync([ "notify-send", "-i", "preferences-desktop-theme-symbolic", "Theme copied to clipboard", 'To save it permanently, make a new theme in themes.js', ]); }, }), }), ], }), }); const searchEntry = Widget.Revealer({ transition: "slide_down", reveal_child: showSearch.bind(), transition_duration: options.transition.bind("value"), child: Widget.Entry({ setup: (self) => self.hook(showSearch, () => { if (!showSearch.value) self.text = ""; if (showSearch.value) self.grab_focus(); }), hexpand: true, class_name: "search", placeholder_text: "Search Options", secondary_icon_name: icons.apps.search, on_change: ({ text }) => (search.value = text || ""), }), }); const categoriesStack = Widget.Stack({ transition: "slide_left_right", children: categories.reduce((obj, name) => { obj[name] = Page(name); return obj; }, {}), shown: currentPage.bind(), visible: search.bind().transform((v) => !v), }); const searchPage = Widget.Box({ visible: search.bind().transform((v) => !!v), child: Page(""), }); export default RegularWindow({ name: "settings-dialog", title: "Settings", setup: (win) => win .on("delete-event", () => { win.hide(); return true; }) .on("key-press-event", (_, event) => { if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) { showSearch.setValue(false); search.setValue(""); } }) .set_default_size(800, 500), child: Widget.Box({ children: [ sidebar, Widget.Box({ vertical: true, children: [searchEntry, categoriesStack, searchPage], }), ], }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/globals.js ================================================ import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js'; export async function globals() { try { globalThis.options = (await import('../options.js')).default; globalThis.iconBrowser = (await import('../misc/IconBrowser.js')).default; globalThis.app = (await import('resource:///com/github/Aylur/ags/app.js')).default; globalThis.audio = (await import('resource:///com/github/Aylur/ags/service/audio.js')).default; globalThis.recorder = (await import('../services/screenrecord.js')).default; globalThis.brightness = (await import('../services/brightness.js')).default; globalThis.indicator = (await import('../services/onScreenIndicator.js')).default; globalThis.app = (await import('resource:///com/github/Aylur/ags/app.js')).default; Mpris.players.forEach(player => { player.connect('changed', player => { globalThis.mpris = player || Mpris.players[0]; }); }); Mpris.connect('player-added', (mpris, bus) => { mpris.getPlayer(bus)?.connect('changed', player => { globalThis.mpris = player || Mpris.players[0]; }); }); Mpris.connect('player-closed', () => { globalThis.mpris = Mpris.players[0]; }); } catch (error) { logError(error); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/hyprland.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; import options from '../options.js'; import { readFile, writeFile } from 'resource:///com/github/Aylur/ags/utils.js'; const noIgnorealpha = ['verification', 'powermenu', 'lockscreen']; /** @param {Array} batch */ function sendBatch(batch) { const cmd = batch .filter(x => !!x) .map(x => `keyword ${x}`) .join('; '); Hyprland.sendMessage(`[[BATCH]]/${cmd}`); } /** @param {string} scss */ function getColor(scss) { if (scss.includes('#')) return scss.replace('#', ''); if (scss.includes('$')) { const opt = options.list().find(opt => opt.scss === scss.replace('$', '')); return opt?.value.replace('#', '') || 'ff0000'; } } export function hyprlandInit() { if (readFile('/tmp/ags/hyprland-init')) return; sendBatch(App.windows.flatMap(({ name }) => [ `layerrule blur, ${name}`, noIgnorealpha.some(skip => name?.includes(skip)) ? '' : `layerrule ignorealpha 0.6, ${name}`, ])); writeFile('init', '/tmp/ags/hyprland-init'); } export async function setupHyprland() { const wm_gaps = Math.floor(options.hypr.wm_gaps_multiplier.value * options.spacing.value); const border_width = options.border.width.value; const radii = options.radii.value; const drop_shadow = options.desktop.drop_shadow.value; const bar_style = options.bar.style.value; const bar_pos = options.bar.position.value; const inactive_border = options.hypr.inactive_border.value; const accent = getColor(options.theme.accent.accent.value); const batch = []; JSON.parse(await Hyprland.sendMessage('j/monitors')).forEach(({ name }) => { const v = bar_pos === 'top' ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`; if (bar_style !== 'normal') batch.push(`monitor ${name},addreserved,${v}`); else batch.push(`monitor ${name},addreserved,0,0,0,0`); }); batch.push( `general:border_size ${border_width}`, `general:gaps_out ${wm_gaps}`, `general:gaps_in ${Math.floor(wm_gaps / 2)}`, `general:col.active_border rgba(${accent}ff)`, `general:col.inactive_border ${inactive_border}`, `decoration:rounding ${radii}`, `decoration:drop_shadow ${drop_shadow ? 'yes' : 'no'}`, ); sendBatch(batch); } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/option.js ================================================ import { CACHE_DIR, readFile, writeFile } from 'resource:///com/github/Aylur/ags/utils.js'; import { exec } from 'resource:///com/github/Aylur/ags/utils.js'; import options from '../options.js'; import Service from 'resource:///com/github/Aylur/ags/service.js'; import { reloadScss } from './scss.js'; import { setupHyprland } from './hyprland.js'; const CACHE_FILE = CACHE_DIR + '/options.json'; /** object that holds the overriedden values */ let cacheObj = JSON.parse(readFile(CACHE_FILE) || '{}'); /** * @template T * @typedef {Object} OptionConfig * @property {string=} scss - name of scss variable set to "exclude" to not include it in the generated scss file * @property {string=} unit - scss unit on numbers, default is "px" * @property {string=} title * @property {string=} note * @property {string=} category * @property {boolean=} noReload - don't reload css & hyprland on change * @property {boolean=} persist - ignore reset call * @property {'object' | 'string' | 'img' | 'number' | 'float' | 'font' | 'enum' =} type * @property {Array =} enums * @property {(value: T) => any=} format * @property {(value: T) => any=} scssFormat */ /** @template T */ export class Opt extends Service { static { Service.register(this, {}, { 'value': ['jsobject'], }); } #value; #scss = ''; unit = 'px'; noReload = false; persist = false; id = ''; title = ''; note = ''; type = ''; category = ''; /** @type {Array} */ enums = []; /** @type {(v: T) => any} */ format = v => v; /** @type {(v: T) => any} */ scssFormat = v => v; /** * @param {T} value * @param {OptionConfig =} config */ constructor(value, config) { super(); this.#value = value; this.defaultValue = value; this.type = typeof value; if (config) Object.keys(config).forEach(c => this[c] = config[c]); import('../options.js').then(this.#init.bind(this)); } set scss(scss) { this.#scss = scss; } get scss() { return this.#scss || this.id .split('.') .join('-') .split('_') .join('-'); } #init() { getOptions(); // sets the ids as a side effect if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]); const words = this.id .split('.') .flatMap(w => w.split('_')) .map(word => word.charAt(0).toUpperCase() + word.slice(1)); this.title ||= words.join(' '); this.category ||= words.length === 1 ? 'General' : words.at(0) || 'General'; this.connect('changed', () => { cacheObj[this.id] = this.value; writeFile( JSON.stringify(cacheObj, null, 2), CACHE_FILE, ); }); } get value() { return this.#value; } set value(value) { this.setValue(value); } /** @param {T} value */ setValue(value, reload = false) { if (typeof value !== typeof this.defaultValue) { console.error(Error(`WrongType: Option "${this.id}" can't be set to ${value}, ` + `expected "${typeof this.defaultValue}", but got "${typeof value}"`)); return; } if (this.value !== value) { this.#value = this.format(value); this.changed('value'); if (reload && !this.noReload) { reloadScss(); setupHyprland(); } } } reset(reload = false) { if (!this.persist) this.setValue(this.defaultValue, reload); } } /** * @template T * @param {T} value * @param {OptionConfig =} config * @returns {Opt} */ export function Option(value, config) { return new Opt(value, config); } /** @returns {Array>} */ export function getOptions(object = options, path = '') { return Object.keys(object).flatMap(key => { /** @type Option */ const obj = object[key]; const id = path ? path + '.' + key : key; if (obj instanceof Opt) { obj.id = id; return obj; } if (typeof obj === 'object') return getOptions(obj, id); return []; }); } export function resetOptions() { exec(`rm -rf ${CACHE_FILE}`); cacheObj = {}; getOptions().forEach(opt => opt.reset()); } export function getValues() { const obj = {}; for (const opt of getOptions()) { if (opt.category !== 'exclude') obj[opt.id] = opt.value; } return JSON.stringify(obj, null, 2); } /** @param {string | object} config */ export function apply(config) { const options = getOptions(); const settings = typeof config === 'string' ? JSON.parse(config) : config; for (const id of Object.keys(settings)) { const opt = options.find(opt => opt.id === id); if (!opt) { print(`No option with id: "${id}"`); continue; } opt.setValue(settings[id]); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/scss.js ================================================ import App from 'resource:///com/github/Aylur/ags/app.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; import { getOptions } from './option.js'; import { dependencies } from '../utils.js'; export function scssWatcher() { return Utils.subprocess( [ 'inotifywait', '--recursive', '--event', 'create,modify', '-m', App.configDir + '/scss', ], reloadScss, () => print('missing dependancy for css hotreload: inotify-tools'), ); } /** * generate an scss file that makes every option available as a variable * based on the passed scss parameter or the path in the object * * e.g * options.bar.style.value => $bar-style */ export async function reloadScss() { if (!dependencies(['sassc'])) return; const opts = getOptions(); const vars = opts.map(opt => { if (opt.scss === 'exclude') return ''; const unit = typeof opt.value === 'number' ? opt.unit : ''; const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value; return `$${opt.scss}: ${value}${unit};`; }); const bar_style = opts.find(opt => opt.id === 'bar.style')?.value || ''; const additional = bar_style === 'normal' ? '//' : ` window#quicksettings .window-content { margin-right: $wm-gaps; } `; try { const tmp = '/tmp/ags/scss'; Utils.ensureDirectory(tmp); await Utils.writeFile(vars.join('\n'), `${tmp}/options.scss`); await Utils.writeFile(additional, `${tmp}/additional.scss`); await Utils.execAsync(`sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`); App.resetCss(); App.applyCss(`${tmp}/style.css`); } catch (error) { if (error instanceof Error) console.error(error.message); if (typeof error === 'string') console.error(error); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/setup.js ================================================ import App from "resource:///com/github/Aylur/ags/app.js"; import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; import Notifications from "resource:///com/github/Aylur/ags/service/notifications.js"; import Audio from "resource:///com/github/Aylur/ags/service/audio.js"; import options from "../options.js"; import icons from "../icons.js"; import { reloadScss, scssWatcher } from "./scss.js"; import { initWallpaper, wallpaper } from "./wallpaper.js"; import { hyprlandInit } from "./hyprland.js"; import { globals } from "./globals.js"; import Gtk from "gi://Gtk?version=3.0"; import { exec, execAsync } from "resource:///com/github/Aylur/ags/utils.js"; export function init() { initWallpaper(); notificationBlacklist(); warnOnLowBattery(); globals(); tmux(); gsettigsColorScheme(); gtkFontSettings(); scssWatcher(); dependandOptions(); reloadScss(); hyprlandInit(); wallpaper(); //pywal(); //gtkTheme(); //gtkIcons(); Audio.maxStreamVolume = 1.05; } function dependandOptions() { options.bar.style.connect("changed", ({ value }) => { if (value !== "normal") options.desktop.screen_corners.setValue(false, true); }); } function tmux() { if (!Utils.exec("which tmux")) return; /** @param {string} scss */ function getColor(scss) { if (scss.includes("#")) return scss; if (scss.includes("$")) { const opt = options .list() .find((opt) => opt.scss === scss.replace("$", "")); return opt?.value; } } options.theme.accent.accent.connect("changed", ({ value }) => Utils.execAsync(`tmux set @main_accent ${getColor(value)}`).catch((err) => console.error(err.message), ), ); } function gsettigsColorScheme() { if (!Utils.exec("which gsettings")) return; options.theme.scheme.connect("changed", ({ value }) => { const gsettings = "gsettings set org.gnome.desktop.interface color-scheme"; Utils.execAsync(`${gsettings} "prefer-${value}"`).catch((err) => console.error(err.message), ); }); } function gtkFontSettings() { const settings = Gtk.Settings.get_default(); if (!settings) { console.error(Error("Gtk.Settings unavailable")); return; } const callback = () => { const { size, font } = options.font; settings.gtk_font_name = `${font.value} ${size.value}`; }; options.font.font.connect("notify::value", callback); options.font.size.connect("notify::value", callback); } function notificationBlacklist() { Notifications.connect("notified", (_, id) => { const n = Notifications.getNotification(id); options.notifications.black_list.value.forEach((item) => { if (n?.app_name.includes(item) || n?.app_entry?.includes(item)) n.close(); }); }); } function warnOnLowBattery() { Battery.connect("notify::percent", () => { const low = options.battery.low.value; if ( Battery.percent !== low || Battery.percent !== low / 2 || !Battery.charging ) return; Utils.execAsync([ "notify-send", `${Battery.percent}% Battery Percentage`, "-i", icons.battery.warning, "-u", "critical", ]); }); } export function pywal() { if (!exec("which wal")) return print("missing dependancy: pywal"); execAsync(["wal", "--theme", options.misc.pywal.theme.value]).catch((err) => console.error(err), ); } export function gtkTheme() { if (!exec("which gsettings")) return print("missing dependancy: Gnome-Settings"); execAsync([ "gsettings", "set", "org.gnome.desktop.interface", "gtk-theme", options.misc.gtk.theme.value, ]).catch((err) => console.error(err)); } export function gtkIcons() { if (!exec("which gsettings")) return print("missing dependancy: Gnome-Settings"); execAsync([ "gsettings", "set", "org.gnome.desktop.interface", "icon-theme", options.misc.gtkIcons.theme.value, ]).catch((err) => console.error(err)); } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/theme.js ================================================ import options from '../options.js'; import themes from '../themes.js'; import { reloadScss } from './scss.js'; import { setupHyprland } from './hyprland.js'; import { wallpaper } from './wallpaper.js'; import { gtkIcons, gtkTheme, pywal } from './setup.js'; import GLib from 'gi://GLib'; /** @param {string} name */ export function setTheme(name) { options.reset(); const theme = themes.find(t => t.name === name); if (!theme) return print('No theme named ' + name); options.apply(theme.options); reloadScss(); setupHyprland(); wallpaper(); // gtkIcons(); // gtkTheme(); } export const WP = GLib.get_home_dir() + '/.config/backgrounds/'; export const HOME = GLib.get_home_dir() + '/'; export const lightColors = { 'theme.scheme': 'light', 'color.red': '#e55f86', 'color.green': '#00D787', 'color.yellow': '#EBFF71', 'color.blue': '#51a4e7', 'color.magenta': '#9077e7', 'color.teal': '#51e6e6', 'color.orange': '#E79E64', 'theme.bg': '#fffffa', 'theme.fg': '#141414', }; export const Theme = ({ name, icon = ' ', ...options }) => ({ name, icon, options: { 'theme.name': name, 'theme.icon': icon, ...options, }, }); let settingsDialog; export async function openSettings() { if (settingsDialog) return settingsDialog.present(); try { settingsDialog = (await import('./SettingsDialog.js')).default; settingsDialog.present(); } catch (error) { if (error instanceof Error) console.error(error.message); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/settings/wallpaper.js ================================================ import options from '../options.js'; import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js'; import { dependencies } from '../utils.js'; import GLib from 'gi://GLib'; export function initWallpaper() { if (dependencies(['swww'])) { exec('swww init'); options.desktop.wallpaper.img.connect('changed', wallpaper); } } export function wallpaper() { const backgrounds = GLib.get_home_dir() + '/.config/backgrounds'; if (!dependencies(['swww'])) return; execAsync([ 'swww', 'img', '--transition-step', '4', '-f', 'CatmullRom', '--transition-fps', '120', options.desktop.wallpaper.img.value, ]).catch(err => console.error(err)); execAsync([ 'cp', options.desktop.wallpaper.img.value, `${backgrounds}/last/image.png` ]); execAsync(`sh -c ~/.config/ags/prepare_background.sh`) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/themes.js ================================================ /** * A Theme is a set of options that will be applied * ontop of the default values. see options.js for possible options */ import { Theme, WP, HOME } from "./settings/theme.js"; export default [ Theme({ name: "Adwaita Dark", icon: "󰊬 ", workspaces: 10, //"misc.gtk.theme": "adw-gtk3-dark", //"misc.gtkIcons.theme": "Adwaita", "desktop.wallpaper.img": WP + "hypr-marble.png", "desktop.avatar": HOME + "face.png", spacing: 2, padding: 8, radii: 5, popover_padding_multiplier: 1.4, "color.red": "#c01c28", "color.green": "#2ec27e", "color.yellow": "#f5c211", "color.blue": "#3584e4", "color.magenta": "#813d9c", "color.teal": "#99c1f1", "color.orange": "#e66100", "theme.scheme": "dark", "theme.bg": "#1E1E1E", "theme.fg": "#deddda", "theme.accent.accent": "$blue", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "theme.widget.borderwidth": 1, "border.color": "$fg-color", "border.opacity": 0, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 5, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 42, "applauncher.anchor": "center", "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "desktop.dock.icon_size": 42, "desktop.dock.pinned_apps": [ "firefox", "neovide", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], "notifications.black_list": ["Spotify"], "notifications.position": ["top"], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": ["firefox"], "mpris.preferred": "spotify", }), Theme({ name: "Gruvbox Dark", icon: " ", workspaces: 10, //"misc.gtk.theme": "Gruvbox-Dark-B", //"misc.gtkIcons.theme": "gruvbox_icons", "desktop.wallpaper.img": WP + "stairs.png", "desktop.avatar": HOME + "face.png", spacing: 2, padding: 8, radii: 5, popover_padding_multiplier: 1.4, "color.red": "#CC241D", "color.green": "#476C43", "color.yellow": "#D79921", "color.blue": "#458588", "color.magenta": "#B16286", "color.teal": "#689D6A", "color.orange": "#D65D0E", "theme.scheme": "dark", "theme.bg": "#1D2021", "theme.fg": "#FBF1C7", "theme.accent.accent": "$blue", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$green", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "applauncher.anchor": "center", "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "desktop.dock.icon_size": 42, "desktop.dock.pinned_apps": [ "firefox", "neovide", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], "notifications.black_list": ["Spotify"], "notifications.position": ["top"], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": ["Caprine"], "mpris.preferred": "spotify", }), Theme({ name: "Catppuccin Frappé", icon: "󰄛 ", workspaces: 10, //"misc.gtk.theme": "Catppuccin-Frappe", //"misc.gtkIcons.theme": "Adwaita", "desktop.wallpaper.img": WP + "mocha-mountains.png", "desktop.avatar": HOME + "face.png", spacing: 2, padding: 8, radii: 5, popover_padding_multiplier: 1.4, "color.red": "#e78284", "color.green": "#a6d189", "color.yellow": "#e5c890", "color.blue": "#8caaee", "color.magenta": "#ca9ee6", "color.teal": "#81c8be", "color.orange": "#ef9f76", "theme.scheme": "dark", "theme.bg": "#181926", "theme.fg": "#c6d0f5", "theme.accent.accent": "$blue", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 8%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 5, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "applauncher.anchor": "center", "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "desktop.dock.icon_size": 42, "desktop.dock.pinned_apps": [ "firefox", "neovide", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], "notifications.black_list": ["Spotify"], "notifications.position": ["top"], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": ["Caprine"], "mpris.preferred": "spotify", }), Theme({ name: "Rosé Pine", icon: "󰐅 ", workspaces: 10, //"misc.gtk.theme": "rose-pine-gtk", //"misc.gtkIcons.theme": "rose-pine-icons", "desktop.wallpaper.img": WP + "leafy-moon.png", "desktop.avatar": HOME + "face.png", spacing: 2, padding: 8, radii: 5, popover_padding_multiplier: 1.4, "color.red": "#eb6f92", "color.green": "#9ccfd8", "color.yellow": "#f6c177", "color.blue": "#3e8fb0", "color.magenta": "#c4a7e7", "color.teal": "#31748f", "color.orange": "#ebbcba", "theme.scheme": "dark", "theme.bg": "#191724", "theme.fg": "#e0def4", "theme.accent.accent": "$teal", "theme.accent.fg": "$bg-color", "theme.accent.gradient": "to right, $accent, lighten($accent, 14%)", "theme.widget.bg": "$fg-color", "theme.widget.opacity": 94, "border.color": "$fg-color", "border.opacity": 100, "border.width": 0, "border.barcolor": "$accent", "hypr.inactive_border": "rgba(333333ff)", "hypr.wm_gaps": 3, "font.font": "Ubuntu Nerd Font", "font.mono": "Mononoki Nerd Font", "font.size": 13, "applauncher.width": 500, "applauncher.height": 400, "applauncher.icon_size": 32, "applauncher.anchor": "center", "bar.position": "top", "bar.style": "floating", "bar.flat_buttons": true, "bar.separators": true, "bar.icon": "distro-icon", "battery.bar.width": 70, "battery.bar.height": 14, "battery.low": 15, "battery.medium": 35, "desktop.wallpaper.fg": "#fff", "desktop.drop_shadow": false, "desktop.shadow": "rgba(0, 0, 0, .6)", "desktop.dock.icon_size": 42, "desktop.dock.pinned_apps": [ "firefox", "neovide", "kitty", "org.gnome.Nautilus", "obsidian", "discord", "spotify", "superslicer", "org.gnome.Software", ], "notifications.black_list": ["Spotify"], "notifications.position": ["top"], "notifications.width": 450, "dashboard.sys_info_size": 70, "mpris.black_list": ["Caprine"], "mpris.preferred": "spotify", }), ]; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/utils.js ================================================ import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; import cairo from "cairo"; import icons from "./icons.js"; import Gdk from "gi://Gdk"; import GLib from "gi://GLib"; /** * @param {number} length * @param {number=} start * @returns {Array} */ export function range(length, start = 1) { return Array.from({ length }, (_, i) => i + start); } /** * @param {Array<[string, string] | string[]>} collection * @param {string} item * @returns {string} */ export function substitute(collection, item) { return collection.find(([from]) => from === item)?.[1] || item; } /** * @param {(monitor: number) => any} widget * @returns {Array} */ export function forMonitors(widget) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1; return range(n, 0).map(widget).flat(1); } /** * @param {import('gi://Gtk?version=3.0').default.Widget} widget* * @returns {any} - missing cairo type */ export function createSurfaceFromWidget(widget) { const alloc = widget.get_allocation(); const surface = new cairo.ImageSurface( cairo.Format.ARGB32, alloc.width, alloc.height, ); const cr = new cairo.Context(surface); cr.setSourceRGBA(255, 255, 255, 0); cr.rectangle(0, 0, alloc.width, alloc.height); cr.fill(); widget.draw(cr); return surface; } /** @param {string} icon */ export function getAudioTypeIcon(icon) { const substitues = [ ["audio-headset-bluetooth", icons.audio.type.headset], ["audio-card-analog-usb", icons.audio.type.speaker], ["audio-card-analog-pci", icons.audio.type.card], ]; return substitute(substitues, icon); } /** @param {import('types/service/applications').Application} app */ export function launchApp(app) { Utils.execAsync(["hyprctl", "dispatch", "exec", `sh -c ${app.executable}`]); app.frequency += 1; } /** @param {Array} bins */ export function dependencies(bins) { const deps = bins.map((bin) => { const has = Utils.exec(`which ${bin}`); if (!has) print(`missing dependency: ${bin}`); return !!has; }); return deps.every((has) => has); } /** @param {string} img - path to an img file */ export function blurImg(img) { const cache = Utils.CACHE_DIR + "/media"; return new Promise((resolve) => { if (!img) resolve(""); const dir = cache + "/blurred"; const blurred = dir + img.substring(cache.length); if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) return resolve(blurred); Utils.ensureDirectory(dir); Utils.execAsync(["convert", img, "-blur", "0x22", blurred]) .then(() => resolve(blurred)) .catch(() => resolve("")); }); } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/js/variables.js ================================================ import Variable from 'resource:///com/github/Aylur/ags/variable.js'; import GLib from 'gi://GLib'; import options from './options.js'; const intval = options.systemFetchInterval; export const clock = Variable(GLib.DateTime.new_now_local(), { poll: [1000, () => GLib.DateTime.new_now_local()], }); export const uptime = Variable('', { poll: [60_000, 'cat /proc/uptime', line => { const uptime = Number.parseInt(line.split('.')[0]) / 60; if (uptime > 18 * 60) return 'Go Sleep'; const h = Math.floor(uptime / 60); const s = Math.floor(uptime % 60); return `${h}:${s < 10 ? '0' + s : s}`; }], }); export const distro = GLib.get_os_info('ID'); export const distroIcon = (() => { switch (distro) { case 'fedora': return ''; case 'arch': return ''; case 'nixos': return ''; case 'debian': return ''; case 'opensuse-tumbleweed': return ''; case 'ubuntu': return ''; case 'endeavouros': return ''; default: return ''; } })(); /** @type {function([string, string] | string[]): number} */ const divide = ([total, free]) => Number.parseInt(free) / Number.parseInt(total); export const cpu = Variable(0, { poll: [intval, 'top -b -n 1', out => divide(['100', out.split('\n') .find(line => line.includes('Cpu(s)')) ?.split(/\s+/)[1] .replace(',', '.') || '0'])], }); export const ram = Variable(0, { poll: [intval, 'free', out => divide(out.split('\n') .find(line => line.includes('Mem:')) ?.split(/\s+/) .splice(1, 2) || ['1', '1'])], }); export const temp = Variable(0, { poll: [intval, 'cat ' + options.temperature, n => { return Number.parseInt(n) / 100_000; }], }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/package.json ================================================ { "name": "ags-dotfiles", "version": "1.7.6", "description": "An extensible GTK-Shell", "main": "config.js", "scripts": { "lint": "eslint . --fix", "stylelint": "stylelint ./scss --fix" }, "repository": { "type": "git", "url": "git+https://github.com/RoccoRakete/hyprland-dots.git" }, "author": "RoccoRakete", "bugs": { "url": "https://github.com/RoccoRakete/hyprland-dots/issues" }, "homepage": "https://github.com/RoccoRakete/hyprland-dots/blob/main/README.md", "kofi": "https://ko-fi.com/roccorakete", "devDependencies": { "@girs/dbusmenugtk3-0.4": "^0.4.0-3.2.0", "@girs/gobject-2.0": "^2.76.1-3.2.3", "@girs/gtk-3.0": "^3.24.39-3.2.2", "@girs/gvc-1.0": "^1.0.0-3.1.0", "@girs/nm-1.0": "^1.43.1-3.1.0", "stylelint-config-standard-scss": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.44.0" } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/prepare_background.sh ================================================ #!/usr/bin/env sh sleep 5 convert -scale 1920x1080 -blur 0x5 ~/.config/backgrounds/last/image.png ~/.config/backgrounds/last/image_blurred.png ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/a11y-button.scss ================================================ @import './button'; @mixin accs-button($flat: false, $reactive: true){ @include button($flat: true, $reactive: false, $focusable: false); color: $fg-color; > * { border-radius: $radii; transition: $transition; @if $flat{ background-color: transparent; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } } @if $reactive{ &:focus > *, &.focused > * { @include button-focus; } &:hover > * { @include button-hover; } &:active, &.active, &.on, &:checked { > * { @include button-active; } &:hover > * { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/button-workspaces.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $accent; background-color: $hover; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $bg-color; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $accent; color: $accent-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg-color, 0.7); } @mixin button-workspaces($flat: false, $reactive: true, $radii: $radii, $focusable: true){ all: unset; transition: $transition; border-radius: $radii; color: $fg-color; @if $flat{ background-color: transparent; background-image: none; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive{ @if $focusable { &:focus{ @include button-focus; } } &:hover{ @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/button.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $accent; background-color: $hover; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $hover; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $accent; color: $accent-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg-color, 0.7); } @mixin button($flat: false, $reactive: true, $radii: $radii, $focusable: true){ all: unset; transition: $transition; border-radius: $radii; color: $fg-color; @if $flat{ background-color: transparent; background-image: none; box-shadow: none; } @else{ background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive{ @if $focusable { &:focus{ @include button-focus; } } &:hover{ @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/floating-widget.scss ================================================ @mixin floating-widget { @if $drop-shadow { box-shadow: 0 0 5px 0 $shadow; } margin: max($spacing, 8px); border: $widget-border-width solid $popover-border-color; background-color: $bg-color; color: $fg-color; border-radius: $popover-radius; padding: $popover-padding; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/hidden.scss ================================================ @mixin hidden { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); * { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/menu.scss ================================================ window.popup { >* { border: none; box-shadow: none; } menu { border-radius: $popover-radius; background-color: $bg-color; padding: $popover-padding; border: $border-width solid $popover-border-color; separator { background-color: $border-color; } menuitem { @include button; padding: $spacing/2; margin: $spacing/2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/scrollable.scss ================================================ @mixin scrollable { scrollbar, scrollbar * { all: unset; } scrollbar.vertical { transition: $transition; background-color: transparentize($bg-color, 0.7); &:hover { background-color: transparentize($bg-color, 0.3); slider { background-color: transparentize($fg-color, 0.3); min-width: .6em; } } } scrollbar.vertical slider { background-color: transparentize($fg-color, 0.5); border-radius: $radii; min-width: .4em; min-height: 2em; transition: $transition; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/slider.scss ================================================ @import './unset'; @mixin slider($width: 0.7em, $slider-width: .5em, $gradient: $active-gradient, $slider: true, $focusable: true, $radii: $radii){ @include unset($rec: true); trough{ transition: $transition; border-radius: $radii; border: $border; background-color: $widget-bg; min-height: $width; min-width: $width; highlight, progress{ border-radius: max($radii - $border-width, 0); background-image: $gradient; min-height: $width; min-width: $width; } } slider { box-shadow: none; background-color: transparent; border: $border-width solid transparent; transition: $transition; border-radius: $radii; min-height: $width; min-width: $width; margin: -$slider-width; } &:hover { trough { background-color: $hover; } slider { @if $slider{ background-color: $fg-color; border-color: $border-color; @if $drop-shadow { box-shadow: 0 0 3px 0 $shadow; } } } } &:disabled { highlight, progress{ background-color: transparentize($fg-color, 0.4); background-image: none; } } @if $focusable { trough:focus{ background-color: $hover; box-shadow: inset 0 0 0 $border-width $accent; slider { @if $slider { background-color: $fg-color; box-shadow: inset 0 0 0 $border-width $accent; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/spacing.scss ================================================ @mixin spacing($multiplier: 6, $spacing: $spacing, $rec: false) { &.horizontal>* { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical>* { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } @if $rec { box { &.horizontal>* { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical>* { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/switch.scss ================================================ @import './button'; @mixin switch { @include button; slider { background-color: $accent-fg; border-radius: $radii; min-width: 24px; min-height: 24px; } image { color: transparent; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/text-border.scss ================================================ @mixin text-border{ text-shadow: -1 * $border-width -1 * $border-width 0 $border-color, $border-width $border-width 0 $border-color, -1 * $border-width $border-width 0 $border-color, $border-width -1 * $border-width 0 $border-color; -gtk-icon-shadow: -1 * $border-width -1 * $border-width 0 $border-color, $border-width $border-width 0 $border-color, -1 * $border-width $border-width 0 $border-color, $border-width -1 * $border-width 0 $border-color; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/tooltip.scss ================================================ tooltip { * { all: unset; } background-color: transparent; border: none; > * > *{ background-color: $bg-color; border-radius: $radii; border: $border-width solid $popover-border-color; color: $fg-color; padding: 8px; margin: 4px; box-shadow: 0 0 3px 0 $shadow; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/unset.scss ================================================ @mixin unset($rec: false){ all: unset; @if $rec { * { all: unset }; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/common/widget.scss ================================================ @mixin widget{ transition: $transition; border-radius: $radii; color: $fg-color; background-color: $widget-bg; border: $border; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/main.scss ================================================ @import '/tmp/ags/scss/options'; @import './variables'; // common @import './common/unset'; @import './common/widget'; @import './common/button'; @import './common/button-workspaces.scss'; @import './common/a11y-button'; @import './common/floating-widget'; @import './common/slider'; @import './common/scrollable'; @import './common/switch'; @import './common/hidden'; @import './common/text-border'; @import './common/tooltip'; @import './common/menu'; @import './common/spacing'; // widgets @import './widgets/about'; @import './widgets/applauncher'; @import './widgets/bar'; @import './widgets/desktop'; @import './widgets/notifications'; @import './widgets/overview'; @import './widgets/osd'; @import './widgets/dashboard'; @import './widgets/dock'; @import './widgets/powermenu'; @import './widgets/lockscreen'; @import './widgets/media'; @import './widgets/quicksettings'; @import './widgets/settings'; // additional overrides @import '/tmp/ags/scss/additional'; ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/variables.scss ================================================ // variables are defined in options.js // these ones are derived from those $hover: transparentize($_widget-bg, ($widget-opacity * 0.9) / 100); $widget-bg: transparentize($_widget-bg, $widget-opacity / 100); $active-gradient: linear-gradient($accent-gradient); $hover-fg: if($color-scheme == 'dark', lighten($fg-color, 10%), darken($fg-color, 8%)); $border-color: transparentize($_border-color, $border-opacity / 100); $border: $border-width solid $border-color; $text-shadow: 2px 2px 2px $shadow; $popover-border-color: transparentize($_border-color, max(($border-opacity - 1) / 100, 0)); $popover-padding: $padding * $popover-padding-multiplier; $popover-radius: if($radii == 0, 0, $radii + $popover-padding); $bar-border: $border-width solid $bar-border-color; $shader-fg: #fff; * { font-size: $font-size; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/about.scss ================================================ window#about { @include unset; .window-content { @include floating-widget; min-width: 300px; } .avatar { min-width: 200px; min-height: 200px; background-size: cover; border: $border; margin: $spacing 0; } .labels { .title { font-size: 1.2em; } .author { color: transparentize($fg-color, 0.2) } .version { margin-top: $spacing; margin-bottom: $spacing * 2; border-radius: $radii; background-color: $widget-bg; color: $accent; padding: $padding; } } .buttons { padding-bottom: $popover-padding; button { @include button; padding: $padding; &:first-child { border-radius: $radii $radii 0 0; } &:last-child { border-radius: 0 0 $radii $radii; } } } .dont-show { @include button; padding: $padding; image { font-size: 1.4em; color: $red; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/applauncher.scss ================================================ window#applauncher .window-content { @include floating_widget; entry { @include button; padding: $padding; margin-bottom: $spacing; label, image { color: $fg-color; } } separator { min-height: 1px; background-color: $hover; } scrolledwindow { @include scrollable; min-width: $applauncher-width; min-height: $applauncher-height; } button.app-item { @include button($flat: true, $reactive: false); > box { @include spacing(0.5); } transition: $transition; padding: $padding; label { transition: $transition; &.title { color: $fg-color; } &.description { color: transparentize($fg-color, 0.3); } } image { transition: $transition; } &:hover, &:focus { .title { color: $accent; } image { -gtk-icon-shadow: 2px 2px $accent; } } &:active { background-color: transparentize($accent, 0.5); border-radius: $radii; box-shadow: inset 0 0 0 $border-width $border-color; .title { color: $fg-color; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/bar.scss ================================================ $bar-spacing: $spacing / 2; $button-radius: if( $bar-style == "floating", max(0, $radii - $bar-spacing), $radii ); @mixin panel-button($flat: $bar-flat-buttons, $reactive: true) { @include unset; @if $bar-style == "separated" { transition: $transition; > * { @include floating-widget; border-radius: $radii; margin: $wm-gaps $bar-spacing; transition: $transition; } &:hover > * { color: $hover-fg; @if $drop-shadow { box-shadow: 0 0 min(6px, $spacing/2) 0 $shadow, inset 0 0 0 99px $hover; } @else { box-shadow: inset 0 0 0 99px $hover; } } &:active > *, &.active > * { label, image { color: $accent-fg; } background-image: $active-gradient; background-color: $accent; } } @else { @include accs-button($flat, $reactive); > * { border-radius: $button-radius; margin: $bar-spacing; } } label, image { font-weight: bold; } > * { padding: $padding * 0.4 $padding * 0.8; } } .panel { .cpu { padding-left: $spacing/2; color: $accent; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-left: $spacing/4; margin-right: 0; padding: $spacing; padding-left: $spacing * 3; background-color: $bg-color; } } .ram { color: $yellow; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-radius: 0; margin-left: 0; margin-right: 0; padding: $spacing; background-color: $bg-color; } } .temp { padding-right: $spacing * 2; color: $magenta; font-size: $font_size/5; border-radius: max($radii - $border_width, 0); margin: $spacing; min-height: $font_size * 1.25; min-width: $font_size * 1.25; @if $bar_style == "separated" { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-right: $spacing/4; margin-left: 0; padding: $spacing; padding-right: $spacing * 3; background-color: $bg-color; } } .circular-progress-box { .circular-progress { margin: $spacing/2.5; background-color: $widget-bg; font-size: 1em; @if $bar_style == "separated" { padding: $wm_gaps $wm_gaps + 5px $wm_gaps $wm_gaps + 5px; border-radius: max($radii - $border_width, 0); margin-left: $spacing/4; margin-right: $spacing/4; } } } @if $bar-style == "normal" { background-color: $bg-color; } @if not $screen-corners and $bar-style == "normal" { @if $bar-position == "bottom" { border-top: $border; } @else { border-bottom: $border; } } @if $bar-style == "floating" { @include floating-widget; border: $bar-border-width solid $popover-border-color; border-radius: $radii; margin-top: $wm-gaps; margin-left: $wm-gaps; margin-right: $wm-gaps; margin-bottom: 0; padding: 0; } @if $bar-style == "separated" { > .end > button:last-child > * { margin-right: $wm-gaps; } > .start > button:first-child > * { margin-left: $wm-gaps; } margin-bottom: 0; } .panel-button { @include panel-button; } .battery_percentage { padding-bottom: 2px; } .tray-item, .color-picker { @include panel-button($flat: true); } separator { background-color: transparentize($fg-color, 0.86); border-radius: $radii; min-height: 5px; min-width: 5px; } .overview { label { color: transparentize($accent, 0.2); } &:hover label { color: $accent; } &:active label, &.active label { color: $accent-fg; } } .powermenu, .recorder { image { color: transparentize($red, 0.3); } &:hover image { color: transparentize($red, 0.15); } &:active image { color: $red; } } .focused-client > box > box, .quicksettings > box > box { @include spacing( $spacing: if($bar-spacing ==0, $padding / 2, $bar-spacing) ); } /* stylelint-disable-next-line selector-not-notation */ .quicksettings:not(.active):not(:active) { .bluetooth { color: $blue; } .battery { &.low { color: $red; } &.charged, &.charging { color: $green; } } } .media { &.spotify image { color: $green; } &.firefox image { color: $orange; } &.mpv image { color: $magenta; } } .notifications { image { color: $yellow; } } .battery-bar { label { margin-right: $bar-spacing * 3; } .font-icon { font-size: 1.15em; } @if $battery-bar-full { > box { padding: 0; } } image, .font-icon { margin-right: $bar-spacing * 0.5; } levelbar { margin: $padding; padding: $padding; trough { @include widget; min-width: $battery-bar-width; min-height: $battery-bar-height; block.filled { border-radius: max($radii - $border-width, 0); background-image: $active-gradient; } block.empty { border-radius: max($radii - $border-width, 0); } } } @mixin color($color) { image, label { color: $fg_color; } block.filled { background-image: linear-gradient( to right, $color, lighten($color, 6%) ); } } .medium { @include color($yellow); } .low { @include color($red); } .charging { @include color($green); } &:active { @include color($accent-fg); } .whole-button { label { color: $fg-color; text-shadow: $text-shadow; } trough, block.filled { border-radius: $button-radius; } @if $bar-style == "separated" { trough { border: none; } } } } .workspaces { .horizontal { background-color: $bg-color; } > * { padding: 0; } .eventbox { transition: $transition; @if $bar-style == "separated" { border-radius: max($radii - $border-width, 0); } @else { @include button($flat: true); } } button { all: unset; background-color: $bg-color; border-radius: $radii; .indicator { font-size: 0; min-width: $font_size * 0.9; min-height: $font_size * 0.9; border-radius: $font_size; box-shadow: inset 0 0 0 $border-width $border-color; margin: 0 $padding/2; transition: $transition/2; background-color: transparentize($fg-color, 0.8); } &:last-child .indicator { margin-right: $padding; } &:first-child .indicator { margin-left: $padding; } &.occupied .indicator { background-color: transparentize($fg-color, 0.2); } &:hover .indicator { box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8); } &.active .indicator, &:active .indicator { background-color: $accent; } &.active .indicator { min-width: $font_size * 2.5; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/dashboard.scss ================================================ @mixin calendar { @include widget; padding: $padding*2 $padding*2 0; calendar{ all: unset; &.button{ @include button($flat: true); } &:selected{ box-shadow: inset 0 -8px 0 0 transparentize($accent, 0.5), inset 0 0 0 1px $accent; border-radius: $radii*0.6; } &.header{ background-color: transparent; border: none; color: transparentize($fg-color, 0.5); } &.highlight{ background-color: transparent; color: transparentize($accent, 0.5); } &:indeterminate { color: transparentize($fg-color, 0.9); } font-size: 1.1em; padding: .2em; } } window#dashboard .window-content { @include floating-widget; .notifications { min-width: $notifications-width; .header { margin-bottom: $spacing; margin-right: $spacing; > label { margin-left: $radii / 2; } button { @include button; padding: $padding/2 $padding; } } .notification-scrollable { @include scrollable; } .notification-list { margin-right: $spacing; } .notification { @include notification; > box { @include widget; padding: $padding; margin-bottom: $spacing; } } .placeholder { image { font-size: 7em; } label { font-size: 1.2em; } } } separator { background-color: $popover-border-color; min-width: 2px; border-radius: $radii; margin-right: $spacing; } .datemenu, .system-info { @include spacing; } .clock-box { padding: $padding; .clock { font-size: 5em; } .uptime { color: transparentize($fg-color, 0.2); } } .calendar { @include calendar; } .circular-progress-box { @include widget; padding: $padding; .circular-progress { min-height: $sys-info-size; min-width: $sys-info-size; margin: $padding/2; font-size: $padding; background-color: $bg-color; color: $accent; image { font-size: 1.8em; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/desktop.scss ================================================ window.corner .corner { background-color: $bg-color; border-radius: $radii * 2; min-width: 2px; min-height: 2px; } window.desktop { @if $bar-style == 'normal' { border-radius: if($screen-corners, $radii * 2, 0); box-shadow: inset 0 0 $wm-gaps / 2 0 $shadow; } .clock-box-shadow { border: 5px solid $wallpaper-fg; border-radius: $radii; .clock-box { border-radius: max($radii - 5px, 0); padding: 0 14px; .clock { color: $wallpaper-fg; font-size: 140px; font-family: $mono-font; } .separator-box { padding: 24px 12px; separator { border-radius: $radii; min-width: 16px; min-height: 16px; background-color: $wallpaper-fg; } } } } .date { color: $wallpaper-fg; font-size: 48px; } @if $drop-shadow { .clock-box-shadow, separator { box-shadow: 2px 2px 2px 0 $shadow; } .clock-box { box-shadow: inset 2px 2px 2px 0 $shadow; } label { text-shadow: $text-shadow; } } @else { .clock-box-shadow{ box-shadow: 0 0 0 $border-width $border-color, inset 0 0 0 $border-width $border-color; } separator { border: $border; } label { @include text-border; } } } .desktop-menu { image { margin-left: -14px; margin-right: 6px; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/dock.scss ================================================ @mixin dock($spacing: $spacing * 0.7) { separator { border-radius: $radii; background-color: transparentize($fg-color, 0.8); margin: 0 $spacing; min-width: 2px; min-height: 2em; } button { @include accs-button($flat: true); .box { margin: $spacing / 2; } image { margin: $padding; margin-bottom: $padding * 1.5; @if $color-scheme == 'light' { -gtk-icon-shadow: $text-shadow; } } .indicator { min-width: 6px; min-height: 6px; background-color: $fg-color; border-radius: $radii; margin-bottom: $padding/4; &.focused { background-image: $active-gradient; } } } } window.floating-dock .dock { @include dock; @include floating-widget; border-radius: if($radii == 0, 0, $radii + $spacing / 2); border: $border-width solid $popover-border-color; padding: $spacing / 2; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/lockscreen.scss ================================================ window.lockscreen { background-color: rgba(0, 0, 0, 0.25); .avatar { @include widget; border-radius: $radii * 2; min-height: 200px; min-width: 200px; } .content { @include floating-widget; padding: $spacing * 4; } spinner { margin-top: $spacing * 2; } entry { @include button; margin-top: $spacing * 2; padding: $spacing; min-height: 20px; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/media.scss ================================================ @mixin player-color($color) { button { .shuffle.enabled { color: $color; } .loop { &.playlist, &.track { color: $color; } } &:active label { color: $color; } } .position-slider:hover trough { background-color: transparentize($color, 0.5); } .player-icon { color: $color; } } @mixin media() { @include widget; label { color: $shader-fg; text-shadow: $text-shadow; } .blurred-cover, .cover { background-size: cover; background-position: center; border-radius: $radii*0.8; opacity: 0.8; } .cover { min-height: 100px; min-width: 100px; box-shadow: 2px 2px 2px 0 $shadow; margin: $padding; opacity: 0.9; } .labels { margin-top: $padding; label { font-size: 1.1em; text-shadow: $text-shadow; &.title { font-weight: bold; } } } .position-slider { @include slider($width: .4em, $slider: false, $gradient: linear-gradient($shader-fg, $shader-fg), $radii: 0); margin-bottom: $padding/2; trough { border: none; background-color: transparentize($shader-fg, 0.7); } } .footer-box { margin: -$padding/2 $padding $padding/2; image { -gtk-icon-shadow: $text-shadow; } } .controls button { @include unset; label { font-size: 2em; color: transparentize($shader-fg, 0.2); transition: $transition; &.shuffle, &.loop { font-size: 1.4em; } } &:hover label { color: transparentize($shader-fg, 0.1); } &:active label { color: $shader-fg; } } &.spotify { @include player-color($green); } &.firefox { @include player-color($orange); } &.mpv { @include player-color($magenta); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/notifications.scss ================================================ @mixin notification() { &.critical > box { box-shadow: inset 0 0 .5em 0 $red; } &:hover button.close-button{ @include button-hover; background-color: transparentize($red, .5); } .content { .title { margin-right: $spacing; color: $fg-color; font-size: 1.1em; } .time { color: transparentize($fg-color, .2); } .description { font-size: .9em; color: transparentize($fg-color, .2); } .icon { border-radius: $radii*0.8; margin-right: $spacing; &.img { border: $border; } } } box.actions { @include spacing(0.5); margin-top: $spacing; button { @include button; border-radius: $radii*0.8; font-size: 1.2em; padding: $padding * 0.7; } } button.close-button { @include button($flat: true); margin-left: $spacing / 2; border-radius: $radii*0.8; min-width: 1.2em; min-height: 1.2em; &:hover { background-color: transparentize($red, .2); } &:active { background-image: linear-gradient($red, $red); } } } window.notifications { @include unset; .notification { @include notification; > box { @include floating-widget; border-radius: $radii; } .description { min-width: 350px; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/osd.scss ================================================ window.indicator .progress { @include floating-widget; padding: $padding / 2; border-radius: if($radii == 0, 0, $radii + $padding / 2); border: $border-width solid $popover-border-color; .fill { border-radius: $radii; background-color: $accent; color: $accent-fg; image { -gtk-icon-transform: scale(0.7); } .font-icon { font-size: 34px; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/overview.scss ================================================ window#overview .window-content { @include floating-widget; @include spacing; .workspace { &.active > widget { border-color: $accent } > widget { @include widget; border-radius: if($radii == 0, 0, $radii + $padding); &:drop(active) { border-color: $accent; } } } .client { @include button; border-radius: $radii; margin: $padding; &.hidden { @include hidden; transition: 0; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/powermenu.scss ================================================ window#powermenu, window#verification { .shader { background-color: rgba(0, 0, 0, 0.05); } } window#verification .window-content { @include floating-widget; min-width: 300px; min-height: 100px; .text-box { .title { font-size: 1.6em; } .desc { color: transparentize($fg-color, 0.1); font-size: 1.1em; } } .buttons { @include spacing; margin-top: $padding; button { @include button; font-size: 1.5em; padding: $padding; } } } window#powermenu .window-content { @include floating-widget; @include spacing(2); padding: $popover-padding + $spacing * 1.5; border-radius: if($radii == 0, 0, $popover-radius + ($popover-padding + $spacing * 1.5)); button { @include unset; image { @include button; border-radius: $popover-radius; min-width: 1.7em; min-height: 1.7em; font-size: 4em; } label, image { color: transparentize($fg-color, 0.1); } &:hover { image{ @include button-hover; } label{ color: $fg-color; } } &:focus image { @include button-focus; } &:active image { @include button-active; } &:focus, &:active { label{ color: $accent; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/quicksettings.scss ================================================ window#quicksettings .window-content { @include floating-widget; @include spacing; .avatar { @include widget; opacity: 0.9; border-radius: $popover-radius; } .header { @include spacing($rec: true); button, .uptime, .battery { @include button; padding: $padding; font-weight: bold; min-height: 20px; min-width: 20px; border-radius: $popover-radius; image { font-size: 1.2em; } } .battery { @include spacing($multiplier: 0.5); } } .battery-progress { label { color: $accent-fg; font-weight: bold; } &.charging label { font-size: $padding*2; } &.half label { color: $fg-color; } progressbar { @include slider($width: $padding*3.6); } &.low progressbar { @include slider($width: $padding*3.6, $gradient: linear-gradient(to right, $red, $red)); } } .sliders-box { @include widget; @include spacing($rec: true); @include spacing(0); padding: $padding; border-radius: $popover-radius; button { @include button($flat: true); padding: $padding / 2; } scale { @include slider; margin-left: $spacing * -0.5; } .menu { margin: $spacing 0; background-color: $bg-color; border: $border-width solid $popover-border-color; border-radius: $radii; } } .mixer-item { scale { @include slider($width: 7px); } image { font-size: 1.2em; } } .row { @include spacing($rec: true); border-radius: $popover-radius; } .menu { @include unset; @include widget; @include spacing($rec: true); padding: $padding; margin-top: $spacing * 5; border-radius: $popover-radius; .title { @include spacing(.5); } separator { margin: 0 $radii / 2; } button { @include button($flat: true); padding: $padding / 2; } switch { @include switch; } } .toggle-button { @include button; font-weight: bold; border-radius: $popover-radius; .label-box { @include spacing(.5); } button { @include button($flat: true); padding: $padding; border-radius: $popover-radius; &:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } &:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } } &.active { background-color: $accent; label, image { color: $accent-fg; } } } .simple-toggle { @include button; padding: $padding $padding * 1.1; border-radius: $popover-radius; } .media { @include spacing; .player { @include media; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/scss/widgets/settings.scss ================================================ window#settings-dialog { background-color: $bg-color; .page { @include scrollable; } .page-content { margin: $spacing; } .sidebar-box { @include spacing($rec: true); background-color: $widget-bg; border-right: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding * 2; } scrolledwindow { @include scrollable; } } .sidebar-header { background-color: $widget-bg; border-right: $border; border-bottom: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding; } button:last-child { margin-left: $spacing / 2; } } .sidebar-footer { background-color: $widget-bg; border-right: $border; border-top: $border; padding: $spacing / 2; button { @include button($flat: true); padding: $padding / 2 $padding; } } entry.search { @include button; border-radius: 0; padding: $padding; } .row { @include widget; border-radius: 0; border-bottom-width: 0; padding: $padding; transition: border-radius 0; &:last-child { border-radius: 0 0 $radii $radii; border-bottom-width: $border-width; } &:first-child { border-radius: $radii $radii 0 0; } &:first-child:last-child { border-radius: $radii; } .overlay-padding { min-height: $font-size * 3; } &:hover { background-color: $hover; } entry, button { @include button; padding: $padding; } switch { @include switch; } spinbutton { @include unset; entry { border-radius: $radii 0 0 $radii; } button { border-radius: 0; } button:last-child { border-radius: 0 $radii $radii 0; } } .enum-setter { label { background-color: $widget-bg; border-top: $border; border-bottom: $border; padding: 0 $padding; } button:first-child { border-radius: $radii 0 0 $radii; } button:last-child { border-radius: 0 $radii $radii 0; } } } .id, .note { font-size: .8em; color: transparentize($fg-color, $amount: 0.5); } .id { font-family: $mono-font; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_js/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2022", "module": "ES2022", "lib": [ "ES2022" ], "allowJs": true, "checkJs": false, "strict": true, "noImplicitAny": false, "baseUrl": ".", "typeRoots": [ "./types/ags.d.ts", "./node_modules/@girs" ], "skipLibCheck": true, "forceConsistentCasingInFileNames": true } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/.eslintrc.yml ================================================ env: es2022: true extends: - "eslint:recommended" - "plugin:@typescript-eslint/recommended" parser: "@typescript-eslint/parser" parserOptions: ecmaVersion: 2022 sourceType: "module" project: "./tsconfig.json" warnOnUnsupportedTypeScriptVersion: false root: true ignorePatterns: - types/ plugins: - "@typescript-eslint" rules: "@typescript-eslint/ban-ts-comment": - "off" "@typescript-eslint/no-non-null-assertion": - "off" # "@typescript-eslint/no-explicit-any": # - "off" "@typescript-eslint/no-unused-vars": - error - varsIgnorePattern: (^unused|_$) argsIgnorePattern: ^(unused|_) "@typescript-eslint/no-empty-interface": - "off" arrow-parens: - error - as-needed comma-dangle: - error - always-multiline comma-spacing: - error - before: false after: true comma-style: - error - last curly: - error - multi-or-nest - consistent dot-location: - error - property eol-last: - error eqeqeq: - error - always indent: - error - 4 - SwitchCase: 1 keyword-spacing: - error - before: true lines-between-class-members: - error - always - exceptAfterSingleLine: true padded-blocks: - error - never - allowSingleLineBlocks: false prefer-const: - error quotes: - error - double - avoidEscape: true semi: - error - never nonblock-statement-body-position: - error - below no-trailing-spaces: - error no-useless-escape: - off max-len: - error - code: 100 func-call-spacing: - error array-bracket-spacing: - error space-before-function-paren: - error - never space-before-blocks: - error key-spacing: - error object-curly-spacing: - error - always ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/.gitignore ================================================ node_modules types package-lock.json bun.lockb flake.lock ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/config.js ================================================ const main = "/tmp/ags/main.js" const outdir = `${App.configDir}/main.ts` try { await Utils.execAsync([ "bun", "build", outdir, "--outfile", main, "--external", "resource://*", "--external", "gi://*", "--external", "file://*", ]) } catch (error) { console.error(error) App.quit() } const { default: config } = await import(`file://${main}`) export default config ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/default.nix ================================================ { inputs , system , stdenv , writeShellScriptBin , swww , bun , dart-sass , brightnessctl }: let ags = inputs.ags.packages.${system}.default; pname = "asztal"; config = stdenv.mkDerivation { inherit pname; version = "1.7.6"; src = ./.; buildPhase = '' ${bun}/bin/bun build ./main.ts \ --outfile main.js \ --external "resource://*" \ --external "gi://*" ''; installPhase = '' mkdir $out cp -r assets $out cp -r style $out cp -f main.js $out/config.js ''; }; in { inherit config; script = writeShellScriptBin pname '' export PATH=$PATH:${dart-sass}/bin export PATH=$PATH:${brightnessctl}/bin export PATH=$PATH:${swww}/bin ${ags}/bin/ags -b ${pname} -c ${config}/config.js $@ ''; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/battery.ts ================================================ import icons from "./icons" export default async function init() { const bat = await Service.import("battery") bat.connect("notify::percent", ({ percent, charging }) => { const low = 30 if (percent !== low || percent !== low / 2 || !charging) return Utils.notify({ summary: `${percent}% Battery Percentage`, iconName: icons.battery.warning, urgency: "critical", }) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/experiments.ts ================================================ // these are functionalities that I might include in ags /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable max-len */ import { Binding } from "types/service" import { Variable } from "resource:///com/github/Aylur/ags/variable.js" import { App } from "resource:///com/github/Aylur/ags/app.js" import GObject from "gi://GObject?version=2.0" type GObj = GObject.Object | App export function watch(init: T, objs: Array<[GObj, signal?: string]>, signal: string, callback: (v: Variable) => T): Binding, any, T> export function watch(init: T, obj: GObj, signal: string, callback: (v: Variable) => T): Binding, any, T> export function watch(init: T, obj: GObj, callback: (v: Variable) => T): Binding, any, T> export function watch( init: T, objs: GObj | Array<[GObj, signal?: string]>, sigOrFn: string | ((v: Variable) => T), callback?: (v: Variable) => T, ) { const v = new Variable(init) const fn = typeof sigOrFn === "function" ? sigOrFn : callback ?? (() => v.value) if (Array.isArray(objs)) { objs.map(([o, s = "changed"]) => [o, o.connect(s, () => fn(v))] as const) return v.bind() } const signal = typeof sigOrFn === "string" ? sigOrFn : "changed" objs.connect(signal, () => fn(v)) return v.bind() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/gtk.ts ================================================ import Gio from "gi://Gio" import options from "options" const settings = new Gio.Settings({ schema: "org.gnome.desktop.interface", }) function gtk() { const scheme = options.theme.scheme.value settings.set_string("color-scheme", `prefer-${scheme}`) } export default function init() { options.theme.scheme.connect("changed", gtk) gtk() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/hyprland.ts ================================================ import options from "options" const { messageAsync } = await Service.import("hyprland") const { hyprland } = options const { spacing, radius, border: { width }, shadows, dark: { primary: { bg: darkActive } }, light: { primary: { bg: lightActive } }, scheme, } = options.theme const deps = [ "hyprland", spacing.id, radius.id, width.id, shadows.id, darkActive.id, lightActive.id, scheme.id, ] export default function init() { options.handler(deps, setupHyprland) setupHyprland() } function activeBorder() { const color = scheme.value === "dark" ? darkActive.value : lightActive.value return color.replace("#", "") } function sendBatch(batch: string[]) { const cmd = batch .filter(x => !!x) .map(x => `keyword ${x}`) .join("; ") messageAsync(`[[BATCH]]/${cmd}`) } function blur(name: string) { const blur = hyprland.blur.value const alpha = hyprland.alpha.value const rule = [ `layerrule unset, ${name}`, `layerrule blur, ${name}`, ] if (blur === "*") return [...rule, `layerrule ignorealpha ${alpha}, ${name}`] if (blur.some(b => name.includes(b))) return [...rule, `layerrule ignorealpha ${alpha}, ${name}`] return [] } function setupHyprland() { const wm_gaps = Math.floor(hyprland.gaps.value * spacing.value) sendBatch([ `general:border_size ${width.value}`, `general:gaps_out ${wm_gaps}`, `general:gaps_in ${Math.floor(wm_gaps / 2)}`, `general:col.active_border rgba(${activeBorder()}ff)`, `general:col.inactive_border rgba(${hyprland.inactiveBorder.value})`, `decoration:rounding ${radius.value}`, `decoration:drop_shadow ${shadows.value ? "yes" : "no"}`, ]) sendBatch(App.windows.flatMap(({ name }) => blur(name!))) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/icons.ts ================================================ export const substitutes = { "transmission-gtk": "transmission", "blueberry.py": "blueberry", "Caprine": "facebook-messenger", "com.raggesilver.BlackBox-symbolic": "terminal-symbolic", "audio-headset-bluetooth": "audio-headphones-symbolic", "audio-card-analog-usb": "audio-speakers-symbolic", "audio-card-analog-pci": "audio-card-symbolic", "preferences-system": "emblem-system-symbolic", "com.github.Aylur.ags-symbolic": "controls-symbolic", "com.github.Aylur.ags": "controls-symbolic", } export default { fallback: { executable: "application-x-executable-symbolic", notification: "dialog-information-symbolic", video: "video-x-generic-symbolic", audio: "audio-x-generic-symbolic", }, ui: { close: "window-close-symbolic", colorpicker: "color-select-symbolic", info: "info-symbolic", link: "external-link-symbolic", lock: "system-lock-screen-symbolic", menu: "open-menu-symbolic", refresh: "view-refresh-symbolic", search: "system-search-symbolic", settings: "emblem-system-symbolic", themes: "preferences-desktop-theme-symbolic", tick: "object-select-symbolic", time: "hourglass-symbolic", toolbars: "toolbars-symbolic", warning: "dialog-warning-symbolic", arrow: { right: "pan-end-symbolic", left: "pan-start-symbolic", down: "pan-down-symbolic", up: "pan-up-symbolic", }, }, audio: { mic: { muted: "microphone-disabled-symbolic", low: "microphone-sensitivity-low-symbolic", medium: "microphone-sensitivity-medium-symbolic", high: "microphone-sensitivity-high-symbolic", }, volume: { muted: "audio-volume-muted-symbolic", low: "audio-volume-low-symbolic", medium: "audio-volume-medium-symbolic", high: "audio-volume-high-symbolic", overamplified: "audio-volume-overamplified-symbolic", }, type: { headset: "audio-headphones-symbolic", speaker: "audio-speakers-symbolic", card: "audio-card-symbolic", }, mixer: "mixer-symbolic", }, asusctl: { profile: { Balanced: "power-profile-balanced-symbolic", Quiet: "power-profile-power-saver-symbolic", Performance: "power-profile-performance-symbolic", }, mode: { Integrated: "processor-symbolic", Hybrid: "controller-symbolic", }, }, battery: { charging: "flash-symbolic", warning: "battery-empty-symbolic", }, bluetooth: { enabled: "bluetooth-active-symbolic", disabled: "bluetooth-disabled-symbolic", }, brightness: { indicator: "display-brightness-symbolic", keyboard: "keyboard-brightness-symbolic", screen: "display-brightness-symbolic", }, powermenu: { sleep: "weather-clear-night-symbolic", reboot: "system-reboot-symbolic", logout: "system-log-out-symbolic", shutdown: "system-shutdown-symbolic", }, recorder: { recording: "media-record-symbolic", }, notifications: { noisy: "org.gnome.Settings-notifications-symbolic", silent: "notifications-disabled-symbolic", message: "chat-bubbles-symbolic", }, trash: { full: "user-trash-full-symbolic", empty: "user-trash-symbolic", }, mpris: { shuffle: { enabled: "media-playlist-shuffle-symbolic", disabled: "media-playlist-consecutive-symbolic", }, loop: { none: "media-playlist-repeat-symbolic", track: "media-playlist-repeat-song-symbolic", playlist: "media-playlist-repeat-symbolic", }, playing: "media-playback-pause-symbolic", paused: "media-playback-start-symbolic", stopped: "media-playback-start-symbolic", prev: "media-skip-backward-symbolic", next: "media-skip-forward-symbolic", }, system: { cpu: "org.gnome.SystemMonitor-symbolic", ram: "drive-harddisk-solidstate-symbolic", temp: "temperature-symbolic", }, color: { dark: "dark-mode-symbolic", light: "light-mode-symbolic", }, } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/init.ts ================================================ import css from "style/style" import matugen from "./matugen" import hyprland from "./hyprland" import tmux from "./tmux" import gtk from "./gtk" import lowBattery from "./battery" import swww from "./swww" export async function init() { try { gtk() css() tmux() matugen() lowBattery() hyprland() css() swww() } catch (error) { logError(error) } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/matugen.ts ================================================ import options from "options" import { sh, dependencies } from "./utils" export default function init() { options.wallpaper.connect("changed", () => matugen()) options.autotheme.connect("changed", () => matugen()) } function animate(...setters: Array<() => void>) { const delay = options.transition.value / 2 setters.forEach((fn, i) => Utils.timeout(delay * i, fn)) } export async function matugen( type: "image" | "color" = "image", arg = options.wallpaper.value, ) { if (!options.autotheme.value || !dependencies("matugen")) return const colors = await sh(`matugen --dry-run -j hex ${type} ${arg}`) const c = JSON.parse(colors).colors as { light: Colors, dark: Colors } const { dark, light } = options.theme animate( () => { dark.widget.value = c.dark.on_surface light.widget.value = c.light.on_surface }, () => { dark.border.value = c.dark.outline light.border.value = c.light.outline }, () => { dark.bg.value = c.dark.surface light.bg.value = c.light.surface }, () => { dark.fg.value = c.dark.on_surface light.fg.value = c.light.on_surface }, () => { dark.primary.bg.value = c.dark.primary light.primary.bg.value = c.light.primary }, () => { dark.primary.fg.value = c.dark.on_primary light.primary.fg.value = c.light.on_primary }, () => { dark.error.bg.value = c.dark.error light.error.bg.value = c.light.error }, () => { dark.error.fg.value = c.dark.on_error light.error.fg.value = c.light.on_error }, ) } type Colors = { background: string error: string error_container: string inverse_on_surface: string inverse_primary: string inverse_surface: string on_background: string on_error: string on_error_container: string on_primary: string on_primary_container: string on_primary_fixed: string on_primary_fixed_variant: string on_secondary: string on_secondary_container: string on_secondary_fixed: string on_secondary_fixed_variant: string on_surface: string on_surface_variant: string on_tertiary: string on_tertiary_container: string on_tertiary_fixed: string on_tertiary_fixed_variant: string outline: string outline_variant: string primary: string primary_container: string primary_fixed: string primary_fixed_dim: string scrim: string secondary: string secondary_container: string secondary_fixed: string secondary_fixed_dim: string shadow: string surface: string surface_bright: string surface_container: string surface_container_high: string surface_container_highest: string surface_container_low: string surface_container_lowest: string surface_dim: string surface_variant: string tertiary: string tertiary_container: string tertiary_fixed: string tertiary_fixed_dim: string } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/option.ts ================================================ import { Variable } from "resource:///com/github/Aylur/ags/variable.js" import { wait } from "./utils" import options from "options" export class Opt extends Variable { static { Service.register(this) } constructor(initial: T) { super(initial) this.initial = initial } initial: T id = "" toString() { return `${this.value}` } init(cacheFile: string) { const cacheV = JSON.parse(Utils.readFile(cacheFile) || "{}")[this.id] if (cacheV !== undefined) this.value = cacheV this.connect("changed", () => { const cache = JSON.parse(Utils.readFile(cacheFile) || "{}") cache[this.id] = this.value Utils.writeFileSync(JSON.stringify(cache, null, 2), cacheFile) }) } reset() { if (JSON.stringify(this.value) !== JSON.stringify(this.initial)) { this.value = this.initial return this.id } } } export const opt = (initial: T) => new Opt(initial) function getOptions(object: object, path = ""): Opt[] { return Object.keys(object).flatMap(key => { const obj: Opt = object[key] const id = path ? path + "." + key : key if (obj instanceof Variable) { obj.id = id return obj } if (typeof obj === "object") return getOptions(obj, id) return [] }) } export function mkOptions(cacheFile: string, object: T) { for (const opt of getOptions(object)) opt.init(cacheFile) // --- FIXME: remove after gui const configFile = `/tmp/ags/config-${Date.now()}.json` const values = getOptions(object).reduce((obj, { id, value }) => ({ [id]: value, ...obj }), {}) Utils.writeFileSync(JSON.stringify(values, null, 2), configFile) Utils.monitorFile(configFile, () => { const cache = JSON.parse(Utils.readFile(configFile) || "{}") for (const opt of getOptions(object)) { if (JSON.stringify(cache[opt.id]) !== JSON.stringify(opt.value)) opt.value = cache[opt.id] } }) // --- async function reset( [opt, ...list] = getOptions(object), id = opt?.reset(), ): Promise> { if (!opt) return wait(0, () => []) return id ? [id, ...(await wait(50, () => reset(list)))] : await wait(0, () => reset(list)) } return Object.assign(object, { configFile, array: () => getOptions(object), async reset() { return (await reset()).join("\n") }, handler(deps: string[], callback: () => void) { for (const opt of getOptions(options)) { if (deps.some(i => opt.id.startsWith(i))) opt.connect("changed", callback) } }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/swww.ts ================================================ import options from "options" import { dependencies, sh } from "./utils" import GLib from "gi://GLib?version=2.0" async function wallpaper() { print("hello?") const pos = await sh("hyprctl cursorpos") await sh([ "swww", "img", "--transition-type", "grow", "--transition-pos", pos.replace(" ", ""), options.wallpaper.value, ]) } export default async function init() { if (!dependencies("swww")) return // gtk portal const wp = `${GLib.get_user_config_dir()}/background` Utils.monitorFile(wp, () => options.wallpaper.value = wp) options.wallpaper.connect("changed", wallpaper) await sh("swww init") wallpaper() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/tmux.ts ================================================ import options from "options" import { sh } from "./utils" export async function tmux() { const { scheme, dark, light } = options.theme const hex = scheme.value === "dark" ? dark.primary.bg.value : light.primary.bg.value if (await sh("which tmux")) sh(`tmux set @main_accent "${hex}"`) } export default function init() { options.wallpaper.connect("changed", tmux) options.autotheme.connect("changed", tmux) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/utils.ts ================================================ /* eslint-disable @typescript-eslint/no-explicit-any */ import { type Config } from "types/app" import { type Application } from "types/service/applications" import { substitutes } from "./icons" import Gtk from "gi://Gtk?version=3.0" import Gdk from "gi://Gdk" import GLib from "gi://GLib?version=2.0" export function config(config: Config) { return config } /** * @returns substitute icon || name || fallback icon */ export function icon(name: string | null, fallback = name) { if (!name) return fallback || "" if (GLib.file_test(name, GLib.FileTest.EXISTS)) return name const icon = (substitutes[name] || name) if (Utils.lookUpIcon(icon)) return icon print(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`) return fallback } /** * @returns execAsync(["bash", "-c", cmd]) */ export async function bash(strings: TemplateStringsArray | string, ...values: unknown[]) { const cmd = typeof strings === "string" ? strings : strings .flatMap((str, i) => str + `${values[i] ?? ""}`) .join("") return Utils.execAsync(["bash", "-c", cmd]).catch(err => { console.error(cmd, err) return "" }) } /** * @returns execAsync(cmd) */ export async function sh(cmd: string | string[]) { return Utils.execAsync(cmd).catch(err => { console.error(typeof cmd === "string" ? cmd : cmd.join(" "), err) return "" }) } export function forMonitors(widget: (monitor: number) => Gtk.Window) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1 return range(n, 0).map(widget).flat(1) } /** * @returns [start...length] */ export function range(length: number, start = 1) { return Array.from({ length }, (_, i) => i + start) } /** * promisified timeout */ export function wait(ms: number, callback: () => T): Promise { return new Promise(resolve => Utils.timeout(ms, () => { resolve(callback()) })) } /** * @returns true if all of the `bins` are found */ export function dependencies(...bins: string[]) { const missing = bins.filter(bin => { return !Utils.exec(`which ${bin}`) }) if (missing.length > 0) console.warn("missing dependencies:", missing.join(", ")) return missing.length === 0 } /** * run app detached */ export function launchApp(app: Application) { print(`launching ${app.name}, ${app.desktop}`) sh(`gtk-launch ${app.desktop} &`) app.frequency += 1 } /** * to use with drag and drop */ export function createSurfaceFromWidget(widget: Gtk.Widget) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const cairo = imports.gi.cairo as any const alloc = widget.get_allocation() const surface = new cairo.ImageSurface( cairo.Format.ARGB32, alloc.width, alloc.height, ) const cr = new cairo.Context(surface) cr.setSourceRGBA(255, 255, 255, 0) cr.rectangle(0, 0, alloc.width, alloc.height) cr.fill() widget.draw(cr) return surface } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/lib/variables.ts ================================================ import GLib from "gi://GLib" // import options from "options" // // const intval = options.system.fetchInterval.value // const tempPath = options.system.temperature.value export const clock = Variable(GLib.DateTime.new_now_local(), { poll: [1000, () => GLib.DateTime.new_now_local()], }) export const uptime = Variable(0, { poll: [60_000, "cat /proc/uptime", line => Number.parseInt(line.split(".")[0]) / 60, ], }) // export const distro = GLib.get_os_info("ID") // const divide = ([total, free]: string[]) => Number.parseInt(free) / Number.parseInt(total) // // export const cpu = Variable(0, { // poll: [intval, "top -b -n 1", out => divide(["100", out.split("\n") // .find(line => line.includes("Cpu(s)")) // ?.split(/\s+/)[1] // .replace(",", ".") || "0"])], // }) // // export const ram = Variable(0, { // poll: [intval, "free", out => divide(out.split("\n") // .find(line => line.includes("Mem:")) // ?.split(/\s+/) // .splice(1, 2) || ["1", "1"])], // }) // // export const temperature = Variable(0, { // poll: [intval, `cat ${tempPath}`, n => { // return Number.parseInt(n) / 100_000 // }], // }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/main.ts ================================================ import "lib/init" import options from "options" import Bar from "widget/bar/Bar" import Applauncher from "widget/applauncher/Applauncher" import Overview from "widget/overview/Overview" import PowerMenu from "widget/powermenu/PowerMenu" import Verification from "widget/powermenu/Verification" import NotificationPopups from "widget/notifications/NotificationPopups" import ScreenCorners from "widget/bar/ScreenCorners" import OSD from "widget/osd/OSD" import SettingsDialog from "widget/settings/SettingsDialog" import { dependencies, config, forMonitors } from "lib/utils" import { setupQuickSettings } from "widget/quicksettings/QuickSettings" import { setupDateMenu } from "widget/datemenu/DateMenu" import { init } from "lib/init" Utils.ensureDirectory("/tmp/ags") if (!dependencies("dart-sass", "brightnessctl")) App.quit() export default config({ icons: "./assets", onConfigParsed: () => { setupQuickSettings() setupDateMenu() init() }, closeWindowDelay: { "applauncher": options.transition.value, "overview": options.transition.value, "quicksettings": options.transition.value, "datemenu": options.transition.value, }, windows: [ ...forMonitors(Bar), ...forMonitors(NotificationPopups), ...forMonitors(ScreenCorners), ...forMonitors(OSD), Applauncher(), Overview(), PowerMenu(), Verification(), SettingsDialog(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/options.ts ================================================ import { type BarWidget } from "widget/bar/Bar" import { opt, mkOptions } from "lib/option" const options = mkOptions(Utils.CACHE_DIR + "/options2.json", { autotheme: opt(false), wallpaper: opt(`/home/${Utils.USER}/.config/background`), theme: { dark: { primary: { bg: opt("#51a4e7"), fg: opt("#141414"), }, error: { bg: opt("#e55f86"), fg: opt("#141414"), }, bg: opt("#171717"), fg: opt("#eeeeee"), widget: opt("#eeeeee"), border: opt("#eeeeee"), }, light: { primary: { bg: opt("#426ede"), fg: opt("#eeeeee"), }, error: { bg: opt("#b13558"), fg: opt("#eeeeee"), }, bg: opt("#fffffa"), fg: opt("#080808"), widget: opt("#080808"), border: opt("#080808"), }, scheme: opt<"dark" | "light">("dark"), widget: { opacity: opt(94) }, border: { width: opt(0), opacity: opt(96), }, shadows: opt(true), padding: opt(7), spacing: opt(5), radius: opt(15), }, transition: opt(200), font: { size: opt(13), name: opt("Ubuntu Nerd Font"), }, bar: { flatButtons: opt(true), position: opt<"top" | "bottom">("top"), corners: opt(false), layout: { start: opt([ "launcher", "workspaces", //"taskbar", "expander", //"messages", ]), center: opt([ "date", ]), end: opt([ //"media", "expander", "systray", "colorpicker", "screenrecord", "battery", "system", "powermenu", ]), }, launcher: { icon: { colored: opt(true), icon: opt("system-search-symbolic"), }, label: { colored: opt(false), label: opt(" Applications"), }, action: opt(() => App.toggleWindow("applauncher")), }, date: { format: opt("%d.%m.%y - %H:%M"), action: opt(() => App.toggleWindow("datemenu")), }, battery: { bar: opt<"hidden" | "regular" | "whole">("hidden"), percentage: opt(true), blocks: opt(10), width: opt(70), low: opt(30), }, workspaces: { workspaces: opt(10), }, taskbar: { monochrome: opt(true), exclusive: opt(false), }, messages: { action: opt(() => App.toggleWindow("datemenu")), }, systray: { ignore: opt([ "KDE Connect Indicator", "spotify-client", ]), }, media: { monochrome: opt(true), preferred: opt("spotify"), direction: opt<"left" | "right">("right"), length: opt(40), }, powermenu: { monochrome: opt(false), action: opt(() => App.toggleWindow("powermenu")), }, }, applauncher: { iconSize: opt(62), width: opt(400), margin: opt(80), maxItem: opt(10), favorites: opt([ "firefox", "blackbox", "org.gnome.Calendar", "obsidian", "discord", "spotify", ]), }, overview: { scale: opt(9), workspaces: opt(10), monochromeIcon: opt(true), }, powermenu: { sleep: opt("systemctl suspend"), reboot: opt("systemctl reboot"), logout: opt("pkill Hyprland"), shutdown: opt("shutdown now"), layout: opt<"line" | "box">("line"), labels: opt(true), }, quicksettings: { avatar: { image: opt(`/var/lib/AccountsService/icons/${Utils.USER}`), size: opt(70), }, width: opt(380), position: opt<"left" | "center" | "right">("right"), networkSettings: opt("gtk-launch gnome-control-center"), media: { monochromeIcon: opt(false), coverSize: opt(100), }, }, datemenu: { position: opt<"left" | "center" | "right">("center"), }, osd: { progress: { vertical: opt(false), pack: { h: opt<"start" | "center" | "end">("center"), v: opt<"start" | "center" | "end">("end"), }, }, microphone: { pack: { h: opt<"start" | "center" | "end">("center"), v: opt<"start" | "center" | "end">("end"), }, }, }, notifications: { position: opt>(["top", "right"]), blacklist: opt(["Spotify"]), width: opt(440), }, hyprland: { blur: opt<"*" | Array>([ "powermenu", "verification", ]), alpha: opt(.3), gaps: opt(2.4), inactiveBorder: opt("333333ff"), }, }) globalThis["options"] = options export default options ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/package.json ================================================ { "name": "Rocket-dotfiles", "author": "RoccoRakete", "kofi": "https://ko-fi.com/roccorakete", "repository": { "type": "git", "url": "github.com/RoccoRakete/hyprland-dots.git" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.20.0", "eslint": "^8.56.0", "eslint-config-standard-with-typescript": "^43.0.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", "typescript": "^5.3.3" } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/service/asusctl.ts ================================================ import { sh } from "lib/utils" type Profile = "Performance" | "Balanced" | "Quiet" type Mode = "Hybrid" | "Integrated" class Asusctl extends Service { static { Service.register(this, {}, { "profile": ["string", "r"], "mode": ["string", "r"], }) } available = !!Utils.exec("which asusctl") #profile: Profile = "Balanced" #mode: Mode = "Hybrid" async nextProfile() { await sh("asusctl profile -n") const profile = await sh("asusctl profile -p") const p = profile.split(" ")[3] as Profile this.#profile = p this.changed("profile") } async setProfile(prof: Profile) { await sh(`asusctl profile --profile-set ${prof}`) this.#profile = prof this.changed("profile") } async nextMode() { await sh(`supergfxctl -m ${this.#mode === "Hybrid" ? "Integrated" : "Hybrid"}`) this.#mode = await sh("supergfxctl -g") as Mode this.changed("profile") } constructor() { super() if (this.available) { sh("asusctl profile -p").then(p => this.#profile = p.split(" ")[3] as Profile) sh("supergfxctl -g").then(m => this.#mode = m as Mode) } } get profiles(): Profile[] { return ["Performance", "Balanced", "Quiet"] } get profile() { return this.#profile } get mode() { return this.#mode } } export default new Asusctl() ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/service/brightness.ts ================================================ import { bash, sh } from "lib/utils" const get = (args: string) => Number(Utils.exec(`brightnessctl ${args}`)) const screen = await bash`ls -w1 /sys/class/backlight | head -1` const kbd = await bash`ls -w1 /sys/class/leds | head -1` class Brightness extends Service { static { Service.register(this, {}, { "screen": ["float", "rw"], "kbd": ["int", "rw"], }) } #kbdMax = get(`--device ${kbd} max`) #kbd = get(`--device ${kbd} get`) #screenMax = get("max") #screen = get("get") / get("max") get kbd() { return this.#kbd } get screen() { return this.#screen } set kbd(value) { if (value < 0 || value > this.#kbdMax) return sh(`brightnessctl -d ${kbd} s ${value} -q`).then(() => { this.#kbd = value this.changed("kbd") }) } set screen(percent) { if (percent < 0) percent = 0 if (percent > 1) percent = 1 sh(`brightnessctl set ${Math.floor(percent * 100)}% -q`).then(() => { this.#screen = percent this.changed("screen") }) } constructor() { super() const screenPath = `/sys/class/backlight/${screen}/brightness` const kbdPath = `/sys/class/leds/${kbd}/brightness` Utils.monitorFile(screenPath, async f => { const v = await Utils.readFileAsync(f) this.#screen = Number(v) / this.#screenMax this.changed("screen") }) Utils.monitorFile(kbdPath, async f => { const v = await Utils.readFileAsync(f) this.#kbd = Number(v) / this.#kbdMax this.changed("kbd") }) } } export default new Brightness() ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/service/colorpicker.ts ================================================ import icons from "lib/icons" import { bash, dependencies } from "lib/utils" const COLORS_CACHE = Utils.CACHE_DIR + "/colorpicker.json" const MAX_NUM_COLORS = 10 class ColorPicker extends Service { static { Service.register(this, {}, { "colors": ["jsobject"], }) } notifID = 0 #colors = JSON.parse(Utils.readFile(COLORS_CACHE) || "[]") as string[] get colors() { return [...this.#colors] } set colors(colors) { this.#colors = colors this.changed("colors") } // TODO: doesn't work? async wlCopy(color: string) { if (dependencies("wl-copy")) bash(`wl-copy ${color}`) } async pick() { if (!dependencies("hyprpicker")) return const color = await bash("hyprpicker -a -r") if (!color) return colorpicker.wlCopy(color) const list = colorpicker.colors if (!list.includes(color)) { list.push(color) if (list.length > MAX_NUM_COLORS) list.shift() colorpicker.colors = list Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE) } colorpicker.notifID = await Utils.notify({ id: colorpicker.notifID, iconName: icons.ui.colorpicker, summary: color, }) } } const colorpicker = new ColorPicker export default colorpicker ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/service/powermenu.ts ================================================ import options from "options" const { sleep, reboot, logout, shutdown } = options.powermenu export type Action = "sleep" | "reboot" | "logout" | "shutdown" class PowerMenu extends Service { static { Service.register(this, {}, { "title": ["string"], "cmd": ["string"], }) } #title = "" #cmd = "" get title() { return this.#title } get cmd() { return this.#cmd } action(action: Action) { [this.#cmd, this.#title] = { sleep: [sleep.value, "Sleep"], reboot: [reboot.value, "Reboot"], logout: [logout.value, "Log Out"], shutdown: [shutdown.value, "Shutdown"], }[action] this.notify("cmd") this.notify("title") this.emit("changed") App.closeWindow("powermenu") App.openWindow("verification") } readonly shutdown = () => { this.action("shutdown") } } const powermenu = new PowerMenu globalThis["powermenu"] = powermenu export default powermenu ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/service/screenrecord.ts ================================================ import GLib from "gi://GLib" import icons from "lib/icons" import { dependencies, sh, bash } from "lib/utils" const now = () => GLib.DateTime.new_now_local().format("%Y-%m-%d_%H-%M-%S") class Recorder extends Service { static { Service.register(this, {}, { "timer": ["int"], "recording": ["boolean"], }) } #recordings = Utils.HOME + "/Videos/Screencasting" #screenshots = Utils.HOME + "/Pictures/Screenshots" #file = "" #interval = 0 recording = false timer = 0 async start() { if (!dependencies("slurp", "wf-recorder")) return if (this.recording) return const area = await sh("slurp") Utils.ensureDirectory(this.#recordings) this.#file = `${this.#recordings}/${now()}.mp4` sh(`wf-recorder -g ${area} -f ${this.#file} --pixel-format yuv420p`) this.recording = true this.changed("recording") this.timer = 0 this.#interval = Utils.interval(1000, () => { this.changed("timer") this.timer++ }) } async stop() { if (!this.recording) return bash("killall -INT wf-recorder") this.recording = false this.changed("recording") GLib.source_remove(this.#interval) Utils.notify({ iconName: icons.fallback.video, summary: "Screenrecord", body: this.#file, actions: { "Show in Files": () => sh(`xdg-open ${this.#recordings}`), "View": () => sh(`xdg-open ${this.#file}`), }, }) } async screenshot(full = false) { if (!dependencies("slurp", "wayshot")) return const file = `${this.#screenshots}/${now()}.png` Utils.ensureDirectory(this.#screenshots) const wayshot = `wayshot -f ${file} ${full ? "" : `-s "${await sh("slurp")}"`}` await sh(wayshot) bash(`wl-copy < ${file}`) Utils.notify({ image: file, summary: "Screenshot", body: this.#file, actions: { "Show in Files": () => sh(`xdg-open ${this.#screenshots}`), "View": () => sh(`xdg-open ${file}`), "Edit": () => { if (!dependencies("swappy")) sh(`swappy, -f ${file}`) }, }, }) } } const recorder = new Recorder globalThis["recorder"] = recorder export default recorder ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/a11y-button.scss ================================================ @import './button'; @mixin accs-button($flat: false, $reactive: true) { @include unset; color: $fg; >* { border-radius: $radius; transition: $transition; @if $flat { background-color: transparent; box-shadow: none; } @else { background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } } @if $reactive { &:focus>*, &.focused>* { @include button-focus; } &:hover>* { @include button-hover; } &:active, &.active, &.on, &:checked { >* { @include button-active; } &:hover>* { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover-bg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/button.scss ================================================ @mixin button-focus() { box-shadow: inset 0 0 0 $border-width $primary-bg; background-color: $hover-bg; color: $hover-fg; } @mixin button-hover() { box-shadow: inset 0 0 0 $border-width $border-color; background-color: $hover-bg; color: $hover-fg; } @mixin button-active() { box-shadow: inset 0 0 0 $border-width $border-color; background-image: $active-gradient; background-color: $primary-bg; color: $primary-fg; } @mixin button-disabled() { box-shadow: none; background-color: transparent; color: transparentize($fg, 0.7); } @mixin button($flat: false, $reactive: true, $radius: $radius, $focusable: true) { all: unset; transition: $transition; border-radius: $radius; color: $fg; @if $flat { background-color: transparent; background-image: none; box-shadow: none; } @else { background-color: $widget-bg; box-shadow: inset 0 0 0 $border-width $border-color; } @if $reactive { @if $focusable { &:focus { @include button-focus; } } &:hover { @include button-hover; } &:active, &.on, &.active, &:checked { @include button-active; &:hover { box-shadow: inset 0 0 0 $border-width $border-color, inset 0 0 0 99px $hover-bg; } } } &:disabled { @include button-disabled; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/floating-widget.scss ================================================ @mixin floating-widget { @if $shadows { box-shadow: 0 0 5px 0 $shadow-color; } margin: max($spacing, 8px); border: $border-width solid $popover-border-color; background-color: $bg; color: $fg; border-radius: $popover-radius; padding: $popover-padding; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/hidden.scss ================================================ @mixin hidden { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); * { background-color: transparent; background-image: none; border-color: transparent; box-shadow: none; -gtk-icon-transform: scale(0); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/media.scss ================================================ @mixin media() { @include widget; padding: $padding; .cover { box-shadow: 2px 2px 2px 0 $shadow-color; background-size: cover; background-position: center; border-radius: $radius*0.8; margin-right: $spacing; } button { @include button($flat: true); padding: $padding * .5; &.play-pause { margin: 0 ($spacing * .5); } image { font-size: 1.2em; } } .artist { color: transparentize($fg, .2); font-size: .9em; } scale { @include slider($width: .5em, $slider: false, $gradient: linear-gradient($fg, $fg)); margin-bottom: $padding * .5; trough { border: none; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/scrollable.scss ================================================ @mixin scrollable { scrollbar, scrollbar * { all: unset; } scrollbar.vertical { transition: $transition; background-color: transparentize($bg, 0.7); &:hover { background-color: transparentize($bg, 0.3); slider { background-color: transparentize($fg, 0.3); min-width: .6em; } } } scrollbar.vertical slider { background-color: transparentize($fg, 0.5); border-radius: $radius; min-width: .4em; min-height: 2em; transition: $transition; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/slider.scss ================================================ @import './unset'; @mixin slider($width: 0.7em, $slider-width: .5em, $gradient: $active-gradient, $slider: true, $focusable: true, $radius: $radius) { @include unset($rec: true); trough { transition: $transition; border-radius: $radius; border: $border; background-color: $widget-bg; min-height: $width; min-width: $width; highlight, progress { border-radius: max($radius - $border-width, 0); background-image: $gradient; min-height: $width; min-width: $width; } } slider { box-shadow: none; background-color: transparent; border: $border-width solid transparent; transition: $transition; border-radius: $radius; min-height: $width; min-width: $width; margin: -$slider-width; } &:hover { trough { background-color: $hover-bg; } slider { @if $slider { background-color: $fg; border-color: $border-color; @if $shadows { box-shadow: 0 0 3px 0 $shadow-color; } } } } &:disabled { highlight, progress { background-color: transparentize($fg, 0.4); background-image: none; } } @if $focusable { trough:focus { background-color: $hover-bg; box-shadow: inset 0 0 0 $border-width $primary-bg; slider { @if $slider { background-color: $fg; box-shadow: inset 0 0 0 $border-width $primary-bg; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/spacing.scss ================================================ @mixin spacing($multiplier: 1, $spacing: $spacing, $rec: false) { &.horizontal>* { margin: 0 calc($spacing * $multiplier / 2); &:first-child { margin-left: 0; } &:last-child { margin-right: 0; margin-left: 0; } } &.vertical>* { margin: calc($spacing * $multiplier / 2) 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } @if $rec { box { &.horizontal>* { margin: 0 $spacing * $multiplier / 2; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } &.vertical>* { margin: $spacing * $multiplier / 2 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/switch.scss ================================================ @import './button'; @mixin switch { @include button; slider { background-color: $primary-fg; border-radius: $radius; min-width: 24px; min-height: 24px; } image { color: transparent; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/unset.scss ================================================ @mixin unset($rec: false) { all: unset; @if $rec { * { all: unset } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/mixins/widget.scss ================================================ @mixin widget { transition: $transition; border-radius: $radius; color: $fg; background-color: $widget-bg; border: $border; } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/style.ts ================================================ /* eslint-disable max-len */ import { type Opt } from "lib/option" import options from "options" import { bash } from "lib/utils" const deps = ["font", "theme", "bar.flatButtons", "bar.position"] const dirs = [ `${App.configDir}/style/mixins`, `${App.configDir}/style/widget`, ] const { dark, light, scheme, padding, spacing, radius, shadows, widget, border, } = options.theme const popoverPaddingMultiplier = 1.6 // eslint-disable-next-line @typescript-eslint/no-explicit-any const t = (dark: Opt | string, light: Opt | string) => scheme.value === "dark" ? `${dark}` : `${light}` // eslint-disable-next-line @typescript-eslint/no-explicit-any const $ = (name: string, value: string | Opt) => `$${name}: ${value};` const variables = () => [ $("bg", t(dark.bg, light.bg)), $("fg", t(dark.fg, light.fg)), $("primary-bg", t(dark.primary.bg, light.primary.bg)), $("primary-fg", t(dark.primary.fg, light.primary.fg)), $("error-bg", t(dark.error.bg, light.error.bg)), $("error-fg", t(dark.error.fg, light.error.fg)), $("padding", `${padding}pt`), $("spacing", `${spacing}pt`), $("radius", `${radius}px`), $("transition", `${options.transition}ms`), $("shadows", `${shadows}`), $("widget-bg", `transparentize(${t(dark.widget, light.widget)}, ${widget.opacity.value / 100})`), $("hover-bg", `transparentize(${t(dark.widget, light.widget)}, ${(widget.opacity.value * .9) / 100})`), $("hover-fg", `lighten(${t(dark.fg, light.fg)}, 8%)`), $("border-width", `${border.width}px`), $("border-color", `transparentize(${t(dark.border, light.border)}, ${border.opacity.value / 100})`), $("border", "$border-width solid $border-color"), $("active-gradient", `linear-gradient(to right, ${t(dark.primary.bg, light.primary.bg)}, darken(${t(dark.primary.bg, light.primary.bg)}, 4%))`), $("shadow-color", t("rgba(0,0,0,.6)", "rgba(0,0,0,.4)")), $("text-shadow", t("2pt 2pt 2pt $shadow-color", "none")), $("popover-border-color", `transparentize(${t(dark.border, light.border)}, ${Math.max(((border.opacity.value - 1) / 100), 0)})`), $("popover-padding", `$padding * ${popoverPaddingMultiplier}`), $("popover-radius", radius.value === 0 ? "0" : "$radius + $popover-padding"), $("font-size", `${options.font.size}pt`), $("font-name", options.font.name), // etc $("charging-bg", "#00D787"), $("charging-fg", "#141414"), $("bar-battery-blocks", options.bar.battery.blocks), $("bar-position", options.bar.position), $("hyprland-gaps-multiplier", options.hyprland.gaps), ] async function resetCss() { const vars = "/tmp/ags/variables.scss" await Utils.writeFile(variables().join("\n"), vars) const files = dirs.flatMap(dir => Utils.exec(`ls ${dir}`) .split(/\s+/) .map(file => `@import '${dir}/${file}';`)) const scss = [`@import '${vars}';`, ...files].join("\n") const css = await bash`echo "${scss}" | sass --stdin` const file = "/tmp/ags/style.css" await Utils.writeFile(css, file) App.resetCss() App.applyCss(file) } export default function init() { dirs.forEach(dir => Utils.monitorFile(dir, resetCss)) options.handler(deps, resetCss) resetCss() } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/applauncher.scss ================================================ @use "sass:math"; @use "sass:color"; window#applauncher .applauncher { @include floating_widget; .quicklaunch { @include spacing; button { @include button($flat: true); padding: $padding; } } entry { @include button; padding: $padding; margin: $spacing; selection { color: color.mix($fg, $bg, 50%); background-color: transparent; } label, image { color: $fg; } } separator { margin: 4pt 0; min-height: 1px; background-color: $popover-border-color; } button.app-item { @include button($flat: true, $reactive: false); >box { @include spacing(0.5); } transition: $transition; padding: $padding; label { transition: $transition; &.title { color: $fg; } &.description { color: transparentize($fg, 0.3); } } image { transition: $transition; } &:hover, &:focus { .title { color: $primary-bg; } .description { color: transparentize($primary-bg, .4); } image { -gtk-icon-shadow: 2px 2px $primary-bg; } } &:active { background-color: transparentize($primary-bg, 0.5); border-radius: $radius; box-shadow: inset 0 0 0 $border-width $border-color; .title { color: $fg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/bar.scss ================================================ @use "sass:color"; $bar-spacing: $spacing * 0.3; $button-radius: $radius; @mixin panel-button($flat: true, $reactive: true) { @include accs-button($flat, $reactive); > * { border-radius: $button-radius; margin: $bar-spacing; } label, image { font-weight: bold; } > * { padding: $padding * 0.4 $padding * 0.8; } } .bar { background-color: $bg; .panel-button { @include panel-button; &:not(.flat) { @include accs-button($flat: false); } } .launcher { .colored { color: transparentize($primary-bg, 0.2); } &:hover .colored { color: $primary-bg; } &:active .colored, &.active .colored { color: $primary-fg; } } .workspaces { label { font-size: 0; min-width: 12pt; min-height: 12pt; border-radius: $radius * 2; box-shadow: inset 0 0 0 $border-width $border-color; margin: 0 $padding * 0.5; transition: $transition * 0.5; background-color: transparentize($fg, 0.8); &.occupied { background-color: transparentize($fg, 0.2); min-width: 12pt; min-height: 12pt; } &.active { // background-color: $primary-bg; background-image: $active-gradient; min-width: 25pt; min-height: 12pt; } } &.active, &:active { label { background-color: transparentize($primary-fg, 0.3); &.occupied { background-color: transparentize($primary-fg, 0.15); } &.active { background-color: $primary-fg; } } } } .media label { margin: 0 ($spacing * 0.5); } .taskbar .indicator.active { background-color: $primary-bg; border-radius: $radius; min-height: 4pt; min-width: 6pt; margin: 2pt; } .powermenu.colored, .recorder { image { color: transparentize($error-bg, 0.3); } &:hover image { color: transparentize($error-bg, 0.15); } &:active image { color: $primary-fg; } } .quicksettings > box > box { @include spacing($spacing: if($bar-spacing==0, $padding / 2, $bar-spacing * 7)); } .quicksettings:not(.active):not(:active) { .bluetooth { color: $primary-bg; label { font-size: $font-size * 0.7; color: $fg; text-shadow: $text-shadow; } } } .battery-bar { > * { padding: 0; } &.bar-hidden > box { padding: 0 $spacing * 0.5; image { margin: 0; } } levelbar * { all: unset; transition: $transition; } .whole { @if $shadows { image { -gtk-icon-shadow: $text-shadow; } label { text-shadow: $text-shadow; } } } .regular image { margin-left: $spacing * 0.5; } trough { @include widget; min-height: 12pt; min-width: 12pt; } .regular trough { margin-right: $spacing * 0.5; } block { margin: 0; &:last-child { border-radius: 0 $button-radius $button-radius 0; } &:first-child { border-radius: $button-radius 0 0 $button-radius; } } .vertical { block { &:last-child { border-radius: 0 0 $button-radius $button-radius; } &:first-child { border-radius: $button-radius $button-radius 0 0; } } } @for $i from 1 through $bar-battery-blocks { block:nth-child(#{$i}).filled { background-color: color.mix($bg, $primary-bg, $i * 3); } &.low block:nth-child(#{$i}).filled { background-color: color.mix($bg, $error-bg, $i * 3); } &.charging block:nth-child(#{$i}).filled { background-color: color.mix($bg, $charging-bg, $i * 3); } &:active .regular block:nth-child(#{$i}).filled { background-color: color.mix($bg, $primary-fg, $i * 3); } } &.low image { color: $error-bg; } &.charging image { color: $charging-bg; } &:active image { color: $primary-fg; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/datemenu.scss ================================================ @import "./notifications.scss"; @mixin calendar { @include widget; padding: $padding*2 $padding*2 0; calendar { all: unset; &.button { @include button($flat: true); } &:selected { box-shadow: inset 0 -8px 0 0 transparentize($primary-bg, 0.5), inset 0 0 0 1px $primary-bg; border-radius: $radius*0.6; } &.header { background-color: transparent; border: none; color: transparentize($fg, 0.5); } &.highlight { background-color: transparent; color: transparentize($primary-bg, 0.5); } &:indeterminate { color: transparentize($fg, 0.9); } font-size: 1.1em; padding: .2em; } } window#datemenu .datemenu { @include floating-widget; .notifications { .header { margin-bottom: $spacing; margin-right: $spacing; >label { margin-left: $radius * .5; } button { @include button; padding: $padding*.7 $padding; } } .notification-scrollable { @include scrollable; } .notification-list { margin-right: $spacing; } .notification { @include notification; @include widget; padding: $padding; margin-bottom: $spacing; } .placeholder { image { font-size: 7em; } label { font-size: 1.2em; } } } separator { background-color: $popover-border-color; min-width: 2px; border-radius: $radius; margin-right: $spacing; } .datemenu { @include spacing; } .clock-box { padding: $padding; .clock { font-size: 5em; } .uptime { color: transparentize($fg, 0.2); } } .calendar { @include calendar; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/extra.scss ================================================ * { font-size: $font-size; font-family: $font-name; } window.popup { >* { border: none; box-shadow: none; } menu { border-radius: $popover-radius; background-color: $bg; padding: $popover-padding; border: $border-width solid $popover-border-color; separator { background-color: $border-color; } menuitem { @include button; padding: $spacing * .5; margin: ($spacing * .5) 0; &:first-child { margin-top: 0; } &:last-child { margin-bottom: 0; } } } } tooltip { * { all: unset; } background-color: transparent; border: none; >*>* { background-color: $bg; border-radius: $radius; border: $border-width solid $popover-border-color; color: $fg; padding: 8px; margin: 4px; box-shadow: 0 0 3px 0 $shadow-color; } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/notifications.scss ================================================ @mixin notification() { &.critical { box-shadow: inset 0 0 .5em 0 $error-bg; } &:hover button.close-button { @include button-hover; background-color: transparentize($error-bg, .5); } .content { .title { margin-right: $spacing; color: $fg; font-size: 1.1em; } .time { color: transparentize($fg, .2); } .description { font-size: .9em; color: transparentize($fg, .2); } .icon { border-radius: $radius*0.8; margin-right: $spacing; &.img { border: $border; } } } box.actions { @include spacing(0.5); margin-top: $spacing; button { @include button; border-radius: $radius*0.8; font-size: 1.2em; padding: $padding * 0.7; } } button.close-button { @include button($flat: true); margin-left: $spacing / 2; border-radius: $radius*0.8; min-width: 1.2em; min-height: 1.2em; &:hover { background-color: transparentize($error-bg, .2); } &:active { background-image: none; background-color: $error-bg; } } } window.notifications { @include unset; .notification { @include notification; @include floating-widget; border-radius: $radius; .description { min-width: 350px; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/osd.scss ================================================ window.indicator { .progress { @include floating-widget; margin: max($spacing * 15, 8px); padding: $padding * 0.5; border-radius: if($radius >0, calc($radius + $padding * 0.5), 0); @debug $radius; .fill { border-radius: $radius; background-color: $primary-bg; color: $primary-fg; image { -gtk-icon-transform: scale(0.7); } } } .microphone { @include floating-widget; margin: $spacing * 2; padding: $popover-padding * 2; font-size: 58px; color: transparentize($fg, 0.1); } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/overview.scss ================================================ window#overview .overview { @include floating-widget; @include spacing; .workspace { &.active>widget { border-color: $primary-bg } >widget { @include widget; border-radius: if($radius ==0, 0, $radius + $padding); &:hover { background-color: $hover-bg; } &:drop(active) { border-color: $primary-bg; } } } .client { @include button; border-radius: $radius; margin: $padding; &.hidden { @include hidden; transition: 0; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/powermenu.scss ================================================ window#powermenu, window#verification { // the fraction has to be more than hyprland ignorealpha background-color: rgba(0, 0, 0, .4); } window#verification .verification { @include floating-widget; padding: $popover-padding * 1.5; min-width: 300px; min-height: 100px; .text-box { margin-bottom: $spacing; .title { font-size: 1.6em; } .desc { color: transparentize($fg, 0.1); font-size: 1.1em; } } .buttons { @include spacing; margin-top: $padding; button { @include button; font-size: 1.5em; padding: $padding; } } } window#powermenu .powermenu { @include floating-widget; &.line { padding: $popover-padding * 1.5; button { padding: $popover-padding; } label { margin-bottom: $spacing * -.5; } } &.box { padding: $popover-padding * 2; button { padding: $popover-padding * 1.5; } label { margin-bottom: $spacing * -1; } } button { @include unset; image { @include button; border-radius: $radius + ($popover-padding * 1.4); min-width: 1.7em; min-height: 1.7em; font-size: 4em; } label, image { color: transparentize($fg, 0.1); } label { margin-top: $spacing * .3; } &:hover { image { @include button-hover; } label { color: $fg; } } &:focus image { @include button-focus; } &:active image { @include button-active; } &:focus, &:active { label { color: $primary-bg; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/quicksettings.scss ================================================ window#quicksettings .quicksettings { @include floating-widget; @include spacing; padding: $popover-padding * 1.4; .avatar { @include widget; border-radius: $radius * 3; } .header { @include spacing(.5); color: transparentize($fg, .15); button { @include button; padding: $padding; image { font-size: 1.4em; } } } .sliders-box { @include widget; padding: $padding; button { @include button($flat: true); padding: $padding * .5; } .volume button.arrow:last-child { margin-left: $spacing * .4; } .volume, .brightness { padding: $padding * .5; } scale { @include slider; margin: 0 ($spacing * .5); } } .row { @include spacing; } .menu { @include unset; @include widget; padding: $padding; margin-top: $spacing; .icon { margin: 0 ($spacing * .5); margin-left: $spacing * .2; } .title { font-weight: bold; } separator { margin: ($radius * .5); background-color: $border-color; } button { @include button($flat: true); padding: ($padding * .5); image:first-child { margin-right: $spacing * .5; } } .bluetooth-devices { @include spacing(.5); } switch { @include switch; } } .sliders-box .menu { margin: ($spacing * .5) 0; &.app-mixer { .mixer-item { padding: $padding * .5; padding-left: 0; padding-right: $padding * 2; scale { @include slider($width: .5em); } image { font-size: 1.2em; margin: 0 $padding; } } } } .toggle-button { @include button; font-weight: bold; image { font-size: 1.3em; } label { margin-left: $spacing * .3; } button { @include button($flat: true); &:first-child { padding: $padding * 1.2; border-top-right-radius: 0; border-bottom-right-radius: 0; } &:last-child { padding: $padding * .5; border-top-left-radius: 0; border-bottom-left-radius: 0; } } &.active { background-color: $primary-bg; label, image { color: $primary-fg; } } } .simple-toggle { @include button; font-weight: bold; padding: $padding * 1.2; label { margin-left: $spacing * .3; } image { font-size: 1.3em; } } .media { @include spacing; .player { @include media; } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/screencorner.scss ================================================ $_shadow-size: $padding; $_radius: $radius * $hyprland-gaps-multiplier; $_margin: 99px; window.screen-corner { box.shadow { margin-right: $_margin * -1; margin-left: $_margin * -1; @if $shadows { box-shadow: inset 0 0 $_shadow-size 0 $shadow-color; } @if $bar-position =="top" { margin-bottom: $_margin * -1; } @if $bar-position =="bottom" { margin-top: $_margin * -1; } } box.border { @if $bar-position =="top" { border-top: $border-width solid $bg; } @if $bar-position =="bottom" { border-bottom: $border-width solid $bg; } margin-right: $_margin; margin-left: $_margin; } box.corner { box-shadow: 0 0 0 $border-width $border-color; } &.corners { box.border { border-radius: if($radius>0, $radius * $hyprland-gaps-multiplier, 0); box-shadow: 0 0 0 $_radius $bg; } box.corner { border-radius: if($radius>0, $radius * $hyprland-gaps-multiplier, 0); } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/style/widget/settingsdialog.scss ================================================ window.settings-dialog { background-color: $bg; color: $fg; .header { .pager { @include spacing(.5); } padding: $padding; button { @include button; font-weight: bold; padding: $padding*.5 $padding; box { @include spacing($spacing: .3em); } } button.close { padding: $padding * .4; } button.reset { @include button($flat: true); padding: $padding*.5; } } .page { padding: $padding*2; padding-top: 0; } .group { .group-title { color: $primary-bg; margin-bottom: $spacing*.5; } &:not(:first-child) { margin-top: $spacing; } } .row { background-color: $widget-bg; padding: $padding; border: $border; border-top: none; &:first-child { border-radius: $radius $radius 0 0; border: $border; } &:last-child { border-radius: 0 0 $radius $radius; } label.id, label.note { color: transparentize($fg, .4) } entry, button { @include button; padding: $padding; } switch { @include switch; } spinbutton { @include unset; entry { border-radius: $radius 0 0 $radius; } button { border-radius: 0; } button:last-child { border-radius: 0 $radius $radius 0; } } .enum-setter { label { background-color: $widget-bg; border: $border; padding: 0 $padding; border-radius: $radius 0 0 $radius; } button { border-radius: 0; } button:last-child { border-radius: 0 $radius $radius 0; } } } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/tsconfig.json ================================================ { "compilerOptions": { "target": "ES2022", "module": "ES2022", "lib": [ "ES2022" ], "allowJs": true, "checkJs": true, "strict": true, "noImplicitAny": false, "baseUrl": ".", "typeRoots": [ "./types" ], "skipLibCheck": true } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/PopupWindow.ts ================================================ import { type WindowProps } from "types/widgets/window" import { type RevealerProps } from "types/widgets/revealer" import { type EventBoxProps } from "types/widgets/eventbox" import type Gtk from "gi://Gtk?version=3.0" import options from "options" type Transition = RevealerProps["transition"] type Child = WindowProps["child"] type PopupWindowProps = WindowProps & { name: string layout?: keyof ReturnType transition?: Transition, } export const Padding = (name: string, { css = "", hexpand = true, vexpand = true, }: EventBoxProps = {}) => Widget.EventBox({ hexpand, vexpand, can_focus: false, child: Widget.Box({ css }), setup: w => w.on("button-press-event", () => App.toggleWindow(name)), }) const PopupRevealer = ( name: string, child: Child, transition: Transition = "slide_down", ) => Widget.Box( { css: "padding: 1px;" }, Widget.Revealer({ transition, child: Widget.Box({ class_name: "window-content", child, }), transitionDuration: options.transition.bind(), setup: self => self.hook(App, (_, wname, visible) => { if (wname === name) self.reveal_child = visible }), }), ) const Layout = (name: string, child: Child, transition?: Transition) => ({ "center": () => Widget.CenterBox({}, Padding(name), Widget.CenterBox( { vertical: true }, Padding(name), PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top": () => Widget.CenterBox({}, Padding(name), Widget.Box( { vertical: true }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top-right": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), ), "top-center": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "top-left": () => Widget.Box({}, Widget.Box( { hexpand: false, vertical: true, }, PopupRevealer(name, child, transition), Padding(name), ), Padding(name), ), "bottom-left": () => Widget.Box({}, Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), Padding(name), ), "bottom-center": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), Padding(name), ), "bottom-right": () => Widget.Box({}, Padding(name), Widget.Box( { hexpand: false, vertical: true, }, Padding(name), PopupRevealer(name, child, transition), ), ), }) export default ({ name, child, layout = "center", transition, exclusivity = "ignore", ...props }: PopupWindowProps) => Widget.Window({ name, class_names: [name, "popup-window"], popup: true, visible: false, keymode: "on-demand", exclusivity, layer: "top", anchor: ["top", "bottom", "right", "left"], child: Layout(name, child, transition)[layout](), ...props, }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/applauncher/AppItem.ts ================================================ import { type Application } from "types/service/applications" import options from "options" import { launchApp, icon } from "lib/utils" import icons from "lib/icons" const { iconSize } = options.applauncher export const QuickButton = (app: Application) => Widget.Button({ hexpand: true, on_clicked: () => { App.closeWindow("applauncher") launchApp(app) }, child: Widget.Icon({ size: iconSize.bind(), icon: icon(app.icon_name, icons.fallback.executable), }), }) export const AppItem = (app: Application) => { const title = Widget.Label({ class_name: "title", label: app.name, hexpand: true, xalign: 0, vpack: "center", truncate: "end", }) const description = Widget.Label({ class_name: "description", label: app.description || "", hexpand: true, wrap: true, max_width_chars: 30, xalign: 0, justification: "left", vpack: "center", }) const appicon = Widget.Icon({ icon: icon(app.icon_name, icons.fallback.executable), size: iconSize.bind(), }) const textBox = Widget.Box({ vertical: true, vpack: "center", children: app.description ? [title, description] : [title], }) return Widget.Button({ class_name: "app-item", attribute: { app }, child: Widget.Box({ children: [appicon, textBox], }), on_clicked: () => { App.closeWindow("applauncher") launchApp(app) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/applauncher/Applauncher.ts ================================================ import PopupWindow, { Padding } from "widget/PopupWindow" import { AppItem, QuickButton } from "./AppItem" import icons from "lib/icons" import options from "options" import type Gtk from "gi://Gtk?version=3.0" const apps = await Service.import("applications") const { query } = apps const { width, margin, maxItem, favorites } = options.applauncher const SeparatedAppItem = (app: Parameters[0]) => Widget.Revealer( { attribute: { app } }, Widget.Box( { vertical: true }, Widget.Separator(), AppItem(app), ), ) const Applauncher = () => { const applist = Variable(query("")) let first = applist.value[0] const list = Widget.Box({ vertical: true, children: applist.bind().as(list => list.map(SeparatedAppItem)), }) list.hook(apps, () => applist.value = query(""), "notify::frequents") const entry = Widget.Entry({ hexpand: true, primary_icon_name: icons.ui.search, on_accept: () => { entry.text !== "" && first?.launch() App.toggleWindow("applauncher") }, on_change: ({ text }) => { first = query(text || "")[0] list.children.reduce((i, item) => { if (!text || i >= maxItem.value) { item.reveal_child = false return i } if (item.attribute.app.match(text)) { item.reveal_child = true return ++i } item.reveal_child = false return i }, 0) }, }) const quicklaunch = Widget.Revealer({ setup: self => self.hook(entry, () => self.reveal_child = !entry.text, "notify::text"), visible: favorites.bind().as(f => f.length > 0), child: Widget.Box({ vertical: true, children: [ Widget.Separator(), Widget.Box({ class_name: "quicklaunch horizontal", children: favorites.bind().as(f => f .map(f => query(f)?.[0]) .filter(f => f) .map(QuickButton), ), }), ], }), }) function focus() { entry.text = "Search" entry.set_position(-1) entry.select_region(0, -1) entry.grab_focus() quicklaunch.reveal_child = true } const layout = Widget.Box({ css: width.bind().as(v => `min-width: ${v}pt;`), class_name: "applauncher", vertical: true, vpack: "start", setup: self => self.hook(App, (_, win, visible) => { if (win !== "applauncher") return entry.text = "" if (visible) focus() }), children: [ entry, quicklaunch, list, ], }) return Widget.Box( { vertical: true, css: "padding: 1px" }, Padding("applauncher", { css: margin.bind().as(v => `min-height: ${v}pt;`), vexpand: false, }), layout, ) } export default () => PopupWindow({ name: "applauncher", layout: "top", child: Applauncher(), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/Bar.ts ================================================ import BatteryBar from "./buttons/BatteryBar"; import ColorPicker from "./buttons/ColorPicker"; import Date from "./buttons/Date"; import Launcher from "./buttons/Launcher"; import Media from "./buttons/Media"; import PowerMenu from "./buttons/PowerMenu"; import SysTray from "./buttons/SysTray"; import SystemIndicators from "./buttons/SystemIndicators"; import Taskbar from "./buttons/Taskbar"; import Workspaces from "./buttons/Workspaces"; import ScreenRecord from "./buttons/ScreenRecord"; import Messages from "./buttons/Messages"; import options from "options"; const { start, center, end } = options.bar.layout; const pos = options.bar.position.bind(); export type BarWidget = keyof typeof widget; const widget = { battery: BatteryBar, colorpicker: ColorPicker, date: Date, launcher: Launcher, media: Media, powermenu: PowerMenu, systray: SysTray, system: SystemIndicators, taskbar: Taskbar, workspaces: Workspaces, screenrecord: ScreenRecord, messages: Messages, expander: () => Widget.Box({ expand: true }), }; export default (monitor: number) => Widget.Window({ monitor, class_name: "bar", name: `bar${monitor}`, exclusivity: "exclusive", anchor: pos.as((pos) => [pos, "right", "left"]), child: Widget.CenterBox({ css: "min-width: 2px; min-height: 2px;", startWidget: Widget.Box({ hexpand: false, children: start.bind().as((s) => s.map((w) => widget[w]())), }), centerWidget: Widget.Box({ hpack: "center", children: center.bind().as((c) => c.map((w) => widget[w]())), }), endWidget: Widget.Box({ hexpand: true, children: end.bind().as((e) => e.map((w) => widget[w]())), }), }), }); ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/PanelButton.ts ================================================ import options from "options" import { ButtonProps } from "types/widgets/button" type PanelButtonProps = ButtonProps & { window?: string, flat?: boolean } export default ({ window = "", flat, child, setup, ...rest }: PanelButtonProps) => Widget.Button({ child: Widget.Box({ child }), setup: self => { let open = false self.toggleClassName("panel-button") self.toggleClassName(window) self.hook(options.bar.flatButtons, () => { self.toggleClassName("flat", flat ?? options.bar.flatButtons.value) }) self.hook(App, (_, win, visible) => { if (win !== window) return if (open && !visible) { open = false self.toggleClassName("active", false) } if (visible) { open = true self.toggleClassName("active") } }) if (setup) setup(self) }, ...rest, }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/ScreenCorners.ts ================================================ import options from "options" const { corners } = options.bar export default (monitor: number) => Widget.Window({ monitor, name: `corner${monitor}`, class_name: "screen-corner", anchor: ["top", "bottom", "right", "left"], click_through: true, child: Widget.Box({ class_name: "shadow", child: Widget.Box({ class_name: "border", expand: true, child: Widget.Box({ class_name: "corner", expand: true, }), }), }), setup: self => self.hook(corners, () => { self.toggleClassName("corners", corners.value) }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/BatteryBar.ts ================================================ import icons from "lib/icons" import options from "options" import PanelButton from "../PanelButton" const battery = await Service.import("battery") const { bar, percentage, blocks, width, low } = options.bar.battery const Indicator = () => Widget.Icon({ setup: self => self.hook(battery, () => { self.icon = battery.charging || battery.charged ? icons.battery.charging : battery.icon_name }), }) const PercentLabel = () => Widget.Revealer({ transition: "slide_right", click_through: true, reveal_child: percentage.bind(), child: Widget.Label({ label: battery.bind("percent").as(p => `${p}%`), }), }) const LevelBar = () => { const level = Widget.LevelBar({ mode: 1, max_value: blocks.bind(), visible: bar.bind().as(b => b !== "hidden"), value: battery.bind("percent").as(p => (p / 100) * blocks.value), }) const update = () => { level.value = (battery.percent / 100) * blocks.value level.css = `block { min-width: ${width.value / blocks.value}pt; }` } return level .hook(width, update) .hook(blocks, update) .hook(bar, () => { level.vpack = bar.value === "whole" ? "fill" : "center" level.hpack = bar.value === "whole" ? "fill" : "center" }) } const WholeButton = () => Widget.Overlay({ vexpand: true, child: LevelBar(), class_name: "whole", pass_through: true, overlay: Widget.Box({ hpack: "center", children: [ Widget.Icon({ icon: icons.battery.charging, visible: Utils.merge([ battery.bind("charging"), battery.bind("charged"), ], (ing, ed) => ing || ed), }), Widget.Box({ hpack: "center", vpack: "center", child: PercentLabel(), }), ], }), }) const Regular = () => Widget.Box({ class_name: "regular", children: [ Indicator(), PercentLabel(), LevelBar(), ], }) export default () => PanelButton({ class_name: "battery-bar", hexpand: false, on_clicked: () => { percentage.value = !percentage.value }, child: Widget.Box({ expand: true, visible: battery.bind("available"), child: bar.bind().as(b => b === "whole" ? WholeButton() : Regular()), }), setup: self => self .hook(bar, w => w.toggleClassName("bar-hidden", bar.value === "hidden")) .hook(battery, w => { w.toggleClassName("charging", battery.charging || battery.charged) w.toggleClassName("low", battery.percent < low.value) }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/ColorPicker.ts ================================================ import PanelButton from "../PanelButton" import colorpicker from "service/colorpicker" import Gdk from "gi://Gdk" const css = (color: string) => ` * { background-color: ${color}; color: transparent; } *:hover { color: white; text-shadow: 2px 2px 3px rgba(0,0,0,.8); }` export default () => { const menu = Widget.Menu({ class_name: "colorpicker", children: colorpicker.bind("colors").as(c => c.map(color => Widget.MenuItem({ child: Widget.Label(color), css: css(color), on_activate: () => colorpicker.wlCopy(color), }))), }) return PanelButton({ class_name: "color-picker", child: Widget.Icon("color-select-symbolic"), tooltip_text: colorpicker.bind("colors").as(v => `${v.length} colors`), on_clicked: colorpicker.pick, on_secondary_click: self => { if (colorpicker.colors.length === 0) return menu.popup_at_widget(self, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Date.ts ================================================ import { clock } from "lib/variables" import PanelButton from "../PanelButton" import options from "options" const { format, action } = options.bar.date const time = Utils.derive([clock, format], (c, f) => c.format(f) || "") export default () => PanelButton({ window: "dashboard", on_clicked: action.bind(), child: Widget.Label({ label: time.bind() }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Launcher.ts ================================================ import PanelButton from "../PanelButton" import options from "options" const { icon, label, action } = options.bar.launcher export default () => PanelButton({ window: "launcher", on_clicked: action.bind(), child: Widget.Box([ Widget.Icon({ class_name: icon.colored.bind().as(c => c ? "colored" : ""), visible: icon.icon.bind().as(v => !!v), icon: icon.icon.bind(), }), Widget.Label({ class_name: label.colored.bind().as(c => c ? "colored" : ""), visible: label.label.bind().as(v => !!v), label: label.label.bind(), }), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Media.ts ================================================ import { type MprisPlayer } from "types/service/mpris" import PanelButton from "../PanelButton" import options from "options" import icons from "lib/icons" import { icon } from "lib/utils" const mpris = await Service.import("mpris") const { length, direction, preferred, monochrome } = options.bar.media const getPlayer = (name = preferred.value) => mpris.getPlayer(name) || mpris.players[0] || null const Content = (player: MprisPlayer) => { const revealer = Widget.Revealer({ click_through: true, visible: length.bind().as(l => l > 0), transition: direction.bind().as(d => `slide_${d}` as const), setup: self => { let current = "" self.hook(player, () => { if (current === player.track_title) return current = player.track_title self.reveal_child = true Utils.timeout(3000, () => { !self.is_destroyed && (self.reveal_child = false) }) }) }, child: Widget.Label({ truncate: "end", max_width_chars: length.bind(), label: player.bind("track_title").as(() => `${player.track_artists.join(", ")} - ${player.track_title}`), }), }) const playericon = Widget.Icon({ icon: player.bind("entry").as(entry => { const name = `${entry}${monochrome.value ? "-symbolic" : ""}` return icon(name, icons.fallback.audio) }), }) return Widget.Box({ attribute: { revealer }, children: direction.bind().as(d => d === "right" ? [playericon, revealer] : [revealer, playericon]), }) } export default () => { let player = getPlayer() const btn = PanelButton({ class_name: "media", child: Widget.Icon(icons.fallback.audio), }) const update = () => { player = getPlayer() btn.visible = !!player if (!player) return const content = Content(player) const { revealer } = content.attribute btn.child = content btn.on_primary_click = () => { player.playPause() } btn.on_secondary_click = () => { player.playPause() } btn.on_scroll_up = () => { player.next() } btn.on_scroll_down = () => { player.previous() } btn.on_hover = () => { revealer.reveal_child = true } btn.on_hover_lost = () => { revealer.reveal_child = false } } return btn .hook(preferred, update) .hook(mpris, update, "notify::players") } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Messages.ts ================================================ import icons from "lib/icons" import PanelButton from "../PanelButton" import options from "options" const n = await Service.import("notifications") const notifs = n.bind("notifications") const action = options.bar.messages.action.bind() export default () => PanelButton({ class_name: "messages", on_clicked: action, visible: notifs.as(n => n.length > 0), child: Widget.Box([ Widget.Icon(icons.notifications.message), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/PowerMenu.ts ================================================ import icons from "lib/icons" import PanelButton from "../PanelButton" import options from "options" const { monochrome, action } = options.bar.powermenu export default () => PanelButton({ window: "powermenu", on_clicked: action.bind(), child: Widget.Icon(icons.powermenu.shutdown), setup: self => self.hook(monochrome, () => { self.toggleClassName("colored", !monochrome.value) self.toggleClassName("box") }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/ScreenRecord.ts ================================================ import PanelButton from "../PanelButton" import screenrecord from "service/screenrecord" import icons from "lib/icons" export default () => PanelButton({ class_name: "recorder", on_clicked: () => screenrecord.stop(), visible: screenrecord.bind("recording"), child: Widget.Box({ children: [ Widget.Icon(icons.recorder.recording), Widget.Label({ label: screenrecord.bind("timer").as(time => { const sec = time % 60 const min = Math.floor(time / 60) return `${min}:${sec < 10 ? "0" + sec : sec}` }), }), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/SysTray.ts ================================================ import { type TrayItem } from "types/service/systemtray" import PanelButton from "../PanelButton" import Gdk from "gi://Gdk" import options from "options" const systemtray = await Service.import("systemtray") const { ignore } = options.bar.systray const SysTrayItem = (item: TrayItem) => PanelButton({ class_name: "tray-item", child: Widget.Icon({ icon: item.bind("icon") }), tooltip_markup: item.bind("tooltip_markup"), setup: self => { const menu = item.menu if (!menu) return const id = item.menu?.connect("popped-up", () => { self.toggleClassName("active") menu.connect("notify::visible", () => { self.toggleClassName("active", menu.visible) }) menu.disconnect(id!) }) if (id) self.connect("destroy", () => item.menu?.disconnect(id)) }, on_primary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), on_secondary_click: btn => item.menu?.popup_at_widget( btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null), }) export default () => Widget.Box() .bind("children", systemtray, "items", i => i .filter(({ id }) => !ignore.value.includes(id)) .map(SysTrayItem)) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/SystemIndicators.ts ================================================ import PanelButton from "../PanelButton" import icons from "lib/icons" import asusctl from "service/asusctl" const notifications = await Service.import("notifications") const bluetooth = await Service.import("bluetooth") const audio = await Service.import("audio") const network = await Service.import("network") const ProfileIndicator = () => Widget.Icon() .bind("visible", asusctl, "profile", p => p !== "Balanced") .bind("icon", asusctl, "profile", p => icons.asusctl.profile[p]) const ModeIndicator = () => Widget.Icon() .bind("visible", asusctl, "mode", m => m !== "Hybrid") .bind("icon", asusctl, "mode", m => icons.asusctl.mode[m]) const MicrophoneIndicator = () => Widget.Icon() .hook(audio, self => self.visible = audio.recorders.length > 0 || audio.microphone.stream?.is_muted || audio.microphone.is_muted) .hook(audio.microphone, self => { const vol = audio.microphone.stream!.is_muted ? 0 : audio.microphone.volume const { muted, low, medium, high } = icons.audio.mic const cons = [[67, high], [34, medium], [1, low], [0, muted]] as const self.icon = cons.find(([n]) => n <= vol * 100)?.[1] || "" }) const DNDIndicator = () => Widget.Icon({ visible: notifications.bind("dnd"), icon: icons.notifications.silent, }) const BluetoothIndicator = () => Widget.Overlay({ class_name: "bluetooth", passThrough: true, child: Widget.Icon({ icon: icons.bluetooth.enabled, visible: bluetooth.bind("enabled"), }), overlay: Widget.Label({ hpack: "end", vpack: "start", label: bluetooth.bind("connected_devices").as(c => `${c.length}`), visible: bluetooth.bind("connected_devices").as(c => c.length > 0), }), }) const NetworkIndicator = () => Widget.Icon().hook(network, self => { const icon = network[network.primary || "wifi"]?.icon_name self.icon = icon || "" self.visible = !!icon }) const AudioIndicator = () => Widget.Icon({ icon: audio.speaker.bind("volume").as(vol => { const { muted, low, medium, high, overamplified } = icons.audio.volume const cons = [[101, overamplified], [67, high], [34, medium], [1, low], [0, muted]] as const const icon = cons.find(([n]) => n <= vol * 100)?.[1] || "" return audio.speaker.is_muted ? muted : icon }), }) export default () => PanelButton({ class_name: "quicksettings panel-button", on_clicked: () => App.toggleWindow("quicksettings"), on_scroll_up: () => audio.speaker.volume += 0.02, on_scroll_down: () => audio.speaker.volume -= 0.02, child: Widget.Box([ // @ts-expect-error asusctl?.available && ProfileIndicator(), // @ts-expect-error asusctl?.available && ModeIndicator(), DNDIndicator(), BluetoothIndicator(), NetworkIndicator(), AudioIndicator(), MicrophoneIndicator(), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Taskbar.ts ================================================ import { launchApp, icon } from "lib/utils" import icons from "lib/icons" import options from "options" import PanelButton from "../PanelButton" const hyprland = await Service.import("hyprland") const apps = await Service.import("applications") const { monochrome, exclusive } = options.bar.taskbar const { position } = options.bar const focus = (address: string) => hyprland.messageAsync( `dispatch focuswindow address:${address}`) const DummyItem = (address: string) => Widget.Box({ attribute: { address }, visible: false, }) const AppItem = (address: string) => { const client = hyprland.getClient(address) if (!client || client.class === "") return DummyItem(address) const app = apps.list.find(app => app.match(client.class)) const btn = PanelButton({ class_name: "panel-button", tooltip_text: client.title, on_primary_click: () => focus(address), on_middle_click: () => app && launchApp(app), setup: w => w.hook(hyprland, () => { const { workspace } = hyprland.getClient(address)! w.visible = exclusive.value ? hyprland.active.workspace.id === workspace.id : true }), child: Widget.Icon({ icon: monochrome.bind().as(m => { return icon( (app?.icon_name || client.class) + (m ? "-symbolic" : ""), icons.fallback.executable, ) }), }), }) return Widget.Box( { attribute: { address } }, Widget.Overlay({ child: btn, pass_through: true, overlay: Widget.Box({ className: "indicator", hpack: "center", vpack: position.bind().as(p => p === "top" ? "start" : "end"), setup: w => w.hook(hyprland, () => { w.toggleClassName("active", hyprland.active.client.address === address) }, "event"), }), }), ) } function sortItems(arr: T[]) { return arr.sort(({ attribute: a }, { attribute: b }) => { const aclient = hyprland.getClient(a.address)! const bclient = hyprland.getClient(b.address)! return aclient.workspace.id - bclient.workspace.id }) } export default () => Widget.Box({ class_name: "taskbar", children: sortItems(hyprland.clients.map(c => AppItem(c.address))), setup: w => w .hook(hyprland, (w, address?: string) => { if (typeof address === "string") w.children = w.children.filter(ch => ch.attribute.address !== address) }, "client-removed") .hook(hyprland, (w, address?: string) => { if (typeof address === "string") w.children = sortItems([...w.children, AppItem(address)]) }, "client-added") .hook(hyprland, (w, event?: string) => { if (event === "movewindow") w.children = sortItems(w.children) }, "event"), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/bar/buttons/Workspaces.ts ================================================ import PanelButton from "../PanelButton" import options from "options" import { sh, range } from "lib/utils" const hyprland = await Service.import("hyprland") const { workspaces } = options.bar.workspaces const dispatch = (arg: string | number) => { sh(`hyprctl dispatch workspace ${arg}`) } const Workspaces = (ws: number) => Widget.Box({ children: range(ws || 20).map(i => Widget.Label({ attribute: i, vpack: "center", label: `${i}`, setup: self => self.hook(hyprland, () => { self.toggleClassName("active", hyprland.active.workspace.id === i) self.toggleClassName("occupied", (hyprland.getWorkspace(i)?.windows || 0) > 0) }), })), setup: box => { if (ws === 0) { box.hook(hyprland.active.workspace, () => box.children.map(btn => { btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute) })) } }, }) export default () => PanelButton({ window: "overview", class_name: "workspaces", on_scroll_up: () => dispatch("m+1"), on_scroll_down: () => dispatch("m-1"), on_clicked: () => App.toggleWindow("overview"), child: workspaces.bind().as(Workspaces), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/datemenu/DateColumn.ts ================================================ import { clock, uptime } from "lib/variables" function up(up: number) { const h = Math.floor(up / 60) const m = Math.floor(up % 60) return `uptime: ${h}:${m < 10 ? "0" + m : m}` } export default () => Widget.Box({ vertical: true, class_name: "date-column vertical", children: [ Widget.Box({ class_name: "clock-box", vertical: true, children: [ Widget.Label({ class_name: "clock", label: clock.bind().as(t => t.format("%H:%M")!), }), Widget.Label({ class_name: "uptime", label: uptime.bind().as(up), }), ], }), Widget.Box({ class_name: "calendar", children: [ Widget.Calendar({ hexpand: true, hpack: "center", }), ], }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/datemenu/DateMenu.ts ================================================ import PopupWindow from "widget/PopupWindow" import NotificationColumn from "./NotificationColumn" import DateColumn from "./DateColumn" import options from "options" const { bar, datemenu } = options const pos = bar.position.bind() const layout = Utils.derive([bar.position, datemenu.position], (bar, qs) => `${bar}-${qs}` as const, ) const Settings = () => Widget.Box({ class_name: "datemenu horizontal", vexpand: false, children: [ NotificationColumn(), Widget.Separator({ orientation: 1 }), DateColumn(), ], }) const DateMenu = () => PopupWindow({ name: "datemenu", exclusivity: "exclusive", transition: pos.as(pos => pos === "top" ? "crossfade" : "crossfade"), layout: layout.value, child: Settings(), }) export function setupDateMenu() { App.addWindow(DateMenu()) layout.connect("changed", () => { App.removeWindow("datemenu") App.addWindow(DateMenu()) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/datemenu/NotificationColumn.ts ================================================ import Notification from "widget/notifications/Notification" import options from "options" import icons from "lib/icons" const notifications = await Service.import("notifications") const notifs = notifications.bind("notifications") const ClearButton = () => Widget.Button({ on_clicked: () => { const n = notifications.notifications const t = options.transition.value / 2 for (let i = 0; i < n.length; i++) Utils.timeout(t * i, () => n[i]?.close()) }, sensitive: notifs.as(n => n.length > 0), child: Widget.Box({ children: [ Widget.Label("Clear "), Widget.Icon({ icon: notifs.as(n => icons.trash[n.length > 0 ? "full" : "empty"]), }), ], }), }) const Header = () => Widget.Box({ class_name: "header", children: [ Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }), ClearButton(), ], }) const NotificationList = () => { const map: Map> = new Map const box = Widget.Box({ vertical: true, children: notifications.notifications.map(Notification), visible: notifs.as(n => n.length > 0), }) function remove(_: unknown, id: number) { map.get(id)?.destroy() map.delete(id) } return box .hook(notifications, remove, "closed") .hook(notifications, (_, id: number) => { if (id !== undefined) { if (map.has(id)) remove(null, id) const n = notifications.getNotification(id)! const w = Notification(n) map.set(id, w) box.children = [w, ...box.children] } }, "notified") } const Placeholder = () => Widget.Box({ class_name: "placeholder", vertical: true, vpack: "center", hpack: "center", vexpand: true, hexpand: true, visible: notifs.as(n => n.length === 0), children: [ Widget.Icon(icons.notifications.silent), Widget.Label("Your inbox is empty"), ], }) export default () => Widget.Box({ class_name: "notifications", css: options.notifications.width.bind().as(w => `min-width: ${w}px`), vertical: true, children: [ Header(), Widget.Scrollable({ vexpand: true, hscroll: "never", class_name: "notification-scrollable", child: Widget.Box({ class_name: "notification-list vertical", vertical: true, children: [ NotificationList(), Placeholder(), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/desktop/Desktop.ts ================================================ import options from "options" const mpris = await Service.import("mpris") const pref = () => options.bar.media.preferred.value export default (monitor: number) => Widget.Window({ layer: "bottom", name: `desktop${monitor}`, class_name: "desktop", anchor: ["top", "bottom", "left", "right"], child: Widget.Box({ expand: true, child: Widget.Box({ class_name: "wallpaper", expand: true, vpack: "center", hpack: "center", setup: self => self .hook(mpris, () => { self.css = ` background-image: url('${mpris.getPlayer(pref())!.cover_path}'); background-size: contain; background-repeat: no-repeat; transition: 200ms; min-width: 700px; min-height: 700px; border-radius: 30px; box-shadow: 25px 25px 30px 0 rgba(0,0,0,0.5);` }), }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/notifications/Notification.ts ================================================ import { type Notification } from "types/service/notifications" import GLib from "gi://GLib" import icons from "lib/icons" const time = (time: number, format = "%H:%M") => GLib.DateTime .new_from_unix_local(time) .format(format) const NotificationIcon = ({ app_entry, app_icon, image }: Notification) => { if (image) { return Widget.Box({ vpack: "start", hexpand: false, class_name: "icon img", css: ` background-image: url("${image}"); background-size: cover; background-repeat: no-repeat; background-position: center; min-width: 78px; min-height: 78px; `, }) } let icon = icons.fallback.notification if (Utils.lookUpIcon(app_icon)) icon = app_icon if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || "" return Widget.Box({ vpack: "start", hexpand: false, class_name: "icon", css: ` min-width: 78px; min-height: 78px; `, child: Widget.Icon({ icon, size: 58, hpack: "center", hexpand: true, vpack: "center", vexpand: true, }), }) } export default (notification: Notification) => { const content = Widget.Box({ class_name: "content", children: [ NotificationIcon(notification), Widget.Box({ hexpand: true, vertical: true, children: [ Widget.Box({ children: [ Widget.Label({ class_name: "title", xalign: 0, justification: "left", hexpand: true, max_width_chars: 24, truncate: "end", wrap: true, label: notification.summary.trim(), use_markup: true, }), Widget.Label({ class_name: "time", vpack: "start", label: time(notification.time), }), Widget.Button({ class_name: "close-button", vpack: "start", child: Widget.Icon("window-close-symbolic"), on_clicked: notification.close, }), ], }), Widget.Label({ class_name: "description", hexpand: true, use_markup: true, xalign: 0, justification: "left", label: notification.body.trim(), max_width_chars: 24, wrap: true, }), ], }), ], }) const actionsbox = notification.actions.length > 0 ? Widget.Revealer({ transition: "slide_down", child: Widget.EventBox({ child: Widget.Box({ class_name: "actions horizontal", children: notification.actions.map(action => Widget.Button({ class_name: "action-button", on_clicked: () => notification.invoke(action.id), hexpand: true, child: Widget.Label(action.label), })), }), }), }) : null const eventbox = Widget.EventBox({ vexpand: false, on_primary_click: notification.dismiss, on_hover() { if (actionsbox) actionsbox.reveal_child = true }, on_hover_lost() { if (actionsbox) actionsbox.reveal_child = true notification.dismiss() }, child: Widget.Box({ vertical: true, children: actionsbox ? [content, actionsbox] : [content], }), }) return Widget.Box({ class_name: `notification ${notification.urgency}`, child: eventbox, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/notifications/NotificationPopups.ts ================================================ import Notification from "./Notification" import options from "options" const notifications = await Service.import("notifications") const { transition } = options const { position, blacklist } = options.notifications const { timeout, idle } = Utils function Animated(id: number) { const n = notifications.getNotification(id)! const widget = Notification(n) const inner = Widget.Revealer({ css: "border: 1px solid magenta;", transition: "slide_left", transition_duration: transition.value, child: widget, }) const outer = Widget.Revealer({ css: "border: 1px solid yellow;", transition: "slide_down", transition_duration: transition.value, child: inner, }) const box = Widget.Box({ hpack: "end", child: outer, }) idle(() => { outer.reveal_child = true timeout(transition.value, () => { inner.reveal_child = true }) }) return Object.assign(box, { dismiss() { inner.reveal_child = false timeout(transition.value, () => { outer.reveal_child = false timeout(transition.value, () => { box.destroy() }) }) }, }) } function PopupList() { const map: Map> = new Map const box = Widget.Box({ hpack: "end", vertical: true, css: options.notifications.width.bind().as(w => `min-width: ${w}px;`), }) function remove(_: unknown, id: number) { map.get(id)?.dismiss() map.delete(id) } return box .hook(notifications, (_, id: number) => { if (id !== undefined) { if (map.has(id)) remove(null, id) if (blacklist.value.includes(notifications.getNotification(id)!.app_name)) return if (notifications.dnd) return const w = Animated(id) map.set(id, w) box.children = [w, ...box.children] } }, "notified") .hook(notifications, remove, "dismissed") .hook(notifications, remove, "closed") } export default (monitor: number) => Widget.Window({ monitor, name: `notifications${monitor}`, anchor: position.bind(), class_name: "notifications", child: Widget.Box({ css: "padding: 2px;", child: PopupList(), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/osd/OSD.ts ================================================ import { icon } from "lib/utils" import icons from "lib/icons" import Progress from "./Progress" import brightness from "service/brightness" import type Gtk from "gi://Gtk?version=3.0" import options from "options" const audio = await Service.import("audio") const { progress, microphone } = options.osd const DELAY = 2500 function OnScreenProgress(vertical: boolean) { const indicator = Widget.Icon({ size: 32, vpack: "start", }) const progress = Progress({ vertical, width: vertical ? 42 : 200, height: vertical ? 300 : 32, child: indicator, }) const revealer = Widget.Revealer({ transition: "slide_left", child: progress, }) let count = 0 function show(value: number, icon: string) { revealer.reveal_child = true indicator.icon = icon progress.setValue(value) count++ Utils.timeout(DELAY, () => { count-- if (count === 0) revealer.reveal_child = false }) } return revealer .hook(brightness, () => show( brightness.screen, icons.brightness.screen, ), "notify::screen") .hook(brightness, () => show( brightness.kbd, icons.brightness.keyboard, ), "notify::kbd") .hook(audio.speaker, () => show( audio.speaker.volume, icon(audio.speaker.icon_name || "", icons.audio.type.speaker), ), "notify::volume") } function MicrophoneMute() { const icon = Widget.Icon({ class_name: "microphone", }) const revealer = Widget.Revealer({ transition: "slide_up", child: icon, }) let count = 0 let mute = audio.microphone.stream?.is_muted ?? false return revealer.hook(audio.microphone, () => Utils.idle(() => { if (mute !== audio.microphone.stream?.is_muted) { mute = audio.microphone.stream!.is_muted icon.icon = icons.audio.mic[mute ? "muted" : "high"] revealer.reveal_child = true count++ Utils.timeout(DELAY, () => { count-- if (count === 0) revealer.reveal_child = false }) } })) } export default (monitor: number) => Widget.Window({ monitor, name: `indicator${monitor}`, class_name: "indicator", layer: "overlay", click_through: true, anchor: ["right", "left", "top", "bottom"], child: Widget.Box({ css: "padding: 2px;", expand: true, child: Widget.Overlay( { child: Widget.Box({ expand: true }) }, Widget.Box({ hpack: progress.pack.h.bind(), vpack: progress.pack.v.bind(), child: progress.vertical.bind().as(OnScreenProgress), }), Widget.Box({ hpack: microphone.pack.h.bind(), vpack: microphone.pack.v.bind(), child: MicrophoneMute(), }), ), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/osd/Progress.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import GLib from "gi://GLib?version=2.0" import { range } from "lib/utils" import options from "options" type ProgressProps = { height?: number width?: number vertical?: boolean child: Gtk.Widget } export default ({ height = 18, width = 180, vertical = false, child, }: ProgressProps) => { const fill = Widget.Box({ class_name: "fill", hexpand: vertical, vexpand: !vertical, hpack: vertical ? "fill" : "start", vpack: vertical ? "end" : "fill", child, }) const container = Widget.Box({ class_name: "progress", child: fill, css: ` min-width: ${width}px; min-height: ${height}px; `, }) let fill_size = 0 let animations: number[] = [] return Object.assign(container, { setValue(value: number) { if (value < 0) return if (animations.length > 0) { for (const id of animations) GLib.source_remove(id) animations = [] } const axis = vertical ? "height" : "width" const axisv = vertical ? height : width const min = vertical ? width : height const preferred = (axisv - min) * value + min if (!fill_size) { fill_size = preferred fill.css = `min-${axis}: ${preferred}px;` return } const frames = options.transition.value / 10 const goal = preferred - fill_size const step = goal / frames animations = range(frames, 0).map(i => Utils.timeout(5 * i, () => { fill_size += step fill.css = `min-${axis}: ${fill_size}px` animations.shift() })) }, }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/overview/Overview.ts ================================================ import PopupWindow from "widget/PopupWindow" import Workspace from "./Workspace" import options from "options" import { range } from "lib/utils" const hyprland = await Service.import("hyprland") const Overview = (ws: number) => Widget.Box({ class_name: "overview horizontal", children: ws > 0 ? range(ws).map(Workspace) : hyprland.workspaces .map(({ id }) => Workspace(id)) .sort((a, b) => a.attribute.id - b.attribute.id), setup: w => { if (ws > 0) return w.hook(hyprland, (w, id?: number) => { if (id === undefined) return w.children = w.children .filter(ch => ch.attribute.id !== Number(id)) }, "workspace-removed") w.hook(hyprland, (w, id?: number) => { if (id === undefined) return w.children = [...w.children, Workspace(Number(id))] .sort((a, b) => a.attribute.id - b.attribute.id) }, "workspace-added") }, }) export default () => PopupWindow({ name: "overview", layout: "center", child: options.overview.workspaces.bind().as(Overview), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/overview/Window.ts ================================================ import { type Client } from "types/service/hyprland" import { createSurfaceFromWidget, icon } from "lib/utils" import Gdk from "gi://Gdk" import Gtk from "gi://Gtk?version=3.0" import options from "options" import icons from "lib/icons" const monochrome = options.overview.monochromeIcon const TARGET = [Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 0)] const scale = (size: number) => (options.overview.scale.value / 100) * size const hyprland = await Service.import("hyprland") const apps = await Service.import("applications") const dispatch = (args: string) => hyprland.messageAsync(`dispatch ${args}`) export default ({ address, size: [w, h], class: c, title }: Client) => Widget.Button({ class_name: "client", attribute: { address }, tooltip_text: `${title}`, child: Widget.Icon({ css: ` min-width: ${scale(w)}px; min-height: ${scale(h)}px; `, icon: monochrome.bind().as(m => { const app = apps.list.find(app => app.match(c)) if (!app) return icons.fallback.executable return icon( app.icon_name + (m ? "-symbolic" : ""), icons.fallback.executable, ) }), }), on_secondary_click: () => dispatch(`closewindow address:${address}`), on_clicked: () => { dispatch(`focuswindow address:${address}`) App.closeWindow("overview") }, setup: btn => btn .on("drag-data-get", (_w, _c, data) => data.set_text(address, address.length)) .on("drag-begin", (_, context) => { Gtk.drag_set_icon_surface(context, createSurfaceFromWidget(btn)) btn.toggleClassName("hidden", true) }) .on("drag-end", () => btn.toggleClassName("hidden", false)) .drag_source_set(Gdk.ModifierType.BUTTON1_MASK, TARGET, Gdk.DragAction.COPY), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/overview/Workspace.ts ================================================ import Window from "./Window" import Gdk from "gi://Gdk" import Gtk from "gi://Gtk?version=3.0" import options from "options" const TARGET = [Gtk.TargetEntry.new("text/plain", Gtk.TargetFlags.SAME_APP, 0)] const scale = (size: number) => (options.overview.scale.value / 100) * size const hyprland = await Service.import("hyprland") const dispatch = (args: string) => hyprland.messageAsync(`dispatch ${args}`) const size = (id: number) => { const def = { h: 1080, w: 1920 } const ws = hyprland.getWorkspace(id) if (!ws) return def const mon = hyprland.getMonitor(ws.monitorID) return mon ? { h: mon.height, w: mon.width } : def } export default (id: number) => Widget.Box({ attribute: { id }, tooltipText: `${id}`, class_name: "workspace", vpack: "center", css: ` min-width: ${scale(size(id).w)}px; min-height: ${scale(size(id).h)}px; `, setup: box => box.hook(hyprland, () => { box.toggleClassName("active", hyprland.active.workspace.id === id) }), child: Widget.EventBox({ expand: true, on_primary_click: () => { App.closeWindow("overview") dispatch(`workspace ${id}`) }, setup: eventbox => { eventbox.drag_dest_set(Gtk.DestDefaults.ALL, TARGET, Gdk.DragAction.COPY) eventbox.connect("drag-data-received", (_w, _c, _x, _y, data) => { const address = new TextDecoder().decode(data.get_data()) dispatch(`movetoworkspacesilent ${id},address:${address}`) }) }, child: Widget.Fixed().hook(hyprland, fixed => { fixed.get_children().forEach(ch => ch.destroy()) hyprland.clients .filter(({ workspace }) => workspace.id === id) .forEach(c => { const x = c.at[0] - (hyprland.getMonitor(c.monitor)?.x || 0) const y = c.at[1] - (hyprland.getMonitor(c.monitor)?.y || 0) c.mapped && fixed.put(Window(c), scale(x), scale(y)) }) fixed.show_all() }, "notify::clients"), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/powermenu/PowerMenu.ts ================================================ import PopupWindow from "widget/PopupWindow" import powermenu, { type Action } from "service/powermenu" import icons from "lib/icons" import options from "options" import type Gtk from "gi://Gtk?version=3.0" const { layout, labels } = options.powermenu const SysButton = (action: Action, label: string) => Widget.Button({ on_clicked: () => powermenu.action(action), child: Widget.Box({ vertical: true, class_name: "system-button", children: [ Widget.Icon(icons.powermenu[action]), Widget.Label({ label, visible: labels.bind(), }), ], }), }) export default () => PopupWindow({ name: "powermenu", transition: "crossfade", child: Widget.Box({ class_name: "powermenu horizontal", setup: self => self.hook(layout, () => { self.toggleClassName("box", layout.value === "box") self.toggleClassName("line", layout.value === "line") }), children: layout.bind().as(layout => { switch (layout) { case "line": return [ SysButton("shutdown", "Shutdown"), SysButton("logout", "Log Out"), SysButton("reboot", "Reboot"), SysButton("sleep", "Sleep"), ] case "box": return [ Widget.Box( { vertical: true }, SysButton("shutdown", "Shutdown"), SysButton("logout", "Log Out"), ), Widget.Box( { vertical: true }, SysButton("reboot", "Reboot"), SysButton("sleep", "Sleep"), ), ] } }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/powermenu/Verification.ts ================================================ import PopupWindow from "widget/PopupWindow" import powermenu from "service/powermenu" export default () => PopupWindow({ name: "verification", transition: "crossfade", child: Widget.Box({ class_name: "verification", vertical: true, children: [ Widget.Box({ class_name: "text-box", vertical: true, children: [ Widget.Label({ class_name: "title", label: powermenu.bind("title"), }), Widget.Label({ class_name: "desc", label: "Are you sure?", }), ], }), Widget.Box({ class_name: "buttons horizontal", vexpand: true, vpack: "end", homogeneous: true, children: [ Widget.Button({ child: Widget.Label("No"), on_clicked: () => App.toggleWindow("verification"), setup: self => self.hook(App, (_, name: string, visible: boolean) => { if (name === "verification" && visible) self.grab_focus() }), }), Widget.Button({ child: Widget.Label("Yes"), on_clicked: () => Utils.exec(powermenu.cmd), }), ], }), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/QuickSettings.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import { ProfileSelector, ProfileToggle } from "./widgets/AsusProfile" import { Header } from "./widgets/Header" import { Volume, Microhone, SinkSelector, AppMixer } from "./widgets/Volume" import { Brightness } from "./widgets/Brightness" import { NetworkToggle, WifiSelection } from "./widgets/Network" import { BluetoothToggle, BluetoothDevices } from "./widgets/Bluetooth" import { DND } from "./widgets/DND" import { DarkModeToggle } from "./widgets/DarkMode" import { MicMute } from "./widgets/MicMute" import { Media } from "./widgets/Media" import PopupWindow from "widget/PopupWindow" import options from "options" const { bar, quicksettings } = options const media = (await Service.import("mpris")).bind("players") const layout = Utils.derive([bar.position, quicksettings.position], (bar, qs) => `${bar}-${qs}` as const, ) const Row = ( toggles: Array<() => Gtk.Widget> = [], menus: Array<() => Gtk.Widget> = [], ) => Widget.Box({ vertical: true, children: [ Widget.Box({ homogeneous: true, class_name: "row horizontal", children: toggles.map(w => w()), }), ...menus.map(w => w()), ], }) const Settings = () => Widget.Box({ vertical: true, class_name: "quicksettings vertical", css: quicksettings.width.bind().as(w => `min-width: ${w}px;`), children: [ Header(), Widget.Box({ class_name: "sliders-box vertical", vertical: true, children: [ Row( [Volume], [SinkSelector, AppMixer], ), Microhone(), Brightness(), ], }), Row( [NetworkToggle, BluetoothToggle], [WifiSelection, BluetoothDevices], ), Row( [ProfileToggle, DarkModeToggle], [ProfileSelector], ), Row([MicMute, DND]), Widget.Box({ visible: media.as(l => l.length > 0), child: Media(), }), ], }) const QuickSettings = () => PopupWindow({ name: "quicksettings", exclusivity: "exclusive", transition: bar.position.bind().as(pos => pos === "top" ? "crossfade" : "crossfade"), layout: layout.value, child: Settings(), }) export function setupQuickSettings() { App.addWindow(QuickSettings()) layout.connect("changed", () => { App.removeWindow("quicksettings") App.addWindow(QuickSettings()) }) } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/ToggleButton.ts ================================================ import { type Props as IconProps } from "types/widgets/icon" import { type Props as LabelProps } from "types/widgets/label" import type GObject from "gi://GObject?version=2.0" import type Gtk from "gi://Gtk?version=3.0" import icons from "lib/icons" export const opened = Variable("") App.connect("window-toggled", (_, name: string, visible: boolean) => { if (name === "quicksettings" && !visible) Utils.timeout(500, () => opened.value = "") }) export const Arrow = (name: string, activate?: false | (() => void)) => { let deg = 0 let iconOpened = false const icon = Widget.Icon(icons.ui.arrow.right).hook(opened, () => { if (opened.value === name && !iconOpened || opened.value !== name && iconOpened) { const step = opened.value === name ? 10 : -10 iconOpened = !iconOpened for (let i = 0; i < 9; ++i) { Utils.timeout(15 * i, () => { deg += step icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`) }) } } }) return Widget.Button({ child: icon, class_name: "arrow", on_clicked: () => { opened.value = opened.value === name ? "" : name if (typeof activate === "function") activate() }, }) } type ArrowToggleButtonProps = { name: string icon: IconProps["icon"] label: LabelProps["label"] activate: () => void deactivate: () => void activateOnArrow?: boolean connection: [GObject.Object, () => boolean] } export const ArrowToggleButton = ({ name, icon, label, activate, deactivate, activateOnArrow = true, connection: [service, condition], }: ArrowToggleButtonProps) => Widget.Box({ class_name: "toggle-button", setup: self => self.hook(service, () => { self.toggleClassName("active", condition()) }), children: [ Widget.Button({ child: Widget.Box({ hexpand: true, children: [ Widget.Icon({ class_name: "icon", icon, }), Widget.Label({ class_name: "label", max_width_chars: 10, truncate: "end", label, }), ], }), on_clicked: () => { if (condition()) { deactivate() if (opened.value === name) opened.value = "" } else { activate() } }, }), Arrow(name, activateOnArrow && activate), ], }) type MenuProps = { name: string icon: IconProps["icon"] title: LabelProps["label"] content: Gtk.Widget[] } export const Menu = ({ name, icon, title, content }: MenuProps) => Widget.Revealer({ transition: "slide_down", reveal_child: opened.bind().as(v => v === name), child: Widget.Box({ class_names: ["menu", name], vertical: true, children: [ Widget.Box({ class_name: "title-box", children: [ Widget.Icon({ class_name: "icon", icon, }), Widget.Label({ class_name: "title", truncate: "end", label: title, }), ], }), Widget.Separator(), Widget.Box({ vertical: true, class_name: "content vertical", children: content, }), ], }), }) type SimpleToggleButtonProps = { icon: IconProps["icon"] label: LabelProps["label"] toggle: () => void connection: [GObject.Object, () => boolean] } export const SimpleToggleButton = ({ icon, label, toggle, connection: [service, condition], }: SimpleToggleButtonProps) => Widget.Button({ on_clicked: toggle, class_name: "simple-toggle", setup: self => self.hook(service, () => { self.toggleClassName("active", condition()) }), child: Widget.Box([ Widget.Icon({ icon }), Widget.Label({ max_width_chars: 10, truncate: "end", label, }), ]), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/AsusProfile.ts ================================================ import { ArrowToggleButton, Menu } from "../ToggleButton" import icons from "lib/icons" import asusctl from "service/asusctl" const profile = asusctl.bind("profile") export const ProfileToggle = () => ArrowToggleButton({ name: "asusctl-profile", icon: profile.as(p => icons.asusctl.profile[p]), label: profile, connection: [asusctl, () => asusctl.profile !== "Balanced"], activate: () => asusctl.setProfile("Quiet"), deactivate: () => asusctl.setProfile("Balanced"), activateOnArrow: false, }) export const ProfileSelector = () => Menu({ name: "asusctl-profile", icon: profile.as(p => icons.asusctl.profile[p]), title: "Profile Selector", content: [ Widget.Box({ vertical: true, hexpand: true, children: [ Widget.Box({ vertical: true, children: asusctl.profiles.map(prof => Widget.Button({ on_clicked: () => asusctl.setProfile(prof), child: Widget.Box({ children: [ Widget.Icon(icons.asusctl.profile[prof]), Widget.Label(prof), ], }), })), }), ], }), Widget.Separator(), Widget.Button({ on_clicked: () => Utils.execAsync("rog-control-center"), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Rog Control Center"), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Bluetooth.ts ================================================ import { type BluetoothDevice } from "types/service/bluetooth" import { Menu, ArrowToggleButton } from "../ToggleButton" import icons from "lib/icons" import { watch } from "lib/experiments" const bluetooth = await Service.import("bluetooth") const title = watch("Disabled", bluetooth, () => { if (!bluetooth.enabled) return "Disabled" if (bluetooth.connected_devices.length === 1) return bluetooth.connected_devices[0].alias return `${bluetooth.connected_devices.length} Connected` }) export const BluetoothToggle = () => ArrowToggleButton({ name: "bluetooth", icon: bluetooth.bind("enabled").as(p => icons.bluetooth[p ? "enabled" : "disabled"]), label: title, connection: [bluetooth, () => bluetooth.enabled], deactivate: () => bluetooth.enabled = false, activate: () => bluetooth.enabled = true, }) const DeviceItem = (device: BluetoothDevice) => Widget.Box({ children: [ Widget.Icon(device.icon_name + "-symbolic"), Widget.Label(device.name), Widget.Label({ label: `${device.battery_percentage}%`, visible: device.bind("battery_percentage").as(p => p > 0), }), Widget.Box({ hexpand: true }), Widget.Spinner({ active: device.bind("connecting"), visible: device.bind("connecting"), }), Widget.Switch({ active: device.connected, visible: device.bind("connecting").as(p => !p), setup: self => self.on("notify::active", () => { device.setConnection(self.active) }), }), ], }) export const BluetoothDevices = () => Menu({ name: "bluetooth", icon: icons.bluetooth.disabled, title: "Bluetooth", content: [ Widget.Box({ class_name: "bluetooth-devices", hexpand: true, vertical: true, children: bluetooth.bind("devices").as(ds => ds .filter(d => d.name) .map(DeviceItem)), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Brightness.ts ================================================ import icons from "lib/icons" import brightness from "service/brightness" const BrightnessSlider = () => Widget.Slider({ draw_value: false, hexpand: true, value: brightness.bind("screen"), on_change: ({ value }) => brightness.screen = value, }) export const Brightness = () => Widget.Box({ class_name: "brightness", children: [ Widget.Button({ vpack: "center", child: Widget.Icon(icons.brightness.indicator), on_clicked: () => brightness.screen = 0, tooltip_text: brightness.bind("screen").as(v => `Screen Brightness: ${Math.floor(v * 100)}%`), }), BrightnessSlider(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/DND.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" const n = await Service.import("notifications") const dnd = n.bind("dnd") export const DND = () => SimpleToggleButton({ icon: dnd.as(dnd => icons.notifications[dnd ? "silent" : "noisy"]), label: dnd.as(dnd => dnd ? "Silent" : "Noisy"), toggle: () => n.dnd = !n.dnd, connection: [n, () => n.dnd], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/DarkMode.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" import options from "options" const { scheme } = options.theme export const DarkModeToggle = () => SimpleToggleButton({ icon: scheme.bind().as(s => icons.color[s]), label: scheme.bind().as(s => s === "dark" ? "Dark" : "Light"), toggle: () => scheme.value = scheme.value === "dark" ? "light" : "dark", connection: [scheme, () => scheme.value === "dark"], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Header.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import icons from "lib/icons" import { uptime } from "lib/variables" import options from "options" import powermenu, { Action } from "service/powermenu" const battery = await Service.import("battery") const { image, size } = options.quicksettings.avatar function up(up: number) { const h = Math.floor(up / 60) const m = Math.floor(up % 60) return `${h}h ${m < 10 ? "0" + m : m}m` } const Avatar = () => Widget.Box({ class_name: "avatar", css: Utils.merge([image.bind(), size.bind()], (img, size) => ` min-width: ${size}px; min-height: ${size}px; background-image: url('${img}'); background-size: cover; `), }) const SysButton = (action: Action) => Widget.Button({ vpack: "center", child: Widget.Icon(icons.powermenu[action]), on_clicked: () => powermenu.action(action), }) export const Header = () => Widget.Box( { class_name: "header horizontal" }, Avatar(), Widget.Box({ vertical: true, vpack: "center", children: [ Widget.Box([ Widget.Icon({ icon: battery.bind("icon_name") }), Widget.Label({ label: battery.bind("percent").as(p => `${p}%`) }), ]), Widget.Box([ Widget.Icon({ icon: icons.ui.time }), Widget.Label({ label: uptime.bind().as(up) }), ]), ], }), Widget.Box({ hexpand: true }), Widget.Button({ vpack: "center", child: Widget.Icon(icons.ui.settings), on_clicked: () => { App.closeWindow("settings-dialog") App.openWindow("settings-dialog") }, }), SysButton("logout"), SysButton("shutdown"), ) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Media.ts ================================================ import { type MprisPlayer } from "types/service/mpris" import icons from "lib/icons" import type Gtk from "gi://Gtk?version=3.0" import options from "options" import { icon } from "lib/utils" const mpris = await Service.import("mpris") const players = mpris.bind("players") const { media } = options.quicksettings function lengthStr(length: number) { const min = Math.floor(length / 60) const sec = Math.floor(length % 60) const sec0 = sec < 10 ? "0" : "" return `${min}:${sec0}${sec}` } const Player = (player: MprisPlayer) => { const cover = Widget.Box({ class_name: "cover", vpack: "start", css: Utils.merge([player.bind("cover_path"), media.coverSize.bind()], (path, size) => ` min-width: ${size}px; min-height: ${size}px; background-image: url('${path}'); `), }) const title = Widget.Label({ class_name: "title", max_width_chars: 20, truncate: "end", hpack: "start", label: player.bind("track_title"), }) const artist = Widget.Label({ class_name: "artist", max_width_chars: 20, truncate: "end", hpack: "start", label: player.bind("track_artists").as(a => a.join(", ")), }) const positionSlider = Widget.Slider({ class_name: "position", draw_value: false, on_change: ({ value }) => player.position = value * player.length, setup: self => { const update = () => { const { length, position } = player self.visible = length > 0 self.value = length > 0 ? position / length : 0 } self.hook(player, update) self.hook(player, update, "position") self.poll(1000, update) }, }) const positionLabel = Widget.Label({ class_name: "position", hpack: "start", setup: self => { const update = (_: unknown, time?: number) => { self.label = lengthStr(time || player.position) self.visible = player.length > 0 } self.hook(player, update, "position") self.poll(1000, update) }, }) const lengthLabel = Widget.Label({ class_name: "length", hpack: "end", visible: player.bind("length").as(l => l > 0), label: player.bind("length").as(lengthStr), }) const playericon = Widget.Icon({ class_name: "icon", hexpand: true, hpack: "end", vpack: "start", tooltip_text: player.identity || "", icon: Utils.merge([player.bind("entry"), media.monochromeIcon.bind()], (e, s) => { const name = `${e}${s ? "-symbolic" : ""}` return icon(name, icons.fallback.audio) }), }) const playPause = Widget.Button({ class_name: "play-pause", on_clicked: () => player.playPause(), visible: player.bind("can_play"), child: Widget.Icon({ icon: player.bind("play_back_status").as(s => { switch (s) { case "Playing": return icons.mpris.playing case "Paused": case "Stopped": return icons.mpris.stopped } }), }), }) const prev = Widget.Button({ on_clicked: () => player.previous(), visible: player.bind("can_go_prev"), child: Widget.Icon(icons.mpris.prev), }) const next = Widget.Button({ on_clicked: () => player.next(), visible: player.bind("can_go_next"), child: Widget.Icon(icons.mpris.next), }) return Widget.Box( { class_name: "player", vexpand: false }, cover, Widget.Box( { vertical: true }, Widget.Box([ title, playericon, ]), artist, Widget.Box({ vexpand: true }), positionSlider, Widget.CenterBox({ class_name: "footer horizontal", start_widget: positionLabel, center_widget: Widget.Box([ prev, playPause, next, ]), end_widget: lengthLabel, }), ), ) } export const Media = () => Widget.Box({ vertical: true, class_name: "media vertical", children: players.as(p => p.map(Player)), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/MicMute.ts ================================================ import { SimpleToggleButton } from "../ToggleButton" import icons from "lib/icons" const { microphone } = await Service.import("audio") const icon = () => microphone.is_muted || microphone.stream?.is_muted ? icons.audio.mic.muted : icons.audio.mic.high const label = () => microphone.is_muted || microphone.stream?.is_muted ? "Muted" : "Unmuted" // TODO: Variable watch option const ico = Variable(icon()) microphone.connect("changed", () => ico.value = icon()) // TODO: Variable watch option const lbl = Variable(label()) microphone.connect("changed", () => lbl.value = label()) export const MicMute = () => SimpleToggleButton({ icon: ico.bind(), label: lbl.bind(), toggle: () => microphone.is_muted = !microphone.is_muted, connection: [microphone, () => microphone?.is_muted || false], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Network.ts ================================================ import { Menu, ArrowToggleButton } from "../ToggleButton" import icons from "lib/icons.js" import { dependencies, sh } from "lib/utils" import options from "options" const { wifi } = await Service.import("network") export const NetworkToggle = () => ArrowToggleButton({ name: "network", icon: wifi.bind("icon_name"), label: wifi.bind("ssid").as(ssid => ssid || "Not Connected"), connection: [wifi, () => wifi.enabled], deactivate: () => wifi.enabled = false, activate: () => { wifi.enabled = true wifi.scan() }, }) export const WifiSelection = () => Menu({ name: "network", icon: wifi.bind("icon_name"), title: "Wifi Selection", content: [ Widget.Box({ vertical: true, setup: self => self.hook(wifi, () => self.children = wifi.access_points.map(ap => Widget.Button({ on_clicked: () => { if (dependencies("nmcli")) Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`) }, child: Widget.Box({ children: [ Widget.Icon(ap.iconName), Widget.Label(ap.ssid || ""), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: "end", setup: self => Utils.idle(() => { if (!self.is_destroyed) self.visible = ap.active }), }), ], }), })), ), }), Widget.Separator(), Widget.Button({ on_clicked: () => sh(options.quicksettings.networkSettings.value), child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Network"), ], }), }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/quicksettings/widgets/Volume.ts ================================================ import type Gtk from "gi://Gtk?version=3.0" import { type Stream } from "types/service/audio" import { Arrow, Menu } from "../ToggleButton" import { dependencies, icon, sh } from "lib/utils" import icons from "lib/icons.js" const audio = await Service.import("audio") type Type = "microphone" | "speaker" const VolumeIndicator = (type: Type = "speaker") => Widget.Button({ vpack: "center", on_clicked: () => audio[type].is_muted = !audio[type].is_muted, child: Widget.Icon({ icon: audio[type].bind("icon_name") .as(i => icon(i || "", icons.audio.mic.high)), tooltipText: audio[type].bind("volume") .as(vol => `Volume: ${Math.floor(vol * 100)}%`), }), }) const VolumeSlider = (type: Type = "speaker") => Widget.Slider({ hexpand: true, draw_value: false, on_change: ({ value, dragging }) => dragging && (audio[type].volume = value), value: audio[type].bind("volume"), }) export const Volume = () => Widget.Box({ class_name: "volume", children: [ VolumeIndicator("speaker"), VolumeSlider("speaker"), Widget.Box({ vpack: "center", child: Arrow("sink-selector"), }), Widget.Box({ vpack: "center", child: Arrow("app-mixer"), visible: audio.bind("apps").as(a => a.length > 0), }), ], }) export const Microhone = () => Widget.Box({ class_name: "slider horizontal", visible: audio.bind("recorders").as(a => a.length > 0), children: [ VolumeIndicator("microphone"), VolumeSlider("microphone"), ], }) const MixerItem = (stream: Stream) => Widget.Box( { hexpand: true, class_name: "mixer-item horizontal", }, Widget.Icon({ tooltip_text: stream.bind("name").as(n => n || ""), icon: stream.bind("name").as(n => { return Utils.lookUpIcon(n || "") ? (n || "") : icons.fallback.audio }), }), Widget.Box( { vertical: true }, Widget.Label({ xalign: 0, truncate: "end", max_width_chars: 28, label: stream.bind("description").as(d => d || ""), }), Widget.Slider({ hexpand: true, draw_value: false, value: stream.bind("volume"), on_change: ({ value }) => stream.volume = value, }), ), ) const SinkItem = (stream: Stream) => Widget.Button({ hexpand: true, on_clicked: () => audio.speaker = stream, child: Widget.Box({ children: [ Widget.Icon({ icon: icon(stream.icon_name || "", icons.fallback.audio), tooltip_text: stream.icon_name || "", }), Widget.Label((stream.description || "").split(" ").slice(0, 4).join(" ")), Widget.Icon({ icon: icons.ui.tick, hexpand: true, hpack: "end", visible: audio.speaker.bind("stream").as(s => s === stream.stream), }), ], }), }) const SettingsButton = () => Widget.Button({ on_clicked: () => { if (dependencies("pavucontrol")) sh("pavucontrol") }, hexpand: true, child: Widget.Box({ children: [ Widget.Icon(icons.ui.settings), Widget.Label("Settings"), ], }), }) export const AppMixer = () => Menu({ name: "app-mixer", icon: icons.audio.mixer, title: "App Mixer", content: [ Widget.Box({ vertical: true, class_name: "vertical mixer-item-box", children: audio.bind("apps").as(a => a.map(MixerItem)), }), Widget.Separator(), SettingsButton(), ], }) export const SinkSelector = () => Menu({ name: "sink-selector", icon: icons.audio.type.headset, title: "Sink Selector", content: [ Widget.Box({ vertical: true, children: audio.bind("speakers").as(a => a.map(SinkItem)), }), Widget.Separator(), SettingsButton(), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/settings/Group.ts ================================================ import Row from "./Row" export default (title: string, ...rows: ReturnType>[]) => Widget.Box({ class_name: "group", vertical: true, children: [ Widget.Label({ hpack: "start", class_name: "group-title", label: title, setup: w => Utils.idle(() => w.visible = !!title), }), Widget.Box({ vertical: true, children: rows, }), ], }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/settings/Page.ts ================================================ import Group from "./Group" export default ( name: string, icon: string, ...groups: ReturnType>[] ) => Widget.Box({ class_name: "page", attribute: { name, icon }, child: Widget.Scrollable({ css: "min-height: 300px;", child: Widget.Box({ vexpand: true, vertical: true, children: groups, }), }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/settings/Row.ts ================================================ import { Opt } from "lib/option" import icons from "lib/icons" import Gtk from "types/@girs/gtk-3.0/gtk-3.0" import Gdk from "gi://Gdk" function EnumSetter(opt: Opt, values: string[]) { const lbl = Widget.Label({ label: opt.bind().as(v => `${v}`) }) const step = (dir: 1 | -1) => { const i = values.findIndex(i => i === lbl.label) opt.setValue(dir > 0 ? i + dir > values.length - 1 ? values[0] : values[i + dir] : i + dir < 0 ? values[values.length - 1] : values[i + dir], ) } const next = Widget.Button({ child: Widget.Icon(icons.ui.arrow.right), on_clicked: () => step(+1), }) const prev = Widget.Button({ child: Widget.Icon(icons.ui.arrow.left), on_clicked: () => step(-1), }) return Widget.Box({ class_name: "enum-setter", children: [lbl, prev, next], }) } type RowProps = { opt: Opt title: string note?: string type?: | "number" | "color" | "float" | "object" | "string" | "enum" | "boolean" | "img" | "font" enums?: string[] max?: number min?: number } function Setter({ opt, type = typeof opt.value as RowProps["type"], enums, max = 1000, min = 0, }: RowProps) { switch (type) { case "number": return Widget.SpinButton({ setup(self) { self.set_range(min, max) self.set_increments(1, 5) self.on("value-changed", () => opt.value = self.value as T) self.hook(opt, () => self.value = opt.value as number) }, }) case "float": case "object": return Widget.Entry({ on_accept: self => opt.value = JSON.parse(self.text || ""), setup: self => self.hook(opt, () => self.text = JSON.stringify(opt.value)), }) case "string": return Widget.Entry({ on_accept: self => opt.value = self.text as T, setup: self => self.hook(opt, () => self.text = opt.value as string), }) case "enum": return EnumSetter(opt as unknown as Opt, enums!) case "boolean": return Widget.Switch() .on("notify::active", self => opt.value = self.active as T) .hook(opt, self => self.active = opt.value as boolean) case "img": return Widget.FileChooserButton() .on("selection-changed", self => { opt.value = self.get_uri()?.replace("file://", "") as T }) case "font": return Widget.FontButton({ show_size: false, use_size: false, setup: self => self .on("notify::font", ({ font }) => opt.value = font as T) .hook(opt, () => self.font = opt.value as string), }) case "color": return Widget.ColorButton({ setup: self => self .hook(opt, () => { const rgba = new Gdk.RGBA() rgba.parse(opt.value as string) self.rgba = rgba }) .on("color-set", ({ rgba: { red, green, blue } }) => { const hex = (n: number) => { const c = Math.floor(255 * n).toString(16) return c.length === 1 ? `0${c}` : c } opt.value = `#${hex(red)}${hex(green)}${hex(blue)}` as T }), }) default: return Widget.Label({ label: `no setter with type ${type}`, }) } } export default (props: RowProps) => Widget.Box( { class_name: "row" }, Widget.Box( { vertical: true, vpack: "center" }, Widget.Label({ xalign: 0, class_name: "row-title", label: props.title, }), Widget.Label({ xalign: 0, class_name: "id", label: props.opt.id, }), ), Widget.Box({ hexpand: true }), Widget.Box( { vpack: "center" }, Setter(props), ), ) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/settings/SettingsDialog.ts ================================================ import Gtk from "gi://Gtk?version=3.0" import layout from "./layout" import icons from "lib/icons" import options from "options" const current = Variable(layout[0].attribute.name) const Header = () => Widget.CenterBox({ class_name: "header", start_widget: Widget.Button({ class_name: "reset", on_clicked: options.reset, hpack: "start", vpack: "start", child: Widget.Icon(icons.ui.refresh), tooltip_text: "Reset", }), center_widget: Widget.Box({ class_name: "pager horizontal", children: layout.map(({ attribute: { name, icon } }) => Widget.Button({ xalign: 0, class_name: current.bind().as(v => `${v === name ? "active" : ""}`), on_clicked: () => current.value = name, child: Widget.Box([ Widget.Icon(icon), Widget.Label(name), ]), })), }), end_widget: Widget.Button({ class_name: "close", hpack: "end", vpack: "start", child: Widget.Icon(icons.ui.close), on_clicked: () => App.closeWindow("settings-dialog"), }), }) const PagesStack = () => Widget.Stack({ transition: "slide_left_right", children: layout.reduce((obj, page) => ({ ...obj, [page.attribute.name]: page }), {}), shown: current.bind() as never, }) // eslint-disable-next-line max-len const RegularWindow = Widget.subclass(Gtk.Window) export default () => RegularWindow({ name: "settings-dialog", class_name: "settings-dialog", title: "Settings", setup(win) { win.on("delete-event", () => { win.hide() return true }) win.set_default_size(600, 500) }, child: Widget.Box({ vertical: true, children: [ Header(), PagesStack(), ], }), }) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/ags_ts_old/widget/settings/layout.ts ================================================ /* eslint-disable max-len */ import Row from "./Row" import Group from "./Group" import Page from "./Page" import options from "options" import icons from "lib/icons" const { wallpaper: wp, autotheme: at, font, theme, bar: b, applauncher: al, overview: ov, powermenu: pm, quicksettings: qs, osd, } = options const { dark, light, scheme, padding, spacing, radius, shadows, widget, border, } = theme export default [ Page("Theme", icons.ui.themes, Group("", Row({ opt: wp, title: "Wallpaper", type: "img" }), Row({ opt: at, title: "Auto Generate Color Scheme" }), Row({ opt: scheme, title: "Color Scheme", type: "enum", enums: ["dark", "light"] }), ), Group("Dark Colors", Row({ opt: dark.bg, title: "Background", type: "color" }), Row({ opt: dark.fg, title: "Foreground", type: "color" }), Row({ opt: dark.primary.bg, title: "Primary", type: "color" }), Row({ opt: dark.primary.fg, title: "On Primary", type: "color" }), Row({ opt: dark.error.bg, title: "Error", type: "color" }), Row({ opt: dark.error.fg, title: "On Error", type: "color" }), Row({ opt: dark.widget, title: "Widget", type: "color" }), Row({ opt: dark.border, title: "Border", type: "color" }), ), Group("Light Colors", Row({ opt: light.bg, title: "Background", type: "color" }), Row({ opt: light.fg, title: "Foreground", type: "color" }), Row({ opt: light.primary.bg, title: "Primary", type: "color" }), Row({ opt: light.primary.fg, title: "On Primary", type: "color" }), Row({ opt: light.error.bg, title: "Error", type: "color" }), Row({ opt: light.error.fg, title: "On Error", type: "color" }), Row({ opt: light.widget, title: "Widget", type: "color" }), Row({ opt: light.border, title: "Border", type: "color" }), ), Group("Theme", Row({ opt: shadows, title: "Shadows" }), Row({ opt: widget.opacity, title: "Widget Opacity" }), Row({ opt: border.opacity, title: "Border Opacity" }), Row({ opt: border.width, title: "Border Width" }), ), Group("UI", Row({ opt: padding, title: "Padding" }), Row({ opt: spacing, title: "Spacing" }), Row({ opt: radius, title: "Roundness" }), Row({ opt: font.size, title: "Font Size" }), Row({ opt: font.name, title: "Font Name", type: "font" }), ), ), Page("Bar", icons.ui.toolbars, Group("General", Row({ opt: b.flatButtons, title: "Flat Buttons" }), Row({ opt: b.position, title: "Position", type: "enum", enums: ["top", "bottom"] }), Row({ opt: b.corners, title: "Corners" }), Row({ opt: b.date.format, title: "Date Format" }), Row({ opt: b.workspaces.workspaces, title: "Number of Workspaces", note: "0 to make it dynamic" }), ), Group("Launcher", Row({ opt: b.launcher.icon.icon, title: "Icon" }), Row({ opt: b.launcher.icon.colored, title: "Colored Icon" }), Row({ opt: b.launcher.label.label, title: "Label" }), Row({ opt: b.launcher.label.colored, title: "Colored Label" }), ), Group("Battery", Row({ opt: b.battery.bar, title: "Style", type: "enum", enums: ["hidden", "regular", "whole"] }), Row({ opt: b.battery.blocks, title: "Number of Blocks" }), Row({ opt: b.battery.width, title: "Width of Bar" }), ), Group("Taskbar", Row({ opt: b.taskbar.monochrome, title: "Monochrome Icons" }), Row({ opt: b.taskbar.exclusive, title: "Exclusive to workspaces" }), ), Group("Media", Row({ opt: b.media.monochrome, title: "Monochrome Icons" }), Row({ opt: b.media.preferred, title: "Preferred Player" }), Row({ opt: b.media.direction, title: "Slide Direction" }), Row({ opt: b.media.length, title: "Max Length of Label" }), ), ), Page("General", icons.ui.settings, Group("Applauncher", Row({ opt: al.iconSize, title: "Icon Size" }), Row({ opt: al.width, title: "Width" }), Row({ opt: al.maxItem, title: "Max Items" }), ), Group("Overview", Row({ opt: ov.scale, title: "Scale", max: 100 }), Row({ opt: ov.workspaces, title: "workspaces", max: 11, note: "set this to 0 to make it dynamic" }), Row({ opt: ov.monochromeIcon, title: "Monochrome Icons" }), ), Group("Powermenu", Row({ opt: pm.layout, title: "Layout", type: "enum", enums: ["box", "line"] }), Row({ opt: pm.labels, title: "Show Labels" }), ), Group("Quicksettings", Row({ opt: qs.avatar.image, title: "Avatar", type: "img" }), Row({ opt: qs.avatar.size, title: "Avatar Size" }), Row({ opt: qs.media.monochromeIcon, title: "Media Monochrome Icons" }), Row({ opt: qs.media.coverSize, title: "Media Cover Art Size" }), ), Group("On Screen Indicator", Row({ opt: osd.progress.vertical, title: "Vertical" }), Row({ opt: osd.progress.pack.h, title: "Horizontal Alignment", type: "enum", enums: ["start", "center", "end"] }), Row({ opt: osd.progress.pack.v, title: "Vertical Alignment", type: "enum", enums: ["start", "center", "end"] }), ), ), ] as const ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/anyrun/stylesheet.css ================================================ * { } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/Autostart.conf ================================================ # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # # See https://wiki.hyprland.org/Configuring/Keywords/ for more # exec = ~/.config/hypr/scripts/launch_ags.sh exec = ~/.config/waybar/launch.sh exec = walker --gapplication-service exec-once = dbus-update-activation-environment --all exec = swayosd-libinput-backend # exec = swww-daemon exec = swayosd-server exec = sway-audio-idle-inhibit exec = ~/.config/screenlock/lock.sh exec = clipse -listen exec-once = nextcloud --background exec = /nix/store/$(ls -la /nix/store | grep 'mate-polkit' | grep '4096' | awk '{print $9}' | sed -n '$p')/libexec/polkit-mate-authentication-agent-1 & exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = nm-applet exec-once = wl-paste -p --watch clipman store -P --histpath="~/.local/share/clipman-primary.json" exec-once = wl-clip-persist --clipboard regular --read-timeout 50 --write-timeout 1000 exec-once = hyprctl setcursor Bibata-Modern-Classic 24 exec = hypridle ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/KeyBinds.conf ================================================ # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # KeyBinds # Apps bind = $mainMod , return , exec , kitty bind = $mainMod SHIFT , return , exec , kitty --title kitty_float bind = $mainMod , F , exec , nautilus #bind= $mainMod , B , exec , brave bind = $mainMod , B , exec , firefox bind = $mainMod , C , exec , neovide bind = CONTROL SHIFT , Escape , exec , missioncenter bind = , XF86Keyboard , exec , gnome-calculator bind = $mainMod , D , exec , vesktop bind = $mainMod , O , exec , obsidian # Shell bind = $mainMod , SPACE , exec , ~/.config/anyrun/launch.sh #bind = $mainMod , SPACE , exec , ~/.config/walker/launch.sh bind = $mainMod CONTROL , P , exec , wlogout -b 5 -c 0 -r 0 -T 0 -B 0 bind = $mainMod , R , exec , ~/.config/waybar/launch.sh bind = $mainMod Alt_L , N , exec , ~/.config/swaync/launch.sh bind = SUPER , V , exec, kitty --class floating -e zsh -c 'clipse' # NixOS bind = $mainMod Alt_L , R , exec , hyprctl reload # System bind = $mainMod , L , exec , hyprlock bind = $mainMod SHIFT , S , exec , grimblast --notify copysave area ~/Bilder/Screenshots/$(date +'Screenshot_%d-%m-%y_%H-%M.png') bind = , Print , exec , grimblast --notify copysave output ~/Bilder/Screenshots/$(date +'Screenshot_%d-%m-%y_%H-%M.png') bind = $mainMod Alt_L , M , exec , ~/.config/hypr/scripts/w2m.sh # Window management bind = $mainMod , Q , killactive , bind = $mainMod , T , togglefloating , bind = $mainMod , P , pseudo , # dwindle bind = $mainMod , J , togglesplit , # dwindle bind = ALT , Tab , cyclenext , bind = $mainMod , Tab , bringactivetotop , # Move focus with mainMod + arrow keys bind = $mainMod , left , movefocus, l bind = $mainMod , right , movefocus, r bind = $mainMod , up , movefocus, u bind = $mainMod , down , movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod , 1 , workspace , 1 bind = $mainMod , 2 , workspace , 2 bind = $mainMod , 3 , workspace , 3 bind = $mainMod , 4 , workspace , 4 bind = $mainMod , 5 , workspace , 5 bind = $mainMod , 6 , workspace , 6 bind = $mainMod , 7 , workspace , 7 bind = $mainMod , 8 , workspace , 8 bind = $mainMod , 9 , workspace , 9 bind = $mainMod , 0 , workspace , 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT , 1 , movetoworkspace , 1 bind = $mainMod SHIFT , 2 , movetoworkspace , 2 bind = $mainMod SHIFT , 3 , movetoworkspace , 3 bind = $mainMod SHIFT , 4 , movetoworkspace , 4 bind = $mainMod SHIFT , 5 , movetoworkspace , 5 bind = $mainMod SHIFT , 6 , movetoworkspace , 6 bind = $mainMod SHIFT , 7 , movetoworkspace , 7 bind = $mainMod SHIFT , 8 , movetoworkspace , 8 bind = $mainMod SHIFT , 9 , movetoworkspace , 9 bind = $mainMod SHIFT , 0 , movetoworkspace , 10 # Move active window in workspace bind = $mainMod ALT , left , movewindow, l bind = $mainMod ALT , right , movewindow, r bind = $mainMod ALT , up , movewindow, u bind = $mainMod ALT , down , movewindow, d # Mediacontrol with mediakeys bind = , XF86AudioPrev , exec , playerctl previous bind = , XF86AudioPlay , exec , playerctl play-pause bind = , XF86AudioNext , exec , playerctl next bindle = , XF86MonBrightnessUp , exec , swayosd-client --brightness=raise 5 bindle = , XF86MonBrightnessDown , exec , swayosd-client --brightness=lower 5 bindle = , XF86AudioRaiseVolume , exec , swayosd-client --output-volume 5 bindle = , XF86AudioLowerVolume , exec , swayosd-client --output-volume -5 bindle = , XF86AudioMicMute , exec , swayosd-client --input-volume mute-toggle bindle = , XF86AudioMute , exec , swayosd-client --output-volume mute-toggle # bindle = , XF86MonBrightnessUp , exec , brightnessctl set +5% # bindle = , XF86MonBrightnessDown , exec , brightnessctl set 5%- # bindle = , XF86AudioRaiseVolume , exec , pactl set-sink-volume @DEFAULT_SINK@ +5% # bindle = , XF86AudioLowerVolume , exec , pactl set-sink-volume @DEFAULT_SINK@ -5% # bindle = , XF86AudioMicMute , exec , pactl set-source-mute 70 toggle # bindle = , XF86AudioMute , exec , pactl set-sink-mute @DEFAULT_SINK@ toggle bind = , XF86Favorites , exec , brightnessctl -s && brightnessctl s 1 bind = , XF86Go , exec , brightnessctl -s && brightnessctl s 0 bind = , Cancel , exec , brightnessctl -r # Resize windows with mainMod CTRL + arrowkeys bind = $mainMod CONTROL , Right , resizeactive , 30 0 bind = $mainMod CONTROL , Left , resizeactive , -30 0 bind = $mainMod CONTROL , Up , resizeactive , 0 -30 bind = $mainMod CONTROL , Down , resizeactive , 0 30 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod , mouse:272 , movewindow bindm = $mainMod , mouse:273 , resizewindow # AGS # bind = $mainMod , SPACE , exec , ags toggle-window applauncher # bind = $mainMod SHIFT , S , exec , ags -r "recorder.start()" # bind = $mainMod CONTROL , P , exec , ags toggle-window powermenu # bind = $mainMod CONTROL , A , exec , ags toggle-window about # bind = $mainMod , R , exec , ~/.config/hypr/scripts/launch_ags.sh ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/Misc.conf ================================================ # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ general { allow_tearing = false } input { kb_layout = de kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 natural_scroll = false touchpad { natural_scroll = true scroll_factor = 0.15 tap-to-click = false tap_button_map = l clickfinger_behavior = true } } gestures { workspace_swipe = true workspace_swipe_fingers = 3 workspace_swipe_distance = 1000 workspace_swipe_min_speed_to_force = 5 workspace_swipe_use_r = true } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_is_master = true } # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more misc { vfr = true #vrr = 1 animate_manual_resizes = false focus_on_activate = false render_ahead_of_time = false disable_hyprland_logo = true focus_on_activate = true key_press_enables_dpms = true } debug { overlay = false } # Variables env = XCURSOR_THEME, Bibata-Modern-Classic env = XCURSOR_SIZE, 24 env = export TERM=kitty ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/WindowRules.conf ================================================ # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # windowrulev2 = float , class:(floating) windowrulev2 = size 60% 60% , class:(floating) windowrulev2 = float , title:(Preferences) windowrulev2 = center , title:(Preferences) windowrulev2 = float , title:(About) windowrulev2 = center , title:(About) windowrulev2 = float , class:(BLHeliSuite32xl) windowrulev2 = center , class:(BLHeliSuite32xl) windowrulev2 = float , class:(nm-connection-editor) windowrulev2 = center , class:(nm-connection-editor) windowrulev2 = float , class:(ExpressLRS Configurator) windowrulev2 = center , class:(ExpressLRS Configurator) windowrulev2 = float , class:(betaflight-configurator) windowrulev2 = center , class:(betaflight-configurator) windowrulev2 = size 80% 80% , class:(betaflight-configurator) windowrulev2 = float , class:(pavucontrol) windowrulev2 = float , class:(com.RoccoRakete.ThemeSwitcher) windowrulev2 = center , class:(com.RoccoRakete.ThemeSwitcher) windowrulev2 = float , class:(solaar) windowrulev2 = float , class:(org.gnome.World.PikaBackup) windowrulev2 = float , class:(missioncenter) windowrulev2 = size 70% 70% , class:(missioncenter) windowrulev2 = center , class:(missioncenter) windowrulev2 = float , class:(.blueman-manager-wrapped) windowrulev2 = size 70% 70% , class:(.blueman-manager-wrapped) windowrulev2 = center , class:(.blueman-manager-wrapped) windowrulev2 = float , class:(ags) windowrulev2 = size 70% 70% , class:(ags) windowrulev2 = center , class:(ags) windowrulev2 = float , class:(thunar) windowrulev2 = size 70% 70% , class:(thunar) windowrulev2 = center , class:(thunar) windowrulev2 = float , title:(kitty_float) windowrulev2 = size 70% 70% , title:(kitty_float) windowrulev2 = center , title:(kitty_float) windowrulev2 = float , class:(org.gnome.Nautilus) windowrulev2 = size 70% 70% , class:(org.gnome.Nautilus) windowrulev2 = center , class:(org.gnome.Nautilus) windowrulev2 = float , title:(Raspberry Pi Imager) windowrulev2 = size 70% 70% , title:(Raspberry Pi Imager) windowrulev2 = center , title:(Raspberry Pi Imager) windowrulev2 = float , title:(Open Folder) windowrulev2 = float , title:(Open File) windowrulev2 = center , class:(Open Folder) windowrulev2 = center , class:(Open File) windowrulev2 = float , class:(com.nextcloud.desktopclient.nextcloud) windowrulev2 = center , class:(com.nextcloud.desktopclient.nextcloud) windowrulev2 = float , class:(gthumb) windowrulev2 = size 70% 80% , class:(gthumb) windowrulev2 = center , class:(gthumb) windowrulev2 = float , class:(org.gnome.Loupe) windowrulev2 = size 70% 80% , class:(org.gnome.Loupe) windowrulev2 = center , class:(org.gnome.Loupe) windowrulev2 = float , class:(obsidian) windowrulev2 = size 70% 80% , class:(obsidian) windowrulev2 = center , class:(obsidian) windowrulev2 = float , class:(Bitwarden) windowrulev2 = size 70% 80% , class:(Bitwarden) windowrulev2 = center , class:(Bitwarden) windowrulev2 = float , class:(com.hunterwittenborn.Celeste) windowrulev2 = size 60% 70% , class:(com.hunterwittenborn.Celeste) windowrulev2 = center , class:(com.hunterwittenborn.Celeste) windowrulev2 = float , class:(celeste) windowrulev2 = size 50% 60% , class:(celeste) windowrulev2 = center , class:(celeste) windowrulev2 = float , class:(io.github.kaii_lb.Overskride) windowrulev2 = size 50% 60% , class:(io.github.kaii_lb.Overskride) windowrulev2 = center , class:(io.github.kaii_lb.Overskride) windowrulev2 = float , class:(org.gnome.Calculator) windowrulev2 = size 25% 60% , class:(org.gnome.Calculator) windowrulev2 = center , class:(org.gnome.Calculator) windowrulev2 = float , class:(rustdesk) # Games windowrulev2 = fakefullscreen , title:(NFS Underground 2) windowrulev2 = noborder , title:(NFS Underground 2) windowrulev2 = rounding 0 , title:(NFS Underground 2) windowrulev2 = fakefullscreen , title:(DIE SIEDLER - Das Erbe der Könige) windowrulev2 = center , title:(DIE SIEDLER - Das Erbe der Könige) windowrulev2 = noborder , title:(DIE SIEDLER - Das Erbe der Könige) windowrulev2 = rounding 0 , title:(DIE SIEDLER - Das Erbe der Könige) windowrulev2 = fakefullscreen , title:(Manor Lords) windowrulev2 = noborder , title:(Manor Lords) windowrulev2 = rounding 0 , title:(Manor Lords) windowrulev2 = fakefullscreen , title:(GTA: San Andreas) windowrulev2 = noborder , title:(GTA: San Andreas) windowrulev2 = rounding 0 , title:(GTA: San Andreas) windowrulev2 = fakefullscreen , title:(Fallout: New Vegas) windowrulev2 = noborder , title:(Fallout: New Vegas) windowrulev2 = rounding 0 , title:(Fallout: New Vegas) ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/hypridle.conf ================================================ general { ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) } listener { timeout = 300 on-timeout = ~/.config/hypr/scripts/brightness off on-resume = ~/.config/hypr/scripts/brightness on } listener { timeout = 600 on-timeout = hyprlock } listener { timeout = 900 on-timeout = systemctl suspend } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/hyprland.conf ================================================ # _ _ _ _ ____ __ _ # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # |___/|_| |___/ # # # Source files source = ~/.config/hypr/monitors.conf source = ~/.config/hypr/Autostart.conf source = ~/.config/hypr/Misc.conf source = ~/.config/hypr/KeyBinds.conf source = ~/.config/hypr/Decoration.conf source = ~/.config/hypr/WindowRules.conf plugin { hyprexpo { columns = 3 gap_size = 5 bg_col = rgb(111111) workspace_method = center current # [center/first] [workspace] e.g. first 1 or center m+1 enable_gesture = true # laptop touchpad, 4 fingers } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/hyprlock.conf ================================================ general { disable_loading_bar = true hide_cursor = true } background { # path = screenshot blur_passes = 3 blur_size = 3 brightness = 0.3 } label { monitor = text = cmd[update:1000] echo "$(date '+%A, %d. %B')" # text = cmd[update:1000] echo "$(date '+%A, %d %B')" color = rgba(250, 250, 250, 0.8) font_size = 16 font_family = Ubuntu Nerd Font Medium shadow_passes = 3 position = 0, -120 halign = center valign = top } label { monitor = text = cmd[update:1000] echo "$(date '+%H:%M')" font_size = 75 font_family = Ubuntu Nerd Font Bold shadow_passes = 3 position = 0, -135 halign = center valign = top } image { monitor = path = ~/face.png size = 130 # lesser side if not 1:1 ratio rounding = -1 # negative values mean circle border_size = 0 # border_color = rgb(221, 221, 221) rotate = 0 # degrees, counter-clockwise reload_time = -1 # seconds between reloading, 0 to reload with SIGUSR2 reload_cmd = position = 0, -50 halign = center valign = center } label { monitor = text = $USER font_size = 18 font_family = Ubuntu Nerd Font Medium shadow_passes = 3 position = 0, -150 halign = center valign = center } input-field { monitor = size = 260, 40 outline_thickness = 3 dots_size = 0.33 dots_spacing = 0.15 dots_center = true outer_color = rgba(000000) inner_color = rgba(200, 200, 200, 0.8) fade_on_empty = false placeholder_text = Enter Password hide_input = false shadow_passes = 3 rounding = 10 fail_color = rgb(FF0000) fail_transition = 300 position = 0, -210 halign = center valign = center } image { monitor = path = ~/Dokumente/Backgrounds/nixos.png size = 50 # lesser side if not 1:1 ratio rounding = -1 # negative values mean circle border_size = 0 # border_color = rgb(221, 221, 221) rotate = 0 # degrees, counter-clockwise reload_time = -1 # seconds between reloading, 0 to reload with SIGUSR2 reload_cmd = position = 0, 20 halign = center valign = bottom } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/monitors.conf ================================================ # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # monitor = eDP-1 , preferred , 320x1440 , 1 , monitor = HDMI-A-1 , 2560x1440@120.0 , 0x0 , 1.0 , vrr , 1 , bitdepth , 10 # Move active workspace to a monitor with mainMod + CTRL + (SHIFT) + [0-9] bind = $mainMod CTRL , 1 , moveworkspacetomonitor , 1 1 bind = $mainMod CTRL , 2 , moveworkspacetomonitor , 2 1 bind = $mainMod CTRL , 3 , moveworkspacetomonitor , 3 1 bind = $mainMod CTRL , 4 , moveworkspacetomonitor , 4 1 bind = $mainMod CTRL , 5 , moveworkspacetomonitor , 5 1 bind = $mainMod CTRL , 6 , moveworkspacetomonitor , 6 1 bind = $mainMod CTRL , 7 , moveworkspacetomonitor , 7 1 bind = $mainMod CTRL , 8 , moveworkspacetomonitor , 8 1 bind = $mainMod CTRL , 9 , moveworkspacetomonitor , 9 1 bind = $mainMod CTRL , 0 , moveworkspacetomonitor , 10 1 bind = $mainMod CTRL SHIFT , 1 , moveworkspacetomonitor , 1 0 bind = $mainMod CTRL SHIFT , 2 , moveworkspacetomonitor , 2 0 bind = $mainMod CTRL SHIFT , 3 , moveworkspacetomonitor , 3 0 bind = $mainMod CTRL SHIFT , 4 , moveworkspacetomonitor , 4 0 bind = $mainMod CTRL SHIFT , 5 , moveworkspacetomonitor , 5 0 bind = $mainMod CTRL SHIFT , 6 , moveworkspacetomonitor , 6 0 bind = $mainMod CTRL SHIFT , 7 , moveworkspacetomonitor , 7 0 bind = $mainMod CTRL SHIFT , 8 , moveworkspacetomonitor , 8 0 bind = $mainMod CTRL SHIFT , 9 , moveworkspacetomonitor , 9 0 bind = $mainMod CTRL SHIFT , 0 , moveworkspacetomonitor , 10 0 # bindl = , switch:on:Lid Switch , exec , hyprctl reload bindl = , switch:on:Lid Switch , exec , ~/.config/hypr/scripts/monitor_attached.sh #bindl = , switch:on:Lid Switch , exec , ~/.dots/nixos/hosts/laptop/home-dotfiles-laptop/screenlock/lock.sh # bindl = , switch:off:Lid Switch , exec , hyprctl reload bindl = , switch:off:Lid Switch , exec , ~/.config/hypr/scripts/monitor_dettached.sh ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/presets/monitors.exampleconf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = DP-1 , 2560x1440@120.0 , 0x0 , 1.0 #monitor = HDMI-A-2 , 1920x1080@120.0 , 0x-1080 , 1.0 ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/presets/monitors_external.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = eDP-1 , 1920x1080@60.0 , 0x0 , 1.0 monitor = HDMI-A-2 , 1920x1080@120.0 , 0x-1080 , 1.0 workspace = HDMI-A-2 , 0 , persistent:true workspace = HDMI-A-2 , 1 , persistent:true workspace = HDMI-A-2 , 2 , persistent:true workspace = HDMI-A-2 , 3 , persistent:true workspace = HDMI-A-2 , 4 , persistent:true workspace = HDMI-A-2 , 5 , persistent:true workspace = HDMI-A-2 , 6 , persistent:true workspace = HDMI-A-2 , 7 , persistent:true workspace = HDMI-A-2 , 8 , persistent:true workspace = HDMI-A-2 , 9 , persistent:true workspace = eDP-1 , 10 , persistent:true workspace = eDP-1 , 11 , persistent:true workspace = eDP-1 , 12 , persistent:true workspace = eDP-1 , 13 , persistent:true workspace = eDP-1 , 14 , persistent:true workspace = eDP-1 , 15 , persistent:true workspace = eDP-1 , 16 , persistent:true workspace = eDP-1 , 17 , persistent:true workspace = eDP-1 , 18 , persistent:true workspace = eDP-1 , 19 , persistent:true # Switch workspaces with mainMod + [0-9] bind = $mainMod CTRL , 1 , workspace , 11 bind = $mainMod CTRL , 2 , workspace , 12 bind = $mainMod CTRL , 3 , workspace , 13 bind = $mainMod CTRL , 4 , workspace , 14 bind = $mainMod CTRL , 5 , workspace , 15 bind = $mainMod CTRL , 6 , workspace , 16 bind = $mainMod CTRL , 7 , workspace , 17 bind = $mainMod CTRL , 8 , workspace , 18 bind = $mainMod CTRL , 9 , workspace , 19 bind = $mainMod CTRL , 0 , workspace , 20 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod CTRL SHIFT , 1 , movetoworkspace , 11 bind = $mainMod CTRL SHIFT , 2 , movetoworkspace , 12 bind = $mainMod CTRL SHIFT , 3 , movetoworkspace , 13 bind = $mainMod CTRL SHIFT , 4 , movetoworkspace , 14 bind = $mainMod CTRL SHIFT , 5 , movetoworkspace , 15 bind = $mainMod CTRL SHIFT , 6 , movetoworkspace , 16 bind = $mainMod CTRL SHIFT , 7 , movetoworkspace , 17 bind = $mainMod CTRL SHIFT , 8 , movetoworkspace , 18 bind = $mainMod CTRL SHIFT , 9 , movetoworkspace , 19 bind = $mainMod CTRL SHIFT , 0 , movetoworkspace , 20 exec = hyprctl dispatch focusmonitor 1 bindl = , switch:Lid Switch , exec , ~/.dots/ags/launch.sh #monitor = eDP-1, disable ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/presets/monitors_internal.conf ================================================ ################################################################################# # _ _ _ _ ____ __ _ # # | | | |_ _ _ __ _ __| | __ _ _ __ __| | / ___|___ _ __ / _(_) __ _ # # | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | | | / _ \| '_ \| |_| |/ _` | # # | _ | |_| | |_) | | | | (_| | | | | (_| | | |__| (_) | | | | _| | (_| | # # |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| \____\___/|_| |_|_| |_|\__, | # # |___/|_| |___/ # # # ################################################################################# monitor = eDP-1 , 1920x1080@60.0 , 0x0 , 1.0 workspace = eDP-1 , 0 , persistent:true workspace = eDP-1 , 1 , persistent:true workspace = eDP-1 , 2 , persistent:true workspace = eDP-1 , 3 , persistent:true workspace = eDP-1 , 4 , persistent:true workspace = eDP-1 , 5 , persistent:true workspace = eDP-1 , 6 , persistent:true workspace = eDP-1 , 7 , persistent:true workspace = eDP-1 , 8 , persistent:true workspace = eDP-1 , 9 , persistent:true # lock screen if lid is closed bindl = , switch:Lid Switch , exec , gtklock ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/brightness ================================================ #!/bin/sh previous_brightness=$(brightnessctl g) case $1 in off) brightnessctl -s -q previous_brightness=$(brightnessctl g) current_brightness=$previous_brightness while [ "$current_brightness" -gt 1 ]; do current_brightness=$((current_brightness - 1200)) brightnessctl s -q $current_brightness sleep 0.03 done ;; on) brightnessctl -r -q ;; esac ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/launch_ags.sh ================================================ #!/usr/bin/env zsh pkill ags # Launch ags echo "---" | tee -a /tmp/ags.log ags 2>&1 | tee -a /tmp/ags.log & disown echo "shell launched..." ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/logoutlaunch.sh ================================================ #!/usr/bin/env sh # set variables wLayout="$HOME/.config/wlogout/layout_$1" wlTmplt="$HOME/.config/wlogout/style_$1.css" # set font size fntSize=`gsettings get org.gnome.desktop.interface font-name | sed "s/'//g" | awk '{print $2}'` export fntSize=$(( fntSize * 2 )) # set scaling as per monitor res res=`cat /sys/class/drm/*/modes | head -1 | cut -d 'x' -f 2` case $1 in 1) wlColms=1 export mgn=$(( res * 10 / 100 )) export hvr=$(( res * 5 / 100 )) ;; 2) wlColms=5 export mgn=$(( res * 8 / 100 )) export mgn2=$(( res * 65 / 100 )) export hvr=$(( res * 3 / 100 )) export hvr2=$(( res * 60 / 100 )) ;; *) echo "Error: invalid parameter passed..." exit 1 ;; esac # eval config files wlStyle=`envsubst < $wlTmplt` # launch wlogout wlogout -b $wlColms -c 0 -r 0 --layout $wLayout --css <(echo "$wlStyle") --protocol layer-shell ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/monitor_attached.sh ================================================ #!/bin/sh hyprctl keyword monitor "eDP-1 , preferred , auto , 1 , mirror , HDMI-A-1" hyprctl dispatch moveworkspacetomonitor 1 1 hyprctl dispatch moveworkspacetomonitor 2 1 hyprctl dispatch moveworkspacetomonitor 3 1 hyprctl dispatch moveworkspacetomonitor 4 1 hyprctl dispatch moveworkspacetomonitor 5 1 hyprctl dispatch moveworkspacetomonitor 6 1 hyprctl dispatch moveworkspacetomonitor 7 1 hyprctl dispatch moveworkspacetomonitor 8 1 hyprctl dispatch moveworkspacetomonitor 9 1 hyprctl dispatch moveworkspacetomonitor 10 1 ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/monitor_dettached.sh ================================================ #!/bin/sh hyprctl keyword monitor "eDP-1 , preferred , 320x1440 , 1 ," #hyprctl dispatch moveworkspacetomonitor 1 0 #hyprctl dispatch moveworkspacetomonitor 2 0 #hyprctl dispatch moveworkspacetomonitor 3 0 #hyprctl dispatch moveworkspacetomonitor 4 0 #hyprctl dispatch moveworkspacetomonitor 5 0 #hyprctl dispatch moveworkspacetomonitor 6 0 #hyprctl dispatch moveworkspacetomonitor 7 0 #hyprctl dispatch moveworkspacetomonitor 8 0 #hyprctl dispatch moveworkspacetomonitor 9 0 #hyprctl dispatch moveworkspacetomonitor 10 0 ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/hypr/scripts/w2m.sh ================================================ #!/bin/sh hyprctl dispatch moveworkspacetomonitor 1 1 hyprctl dispatch moveworkspacetomonitor 2 1 hyprctl dispatch moveworkspacetomonitor 3 1 hyprctl dispatch moveworkspacetomonitor 4 1 hyprctl dispatch moveworkspacetomonitor 5 1 hyprctl dispatch moveworkspacetomonitor 6 1 hyprctl dispatch moveworkspacetomonitor 7 1 hyprctl dispatch moveworkspacetomonitor 8 1 hyprctl dispatch moveworkspacetomonitor 9 1 hyprctl dispatch moveworkspacetomonitor 10 1 ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/neofetch/ascii.txt ================================================ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/ ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/neofetch/config.conf ================================================ print_info() { prin "" prin "$(color 6)󰌢 ""ThinkPad T14 G3" info underline info "$(color 7)╭"$(color 1)"󰣇 " distro info "$(color 7)├"$(color 2)" " kernel info "$(color 7)├"$(color 3)" " uptime info "$(color 7)├"$(color 5)" " de info "$(color 7)├"$(color 4)" " packages info "$(color 7)├"$(color 6)"󰞱 " cpu info "$(color 7)╰"$(color 2)"󰍛 " memory prin "" prin "$(color 3)󰮯 $(color 2) $(color 1) $(color 4) $(color 5) $(color 6) $(color 7)󰊠" #prin "" prin "$(color 3)Hi$(color 7), $(color 2)M$(color 1)o$(color 4)m $(color 5)=$(color 6)) " } # Title # Hide/Show Fully qualified domain name. # # Default: 'off' # Values: 'on', 'off' # Flag: --title_fqdn title_fqdn="off" # Kernel # Shorten the output of the kernel function. # # Default: 'on' # Values: 'on', 'off' # Flag: --kernel_shorthand # Supports: Everything except *BSDs (except PacBSD and PC-BSD) # # Example: # on: '4.8.9-1-ARCH' # off: 'Linux 4.8.9-1-ARCH' kernel_shorthand="on" # Distro # Shorten the output of the distro function # # Default: 'off' # Values: 'on', 'tiny', 'off' # Flag: --distro_shorthand # Supports: Everything except Windows and Haiku distro_shorthand="on" # Show/Hide OS Architecture. # Show 'x86_64', 'x86' and etc in 'Distro:' output. # # Default: 'on' # Values: 'on', 'off' # Flag: --os_arch # # Example: # on: 'Arch Linux x86_64' # off: 'Arch Linux' os_arch="off" # Uptime # Shorten the output of the uptime function # # Default: 'on' # Values: 'on', 'tiny', 'off' # Flag: --uptime_shorthand # # Example: # on: '2 days, 10 hours, 3 mins' # tiny: '2d 10h 3m' # off: '2 days, 10 hours, 3 minutes' uptime_shorthand="on" # Memory # Show memory pecentage in output. # # Default: 'off' # Values: 'on', 'off' # Flag: --memory_percent # # Example: # on: '1801MiB / 7881MiB (22%)' # off: '1801MiB / 7881MiB' memory_percent="off" # Change memory output unit. # # Default: 'mib' # Values: 'kib', 'mib', 'gib' # Flag: --memory_unit # # Example: # kib '1020928KiB / 7117824KiB' # mib '1042MiB / 6951MiB' # gib: ' 0.98GiB / 6.79GiB' memory_unit="gib" # Packages # Show/Hide Package Manager names. # # Default: 'tiny' # Values: 'on', 'tiny' 'off' # Flag: --package_managers # # Example: # on: '998 (pacman), 8 (flatpak), 4 (snap)' # tiny: '908 (pacman, flatpak, snap)' # off: '908' package_managers="off" # Shell # Show the path to $SHELL # # Default: 'off' # Values: 'on', 'off' # Flag: --shell_path # # Example: # on: '/bin/bash' # off: 'bash' shell_path="off" # Show $SHELL version # # Default: 'on' # Values: 'on', 'off' # Flag: --shell_version # # Example: # on: 'bash 4.4.5' # off: 'bash' shell_version="on" # CPU # CPU speed type # # Default: 'bios_limit' # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. # Flag: --speed_type # Supports: Linux with 'cpufreq' # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. speed_type="bios_limit" # CPU speed shorthand # # Default: 'off' # Values: 'on', 'off'. # Flag: --speed_shorthand # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz # # Example: # on: 'i7-6500U (4) @ 3.1GHz' # off: 'i7-6500U (4) @ 3.100GHz' speed_shorthand="on" # Enable/Disable CPU brand in output. # # Default: 'on' # Values: 'on', 'off' # Flag: --cpu_brand # # Example: # on: 'Intel i7-6500U' # off: 'i7-6500U (4)' cpu_brand="off" # CPU Speed # Hide/Show CPU speed. # # Default: 'on' # Values: 'on', 'off' # Flag: --cpu_speed # # Example: # on: 'Intel i7-6500U (4) @ 3.1GHz' # off: 'Intel i7-6500U (4)' cpu_speed="off" # CPU Cores # Display CPU cores in output # # Default: 'logical' # Values: 'logical', 'physical', 'off' # Flag: --cpu_cores # Support: 'physical' doesn't work on BSD. # # Example: # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) # off: 'Intel i7-6500U @ 3.1GHz' cpu_cores="off" # CPU Temperature # Hide/Show CPU temperature. # Note the temperature is added to the regular CPU function. # # Default: 'off' # Values: 'C', 'F', 'off' # Flag: --cpu_temp # Supports: Linux, BSD # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable # coretemp kernel module. This only supports newer Intel processors. # # Example: # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' # off: 'Intel i7-6500U (4) @ 3.1GHz' cpu_temp="off" # GPU # Enable/Disable GPU Brand # # Default: 'on' # Values: 'on', 'off' # Flag: --gpu_brand # # Example: # on: 'AMD HD 7950' # off: 'HD 7950' gpu_brand="on" # Which GPU to display # # Default: 'all' # Values: 'all', 'dedicated', 'integrated' # Flag: --gpu_type # Supports: Linux # # Example: # all: # GPU1: AMD HD 7950 # GPU2: Intel Integrated Graphics # # dedicated: # GPU1: AMD HD 7950 # # integrated: # GPU1: Intel Integrated Graphics gpu_type="dedicated" # Resolution # Display refresh rate next to each monitor # Default: 'off' # Values: 'on', 'off' # Flag: --refresh_rate # Supports: Doesn't work on Windows. # # Example: # on: '1920x1080 @ 60Hz' # off: '1920x1080' refresh_rate="off" # Gtk Theme / Icons / Font # Shorten output of GTK Theme / Icons / Font # # Default: 'off' # Values: 'on', 'off' # Flag: --gtk_shorthand # # Example: # on: 'Numix, Adwaita' # off: 'Numix [GTK2], Adwaita [GTK3]' gtk_shorthand="off" # Enable/Disable gtk2 Theme / Icons / Font # # Default: 'on' # Values: 'on', 'off' # Flag: --gtk2 # # Example: # on: 'Numix [GTK2], Adwaita [GTK3]' # off: 'Adwaita [GTK3]' gtk2="on" # Enable/Disable gtk3 Theme / Icons / Font # # Default: 'on' # Values: 'on', 'off' # Flag: --gtk3 # # Example: # on: 'Numix [GTK2], Adwaita [GTK3]' # off: 'Numix [GTK2]' gtk3="on" # IP Address # Website to ping for the public IP # # Default: 'http://ident.me' # Values: 'url' # Flag: --ip_host public_ip_host="http://ident.me" # Public IP timeout. # # Default: '2' # Values: 'int' # Flag: --ip_timeout public_ip_timeout=2 # Desktop Environment # Show Desktop Environment version # # Default: 'on' # Values: 'on', 'off' # Flag: --de_version de_version="on" # Disk # Which disks to display. # The values can be any /dev/sdXX, mount point or directory. # NOTE: By default we only show the disk info for '/'. # # Default: '/' # Values: '/', '/dev/sdXX', '/path/to/drive'. # Flag: --disk_show # # Example: # disk_show=('/' '/dev/sdb1'): # 'Disk (/): 74G / 118G (66%)' # 'Disk (/mnt/Videos): 823G / 893G (93%)' # # disk_show=('/'): # 'Disk (/): 74G / 118G (66%)' # disk_show=('/') # Disk subtitle. # What to append to the Disk subtitle. # # Default: 'mount' # Values: 'mount', 'name', 'dir', 'none' # Flag: --disk_subtitle # # Example: # name: 'Disk (/dev/sda1): 74G / 118G (66%)' # 'Disk (/dev/sdb2): 74G / 118G (66%)' # # mount: 'Disk (/): 74G / 118G (66%)' # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' # 'Disk (/mnt/Videos): 74G / 118G (66%)' # # dir: 'Disk (/): 74G / 118G (66%)' # 'Disk (Local Disk): 74G / 118G (66%)' # 'Disk (Videos): 74G / 118G (66%)' # # none: 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' # 'Disk: 74G / 118G (66%)' disk_subtitle="mount" # Disk percent. # Show/Hide disk percent. # # Default: 'on' # Values: 'on', 'off' # Flag: --disk_percent # # Example: # on: 'Disk (/): 74G / 118G (66%)' # off: 'Disk (/): 74G / 118G' disk_percent="on" # Song # Manually specify a music player. # # Default: 'auto' # Values: 'auto', 'player-name' # Flag: --music_player # # Available values for 'player-name': # # amarok # audacious # banshee # bluemindo # clementine # cmus # deadbeef # deepin-music # dragon # elisa # exaile # gnome-music # gmusicbrowser # gogglesmm # guayadeque # io.elementary.music # iTunes # juk # lollypop # mocp # mopidy # mpd # muine # netease-cloud-music # olivia # playerctl # pogo # pragha # qmmp # quodlibet # rhythmbox # sayonara # smplayer # spotify # strawberry # tauonmb # tomahawk # vlc # xmms2d # xnoise # yarock music_player="mpd" # Format to display song information. # # Default: '%artist% - %album% - %title%' # Values: '%artist%', '%album%', '%title%' # Flag: --song_format # # Example: # default: 'Song: Jet - Get Born - Sgt Major' song_format="%artist% - %album% - %title%" # Print the Artist, Album and Title on separate lines # # Default: 'off' # Values: 'on', 'off' # Flag: --song_shorthand # # Example: # on: 'Artist: The Fratellis' # 'Album: Costello Music' # 'Song: Chelsea Dagger' # # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' song_shorthand="off" # 'mpc' arguments (specify a host, password etc). # # Default: '' # Example: mpc_args=(-h HOST -P PASSWORD) mpc_args=() # Text Colors # Text Colors # # Default: 'distro' # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' # Flag: --colors # # Each number represents a different part of the text in # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' # # Example: # colors=(distro) - Text is colored based on Distro colors. # colors=(4 6 1 8 8 6) - Text is colored in the order above. colors=(distro) # Text Options # Toggle bold text # # Default: 'on' # Values: 'on', 'off' # Flag: --bold bold="on" # Enable/Disable Underline # # Default: 'on' # Values: 'on', 'off' # Flag: --underline underline_enabled="on" # Underline character # # Default: '-' # Values: 'string' # Flag: --underline_char underline_char="-" # Info Separator # Replace the default separator with the specified string. # # Default: ':' # Flag: --separator # # Example: # separator="->": 'Shell-> bash' # separator=" =": 'WM = dwm' separator="󰇙" # Color Blocks # Color block range # The range of colors to print. # # Default: '0', '15' # Values: 'num' # Flag: --block_range # # Example: # # Display colors 0-7 in the blocks. (8 colors) # neofetch --block_range 0 7 # # Display colors 0-15 in the blocks. (16 colors) # neofetch --block_range 0 15 block_range=(0 15) # Toggle color blocks # # Default: 'on' # Values: 'on', 'off' # Flag: --color_blocks color_blocks="on" # Color block width in spaces # # Default: '3' # Values: 'num' # Flag: --block_width block_width=3 # Color block height in lines # # Default: '1' # Values: 'num' # Flag: --block_height block_height=1 # Color Alignment # # Default: 'auto' # Values: 'auto', 'num' # Flag: --col_offset # # Number specifies how far from the left side of the terminal (in spaces) to # begin printing the columns, in case you want to e.g. center them under your # text. # Example: # col_offset="auto" - Default behavior of neofetch # col_offset=7 - Leave 7 spaces then print the colors col_offset="auto" # Progress Bars # Bar characters # # Default: '-', '=' # Values: 'string', 'string' # Flag: --bar_char # # Example: # neofetch --bar_char 'elapsed' 'total' # neofetch --bar_char '-' '=' bar_char_elapsed="-" bar_char_total="=" # Toggle Bar border # # Default: 'on' # Values: 'on', 'off' # Flag: --bar_border bar_border="on" # Progress bar length in spaces # Number of chars long to make the progress bars. # # Default: '15' # Values: 'num' # Flag: --bar_length bar_length=15 # Progress bar colors # When set to distro, uses your distro's logo colors. # # Default: 'distro', 'distro' # Values: 'distro', 'num' # Flag: --bar_colors # # Example: # neofetch --bar_colors 3 4 # neofetch --bar_colors distro 5 bar_color_elapsed="distro" bar_color_total="distro" # Info display # Display a bar with the info. # # Default: 'off' # Values: 'bar', 'infobar', 'barinfo', 'off' # Flags: --cpu_display # --memory_display # --battery_display # --disk_display # # Example: # bar: '[---=======]' # infobar: 'info [---=======]' # barinfo: '[---=======] info' # off: 'info' cpu_display="off" memory_display="off" battery_display="off" disk_display="off" # Backend Settings # Image backend. # # Default: 'ascii' # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # Flag: --backend image_backend="kitty" # Image Source # # Which image or ascii file to display. # # Default: 'auto' # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' # Flag: --source # # NOTE: 'auto' will pick the best image source for whatever image backend is used. # In ascii mode, distro ascii art will be used and in an image mode, your # wallpaper will be used. image_source="$HOME/.dots/nixos/hosts/laptop/home-dotfiles-laptop/ags/assets/nixos.png" # Ascii Options # Ascii distro # Which distro's ascii art to display. # # Default: 'auto' # Values: 'auto', 'distro_name' # Flag: --ascii_distro # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", # "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, # ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, # Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, # DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, # FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, # gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, # NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, # OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, # Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, # popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, # Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, # Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, # Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, # SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, # openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, # Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, # Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, # and IRIX have ascii logos # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. # Use '{distro name}_old' to use the old logos. # NOTE: Ubuntu has flavor variants. # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, # postmarketOS, and Void have a smaller logo variant. # Use '{distro name}_small' to use the small variants. ascii_distro="arch_small" # Ascii Colors # # Default: 'distro' # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' # Flag: --ascii_colors # # Example: # ascii_colors=(distro) - Ascii is colored based on Distro colors. # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. ascii_colors=(distro) # Bold ascii logo # Whether or not to bold the ascii logo. # # Default: 'on' # Values: 'on', 'off' # Flag: --ascii_bold ascii_bold="on" # Image Options # Image loop # Setting this to on will make neofetch redraw the image constantly until # Ctrl+C is pressed. This fixes display issues in some terminal emulators. # # Default: 'off' # Values: 'on', 'off' # Flag: --loop image_loop="off" # Thumbnail directory # # Default: '~/.cache/thumbnails/neofetch' # Values: 'dir' thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" # Crop mode # # Default: 'normal' # Values: 'normal', 'fit', 'fill' # Flag: --crop_mode # # See this wiki page to learn about the fit and fill options. # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F crop_mode="fit" # Crop offset # Note: Only affects 'normal' crop mode. # # Default: 'center' # Values: 'northwest', 'north', 'northeast', 'west', 'center' # 'east', 'southwest', 'south', 'southeast' # Flag: --crop_offset crop_offset="center" # Image size # The image is half the terminal width by default. # # Default: 'auto' # Values: 'auto', '00px', '00%', 'none' # Flags: --image_size # --size image_size="350px" # Gap between image and text # # Default: '3' # Values: 'num', '-num' # Flag: --gap gap=1 # Image offsets # Only works with the w3m backend. # # Default: '0' # Values: 'px' # Flags: --xoffset # --yoffset yoffset=0 xoffset=0 # Image background color # Only works with the w3m backend. # # Default: '' # Values: 'color', 'blue' # Flag: --b ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/screenlock/lock.sh ================================================ #!/usr/bin/env sh # Path to config file CONFIG_FILE=~/.config/screenlock/lock_config.conf # read config file source "$CONFIG_FILE" # Initialize error count errors=0 # check if config file input of "LID_STATUS" is valid if [ ! -f "$LID_STATUS" ]; then echo "LID_STATUS file does not exist or is not readable." ((errors++)) fi # check if config file input of "EXTERNAL_MONITOR_STATUS" is valid if [ ! -f "$EXTERNAL_MONITOR_STATUS" ]; then echo "EXTERNAL_MONITOR_STATUS file does not exist or is not readable." ((errors++)) fi # check if config file input of "LID_CLOSED_CONDITION" is valid if [ "$LID_CLOSED_CONDITION" != "closed" ] && [ "$LID_CLOSED_CONDITION" != "open" ]; then echo "LID_CLOSED_CONDITION must be either 'closed' or 'open'." ((errors++)) fi # check if config file input of "EXTERNAL_MONITOR_CONDITION" is valid if [ "$EXTERNAL_MONITOR_CONDITION" != "disconnected" ] && [ "$EXTERNAL_MONITOR_CONDITION" != "connected" ]; then echo "EXTERNAL_MONITOR_CONDITION must be either 'disconnected' or 'connected'." ((errors++)) fi # check if config file input of "LOCK_COMMAND" is valid #if ! command -v "$LOCK_COMMAND" &> /dev/null; then # echo "Screenlocker '$LOCK_COMMAND' is not installed or not in PATH." # ((errors++)) #fi # Output status if [ $errors != 0 ]; then echo "There are $errors errors in the configuration. Please correct them before running the script." exit 1 fi while true; do # check conditions if [[ $(cat "$LID_STATUS") == *"$LID_CLOSED_CONDITION"* && $(cat "$EXTERNAL_MONITOR_STATUS") == *"$EXTERNAL_MONITOR_CONDITION"* ]]; then # execute screenlocker $LOCK_COMMAND $LOCK_COMMAND_PARAMS fi sleep 1 done ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/screenlock/lock_config.conf ================================================ # Config file for screenlocker # path to lid status file LID_STATUS="/proc/acpi/button/lid/LID/state" # lid closed status (output of i.e.: "/proc/acpi/button/lid/LID/state") LID_CLOSED_CONDITION="closed" # path to external monitor status file EXTERNAL_MONITOR_STATUS="/sys/class/drm/card1-HDMI-A-1/status" # external monitor connection status (output of i.e.: "/sys/class/drm/card0-HDMI-A-1/status") EXTERNAL_MONITOR_CONDITION="disconnected" # command of the screenlocker to be executed LOCK_COMMAND="hyprlock" # additional parameters for the screenlocker command LOCK_COMMAND_PARAMS="" ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/screenlock/lock_screen.sh ================================================ #!/usr/bin/env zsh if [ ! -d "/tmp/hypr/latest_screenshot" ]; then mkdir -p /tmp/hypr/latest_screenshot else echo "Directory /tmp/hypr/latest_screenshot already exists... continue" fi playerctl pause grimblast save output /tmp/hypr/latest_screenshot/latest.png && convert /tmp/hypr/latest_screenshot/latest.png -blur 0x3 -brightness-contrast -5x0 /tmp/hypr/latest_screenshot/latest_blur.png && swaylock -f && ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/waybar/config.jsonc ================================================ { "spacing": 0, //"margin-left": 10, //"margin-right": 10, //"margin-top": 10, "margin-left": 0, "margin-right": 0, "margin-top": 0, "layer": "top", "reload_style_on_change": true, "modules-left": [ "image", "hyprland/workspaces" ], "modules-center": [ "clock" ], "modules-right": [ "cpu", "memory", "temperature", "backlight", "battery", "tray", "network", "bluetooth", "pulseaudio", "custom/notification", "custom/power" ], "image": { "path": "/home/martin/Dokumente/Backgrounds/nixos.png", "size": 20, "interval": 86400, // once every day "on-click": "mpc toggle" }, "hyprland/workspaces": { "format": "{icon}", "tooltip": false, "all-outputs": false, "current-only": true, "sort-by-number": true, "persistent-workspaces": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "" }, "format-icons": { "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "10": "", "active": "", "default": "" } }, "clock": { "format": "{:%H:%M}", "tooltip-format": "{:%Y %B}\n{calendar}", "format-alt": "{:%d.%m.%y - %H:%M}" }, "cpu": { "format": "{icon}", "format-icons": [ "󰝦", "󰪞", "󰪟", "󰪠", "󰪡", "󰪢", "󰪣", "󰪤", "󰪥" ], "tooltip": false, "interval": 1 }, "memory": { "tooltip": false, "format": "󰆼{used:.1f} GiB" }, "temperature": { "tooltip": false, "thermal-zone": 6, "critical-threshold": 90, "format": "{temperatureC}°C", "interval": 1 }, "backlight": { "tooltip": false, "format": "{icon}{percent}%", "format-icons": [ "", "", "", "", "", "", "", "", "" ] }, "battery": { "states": { "warning": 30, "critical": 15 }, "format": "{icon}", "format-full": "󱐥", "format-charging": "󱐋{capacity}%", "format-plugged": "󱐋{capacity}%", "format-alt": "{icon} {capacity}%", "format-icons": [ " ", " ", " ", " ", " " ], "interval": 1 }, "tray": { "spacing": 6 }, "network": { "format-wifi": "", "format-ethernet": "󰈀", "tooltip-format": "{ifname} ({ipaddr}) via {gwaddr} at\n{essid}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "󰖪", "on-click": "swaync-client -t -sw" }, "bluetooth": { "format": "", "format-disabled": "󰂲", "format-connected": "󰂱", "tooltip-format": "{controller_alias}\t{controller_address}", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "on-click": "swaync-client -t -sw" }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{icon} {format_source}", "format-bluetooth": "{icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": "󰸈 {format_source}", "format-source": "", "format-source-muted": "", "format-icons": { "headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", "default": [ "", "", "" ] }, "on-click": "swaync-client -t -sw", "on-click-right": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "󰂟", "none": "", "dnd-notification": "󰺁", "dnd-none": "", "inhibited-notification": "󰂟", "inhibited-none": "", "dnd-inhibited-notification": "󰺁", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", "on-click": "swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true }, "custom/power": { "format": "", "on-click": "wlogout -b 5 -c 0 -r 0 -T 0 -B 0", "interval": 86400, // once every day "tooltip": true } } ================================================ FILE: nixos/hosts/laptop/home-dotfiles-laptop/waybar/launch.sh ================================================ #!/usr/bin/env sh is_swww_daemon_running() { if pgrep -x "swww-daemon" > /dev/null then return 0 else exec swww-daemon & return 1 fi } # wait for the swww-daemon while ! is_swww_daemon_running; do echo "wait for swww-daemon" sleep 1 done swww img ~/.config/backgrounds/minimal_landscape.jpg pkill waybar sassc $HOME/.config/waybar/themes/style-catppuccin-mocha.scss $HOME/.config/waybar/style.css waybar ================================================ FILE: nixos/hosts/laptop/home-laptop.nix ================================================ { inputs, pkgs, ... }: let vars = import ../../variables.nix; in { imports = [ ../../configs/home-configs/styling.nix ../../configs/home-configs/zsh.nix ../../configs/home-configs/kitty.nix ../../configs/home-configs/waybar.nix ./link-dotfiles-laptop.nix ./home-programs-laptop.nix ]; home.username = vars.user1; home.homeDirectory = vars.homeDirectoryUser1; #broken????? #services.gpg-agent = { # enable = true; # defaultCacheTtl = 1800; # enableSshSupport = true; #}; dconf.settings = { "org/virt-manager/virt-manager/connections" = { autoconnect = [ "qemu:///system" ]; uris = [ "qemu:///system" ]; }; }; xdg.desktopEntries."org.gnome.Settings" = { name = "Settings"; comment = "Gnome Control Center"; icon = "org.gnome.Settings"; exec = "env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --verbose"; categories = [ "X-Preferences" ]; terminal = true; }; xdg.desktopEntries."com.RoccoRakete.ThemeSwitcher" = { name = "ThemeSwitcher"; comment = "Dotfile ThemeSwitcher"; icon = "org.gnome.Settings"; exec = "/home/martin/.local/bin/theme_switcher"; categories = [ "X-Preferences" ]; terminal = false; }; xdg.desktopEntries."Betaflight Configurator 10.9.0" = { name = "Betaflight Configurator 10.9.0"; comment = "Configurator FPV Flight Controllers"; icon = "/home/martin/.local/bin/BetaflightConfigurator10_9_0/icon/bf_icon_128.png"; exec = "/home/martin/.local/bin/betaflight-configurator"; categories = [ "X-FPV" ]; terminal = false; }; xdg.desktopEntries."BlHeliSuite32" = { name = "BlHeliSuite32"; comment = "Configurator for BlHeli32 ESC's"; icon = "org.gnome.Settings"; exec = "/home/martin/.local/bin/blhelisuite32"; categories = [ "X-FPV" ]; terminal = false; }; xdg.desktopEntries."ExpressLRS Configurator" = { name = "ExpressLRS Configurator"; comment = "Configurator for ExpressLRS"; icon = "expresslrs-configurator"; exec = "/home/martin/.local/bin/expresslrs-configurator"; categories = [ "X-FPV" ]; terminal = false; }; #xdg.desktopEntries."SuperSlicer" = { # name = "SuperSlicer"; # comment = "3D Print Slicer"; # icon = "SuperSlicer"; # exec = "/home/martin/.local/bin/superslicer"; # categories = [ "X-FPV" ]; # terminal = false; #}; home.file = { }; home.sessionVariables = { }; home.stateVersion = "23.11"; } ================================================ FILE: nixos/hosts/laptop/home-programs-laptop.nix ================================================ { inputs, pkgs, ... }: { imports = [ inputs.ags.homeManagerModules.default #inputs.hyprlock.homeManagerModules.default inputs.anyrun.homeManagerModules.default inputs.walker.homeManagerModules.default ]; nixpkgs.config.allowUnfree = true; programs.home-manager.enable = true; programs = { hyprlock.enable = true; anyrun = { enable = false; config = { plugins = [ inputs.anyrun.packages.${pkgs.system}.applications ]; width = { fraction = 0.25; }; y = { fraction = 0.3; }; hideIcons = false; ignoreExclusiveZones = true; layer = "overlay"; hidePluginInfo = true; closeOnClick = true; showResultsImmediately = true; maxEntries = null; }; extraCss = '' @import url("stylesheet.css"); ''; }; wofi = { enable = true; }; walker = { enable = false; }; #rofi = { # enable = true; # package = pkgs.rofi.override { plugins = [ pkgs.rofi-wayland ]; }; #}; ags = { enable = false; configDir = ./home-dotfiles-laptop/ags; #configDir = null; extraPackages = [ pkgs.libsoup_3 ]; }; vscode = { enable = true; extensions = with pkgs.vscode-extensions; [ bbenoist.nix jnoortheen.nix-ide piousdeer.adwaita-theme pkief.material-product-icons ]; userSettings = { }; }; zathura = { enable = true; }; zoxide = { enable = true; options = [ "--cmd cd" ]; }; git = { enable = true; userName = "RoccoRakete"; userEmail = "m.schaumann@mscloud.uk"; extraConfig = { credential.helper = "${ pkgs.git.override { withLibsecret = true; } }/bin/git-credential-libsecret"; }; }; }; # Packages that should be installed to the user profile. home.packages = with pkgs; [ htop sassc gparted (python311.withPackages (p: [ p.python-pam ])) ]; } ================================================ FILE: nixos/hosts/laptop/link-dotfiles-laptop.nix ================================================ { config, ... }: { # neofetch home.file."${config.xdg.configHome}/neofetch" = { source = ./home-dotfiles-laptop/neofetch; recursive = true; enable = true; }; # hyprland home.file."${config.xdg.configHome}/hypr" = { source = ./home-dotfiles-laptop/hypr; recursive = true; enable = true; }; # screenlock home.file."${config.xdg.configHome}/screenlock" = { source = ./home-dotfiles-laptop/screenlock; recursive = true; enable = true; }; # ThemeSwitcher home.file."${config.xdg.configHome}/themeswitcher" = { source = ../../../cfg/themeswitcher; recursive = true; enable = true; }; # waybar launchscript #home.file."${config.xdg.configHome}/waybar/launch.sh" = { # source = ./home-dotfiles-laptop/waybar/launch.sh; # recursive = true; # enable = true; #}; # waybar config #home.file."${config.xdg.configHome}/waybar/config.jsonc" = { # source = ./home-dotfiles-laptop/waybar/config.jsonc; # recursive = true; # enable = true; #}; # waybar themes #home.file."${config.xdg.configHome}/waybar/themes" = { # source = ../../../styles/waybar; # recursive = true; # enable = true; #}; # anyrun launchscript #home.file."${config.xdg.configHome}/anyrun/launch.sh" = { # source = ./home-dotfiles-laptop/anyrun/launch.sh; # recursive = true; # enable = true; #}; # anyrun themes #home.file."${config.xdg.configHome}/anyrun/themes" = { # source = ../../../styles/anyrun; # recursive = true; # enable = true; #}; } ================================================ FILE: nixos/nixos.nix ================================================ { pkgs, ... }: let inherit (pkgs) nixos-icons; vars = import ./variables.nix; in { #environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.FLAKE = "/home/${vars.user1}/.dots/nixos/"; environment = { variables = { }; pathsToLink = [ "/share/zsh" ]; }; environment.sessionVariables = rec { # XDG_STATE_HOME = "$HOME/.local/state"; # XDG_CURRENT_DESKTOP = "GNOME"; # Not officially in the specification # XDG_BIN_HOME = "$HOME/.local/bin"; # PATH = [ # "${XDG_BIN_HOME}" # ]; }; nix = { optimise.automatic = true; gc = { automatic = true; dates = "daily"; options = "--delete-older-than 7d"; }; settings = { builders-use-substitutes = true; substituters = [ "https://hyprland.cachix.org" "https://anyrun.cachix.org" ]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" ]; experimental-features = "nix-command flakes"; auto-optimise-store = true; }; }; nixpkgs.overlays = [ (final: prev: { pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ ( python-final: python-prev: { catppuccin = python-prev.catppuccin.overridePythonAttrs (oldAttrs: rec { version = "1.3.2"; src = prev.fetchFromGitHub { owner = "catppuccin"; repo = "python"; rev = "refs/tags/v${version}"; hash = "sha256-spPZdQ+x3isyeBXZ/J2QE6zNhyHRfyRQGiHreuXzzik="; }; # can be removed next version disabledTestPaths = [ "tests/test_flavour.py" # would download a json to check correctness of flavours ]; }); } ) ]; }) ]; # Bootloader. boot = { initrd.systemd.enable = true; tmp.cleanOnBoot = true; kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ "quiet" "nosgx" ]; loader = { timeout = 0; systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; plymouth = { enable = true; theme = "bgrt"; logo = "${nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png"; }; }; # Set your time zone. time.timeZone = "Europe/Berlin"; # Locale Settings i18n = { extraLocaleSettings = { defaultLocale = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8"; LC_MEASUREMENT = "de_DE.UTF-8"; LC_MONETARY = "de_DE.UTF-8"; LC_NAME = "de_DE.UTF-8"; LC_NUMERIC = "de_DE.UTF-8"; LC_PAPER = "de_DE.UTF-8"; LC_TELEPHONE = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8"; }; }; # Configure console(tty) console.keyMap = "de"; #console.font = "ter-v32b"; #console.packages = with pkgs; [ terminus_font ]; hardware = { pulseaudio.enable = false; opengl.extraPackages = with pkgs; [ intel-compute-runtime intel-media-driver vaapiIntel ]; }; # virtualisation virtualisation = { podman.enable = true; libvirtd.enable = true; }; security.pam.services.swaylock = { }; security.pam.services.gtklock = { }; security.pam.services.hyprlock = { }; security.polkit.enable = true; # Enable sound with pipewire. #sound.enable = true; security.rtkit.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users = { defaultUserShell = pkgs.zsh; users.${vars.user1} = { isNormalUser = true; description = "Martin"; extraGroups = [ "video" "input" "networkmanager" "wheel" "dialout" "libvirtd" ]; }; }; xdg.portal.enable = true; system.activationScripts.script.text = '' cp /home/${vars.user1}/face.png /var/lib/AccountsService/icons/${vars.user1} ''; # Installed Fonts fonts = { enableDefaultPackages = true; fontDir.enable = true; packages = with pkgs; [ (nerdfonts.override { fonts = [ "Ubuntu" "UbuntuMono" "Hermit" ]; }) ]; }; system.stateVersion = "23.05"; } ================================================ FILE: nixos/overlays/betaflight-configurator.nix ================================================ self: super: { betaflightConfigurator = let pname = "betaflight-configurator"; desktopItem = super.makeDesktopItem { name = pname; exec = pname; icon = pname; comment = "Betaflight configuration tool"; desktopName = "Betaflight Configurator"; genericName = "Flight controller configuration tool"; }; in super.stdenv.mkDerivation rec { inherit pname; version = "10.9.0"; src = super.fetchurl { url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64-portable.zip"; sha256 = "sha256-9FzMyBIR2u1zXHtTWJABM6RF1+OyjYdEPlRwtig9blI="; }; # remove large unneeded files postUnpack = '' find -name "lib*.so" -delete ''; nativeBuildInputs = [ super.wrapGAppsHook super.unzip ]; buildInputs = [ super.dbus-glib super.dbus super.gsettings-desktop-schemas super.gtk3 ]; installPhase = '' runHook preInstall mkdir -p $out/bin \ $out/opt/${pname} cp -r . $out/opt/${pname}/ install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png cp -r ${desktopItem}/share/applications $out/share/ makeWrapper ${super.nwjs}/bin/nw $out/bin/${pname} --add-flags $out/opt/${pname} runHook postInstall ''; meta = with self.lib; { description = "The Betaflight flight control system configuration tool"; longDescription = '' A crossplatform configuration tool for the Betaflight flight control system. Various types of aircraft are supported by the tool and by Betaflight, e.g. quadcopters, hexacopters, octocopters and fixed-wing aircraft. ''; homepage = "https://github.com/betaflight/betaflight/wiki"; sourceProvenance = with builtins; [ sourceTypes.binaryNativeCode ]; license = licenses.gpl3; maintainers = with self.maintainers; [ wucke13 ]; platforms = platforms.linux; }; }; } ================================================ FILE: nixos/overlays/blhelisuite32.nix ================================================ self: super: { BlHeliSuite32xl = let pname = "blhelisuite32"; desktopItem = super.makeDesktopItem { name = pname; exec = pname; icon = pname; comment = "BlHeli32 ESC Configurator"; desktopName = "BlHeli32Suite"; genericName = "BlHeli32 ESC Configurator"; }; in super.stdenv.mkDerivation rec { inherit pname; version = "10.0.0"; src = super.fetchurl { url = "https://github.com/bitdump/BLHeli/releases/download/Rev32.10/BLHeliSuite32xLinux64_1044.zip"; sha256 = "sha256-Fi/rMQz02/2QVTY32Q16DcJPWmeVcx+EjcN+meBxt14="; }; # remove large unneeded files postUnpack = '' ''; nativeBuildInputs = [ super.wrapGAppsHook super.unzip super.libGL super.autoPatchelfHook ]; buildInputs = [ super.gvfs super.libgcc super.libgccjit super.libGL super.libglibutil super.zlib super.gtk3 super.systemdLibs super.glibc ]; installPhase = '' runHook preInstall mkdir -p $out/bin \ $out/opt/${pname} cp -r . $out/opt/${pname}/ #install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png cp -r ${desktopItem}/share/applications $out/share/ makeWrapper $out/opt/${pname}/BLHeliSuite32xl $out/bin/${pname} --add-flags $out/opt/${pname} patchelf --set-rpath '$out/lib' $out/opt/${pname}/BLHeliSuite32xl runHook postInstall ''; meta = with self.lib; { description = "The Betaflight flight control system configuration tool"; longDescription = '' A crossplatform configuration tool for the Betaflight flight control system. Various types of aircraft are supported by the tool and by Betaflight, e.g. quadcopters, hexacopters, octocopters and fixed-wing aircraft. ''; homepage = "https://github.com/betaflight/betaflight/wiki"; sourceProvenance = with builtins; [ sourceTypes.binaryNativeCode ]; license = licenses.gpl3; maintainers = with self.maintainers; [ wucke13 ]; platforms = platforms.linux; }; }; } ================================================ FILE: nixos/overlays/default.bkp ================================================ { makeDesktopItem, nwjs }: self: super: { betaflightConfigurator = self.stdenv.mkDerivation rec { pname = "betaflight-configurator"; version = "10.9.0"; desktopItem = makeDesktopItem { name = pname; exec = pname; icon = pname; comment = "Betaflight configuration tool"; desktopName = "Betaflight Configurator"; genericName = "Flight controller configuration tool"; }; src = self.fetchurl { url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64-portable.zip"; sha256 = "sha256-9FzMyBIR2u1zXHtTWJABM6RF1+OyjYdEPlRwtig9blI="; }; nativeBuildInputs = [ self.unzip ]; unpackPhase = '' unzip $src ''; installPhase = '' runHook preInstall mkdir -p $out/bin \ $out/opt/${pname} cp -r. $out/opt/${pname}/ install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png cp -r ${desktopItem}/share/applications $out/share/applications/ makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags "$out/opt/${pname}" runHook postInstall ''; meta = with self.lib; { description = "A cross-platform configuration tool for the Betaflight flight control software"; homepage = "https://github.com/betaflight/betaflight-configurator"; license = licenses.mit; platforms = platforms.unix; }; }; } ================================================ FILE: nixos/overlays/test.nix ================================================ self: super: { betaflightConfigurator = let pname = "betaflight-configurator"; desktopItem = super.makeDesktopItem { name = pname; exec = pname; icon = pname; comment = "Betaflight configuration tool"; desktopName = "Betaflight Configurator"; genericName = "Flight controller configuration tool"; }; in super.stdenv.mkDerivation rec { inherit pname; version = "10.9.0"; src = super.fetchurl { url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64-portable.zip"; sha256 = "sha256-9FzMyBIR2u1zXHtTWJABM6RF1+OyjYdEPlRwtig9blI="; }; # remove large unneeded files postUnpack = '' find -name "lib*.so" -delete ''; nativeBuildInputs = [ super.wrapGAppsHook super.unzip ]; buildInputs = [ super.dbus-glib super.dbus super.gsettings-desktop-schemas super.gtk3 ]; # Erzwingen der spezifischen NW.js-Version NWJS_SRC = super.fetchurl { url = "https://dl.nwjs.io/v0.84.0/nwjs-v0.84.0-linux-x64.tar.gz"; hash = "sha256-VIygMzCPTKzLr47bG1DYy/zj0OxsjGcms0G1BkI/TEI="; }; installPhase = '' runHook preInstall mkdir -p $out/bin \ $out/opt/${pname} tar -xf $out-nwjs-v0.84.0-linux-x64.tar.gz -C $out/bin/ cp -r. $out/opt/${pname}/ install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png cp -r ${desktopItem}/share/applications $out/share/ makeWrapper $out/bin/nwjs-v0.84.0-linux-x64/nw $out/bin/${pname} --add-flags $out/opt/${pname} runHook postInstall ''; meta = with self.lib; { description = "The Betaflight flight control system configuration tool"; longDescription = '' A crossplatform configuration tool for the Betaflight flight control system. Various types of aircraft are supported by the tool and by Betaflight, e.g. quadcopters, hexacopters, octocopters and fixed-wing aircraft. ''; homepage = "https://github.com/betaflight/betaflight/wiki"; sourceProvenance = with builtins; [ sourceTypes.binaryNativeCode ]; license = licenses.gpl3; maintainers = with self.maintainers; [ wucke13 ]; platforms = platforms.linux; }; }; } ================================================ FILE: nixos/packages.nix ================================================ { pkgs, inputs, ... }: #let # myOverlays = import ./overlays/betaflight-configurator.nix; #in { #nixpkgs.overlays = [ myOverlays ]; # Allow unfree packages nixpkgs = { config = { allowUnfree = true; permittedInsecurePackages = [ #"electron-25.9.0" #"electron-19.1.9" #"nix-2.16.2" ]; overlays = [ ]; }; }; services.udev.packages = [ pkgs.swayosd ]; # Package configurations environment.systemPackages = with pkgs; [ #( # pkgs.runCommand # "brave-wrapped" # { nativeBuildInputs = [ pkgs.makeWrapper ]; } # '' # makeWrapper ${lib.getExe pkgs.brave} $out/bin/brave \ # --append-flags "--enable-features=TouchpadOverscrollHistoryNavigation" \ # --append-flags "--password-store=basic" \ # --append-flags "--enable-chrome-browser-cloud-management" # '' #) #Commandline arguments ( brave.override { commandLineArgs = [ "--enable-features=TouchpadOverscrollHistoryNavigation" "--password-store=basic" ]; } ) #Packages # gnome gnome.gnome-bluetooth gnome.gnome-settings-daemon gnome.gnome-software glib nautilus-open-any-terminal libadwaita gnome.gnome-control-center gnome.gvfs gnome.sushi gnome.seahorse gnome.gnome-tweaks gtk4 gtk3 # theming inputs.walker.packages.${system}.default inputs.anyrun.packages.${system}.default swaynotificationcenter swayosd wlogout neofetch swww pywal imagemagick nwg-look hyprpicker gradience kitty-themes # code yarn nodejs_22 stylua codespell isort black prettierd shfmt jsbeautifier lua-language-server dart-sass bun neovide fzf libgcc libgccjit bintools-unwrapped nixpkgs-fmt python3 gcc-unwrapped gnumake gccgo cargo ripgrep fd jq nil rustfmt java-language-server jsonfmt luaformatter typescript meson vala cmake pkg-config uncrustify #vala-language-server #neovim-unwrapped # homelab rpi-imager super-slicer-beta orca-slicer # information lutris openra firefox thunderbird brave bitwarden vesktop #betaflight-configurator #BlHeliSuite32xl #betaflightConfigurator whatsapp-for-linux #kicad # office obsidian libreoffice-fresh nextcloud-client mailspring localsend # media obs-studio wf-recorder grimblast wayshot spotify gimp gthumb jellyfin-media-player heroic # system clipse proxmox-backup-client inputs.eza.packages.${system}.default inputs.hypridle.packages.${system}.default pika-backup envsubst grim deadnix mesa-demos mesa nitch coreutils powerstat mate.mate-polkit polkit wget brightnessctl libnotify inotify-tools pavucontrol bluez bluez-tools wl-clip-persist wl-clipboard sway-audio-idle-inhibit xdg-desktop-portal distrobox nixos-icons libsecret wireguard-tools wireguard-go networkmanagerapplet intel-gpu-tools usbutils btop stress-ng slurp playerctl unzip wev sabnzbd wineWowPackages.waylandFull wlr-randr powertop poweralertd pulseaudio inputs.nh.packages.${system}.default satty ]; } ================================================ FILE: nixos/pkgs/default.nix ================================================ { pkgs, ... }: let callPackage = pkgs.callPackage; in { nixpkgs.overlays = [ (_final: _prev: { custompkgs = { kanagawa-gtk-theme = callPackage ./kanagawa-gtk-theme.nix { }; }; }) ]; } ================================================ FILE: nixos/pkgs/kanagawa-gtk-theme.nix ================================================ { lib , stdenvNoCC , fetchFromGitHub , gtk3 , gtk-engine-murrine , hicolor-icon-theme }: stdenvNoCC.mkDerivation { pname = "kanagawa-gtk-theme"; version = "unstable-2023-07-03"; src = fetchFromGitHub { owner = "Fausto-Korpsvart"; repo = "Kanagawa-GKT-Theme"; rev = "35936a1e3bbd329339991b29725fc1f67f192c1e"; hash = "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0="; }; nativeBuildInputs = [ gtk3 ]; propagatedBuildInputs = [ hicolor-icon-theme ]; propagatedUserEnvPkgs = [ gtk-engine-murrine ]; dontDropIconThemeCache = true; installPhase = '' runHook preInstall mkdir -p $out/share/themes cp -a themes/* $out/share/themes mkdir -p $out/share/icons cp -a icons/* $out/share/icons for theme in $out/share/icons/*; do gtk-update-icon-cache -f $theme done runHook postInstall ''; meta = with lib; { description = "A GTK theme with the Kanagawa colour palette"; homepage = "https://github.com/Fausto-Korpsvart/Kanagawa-GKT-Theme"; license = licenses.gpl3Only; platforms = platforms.all; }; } ================================================ FILE: nixos/variables.nix ================================================ let user1 = "martin"; in { desktop = "OptiPlex3060"; laptop = "ThinkPad"; user1 = user1; homeDirectoryUser1 = "/home/${user1}"; } ================================================ FILE: scripts/blepower.sh ================================================ #!/usr/bin/env sh bluetooth_status=$(bluetoothctl show | grep "Powered: yes") if [ -n "$bluetooth_status" ]; then echo "Bluetooth is enabled. Disabling..." bluetoothctl power off else echo "Bluetooth is disabled. Enabling..." bluetoothctl power on fi ================================================ FILE: scripts/sleep.sh ================================================ #!/usr/bin/env sh brightnessctl s 1 pactl set-sink-volume @DEFAULT_SINK@ 30% ================================================ FILE: scripts/update.sh ================================================ #!/usr/bin/env sh kitty sh -c "upgrade-laptop -u && home-upgrade-laptop" ================================================ FILE: scripts/wifipower.sh ================================================ #!/usr/bin/env sh wifi_status=$(nmcli radio wifi) if [ "$wifi_status" = "enabled" ]; then echo "Wi-Fi is enabled. Disabling..." nmcli radio wifi off else echo "Wi-Fi is disabled. Enabling..." nmcli radio wifi on fi