mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
chezmoi: windows migration dir
This commit is contained in:
parent
52b70819bf
commit
c24adf35d4
51 changed files with 3403 additions and 3840 deletions
4
home/dot_glzr/.gitignore
vendored
Normal file
4
home/dot_glzr/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# New-Item -ItemType SymbolicLink -Path $Env:UserProfile\.glzr -Target $DOTFILES\platforms\win\glzr -Force
|
||||
boilerplate*
|
||||
starter/
|
||||
neobrutal/
|
||||
364
home/dot_glzr/glazewm/config.yaml
Normal file
364
home/dot_glzr/glazewm/config.yaml
Normal file
|
|
@ -0,0 +1,364 @@
|
|||
# $DOTFILES/platforms/win/glzr/glazewm/config.yaml
|
||||
# Date: 2025-01-05
|
||||
# Author: js0ny
|
||||
|
||||
# Location:
|
||||
# - %UserProfile%\.glzr\glazewm\config.yaml
|
||||
# Linking: Link to whole directory
|
||||
# New-Item -ItemType SymbolicLink -Path $Env:UserProfile\.glzr -Target $DOTFILES\platforms\win\glzr -Force
|
||||
|
||||
general:
|
||||
# Commands to run when the WM has started. This is useful for running a
|
||||
# script or launching another application.
|
||||
# Example: The below command launches Zebar.
|
||||
startup_commands: ["shell-exec zebar"]
|
||||
|
||||
# Commands to run just before the WM is shutdown.
|
||||
# Example: The below command kills Zebar.
|
||||
shutdown_commands: ["shell-exec taskkill /IM zebar.exe /F"]
|
||||
|
||||
# Commands to run after the WM config is reloaded.
|
||||
config_reload_commands: []
|
||||
|
||||
# Whether to automatically focus windows underneath the cursor.
|
||||
focus_follows_cursor: false
|
||||
|
||||
# Whether to switch back and forth between the previously focused
|
||||
# workspace when focusing the current workspace.
|
||||
toggle_workspace_on_refocus: false
|
||||
|
||||
cursor_jump:
|
||||
# Whether to automatically move the cursor on the specified trigger.
|
||||
enabled: true
|
||||
|
||||
# Trigger for cursor jump:
|
||||
# - 'monitor_focus': Jump when focus changes between monitors.
|
||||
# - 'window_focus': Jump when focus changes between windows.
|
||||
trigger: "monitor_focus"
|
||||
|
||||
# How windows should be hidden when switching workspaces.
|
||||
# - 'cloak': Recommended. Hides windows with no animation.
|
||||
# - 'hide': Legacy method (v3.5 and earlier) that has a brief animation,
|
||||
# but has stability issues with some apps.
|
||||
hide_method: "cloak"
|
||||
|
||||
# Affects which windows get shown in the native Windows taskbar. Has no
|
||||
# effect if `hide_method: 'hide'`.
|
||||
# - 'true': Show all windows (regardless of workspace).
|
||||
# - 'false': Only show windows from the currently shown workspaces.
|
||||
show_all_in_taskbar: false
|
||||
|
||||
gaps:
|
||||
# Whether to scale the gaps with the DPI of the monitor.
|
||||
scale_with_dpi: true
|
||||
|
||||
# Gap between adjacent windows.
|
||||
inner_gap: "5px"
|
||||
|
||||
# Gap between windows and the screen edge.
|
||||
outer_gap:
|
||||
top: "50px"
|
||||
right: "5px"
|
||||
bottom: "5px"
|
||||
left: "5px"
|
||||
|
||||
window_effects:
|
||||
# Visual effects to apply to the focused window.
|
||||
focused_window:
|
||||
# Highlight the window with a colored border.
|
||||
# ** Exclusive to Windows 11 due to API limitations.
|
||||
border:
|
||||
enabled: true
|
||||
color: "#f6a7ba"
|
||||
|
||||
# Remove the title bar from the window's frame. Note that this can
|
||||
# cause rendering issues for some applications.
|
||||
hide_title_bar:
|
||||
enabled: false
|
||||
|
||||
# Change the corner style of the window's frame.
|
||||
# ** Exclusive to Windows 11 due to API limitations.
|
||||
corner_style:
|
||||
enabled: false
|
||||
# Allowed values: 'square', 'rounded', 'small_rounded'.
|
||||
style: "square"
|
||||
|
||||
# Visual effects to apply to non-focused windows.
|
||||
other_windows:
|
||||
border:
|
||||
enabled: false
|
||||
color: "#a1a1a1"
|
||||
hide_title_bar:
|
||||
enabled: false
|
||||
corner_style:
|
||||
enabled: false
|
||||
style: "square"
|
||||
|
||||
window_behavior:
|
||||
# New windows are created in this state whenever possible.
|
||||
# Allowed values: 'tiling', 'floating'.
|
||||
initial_state: "tiling"
|
||||
|
||||
# Sets the default options for when a new window is created. This also
|
||||
# changes the defaults for when the state change commands, like
|
||||
# `set-floating`, are used without any flags.
|
||||
state_defaults:
|
||||
floating:
|
||||
# Whether to center floating windows by default.
|
||||
centered: false
|
||||
|
||||
# Whether to show floating windows as always on top.
|
||||
shown_on_top: false
|
||||
|
||||
fullscreen:
|
||||
# Maximize the window if possible. If the window doesn't have a
|
||||
# maximize button, then it'll be fullscreen'ed normally instead.
|
||||
maximized: false
|
||||
|
||||
# Whether to show fullscreen windows as always on top.
|
||||
shown_on_top: false
|
||||
|
||||
workspaces:
|
||||
- name: "1"
|
||||
- name: "2"
|
||||
- name: "3"
|
||||
- name: "4"
|
||||
- name: "5"
|
||||
- name: "6"
|
||||
- name: "7"
|
||||
- name: "8"
|
||||
- name: "9"
|
||||
|
||||
window_rules:
|
||||
- commands: ["ignore"]
|
||||
match:
|
||||
# Ignores any Zebar windows.
|
||||
- window_process: { equals: "zebar" }
|
||||
|
||||
# Ignores picture-in-picture windows for browsers.
|
||||
- window_title: { regex: "[Pp]icture.in.[Pp]icture" }
|
||||
window_class: { regex: "Chrome_WidgetWin_1|MozillaDialogClass" }
|
||||
|
||||
# Notion Desktop Popup
|
||||
- window_process: { equals: "Notion" }
|
||||
window_class: { regex: "Chrome_WidgetWin_1" }
|
||||
|
||||
# PowerToys Tools
|
||||
- window_process: { equals: "PowerToys" }
|
||||
window_class: { regex: 'HwndWrapper\[PowerToys\.PowerAccent.*?\]' }
|
||||
- window_process: { equals: "PowerToys" }
|
||||
window_title: { regex: ".*? - Peek" }
|
||||
# PowerToys Command Palette
|
||||
- window_title: { equals: "Command Palette" }
|
||||
window_class: { equals: "WinUIDesktopWin32WindowClass" }
|
||||
# Quake-style consoles.
|
||||
- window_process: { equals: "WindowsTerminal" }
|
||||
window_class: { equals: "CASCADIA_HOSTING_WINDOW_CLASS" }
|
||||
# Misc
|
||||
- window_process: { equals: "Lively" }
|
||||
window_class: { regex: "HwndWrapper" }
|
||||
- commands: ["set-floating"]
|
||||
match:
|
||||
# Razer Synapse
|
||||
- window_process: { equals: "RazerAppEngine" }
|
||||
# AutoHotKey Window Spy
|
||||
- window_process: { equals: "AutoHotkeyUX" }
|
||||
- window_process: { equals: "ApplicationFrameHost" }
|
||||
window_title: { regex: "Settings|设置" }
|
||||
## Messenger Picture Preview
|
||||
# QQ 图片预览
|
||||
- window_process: { equals: "QQ" }
|
||||
window_title: { equals: "图片查看器" }
|
||||
# 微信图片视图
|
||||
- window_process: { equals: "WeChat" }
|
||||
window_class: { equals: "ImagePreviewWnd" }
|
||||
# 微信朋友圈视图
|
||||
- window_process: { equals: "WeChat" }
|
||||
window_class: { equals: "SnsWnd" }
|
||||
- window_process: { equals: "setup" }
|
||||
window_title: { equals: "Visual Studio Installer" }
|
||||
# JetBrains IDEs Floating Dialogs
|
||||
- window_class: { equals: "SunAwtDialog" }
|
||||
window_process:
|
||||
{ regex: "rider64|idea64|goland64|rustrover64|clion64|pycharm64" }
|
||||
## Browser
|
||||
- window_process: { equals: "vivaldi" }
|
||||
window_title: { regex: "^Vivaldi 设置.*$" }
|
||||
- window_process: { equals: "vivaldi" }
|
||||
window_title: { regex: "^Bitwarden.*$" }
|
||||
## KDE Apps on Windows, Configure & Keymap Popup
|
||||
- window_class: { regex: "^Qt681QWindow(Icon)?$" }
|
||||
window_title: { regex: "^Configure.*$" }
|
||||
- window_process: { equals: "haruna" }
|
||||
window_title: { regex: "^Settings.*$" }
|
||||
- window_process: { equals: "steamwebhelper" }
|
||||
window_title: { equals: "好友列表" }
|
||||
binding_modes:
|
||||
# When enabled, the focused window can be resized via arrow keys or HJKL.
|
||||
- name: "resize"
|
||||
keybindings:
|
||||
- commands: ["resize --width -2%"]
|
||||
bindings: ["h", "left"]
|
||||
- commands: ["resize --width +2%"]
|
||||
bindings: ["i", "right"]
|
||||
- commands: ["resize --height +2%"]
|
||||
bindings: ["e", "up"]
|
||||
- commands: ["resize --height -2%"]
|
||||
bindings: ["n", "down"]
|
||||
# Press enter/escape to return to default keybindings.
|
||||
- commands: ["wm-disable-binding-mode --name resize"]
|
||||
bindings: ["escape", "enter"]
|
||||
|
||||
keybindings:
|
||||
# Shift focus in a given direction.
|
||||
- commands: ["focus --direction left"]
|
||||
bindings: ["lwin+h", "lwin+left"]
|
||||
- commands: ["focus --direction right"]
|
||||
bindings: ["lwin+i", "lwin+right"]
|
||||
- commands: ["focus --direction up"]
|
||||
bindings: ["lwin+e", "lwin+up"]
|
||||
- commands: ["focus --direction down"]
|
||||
bindings: ["lwin+n", "lwin+down"]
|
||||
|
||||
# Move focused window in a given direction.
|
||||
- commands: ["move --direction left"]
|
||||
bindings: ["lwin+shift+h", "lwin+shift+left"]
|
||||
- commands: ["move --direction right"]
|
||||
bindings: ["lwin+shift+i", "lwin+shift+right"]
|
||||
- commands: ["move --direction up"]
|
||||
bindings: ["lwin+shift+e", "lwin+shift+up"]
|
||||
- commands: ["move --direction down"]
|
||||
bindings: ["lwin+shift+n", "lwin+shift+down"]
|
||||
|
||||
# Resize focused window by a percentage or pixel amount.
|
||||
# - commands: ["resize --width -2%"]
|
||||
# bindings: ["alt+u"]
|
||||
# - commands: ["resize --width +2%"]
|
||||
# bindings: ["alt+p"]
|
||||
# - commands: ["resize --height +2%"]
|
||||
# bindings: ["alt+o"]
|
||||
# - commands: ["resize --height -2%"]
|
||||
# bindings: ["alt+i"]
|
||||
|
||||
# As an alternative to the resize keybindings above, resize mode enables
|
||||
# resizing via arrow keys or HJKL. The binding mode is defined above with
|
||||
# the name 'resize'.
|
||||
- commands: ["wm-enable-binding-mode --name resize"]
|
||||
bindings: ["lwin+shift+r"]
|
||||
|
||||
# Disables window management and all other keybindings until alt+shift+p
|
||||
# is pressed again.
|
||||
- commands: ["wm-toggle-pause"]
|
||||
bindings: ["alt+shift+p"]
|
||||
|
||||
# Change tiling direction. This determines where new tiling windows will
|
||||
# be inserted.
|
||||
- commands: ["toggle-tiling-direction"]
|
||||
bindings: ["lwin+x"]
|
||||
|
||||
# Change focus from tiling windows -> floating -> fullscreen.
|
||||
# - commands: ["wm-cycle-focus"]
|
||||
# bindings: ["alt+space"]
|
||||
|
||||
# Change the focused window to be floating.
|
||||
- commands: ["toggle-floating --centered"]
|
||||
bindings: ["lwin+shift+f"]
|
||||
|
||||
# Change the focused window to be tiling.
|
||||
- commands: ["toggle-tiling"]
|
||||
bindings: ["lwin+t"]
|
||||
|
||||
# Change the focused window to be fullscreen.
|
||||
- commands: ["toggle-fullscreen"]
|
||||
bindings: ["lwin+ctrl+f"]
|
||||
- commands: ["shell-exec dopus.exe"]
|
||||
bindings: ["lwin+f"]
|
||||
|
||||
# Minimize focused window.
|
||||
- commands: ["toggle-minimized"]
|
||||
bindings: ["lwin+m"]
|
||||
|
||||
# Close focused window.
|
||||
- commands: ["close"]
|
||||
bindings: ["lwin+q"]
|
||||
|
||||
# Kill GlazeWM process safely.
|
||||
- commands: ["wm-exit"]
|
||||
bindings: ["alt+shift+e"]
|
||||
|
||||
# Re-evaluate configuration file.
|
||||
- commands: ["wm-reload-config"]
|
||||
bindings: ["alt+shift+r"]
|
||||
|
||||
# Redraw all windows.
|
||||
- commands: ["wm-redraw"]
|
||||
bindings: ["lwin+shift+w"]
|
||||
|
||||
# Launch CMD terminal. Alternatively, use `shell-exec wt` or
|
||||
# `shell-exec %ProgramFiles%/Git/git-bash.exe` to start Windows
|
||||
# Terminal and Git Bash respectively.
|
||||
- commands: ["shell-exec wezterm-gui.exe start"]
|
||||
bindings: ["lwin+r"]
|
||||
- commands: ["shell-exec sharex -RectangleRegion"]
|
||||
bindings: ["lwin+c"]
|
||||
|
||||
# Focus the next/previous active workspace defined in `workspaces` config.
|
||||
# - commands: ["focus --next-active-workspace"]
|
||||
# bindings: ["alt+s"]
|
||||
# - commands: ["focus --prev-active-workspace"]
|
||||
# bindings: ["alt+a"]
|
||||
|
||||
# Focus the workspace that last had focus.
|
||||
- commands: ["focus --recent-workspace"]
|
||||
bindings: ["alt+d"]
|
||||
|
||||
# Change focus to a workspace defined in `workspaces` config.
|
||||
- commands: ["focus --workspace 1"]
|
||||
bindings: ["lwin+1"]
|
||||
- commands: ["focus --workspace 2"]
|
||||
bindings: ["lwin+2"]
|
||||
- commands: ["focus --workspace 3"]
|
||||
bindings: ["lwin+3"]
|
||||
- commands: ["focus --workspace 4"]
|
||||
bindings: ["lwin+4"]
|
||||
- commands: ["focus --workspace 5"]
|
||||
bindings: ["lwin+5"]
|
||||
- commands: ["focus --workspace 6"]
|
||||
bindings: ["lwin+6"]
|
||||
- commands: ["focus --workspace 7"]
|
||||
bindings: ["lwin+7"]
|
||||
- commands: ["focus --workspace 8"]
|
||||
bindings: ["lwin+8"]
|
||||
- commands: ["focus --workspace 9"]
|
||||
bindings: ["lwin+9"]
|
||||
|
||||
# Move the focused window's parent workspace to a monitor in a given
|
||||
# direction.
|
||||
# - commands: ["move-workspace --direction left"]
|
||||
# bindings: ["alt+shift+a"]
|
||||
# - commands: ["move-workspace --direction right"]
|
||||
# bindings: ["alt+shift+f"]
|
||||
# - commands: ["move-workspace --direction up"]
|
||||
# bindings: ["alt+shift+d"]
|
||||
# - commands: ["move-workspace --direction down"]
|
||||
# bindings: ["alt+shift+s"]
|
||||
|
||||
# Move focused window to a workspace defined in `workspaces` config.
|
||||
- commands: ["move --workspace 1", "focus --workspace 1"]
|
||||
bindings: ["lwin+shift+1"]
|
||||
- commands: ["move --workspace 2", "focus --workspace 2"]
|
||||
bindings: ["lwin+shift+2"]
|
||||
- commands: ["move --workspace 3", "focus --workspace 3"]
|
||||
bindings: ["lwin+shift+3"]
|
||||
- commands: ["move --workspace 4", "focus --workspace 4"]
|
||||
bindings: ["lwin+shift+4"]
|
||||
- commands: ["move --workspace 5", "focus --workspace 5"]
|
||||
bindings: ["lwin+shift+5"]
|
||||
- commands: ["move --workspace 6", "focus --workspace 6"]
|
||||
bindings: ["lwin+shift+6"]
|
||||
- commands: ["move --workspace 7", "focus --workspace 7"]
|
||||
bindings: ["lwin+shift+7"]
|
||||
- commands: ["move --workspace 8", "focus --workspace 8"]
|
||||
bindings: ["lwin+shift+8"]
|
||||
- commands: ["move --workspace 9", "focus --workspace 9"]
|
||||
bindings: ["lwin+shift+9"]
|
||||
38
home/dot_glzr/readme.md
Normal file
38
home/dot_glzr/readme.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# GlazeWM Setup
|
||||
|
||||
Link the whole `glzr` directory to the user's home directory.
|
||||
|
||||
```powershell
|
||||
New-Item -ItemType SymbolicLink -Path $Env:UserProfile\.glzr -Target $DOTFILES\platforms\win\glzr -Force
|
||||
```
|
||||
|
||||
The Zebar config should be downloaded from [this repository](https://github.com/js0ny/neobrutal-zebar) and extracted to the `glzr\zebar` directory.
|
||||
|
||||
```powershell
|
||||
Invoke-WebRequest -Uri "https://github.com/js0ny/neobrutal-zebar/releases/download/2/neobrutal.zip" -OutFile "$Env:UserProfile\.glzr\zebar\neobrutal.zip"
|
||||
Expand-Archive -Path "$Env:UserProfile\.glzr\zebar\neobrutal.zip" -DestinationPath "$Env:UserProfile\.glzr\zebar"
|
||||
Remove-Item -Path "$Env:UserProfile\.glzr\zebar\neobrutal.zip"
|
||||
```
|
||||
|
||||
If `just` and `pwsh` are installed, you can build the config by running `just build-zebar`.
|
||||
|
||||
```powershell
|
||||
git clone https://github.com/js0ny/neobrutal-zebar.git --depth 1
|
||||
just init
|
||||
just build
|
||||
```
|
||||
|
||||
Or use the minimal setup, by changing `glzr\zebar\settings.json`: `startupConfigs.path` to `minimal/bar.zebar.json`.
|
||||
|
||||
```diff
|
||||
{
|
||||
"$schema": "https://github.com/glzr-io/zebar/raw/v2.4.0/resources/settings-schema.json",
|
||||
"startupConfigs": [
|
||||
{
|
||||
- "path": "neobrutal/bar.zebar.json",
|
||||
+ "path": "minimal/bar.zebar.json",
|
||||
"preset": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
22
home/dot_glzr/zebar/minimal/bar.zebar.json
Normal file
22
home/dot_glzr/zebar/minimal/bar.zebar.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"$schema": "https://github.com/glzr-io/zebar/raw/v2.4.0/resources/widget-schema.json",
|
||||
"htmlPath": "./index.html",
|
||||
"zOrder": "normal",
|
||||
"shownInTaskbar": false,
|
||||
"focused": false,
|
||||
"resizable": false,
|
||||
"transparent": true,
|
||||
"presets": [
|
||||
{
|
||||
"name": "default",
|
||||
"anchor": "top_left",
|
||||
"offsetX": "0px",
|
||||
"offsetY": "0px",
|
||||
"width": "100%",
|
||||
"height": "40px",
|
||||
"monitorSelection": {
|
||||
"type": "all"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
29
home/dot_glzr/zebar/minimal/index.html
Normal file
29
home/dot_glzr/zebar/minimal/index.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<!-- Base styles for better consistency across platforms (aka. CSS reset). -->
|
||||
<link rel="stylesheet" type="text/css" href="../normalize.css" />
|
||||
|
||||
<!-- Custom styles. -->
|
||||
<link rel="stylesheet" type="text/css" href="./styles.css" />
|
||||
|
||||
<!-- Add empty favicon to suppress not found errors. -->
|
||||
<link rel="icon" href="data:;" />
|
||||
|
||||
<!-- Allows React to be run buildless via "text/babel" script below. -->
|
||||
<script
|
||||
src="https://unpkg.com/@babel/standalone@7.25.6/babel.min.js"
|
||||
integrity="sha256-aS0B0wnsaDByLfE16h4MDCP1fQFccysd1YWOcV+gbBo="
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
<script type="text/babel" data-type="module" src="./scripts.jsx">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
197
home/dot_glzr/zebar/minimal/scripts.jsx
Normal file
197
home/dot_glzr/zebar/minimal/scripts.jsx
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
} from 'https://esm.sh/react@18?dev';
|
||||
import { createRoot } from 'https://esm.sh/react-dom@18/client?dev';
|
||||
import * as zebar from 'https://esm.sh/zebar@2';
|
||||
|
||||
const providers = zebar.createProviderGroup({
|
||||
// network: { type: 'network' },
|
||||
glazewm: { type: 'glazewm' },
|
||||
cpu: { type: 'cpu' },
|
||||
date: { type: 'date', formatting: 'HH:mm:ss MMM月d日 EEE', locale: 'zh-CN' },
|
||||
battery: { type: 'battery' },
|
||||
memory: { type: 'memory' },
|
||||
weather: { type: 'weather' },
|
||||
});
|
||||
|
||||
function getNetworkIcon(networkOutput) {
|
||||
switch (networkOutput.defaultInterface?.type) {
|
||||
case 'ethernet':
|
||||
return <i className="nf nf-md-ethernet_cable"></i>;
|
||||
case 'wifi':
|
||||
if (networkOutput.defaultGateway?.signalStrength >= 80) {
|
||||
return <i className="nf nf-md-wifi_strength_4"></i>;
|
||||
} else if (
|
||||
networkOutput.defaultGateway?.signalStrength >= 65
|
||||
) {
|
||||
return <i className="nf nf-md-wifi_strength_3"></i>;
|
||||
} else if (
|
||||
networkOutput.defaultGateway?.signalStrength >= 40
|
||||
) {
|
||||
return <i className="nf nf-md-wifi_strength_2"></i>;
|
||||
} else if (
|
||||
networkOutput.defaultGateway?.signalStrength >= 25
|
||||
) {
|
||||
return <i className="nf nf-md-wifi_strength_1"></i>;
|
||||
} else {
|
||||
return <i className="nf nf-md-wifi_strength_outline"></i>;
|
||||
}
|
||||
default:
|
||||
return (
|
||||
<i className="nf nf-md-wifi_strength_off_outline"></i>
|
||||
);
|
||||
}
|
||||
}
|
||||
// Get icon to show for how much of the battery is charged.
|
||||
function getBatteryIcon(batteryOutput) {
|
||||
if (batteryOutput.chargePercent > 90)
|
||||
return <i className="nf nf-fa-battery_4"></i>;
|
||||
if (batteryOutput.chargePercent > 70)
|
||||
return <i className="nf nf-fa-battery_3"></i>;
|
||||
if (batteryOutput.chargePercent > 40)
|
||||
return <i className="nf nf-fa-battery_2"></i>;
|
||||
if (batteryOutput.chargePercent > 20)
|
||||
return <i className="nf nf-fa-battery_1"></i>;
|
||||
return <i className="nf nf-fa-battery_0"></i>;
|
||||
}
|
||||
// Get icon to show for current weather status.
|
||||
function getWeatherIcon(weatherOutput) {
|
||||
switch (weatherOutput.status) {
|
||||
case 'clear_day':
|
||||
return <i className="nf nf-weather-day_sunny"></i>;
|
||||
case 'clear_night':
|
||||
return <i className="nf nf-weather-night_clear"></i>;
|
||||
case 'cloudy_day':
|
||||
return <i className="nf nf-weather-day_cloudy"></i>;
|
||||
case 'cloudy_night':
|
||||
return <i className="nf nf-weather-night_alt_cloudy"></i>;
|
||||
case 'light_rain_day':
|
||||
return <i className="nf nf-weather-day_sprinkle"></i>;
|
||||
case 'light_rain_night':
|
||||
return <i className="nf nf-weather-night_alt_sprinkle"></i>;
|
||||
case 'heavy_rain_day':
|
||||
return <i className="nf nf-weather-day_rain"></i>;
|
||||
case 'heavy_rain_night':
|
||||
return <i className="nf nf-weather-night_alt_rain"></i>;
|
||||
case 'snow_day':
|
||||
return <i className="nf nf-weather-day_snow"></i>;
|
||||
case 'snow_night':
|
||||
return <i className="nf nf-weather-night_alt_snow"></i>;
|
||||
case 'thunder_day':
|
||||
return <i className="nf nf-weather-day_lightning"></i>;
|
||||
case 'thunder_night':
|
||||
return <i className="nf nf-weather-night_alt_lightning"></i>;
|
||||
}
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root')).render(<App />);
|
||||
|
||||
function App() {
|
||||
const [output, setOutput] = useState(providers.outputMap);
|
||||
|
||||
useEffect(() => {
|
||||
providers.onOutput(() => setOutput(providers.outputMap));
|
||||
}, []);
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="app">
|
||||
<div className="left">
|
||||
<i className="logo nf nf-custom-windows"></i>
|
||||
{output.glazewm && (
|
||||
<div className="workspaces">
|
||||
{output.glazewm.currentWorkspaces.map(workspace => (
|
||||
<button
|
||||
className={`workspace ${workspace.hasFocus && 'focused'} ${workspace.isDisplayed && 'displayed'}`}
|
||||
onClick={() =>
|
||||
output.glazewm.runCommand(
|
||||
`focus --workspace ${workspace.name}`,
|
||||
)
|
||||
}
|
||||
key={workspace.name}
|
||||
>
|
||||
{workspace.displayName ?? workspace.name}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="center">{output.date?.formatted}</div>
|
||||
|
||||
<div className="right">
|
||||
{output.glazewm && (
|
||||
<>
|
||||
{output.glazewm.bindingModes.map(bindingMode => (
|
||||
<button
|
||||
className="binding-mode"
|
||||
key={bindingMode.name}
|
||||
onClick={() =>
|
||||
output.glazewm.runCommand(
|
||||
`wm-disable-binding-mode --name ${bindingMode.name}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{bindingMode.displayName ?? bindingMode.name}
|
||||
</button>
|
||||
))}
|
||||
|
||||
<button
|
||||
className={`tiling-direction nf ${output.glazewm.tilingDirection === 'horizontal' ? 'nf-md-swap_horizontal' : 'nf-md-swap_vertical'}`}
|
||||
onClick={() =>
|
||||
output.glazewm.runCommand('toggle-tiling-direction')
|
||||
}
|
||||
></button>
|
||||
</>
|
||||
)}
|
||||
|
||||
{output.network && (
|
||||
<div className="network">
|
||||
{getNetworkIcon(output.network)}
|
||||
{output.network.defaultGateway?.ssid}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{output.memory && (
|
||||
<div className="memory">
|
||||
<i className="nf nf-fae-chip"></i>
|
||||
{Math.round(output.memory.usage)}%
|
||||
</div>
|
||||
)}
|
||||
|
||||
{output.cpu && (
|
||||
<div className="cpu">
|
||||
<i className="nf nf-oct-cpu"></i>
|
||||
|
||||
{/* Change the text color if the CPU usage is high. */}
|
||||
<span
|
||||
className={output.cpu.usage > 85 ? 'high-usage' : ''}
|
||||
>
|
||||
{Math.round(output.cpu.usage)}%
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{output.battery && (
|
||||
<div className="battery">
|
||||
{/* Show icon for whether battery is charging. */}
|
||||
{output.battery.isCharging && (
|
||||
<i className="nf nf-md-power_plug charging-icon"></i>
|
||||
)}
|
||||
{getBatteryIcon(output.battery)}
|
||||
{Math.round(output.battery.chargePercent)}%
|
||||
</div>
|
||||
)}
|
||||
|
||||
{output.weather && (
|
||||
<div className="weather">
|
||||
{getWeatherIcon(output.weather)}
|
||||
{Math.round(output.weather.celsiusTemp)}°C
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
115
home/dot_glzr/zebar/minimal/styles.css
Normal file
115
home/dot_glzr/zebar/minimal/styles.css
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/**
|
||||
* Import the Nerdfonts icon font.
|
||||
* Ref https://www.nerdfonts.com/cheat-sheet for a cheatsheet of available Nerdfonts icons.
|
||||
*/
|
||||
@import 'https://www.nerdfonts.com/assets/css/webfont.css';
|
||||
|
||||
i {
|
||||
color: rgb(115 130 175 / 95%);
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
body {
|
||||
color: rgb(255 255 255 / 90%);
|
||||
font-family: "JetBrainsMono Nerd Font", "LXGW Wenkai", ui-monospace, monospace;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#root {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#root {
|
||||
border-bottom: 1px solid rgb(255 255 255 / 5%);
|
||||
background: linear-gradient(rgb(0 0 0 / 90%), rgb(5 2 20 / 85%));
|
||||
}
|
||||
|
||||
.app {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
padding: 4px 1.5vw;
|
||||
}
|
||||
|
||||
.left,
|
||||
.center,
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center {
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
justify-self: end;
|
||||
}
|
||||
|
||||
.logo,
|
||||
.binding-mode,
|
||||
.tiling-direction,
|
||||
.network,
|
||||
.memory,
|
||||
.cpu,
|
||||
.battery {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
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%);
|
||||
}
|
||||
}
|
||||
|
||||
.binding-mode,
|
||||
.tiling-direction {
|
||||
background: rgb(255 255 255 / 15%);
|
||||
color: rgb(255 255 255 / 90%);
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
padding: 4px 8px;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.binding-mode {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.cpu .high-usage {
|
||||
color: #900029;
|
||||
}
|
||||
|
||||
.battery {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.battery .charging-icon {
|
||||
position: absolute;
|
||||
font-size: 7px;
|
||||
left: -8px;
|
||||
top: 3px;
|
||||
}
|
||||
204
home/dot_glzr/zebar/normalize.css
vendored
Normal file
204
home/dot_glzr/zebar/normalize.css
vendored
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
/**
|
||||
* Base CSS styles for better consistency across platforms.
|
||||
* Yoinked from: https://github.com/sindresorhus/modern-normalize
|
||||
*/
|
||||
|
||||
/*
|
||||
Document
|
||||
========
|
||||
*/
|
||||
|
||||
/**
|
||||
Use a better box model (opinionated).
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
/* Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) */
|
||||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
|
||||
'Apple Color Emoji', 'Segoe UI Emoji';
|
||||
line-height: 1.15; /* 1. Correct the line height in all browsers. */
|
||||
-webkit-text-size-adjust: 100%; /* 2. Prevent adjustments of font size after orientation changes in iOS. */
|
||||
tab-size: 4; /* 3. Use a more readable tab size (opinionated). */
|
||||
}
|
||||
|
||||
/*
|
||||
Sections
|
||||
========
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0; /* Remove the margin in all browsers. */
|
||||
}
|
||||
|
||||
/*
|
||||
Text-level semantics
|
||||
====================
|
||||
*/
|
||||
|
||||
/**
|
||||
Add the correct font weight in Chrome and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
|
||||
2. Correct the odd 'em' font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono',
|
||||
Menlo, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
Tabular data
|
||||
============
|
||||
*/
|
||||
|
||||
/**
|
||||
Correct table border color inheritance in Chrome and Safari. (https://issues.chromium.org/issues/40615503, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
*/
|
||||
|
||||
table {
|
||||
border-color: currentcolor;
|
||||
}
|
||||
|
||||
/*
|
||||
Forms
|
||||
=====
|
||||
*/
|
||||
|
||||
/**
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
line-height: 1.15; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to 'inherit' in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Interactive
|
||||
===========
|
||||
*/
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
9
home/dot_glzr/zebar/settings.json
Normal file
9
home/dot_glzr/zebar/settings.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"$schema": "https://github.com/glzr-io/zebar/raw/v2.4.0/resources/settings-schema.json",
|
||||
"startupConfigs": [
|
||||
{
|
||||
"path": "neobrutal/bar.zebar.json",
|
||||
"preset": "default"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue