add: clipboard history widget

This commit is contained in:
2025-04-26 21:48:58 +02:00
parent 8deb06278f
commit 54b69f0aac
7 changed files with 191 additions and 7 deletions

View File

@ -9,8 +9,8 @@ export const hideWindow = (self: Gtk.Window, keyval: number) => {
const keys = ["quick_settings"].includes(self.name)
? [Gdk.KEY_Escape]
: [
Gdk.KEY_Escape,
Gdk.KEY_Super_L,
Gdk.KEY_Escape,
Gdk.KEY_Super_L,
Gdk.KEY_Super_R
];
@ -21,4 +21,12 @@ export const openOnButton = (event: Gdk.ButtonEvent, keyval: number) => (action:
if (event.get_button() !== keyval) return;
action();
}
}
export const limit = <T>(list: T[], max: number) => list.filter((_, i) => i <= (max - 1));
export const skip = <T>(list: T[], items: number) => list.filter((_, i) => {
if (items < 0) items = 0;
if (items > (list.length - 1)) items = list.length;
return i > (items - 1);
});