Merge pull request #10 from NotMephisto/ryo

Icon changes
Thanks to @NotMephisto !!
This commit is contained in:
João Dias
2025-06-17 15:17:25 -03:00
committed by GitHub
10 changed files with 33 additions and 37 deletions
+1 -1
View File
@@ -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! <br>
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!
+5 -5
View File
@@ -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: "Интернет",
+7
View File
@@ -81,3 +81,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;
}
+4
View File
@@ -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");
+7 -14
View File
@@ -1,16 +1,10 @@
import { bind } from "astal";
import { Gtk, Widget } from "astal/gtk3";
import AstalMpris from "gi://AstalMpris";
import { getSymbolicIcon } from "../../scripts/apps";
import { Separator, SeparatorProps } from "../Separator";
import { Windows } from "../../windows";
const playerIcons = {
spotify: "spotify-symbolic",
mpv: "mpv-symbolic",
Clapper: "com.github.rafostar.Clapper-symbolic"
};
export function Media(): Gtk.Widget {
const connections: Array<number> = [];
@@ -88,13 +82,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({
+2 -4
View File
@@ -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(
+3 -9
View File
@@ -123,18 +123,12 @@ function StatusIcons(): Gtk.Widget {
const networkIcon: Variable<string> = Variable.derive([
bind(AstalNetwork.get_default(), "primary"),
bind(AstalNetwork.get_default(), "wired"),
bind(AstalNetwork.get_default(), "wifi")
],
(primary, wired, wifi) => {
(primary) => {
switch(primary) {
case AstalNetwork.Primary.WIRED: return wired ?
"network-wired-symbolic"
: "network-wired-no-route-symbolic";
case AstalNetwork.Primary.WIRED: return AstalNetwork.get_default().wired.get_icon_name();
case AstalNetwork.Primary.WIFI: return wifi ?
"network-wireless-signal-excellent-symbolic"
: "network-wireless-offline-symbolic";
case AstalNetwork.Primary.WIFI: return AstalNetwork.get_default().wifi.get_icon_name();
}
return "network-no-route-symbolic";
+2 -2
View File
@@ -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<boolean>|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)
])
+1 -1
View File
@@ -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";
})
+1 -1
View File
@@ -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()) ?? ap.ssid.get_data().toString()) ?? "Wi-Fi"
} as Widget.LabelProps),
new Widget.Label({
className: "status",