summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2024-11-28 15:55:03 +0100
committerJasper Ras <jras@hostnet.nl>2024-11-28 15:55:03 +0100
commitb44f4a11380516dbb1a8fcfc6627d669a87d2473 (patch)
tree97b45c1ecb2398a7a6185569ba8fcb77a3ad1b77
parent7f729d18d9d85f914b6cb1f4df81207caeee4b61 (diff)
barzz
-rw-r--r--flake.nix2
-rw-r--r--style.scss94
-rw-r--r--widget/Battery.tsx12
-rw-r--r--widget/Button.tsx34
4 files changed, 84 insertions, 58 deletions
diff --git a/flake.nix b/flake.nix
index ae0c3c5..bfa5b0d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,5 +1,5 @@
{
- description = "My Awesome Desktop Shell";
+ description = "Bar ripped from example";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
diff --git a/style.scss b/style.scss
index 9ae9604..1dcf729 100644
--- a/style.scss
+++ b/style.scss
@@ -1,20 +1,92 @@
-// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss
-$theme_fg_color: "@theme_fg_color";
-$theme_bg_color: "@theme_bg_color";
+@use "sass:color";
+
+$bg: #212223;
+$fg: #f1f1f1;
+$accent: #378DF7;
+$radius: 7px;
window.Bar {
- background: transparent;
- color: #{$theme_bg_color};
+ border: none;
+ box-shadow: none;
+ background-color: $bg;
+ color: $fg;
+ font-size: 1.1em;
font-weight: bold;
- >centerbox {
- background: #{$theme_bg_color};
- border-radius: 10px;
- margin: 8px;
+ button {
+ all: unset;
+ background-color: transparent;
+
+ &:hover label {
+ background-color: color.adjust($fg, $alpha: -0.84);
+ border-color: color.adjust($accent, $alpha: -0.8);
+ }
+
+ &:active label {
+ background-color: color.adjust($fg, $alpha: -0.8)
+ }
}
- button {
- border-radius: 8px;
+ label {
+ transition: 200ms;
+ padding: 0 8px;
margin: 2px;
+ border-radius: $radius;
+ border: 1pt solid transparent;
+ }
+
+ .Workspaces .focused label {
+ color: $accent;
+ border-color: $accent;
+ }
+
+ .FocusedClient {
+ color: $accent;
+ }
+
+ .Media .Cover {
+ min-height: 1.2em;
+ min-width: 1.2em;
+ border-radius: $radius;
+ background-position: center;
+ background-size: contain;
+ }
+
+ .Battery label {
+ padding-left: 0;
+ margin-left: 0;
+ }
+
+ .AudioSlider {
+ * {
+ all: unset;
+ }
+
+ icon {
+ margin-right: .6em;
+ }
+
+ & {
+ margin: 0 1em;
+ }
+
+ trough {
+ background-color: color.adjust($fg, $alpha: -0.8);
+ border-radius: $radius;
+ }
+
+ highlight {
+ background-color: $accent;
+ min-height: .8em;
+ border-radius: $radius;
+ }
+
+ slider {
+ background-color: $fg;
+ border-radius: $radius;
+ min-height: 1em;
+ min-width: 1em;
+ margin: -.2em;
+ }
}
}
diff --git a/widget/Battery.tsx b/widget/Battery.tsx
deleted file mode 100644
index d1b70d6..0000000
--- a/widget/Battery.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import Battery from "gi://AstalBattery"
-import { bind } from "astal"
-
-export default function BatteryPercentage() {
- const bat = Battery.get_default()
-
- return <box>
- <button onClick="echo hello" />
- <label label="hi" />
- <label label={bind(bat, "percentage").as((p) => p * 100 + "%")} />
- </box>
-}
diff --git a/widget/Button.tsx b/widget/Button.tsx
deleted file mode 100644
index abc24ca..0000000
--- a/widget/Button.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Variable, bind } from "astal"
-
-type Props = {
- p: string
- child?: JSX.Element
- children?: Array<JSX.Element>
-}
-
-export default function MyButton({p, child, children}: Props) {
- const count = Variable(0)
- const labels = [p +"1", p +"2"]
-
- if (child) {
- console.log(child.label)
- }
-
- function increment() {
- count.set(count.get() + 1)
- }
-
- function handleClick(self, ...args) {
- console.log(self, "was clicked")
- }
- return <box>
- {labels.map(label => (
- <button onClick={handleClick}>
- <label label={label}></label>
- </button>
- ))}
- <button onClick={increment}>
- <label label={bind(count).as(num => num.toString())}></label>
- </button>
- </box>
-}