xiota / geany-preview

Turns Geany into a markdown editor by providing a preview pane in the sidebar to show the formatting of several light-weight languages as they are edited. Supported document types include AsciiDoc, DocBook, Fountain, HTML, LaTeX, Markdown, MediaWiki, reStructuredText, Textile, and Txt2Tags.
GNU General Public License v3.0
15 stars 0 forks source link

Does Geany Preview exist for Lubuntu 23.10? #49

Closed ralf3u closed 8 months ago

ralf3u commented 1 year ago

I ask this because I would like to test Lubuntu 23.10. Thank you for an answer.

xiota commented 8 months ago

GTK CSS isn't the same has webpage CSS. So not everything works the same. Probably text-decoration is implemented differently or not at all.

Maybe you need a rule for a different name to do what you want. Here's a search for different names in Geany.

ralf3u commented 8 months ago

Maybe you need a rule for a different name to do what you want. Here's a search for different names in Geany.

I couldn't find something.

And what about the border problem?

xiota commented 8 months ago

The editor tab css seems to be forced somehow, limiting what you can do with it in geany.css. If you want, you can ask geany devs, at one of the issues you mentioned earlier, why css rules aren't working on the editor tab and whether/how/where they're being overridden.

Maybe easier to put a border around the whole page:

#geany-xitweaks-notebook-page-focus {
    border-width: 5px;
    border-style: solid;
    border-color: black;
}

#geany-xitweaks-notebook-page-unfocus {
    border-width: 5px;
    border-style: solid;
    border-color: transparent;
}
ralf3u commented 8 months ago

The code of your last comment didn't help.

If you want, you can ask geany devs [...]

Is the internet address down below correct to open issues at GTK? https://gitlab.gnome.org/GNOME/gtk/-/issues

xiota commented 8 months ago

Try this:

#geany-xitweaks-notebook-tab-focus,
#geany-xitweaks-notebook-tab-focus label {
    font-weight: bold;

    border-bottom-width: 3px;
    border-style: solid;
    border-color: black;
}

#geany-xitweaks-notebook-tab-unfocus,
#geany-xitweaks-notebook-tab-unfocus label {
}
ralf3u commented 8 months ago

I tried your code from above and then the underline works in all panels!!!!

But the problem is then, that if one tab of the editor is in focus, and then if I click on one tab of the sidebar, then the content of the tab of the sidebar is moving downwards while the the content of the tab of the editor is moving upwards.

So I changed the code from your last comment, like this:

tab:checked {
    font-weight: bold;
}

#geany-xitweaks-notebook-tab-focus,
#geany-xitweaks-notebook-tab-focus label {
    border-bottom: 5px solid black;
}

#geany-xitweaks-notebook-tab-unfocus,
#geany-xitweaks-notebook-tab-unfocus label {
    border-bottom: 5px solid transparent;
}

And now the content of the tabs is not moving any more downwards/upwards. It's so cool!! Now it is exactly how I wanted.

Thank you so much for your work.

ralf3u commented 8 months ago

The next Ubuntu release 24.04 may be the last.

It could be that I will stay with Lubuntu. Will there be a possibility to install and use geany-plugin-lua, geany-plugin-xi-tweaks and Preview in Lubuntu 24.10?

xiota commented 8 months ago

I hope to migrate to a system for users to make packages from source. Something like makedeb.

ralf3u commented 8 months ago

I hope to migrate to a system for users to make packages from source. Something like makedeb.

I have not big knowledge about installations. Does that mean that geany-plugin-lua, geany-plugin-xi-tweaks and Preview should work in Lubuntu 24.10, but the installations will be different?

xiota commented 8 months ago

The plan is for users to build the package on their own computers. Then they would install the package with dpkg.

The plugins build reasonably quickly, so it shouldn't be too inconvenient.

If you're still testing different distros, consider trying Manjaro, Endeavour, ALCI.

ralf3u commented 8 months ago

The plugin geany-plugin-xi-tweaks does not need to be changed any more because everything works. Because the plugin geany-plugin-xi-tweaks is so good, what about to add it in the official list of plugins, so there is no need to install it by PPA or something else, like geany-plugin-lua?

In the past in the plugin geany-plugin-xi-tweaks there was a lot of things. Now it is only about tab-title of tabs. So, the name could be changed from geany-plugin-xi-tweaks to geany-plugin-tab-title.

xiota commented 8 months ago

Will think about renaming. Since the features are working now, may add to my other tweaks plugin.

Would need approval to be added to geany-plugins. Then would need approval for each future update. Based on experience trying to fix bugs in other plugins, would rather not bother trying to make an official plugin.

ralf3u commented 8 months ago

If you're still testing different distros, consider trying Manjaro, Endeavour, ALCI.

I'm only interested in Debian because of the possibility to install only free software.

I would like to write a step-by-step-description how to change the design of the tab-title of the tab that is in focus. I could do it in the discussions with the number 3784 at geany, but I prefer to open a new issue in discussions in Show and tell (3784 is located in the area Q&A). I would like to post it at geany, because I can imagine that users have more trust in information that is located at geany. Or do you have an other idea?

xiota commented 8 months ago

What software to install depends on what the user chooses. I suggested those distros because they're easier to make packages from source.

You should wait to write your howto until after the PPA and plugin reorganization. Also, it's a niche feature. Is there any indication any one else is interested?

ralf3u commented 8 months ago

Also, it's a niche feature. Is there any indication any one else is interested?

Well, I have no idea.

You should wait to write your howto until after the PPA and plugin reorganization.

OK.

ralf3u commented 8 months ago

Do you know if there is a possibility to change the font-size of the content area of the tab 'Documents' of the sidebar?

Reason: The document names and the folder names in the content area of the tab 'Documents' of the sidebar are too small.

There is already an open issue at geany with the issue number 424.

Thank you in advance for an answer.

xiota commented 8 months ago

The only place I know is Preferences / Interface / Interface / Fonts.

ralf3u commented 8 months ago

Because you are an expert of Geany Tweaks I wanted to ask you if it is possible to add a 1px black border to the tab-switcher? I opened yesterday at geany an issue with number 3797. The last paragraph of the last comment could show a way to the solution. But I don't know how to handle it. Do you have an idea? Thank you in advance for a help.

xiota commented 8 months ago

As described in the referenced comment, used the GTK Inspector, by setting gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true and pressing Control-Shift-D in Geany.

Found name GeanyDialog. Try adding to geany.css:

#GeanyDialog {
    border-width: 2px;
    border-style: solid;
    border-color: black;
}
ralf3u commented 8 months ago

I added the code from the last comment in geany.css. First in geany.css that is located in .config/geany/, and then in geany.css that is located in /usr/share/geany/. After a restart of Geany the tab-switcher has still no border.

xiota commented 8 months ago

Please provide screenshot of what you are referring to as "tab-switcher".

ralf3u commented 8 months ago

Please provide screenshot of what you are referring to as "tab-switcher".

At geany with the issue number 3800 there is this link: https://imgur.com/mWzOafF You can see the tab-switcher on the right side of the image. The tab-switcher appears when pressing Shift+F10.

xiota commented 8 months ago

I was looking at the wrong popup. I'm not sure the shift-F10 popup can be styled separately from other context menus without giving it a name in Geany.

ralf3u commented 8 months ago

I will test the switch-views in Lubuntu 24.04.

Thank you so much for Preview that works in Lubuntu 23.10.

ralf3u commented 8 months ago

I have two important questions outside Preview:

In Lubuntu 23.04 I used Vosk in combination with nerd-dictation. But in Lubuntu 23.10 it is not recommanded to install Vosk like this: pip3 install vosk

It is recommanded to use those three commands during the installation:

sudo apt install pipx
pipx ensurepath
pipx install vosk

Then vosk is running, but not nerd-dictation. I opened at github at nerd-dictation the issue with the number 119. But I get no answer.

In Lubuntu 23.04 I dictated right away in the editor. In Lubuntu 23.10 I have first to record the speech with Audacity, and then to transcribe the speech to text with Vosk.

Thank you in advance for an answer.

xiota commented 8 months ago

I haven't used dictation software. It's an area I think Linux is lacking. I'll look into the programs you mentioned.

I don't know difference between pip and pipx. Why not use pip with venv?

ralf3u commented 7 months ago

It's an area I think Linux is lacking.

There's no lack in this area. There's a lack of information that the speech-to-text-recognition software is so good. I used it in Lubuntu 23.04 and I was able to dictate text in Geany and LibreOffice. That was really awesome. The recognition was really good. I used three shortcuts for starting the program, one for French, one for German and one for English. 16 GB RAM are necessary to run Vosk. But for me it worked also by using 8 GB RAM and 8 GB swap-file to have in sum 16 GB. Even with real 16 GB RAM it took many seconds so that Vosk is ready for dictation (up to 40 seconds I think so). Vosk does not understand punctuation and design, like "dot" or "comma" or "go to the next line". The dots and commas can be set later with an other program and I was astonished how good the result is. The punctuation was perfect.

Why not use pip with venv?

I have no idea what pip and pix and python and venv means. I just do the steps. I just recognized that someone else wrote right after me an issue at nerd-dictation at github that describes the same problem like my problem. It is the issue number 120.

ralf3u commented 7 months ago

This is what I did in the past:

installation of vosk

pip3 install vosk
sudo apt install python3-pip
pip3 install vosk

restart the computer

download model alphacephei.com/vosk/models

installation of nerd-dictation git clone https://github.com/ideasman42/nerd-dictation.git

download model for the punctuation alphacephei.com/vosk/models#punctuation-models

installation of further software for the punctuation

sudo apt install xdotool
pip3 install transformers
pip3 install torch
ralf3u commented 7 months ago

Usage of Vosk

  1. record speech for example in Audacity
  2. save the speech, for example 1.ogg, in the USER-File, so /home/USER/
  3. in the terminal vosk-transcriber -m FULL-PATH-OF-MODEL -i 1.ogg -o 1.txt example: vosk-transcriber -m /home/USER/model-en/ -i 1.ogg -o 1.txt

Result: The text of the speech is in 1.txt.

ralf3u commented 7 months ago

Usage of the punctuation

This is how I used that in the past:

  1. paste the text-document, like 1.txt, inside the folder of the punctuation model
  2. in the terminal: browse inside the punctuation model
  3. terminal: python3 example.py 1.txt > 2.txt

Result: In 2.txt there is the text with punctuation.

ralf3u commented 7 months ago

Usage of nerd-dictation

This is how I used it in the past: nerd-dictation should be automatically in the USER-file after the installation

in the terminal: cd nerd-dictation/ && python3 nerd-dictation begin --vosk-model-dir=PATH example: cd nerd-dictation/ && python3 nerd-dictation begin --vosk-model-dir=/home/USER/model-en/ change to Geany and speak to stop the speech-to-text recognition: change to the terminal and press Ctrl+c

ralf3u commented 7 months ago

Usage of shortcuts to start and stop nerd-dictation

Command to start for openbox: bash -c 'cd nerd-dictation && python3 nerd-dictation begin --vosk-model-dir=/home/USER/model-en' Command to stop for openbox: bash -c 'cd nerd-dictation && python3 nerd-dictation end'

In rc.xml:

    <keybind key="W-+">
      <action name="Execute">
        <command>paste command from above to start</command>
      </action>
    </keybind>
    <keybind key="W-#">
      <action name="Execute">
        <command>paste command from above to stop</command>
      </action>
    </keybind>
ralf3u commented 7 months ago

It seems to be that the maintainer of nerd-dictation stopped the development of nerd-dictation, but maybe I'm wrong. If you find a way to make it run, what about the idea to fork nerd-dictation and call it xiota-dictation?

ralf3u commented 7 months ago

Did you try already Vosk? If the answer is yes, do you like it? Did you find a way to make nerd-dictation run?

xiota commented 7 months ago

Haven't tried yet. Plan to eventually. I did see that github.com/ideasman42/nerd-dictation was updated a month ago. (It's not very active, but it's not abandoned.)