diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c9970a7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "astal-shell", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "astal-shell", + "dependencies": { + "astal": "/usr/share/astal/gjs" + } + }, + "../../../../usr/share/astal/gjs": { + "name": "astal", + "license": "LGPL-2.1" + }, + "node_modules/astal": { + "resolved": "../../../../usr/share/astal/gjs", + "link": true + } + } +} diff --git a/scripts/powermenu b/scripts/powermenu new file mode 100755 index 0000000..4330d0a --- /dev/null +++ b/scripts/powermenu @@ -0,0 +1,19 @@ +#!/bin/sh + +case "$1" in + "lock") + ~/dotfiles/hypr/bin/hyprlock-background.sh & astal -t powermenu + ;; + "suspend") + systemctl suspend & astal -t powermenu + ;; + "logout") + systemctl logout & astal -t powermenu + ;; + "reboot") + systemctl reboot & astal -t powermenu + ;; + "poweroff") + systemctl poweroff & astal -t powermenu + ;; +esac diff --git a/style.scss b/style.scss index 0042c79..da08fcb 100644 --- a/style.scss +++ b/style.scss @@ -5,7 +5,7 @@ $bg-color: #{"@theme_bg_color"}; $bg: #212223; $fg: #f1f1f1; $accent: #{"@theme_accent_color"}; -$radius: 7px; +$radius: 20px; window.Bar { background: transparent; @@ -14,41 +14,121 @@ window.Bar { >centerbox { background: transparent; - border-radius: 10px; - margin: 0; + border-radius: 20px; + margin: 2px 5px 0 5px; + } + + .Menubutton { + all: unset; + background-color: black; + border-radius: 25px; + &:hover label { + transition: 300ms; + background-color: gray; + } + label { + transition: 300ms; + padding: 5px 15px 5px 9px; + border-radius: $radius; + border: 1pt solid black; + } + } + + .RoudedBlock { + background-color: black; + border-radius: 25px; + transition: 300ms; + } + + .Time { + padding: 0 15px; + } + + .SysTray { + all: unset; + border-radius: 25px; + background-color: transparent; + // padding: 10px; + // color: red; + + button { + all: unset; + padding: 5px 7px; + border-radius: 25px; + border: 1pt solid black; + // border-color: black; + transition: 300ms; + // background-color: red; + // color: red; + &:hover { + background-color: gray; + } + } + } + + .Focused { + padding: 0 15px; + transition: 300ms; } .Workspaces { button { all: unset; - background-color: transparent; + background-color: black; + border-radius: 25px; &:hover label { background-color: gray; border-color: black; + color: white; } &:active label { - background-color: black; + background-color: white; + color: black; } } label { - transition: 200ms; - padding: 0 8px; + transition: 300ms; + padding: 5px 15px; border-radius: $radius; border: 1pt solid transparent; } .focused label { - color: $accent; + background-color: white; + color: black; border-color: $accent; } } + + // button { + // border-radius: 8px; + // padding: 0 8px; + // } +} - button { - border-radius: 8px; - padding: 0 8px; +window.Powermenu { + margin: 5px; + background-color: transparent; + box { + margin: 5px; + background-color: black; + border-radius: 25px; + // padding: 10px; + button { + all: unset; + margin: 2px; + padding: 5px 15px 5px 13px; + background-color: black; + border-radius: 25px; + transition: 300ms; + + &:hover { + background-color: gray; + } + } } } diff --git a/widget/Bar.tsx b/widget/Bar.tsx index b373480..fa6efe6 100644 --- a/widget/Bar.tsx +++ b/widget/Bar.tsx @@ -1,6 +1,9 @@ import { App, Astal, Gtk, Gdk } from "astal/gtk3" -import { Variable, bind } from "astal" +import { Variable, GLib, bind } from "astal" import Hyprland from "gi://AstalHyprland" +import Tray from "gi://AstalTray" +import PowerMenu from "./PowerMenu" +import Cpu from "./Cpu" const time = Variable("").poll(1000, "date") @@ -23,37 +26,91 @@ function Workspaces() { } +function FocusedClient() { + const hypr = Hyprland.get_default() + const focused = bind(hypr, "focusedClient") + + return + {focused.as(client => ( + client && +} + +function Time({ format = "%H:%M - %A %e" }) { + const time = Variable("").poll(1000, () => + GLib.DateTime.new_now_local().format(format)!) + + return