From d8b083c3a1d93ff7551fe3df666aff3d300efdf7 Mon Sep 17 00:00:00 2001 From: Alexander Pieck Date: Thu, 1 Aug 2024 07:15:57 +0000 Subject: [PATCH] Upload files to ".glzr/zebar" --- .glzr/zebar/config.yaml | 235 ++++++++++++++++++++++++++++++++++++++++ .glzr/zebar/script.js | 5 + .glzr/zebar/start.bat | 5 + 3 files changed, 245 insertions(+) create mode 100644 .glzr/zebar/config.yaml create mode 100644 .glzr/zebar/script.js create mode 100644 .glzr/zebar/start.bat diff --git a/.glzr/zebar/config.yaml b/.glzr/zebar/config.yaml new file mode 100644 index 0000000..d601cf4 --- /dev/null +++ b/.glzr/zebar/config.yaml @@ -0,0 +1,235 @@ +# Yaml is white-space sensitive (use 2 spaces to indent). + +### +# Define a new window with an id of 'bar'. This window can then be opened +# via the Zebar cli by running 'zebar open bar --args '. +# +# Docs regarding window: https://some-future-docs-link.com +window/bar: + providers: ['self'] + # Width of the window in physical pixels. + width: '{{ self.args.MONITOR_WIDTH }}' + # Height of the window in physical pixels. + height: '32' + # X-position of the window in physical pixels. + position_x: '{{ self.args.MONITOR_X }}' + # Y-position of the window in physical pixels. + position_y: '{{ self.args.MONITOR_Y }}' + # Whether to show the window above/below all others. + # Allowed values: 'always_on_top', 'always_on_bottom', 'normal'. + z_order: 'always_on_top' + # Whether the window should be shown in the taskbar. + shown_in_taskbar: false + # Whether the window should have resize handles. + resizable: false + # Styles to apply globally within the window. For example, we can use + # this to import the Nerdfonts icon font. Ref https://www.nerdfonts.com/cheat-sheet + # for a cheatsheet of available Nerdfonts icons. + global_styles: | + @import "https://www.nerdfonts.com/assets/css/webfont.css"; + # CSS styles to apply to the root element within the window. Using CSS + # nesting, we can also target nested elements (e.g. below we set the + # color and margin-right of icons). + styles: | + display: grid; + grid-template-columns: 1fr 1fr 1fr; + align-items: center; + height: 100%; + color: rgb(255 255 255 / 90%); + # font-family: ui-monospace, monospace; + font-family: "VictorMono Nerd Font"; + font-weight: 800; + font-size: 0.85rem; + padding: 4px 24px; + border-bottom: 1px solid rgb(255 255 255 / 5%);; + background: linear-gradient(rgb(0 0 0 / 90%), rgb(5 2 20 / 85%)); + + i { + color: rgb(115 130 175 / 95%); + margin-right: 7px; + } + + group/left: + styles: | + display: flex; + align-items: center; + + template/logo: + styles: | + margin-right: 20px; + template: | + + + template/glazewm_workspaces: + styles: | + display: flex; + align-items: center; + + .workspace { + background: rgb(255 255 255 / 5%); + margin-right: 4px; + padding: 4px 8px; + color: rgb(255 255 255 / 90%); + border: none; + border-radius: 2px; + cursor: pointer; + + &.displayed { + background: rgb(255 255 255 / 15%); + } + + &.focused, + &:hover { + background: rgb(75 115 255 / 50%); + } + } + providers: ['glazewm'] + events: + - type: 'click' + fn_path: 'script.js#focusWorkspace' + selector: '.workspace' + template: | + @for (workspace of glazewm.currentWorkspaces) { + + } + + group/center: + styles: | + justify-self: center; + + template/clock: + providers: ['date'] + # Available date tokens: https://moment.github.io/luxon/#/formatting?id=table-of-tokens + template: | + {{ date.toFormat(date.now, 'EEE d MMM t:ss') }} + + group/right: + styles: | + justify-self: end; + display: flex; + + .template { + margin-left: 20px; + } + + template/glazewm_other: + providers: ['glazewm'] + styles: | + .binding-mode, + .tiling-direction { + background: rgb(255 255 255 / 15%); + color: rgb(255 255 255 / 90%); + border-radius: 2px; + padding: 4px 6px; + margin: 0; + } + + template: | + @for (bindingMode of glazewm.bindingModes) { + + {{ bindingMode.displayName ?? bindingMode.name }} + + } + + @if (glazewm.tilingDirection === 'horizontal') { + + } @else { + + } + + template/network: + providers: ['network'] + template: | + + @if (network.defaultInterface?.type === 'ethernet') { + + } @else if (network.defaultInterface?.type === 'wifi') { + @if (network.defaultGateway?.signalStrength >= 80) {} + @else if (network.defaultGateway?.signalStrength >= 65) {} + @else if (network.defaultGateway?.signalStrength >= 40) {} + @else if (network.defaultGateway?.signalStrength >= 25) {} + @else {} + {{ network.defaultGateway?.ssid }} + } @else { + + } + + # template/ip: + # providers: ['ip'] + # template: | + # + # {{address}} + + template/memory: + providers: ['memory'] + template: | + + {{ Math.round(memory.usage) }}% + + template/cpu: + providers: ['cpu'] + styles: | + .high-usage { + color: #900029; + } + template: | + + + + @if (cpu.usage > 85) { + {{ Math.round(cpu.usage) }}% + } @else { + {{ Math.round(cpu.usage) }}% + } + + template/battery: + providers: ['battery'] + styles: | + position: relative; + color: #13a243; + font-weight: 600; + + .charging-icon { + color: #13a243; + font-weight: 600; + position: absolute; + font-size: 0.8rem; + left: 7px; + top: 2px; + } + template: | + + @if (battery.isCharging) {} + + + @if (battery.chargePercent > 90) {} + @else if (battery.chargePercent > 70) {} + @else if (battery.chargePercent > 40) {} + @else if (battery.chargePercent > 20) {} + @else {} + + {{ Math.round(battery.chargePercent) }}% + + template/weather: + providers: ['weather'] + template: | + @switch (weather.status) { + @case ('clear_day') {} + @case ('clear_night') {} + @case ('cloudy_day') {} + @case ('cloudy_night') {} + @case ('light_rain_day') {} + @case ('light_rain_night') {} + @case ('heavy_rain_day') {} + @case ('heavy_rain_night') {} + @case ('snow_day') {} + @case ('snow_night') {} + @case ('thunder_day') {} + @case ('thunder_night') {} + } + {{ weather.celsiusTemp }}° diff --git a/.glzr/zebar/script.js b/.glzr/zebar/script.js new file mode 100644 index 0000000..a1801a6 --- /dev/null +++ b/.glzr/zebar/script.js @@ -0,0 +1,5 @@ +export function focusWorkspace(event, context) { + console.log('Focus button clicked!', event, context); + const id = event.target.id; + context.providers.glazewm.focusWorkspace(id); +} diff --git a/.glzr/zebar/start.bat b/.glzr/zebar/start.bat new file mode 100644 index 0000000..7c94725 --- /dev/null +++ b/.glzr/zebar/start.bat @@ -0,0 +1,5 @@ +@echo off +@REM Start hidden powershell script, which runs `zebar open bar --args ...` for every monitor. +powershell -WindowStyle hidden -Command ^ + $monitors = zebar monitors; ^ + foreach ($monitor in $monitors) { Start-Process -WindowStyle Hidden -FilePath \"zebar\" -ArgumentList \"open bar --args $monitor\" };