ags: sync

This commit is contained in:
end-4
2024-01-02 15:54:55 +07:00
parent fae6cf50c1
commit 577550642f
14 changed files with 251 additions and 168 deletions
@@ -1,6 +1,6 @@
const { Gdk, Gtk } = imports.gi;
import { App, SCREEN_WIDTH, SCREEN_HEIGHT, Service, Utils, Variable, Widget } from '../imports.js';
const { Box, Button, Entry, EventBox, Icon, Label, Revealer, Scrollable, Stack } = Widget;
const { Box, Button, EventBox, Label, Overlay, Revealer, Scrollable, Stack } = Widget;
export const MarginRevealer = ({
transition = 'slide_down',
@@ -13,46 +13,41 @@ export const MarginRevealer = ({
}) => {
const widget = Scrollable({
...rest,
css: `min-height: 0px;`,
properties: [
['revealChild', true], // It'll be set to false after init if it's supposed to hide
['transition', transition],
['show', (self) => {
if (self._revealChild) return;
self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
['show', () => {
if (widget._revealChild) return;
widget.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
child.toggleClassName(hideClass, false);
child.toggleClassName(showClass, true);
self._revealChild = true;
widget._revealChild = true;
child.css = 'margin: 0px;';
}],
['hide', (self) => {
if (!self._revealChild) return;
['hide', () => {
if (!widget._revealChild) return;
child.toggleClassName(hideClass, true);
child.toggleClassName(showClass, false);
self._revealChild = false;
if (self._transition == 'slide_left')
widget._revealChild = false;
if (widget._transition == 'slide_left')
child.css = `margin-right: -${child.get_allocated_width()}px;`;
else if (self._transition == 'slide_right')
else if (widget._transition == 'slide_right')
child.css = `margin-left: -${child.get_allocated_width()}px;`;
else if (self._transition == 'slide_up')
else if (widget._transition == 'slide_up')
child.css = `margin-bottom: -${child.get_allocated_height()}px;`;
else if (self._transition == 'slide_down')
else if (widget._transition == 'slide_down')
child.css = `margin-top: -${child.get_allocated_height()}px;`;
}],
['toggle', (self) => {
['toggle', () => {
console.log('toggle');
if (self._revealChild) self._hide(self);
else self._show(self);
if (widget._revealChild) widget._hide();
else widget._show();
}],
...extraProperties,
],
setup: (self) => {
if (!revealChild)
self.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS);
else
self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
self.child = child;
},
child: child,
hscroll: (revealChild ? 'never' : 'always'),
vscroll: (revealChild ? 'never' : 'always'),
});
child.toggleClassName(`${revealChild ? showClass : hideClass}`, true);
return widget;
-1
View File
@@ -7,7 +7,6 @@ const { Box, EventBox, Icon, Overlay, Label, Button, Revealer } = Widget;
import { MaterialIcon } from "./materialicon.js";
import { setupCursorHover } from "./cursorhover.js";
import { AnimatedCircProg } from "./animatedcircularprogress.js";
import { MarginRevealer } from './advancedrevealers.js';
function guessMessageType(summary) {
if (summary.includes('recording')) return 'screen_record';
+1 -1
View File
@@ -68,7 +68,7 @@ menu>menuitem:focus {
}
.separator-line {
background-color: $surfaceVariant;
background-color: $outline;
min-width: 0.068rem;
min-height: 0.068rem;
}
+9 -4
View File
@@ -490,19 +490,24 @@
.menu-decel {
@include menu_decel;
}
.element-show {
@include element_easeInOut;
}
.element-hide {
@include element_easeInOut;
}
.element-move {
@include element_easeInOut;
}
.element-decel {
@include element_decel;
}
.element-bounceout {
@include element_bounceOut;
}
.element-accel {
@include element_accel;
}
.page-move {
@include page_move;
}
+17 -32
View File
@@ -30,56 +30,38 @@ $rounding_large: 1.705rem;
@mixin titlefont {
// Geometric sans-serif
font-family:
'Gabarito',
'Poppins',
'Lexend',
sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
}
@mixin mainfont {
// Other clean sans-serif
font-family:
'Rubik',
'Geist',
'AR One Sans',
'Reddit Sans',
'Inter',
'Roboto',
'Ubuntu',
'Noto Sans',
sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter",
"Roboto", "Ubuntu", "Noto Sans", sans-serif;
// font-weight: 500;
}
@mixin icon-material {
// Material Design Icons
font-family:
'Material Symbols Rounded',
'Material Symbols Outlined',
'Material Symbols Sharp';
font-family: "Material Symbols Rounded", "Material Symbols Outlined",
"Material Symbols Sharp";
}
@mixin icon-nerd {
// Nerd Fonts
font-family:
'SpaceMono NF', 'SpaceMono Nerd Font',
'JetBrains Mono NF', 'JetBrains Mono Nerd Font',
monospace;
font-family: "SpaceMono NF", "SpaceMono Nerd Font", "JetBrains Mono NF",
"JetBrains Mono Nerd Font", monospace;
}
@mixin techfont {
// Monospace for sys info n stuff. Doesn't have to be a nerd font, but it's cool.
font-family: 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', 'JetBrains Mono NL', 'SpaceMono NF', 'SpaceMono Nerd Font', monospace;
font-family: "JetBrains Mono NF", "JetBrains Mono Nerd Font",
"JetBrains Mono NL", "SpaceMono NF", "SpaceMono Nerd Font", monospace;
}
@mixin readingfont {
// The most readable fonts, for a comfortable reading experience
// in stuff like ChatGPT widget
font-family:
'Lexend',
'Noto Sans',
sans-serif;
font-family: "Lexend", "Noto Sans", sans-serif;
// font-weight: 500;
}
@@ -91,7 +73,6 @@ $rounding_large: 1.705rem;
color: $actiontext;
}
$elevation_margin: 0.476rem;
@mixin elevation-safe {
@@ -164,13 +145,17 @@ $elevation_margin: 0.476rem;
@mixin element_decel {
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1);
}
@mixin element_bounceOut {
transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@mixin element_accel {
transition: 300ms cubic-bezier(0.55, 0, 1, 0.45);
}
@mixin element_easeInOut {
transition: 300ms cubic-bezier(0.85, 0, 0.15, 1);
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1);
}
@mixin page_move {
transition: 2000ms cubic-bezier(0, 0.55, 0.45, 1);
}
@function tint($color, $percentage) {
+22 -2
View File
@@ -720,6 +720,21 @@ $onChatgpt: $onPrimary;
border: 0.068rem solid $sidebar_chat_textboxareaColor;
}
.sidebar-chat-chip-toggle {
@include menu_decel;
@include small-rounding;
padding: 0.341rem 0.477rem;
background-color: $surfaceVariant;
color: $onSurfaceVariant;
}
.sidebar-chat-chip-toggle:focus,
.sidebar-chat-chip-toggle:hover {
background-color: mix($surfaceVariant, $onSurfaceVariant, 83%);
}
.sidebar-chat-chip-toggle:active {
background-color: mix($surfaceVariant, $onSurfaceVariant, 67%);
}
.sidebar-pin {
@include small-rounding;
@include menu_decel;
@@ -779,9 +794,14 @@ $onChatgpt: $onPrimary;
$waifu_image_overlay_transparency: 0.7;
.sidebar-waifu-image-action {
@include full-rounding;
min-width: 1.875rem;
min-width: 1.875rem;
min-height: 1.875rem;
background-color: rgba(0, 0, 0, $waifu_image_overlay_transparency); // Fixed cuz on image
background-color: rgba(
0,
0,
0,
$waifu_image_overlay_transparency
); // Fixed cuz on image
color: rgba(255, 255, 255, $waifu_image_overlay_transparency);
}
.sidebar-waifu-image-action:hover,
+19 -4
View File
@@ -5,10 +5,10 @@ import Service from 'resource:///com/github/Aylur/ags/service.js';
// Usage from my python waifu fetcher, for reference
// Usage: waifu-get.py [OPTION]... [TAG]...
// Options:
// --segs\tForce NSFW images
// --im\tUse waifu.im API. You can use many tags
// --pics\tUse waifu.pics API. Use 1 tag only.
// --nekos\tUse nekos.life (old) API. No tags.
// --segs\tForce NSFW images
// Tags:
// waifu.im (type):
@@ -82,11 +82,25 @@ class WaifuService extends Service {
get responses() { return this._responses }
fetch(msg) {
// Init
const newMessageId = this._responses.length;
const taglist = msg.split(' ');
const userArgs = msg.split(' ');
let taglist = [];
this._nsfw = false;
// Construct body/headers
for (let i = 0; i < userArgs.length; i++) {
const thisArg = userArgs[i];
if (thisArg == '--im') this._mode = 'im';
else if (thisArg == '--nekos') this._mode = 'nekos';
else if (thisArg.includes('pics')) this._mode = 'pics';
else if (thisArg.includes('segs') || thisArg.includes('sex') || thisArg.includes('lewd')) this._nsfw = true;
else {
taglist.push(thisArg);
if(['ecchi', 'hentai', 'ero', 'ass', 'paizuri', 'oral', 'milf'].includes(thisArg)) this._nsfw = true;
}
}
this._queries.push(taglist);
this.emit('newResponse', newMessageId);
// Construct body/headers
const params = {
'included_tags': taglist,
'height': `>=${this._minHeight}`,
@@ -94,12 +108,13 @@ class WaifuService extends Service {
};
const paramString = paramStringFromObj(params);
// Fetch
// Note: body isn't included since passing directly to url is more reliable
const options = {
method: 'GET',
headers: this._headers[this._mode],
};
var status = 0;
Utils.fetch(`${this._baseUrl}?${paramString}`, options)
Utils.fetch(`${this._endpoints[this._mode]}?${paramString}`, options)
.then(result => {
status = result.status;
return result.text();
+84 -60
View File
@@ -24,18 +24,18 @@
min-width: 3rem; }
.txt-title {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 2.045rem; }
.txt-title-small {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1.364rem; }
.techfont {
font-family: 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', 'JetBrains Mono NL', 'SpaceMono NF', 'SpaceMono Nerd Font', monospace; }
font-family: "JetBrains Mono NF", "JetBrains Mono Nerd Font", "JetBrains Mono NL", "SpaceMono NF", "SpaceMono Nerd Font", monospace; }
.txt-reading {
font-family: 'Lexend', 'Noto Sans', sans-serif; }
font-family: "Lexend", "Noto Sans", sans-serif; }
.no-anim {
transition: 0ms; }
@@ -57,47 +57,47 @@
margin: 10px; }
.txt-badonkers {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 3rem; }
.txt-tiddies {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 2.7273rem; }
.txt-hugerass {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 2.045rem; }
.txt-hugeass {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1.8182rem; }
.txt-larger {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1.6363rem; }
.txt-large {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1.4545rem; }
.txt-norm {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1.2727rem; }
.txt-small {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1.0909rem; }
.txt-smallie {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 1rem; }
.txt-smaller {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 0.9091rem; }
.txt-tiny {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 0.7273rem; }
.txt-poof {
@@ -119,16 +119,16 @@
font-style: italic; }
.titlefont {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif; }
font-family: "Gabarito", "Poppins", "Lexend", sans-serif; }
.mainfont {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif; }
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif; }
.icon-material {
font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp'; }
font-family: "Material Symbols Rounded", "Material Symbols Outlined", "Material Symbols Sharp"; }
.icon-nerd {
font-family: 'SpaceMono NF', 'SpaceMono Nerd Font', 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', monospace; }
font-family: "SpaceMono NF", "SpaceMono Nerd Font", "JetBrains Mono NF", "JetBrains Mono Nerd Font", monospace; }
.separator-circle {
border-radius: 9999px;
@@ -370,17 +370,26 @@
transition: 300ms cubic-bezier(0.1, 1, 0, 1); }
.element-show {
transition: 300ms cubic-bezier(0.85, 0, 0.15, 1); }
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1); }
.element-hide {
transition: 300ms cubic-bezier(0.85, 0, 0.15, 1); }
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1); }
.element-move {
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1); }
.element-decel {
transition: 300ms cubic-bezier(0, 0.55, 0.45, 1); }
.element-bounceout {
transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.element-accel {
transition: 300ms cubic-bezier(0.55, 0, 1, 0.45); }
.page-move {
transition: 2000ms cubic-bezier(0, 0.55, 0.45, 1); }
* {
caret-color: #ffc4f5; }
* selection {
@@ -432,7 +441,7 @@ menu > menuitem:focus {
background-color: #4a4147; }
.separator-line {
background-color: #3b3338;
background-color: #9a8d95;
min-width: 0.068rem;
min-height: 0.068rem; }
@@ -634,11 +643,11 @@ tooltip {
margin: 0rem 0.682rem; }
.bar-clock {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1.2727rem; }
.bar-date {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1rem;
color: #eae0e4; }
@@ -710,7 +719,7 @@ tooltip {
.bar-music-playstate-txt {
transition: 100ms cubic-bezier(0.05, 0.7, 0.1, 1);
font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp'; }
font-family: "Material Symbols Rounded", "Material Symbols Outlined", "Material Symbols Sharp"; }
.bar-music-cover {
background-position: center;
@@ -887,7 +896,7 @@ tooltip {
padding: 1.364rem; }
.cheatsheet-key {
font-family: 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', 'JetBrains Mono NL', 'SpaceMono NF', 'SpaceMono Nerd Font', monospace;
font-family: "JetBrains Mono NF", "JetBrains Mono Nerd Font", "JetBrains Mono NL", "SpaceMono NF", "SpaceMono Nerd Font", monospace;
min-height: 1.364rem;
min-width: 1.364rem;
margin: 0.17rem;
@@ -920,7 +929,7 @@ tooltip {
background-color: #685e64; }
.cheatsheet-category-title {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1.705rem; }
.bg-time-box {
@@ -961,11 +970,11 @@ tooltip {
border: 0.682rem solid; }
.bg-quicklaunch-title {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
color: #d1c2cb; }
.bg-quicklaunch-btn {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
border-radius: 9999px;
-gtk-outline-radius: 9999px;
background-color: #3b3338;
@@ -1067,7 +1076,7 @@ tooltip {
margin-top: 0.341rem; }
.osd-value-txt {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1.688rem;
font-weight: 500;
color: #eae0e4; }
@@ -1209,7 +1218,7 @@ tooltip {
.overview-search-results-txt-cmd {
margin-right: 0.682rem;
font-family: 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', 'JetBrains Mono NL', 'SpaceMono NF', 'SpaceMono Nerd Font', monospace;
font-family: "JetBrains Mono NF", "JetBrains Mono Nerd Font", "JetBrains Mono NL", "SpaceMono NF", "SpaceMono Nerd Font", monospace;
font-size: 1.227rem; }
.overview-search-result-btn {
@@ -1247,7 +1256,7 @@ tooltip {
background-color: rgba(54, 47, 51, 0.1147); }
.overview-tasks-workspace-number {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
color: rgba(220, 210, 214, 0.31); }
.overview-tasks-window {
@@ -1781,7 +1790,7 @@ tooltip {
.sidebar-module-btn-arrow {
border-radius: 9999px;
-gtk-outline-radius: 9999px;
font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp';
font-family: "Material Symbols Rounded", "Material Symbols Outlined", "Material Symbols Sharp";
background-color: rgba(59, 51, 56, 0.31);
min-width: 1.705rem;
min-height: 1.705rem; }
@@ -1864,7 +1873,7 @@ tooltip {
background-color: #dbbed2; }
.sidebar-chat-name {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
padding: 0.341rem;
margin-left: -0.136rem;
padding-left: 0.818rem; }
@@ -1875,7 +1884,7 @@ tooltip {
padding-left: 0.818rem; }
.sidebar-chat-txt {
font-family: 'Lexend', 'Noto Sans', sans-serif; }
font-family: "Lexend", "Noto Sans", sans-serif; }
.sidebar-chat-codeblock {
border-radius: 1.159rem;
@@ -1886,7 +1895,7 @@ tooltip {
border: 0.068rem solid rgba(248, 218, 238, 0.07); }
.sidebar-chat-codeblock-topbar {
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
margin: 0.273rem;
margin-bottom: 0rem;
background-color: #554050;
@@ -1915,7 +1924,7 @@ tooltip {
background-color: #967e8f; }
.sidebar-chat-codeblock-code {
font-family: 'JetBrains Mono NF', 'JetBrains Mono Nerd Font', 'JetBrains Mono NL', 'SpaceMono NF', 'SpaceMono Nerd Font', monospace;
font-family: "JetBrains Mono NF", "JetBrains Mono Nerd Font", "JetBrains Mono NL", "SpaceMono NF", "SpaceMono Nerd Font", monospace;
padding: 0.682rem; }
.sidebar-chat-divider {
@@ -1965,6 +1974,21 @@ tooltip {
color: #776c73;
border: 0.068rem solid #776c73; }
.sidebar-chat-chip-toggle {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
border-radius: 0.818rem;
-gtk-outline-radius: 0.818rem;
padding: 0.341rem 0.477rem;
background-color: #3b3338;
color: #d1c2cb; }
.sidebar-chat-chip-toggle:focus,
.sidebar-chat-chip-toggle:hover {
background-color: #554b51; }
.sidebar-chat-chip-toggle:active {
background-color: #6d6269; }
.sidebar-pin {
border-radius: 0.818rem;
-gtk-outline-radius: 0.818rem;
@@ -1993,7 +2017,7 @@ tooltip {
background-color: #dda0d4; }
.sidebar-waifu-heading {
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
padding: 0.341rem;
margin-left: -0.136rem;
padding-left: 0.818rem; }
@@ -2002,7 +2026,7 @@ tooltip {
margin-left: 0.682rem; }
.sidebar-waifu-txt {
font-family: 'Lexend', 'Noto Sans', sans-serif;
font-family: "Lexend", "Noto Sans", sans-serif;
margin-left: 0.682rem; }
.sidebar-waifu-image {
@@ -2247,9 +2271,9 @@ tooltip {
border-radius: 1.159rem;
-gtk-outline-radius: 1.159rem;
min-width: 29.659rem;
background-color: #dae8ed;
background-color: #100d10;
padding: 0rem 1.023rem;
background: linear-gradient(127deg, rgba(131, 159, 170, 0.7), rgba(131, 159, 170, 0.55) 70.71%), linear-gradient(217deg, rgba(102, 105, 105, 0.7), rgba(102, 105, 105, 0.55) 70.71%), radial-gradient(circle at 0% 100%, #86776E 13%, rgba(0, 0, 0, 0) 100%), linear-gradient(336deg, rgba(144, 134, 123, 0.7), rgba(144, 134, 123, 0.55) 70.71%), linear-gradient(#dae8ed, #dae8ed); }
background: linear-gradient(127deg, rgba(47, 41, 46, 0.7), rgba(47, 41, 46, 0.55) 70.71%), linear-gradient(217deg, rgba(78, 68, 75, 0.7), rgba(78, 68, 75, 0.55) 70.71%), radial-gradient(circle at 0% 100%, #554050 13%, rgba(0, 0, 0, 0) 100%), linear-gradient(336deg, rgba(85, 64, 80, 0.7), rgba(85, 64, 80, 0.55) 70.71%), linear-gradient(#100d10, #100d10); }
.osd-music-cover-fallback {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
@@ -2257,8 +2281,8 @@ tooltip {
-gtk-outline-radius: 0.818rem;
min-width: 7.5rem;
min-height: 7.5rem;
background-color: rgba(233, 241, 247, 0.3);
color: #0a0b0f; }
background-color: rgba(33, 27, 31, 0.31);
color: #dad0d5; }
.osd-music-cover {
border-radius: 0.818rem;
@@ -2282,35 +2306,35 @@ tooltip {
.osd-music-title {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
font-size: 1.364rem;
color: #0a0b0f; }
color: #dad0d5; }
.osd-music-artists {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
font-family: 'Rubik', 'Geist', 'AR One Sans', 'Reddit Sans', 'Inter', 'Roboto', 'Ubuntu', 'Noto Sans', sans-serif;
font-family: "Rubik", "Geist", "AR One Sans", "Reddit Sans", "Inter", "Roboto", "Ubuntu", "Noto Sans", sans-serif;
font-size: 0.955rem;
color: rgba(20, 22, 26, 0.9); }
color: rgba(205, 196, 201, 0.9); }
.osd-music-pill {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
border-radius: 9999px;
-gtk-outline-radius: 9999px;
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
min-width: 1.833rem;
padding: 0.273rem 0.682rem;
background-color: rgba(139, 149, 154, 0.5);
color: #0a0b0f; }
background-color: rgba(55, 46, 53, 0.5);
color: #dad0d5; }
.osd-music-controls {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
border-radius: 9999px;
-gtk-outline-radius: 9999px;
font-family: 'Gabarito', 'Poppins', 'Lexend', sans-serif;
font-family: "Gabarito", "Poppins", "Lexend", sans-serif;
min-width: 1.833rem;
padding: 0.205rem;
background-color: rgba(139, 149, 154, 0.5);
color: #0a0b0f; }
background-color: rgba(55, 46, 53, 0.5);
color: #dad0d5; }
.osd-music-controlbtn {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
@@ -2321,15 +2345,15 @@ tooltip {
.osd-music-controlbtn:hover,
.osd-music-controlbtn:focus {
background-color: rgba(107, 115, 119, 0.55); }
background-color: rgba(96, 87, 93, 0.55); }
.osd-music-controlbtn:active {
background-color: rgba(94, 101, 106, 0.575); }
background-color: rgba(111, 102, 108, 0.575); }
.osd-music-controlbtn-txt {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
transition: 100ms cubic-bezier(0.05, 0.7, 0.1, 1);
font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp';
font-family: "Material Symbols Rounded", "Material Symbols Outlined", "Material Symbols Sharp";
font-size: 1.364rem;
margin: -0.1rem 0rem; }
@@ -2338,19 +2362,19 @@ tooltip {
min-width: 0.409rem;
min-height: 3.068rem;
padding: 0.273rem;
color: #0a0b0f; }
color: #dad0d5; }
.osd-music-playstate {
transition: 300ms cubic-bezier(0.1, 1, 0, 1);
min-height: 3.068rem;
min-width: 3.068rem;
border-radius: 10rem;
background-color: rgba(139, 149, 154, 0.5);
color: #0a0b0f; }
background-color: rgba(55, 46, 53, 0.5);
color: #dad0d5; }
.osd-music-playstate-btn > label {
transition: 50ms cubic-bezier(0.05, 0.7, 0.1, 1);
font-family: 'Material Symbols Rounded', 'Material Symbols Outlined', 'Material Symbols Sharp';
font-family: "Material Symbols Rounded", "Material Symbols Outlined", "Material Symbols Sharp";
font-size: 1.364rem;
margin: -0.1rem 0rem; }
+8 -1
View File
@@ -5,6 +5,13 @@ const { execAsync, exec } = Utils;
import { AnimatedCircProg } from "../../lib/animatedcircularprogress.js";
import { showMusicControls } from '../../variables.js';
function trimTrackTitle(title) {
// Removes stuff like【C93】 at beginning
var pattern = /【[^】]*】/;
var cleanedTitle = title.replace(pattern, '');
return cleanedTitle.trim();
}
const TrackProgress = () => {
const _updateProgress = (circprog) => {
const mpris = Mpris.getPlayer('');
@@ -69,7 +76,7 @@ export const ModuleMusic = () => Widget.EventBox({
connections: [[Mpris, label => {
const mpris = Mpris.getPlayer('');
if (mpris)
label.label = `${mpris.trackTitle}${mpris.trackArtists.join(', ')}`;
label.label = `${trimTrackTitle(mpris.trackTitle)}${mpris.trackArtists.join(', ')}`;
else
label.label = 'No media';
}]],
@@ -3,7 +3,7 @@ const { GLib, Gtk } = imports.gi;
import { App, Service, Utils, Widget } from '../../imports.js';
import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
const { Box, Label, ProgressBar, Revealer } = Widget;
import { MarginRevealer } from '../../lib/advancedrevealers.js';
import { MarginRevealer } from '../../lib/advancedwidgets.js';
import Brightness from '../../services/brightness.js';
import Indicator from '../../services/indicator.js';
@@ -63,8 +63,8 @@ export default () => MarginRevealer({
hideClass: 'osd-hide',
connections: [
[Indicator, (revealer, value) => {
if(value > -1) revealer._show(revealer);
else revealer._hide(revealer);
if(value > -1) revealer._show();
else revealer._hide();
}, 'popup'],
],
child: Box({
@@ -4,7 +4,7 @@ const { exec, execAsync } = Utils;
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
const { Box, EventBox, Icon, Scrollable, Label, Button, Revealer } = Widget;
import { MarginRevealer } from '../../lib/advancedrevealers.js';
import { MarginRevealer } from '../../lib/advancedwidgets.js';
import { AnimatedCircProg } from "../../lib/animatedcircularprogress.js";
import { MaterialIcon } from '../../lib/materialicon.js';
import { showMusicControls } from '../../variables.js';
@@ -74,6 +74,12 @@ function getTrackfont(player) {
if (title.includes('東方')) return 'Crimson Text, serif'; // Serif for Touhou stuff
return DEFAULT_MUSIC_FONT;
}
function trimTrackTitle(title) {
// Removes stuff like【C93】 at beginning
var pattern = /【[^】]*】/;
var cleanedTitle = title.replace(pattern, '');
return cleanedTitle.trim();
}
const TrackProgress = ({ player, ...rest }) => {
const _updateProgress = (circprog) => {
@@ -102,7 +108,7 @@ const TrackTitle = ({ player, ...rest }) => Label({
className: 'osd-music-title',
connections: [[player, (self) => {
// Player name
self.label = player.trackTitle.length > 0 ? player.trackTitle : 'No media';
self.label = player.trackTitle.length > 0 ? trimTrackTitle(player.trackTitle) : 'No media';
// Font based on track/artist
const fontForThisTrack = getTrackfont(player);
self.css = `font-family: ${fontForThisTrack}, ${DEFAULT_MUSIC_FONT};`;
@@ -374,8 +380,8 @@ export default () => MarginRevealer({
}),
connections: [
[showMusicControls, (revealer) => {
if(showMusicControls.value) revealer._show(revealer);
else revealer._hide(revealer);
if(showMusicControls.value) revealer._show();
else revealer._hide();
}],
],
})
+1 -1
View File
@@ -4,7 +4,7 @@ import Applications from 'resource:///com/github/Aylur/ags/service/applications.
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
const { execAsync, exec } = Utils;
import { setupCursorHover, setupCursorHoverGrab } from "../../lib/cursorhover.js";
import { DoubleRevealer } from "../../lib/advancedrevealers.js";
import { DoubleRevealer } from "../../lib/advancedwidgets.js";
import { execAndClose, expandTilde, hasUnterminatedBackslash, startsWithNumber, launchCustomCommand, ls } from './miscfunctions.js';
import {
CalculationResultButton, CustomCommandButton, DirectoryButton,
+3 -3
View File
@@ -8,7 +8,7 @@ import { setupCursorHover, setupCursorHoverInfo } from "../../../lib/cursorhover
import { SystemMessage, ChatMessage } from "./chatgpt_chatmessage.js";
import { ConfigToggle, ConfigSegmentedSelection, ConfigGap } from '../../../lib/configwidgets.js';
import { markdownTest } from '../../../lib/md2pango.js';
import { MarginRevealer } from '../../../lib/advancedrevealers.js';
import { MarginRevealer } from '../../../lib/advancedwidgets.js';
export const chatGPTTabIcon = Box({
hpack: 'center',
@@ -66,10 +66,10 @@ export const chatGPTSettings = MarginRevealer({
revealChild: true,
connections: [
[ChatGPT, (self) => Utils.timeout(200, () => {
self._hide(self);
self._hide();
}), 'newMsg'],
[ChatGPT, (self) => Utils.timeout(200, () => {
self._show(self);
self._show();
}), 'clear'],
],
child: Box({
+54 -27
View File
@@ -3,10 +3,12 @@ import { App, Utils, Widget } from '../../../imports.js';
const { Box, Button, Entry, EventBox, Icon, Label, Revealer, Scrollable, Stack } = Widget;
const { execAsync, exec } = Utils;
import { MaterialIcon } from "../../../lib/materialicon.js";
import { MarginRevealer } from '../../../lib/advancedrevealers.js';
import { MarginRevealer } from '../../../lib/advancedwidgets.js';
import { setupCursorHover, setupCursorHoverInfo } from "../../../lib/cursorhover.js";
import WaifuService from '../../../services/waifus.js';
const IMAGE_REVEAL_DELAY = 13; // Some wait for inits n other weird stuff
// Create cache folder and clear pics from previous session
Utils.exec(`bash -c 'mkdir -p ${GLib.get_user_cache_dir()}/ags/media/waifus'`);
Utils.exec(`bash -c 'rm ${GLib.get_user_cache_dir()}/ags/media/waifus/*'`);
@@ -125,7 +127,7 @@ const WaifuImage = (taglist) => {
const thisBlock = Box({
className: 'sidebar-chat-message',
properties: [
['update', (imageData) => {
['update', (imageData, force = false) => {
blockImageData = imageData;
const { status, signature, url, source, dominant_color, is_nsfw, width, height, tags } = blockImageData;
if (status != 200) {
@@ -141,13 +143,15 @@ const WaifuImage = (taglist) => {
const showImage = () => {
downloadState.shown = 'done';
blockImage.css = `background-image:url('${imagePath}');`;
blockImageRevealer.revealChild = true;
Utils.timeout(blockImageRevealer.transitionDuration,
Utils.timeout(IMAGE_REVEAL_DELAY, () => {
blockImageRevealer.revealChild = true;
})
Utils.timeout(IMAGE_REVEAL_DELAY + blockImageRevealer.transitionDuration,
() => blockImage.get_children()[0].revealChild = true
);
downloadIndicator._hide(downloadIndicator);
downloadIndicator._hide();
}
if (Gio.File.new_for_path(imagePath).query_exists(null)) showImage();
if (!force && Gio.File.new_for_path(imagePath).query_exists(null)) showImage();
else Utils.execAsync(['bash', '-c', `wget -O '${imagePath}' '${url}'`])
.then(showImage)
.catch(print);
@@ -224,27 +228,50 @@ export const waifuView = Scrollable({
}
});
// const waifuTags = Box({
// className: 'spacing-h-5',
// children: [
// Box({ hexpand: true }),
// CommandButton('waifu'),
// CommandButton('maid'),
// CommandButton('uniform'),
// CommandButton('oppai'),
// CommandButton('selfies'),
// CommandButton('marin-kitagawa'),
// CommandButton('raiden-shogun'),
// CommandButton('mori-calliope'),
// ]
// });
const waifuTags = Revealer({
revealChild: false,
transition: 'crossfade',
transitionDuration: 150,
child: Box({
className: 'spacing-h-5',
children: [
Scrollable({
vscroll: 'never',
hscroll: 'automatic',
hexpand: true,
child: Box({
className: 'spacing-h-5',
children: [
CommandButton('waifu'),
CommandButton('maid'),
CommandButton('uniform'),
CommandButton('oppai'),
CommandButton('selfies'),
CommandButton('marin-kitagawa'),
CommandButton('raiden-shogun'),
CommandButton('mori-calliope'),
]
})
}),
Box({ className: 'separator-line' }),
]
})
});
export const waifuCommands = Box({
className: 'spacing-h-5',
children: [
Box({ hexpand: true }),
CommandButton('/clear'),
]
setup: (self) => {
self.pack_end(CommandButton('/clear'), false, false, 0);
self.pack_start(Button({
className: 'sidebar-chat-chip-toggle',
setup: setupCursorHover,
label: 'Tags →',
onClicked: () => {
waifuTags.revealChild = !waifuTags.revealChild;
}
}), false, false, 0);
self.pack_start(waifuTags, true, true, 0);
}
});
export const sendMessage = (text) => {
@@ -253,7 +280,7 @@ export const sendMessage = (text) => {
if (text.startsWith('/')) {
if (text.startsWith('/clear')) {
const kids = waifuContent.get_children();
for (let i = 0; i < kids.length; i++) {
for (let i = kids.length - 1; i >= 0; i--) {
const child = kids[i];
child.destroy();
}
@@ -261,7 +288,7 @@ export const sendMessage = (text) => {
else if (text.startsWith('/test')) {
const newImage = WaifuImage(['/test']);
waifuContent.add(newImage);
Utils.timeout(13, () => newImage._update({ // Needs timeout or inits won't make it
Utils.timeout(IMAGE_REVEAL_DELAY, () => newImage._update({ // Needs timeout or inits won't make it
// This is an image uploaded to my github repo
status: 200,
url: 'https://picsum.photos/400/600',
@@ -272,7 +299,7 @@ export const sendMessage = (text) => {
width: 300,
height: 200,
tags: ['/test'],
}));
}, true));
}
}
else WaifuService.fetch(text);