diff --git a/README.md b/README.md index 8a500c6..8397ef6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ A panel built for Hyprland with [Aylur's Gtk Shell](https://github.com/Aylur/ags ![HyprPanel](./assets/HyprPanel.png) +## Installation +The [HyprPanel Wiki](https://hyprpanel.com/getting_started/installation.html) contains in depth instructions for installing the panel and all of its dependencies. The instructions below are general instructions for installing the panel. + ## Requirements Bun diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf new file mode 100644 index 0000000..3bed27f Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-Bold.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf new file mode 100644 index 0000000..99cfe5b Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraBold.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf new file mode 100644 index 0000000..1e8103b Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-ExtraLight.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf new file mode 100644 index 0000000..82dcd0b Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-Light.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf new file mode 100644 index 0000000..d134c56 Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-Medium.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf new file mode 100644 index 0000000..de31c48 Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-Regular.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf new file mode 100644 index 0000000..059f6b3 Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-SemiBold.ttf differ diff --git a/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf b/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf new file mode 100644 index 0000000..8aad716 Binary files /dev/null and b/assets/fonts/JetBrainsMonoNerdFontPropo-Thin.ttf differ diff --git a/config.js b/config.js index 7b68dd6..6417940 100644 --- a/config.js +++ b/config.js @@ -33,7 +33,7 @@ try { } if (v.ags[1] < v.expect[1] || v.ags[2] < v.expect[2]) { - print(`my config needs at least v${v.expect.join(".")}, yours is v${v.ags.join(".")}`) + print(`HyprPanel needs atleast v${v.expect.join(".")} of AGS, yours is v${v.ags.join(".")}`) App.quit() } diff --git a/install_fonts.sh b/install_fonts.sh new file mode 100755 index 0000000..c40b022 --- /dev/null +++ b/install_fonts.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +SOURCE_DIR="./assets/fonts" +DEST_DIR="$HOME/.local/share/fonts" +DEST_PATH="$DEST_DIR/NFP" + +if [ ! -d "$SOURCE_DIR" ]; then + echo "Source directory '$SOURCE_DIR' does not exist." + exit 1 +fi + +if [ ! -d "$DEST_PATH" ]; then + echo "Destination directory '$DEST_PATH' does not exist. Creating it..." + mkdir -p "$DEST_PATH" +fi + +if [ -z "$(ls -A "$SOURCE_DIR")" ]; then + echo "Source directory '$SOURCE_DIR' is empty. No files to copy." + exit 1 +fi + +echo "Copying fonts from '$SOURCE_DIR' to '$DEST_PATH'..." +cp -r "$SOURCE_DIR"/* "$DEST_PATH" + +echo "Updating font cache..." +fc-cache -fv + +echo "Fonts installed successfully." diff --git a/modules/bar/bluetooth/index.ts b/modules/bar/bluetooth/index.ts index c962365..cf36e5a 100644 --- a/modules/bar/bluetooth/index.ts +++ b/modules/bar/bluetooth/index.ts @@ -6,7 +6,7 @@ import { openMenu } from "../utils.js"; const Bluetooth = () => { const btIcon = Widget.Label({ label: bluetooth.bind("enabled").as((v) => v ? "󰂯" : "󰂲"), - class_name: "bar-button-icon bluetooth", + class_name: "bar-button-icon bluetooth txt-icon bar", }); const btText = Widget.Label({ diff --git a/modules/bar/media/index.ts b/modules/bar/media/index.ts index 1f1a647..7464dd0 100644 --- a/modules/bar/media/index.ts +++ b/modules/bar/media/index.ts @@ -40,7 +40,7 @@ const Media = () => { const trackArtist = show_artist.value ? ` - ${track_artists.join(', ')}` : ``; - const truncatedLabel = truncation.value + const truncatedLabel = truncation.value ? `${track_title + trackArtist}`.substring(0, truncation_size.value) : `${track_title + trackArtist}`; @@ -63,7 +63,7 @@ const Media = () => { child: Widget.Box({ children: [ Widget.Label({ - class_name: "bar-button-icon media", + class_name: "bar-button-icon media txt-icon bar", label: songIcon.bind("value").as(v => v || "󰝚"), }), Widget.Label({ diff --git a/modules/bar/menu/index.ts b/modules/bar/menu/index.ts index 2e29e17..c4f1ca5 100644 --- a/modules/bar/menu/index.ts +++ b/modules/bar/menu/index.ts @@ -6,7 +6,7 @@ const Menu = () => { return { component: Widget.Box({ child: Widget.Label({ - class_name: "bar-menu_label", + class_name: "bar-menu_label txt-icon bar", label: options.bar.launcher.icon.bind("value"), }), }), diff --git a/modules/bar/notifications/index.ts b/modules/bar/notifications/index.ts index 04bd0c5..d09507f 100644 --- a/modules/bar/notifications/index.ts +++ b/modules/bar/notifications/index.ts @@ -18,7 +18,7 @@ export const Notifications = () => { (notif, dnd, showTotal) => { const notifIcon = Widget.Label({ hpack: "center", - class_name: "bar-button-icon notifications", + class_name: "bar-button-icon notifications txt-icon bar", label: dnd ? "󰂛" : notif.length > 0 ? "󱅫" : "󰂚", }); diff --git a/modules/bar/volume/index.ts b/modules/bar/volume/index.ts index e8526df..6f5a64a 100644 --- a/modules/bar/volume/index.ts +++ b/modules/bar/volume/index.ts @@ -3,8 +3,6 @@ const audio = await Service.import("audio"); import { openMenu } from "../utils.js"; import options from "options"; -import { globalMousePos } from "globals.js"; - const Volume = () => { const icons = { 101: "󰕾", @@ -30,7 +28,7 @@ const Volume = () => { const volIcn = Widget.Label({ vpack: "center", label: getIcon(), - class_name: "bar-button-icon volume", + class_name: "bar-button-icon volume txt-icon bar", }); const volPct = Widget.Label({ diff --git a/modules/bar/window_title/index.ts b/modules/bar/window_title/index.ts index 91fc94d..99ed699 100644 --- a/modules/bar/window_title/index.ts +++ b/modules/bar/window_title/index.ts @@ -31,7 +31,7 @@ const ClientTitle = () => { component: Widget.Box({ children: [ Widget.Label({ - class_name: "bar-button-icon windowtitle", + class_name: "bar-button-icon windowtitle txt-icon bar", label: hyprland.active.bind("client").as((v) => filterTitle(v).icon), }), Widget.Label({ diff --git a/modules/bar/workspaces/index.ts b/modules/bar/workspaces/index.ts index 9e44bb0..8e0116c 100644 --- a/modules/bar/workspaces/index.ts +++ b/modules/bar/workspaces/index.ts @@ -2,13 +2,13 @@ const hyprland = await Service.import("hyprland"); import { WorkspaceRule, WorkspaceMap } from "lib/types/workspace"; import options from "options"; -const { - workspaces, +const { + workspaces, monitorSpecific, - workspaceMask, - reverse_scroll, - scroll_speed, - spacing + workspaceMask, + reverse_scroll, + scroll_speed, + spacing } = options.bar.workspaces; function range(length: number, start = 1) { @@ -188,7 +188,7 @@ const Workspaces = (monitor = -1, ws = 8) => { ], (show_icons, show_numbered, numbered_active_indicator) => { if (show_icons) { - return `workspace-icon`; + return `workspace-icon txt-icon bar`; } if (show_numbered) { const numActiveInd = hyprland.active.workspace.id === i @@ -270,4 +270,4 @@ const Workspaces = (monitor = -1, ws = 8) => { } }; }; -export { Workspaces }; \ No newline at end of file +export { Workspaces }; diff --git a/modules/menus/audio/available/InputDevices.ts b/modules/menus/audio/available/InputDevices.ts index aac0685..42b2a76 100644 --- a/modules/menus/audio/available/InputDevices.ts +++ b/modules/menus/audio/available/InputDevices.ts @@ -37,8 +37,8 @@ const renderInputDevices = (inputDevices: Stream[]) => { .bind("description") .as((v) => device.description === v - ? "menu-button-icon active input" - : "menu-button-icon input", + ? "menu-button-icon active input txt-icon" + : "menu-button-icon input txt-icon", ), label: "", }), diff --git a/modules/menus/audio/available/PlaybackDevices.ts b/modules/menus/audio/available/PlaybackDevices.ts index 07c3fad..67bdd54 100644 --- a/modules/menus/audio/available/PlaybackDevices.ts +++ b/modules/menus/audio/available/PlaybackDevices.ts @@ -31,8 +31,8 @@ const renderPlaybacks = (playbackDevices: Stream[]) => { .bind("description") .as((v) => device.description === v - ? "menu-button-icon active playback" - : "menu-button-icon playback", + ? "menu-button-icon active playback txt-icon" + : "menu-button-icon playback txt-icon", ), label: "", }), diff --git a/modules/menus/bluetooth/devices/connectedControls.ts b/modules/menus/bluetooth/devices/connectedControls.ts index c241c0b..0c7e6c2 100644 --- a/modules/menus/bluetooth/devices/connectedControls.ts +++ b/modules/menus/bluetooth/devices/connectedControls.ts @@ -13,7 +13,7 @@ const connectedControls = (dev: BluetoothDevice, connectedDevices: BluetoothDevi class_name: "menu-icon-button unpair bluetooth", child: Widget.Label({ tooltip_text: dev.paired ? "Unpair" : "Pair", - class_name: "menu-icon-button-label unpair bluetooth", + class_name: "menu-icon-button-label unpair bluetooth txt-icon", label: dev.paired ? "" : "", }), on_primary_click: () => @@ -32,7 +32,7 @@ const connectedControls = (dev: BluetoothDevice, connectedDevices: BluetoothDevi class_name: "menu-icon-button disconnect bluetooth", child: Widget.Label({ tooltip_text: dev.connected ? "Disconnect" : "Connect", - class_name: "menu-icon-button-label disconnect bluetooth", + class_name: "menu-icon-button-label disconnect bluetooth txt-icon", label: dev.connected ? "󱘖" : "", }), on_primary_click: () => dev.setConnection(!dev.connected), @@ -41,7 +41,7 @@ const connectedControls = (dev: BluetoothDevice, connectedDevices: BluetoothDevi class_name: "menu-icon-button untrust bluetooth", child: Widget.Label({ tooltip_text: dev.trusted ? "Untrust" : "Trust", - class_name: "menu-icon-button-label untrust bluetooth", + class_name: "menu-icon-button-label untrust bluetooth txt-icon", label: dev.trusted ? "" : "󱖡", }), on_primary_click: () => @@ -60,7 +60,7 @@ const connectedControls = (dev: BluetoothDevice, connectedDevices: BluetoothDevi class_name: "menu-icon-button delete bluetooth", child: Widget.Label({ tooltip_text: "Forget", - class_name: "menu-icon-button-label delete bluetooth", + class_name: "menu-icon-button-label delete bluetooth txt-icon", label: "󰆴", }), on_primary_click: () => { diff --git a/modules/menus/bluetooth/devices/devicelist.ts b/modules/menus/bluetooth/devices/devicelist.ts index 17626e3..c5e948a 100644 --- a/modules/menus/bluetooth/devices/devicelist.ts +++ b/modules/menus/bluetooth/devices/devicelist.ts @@ -86,7 +86,7 @@ const devices = (bluetooth: Bluetooth, self: Box) => { children: [ Widget.Label({ vpack: "start", - class_name: `menu-button-icon bluetooth ${conDevNames.includes(device.address) ? "active" : ""}`, + class_name: `menu-button-icon bluetooth ${conDevNames.includes(device.address) ? "active" : ""} txt-icon`, label: getBluetoothIcon(`${device["icon-name"]}-symbolic`), }), Widget.Box({ diff --git a/modules/menus/calendar/weather/stats/index.ts b/modules/menus/calendar/weather/stats/index.ts index c459c70..2a0e386 100644 --- a/modules/menus/calendar/weather/stats/index.ts +++ b/modules/menus/calendar/weather/stats/index.ts @@ -16,7 +16,7 @@ export const TodayStats = (theWeather: Variable) => { class_name: "weather wind", children: [ Widget.Label({ - class_name: "weather wind icon", + class_name: "weather wind icon txt-icon", label: "", }), Widget.Label({ @@ -37,7 +37,7 @@ export const TodayStats = (theWeather: Variable) => { class_name: "weather precip", children: [ Widget.Label({ - class_name: "weather precip icon", + class_name: "weather precip icon txt-icon", label: "", }), Widget.Label({ diff --git a/modules/menus/calendar/weather/temperature/index.ts b/modules/menus/calendar/weather/temperature/index.ts index 5577118..32c7b3d 100644 --- a/modules/menus/calendar/weather/temperature/index.ts +++ b/modules/menus/calendar/weather/temperature/index.ts @@ -64,7 +64,7 @@ export const TodayTemperature = (theWeather: Variable) => { .bind("value") .as( (v) => - `calendar-menu-weather today temp label icon ${getIcon(Math.ceil(v.current.temp_f)).color}`, + `calendar-menu-weather today temp label icon txt-icon ${getIcon(Math.ceil(v.current.temp_f)).color}`, ), label: theWeather .bind("value") diff --git a/modules/menus/dashboard/controls/index.ts b/modules/menus/dashboard/controls/index.ts index 943d8b3..62684f7 100644 --- a/modules/menus/dashboard/controls/index.ts +++ b/modules/menus/dashboard/controls/index.ts @@ -4,93 +4,98 @@ const notifications = await Service.import("notifications"); const audio = await Service.import("audio"); const Controls = () => { - return Widget.Box({ - class_name: "dashboard-card controls-container", - hpack: "fill", - vpack: "fill", - expand: true, - children: [ - Widget.Button({ - tooltip_text: "Toggle Wifi", + return Widget.Box({ + class_name: "dashboard-card controls-container", + hpack: "fill", + vpack: "fill", expand: true, - setup: (self) => { - self.hook(network, () => { - return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? "disabled" : ""}`); - }); - }, - on_primary_click: () => network.toggleWifi(), - child: Widget.Label({ - setup: (self) => { - self.hook(network, () => { - return (self.label = network.wifi.enabled ? "󰤨" : "󰤭"); - }); - }, - }), - }), - Widget.Button({ - tooltip_text: "Toggle Bluetooth", - expand: true, - class_name: bluetooth - .bind("enabled") - .as( - (btOn) => `dashboard-button bluetooth ${!btOn ? "disabled" : ""}`, - ), - on_primary_click: () => bluetooth.toggle(), - child: Widget.Label({ - label: bluetooth.bind("enabled").as((btOn) => (btOn ? "󰂯" : "󰂲")), - }), - }), - Widget.Button({ - tooltip_text: "Toggle Notifications", - expand: true, - class_name: notifications - .bind("dnd") - .as( - (dnd) => `dashboard-button notifications ${dnd ? "disabled" : ""}`, - ), - on_primary_click: () => (notifications.dnd = !notifications.dnd), - child: Widget.Label({ - label: notifications.bind("dnd").as((dnd) => (dnd ? "󰂛" : "󰂚")), - }), - }), - Widget.Button({ - tooltip_text: "Toggle Mute (Playback)", - expand: true, - on_primary_click: () => - (audio.speaker.is_muted = !audio.speaker.is_muted), - setup: (self) => { - self.hook(audio, () => { - return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? "disabled" : ""}`); - }); - }, - child: Widget.Label({ - setup: (self) => { - self.hook(audio, () => { - return (self.label = audio.speaker.is_muted ? "󰖁" : "󰕾"); - }); - }, - }), - }), - Widget.Button({ - tooltip_text: "Toggle Mute (Microphone)", - expand: true, - on_primary_click: () => - (audio.microphone.is_muted = !audio.microphone.is_muted), - setup: (self) => { - self.hook(audio, () => { - return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? "disabled" : ""}`); - }); - }, - child: Widget.Label({ - setup: (self) => { - self.hook(audio, () => { - return (self.label = audio.microphone.is_muted ? "󰍭" : "󰍬"); - }); - }, - }), - }), - ], - }); + children: [ + Widget.Button({ + tooltip_text: "Toggle Wifi", + expand: true, + setup: (self) => { + self.hook(network, () => { + return (self.class_name = `dashboard-button wifi ${!network.wifi.enabled ? "disabled" : ""}`); + }); + }, + on_primary_click: () => network.toggleWifi(), + child: Widget.Label({ + class_name: "txt-icon", + setup: (self) => { + self.hook(network, () => { + return (self.label = network.wifi.enabled ? "󰤨" : "󰤭"); + }); + }, + }), + }), + Widget.Button({ + tooltip_text: "Toggle Bluetooth", + expand: true, + class_name: bluetooth + .bind("enabled") + .as( + (btOn) => `dashboard-button bluetooth ${!btOn ? "disabled" : ""}`, + ), + on_primary_click: () => bluetooth.toggle(), + child: Widget.Label({ + class_name: "txt-icon", + label: bluetooth.bind("enabled").as((btOn) => (btOn ? "󰂯" : "󰂲")), + }), + }), + Widget.Button({ + tooltip_text: "Toggle Notifications", + expand: true, + class_name: notifications + .bind("dnd") + .as( + (dnd) => `dashboard-button notifications ${dnd ? "disabled" : ""}`, + ), + on_primary_click: () => (notifications.dnd = !notifications.dnd), + child: Widget.Label({ + class_name: "txt-icon", + label: notifications.bind("dnd").as((dnd) => (dnd ? "󰂛" : "󰂚")), + }), + }), + Widget.Button({ + tooltip_text: "Toggle Mute (Playback)", + expand: true, + on_primary_click: () => + (audio.speaker.is_muted = !audio.speaker.is_muted), + setup: (self) => { + self.hook(audio, () => { + return (self.class_name = `dashboard-button playback ${audio.speaker.is_muted ? "disabled" : ""}`); + }); + }, + child: Widget.Label({ + class_name: "txt-icon", + setup: (self) => { + self.hook(audio, () => { + return (self.label = audio.speaker.is_muted ? "󰖁" : "󰕾"); + }); + }, + }), + }), + Widget.Button({ + tooltip_text: "Toggle Mute (Microphone)", + expand: true, + on_primary_click: () => + (audio.microphone.is_muted = !audio.microphone.is_muted), + setup: (self) => { + self.hook(audio, () => { + return (self.class_name = `dashboard-button input ${audio.microphone.is_muted ? "disabled" : ""}`); + }); + }, + child: Widget.Label({ + class_name: "txt-icon", + setup: (self) => { + self.hook(audio, () => { + return (self.label = audio.microphone.is_muted ? "󰍭" : "󰍬"); + }); + }, + }), + }), + ], + }); }; export { Controls }; diff --git a/modules/menus/dashboard/shortcuts/index.ts b/modules/menus/dashboard/shortcuts/index.ts index 7c744c3..c8feb5d 100644 --- a/modules/menus/dashboard/shortcuts/index.ts +++ b/modules/menus/dashboard/shortcuts/index.ts @@ -88,7 +88,7 @@ const Shortcuts = () => { .bind("value") .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: left.shortcut1.icon.bind("value"), }), }), @@ -99,7 +99,7 @@ const Shortcuts = () => { .bind("value") .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: left.shortcut2.icon.bind("value"), }), }), @@ -117,7 +117,7 @@ const Shortcuts = () => { .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ hpack: "center", - class_name: "button-label", + class_name: "button-label txt-icon", label: left.shortcut3.icon.bind("value"), }), }), @@ -128,7 +128,7 @@ const Shortcuts = () => { .bind("value") .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: left.shortcut4.icon.bind("value"), }), }), @@ -152,7 +152,7 @@ const Shortcuts = () => { .bind("value") .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: right.shortcut1.icon.bind("value"), }), }), @@ -164,7 +164,7 @@ const Shortcuts = () => { App.toggleWindow("settings-dialog"); }, child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: "󰒓", }), }), @@ -181,7 +181,7 @@ const Shortcuts = () => { .bind("value") .as((cmd) => () => handleClick(cmd)), child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: right.shortcut3.icon.bind("value"), }), }), @@ -206,7 +206,7 @@ const Shortcuts = () => { }); }, child: Widget.Label({ - class_name: "button-label", + class_name: "button-label txt-icon", label: "󰑊", }), }), diff --git a/modules/menus/dashboard/stats/index.ts b/modules/menus/dashboard/stats/index.ts index d350af7..05fa1f9 100644 --- a/modules/menus/dashboard/stats/index.ts +++ b/modules/menus/dashboard/stats/index.ts @@ -128,7 +128,10 @@ const Stats = () => { ); } }), - label: "󰢮", + child: Widget.Label({ + class_name: "txt-icon", + label: "󰢮", + }) }), Widget.Button({ on_primary_click: terminal.bind("value").as(term => { @@ -227,7 +230,10 @@ const Stats = () => { ); } }), - label: "", + child: Widget.Label({ + class_name: "txt-icon", + label: "", + }) }), Widget.Button({ on_primary_click: terminal.bind("value").as(term => { @@ -273,7 +279,10 @@ const Stats = () => { ); } }), - label: "", + child: Widget.Label({ + class_name: "txt-icon", + label: "", + }) }), Widget.Button({ on_primary_click: terminal.bind("value").as(term => { @@ -318,7 +327,10 @@ const Stats = () => { ); } }), - label: "󰋊", + child: Widget.Label({ + class_name: "txt-icon", + label: "󰋊", + }) }), Widget.Button({ on_primary_click: terminal.bind("value").as(term => { diff --git a/modules/menus/network/wifi/WirelessAPs.ts b/modules/menus/network/wifi/WirelessAPs.ts index 3b4506b..5bd65c9 100644 --- a/modules/menus/network/wifi/WirelessAPs.ts +++ b/modules/menus/network/wifi/WirelessAPs.ts @@ -132,7 +132,7 @@ const renderWAPs = (self: any, network: Network, staging: Variable, children: [ Widget.Label({ vpack: "start", - class_name: `network-icon wifi ${ap.ssid === network.wifi.ssid ? "active" : ""}`, + class_name: `network-icon wifi ${ap.ssid === network.wifi.ssid ? "active" : ""} txt-icon`, label: getWifiIcon(`${ap["iconName"]}`), }), Widget.Box({ @@ -202,6 +202,7 @@ const renderWAPs = (self: any, network: Network, staging: Variable, }); }, child: Widget.Label({ + class_name: "txt-icon delete-network", label: "󰚃", }), }), diff --git a/modules/menus/notifications/controls/index.ts b/modules/menus/notifications/controls/index.ts index 0bbbce1..4e1bd96 100644 --- a/modules/menus/notifications/controls/index.ts +++ b/modules/menus/notifications/controls/index.ts @@ -23,6 +23,7 @@ const Controls = (notifs) => { children: [ Widget.Switch({ class_name: "menu-switch notifications", + vpack: "center", active: notifs.bind("dnd").as((dnd: boolean) => !dnd), on_activate: ({ active }) => { notifs.dnd = !active; @@ -41,7 +42,7 @@ const Controls = (notifs) => { tooltip_text: "Clear Notifications", on_primary_click: () => notifs.clear(), child: Widget.Label({ - class_name: "clear-notifications-label", + class_name: "clear-notifications-label txt-icon", label: "", }), }), diff --git a/modules/menus/notifications/notification/close/index.ts b/modules/menus/notifications/notification/close/index.ts index 4ef3dff..c5fa2c4 100644 --- a/modules/menus/notifications/notification/close/index.ts +++ b/modules/menus/notifications/notification/close/index.ts @@ -6,6 +6,7 @@ export const CloseButton = (notif: Notification, notifs: Notifications) => { notifs.CloseNotification(notif.id); }, child: Widget.Label({ + class_name: "txt-icon notif-close", label: "󰅜", hpack: "center", }), diff --git a/modules/notifications/close/index.ts b/modules/notifications/close/index.ts index 2da8b7e..7e067f9 100644 --- a/modules/notifications/close/index.ts +++ b/modules/notifications/close/index.ts @@ -7,6 +7,7 @@ export const CloseButton = (notif: Notification, notifs: Notifications) => { notifs.CloseNotification(notif.id); }, child: Widget.Label({ + class_name: "txt-icon notif-close", label: "󰅜", hpack: "center", }), diff --git a/modules/osd/icon/index.ts b/modules/osd/icon/index.ts index 94b9fca..e991fe6 100644 --- a/modules/osd/icon/index.ts +++ b/modules/osd/icon/index.ts @@ -7,7 +7,7 @@ export const OSDIcon = (ort: OSDOrientation) => { class_name: "osd-icon-container", hexpand: true, child: Widget.Label({ - class_name: "osd-icon", + class_name: "osd-icon txt-icon", hexpand: true, vexpand: true, hpack: "center", diff --git a/scss/main.scss b/scss/main.scss index 39ac2cb..a8b037c 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -11,6 +11,9 @@ @import "style/common/floating-widget.scss"; @import "style/common/widget-button.scss"; +//general styles +@import "style/common/general"; + //modules - bar @import "style/bar/menu"; @import "style/bar/audio"; @@ -46,6 +49,3 @@ //settings dialog @import "style/settings/dialog"; - -//general styles -@import "style/common/general"; diff --git a/scss/style/common/general.scss b/scss/style/common/general.scss index 00154b0..c902a93 100644 --- a/scss/style/common/general.scss +++ b/scss/style/common/general.scss @@ -1,5 +1,27 @@ @import '../colors.scss'; +.txt-icon { + font-family: "JetBrainsMono Nerd Font Propo", monospace; + font-size: 1.5em; + + &.bluetooth { + font-size: 1em; + } + + &.playback { + font-size: 1.3em; + } + + &.input { + font-size: 1.3em; + } +} + +.bar.txt-icon { + font-family: "JetBrainsMono Nerd Font Propo", monospace; + font-size: 1.2em; +} + window.popup { opacity: $bar-menus-opacity/100; diff --git a/scss/style/menus/calendar.scss b/scss/style/menus/calendar.scss index 40cb91d..fc3bb68 100644 --- a/scss/style/menus/calendar.scss +++ b/scss/style/menus/calendar.scss @@ -166,3 +166,13 @@ .hourly-weather-temp { color: if($bar-menus-monochrome, $bar-menus-label, $bar-menus-menu-clock-weather-hourly-temperature); } + +.weather.precip.icon { + min-width: 1em; + font-size: 1em; +} + +.weather.wind.icon { + min-width: 1em; + font-size: 1em; +} diff --git a/scss/style/menus/dashboard.scss b/scss/style/menus/dashboard.scss index 911679b..b4ae322 100644 --- a/scss/style/menus/dashboard.scss +++ b/scss/style/menus/dashboard.scss @@ -127,10 +127,6 @@ } } - label { - font-size: 1.5em; - } - &.record.active { background: if($bar-menus-monochrome, $bar-menus-buttons-default, $bar-menus-menu-dashboard-shortcuts-recording); @@ -156,6 +152,7 @@ button { padding: 0em; min-height: 3em; + min-width: 3.8em; label { color: if($bar-menus-monochrome, $bar-menus-buttons-text, $bar-menus-menu-dashboard-controls-wifi-text); @@ -287,8 +284,9 @@ .stat { label { - margin-right: 1em; + margin-right: 0.75em; font-size: 1.5em; + min-width: 1.65em; } &.cpu label { diff --git a/services/snapshot.sh b/services/snapshot.sh index b8ad2d7..27554aa 100755 --- a/services/snapshot.sh +++ b/services/snapshot.sh @@ -5,7 +5,25 @@ outputFile="snapshot_$(date +%Y-%m-%d_%H-%M-%S).png" outputPath="$outputDir/$outputFile" mkdir -p "$outputDir" -if grimblast copysave area "$outputPath"; then +mode=$1 + +case "$mode" in +active) + command="grimblast copysave active $outputPath" + ;; +output) + command="grimblast copysave output $outputPath" + ;; +area) + command="grimblast copysave area $outputPath" + ;; +*) + echo "Usage: $0 {active|output|area}" + exit 1 + ;; +esac + +if eval "$command"; then recentFile=$(ls -t "$outputDir"/snapshot_*.png | head -n 1) notify-send "Grimblast" "Your snapshot has been saved." \ -i video-x-generic \ diff --git a/widget/settings/pages/config/general/index.ts b/widget/settings/pages/config/general/index.ts index 15fb100..c6c6673 100644 --- a/widget/settings/pages/config/general/index.ts +++ b/widget/settings/pages/config/general/index.ts @@ -23,15 +23,6 @@ export const BarGeneral = () => { } }), Option({ opt: options.terminal, title: 'Terminal', subtitle: "Tools such as 'btop' will open in this terminal", type: 'string' }), - - Header('On Screen Display'), - Option({ opt: options.theme.osd.enable, title: 'Enabled', type: 'boolean' }), - Option({ opt: options.theme.osd.orientation, title: 'Orientation', type: 'enum', enums: ["horizontal", "vertical"] }), - Option({ opt: options.theme.osd.location, title: 'Position', subtitle: 'Position of the OSD on the screen', type: 'enum', enums: ["top left", "top", "top right", "right", "bottom right", "bottom", "bottom left", "left"] }), - Option({ opt: options.theme.osd.monitor, title: 'Monitor', subtitle: 'The ID of the monitor on which to display the OSD', type: 'number' }), - Option({ opt: options.theme.osd.active_monitor, title: 'Follow Cursor', subtitle: 'The OSD will follow the monitor of your cursor', type: 'boolean' }), - Option({ opt: options.theme.osd.radius, title: 'Radius', subtitle: 'Radius of the on-screen-display that indicates volume/brightness change', type: 'string' }), - Option({ opt: options.theme.osd.margins, title: 'Margins', subtitle: 'Margins in the following format: top right bottom left', type: 'string' }), ] }) } diff --git a/widget/settings/pages/config/index.ts b/widget/settings/pages/config/index.ts index 4f7f806..01a1ea4 100644 --- a/widget/settings/pages/config/index.ts +++ b/widget/settings/pages/config/index.ts @@ -3,14 +3,16 @@ import { BarSettings } from "./bar/index"; import { ClockMenuSettings } from "./menus/clock"; import { DashboardMenuSettings } from "./menus/dashboard"; import { NotificationSettings } from "./notifications/index"; +import { OSDSettings } from "./osd/index"; -type Page = "General" | "Bar" | "Clock Menu" | "Dashboard Menu" | "Notifications"; +type Page = "General" | "Bar" | "Clock Menu" | "Dashboard Menu" | "Notifications" | "OSD"; const CurrentPage = Variable("General"); const pagerMap: Page[] = [ "General", "Bar", "Notifications", + "OSD", "Clock Menu", "Dashboard Menu", ] @@ -40,6 +42,7 @@ export const SettingsMenu = () => { "General": BarGeneral(), "Bar": BarSettings(), "Notifications": NotificationSettings(), + "OSD": OSDSettings(), "Clock Menu": ClockMenuSettings(), "Dashboard Menu": DashboardMenuSettings(), }, diff --git a/widget/settings/pages/config/osd/index.ts b/widget/settings/pages/config/osd/index.ts new file mode 100644 index 0000000..8c0438d --- /dev/null +++ b/widget/settings/pages/config/osd/index.ts @@ -0,0 +1,21 @@ +import { Option } from "widget/settings/shared/Option"; +import { Header } from "widget/settings/shared/Header"; + +import options from "options"; + +export const OSDSettings = () => { + return Widget.Box({ + class_name: "bar-theme-page paged-container", + vertical: true, + children: [ + Header('On Screen Display'), + Option({ opt: options.theme.osd.enable, title: 'Enabled', type: 'boolean' }), + Option({ opt: options.theme.osd.orientation, title: 'Orientation', type: 'enum', enums: ["horizontal", "vertical"] }), + Option({ opt: options.theme.osd.location, title: 'Position', subtitle: 'Position of the OSD on the screen', type: 'enum', enums: ["top left", "top", "top right", "right", "bottom right", "bottom", "bottom left", "left"] }), + Option({ opt: options.theme.osd.monitor, title: 'Monitor', subtitle: 'The ID of the monitor on which to display the OSD', type: 'number' }), + Option({ opt: options.theme.osd.active_monitor, title: 'Follow Cursor', subtitle: 'The OSD will follow the monitor of your cursor', type: 'boolean' }), + Option({ opt: options.theme.osd.radius, title: 'Radius', subtitle: 'Radius of the on-screen-display that indicates volume/brightness change', type: 'string' }), + Option({ opt: options.theme.osd.margins, title: 'Margins', subtitle: 'Margins in the following format: top right bottom left', type: 'string' }), + ] + }) +}