automatically set theme + sort workspace ids

This commit is contained in:
Soph :3 2024-07-21 16:17:17 +03:00
parent e881630989
commit 427b95da31
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
2 changed files with 20 additions and 16 deletions

View file

@ -20,17 +20,17 @@ function Workspaces(monitor) {
const workspaces = hyprland
.bind("workspaces")
.as((ws) =>
ws
.filter((z) => z.monitorID == monitor)
.map(({ id }) =>
.as((ws) => {
const g = ws.filter((z) => z.monitorID == monitor);
g.sort((a,b) => a.id - b.id)
return g.map(({ id }) =>
Widget.Button({
on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`),
class_name: activeId.as((i) => `${i === id ? "focused" : ""}`),
})
)
);
});
return Widget.Box({
class_name: "workspaces",
@ -54,13 +54,15 @@ function Clock() {
function Media() {
const label = Utils.watch("", mpris, "player-changed", () => {
const player = mpris.players.find(z => z.entry == "spotify");
const player = mpris.players.find((z) => z.entry == "spotify");
if (player) {
const ms = player.metadata["mpris:length"]/1000;
const minutes = Math.floor((ms/1000)/60)
const seconds = Math.floor((ms/1000)%60)
const ms = player.metadata["mpris:length"] / 1000;
const minutes = Math.floor(ms / 1000 / 60);
const seconds = Math.floor((ms / 1000) % 60);
return `${player.track_artists.join(", ")} - ${player.track_title} [${minutes}:${seconds}]`;
return `${player.track_artists.join(", ")} - ${
player.track_title
} [${minutes}:${seconds}]`;
} else {
return "Nothing is playing";
}

View file

@ -17,6 +17,8 @@ exec-once=~/.config/hypr/portal.sh
exec-once=swww init && swww img ~/wallpaper.jpg
exec-once=nm-applet
exec-once=ags
exec-once=gsettings set org.gnome.desktop.interface gtk-theme 'Catppuccin-Latte-Standard-Pink-Light'
exec=~/.config/hypr/import-gsettings.sh
env = XCURSOR_SIZE,24