forked from Shinonome/dots-hyprland
Merge branch 'illogical-impulse' into illogical-impulse
This commit is contained in:
@@ -83,22 +83,22 @@ export const AnimatedCircProg = ({
|
||||
|
||||
// Init animation
|
||||
if (initFrom != initTo) {
|
||||
// area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
|
||||
area.css = `font-size: ${initFrom}px; transition: ${initAnimTime}ms linear;`;
|
||||
Utils.timeout(20, () => {
|
||||
area.css = `font-size: ${initTo}px;`;
|
||||
}, area)
|
||||
// const transitionDistance = initTo - initFrom;
|
||||
// const oneStep = initAnimTime / initAnimPoints;
|
||||
// area.css = `
|
||||
// font-size: ${initFrom}px;
|
||||
// transition: ${oneStep}ms linear;
|
||||
// `;
|
||||
// for (let i = 0; i < initAnimPoints; i++) {
|
||||
// Utils.timeout(Math.max(10, i * oneStep), () => {
|
||||
// if(!area) return;
|
||||
// area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
|
||||
// });
|
||||
// }
|
||||
const transitionDistance = initTo - initFrom;
|
||||
const oneStep = initAnimTime / initAnimPoints;
|
||||
area.css = `
|
||||
font-size: ${initFrom}px;
|
||||
transition: ${oneStep}ms linear;
|
||||
`;
|
||||
for (let i = 0; i < initAnimPoints; i++) {
|
||||
Utils.timeout(Math.max(10, i * oneStep), () => {
|
||||
if(!area) return;
|
||||
area.css = `${initFrom != initTo ? 'font-size: ' + (initFrom + (transitionDistance / initAnimPoints * (i + 1))) + 'px;' : ''}`;
|
||||
});
|
||||
}
|
||||
}
|
||||
else area.css = 'font-size: 0px;';
|
||||
extraSetup(area);
|
||||
|
||||
@@ -20,6 +20,10 @@ function guessMessageType(summary) {
|
||||
return 'chat';
|
||||
}
|
||||
|
||||
function exists(widget) {
|
||||
return widget !== null;
|
||||
}
|
||||
|
||||
const NotificationIcon = (notifObject) => {
|
||||
// { appEntry, appIcon, image }, urgency = 'normal'
|
||||
if (notifObject.image) {
|
||||
@@ -71,9 +75,9 @@ const NotificationIcon = (notifObject) => {
|
||||
export default ({
|
||||
notifObject,
|
||||
isPopup = false,
|
||||
popupTimeout = 3000,
|
||||
props = {},
|
||||
} = {}) => {
|
||||
const popupTimeout = notifObject.timeout || (notifObject.urgency == 'critical' ? 8000 : 3000);
|
||||
const command = (isPopup ?
|
||||
() => notifObject.dismiss() :
|
||||
() => notifObject.close()
|
||||
@@ -82,11 +86,14 @@ export default ({
|
||||
widget.sensitive = false;
|
||||
notificationBox.setCss(middleClickClose);
|
||||
Utils.timeout(200, () => {
|
||||
wholeThing.revealChild = false;
|
||||
if (wholeThing) wholeThing.revealChild = false;
|
||||
}, wholeThing);
|
||||
Utils.timeout(400, () => {
|
||||
command();
|
||||
wholeThing.destroy();
|
||||
if (wholeThing) {
|
||||
wholeThing.destroy();
|
||||
wholeThing = null;
|
||||
}
|
||||
}, wholeThing);
|
||||
}
|
||||
const widget = EventBox({
|
||||
@@ -111,7 +118,7 @@ export default ({
|
||||
wholeThing.attribute.held = true;
|
||||
notificationContent.toggleClassName(`${isPopup ? 'popup-' : ''}notif-clicked-${notifObject.urgency}`, true);
|
||||
Utils.timeout(800, () => {
|
||||
if (wholeThing.attribute.held) {
|
||||
if (wholeThing?.attribute.held) {
|
||||
Utils.execAsync(['wl-copy', `${notifObject.body}`])
|
||||
notifTextSummary.label = notifObject.summary + " (copied)";
|
||||
Utils.timeout(3000, () => notifTextSummary.label = notifObject.summary)
|
||||
@@ -123,10 +130,10 @@ export default ({
|
||||
})
|
||||
}
|
||||
});
|
||||
const wholeThing = Revealer({
|
||||
let wholeThing = Revealer({
|
||||
attribute: {
|
||||
'close': undefined,
|
||||
'destroyWithAnims': () => destroyWithAnims,
|
||||
'destroyWithAnims': destroyWithAnims,
|
||||
'dragging': false,
|
||||
'held': false,
|
||||
'hovered': false,
|
||||
@@ -137,7 +144,7 @@ export default ({
|
||||
transitionDuration: 200,
|
||||
child: Box({ // Box to make sure css-based spacing works
|
||||
homogeneous: true,
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
const display = Gdk.Display.get_default();
|
||||
@@ -400,11 +407,14 @@ export default ({
|
||||
widget.sensitive = false;
|
||||
}
|
||||
Utils.timeout(200, () => {
|
||||
wholeThing.revealChild = false
|
||||
if (wholeThing) wholeThing.revealChild = false;
|
||||
}, wholeThing);
|
||||
Utils.timeout(400, () => {
|
||||
command();
|
||||
wholeThing.destroy();
|
||||
if (wholeThing) {
|
||||
wholeThing.destroy();
|
||||
wholeThing = null;
|
||||
}
|
||||
}, wholeThing);
|
||||
}
|
||||
else {
|
||||
@@ -425,6 +435,17 @@ export default ({
|
||||
})
|
||||
widget.add(notificationBox);
|
||||
wholeThing.child.children = [widget];
|
||||
|
||||
if (isPopup) Utils.timeout(popupTimeout, () => {
|
||||
if (wholeThing) {
|
||||
wholeThing.revealChild = false;
|
||||
Utils.timeout(200, () => {
|
||||
if (wholeThing) {
|
||||
wholeThing.destroy();
|
||||
wholeThing = null;
|
||||
}
|
||||
command();
|
||||
}, wholeThing);
|
||||
}
|
||||
})
|
||||
return wholeThing;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -144,7 +144,6 @@ export default () => {
|
||||
})
|
||||
const systemResources = BarGroup({
|
||||
child: Box({
|
||||
className: 'spacing-h-10',
|
||||
children: [
|
||||
BarResource('RAM Usage', 'memory', `free | awk '/^Mem/ {printf("%.2f\\n", ($3/$2) * 100)}'`),
|
||||
Revealer({
|
||||
@@ -152,7 +151,7 @@ export default () => {
|
||||
transition: 'slide_left',
|
||||
transitionDuration: 200,
|
||||
child: Box({
|
||||
className: 'spacing-h-10',
|
||||
className: 'spacing-h-10 margin-left-10',
|
||||
children: [
|
||||
BarResource('Swap Usage', 'swap_horiz', `free | awk '/^Swap/ {if ($2 > 0) printf("%.2f\\n", ($3/$2) * 100); else print "0";}'`),
|
||||
BarResource('CPU Usage', 'settings_motion_mode', `top -bn1 | grep Cpu | awk '{print $2}'`),
|
||||
@@ -180,4 +179,4 @@ export default () => {
|
||||
]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -208,7 +208,6 @@ const switchToRelativeWorkspace = async (self, num) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default () => Widget.EventBox({
|
||||
onScrollUp: (self) => switchToRelativeWorkspace(self, -1),
|
||||
onScrollDown: (self) => switchToRelativeWorkspace(self, +1),
|
||||
|
||||
@@ -365,6 +365,7 @@ export default () => MarginRevealer({
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
child.destroy();
|
||||
child = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,14 @@ export default () => Box({
|
||||
attribute: {
|
||||
'map': new Map(),
|
||||
'dismiss': (box, id, force = false) => {
|
||||
if (!id || !box.attribute.map.has(id) || box.attribute.map.get(id).attribute.hovered && !force)
|
||||
if (!id || !box.attribute.map.has(id))
|
||||
return;
|
||||
const notifWidget = box.attribute.map.get(id);
|
||||
if (notifWidget == null || notifWidget.attribute.hovered && !force)
|
||||
return; // cuz already destroyed
|
||||
|
||||
const notif = box.attribute.map.get(id);
|
||||
notif.revealChild = false;
|
||||
notif.attribute.destroyWithAnims();
|
||||
notifWidget.revealChild = false;
|
||||
notifWidget.attribute.destroyWithAnims();
|
||||
box.attribute.map.delete(id);
|
||||
},
|
||||
'notify': (box, id) => {
|
||||
@@ -32,8 +34,6 @@ export default () => Box({
|
||||
box.attribute.map.set(id, newNotif);
|
||||
box.pack_end(box.attribute.map.get(id), false, false, 0);
|
||||
box.show_all();
|
||||
|
||||
// box.children = Array.from(box.attribute.map.values()).reverse();
|
||||
},
|
||||
},
|
||||
setup: (self) => self
|
||||
|
||||
@@ -273,10 +273,12 @@ const OverviewRow = ({ startWorkspace, workspaces, windowName = 'overview' }) =>
|
||||
kids.forEach(kid => kid.clear());
|
||||
for (let i = 0; i < allClients.length; i++) {
|
||||
const client = allClients[i];
|
||||
if (offset + startWorkspace <= client.workspace.id && client.workspace.id <= offset + startWorkspace + workspaces) {
|
||||
if (offset + startWorkspace <= client.workspace.id &&
|
||||
client.workspace.id <= offset + startWorkspace + workspaces) {
|
||||
const screenCoords = box.attribute.monitorMap[client.monitor];
|
||||
kids[client.workspace.id - (offset + startWorkspace)]
|
||||
.set(client, screenCoords);
|
||||
?.set(client, screenCoords);
|
||||
|
||||
}
|
||||
}
|
||||
kids.forEach(kid => kid.show());
|
||||
|
||||
@@ -13,13 +13,7 @@ import Gemini from '../../services/gemini.js';
|
||||
import { geminiView, geminiCommands, sendMessage as geminiSendMessage, geminiTabIcon } from './apis/gemini.js';
|
||||
import { chatGPTView, chatGPTCommands, sendMessage as chatGPTSendMessage, chatGPTTabIcon } from './apis/chatgpt.js';
|
||||
import { waifuView, waifuCommands, sendMessage as waifuSendMessage, waifuTabIcon } from './apis/waifu.js';
|
||||
class AgsTextView extends AgsWidget(Gtk.TextView, "AgsTextView") {
|
||||
static { AgsWidget.register(this, {}); }
|
||||
constructor(params) {
|
||||
super(params);
|
||||
}
|
||||
}
|
||||
const TextView = Widget.createCtor(AgsTextView);
|
||||
const TextView = Widget.subclass(Gtk.TextView, "AgsTextView");
|
||||
|
||||
|
||||
const EXPAND_INPUT_THRESHOLD = 30;
|
||||
|
||||
@@ -85,7 +85,8 @@ export default (props) => {
|
||||
self.toggleClassName('notif-listaction-btn-enabled', Notifications.dnd);
|
||||
});
|
||||
const clearButton = ListActionButton('clear_all', 'Clear', () => {
|
||||
notificationList.get_children().forEach(ch => ch.destroy());
|
||||
// Manual destruction is not necessary
|
||||
// since Notifications.clear() sends destroy signals to every notif
|
||||
Notifications.clear();
|
||||
});
|
||||
const listTitle = Box({
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
########## Input method ##########
|
||||
env = GTK_IM_MODULE, fcitx
|
||||
## See https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
|
||||
env = QT_IM_MODULE, fcitx
|
||||
env = XMODIFIERS, @im=fcitx
|
||||
# env = GTK_IM_MODULE, wayland # Crashes electron apps in xwayland
|
||||
# env = GTK_IM_MODULE, fcitx # My Gtk apps no longer require this to work with fcitx5 hmm
|
||||
env = SDL_IM_MODULE, fcitx
|
||||
env = GLFW_IM_MODULE, ibus
|
||||
env = INPUT_METHOD, fcitx
|
||||
|
||||
############# Themes #############
|
||||
env = QT_QPA_PLATFORM, wayland
|
||||
|
||||
@@ -81,7 +81,7 @@ show_always = true
|
||||
home_symbol = " "
|
||||
read_only = " "
|
||||
style = "bg:blue fg:black"
|
||||
truncation_length = 30
|
||||
truncation_length = 6
|
||||
truncation_symbol = "••/"
|
||||
format = '[](bold fg:blue)[$path ]($style)[](bold fg:blue)'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user