Improved readme instructions for switching the theme globally, fixed various ts imports

This commit is contained in:
pascalyazid committed 2026-04-14 01:09:27 +02:00
1 parent 9b2e4e84ab
commit be426ef35d
8 files changed
+57 -62

No files matched your search

+45 -50
View File
@@ -1,13 +1,13 @@
# AGS Bar for Hyprland (CachyOS) # AGS Bar for Hyprland
A fast, highly-customizable, and memory-optimized top bar for Hyprland, built with [AGS (Aylur's GTK Shell)](https://aylur.github.io/ags-docs/) and GTK4. A fast, highly-customizable, and memory-optimized top bar for Hyprland, built with [AGS (Aylur's GTK Shell)](https://aylur.github.io/ags-docs/) and GTK4.
This shell features dynamic on-the-fly theming using **Pywal**, completely integrating your wallpaper colors into the bar and the rest of your system seamlessly. This shell features dynamic theming using **Pywal**, completely integrating your wallpaper colors into the bar and the rest of your system.
## ✨ Features ## ✨ Features
- **Multi-Monitor Support**: Automatically instantiates a top bar and power menu overlay for every connected display. - **Multi-Monitor Support**: Automatically instantiates a top bar and power menu overlay for every connected display.
- **Dynamic Pywal Theming**: Select a wallpaper from the built-in popover, and the entire system theme (AGS, Kitty, Rofi, etc.) updates instantly. - **Dynamic Pywal Theming**: Select a wallpaper from the built-in popover, and the AGS theme updates instantly.
- **Memory-Optimized Image Caching**: The wallpaper switcher uses highly efficient pre-scaled `GdkPixbuf` GTK textures to keep RAM usage incredibly low, even with 4K images. - **Memory-Optimized Image Caching**: The wallpaper switcher uses highly efficient pre-scaled `GdkPixbuf` GTK textures to keep RAM usage incredibly low, even with 4K images.
- **Smart Media Player**: Automatically tracks and controls your active media player via MPRIS. Includes a popover with album art and playback controls. - **Smart Media Player**: Automatically tracks and controls your active media player via MPRIS. Includes a popover with album art and playback controls.
- **Quick Settings Dropdown**: Easily manage your Network, Bluetooth (safe non-blocking toggles), and Audio (Speaker/Mic sliders). - **Quick Settings Dropdown**: Easily manage your Network, Bluetooth (safe non-blocking toggles), and Audio (Speaker/Mic sliders).
@@ -18,20 +18,17 @@ This shell features dynamic on-the-fly theming using **Pywal**, completely integ
## 📦 Dependencies ## 📦 Dependencies
To use this shell, you need to install AGS and the required backend libraries. Since you are on CachyOS/Arch, you can install them via your package manager or AUR. To use this shell, you need to install AGS and the required backend libraries. Since you are most probably using Arch, you can install them via your package manager or AUR.
```bash ```bash
# Core AGS and Sass compiler for theming # Core AGS and Sass compiler for theming, Hyprmod for Hyprland settings, Dunst notification daemon
yay -S ags dart-sass hyprmod-git yay -S ags dart-sass hyprmod-git dunst
# Desktop environment dependencies # Wallpaper dependencies
sudo pacman -S hyprpaper python-pywal16 yay -S hyprpaper python-pywal16
# Astal libraries (for system data bindings) # Astal libraries (for system data bindings)
yay -S astal-gjs astal-mpris astal-tray astal-network astal-bluetooth astal-wireplumber libastal-battery-git yay -S astal-gjs astal-mpris astal-tray astal-network astal-bluetooth astal-wireplumber libastal-battery-git
# Notification daemon
yay -S dunst
``` ```
--- ---
@@ -39,7 +36,7 @@ yay -S dunst
## 🚀 Setup & Installation ## 🚀 Setup & Installation
1. **Clone/Place the Config:** Ensure this repository is placed at `~/.config/ags`. 1. **Clone/Place the Config:** Ensure this repository is placed at `~/.config/ags`.
2. **Wallpaper Directory:** Create a folder at `~/wallpapers` and put some `.jpg` or `.png` images in it. The theme switcher looks here by default. 2. **Wallpaper Directory:** Create a folder at `~/wallpapers` where you can place your `.jpg` or `.png` wallpapers in. The theme switcher looks here by default.
```bash ```bash
mkdir -p ~/wallpapers mkdir -p ~/wallpapers
``` ```
@@ -50,7 +47,7 @@ yay -S dunst
### Autostarting with Hyprland ### Autostarting with Hyprland
To make the bar start automatically when you log into Hyprland, add the following line to your `~/.config/hypr/hyprland.conf`: To make the bar start automatically when you launch Hyprland, add the following line to your `~/.config/hypr/hyprland.conf`:
```ini ```ini
# Start the AGS bar on login # Start the AGS bar on login
@@ -81,51 +78,49 @@ include ~/.cache/wal/colors-kitty.conf
_Next time you open Kitty, it will perfectly match your wallpaper!_ _Next time you open Kitty, it will perfectly match your wallpaper!_
### Example 2: Rofi (App Launcher)
Pywal generates a standard Rofi theme. You can create a custom `config.rasi` file for Rofi that imports these colors and applies them to your launcher. ### Example 2: Dunst (Notification Daemon)
Create or edit `~/.config/rofi/config.rasi`: Pywal doesn't generate a theme for every application, hence you have to define some templates yourself in `~/.config/wal/templates`.
In this case we will create a template for Dunst:
```css ```toml
/* Import the dynamically generated Pywal colors */ [global]
@import "~/.cache/wal/colors-rofi-dark.rasi" * { # Define the corner radius in pixels.
/* Map Pywal's semantic colors to your theme */ # A value of 0 disables rounded corners.
bg-col: @background; corner_radius = 10
fg-col: @foreground;
accent-col: @selected-normal-background;
accent-fg: @selected-normal-foreground;
background-color: transparent; [urgency_low]
text-color: @fg-col; background = "{background}CC"
} foreground = "{foreground}"
frame_color = "{color2}"
timeout = 10
window { [urgency_normal]
border: 2px; background = "{background}CC"
border-color: @accent-col; foreground = "{foreground}"
background-color: @bg-col; frame_color = "{color1}"
} timeout = 10
element selected.normal, [urgency_critical]
element selected.active { background = "{background}CC"
background-color: @accent-col; foreground = "{foreground}"
text-color: @accent-fg; frame_color = "{color9}"
} timeout = 0
```
After switching the wallpaper, pywal will generate a theme with the exactly same name in `~/.cache/wal`
You can create a symlink so dunst will always have the current theme:
```bash
ln -sf ~/.cache/wal/dunstrc ~/.config/dunst/dunstrc
``` ```
### Example 3: Fuzzel Because dunst doesn't apply the theme while it's running, we added
```bash
If you use Fuzzel instead of Rofi, simply add this to the top of your `~/.config/fuzzel/fuzzel.ini` (Requires creating a custom pywal template for fuzzel): killall dunst
dunst &
```ini
include=~/.cache/wal/colors-fuzzel.ini
``` ```
in the `update_script.sh` Bash-Script which runs every time the wallpaper is switched.
You can add your own commands in there if needed.
--- ---
## 🛠️ Code Quality
This project is formatted and linted for maintainability.
- **Format code:** `npm run format`
- **Lint code:** `npm run lint`
+2 -2
View File
@@ -11,9 +11,9 @@ const HOME = GLib.getenv("HOME") || ""
const colorsPath = `${HOME}/.cache/wal/colors.scss` const colorsPath = `${HOME}/.cache/wal/colors.scss`
if (!GLib.file_test(colorsPath, GLib.FileTest.EXISTS)) { if (!GLib.file_test(colorsPath, GLib.FileTest.EXISTS)) {
console.log("No pywal colors found, generating default from pywal.png...") console.log("No pywal colors found, generating default from pywal.jpg...")
const agsDir = `${HOME}/.config/ags` const agsDir = `${HOME}/.config/ags`
exec(`wal -q -n -i ${agsDir}/pywal.png`) exec(`wal -q -n -i ${agsDir}/pywal.jpg`)
} }
const scss = `${HOME}/.config/ags/style.scss` const scss = `${HOME}/.config/ags/style.scss`
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 KiB

+1 -1
View File
@@ -1,5 +1,5 @@
import { Gtk } from "ags/gtk4" import { Gtk } from "ags/gtk4"
import AstalMpris from "gi://AstalMpris?version=0.1" import AstalMpris from "gi://AstalMpris"
import { createBinding, With, onCleanup } from "ags" import { createBinding, With, onCleanup } from "ags"
export default function Media() { export default function Media() {
+4 -4
View File
@@ -1,7 +1,7 @@
import { Gtk } from "ags/gtk4" import { Gtk } from "ags/gtk4"
import AstalNetwork from "gi://AstalNetwork?version=0.1" import AstalNetwork from "gi://AstalNetwork"
import AstalBluetooth from "gi://AstalBluetooth?version=0.1" import AstalBluetooth from "gi://AstalBluetooth"
import AstalWp from "gi://AstalWp?version=0.1" import Wp from "gi://AstalWp"
import { createBinding } from "ags" import { createBinding } from "ags"
import { execAsync } from "ags/process" import { execAsync } from "ags/process"
@@ -69,7 +69,7 @@ function BluetoothItem() {
} }
function AudioSlider({ type }: { type: "speaker" | "microphone" }) { function AudioSlider({ type }: { type: "speaker" | "microphone" }) {
const wp = AstalWp.get_default() const wp = Wp.get_default()
const audio = wp?.audio const audio = wp?.audio
if (!audio) return <box /> if (!audio) return <box />
+2 -2
View File
@@ -1,7 +1,7 @@
import { Gtk } from "ags/gtk4" import { Gtk } from "ags/gtk4"
import { createPoll } from "ags/time" import { createPoll } from "ags/time"
import AstalTray from "gi://AstalTray?version=0.1" import AstalTray from "gi://AstalTray"
import AstalBattery from "gi://AstalBattery?version=0.1" import AstalBattery from "gi://AstalBattery"
import { createBinding, For } from "ags" import { createBinding, For } from "ags"
export function Clock() { export function Clock() {
+2 -2
View File
@@ -1,7 +1,7 @@
import { Gtk } from "ags/gtk4" import { Gtk } from "ags/gtk4"
import GdkPixbuf from "gi://GdkPixbuf?version=2.0" import GdkPixbuf from "gi://GdkPixbuf"
import Gdk from "gi://Gdk?version=4.0" import Gdk from "gi://Gdk"
import { getWallpapers, setTheme } from "../theme" import { getWallpapers, setTheme } from "../theme"
// Global memory cache for textures, shared across all monitors! // Global memory cache for textures, shared across all monitors!
+1 -1
View File
@@ -1,5 +1,5 @@
import { execAsync, createSubprocess } from "ags/process" import { execAsync, createSubprocess } from "ags/process"
import GLib from "gi://GLib?version=2.0" import GLib from "gi://GLib"
import { Gdk } from "ags/gtk4" import { Gdk } from "ags/gtk4"
const HIS = GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE") const HIS = GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE")