2024-02-20 16:00:47 +01:00
|
|
|
Reflect.defineProperty($, "clipboard", {
|
2024-08-01 16:45:19 +02:00
|
|
|
get(){
|
|
|
|
if($.env.XDG_SESSION_TYPE === "x11")
|
|
|
|
return s.$().run`xclip -o -selection clipboard`;
|
|
|
|
return s.$().run`wl-paste`;
|
|
|
|
}
|
2024-02-20 16:00:47 +01:00
|
|
|
})
|
2024-03-20 21:48:17 +01:00
|
|
|
|
|
|
|
// /** Custom uncaughtException function */
|
|
|
|
// export const uncaughtException= console.log;
|
|
|
|
// /** Place for custom code when script starts */
|
|
|
|
// export function onscript(){}
|
|
|
|
/** Place for custom code when REPL starts (`--interactive`) */
|
|
|
|
export function onrepl(){
|
|
|
|
Reflect.defineProperty(s, "jq", { get(){ return file=> s.cat(file).xargs(JSON.parse); } });
|
|
|
|
}
|
|
|
|
/** Place for custom code when eval starts (`--eval`/`--print`) */
|
2024-11-29 16:09:45 +01:00
|
|
|
// export function oneval(){}
|