Git Product home page Git Product logo

Comments (9)

marcosnils avatar marcosnils commented on August 25, 2024 1

Awesome, great. I can start with a draft PR and we can continue iterating there.

from satty.

gabm avatar gabm commented on August 25, 2024

great idea! have you seen #30? We should add default colour and default size there!

would this already solve your use case?

Currently there is no such notion as "state". Satty is basically stateless as all config is passed to it at startup. The configuration file in #30 would be a way to not only describe the initial state but - when writable - also to persist state. Imho that might be the best approach.

We should avoid unpredictable options, i.e. specifying A but getting B...

from satty.

marcosnils avatar marcosnils commented on August 25, 2024

would this already solve your use case?

not entirely since what I'd really like is for the editor to remember the last setting used. This is something that other tools like flameshot do.

Having a config file to set the color and size would partially help, but it won't be a nice UX since it'd be very painful having to go to that file each time I want to change them.

from satty.

gabm avatar gabm commented on August 25, 2024

I think the way forward will be to implement the configuration file as a way of persisting state and then use one of the toml editor crates to edit that file when the remember last state option is set

from satty.

marcosnils avatar marcosnils commented on August 25, 2024

I think the way forward will be to implement the configuration file as a way of persisting state and then use one of the toml editor crates to edit that file when the remember last state option is set

yes sure, this makes sense. How do you prefer to move forward about this? Can I help #30 to move forward somehow?

from satty.

gabm avatar gabm commented on August 25, 2024

I thought about this again and had some specific doubts about us touching the users config file and also systems where the configuration file is immutable. So I asked the NixOS community over at Reddit [0] and the answers are very useful .. let me summarise

  • we should never touch the users config file - that's sacred userland
  • we should follow the xdg standards, there is a place for application state
  • it would be easier for NixOS if the user config would be immutable to the program, but if it's not that wouldn't be deal breaker either

For us that boils down to:

  • config and state are two different things - contrary to what i said above

  • we can implement state without worrying about the config file and even before implementing #30

  • the state for should reside in it's appropriate folder and can be anything - probably json

  • [0] https://www.reddit.com/r/NixOS/s/sak64v9wmD

from satty.

gabm avatar gabm commented on August 25, 2024

I would prefer the following behaviour/spec

  • we introduce a flag that enables satty to remember it's last state. if the flag is not specified, it shall behave as it does until now
  • If the flag is specified we do:
    • try to open a json file from the xdg specified folder
    • load the state from there
    • use the last selected tool from there
    • update the file on every change of state
    • the state includes: selected tool, selected colour, custom colour and selected size

from satty.

gabm avatar gabm commented on August 25, 2024

Awesome, great. I can start with a draft PR and we can continue iterating there.

great, looking forward!

from satty.

gabm avatar gabm commented on August 25, 2024

I implemented config file handling in #38. It pushes the config into a global variable called APP_STATE that is a relm4 SHARED_STATE. I do think that this might also be a good approach for tracking the app state (selected tools, colors, sizes etc)

from satty.

Related Issues (20)

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.