chezmoi: windows migration dir

This commit is contained in:
js0ny 2025-10-20 03:58:34 +01:00
parent 52b70819bf
commit c24adf35d4
51 changed files with 3403 additions and 3840 deletions

View file

@ -19,6 +19,7 @@ scripts
.config/systemd
.config/user-dirs.dirs
.config/user-dirs.locale
.local/share/kio/
{{ end }}
{{ if eq .chezmoi.os "linux" }}
@ -53,4 +54,8 @@ Library
{{ if ne .chezmoi.os "windows" }}
.gitconfig
.glzr
.wslconfig
.wslgconfig
Appdata/
{{ end }}

View file

@ -0,0 +1,72 @@
; Use %KOMOREBI_CONFIG_HOME% Environment Variable to set the path to the config file
#Requires AutoHotkey v2.0.2
#SingleInstance Force
Komorebic(cmd) {
RunWait(format("komorebic.exe {}", cmd), , "Hide")
}
#q:: Komorebic("close")
#m:: Komorebic("minimize")
; Focus windows
#h:: Komorebic("focus left")
#n:: Komorebic("focus down")
#e:: Komorebic("focus up")
#i:: Komorebic("focus right")
#+[:: Komorebic("cycle-focus previous")
#+]:: Komorebic("cycle-focus next")
; Move windows
#+h:: Komorebic("move left")
#+n:: Komorebic("move down")
#+e:: Komorebic("move up")
#+i:: Komorebic("move right")
; Stack windows
#Left:: Komorebic("stack left")
#Down:: Komorebic("stack down")
#Up:: Komorebic("stack up")
#Right:: Komorebic("stack right")
#;:: Komorebic("unstack")
#[:: Komorebic("cycle-stack previous")
#]:: Komorebic("cycle-stack next")
; Resize
#=:: Komorebic("resize-axis horizontal increase")
#-:: Komorebic("resize-axis horizontal decrease")
#+=:: Komorebic("resize-axis vertical increase")
#+_:: Komorebic("resize-axis vertical decrease")
; Manipulate windows
#t:: Komorebic("toggle-float")
#f:: Komorebic("toggle-monocle")
; Window manager options
#+r:: Komorebic("retile")
#p:: Komorebic("toggle-pause")
; Layouts
#x:: Komorebic("flip-layout horizontal")
#y:: Komorebic("flip-layout vertical")
; Workspaces
#1:: Komorebic("focus-workspace 0")
#2:: Komorebic("focus-workspace 1")
#3:: Komorebic("focus-workspace 2")
#4:: Komorebic("focus-workspace 3")
#5:: Komorebic("focus-workspace 4")
#6:: Komorebic("focus-workspace 5")
#7:: Komorebic("focus-workspace 6")
#8:: Komorebic("focus-workspace 7")
; Move windows across workspaces
#+1:: Komorebic("move-to-workspace 0")
#+2:: Komorebic("move-to-workspace 1")
#+3:: Komorebic("move-to-workspace 2")
#+4:: Komorebic("move-to-workspace 3")
#+5:: Komorebic("move-to-workspace 4")
#+6:: Komorebic("move-to-workspace 5")
#+7:: Komorebic("move-to-workspace 6")
#+8:: Komorebic("move-to-workspace 7")

View file

@ -0,0 +1,73 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.34/schema.bar.json",
"monitor": 0,
"font_family": "JetBrains Mono",
"theme": {
"palette": "Base16",
"name": "Ashes",
"accent": "Base0D"
},
"left_widgets": [
{
"Komorebi": {
"workspaces": {
"enable": true,
"hide_empty_workspaces": false
},
"layout": {
"enable": true
},
"focused_window": {
"enable": true,
"show_icon": true
}
}
}
],
"right_widgets": [
{
"Update": {
"enable": true
}
},
{
"Media": {
"enable": true
}
},
{
"Storage": {
"enable": true
}
},
{
"Memory": {
"enable": true
}
},
{
"Network": {
"enable": true,
"show_total_data_transmitted": true,
"show_network_activity": true
}
},
{
"Date": {
"enable": true,
"format": "DayDateMonthYear"
}
},
{
"Time": {
"enable": true,
"format": "TwentyFourHour"
}
},
{
"Battery": {
"enable": true
}
}
]
}

View file

@ -0,0 +1,58 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.34/schema.json",
"app_specific_configuration_path": "$Env:KOMOREBI_CONFIG_HOME/applications.json",
"window_hiding_behaviour": "Cloak",
"cross_monitor_move_behaviour": "Insert",
"default_workspace_padding": 20,
"default_container_padding": 20,
"border": true,
"border_width": 8,
"border_offset": -1,
"theme": {
"palette": "Base16",
"name": "Ashes",
"unfocused_border": "Base03",
"bar_accent": "Base0D"
},
"stackbar": {
"height": 40,
"mode": "OnStack",
"tabs": {
"width": 300
}
},
"monitors": [
{
"workspaces": [
{
"name": "I",
"layout": "BSP"
},
{
"name": "II",
"layout": "VerticalStack"
},
{
"name": "III",
"layout": "HorizontalStack"
},
{
"name": "IV",
"layout": "UltrawideVerticalStack"
},
{
"name": "V",
"layout": "Rows"
},
{
"name": "VI",
"layout": "Grid"
},
{
"name": "VII",
"layout": "RightMainVerticalStack"
}
]
}
]
}

View file

@ -0,0 +1,17 @@
# NOTE: FOR WSL ONLY
# https://github.com/microsoft/WSL/issues/11261
# ~/.config/systemd/user/symlink-wayland-socket.service
# Usage:
# systemctl --user enable symlink-wayland-socket.service
# Cannot use GUI apps/tools as Wayland socket doesn't exist in `XDG_RUNTIME_DIR`
[Unit]
Description=Symlink Wayland socket to XDG_RUNTIME_DIR
[Service]
Type=oneshot
ExecStart=/usr/bin/ln -s /mnt/wslg/runtime-dir/wayland-0 $XDG_RUNTIME_DIR
ExecStart=/usr/bin/ln -s /mnt/wslg/runtime-dir/wayland-0.lock $XDG_RUNTIME_DIR
[Install]
WantedBy=default.target

View file

@ -16,7 +16,7 @@ case "$(uname)" in
if grep -q Microsoft /proc/version || [[ -n "$WSL_DISTRO_NAME" ]]; then
# WSL-specific configuration
export IS_WSL=true
source $DOTFILES/platforms/wsl/winterop.zsh
source $DOTFILES/home/dot_config/zsh/winterop.zsh
else
# Native Linux configuration
if [ -n "$WAYLAND_DISPLAY" ]; then

View file

@ -0,0 +1,30 @@
# $DOTFILES/platforms/wsl/winterop.zsh
# Sourced by $DOTFILES/platforms/wsl/zshrc 在 $DOTFILES/platforms/wsl/zshrc 中被引用
# Defines the interop commands between WSL and Windows
export FILE_EXPLORER="explorer.exe" # Directory Opus
alias psw="tasklist.exe"
alias killw="taskkill.exe"
alias shutdownw="shutdown.exe /s /t 0"
alias rebootw="shutdown.exe /r /t 0"
alias ipconfig="ipconfig.exe"
alias netstatw="netstat.exe"
alias diskpart="diskpart.exe"
alias winget="winget.exe"
alias pastew='pwsh.exe -NoProfile -Command "Get-Clipboard"'
alias ollama="ollama.exe"
# https://github.com/stuartleeks/wsl-notify-send
alias notify-send="wsl-notify-send.exe"
# WSL open
open() {
local target=$1
if command -v "$FILE_EXPLORER" >/dev/null 2>&1; then
"$FILE_EXPLORER" "$target"
else
command open "$target"
fi
}

4
home/dot_glzr/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
# New-Item -ItemType SymbolicLink -Path $Env:UserProfile\.glzr -Target $DOTFILES\platforms\win\glzr -Force
boilerplate*
starter/
neobrutal/

View 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
View 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"
}
]
}
```

View 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"
}
}
]
}

View 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>

View 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>
);
}

View 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
View 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;
}

View 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"
}
]
}

20
home/dot_wslconfig Normal file
View file

@ -0,0 +1,20 @@
# $DOTFILES\platforms\win\wslconfig
# Date: 2024-12-01
# Author: js0ny
# Config Files (mainly for networking) for WSL2 (Windows Subsystem for Linux 2)
# 适用于 Windows 的 Linux 子系统 2 的配置文件(主要用于网络)
# Location: ~/.wslconfig
# Linking: (PowerShell)
# New-Item -ItemType SymbolicLink -Path ~\.wslconfig -Target ~\.dotfiles\platforms\win\wslconfig
[wsl2]
# networkingMode=mirrored
# dnsTunneling=true
# firewall=true
# autoProxy=true
guiApplications=true
[experimental]
# requires dnsTunneling but are also OPTIONAL
bestEffortDnsParsing=true
hostAddressLoopback=true

2
home/dot_wslgconfig Normal file
View file

@ -0,0 +1,2 @@
[system-distro-env]
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=200