forked from Shinonome/dots-hyprland
add superpaste
This commit is contained in:
@@ -37,12 +37,24 @@ Item { // Wrapper
|
||||
}
|
||||
|
||||
property var searchActions: [
|
||||
{
|
||||
action: "accentcolor",
|
||||
execute: args => {
|
||||
Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--noswitch", "--color", ...(args != '' ? [`${args}`] : [])]);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "dark",
|
||||
execute: () => {
|
||||
Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--mode", "dark", "--noswitch"]);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "konachanwallpaper",
|
||||
execute: () => {
|
||||
Quickshell.execDetached([Quickshell.shellPath("scripts/colors/random_konachan_wall.sh")]);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "light",
|
||||
execute: () => {
|
||||
@@ -50,21 +62,21 @@ Item { // Wrapper
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "wall",
|
||||
execute: () => {
|
||||
Quickshell.execDetached([Directories.wallpaperSwitchScriptPath]);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "konachanwall",
|
||||
execute: () => {
|
||||
Quickshell.execDetached([Quickshell.shellPath("scripts/colors/random_konachan_wall.sh")]);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "accentcolor",
|
||||
action: "superpaste",
|
||||
execute: args => {
|
||||
Quickshell.execDetached([Directories.wallpaperSwitchScriptPath, "--noswitch", "--color", ...(args != '' ? [`${args}`] : [])]);
|
||||
if (!/^(\d+)/.test(args.trim())) { // Invalid if doesn't start with numbers
|
||||
Quickshell.execDetached([
|
||||
"notify-send",
|
||||
Translation.tr("Superpaste"),
|
||||
Translation.tr("Usage: <tt>%1superpaste NUM_OF_ENTRIES[i]</tt>\nSupply <tt>i</tt> when you want images\nExamples:\n<tt>%1superpaste 4i</tt> for the last 4 images\n<tt>%1superpaste 7</tt> for the last 7 entries").arg(Config.options.search.prefix.action),
|
||||
"-a", "Shell"
|
||||
]);
|
||||
return;
|
||||
}
|
||||
const syntaxMatch = /^(?:(\d+)(i)?)/.exec(args.trim());
|
||||
const count = syntaxMatch[1] ? parseInt(syntaxMatch[1]) : 1;
|
||||
const isImage = !!syntaxMatch[2];
|
||||
Cliphist.superpaste(count, isImage);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -73,6 +85,12 @@ Item { // Wrapper
|
||||
Todo.addTask(args);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: "wallpaper",
|
||||
execute: () => {
|
||||
GlobalStates.wallpaperSelectorOpen = true;
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
function focusFirstItem() {
|
||||
|
||||
Reference in New Issue
Block a user