Giter Club home page Giter Club logo

boop-gtk's People

Contributors

bertob avatar bilelmoussaoui avatar bors[bot] avatar dependabot[bot] avatar eonfge avatar github-actions[bot] avatar zanderbrown avatar zoeyfyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

boop-gtk's Issues

Change status bar messages to in-app notifications

So there's this blank, useless chunk of space at the bottom of the window, a thick status bar of some sort? What exactly is the point of it? It appears to not be an issue with my theme or CSS customizations because it appears in both screenshots here, but the original Boop doesn't show a status bar on its screenshot. Any reason to keep that thing around?

Specify the accepted date format in the script's description

Today I wanted to convert a date into a unix timestamp.
While BoopGTK has this option, it's not specified how the date should be given

If it is possible I would add a comment in the description indicating which format is supposed to be given as an input (probably now is YYYY-mm-dd HH:mm)

Thank you

Buffer doesn't gain focus after script execution

I have observed that after running "Minify CSS" script, the result is not focused automatically. I have to click in the text in order to do "Ctrl+A" which is waste of time and energy. Moving the mice and clicking consumes energy... In addition, the result, most of the times, will need to be copied and pasted. Tia

Application crash when formatting JSON, generating Base64 and similar

I'm having a serious issue with the latest version from Flathub. Whenever I try to generate a Base64, or I try to format JSON, I get a rather serious error.

[kevin@kevinfedora ~]$ flatpak run fyi.zoey.Boop-GTK 
[2021-04-14T08:03:54Z INFO  boop_gtk::scriptmap] loaded 65 internal scripts
[2021-04-14T08:03:54Z INFO  boop_gtk::scriptmap] loaded 0 scripts from /home/kevin/.var/app/fyi.zoey.Boop-GTK/config/boop-gtk/scripts
[2021-04-14T08:03:54Z INFO  boop_gtk::scriptmap] watching /home/kevin/.var/app/fyi.zoey.Boop-GTK/config/boop-gtk/scripts
Gtk-Message: 10:03:54.331: Failed to load module "canberra-gtk-module"
Gtk-Message: 10:03:54.331: Failed to load module "pk-gtk-module"
Gtk-Message: 10:03:54.331: Failed to load module "canberra-gtk-module"
Gtk-Message: 10:03:54.331: Failed to load module "pk-gtk-module"
[2021-04-14T08:03:54Z INFO  boop_gtk] language manager search directorys: /home/kevin/.var/app/fyi.zoey.Boop-GTK/data/gtksourceview-3.0/language-specs:/home/kevin/.gnome2/gtksourceview-1.0/language-specs:/app/share/gtksourceview-3.0/language-specs:/usr/share/gtksourceview-3.0/language-specs:/usr/share/runtime/share/gtksourceview-3.0/language-specs:/run/host/user-share/gtksourceview-3.0/language-specs:/run/host/share/gtksourceview-3.0/language-specs:/home/kevin/.var/app/fyi.zoey.Boop-GTK/config/boop-gtk/
[2021-04-14T08:04:01Z INFO  boop_gtk::ui::app] executing Base64 Encode
[2021-04-14T08:04:01Z INFO  boop_gtk::script] thread spawned for Base64 Encode
[2021-04-14T08:04:01Z INFO  boop_gtk::executor] V8 initialized in 570.174µs


#
# Fatal error in , line 0
# Check failed: params.array_buffer_allocator == nullptr || params.array_buffer_allocator == allocator.get().
#
#
#
#FailureMessage Object: 0x7f8386867da0
==== C stack trace ===============================

    boop-gtk(+0x810be3) [0x55ff33c23be3]
    boop-gtk(+0x293dfb) [0x55ff336a6dfb]
    boop-gtk(+0x80caf5) [0x55ff33c1faf5]
    boop-gtk(+0x2a9bbd) [0x55ff336bcbbd]
    boop-gtk(+0x2a9c02) [0x55ff336bcc02]
    boop-gtk(+0x2903a9) [0x55ff336a33a9]
    boop-gtk(+0x12341b) [0x55ff3353641b]
    boop-gtk(+0x10e442) [0x55ff33521442]
    boop-gtk(+0x11a97a) [0x55ff3352d97a]
    boop-gtk(+0xcc2d8a) [0x55ff340d5d8a]
    /usr/lib/x86_64-linux-gnu/libpthread.so.0(+0x84d2) [0x7f8396a9a4d2]
    /usr/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f8396870323]

Primary menu

Primary menu should include

  • Link to scripts/config directory
  • Version / about infomation
  • Link to where to get additional scripts

Request: Also load custom scripts from $XDG_CONFIG_DIRS/boop-gtk/scripts

Problem

I want to distribute some custom boop scripts with distribution package manager (e.g. pacman). I know that Boop-GTK loads custom scripts from $XDG_CONFIG_HOME/boop-gtk/scripts but that path is inside $HOME, so I can't install custom scripts there.

Proposal

Also load custom scripts from system paths independent of user, such as /etc/xdg/boop-gtk/scripts ($XDG_CONFIG_DIRS is a list of directory paths separated by : and /etc/xdg is the default value on Arch Linux).

Improve JS scripting

Right now we don't quite match the behavior of Boop. Notably, scripts don't maintain there global state.

Dropping Windows support

  • The majority of my time is spent fixing problems with the windows build
  • Since this project requires gvsbuild (building V8 on MSYS is... difficult) upgrading to gtk4 is blocked if/when gvsbuild provides it
  • The windows build takes 30+ minuets
  • The last release had 27 downloads
  • Woop is a native windows port of Boop, doesn't have a release but its probably the superior way to do a Windows version

Windows build

Currently the build fails on windows:

LINK : fatal error LNK1181: cannot open input file 'gtksourceview-3.0.lib'

This happens despite installing the gtksourceview package with:

pacman -S --noconfirm mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gtksourceview3 mingw-w64-x86_64-gtksourceviewmm3

My guess is that mingw-w64-x86_64-gtksourceview3 install the lib with a different name, but I can't debug this until I set up a windows machine.

Flatpak upgrade to 22.08

Info: org.freedesktop.Platform//20.08 is end-of-life, with reason:
org.freedesktop.Platform 20.08 is no longer receiving fixes and security updates. Please update to a supported runtime version.

Support for Jsonc (.json files with comments)

Jsonc is a simplified json format which allows comments and unquoted values delimited by whitespace. A jsonc formatted file can be transformed to a json file. Comments will be stripped out and quotes added.

https://komkom.github.io/

Right now, parsing json files with comments, causes it to fail. This is annoying since comments are an all-round good practice and they are often de facto required when working in teams.

RangeError. Internal Error. Icu error in custom script

Hi.

I want to have my words sorted. I write this script in node, and it runs fine.

let text =
  "emacs nnn jq ShellCheck tidy neofetch stow workrave pandoc flameshot copyq";

let sorted = text
  .split(" ")
  .sort((a, b) => a.localeCompare(b))
  .join(" ");
console.log(sorted);
⬢ ❯ node sort.js
copyq emacs flameshot jq neofetch nnn pandoc ShellCheck stow tidy workrave

But, when putting it in boop, I got the error below. RangeError. Internal Error. Icu error

/**
     {
         "api":1,
         "name":"Sort words",
         "description":"Sort words alphabetically",
         "author":"Azzam S.A (https://github.com/azzams)",
         "icon":"sort-characters",
         "tags":"sort,alphabet"
     }
 **/

function main(input) {
  input.text = input.text
    .replace(/\n$/, "")
    .split(" ")
    .sort((a, b) => a.localeCompare(b))
    .join(" ");
}

image

Related:

Better error messages parsing json

It would be nice to have better error message formatting JSON, sometimes I paste 30 lines of JSON and if everything isn't perfect it just says ERROR: Invalid JSON I think a great improvement would be to have some extra information like https://jsonlint.com/
image

PS: I really like this project, awesome work!

Cargo release failing

release-cargo step fails because the crate size is too large, but packaging locally produces a crate within the 10mb limit.

New icon?

I think this app could benefit from a better icon that follows the HIG more closely.

I took a quick stab at redrawing it in that style:

image

Running any command through the flathub binary fails

Steps to reproduce:

  1. Run flatpak run fyi.zoey.Boop-GTK
  2. Enter "dupa"
  3. Press ctrl+shift+p
  4. Select any of the options, e.g. the first one
  5. Observe the following error (with backtrace enabled):
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: "Add Slashes"
Location: src/ui/command_pallete.rs:278

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: g_closure_invoke<unknown>
      at <unknown source file>:<unknown line>
   2: g_signal_emit_valist<unknown>
      at <unknown source file>:<unknown line>
   3: g_signal_emit<unknown>
      at <unknown source file>:<unknown line>
   4: gtk_main_do_event<unknown>
      at <unknown source file>:<unknown line>
   5: g_main_context_dispatch<unknown>
      at <unknown source file>:<unknown line>
   6: g_main_context_iteration<unknown>
      at <unknown source file>:<unknown line>
   7: g_application_run<unknown>
      at <unknown source file>:<unknown line>
   8: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

I'm using a combination of xfce and i3.

"Sort lines" fails with error

I don't know how much the scripts are part of this project, but when I try to use "Sort lines" I get this error:

ERROR: EXCEPTION: RangeError: Internal error. Icu error. (14:26 - 14:27)

My journal logs say the following:

fyi.zoey.Boop-GTK.desktop[53859]: [2021-08-18T19:23:15Z INFO boop_gtk::ui::app] executing Sort lines
fyi.zoey.Boop-GTK.desktop[53859]: [2021-08-18T19:23:15Z INFO boop_gtk::script] request received, full_text: 10 bytes, selection: 10 bytes
fyi.zoey.Boop-GTK.desktop[53859]: [2021-08-18T19:23:15Z ERROR boop_gtk::ui::app] Exception: Execute(JSException { exception_str: "RangeError: Internal error. Icu error.", resource_name: Some("undefined"), source_line: Some(" .sort((a, b) => a.localeCompare(b))"), line_number: Some(14), columns: Some((26, 27)) })

I'm using the flatkpak on Fedora Silverblue 34

CPU usage at idle

When I launch Boop-GTK (v1.1.0) via flatpak run uk.co.mrbenshef.Boop-GTK or via the Gnome overview, it starts using ~40% of my CPU (Intel Core i5-7200U, Quad Core) while the application is not being used.

image

I'm not sure what's going on here, but I'm pretty sure this shouldn't be the case. Boop-GTK does not output any major errors in its log as far as I can see, just the following lines:

Gtk-Message: 11:44:39.158: Failed to load module "canberra-gtk-module"
Gtk-Message: 11:44:39.158: Failed to load module "canberra-gtk-module"

(boop-gtk:2): GLib-GObject-CRITICAL **: 11:44:49.354: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(boop-gtk:2): GLib-GObject-CRITICAL **: 11:44:50.890: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(boop-gtk:2): GLib-GObject-CRITICAL **: 11:44:51.076: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(boop-gtk:2): GLib-GObject-CRITICAL **: 11:44:51.089: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(boop-gtk:2): GLib-GObject-CRITICAL **: 11:44:51.169: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

`extern crate` isn't necessary after Rust 2018

Just wanted to let you know that the extern crate statements found in main.rs - for example - aren't really necessary when using Rust 2018. Removing them will clean up your code a bit.

Investigate state.error

JSONtoCSV.js is the only script that calls state.error(...) which is not documented and does not appear to be implemented in Boop. It doesn't fail the test, but it does raise a JS type error.

Finding how to run scripts

What about adding "Click here or Press Ctrl+Shift+P to get started". It will be better for new users to know from the beginning, until they find it out, that "Press..." is not only a remark but it is also a button! Tia

Descriptions aren't searched, only titles

Searching for "color" doesn't bring up the Hex to RGB tool, even though "color" is in the description.

Similarly, "escape", "lower", "length", "whitespace", are all keywords that only appear in descriptions, making search come up empty.

This might be more of an issue once more tools are added, but it's a QoL thing that would be super helpful. Great app by the way, I use it more every day. 😊

Overridable defaults

Further to #158 it should be possible to override a default script. Search order should be:

  1. User config
  2. System config
  3. Binary data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.