Fix icon badge centering, remove uptime card, fix weather location, 3 tiles per row
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
LOCATION="Great+Falls,VA"
|
||||
|
||||
icon=$(omarchy-weather-icon 2>/dev/null)
|
||||
weather=$(curl -fsS --max-time 4 "https://wttr.in/${LOCATION}?format=%l|%t|%w" 2>/dev/null | tr -d '\n')
|
||||
|
||||
if [[ -z $weather ]]; then
|
||||
echo "Weather unavailable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IFS='|' read -r place temperature wind <<< "$weather"
|
||||
place=${place%%,*}
|
||||
temperature=${temperature#+}
|
||||
|
||||
echo "$icon $place · Temp $temperature · Wind $wind"
|
||||
@@ -396,12 +396,6 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.widget-hero-value {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: @foreground;
|
||||
}
|
||||
|
||||
.widget-stat-row {
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
@@ -144,8 +144,6 @@ function Toggles() {
|
||||
sh("omarchy-launch-bluetooth")
|
||||
}}
|
||||
/>
|
||||
</box>
|
||||
<box class="qs-tiles" spacing={8} homogeneous>
|
||||
<Tile
|
||||
icon={""}
|
||||
label="Wallpaper"
|
||||
@@ -154,6 +152,8 @@ function Toggles() {
|
||||
sh("blob_wallpaper")
|
||||
}}
|
||||
/>
|
||||
</box>
|
||||
<box class="qs-tiles" spacing={8} homogeneous>
|
||||
<Tile
|
||||
icon={""}
|
||||
label="Silence"
|
||||
@@ -163,8 +163,6 @@ function Toggles() {
|
||||
sh("makoctl mode -t do-not-disturb")
|
||||
}}
|
||||
/>
|
||||
</box>
|
||||
<box class="qs-tiles" spacing={8} homogeneous>
|
||||
<Tile
|
||||
icon={""}
|
||||
label="Night Light"
|
||||
@@ -175,6 +173,8 @@ function Toggles() {
|
||||
}}
|
||||
/>
|
||||
<Tile icon={""} label="Record" onClicked={() => { closePanel(); sh("omarchy-capture-screenrecording") }} />
|
||||
</box>
|
||||
<box class="qs-tiles" spacing={8} homogeneous>
|
||||
<Tile icon={""} label="Pick Color" onClicked={() => { closePanel(); sh("hyprpicker -a") }} />
|
||||
</box>
|
||||
</box>
|
||||
@@ -318,19 +318,6 @@ function CalendarSection() {
|
||||
)
|
||||
}
|
||||
|
||||
const uptime = createPoll("", 60000, shell("uptime -p"), (stdout) =>
|
||||
stdout.trim().replace(/^up /, ""),
|
||||
)
|
||||
|
||||
function UptimeCard() {
|
||||
return (
|
||||
<box class="panel widget-card" vertical spacing={10}>
|
||||
<CardHeader icon={""} title="Uptime" />
|
||||
<label class="widget-hero-value" label={uptime} xalign={0} halign={Gtk.Align.START} wrap />
|
||||
</box>
|
||||
)
|
||||
}
|
||||
|
||||
type Weather = { ok: boolean; icon: string; place: string; temp: string; wind: string }
|
||||
|
||||
function parseWeather(raw: string): Weather {
|
||||
@@ -349,7 +336,7 @@ function parseWeather(raw: string): Weather {
|
||||
const weather = createPoll<Weather>(
|
||||
{ ok: false, icon: "", place: "Loading...", temp: "", wind: "" },
|
||||
600000,
|
||||
shell("omarchy-weather-status"),
|
||||
shell("bash $HOME/.config/ags/lib/weather.sh"),
|
||||
(stdout) => parseWeather(stdout.trim()),
|
||||
)
|
||||
|
||||
@@ -375,7 +362,6 @@ function WeatherCard() {
|
||||
function LeftPanel() {
|
||||
return (
|
||||
<box class="qs-side-panel" vertical spacing={12}>
|
||||
<UptimeCard />
|
||||
<WeatherCard />
|
||||
</box>
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@ import { Gtk } from "ags/gtk3"
|
||||
export function CardHeader({ icon, title }: { icon: any; title: any }) {
|
||||
return (
|
||||
<box class="widget-card-header" spacing={10}>
|
||||
<box class="widget-icon-badge" halign={Gtk.Align.CENTER} valign={Gtk.Align.CENTER}>
|
||||
<label label={icon} xalign={0.5} yalign={0.5} halign={Gtk.Align.CENTER} valign={Gtk.Align.CENTER} />
|
||||
<box class="widget-icon-badge">
|
||||
<label label={icon} hexpand vexpand halign={Gtk.Align.CENTER} valign={Gtk.Align.CENTER} />
|
||||
</box>
|
||||
<label class="widget-card-title" label={title} xalign={0} halign={Gtk.Align.START} hexpand />
|
||||
</box>
|
||||
|
||||
Reference in New Issue
Block a user