Mae various style changes, fixed fetching workspace state from system

This commit is contained in:
pascalyazid committed 2026-03-26 01:04:07 +01:00
1 parent f6cd33e2fb
commit a33d8d6ac5
3 files changed
+98 -56

No files matched your search

+69 -49
View File
@@ -3,6 +3,12 @@
$fg-color: wal.$foreground; $fg-color: wal.$foreground;
$bg-color: rgba(wal.$background, 0.8); $bg-color: rgba(wal.$background, 0.8);
// Unified sizing variables
$btn-height: 30px;
$btn-radius: 8px;
$btn-margin: 4px 2px;
$icon-size: 16px;
window.Bar { window.Bar {
background: transparent; background: transparent;
color: $fg-color; color: $fg-color;
@@ -11,119 +17,131 @@ window.Bar {
> centerbox { > centerbox {
background: $bg-color; background: $bg-color;
border-radius: 10px; border-radius: 10px;
margin: 4px 8px; // Reduced vertical margin margin: 4px 8px;
padding: 0 12px; // Removed vertical padding padding: 0 8px;
} }
.left-box, .left-box,
.center-box, .center-box,
.right-box { .right-box {
padding: 0 8px; padding: 0 4px;
} }
// Base button styling for absolute uniformity
button { button {
border-radius: 8px; border-radius: $btn-radius;
margin: 2px; margin: $btn-margin;
min-height: $btn-height;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
background: rgba(
150,
150,
150,
0.1
); // Slight base background for all buttons
border: none;
box-shadow: none;
&:hover {
background: rgba(wal.$foreground, 0.15);
}
} }
.workspaces { .workspaces {
.workspace-btn { .workspace-btn {
min-width: 24px; min-width: $btn-height; // Base square size
min-height: 24px; // Control height exactly here padding: 0;
padding: 0 4px; border-radius: 100px; // Pill shape instead of blocky squares
border-radius: 6px; background-color: transparent;
background: transparent; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
&.active { &.active {
background: wal.$color2; min-width: 45px; // Horizontal expansion, slightly less wide
background-color: wal.$color2;
color: wal.$background; color: wal.$background;
} }
&:hover:not(.active) { &:hover:not(.active) {
background: rgba(wal.$color2, 0.2); background-color: rgba(wal.$color2, 0.2);
} }
} }
} }
.clock-btn { .clock-btn {
padding: 0 12px; // Reduced vertical padding padding: 0 12px;
min-height: 24px;
} }
.media-btn { .media-btn {
padding: 0 8px; padding: 0 12px;
min-height: 24px;
&:hover {
background: rgba(wal.$foreground, 0.1);
}
.media-art { .media-art {
border-radius: 4px; border-radius: 4px;
-gtk-icon-size: 32px; -gtk-icon-size: $icon-size;
} }
} }
.system-tray { .system-tray {
background: rgba(wal.$color8, 0.3); // Unified background for the tray background: transparent;
border-radius: 8px; border-radius: $btn-radius;
padding: 0 4px; // Reduced vertical padding padding: 0;
margin: 2px; margin: 0;
.tray-item { .tray-item {
//padding: 2px 4px; // Reduced vertical padding padding: 0;
margin: 0; min-width: $btn-height;
min-height: $btn-height;
margin: 0 2px;
background: transparent; background: transparent;
border: none;
box-shadow: none; button {
background: transparent;
}
&:hover { &:hover {
background: rgba(wal.$foreground, 0.1); background: rgba(wal.$foreground, 0.1);
border-radius: 6px; border-radius: $btn-radius;
} }
image { image {
-gtk-icon-size: 16px; -gtk-icon-size: 20px;
} }
} }
} }
.control-btn { // Icon-only control buttons (wallpaper, settings, power, etc)
padding: 2px 8px; .control-btn,
min-height: 24px; .wallpaper-btn,
.power-btn {
&:hover { min-width: $btn-height;
background: rgba(wal.$foreground, 0.1); padding: 0; // Square buttons should have 0 padding, width handles size
}
image { image {
-gtk-icon-size: 16px; -gtk-icon-size: $icon-size;
} }
} }
.controls-container { .controls-container {
.power-btn { .power-btn {
color: wal.$color1; // Distinctive color for power button color: wal.$color1;
} }
} }
} }
.wallpaper-btn { .wallpaper-btn {
padding: 0;
border-radius: 8px;
background: transparent; background: transparent;
transition: all 0.2s ease-in-out;
&:hover {
background: rgba(wal.$foreground, 0.1);
}
picture { picture {
border-radius: 8px; border-radius: $btn-radius;
} }
} }
popover > contents {
background: $bg-color;
color: $fg-color;
border: 1px solid rgba(wal.$foreground, 0.1);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
window.PowerMenu { window.PowerMenu {
background: transparent; background: transparent;
@@ -139,6 +157,8 @@ window.PowerMenu {
background: transparent; background: transparent;
min-width: 120px; min-width: 120px;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
border: none;
box-shadow: none;
&:hover { &:hover {
background: rgba(wal.$foreground, 0.1); background: rgba(wal.$foreground, 0.1);
+7
View File
@@ -127,6 +127,13 @@ export async function setTheme(wallpaperPath: string) {
try { try {
// -q: quiet, -i: image, -n: skip setting wallpaper (hyprpaper does it) // -q: quiet, -i: image, -n: skip setting wallpaper (hyprpaper does it)
await execAsync(`wal -q -n -i "${wallpaperPath}"`) await execAsync(`wal -q -n -i "${wallpaperPath}"`)
// Add this line so hyprlock always knows the current wallpaper:
await execAsync([
"cp",
wallpaperPath,
`${HOME}/.cache/current_wallpaper.jpg`,
])
} catch (error) { } catch (error) {
console.error("Failed to generate colors with pywal:", error) console.error("Failed to generate colors with pywal:", error)
} }
+22 -7
View File
@@ -1,12 +1,27 @@
import { execAsync } from "ags/process" import { execAsync, createSubprocess } from "ags/process"
import { createPoll } from "ags/time" import GLib from "gi://GLib?version=2.0"
const HIS = GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE")
const sock = `${GLib.getenv("XDG_RUNTIME_DIR")}/hypr/${HIS}/.socket2.sock`
export default function Workspaces() { export default function Workspaces() {
// Poll the active workspace ID from Hyprland // Listen to the Hyprland socket for instant workspace updates
const activeWs = createPoll(1, 250, (prev) => const activeWs = createSubprocess(
execAsync("hyprctl activeworkspace -j") 1,
.then((out) => JSON.parse(out).id as number) [
.catch(() => prev), "sh",
"-c",
`hyprctl activeworkspace -j | grep '"id":' | head -1 | awk '{print $2}' | tr -d ','; nc -U ${sock}`,
],
(out, prev) => {
const match = out.match(/(?:^|\n)workspace>>(\d+)/)
if (match) return parseInt(match[1])
const num = parseInt(out)
if (!isNaN(num) && num > 0) return num
return prev
},
) )
return ( return (