Merge branch 'retrozinndev:ryo' into ryo
This commit is contained in:
@@ -39,11 +39,17 @@ const plugins = new Set<Runner.Plugin>();
|
||||
|
||||
export function close() { instance?.close(); }
|
||||
|
||||
export function regExMatch(search: string, item: string): boolean {
|
||||
export function regExMatch(search: string, item: (string|number)): boolean {
|
||||
search = search.replace(/[\\^$.*?()[\]{}|]/g, "\\$&");
|
||||
|
||||
if(typeof item === "number")
|
||||
return new RegExp(`${search.split('').map(c =>
|
||||
`.*${c}.*`).join('')}`,
|
||||
"g").test(item.toString());
|
||||
|
||||
return new RegExp(`${search.split('').map(c =>
|
||||
`.*(${c.toLowerCase()}|${c.toUpperCase()}).*`).join('')}`
|
||||
).test(item);
|
||||
`.*${c}.*`).join('')}`,
|
||||
"gi").test(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
.time {
|
||||
font-size: 128px;
|
||||
font-weight: 900;
|
||||
color: colors.$fg-primary;
|
||||
text-shadow: 1px 1px 2px colors.$bg-translucent;
|
||||
}
|
||||
.date {
|
||||
|
||||
+20
-20
@@ -1,26 +1,26 @@
|
||||
// SCSS Variables
|
||||
// Generated by 'wal'
|
||||
$wallpaper: "/home/joaov/wallpapers/Nijika Train.jpeg";
|
||||
$wallpaper: "/home/joaov/wallpapers/Kagamine Rin Yellow Tapes.png";
|
||||
|
||||
// Special
|
||||
$background: #11151b;
|
||||
$foreground: #c3c4c6;
|
||||
$cursor: #c3c4c6;
|
||||
$background: #190b14;
|
||||
$foreground: #c5c2c4;
|
||||
$cursor: #c5c2c4;
|
||||
|
||||
// Colors
|
||||
$color0: #11151b;
|
||||
$color1: #967557;
|
||||
$color2: #4f5869;
|
||||
$color3: #665d63;
|
||||
$color4: #576872;
|
||||
$color5: #787375;
|
||||
$color6: #998c7f;
|
||||
$color7: #90949a;
|
||||
$color8: #5c6371;
|
||||
$color9: #C99D75;
|
||||
$color10: #6A768C;
|
||||
$color11: #897C84;
|
||||
$color12: #748B99;
|
||||
$color13: #A19A9D;
|
||||
$color14: #CDBBAA;
|
||||
$color15: #c3c4c6;
|
||||
$color0: #190b14;
|
||||
$color1: #905027;
|
||||
$color2: #685345;
|
||||
$color3: #766b0c;
|
||||
$color4: #a78117;
|
||||
$color5: #ad9527;
|
||||
$color6: #425c6e;
|
||||
$color7: #998e95;
|
||||
$color8: #6e5a67;
|
||||
$color9: #C06B35;
|
||||
$color10: #8B6F5D;
|
||||
$color11: #9E8F11;
|
||||
$color12: #DFAC1F;
|
||||
$color13: #E7C735;
|
||||
$color14: #597B93;
|
||||
$color15: #c5c2c4;
|
||||
|
||||
+14
-16
@@ -4,19 +4,23 @@ import { Separator } from "./Separator";
|
||||
import { HistoryNotification, Notifications } from "../scripts/notifications";
|
||||
import { GLib } from "astal";
|
||||
import { getAppIcon } from "../scripts/apps";
|
||||
import Pango from "gi://Pango";
|
||||
|
||||
|
||||
function getNotificationImage(notif: AstalNotifd.Notification|HistoryNotification): (string|undefined) {
|
||||
const img = notif.image ?? notif.appIcon;
|
||||
if(!img) return undefined;
|
||||
const img = notif.image || notif.appIcon;
|
||||
|
||||
if(!img.includes('/')) return undefined;
|
||||
if(!img || !img.includes('/'))
|
||||
return undefined;
|
||||
|
||||
if(img.startsWith('/'))
|
||||
return `file://${img}`;
|
||||
switch(true) {
|
||||
case /^[/]/.test(img):
|
||||
return `file://${img}`;
|
||||
|
||||
if(img.startsWith('~') || img.startsWith("file://~"))
|
||||
return `file://${GLib.get_home_dir()}/${img.replace(/^(file\:\/\/|\~|file\:\/\/~)/g, "")}`;
|
||||
case /^[~]/.test(img):
|
||||
case /^file:\/\/[~]/i.test(img):
|
||||
return `file://${GLib.get_home_dir()}/${img.replace(/^(file\:\/\/|[~]|file\:\/\[~])/i, "")}`;
|
||||
}
|
||||
|
||||
return img;
|
||||
}
|
||||
@@ -30,14 +34,6 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number
|
||||
AstalNotifd.get_default().get_notification(notification)
|
||||
: notification;
|
||||
|
||||
const body: string = notification.body.split(' ').map(strPart => {
|
||||
if(/^\<(.*)\>/.test(strPart) || /<\/(.*)\>$/.test(strPart))
|
||||
return strPart;
|
||||
|
||||
return strPart.length >= 25 ? `${strPart.substring(0, 22)}...`
|
||||
: strPart
|
||||
}).join(' ');
|
||||
|
||||
return new Widget.EventBox({
|
||||
onClick: () => {
|
||||
if(notification instanceof AstalNotifd.Notification) {
|
||||
@@ -139,7 +135,9 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number
|
||||
xalign: 0,
|
||||
truncate: false,
|
||||
wrap: true,
|
||||
label: body.replace(/\&/g, "&")
|
||||
singleLineMode: false,
|
||||
wrapMode: Pango.WrapMode.WORD_CHAR,
|
||||
label: notification.body.replace(/&/g, "&")
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
|
||||
Reference in New Issue
Block a user