Merge pull request #10 from NotMephisto/ryo
Icon changes Thanks to @NotMephisto !!
This commit is contained in:
@@ -71,7 +71,7 @@ Colorshell supports i18n! The shell automatically matches the shell language wit
|
|||||||
Currently, there's support for the following languages:
|
Currently, there's support for the following languages:
|
||||||
- **English** (English, United States), maintained by [@retrozinndev](https://github.com/retrozinndev)
|
- **English** (English, United States), maintained by [@retrozinndev](https://github.com/retrozinndev)
|
||||||
- **Português** (Portuguese, Brazil), 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>
|
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!
|
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!
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default {
|
|||||||
},
|
},
|
||||||
night_light: {
|
night_light: {
|
||||||
title: "Ночной свет",
|
title: "Ночной свет",
|
||||||
default_desc: "Точность"
|
default_desc: "Тонн"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pages: {
|
pages: {
|
||||||
@@ -69,10 +69,10 @@ export default {
|
|||||||
paired_devices: "Привязанные устройства",
|
paired_devices: "Привязанные устройства",
|
||||||
start_discovering: "Начать поиск",
|
start_discovering: "Начать поиск",
|
||||||
stop_discovering: "Остановить поиск",
|
stop_discovering: "Остановить поиск",
|
||||||
untrust_device: "Не доверять устройству",
|
untrust_device: "Недоверенное устройство",
|
||||||
unpair_device: "Отвязать устройство",
|
unpair_device: "Отвязанное устройство",
|
||||||
trust_device: "Доверять устройству",
|
trust_device: "Доверенное устройство",
|
||||||
pair_device: "Привязать устройство"
|
pair_device: "Привязанное устройство"
|
||||||
},
|
},
|
||||||
network: {
|
network: {
|
||||||
title: "Интернет",
|
title: "Интернет",
|
||||||
|
|||||||
@@ -81,3 +81,10 @@ export function getAppIcon(app: (string|AstalApps.Application)): (string|undefin
|
|||||||
|
|
||||||
return getIconByAppName(app.name);
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { exec, execAsync, Gio, GLib } from "astal";
|
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) {
|
export function getHyprlandInstanceSig(): (string|null) {
|
||||||
return GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE");
|
return GLib.getenv("HYPRLAND_INSTANCE_SIGNATURE");
|
||||||
|
|||||||
+7
-14
@@ -1,16 +1,10 @@
|
|||||||
import { bind } from "astal";
|
import { bind } from "astal";
|
||||||
import { Gtk, Widget } from "astal/gtk3";
|
import { Gtk, Widget } from "astal/gtk3";
|
||||||
import AstalMpris from "gi://AstalMpris";
|
import AstalMpris from "gi://AstalMpris";
|
||||||
|
import { getSymbolicIcon } from "../../scripts/apps";
|
||||||
import { Separator, SeparatorProps } from "../Separator";
|
import { Separator, SeparatorProps } from "../Separator";
|
||||||
import { Windows } from "../../windows";
|
import { Windows } from "../../windows";
|
||||||
|
|
||||||
|
|
||||||
const playerIcons = {
|
|
||||||
spotify: "spotify-symbolic",
|
|
||||||
mpv: "mpv-symbolic",
|
|
||||||
Clapper: "com.github.rafostar.Clapper-symbolic"
|
|
||||||
};
|
|
||||||
|
|
||||||
export function Media(): Gtk.Widget {
|
export function Media(): Gtk.Widget {
|
||||||
const connections: Array<number> = [];
|
const connections: Array<number> = [];
|
||||||
|
|
||||||
@@ -88,13 +82,12 @@ export function Media(): Gtk.Widget {
|
|||||||
players[0] ? [
|
players[0] ? [
|
||||||
new Widget.Icon({
|
new Widget.Icon({
|
||||||
icon: bind(players[0], "busName").as((busName: string) => {
|
icon: bind(players[0], "busName").as((busName: string) => {
|
||||||
const splitName = busName.split('.').filter(str => str !== "");
|
const splitName = busName.split('.').filter(str => str !== "" && !str.toLowerCase().includes('instance'));
|
||||||
|
if (getSymbolicIcon(splitName[splitName.length - 1])) {
|
||||||
return playerIcons[
|
return getSymbolicIcon(splitName[splitName.length - 1]);
|
||||||
Object.keys(playerIcons).filter(icon =>
|
} else {
|
||||||
splitName[splitName.length - 1].includes(icon))?.[0] as keyof typeof playerIcons
|
return "folder-music-symbolic"
|
||||||
]
|
};
|
||||||
?? "folder-music-symbolic";
|
|
||||||
})
|
})
|
||||||
} as Widget.IconProps),
|
} as Widget.IconProps),
|
||||||
new Widget.Label({
|
new Widget.Label({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { bind, Variable } from "astal";
|
import { bind, Variable } from "astal";
|
||||||
import { Gtk, Widget } from "astal/gtk3"
|
import { Gtk, Widget } from "astal/gtk3"
|
||||||
import AstalHyprland from "gi://AstalHyprland";
|
import AstalHyprland from "gi://AstalHyprland";
|
||||||
import { getAppIcon } from "../../scripts/apps";
|
import { getSymbolicIcon } from "../../scripts/apps";
|
||||||
|
|
||||||
export const SpecialWorkspaces: (() => Gtk.Widget) = () => new Widget.EventBox({
|
export const SpecialWorkspaces: (() => Gtk.Widget) = () => new Widget.EventBox({
|
||||||
className: "special-ws-eventbox",
|
className: "special-ws-eventbox",
|
||||||
@@ -28,9 +28,7 @@ export const SpecialWorkspaces: (() => Gtk.Widget) = () => new Widget.EventBox({
|
|||||||
], (lastClient, focusedWorkspace) => focusedWorkspace?.id === workspace.id ?
|
], (lastClient, focusedWorkspace) => focusedWorkspace?.id === workspace.id ?
|
||||||
false : Boolean(lastClient))(),
|
false : Boolean(lastClient))(),
|
||||||
icon: bind(workspace, "lastClient").as((lastClient) =>
|
icon: bind(workspace, "lastClient").as((lastClient) =>
|
||||||
lastClient ?
|
getSymbolicIcon(lastClient) ?? "image-missing")
|
||||||
getAppIcon(lastClient.initialClass) || "image-missing"
|
|
||||||
: "image-missing")
|
|
||||||
} as Widget.IconProps)
|
} as Widget.IconProps)
|
||||||
} as Widget.BoxProps),
|
} as Widget.BoxProps),
|
||||||
onClickRelease: () => AstalHyprland.get_default().dispatch(
|
onClickRelease: () => AstalHyprland.get_default().dispatch(
|
||||||
|
|||||||
@@ -123,18 +123,12 @@ function StatusIcons(): Gtk.Widget {
|
|||||||
|
|
||||||
const networkIcon: Variable<string> = Variable.derive([
|
const networkIcon: Variable<string> = Variable.derive([
|
||||||
bind(AstalNetwork.get_default(), "primary"),
|
bind(AstalNetwork.get_default(), "primary"),
|
||||||
bind(AstalNetwork.get_default(), "wired"),
|
|
||||||
bind(AstalNetwork.get_default(), "wifi")
|
|
||||||
],
|
],
|
||||||
(primary, wired, wifi) => {
|
(primary) => {
|
||||||
switch(primary) {
|
switch(primary) {
|
||||||
case AstalNetwork.Primary.WIRED: return wired ?
|
case AstalNetwork.Primary.WIRED: return AstalNetwork.get_default().wired.get_icon_name();
|
||||||
"network-wired-symbolic"
|
|
||||||
: "network-wired-no-route-symbolic";
|
|
||||||
|
|
||||||
case AstalNetwork.Primary.WIFI: return wifi ?
|
case AstalNetwork.Primary.WIFI: return AstalNetwork.get_default().wifi.get_icon_name();
|
||||||
"network-wireless-signal-excellent-symbolic"
|
|
||||||
: "network-wireless-offline-symbolic";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "network-no-route-symbolic";
|
return "network-no-route-symbolic";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { bind, Variable } from "astal";
|
import { bind, Variable } from "astal";
|
||||||
import { Gtk, Widget } from "astal/gtk3";
|
import { Gtk, Widget } from "astal/gtk3";
|
||||||
import AstalHyprland from "gi://AstalHyprland";
|
import AstalHyprland from "gi://AstalHyprland";
|
||||||
import { getAppIcon } from "../../scripts/apps";
|
import { getSymbolicIcon } from "../../scripts/apps";
|
||||||
|
|
||||||
let showWsNum: (Variable<boolean>|undefined);
|
let showWsNum: (Variable<boolean>|undefined);
|
||||||
export const showWorkspaceNumber = (show: boolean) =>
|
export const showWorkspaceNumber = (show: boolean) =>
|
||||||
@@ -73,7 +73,7 @@ export function Workspaces(): Gtk.Widget {
|
|||||||
: Boolean(lastClient)),
|
: Boolean(lastClient)),
|
||||||
icon: lastClient ?
|
icon: lastClient ?
|
||||||
bind(lastClient, "class").as((clss) =>
|
bind(lastClient, "class").as((clss) =>
|
||||||
getAppIcon(clss) ?? "application-x-executable-symbolic")
|
getSymbolicIcon(clss) ?? "application-x-executable-symbolic")
|
||||||
: undefined
|
: undefined
|
||||||
} as Widget.IconProps)
|
} as Widget.IconProps)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ export function BigMedia(): Gtk.Widget {
|
|||||||
halign: Gtk.Align.END,
|
halign: Gtk.Align.END,
|
||||||
label: bind(players[0], "length").as((len/* bananananananana */: number) => {
|
label: bind(players[0], "length").as((len/* bananananananana */: number) => {
|
||||||
const sec: number = Math.floor(len % 60);
|
const sec: number = Math.floor(len % 60);
|
||||||
return len > 0 ?
|
return (len > 0 && Number.isFinite(len)) ?
|
||||||
`${Math.floor(len / 60)}:${sec < 10 ? "0" : ""}${sec}`
|
`${Math.floor(len / 60)}:${sec < 10 ? "0" : ""}${sec}`
|
||||||
: "0:00";
|
: "0:00";
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export const PageNetwork: (() => Page) = () => new Page({
|
|||||||
new Widget.Label({
|
new Widget.Label({
|
||||||
className: "ssid",
|
className: "ssid",
|
||||||
halign: Gtk.Align.START,
|
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),
|
} as Widget.LabelProps),
|
||||||
new Widget.Label({
|
new Widget.Label({
|
||||||
className: "status",
|
className: "status",
|
||||||
|
|||||||
Reference in New Issue
Block a user