This commit is contained in:
xsghetti 2024-04-11 00:21:35 -04:00
parent 1f8cb3c145
commit 610604e80f
253 changed files with 27055 additions and 44 deletions

View file

@ -0,0 +1,121 @@
export const keybindList = [[
{
"icon": "pin_drop",
"name": "Workspaces: navigation",
"binds": [
{ "keys": ["", "+", "#"], "action": "Go to workspace #" },
{ "keys": ["", "+", "S"], "action": "Toggle special workspace" },
{ "keys": ["", "+", "(Scroll ↑↓)"], "action": "Go to workspace -1/+1" },
{ "keys": ["Ctrl", "", "+", "←"], "action": "Go to workspace on the left" },
{ "keys": ["Ctrl", "", "+", "→"], "action": "Go to workspace on the right" },
{ "keys": ["", "+", "PageUp"], "action": "Go to workspace on the left" },
{ "keys": ["", "+", "PageDown"], "action": "Go to workspace on the right" }
],
"id": 1
},
{
"icon": "overview_key",
"name": "Workspaces: management",
"binds": [
{ "keys": ["", "Alt", "+", "#"], "action": "Move window to workspace #" },
{ "keys": ["", "Alt", "+", "S"], "action": "Move window to special workspace" },
{ "keys": ["", "Alt", "+", "PageUp"], "action": "Move window to workspace on the left" },
{ "keys": ["", "Alt", "+", "PageDown"], "action": "Move window to workspace on the right" }
],
"id": 2
},
{
"icon": "move_group",
"name": "Windows",
"binds": [
{ "keys": ["", "+", "←↑→↓"], "action": "Focus window in direction" },
{ "keys": ["", "Shift", "+", "←↑→↓"], "action": "Swap window in direction" },
{ "keys": ["", "+", ";"], "action": "Split ratio -" },
{ "keys": ["", "+", "'"], "action": "Split ratio +" },
{ "keys": ["", "+", "Lmb"], "action": "Move window" },
{ "keys": ["", "+", "Mmb"], "action": "Move window" },
{ "keys": ["", "+", "Rmb"], "action": "Resize window" },
{ "keys": ["", "+", "F"], "action": "Fullscreen" },
{ "keys": ["", "Alt", "+", "F"], "action": "Fake fullscreen" }
],
"id": 3
}
],
[
{
"icon": "widgets",
"name": "Widgets (AGS)",
"binds": [
{ "keys": ["", "OR", "", "+", "Tab"], "action": "Toggle overview/launcher" },
{ "keys": ["Ctrl", "", "+", "R"], "action": "Restart AGS" },
{ "keys": ["", "+", "/"], "action": "Toggle this cheatsheet" },
{ "keys": ["", "+", "N"], "action": "Toggle system sidebar" },
{ "keys": ["", "+", "B", "OR", "", "+", "O"], "action": "Toggle utilities sidebar" },
{ "keys": ["", "+", "K"], "action": "Toggle virtual keyboard" },
{ "keys": ["Ctrl", "Alt", "+", "Del"], "action": "Power/Session menu" },
{ "keys": ["Esc"], "action": "Exit a window" },
{ "keys": ["rightCtrl"], "action": "Dismiss/close sidebar" },
{ "keys": ["Ctrl", "", "+", "T"], "action": "Change wallpaper+colorscheme" },
// { "keys": ["", "+", "B"], "action": "Toggle left sidebar" },
// { "keys": ["", "+", "N"], "action": "Toggle right sidebar" },
// { "keys": ["", "+", "G"], "action": "Toggle volume mixer" },
// { "keys": ["", "+", "M"], "action": "Toggle useless audio visualizer" },
// { "keys": ["(right)Ctrl"], "action": "Dismiss notification & close menus" }
],
"id": 4
},
{
"icon": "construction",
"name": "Utilities",
"binds": [
{ "keys": ["PrtSc"], "action": "Screenshot >> clipboard" },
{ "keys": ["", "Shift", "+", "S"], "action": "Screen snip >> clipboard" },
{ "keys": ["", "Shift", "+", "T"], "action": "Image to text >> clipboard" },
{ "keys": ["", "Shift", "+", "C"], "action": "Color picker" },
{ "keys": ["", "Alt", "+", "R"], "action": "Record region" },
{ "keys": ["Ctrl", "Alt", "+", "R"], "action": "Record region with sound" },
{ "keys": ["", "Shift", "Alt", "+", "R"], "action": "Record screen with sound" }
],
"id": 5
},
],
[
{
"icon": "apps",
"name": "Apps",
"binds": [
{ "keys": ["", "+", "T"], "action": "Launch terminal: foot" },
{ "keys": ["", "+", "W"], "action": "Launch browser: Firefox" },
{ "keys": ["", "+", "C"], "action": "Launch editor: vscode" },
{ "keys": ["", "+", "X"], "action": "Launch editor: GNOME Text Editor" },
{ "keys": ["", "+", "I"], "action": "Launch settings: GNOME Control center" }
],
"id": 6
},
{
"icon": "keyboard",
"name": "Typing",
"binds": [
{ "keys": ["", "+", "V"], "action": "Clipboard history >> clipboard" },
{ "keys": ["", "+", "."], "action": "Emoji picker >> clipboard" },
],
"id": 7
},
{
"icon": "terminal",
"name": "Launcher actions",
"binds": [
{ "keys": [">raw"], "action": "Toggle mouse acceleration" },
{ "keys": [">img"], "action": "Select wallpaper and generate colorscheme" },
{ "keys": [">light"], "action": "Switch to light theme" },
{ "keys": [">dark"], "action": "Switch to dark theme" },
{ "keys": [">badapple"], "action": "Apply black n' white colorscheme" },
{ "keys": [">color"], "action": "Pick acccent color" },
{ "keys": [">todo"], "action": "Type something after that to add a To-do item" },
],
"id": 8
}
]];

View file

@ -0,0 +1,60 @@
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import { keybindList } from "./data_keybinds.js";
export const Keybinds = () => Widget.Box({
vertical: false,
className: "spacing-h-15",
homogeneous: true,
children: keybindList.map((group, _) => Widget.Box({ // Columns
vertical: true,
className: "spacing-v-15",
children: group.map((category, _) => Widget.Box({ // Categories
vertical: true,
className: "spacing-v-15",
children: [
Widget.Box({ // Category header
vertical: false,
className: "spacing-h-10",
children: [
Widget.Label({
xalign: 0,
className: `icon-material txt-larger cheatsheet-color-${category.id}`,
label: category.icon,
}),
Widget.Label({
xalign: 0,
className: "cheatsheet-category-title txt",
label: category.name,
}),
]
}),
Widget.Box({
vertical: false,
className: "spacing-h-10",
children: [
Widget.Box({ // Keys
vertical: true,
homogeneous: true,
children: category.binds.map((keybinds, _) => Widget.Box({ // Binds
vertical: false,
children: keybinds.keys.map((key, _) => Widget.Label({ // Specific keys
className: `${['OR', '+'].includes(key) ? 'cheatsheet-key-notkey' : 'cheatsheet-key cheatsheet-color-' + category.id} txt-small`,
label: key,
}))
}))
}),
Widget.Box({ // Actions
vertical: true,
homogeneous: true,
children: category.binds.map((keybinds, _) => Widget.Label({ // Binds
xalign: 0,
label: keybinds.action,
className: "txt chearsheet-action txt-small",
}))
})
]
})
]
}))
})),
});

View file

@ -0,0 +1,91 @@
const { Gdk, Gtk } = imports.gi;
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import Service from 'resource:///com/github/Aylur/ags/service.js';
import { Keybinds } from "./keybinds.js";
import { setupCursorHover } from "../.widgetutils/cursorhover.js";
import PopupWindow from '../.widgethacks/popupwindow.js';
const cheatsheetHeader = () => Widget.CenterBox({
vertical: false,
startWidget: Widget.Box({}),
centerWidget: Widget.Box({
vertical: true,
className: "spacing-h-15",
children: [
Widget.Box({
hpack: 'center',
className: 'spacing-h-5 cheatsheet-title',
children: [
Widget.Label({
hpack: 'center',
css: 'margin-right: 0.682rem;',
className: 'txt-title',
label: 'Cheat sheet',
}),
Widget.Label({
vpack: 'center',
className: "cheatsheet-key txt-small",
label: "",
}),
Widget.Label({
vpack: 'center',
className: "cheatsheet-key-notkey txt-small",
label: "+",
}),
Widget.Label({
vpack: 'center',
className: "cheatsheet-key txt-small",
label: "/",
})
]
}),
Widget.Label({
useMarkup: true,
selectable: true,
justify: Gtk.Justification.CENTER,
className: 'txt-small txt',
label: 'Sheet data stored in <tt>~/.config/ags/modules/cheatsheet/data_keybinds.js</tt>\nChange keybinds in <tt>~/.config/hypr/hyprland/keybinds.conf</tt>'
}),
]
}),
endWidget: Widget.Button({
vpack: 'start',
hpack: 'end',
className: "cheatsheet-closebtn icon-material txt txt-hugeass",
onClicked: () => {
App.toggleWindow('cheatsheet');
},
child: Widget.Label({
className: 'icon-material txt txt-hugeass',
label: 'close'
}),
setup: setupCursorHover,
}),
});
const clickOutsideToClose = Widget.EventBox({
onPrimaryClick: () => App.closeWindow('cheatsheet'),
onSecondaryClick: () => App.closeWindow('cheatsheet'),
onMiddleClick: () => App.closeWindow('cheatsheet'),
});
export default () => PopupWindow({
name: 'cheatsheet',
exclusivity: 'ignore',
keymode: 'exclusive',
visible: false,
child: Widget.Box({
vertical: true,
children: [
clickOutsideToClose,
Widget.Box({
vertical: true,
className: "cheatsheet-bg spacing-v-15",
children: [
cheatsheetHeader(),
Keybinds(),
]
}),
],
})
});