From 826ffc9d4a0c4286203e223a3eaeb333f9a0bb6f Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:16:43 +0300 Subject: [PATCH 01/15] some changes --- ags/widget/bar/Status.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ags/widget/bar/Status.ts b/ags/widget/bar/Status.ts index 15b2564..8eafec9 100644 --- a/ags/widget/bar/Status.ts +++ b/ags/widget/bar/Status.ts @@ -79,18 +79,14 @@ function StatusIcons(): Gtk.Widget { const networkIcon: Variable = Variable.derive([ bind(AstalNetwork.get_default(), "primary"), - bind(AstalNetwork.get_default(), "wired"), - bind(AstalNetwork.get_default(), "wifi") + bind(AstalNetwork.get_default().wired, "icon"), + bind(AstalNetwork.get_default().wifi, "icon") ], - (primary, wired, wifi) => { + (primary, wired_icon, wifi_icon) => { switch(primary) { - case AstalNetwork.Primary.WIRED: return wired ? - "network-wired-symbolic" - : "network-wired-no-route-symbolic"; + case AstalNetwork.Primary.WIRED: return wired_icon; - case AstalNetwork.Primary.WIFI: return wifi ? - "network-wireless-signal-excellent-symbolic" - : "network-wireless-offline-symbolic"; + case AstalNetwork.Primary.WIFI: return wifi_icon; } return "network-no-route-symbolic"; From 0164341fd06cd88a59fd2af200f266b8d7ca789e Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:52:50 +0300 Subject: [PATCH 02/15] Update ru_RU.ts --- ags/i18n/lang/ru_RU.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ags/i18n/lang/ru_RU.ts b/ags/i18n/lang/ru_RU.ts index 57f9b8d..ae6a03b 100644 --- a/ags/i18n/lang/ru_RU.ts +++ b/ags/i18n/lang/ru_RU.ts @@ -42,7 +42,7 @@ export default { }, night_light: { title: "Ночной свет", - default_desc: "Точность" + default_desc: "Тонн" } }, pages: { @@ -69,10 +69,10 @@ export default { paired_devices: "Привязанные устройства", start_discovering: "Начать поиск", stop_discovering: "Остановить поиск", - untrust_device: "Не доверять устройству", - unpair_device: "Отвязать устройство", - trust_device: "Доверять устройству", - pair_device: "Привязать устройство" + untrust_device: "Недоверенное устройство", + unpair_device: "Отвязанное устройство", + trust_device: "Доверенное устройство", + pair_device: "Привязанное устройство" }, network: { title: "Интернет", From b552345c3ceef69b145b3d331e9c6e5b90ae7099 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:53:17 +0300 Subject: [PATCH 03/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92063f5..bc70bc8 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Colorshell supports i18n! The shell automatically matches the shell language wit Currently, there's support for the following languages: - **English** (English, United States), maintained by [@retrozinndev](https://github.com/retrozinndev) - **Português** (Portuguese, Brazil), maintained by [@retrozinndev](https://github.com/retrozinndev) -- **русский** (Russian), maintained by [@NotMephisto](https://github.com/NotMephisto) +- **Русский** (Russian), maintained by [@NotMephisto](https://github.com/NotMephisto) Don't see your language here? You can contribute and make translations too!
You can do so by forking this repository, translating the shell in your fork and then opening a pull request to this repository, simple as that! From d67fd5fc03f4e78a3bbcd0819ea68a84e1b8ff58 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Sat, 14 Jun 2025 12:32:49 +0300 Subject: [PATCH 04/15] Update Media widget Now Media widget will search symbolic icons! It looks great! --- ags/widget/bar/Media.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ags/widget/bar/Media.ts b/ags/widget/bar/Media.ts index 2b50554..89fad59 100644 --- a/ags/widget/bar/Media.ts +++ b/ags/widget/bar/Media.ts @@ -1,16 +1,12 @@ import { bind } from "astal"; import { Gtk, Widget } from "astal/gtk3"; import AstalMpris from "gi://AstalMpris"; +import { getSymbolicIcon } from "../../scripts/apps"; +import { getPlayers } from "../../scripts/player"; import { Separator, SeparatorProps } from "../Separator"; import { Windows } from "../../windows"; import { Clipboard } from "../../scripts/clipboard"; - - -const playerIcons = { - spotify: "spotify-symbolic", - mpv: "mpv-symbolic", - Clapper: "com.github.rafostar.Clapper-symbolic" -} +import { Sliders } from "../control-center/Sliders"; export function Media(): Gtk.Widget { @@ -92,13 +88,12 @@ export function Media(): Gtk.Widget { players[0] ? [ new Widget.Icon({ icon: bind(players[0], "busName").as((busName: string) => { - const splitName = busName.split('.').filter(str => str !== ""); - - return playerIcons[ - Object.keys(playerIcons).filter(icon => - splitName[splitName.length - 1].includes(icon))?.[0] as keyof typeof playerIcons - ] - ?? "folder-music-symbolic"; + const splitName = busName.split('.').filter(str => str !== "" && !str.toLowerCase().includes('instance')); + if (getSymbolicIcon(splitName[splitName.length - 1])) { + return getSymbolicIcon(splitName[splitName.length - 1]); + } else { + return "folder-music-symbolic" + }; }) } as Widget.IconProps), new Widget.Label({ From 4dca3912248bcc189378b5a4b467c2fcae9d588e Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Sat, 14 Jun 2025 12:34:56 +0300 Subject: [PATCH 05/15] Update apps.ts add getSymbolicIcon() function --- ags/scripts/apps.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ags/scripts/apps.ts b/ags/scripts/apps.ts index 19a8820..ae1fb77 100644 --- a/ags/scripts/apps.ts +++ b/ags/scripts/apps.ts @@ -69,3 +69,10 @@ export function getAppIcon(app: (string|AstalApps.Application)): (string|undefin return getIconByAppName(app.name); } + +export function getSymbolicIcon(app: (string|AstalApps.Application)): (string|undefined) { + if (Astal.Icon.lookup_icon(`${getAppIcon(app)}-symbolic`)) + return `${getAppIcon(app)}-symbolic` + + return undefined; +} From ed55767a06e92083421a6d6805a470ebc20f0fbe Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Sun, 15 Jun 2025 23:10:55 +0300 Subject: [PATCH 06/15] Remove import --- ags/widget/bar/Media.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ags/widget/bar/Media.ts b/ags/widget/bar/Media.ts index 89fad59..4ed350c 100644 --- a/ags/widget/bar/Media.ts +++ b/ags/widget/bar/Media.ts @@ -2,7 +2,6 @@ import { bind } from "astal"; import { Gtk, Widget } from "astal/gtk3"; import AstalMpris from "gi://AstalMpris"; import { getSymbolicIcon } from "../../scripts/apps"; -import { getPlayers } from "../../scripts/player"; import { Separator, SeparatorProps } from "../Separator"; import { Windows } from "../../windows"; import { Clipboard } from "../../scripts/clipboard"; From 29fca303f6087f5edae3c725ecd8367553611dac Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Sun, 15 Jun 2025 23:18:34 +0300 Subject: [PATCH 07/15] Update BigMedia.ts Add checks for Infinite numbers --- ags/widget/center-window/BigMedia.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ags/widget/center-window/BigMedia.ts b/ags/widget/center-window/BigMedia.ts index 1d1731e..34ce7d3 100644 --- a/ags/widget/center-window/BigMedia.ts +++ b/ags/widget/center-window/BigMedia.ts @@ -189,7 +189,7 @@ export function BigMedia(): Gtk.Widget { halign: Gtk.Align.END, label: bind(players[0], "length").as((len/* bananananananana */: number) => { const sec: number = Math.floor(len % 60); - return len > 0 ? + return (len > 0 && Number.isFinite(len)) ? `${Math.floor(len / 60)}:${sec < 10 ? "0" : ""}${sec}` : "0:00"; }) From e722fc7d42b28ef44e1d28999f542cb972d1194d Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:30:44 +0300 Subject: [PATCH 08/15] Ops.. --- ags/widget/bar/Media.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ags/widget/bar/Media.ts b/ags/widget/bar/Media.ts index 4ed350c..bf67c06 100644 --- a/ags/widget/bar/Media.ts +++ b/ags/widget/bar/Media.ts @@ -5,7 +5,6 @@ import { getSymbolicIcon } from "../../scripts/apps"; import { Separator, SeparatorProps } from "../Separator"; import { Windows } from "../../windows"; import { Clipboard } from "../../scripts/clipboard"; -import { Sliders } from "../control-center/Sliders"; export function Media(): Gtk.Widget { From 9aea545084f6db342a9ce89247311671a64718a7 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:57:16 +0300 Subject: [PATCH 09/15] Update Media.ts --- ags/widget/bar/Media.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ags/widget/bar/Media.ts b/ags/widget/bar/Media.ts index 77aa2fb..9e65583 100644 --- a/ags/widget/bar/Media.ts +++ b/ags/widget/bar/Media.ts @@ -5,16 +5,6 @@ import { getSymbolicIcon } from "../../scripts/apps"; import { Separator, SeparatorProps } from "../Separator"; import { Windows } from "../../windows"; -<<<<<<< ryo -======= - -const playerIcons = { - spotify: "spotify-symbolic", - mpv: "mpv-symbolic", - Clapper: "com.github.rafostar.Clapper-symbolic" -}; - ->>>>>>> ryo export function Media(): Gtk.Widget { const connections: Array = []; From 0f3b7d3ed47d10058507b608c13747e75b190e7f Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:35:10 +0300 Subject: [PATCH 10/15] Add Decoder for Uint8Array --- ags/scripts/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ags/scripts/utils.ts b/ags/scripts/utils.ts index 1204f17..4a847a4 100644 --- a/ags/scripts/utils.ts +++ b/ags/scripts/utils.ts @@ -1,5 +1,9 @@ import { exec, execAsync, Gio, GLib } from "astal"; +export function getDecoded(text: (Uint8Array)): string { + const decoder = new TextDecoder('utf-8'); + return decoder.decode(text); +} export function getHyprlandInstanceSig(): (string|null) { return GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE"); From a69bdfdb7c31ac98977f6475f6f024acf75e1110 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:36:34 +0300 Subject: [PATCH 11/15] Using Decoder for Uint8Array type data --- ags/widget/control-center/pages/Network.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ags/widget/control-center/pages/Network.ts b/ags/widget/control-center/pages/Network.ts index 3626cdd..4c5369d 100644 --- a/ags/widget/control-center/pages/Network.ts +++ b/ags/widget/control-center/pages/Network.ts @@ -92,7 +92,7 @@ export const PageNetwork: (() => Page) = () => new Page({ new Widget.Label({ className: "ssid", halign: Gtk.Align.START, - label: ap.ssid.get_data()?.toString() ?? "Wi-Fi" + label: getDecoded(ap.ssid.get_data()) ?? "Wi-Fi" } as Widget.LabelProps), new Widget.Label({ className: "status", From 7a104098d8736bb4d904db4af4d176cd139a9980 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 17 Jun 2025 20:14:46 +0300 Subject: [PATCH 12/15] Need test --- ags/widget/bar/Status.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ags/widget/bar/Status.ts b/ags/widget/bar/Status.ts index 9cc21e6..c075981 100644 --- a/ags/widget/bar/Status.ts +++ b/ags/widget/bar/Status.ts @@ -123,14 +123,12 @@ function StatusIcons(): Gtk.Widget { const networkIcon: Variable = Variable.derive([ bind(AstalNetwork.get_default(), "primary"), - bind(AstalNetwork.get_default().wired, "icon"), - bind(AstalNetwork.get_default().wifi, "icon") ], - (primary, wired_icon, wifi_icon) => { + (primary) => { switch(primary) { - case AstalNetwork.Primary.WIRED: return wired_icon; + case AstalNetwork.Primary.WIRED: return AstalNetwork.get_default().wired.get_icon_name(); - case AstalNetwork.Primary.WIFI: return wifi_icon; + case AstalNetwork.Primary.WIFI: return AstalNetwork.get_default().wifi.get_icon_name(); } return "network-no-route-symbolic"; From 61d299db75d02d5433e75c21f4c87d9906fd36cd Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 17 Jun 2025 20:22:05 +0300 Subject: [PATCH 13/15] Now it even handles `null` case. --- ags/widget/control-center/pages/Network.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ags/widget/control-center/pages/Network.ts b/ags/widget/control-center/pages/Network.ts index 4c5369d..600d5c5 100644 --- a/ags/widget/control-center/pages/Network.ts +++ b/ags/widget/control-center/pages/Network.ts @@ -92,7 +92,7 @@ export const PageNetwork: (() => Page) = () => new Page({ new Widget.Label({ className: "ssid", halign: Gtk.Align.START, - label: getDecoded(ap.ssid.get_data()) ?? "Wi-Fi" + label: (getDecoded(ap.ssid.get_data()) ?? ap.ssid.get_data().toString()) ?? "Wi-Fi" } as Widget.LabelProps), new Widget.Label({ className: "status", From d7b20bc8b8acc4b2bec8cba7ff1b48bf8ecf3ae7 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:09:32 +0300 Subject: [PATCH 14/15] Symbolic Icons in workspaces --- ags/widget/bar/Workspaces.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ags/widget/bar/Workspaces.ts b/ags/widget/bar/Workspaces.ts index 25b4523..1714c33 100644 --- a/ags/widget/bar/Workspaces.ts +++ b/ags/widget/bar/Workspaces.ts @@ -1,7 +1,7 @@ import { bind, Variable } from "astal"; import { Gtk, Widget } from "astal/gtk3"; import AstalHyprland from "gi://AstalHyprland"; -import { getAppIcon } from "../../scripts/apps"; +import { getSymbolicIcon } from "../../scripts/apps"; let showWsNum: (Variable|undefined); export const showWorkspaceNumber = (show: boolean) => @@ -73,7 +73,7 @@ export function Workspaces(): Gtk.Widget { : Boolean(lastClient)), icon: lastClient ? bind(lastClient, "class").as((clss) => - getAppIcon(clss) ?? "application-x-executable-symbolic") + getSymbolicIcon(clss) ?? "application-x-executable-symbolic") : undefined } as Widget.IconProps) ]) From 9362a18ddcaa94622c657e4cb44128dbb5c9ffe8 Mon Sep 17 00:00:00 2001 From: Mephisto <38382271+NotMephisto@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:11:11 +0300 Subject: [PATCH 15/15] Symbolic icons in special workspaces --- ags/widget/bar/SpecialWorkspaces.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ags/widget/bar/SpecialWorkspaces.ts b/ags/widget/bar/SpecialWorkspaces.ts index 312d1b4..7388f36 100644 --- a/ags/widget/bar/SpecialWorkspaces.ts +++ b/ags/widget/bar/SpecialWorkspaces.ts @@ -1,7 +1,7 @@ import { bind, Variable } from "astal"; import { Gtk, Widget } from "astal/gtk3" import AstalHyprland from "gi://AstalHyprland"; -import { getAppIcon } from "../../scripts/apps"; +import { getSymbolicIcon } from "../../scripts/apps"; export const SpecialWorkspaces: (() => Gtk.Widget) = () => new Widget.EventBox({ className: "special-ws-eventbox", @@ -28,9 +28,7 @@ export const SpecialWorkspaces: (() => Gtk.Widget) = () => new Widget.EventBox({ ], (lastClient, focusedWorkspace) => focusedWorkspace?.id === workspace.id ? false : Boolean(lastClient))(), icon: bind(workspace, "lastClient").as((lastClient) => - lastClient ? - getAppIcon(lastClient.initialClass) || "image-missing" - : "image-missing") + getSymbolicIcon(lastClient) ?? "image-missing") } as Widget.IconProps) } as Widget.BoxProps), onClickRelease: () => AstalHyprland.get_default().dispatch(