Code Monkey home page Code Monkey logo

dama-rs's Introduction

Dama

Desktop Agnostic Menu Aggregate

This program aims to be a hackable, easy to use menu that can be paired to lightweight window managers in order to change settings on the fly.

This is a learning experience for me, most of what i'm doing is probably not a best practice.

Looks

here's a screenshot with the adapta gtk theme

feature roadmap

version 1.0 has been reached, possibly breaking changes will not occur on the main branch

changes might still be made to layout styling / anything that doesn't involve user configuration files

  • correctly render hardcoded components
  • parse components from a json file at startup
    • look in multiple locations before giving up
  • interact with provided scripts
    • execute commands (e.g. change brightness with a slider)
    • get values back from commands (e.g. set the correct value for the brightness slider at startup)
  • add support for image widgets
    • dynamically resize the image
  • add support for checkbox widgets
  • style the layout in a sensible way
    • allow setting names for tabs
    • move the tab list to the side

Dependencies

Dama is built with rust, using the gtk crate and uses cargo to manage the build process.

Installation

just run the command:

make install

writing your own menu entries

menu entries are read from json files listed in a file called config. The program will look for it in $XDG_CONFIG_HOME/dama/ if the variable is set, or in $HOME/.config/dama if it is not.

if that file doesn't exist, dama will try to read from $HOME/.dama/config.

each line of your config should be the full path to a json file describing a menu entry.

Available entries are of types:

{"Notebook" : [
      // list of children
]},

{"Box": [ "name", 
	  // this is used to set the tab's name if the box 
	  // is a direct child of a notebook.
	  // Otherwise, it is ignored and can be left empty.
	  "Vertical", 
          // or  Horizontal
      [
	  // list of children
      ]
]},

{"Label": "some text"},

{"Image": "/absolute/path/to/image"} 
            // the image will not be resized, you will have to resize 
            // the source file for the time being

{"Button": ["the button's label", 
            "notify-send \"click!\""]
            // the command to be executed on click 
}, 

{"Checkbox": ["the label",
			"echo true",
			// command providing initial state
            "notify-send $DAMA_VAL"]
            // the command to be executed on toggle
}, 

{"Scale": [0.0,   
           // the minimum value
           100.0,  
           // the maximum value
           "xbacklight -get",
           // the command to run in order to get the initial value.
           // this will be clamped between maximum and minimum values.
           "xbacklight -set $DAMA_VAL"] 
           // the command to be executed when the slider is moved.
           // the current value of the slider is available through                              
           // the environment variable $DAMA_VAL, rounded to an integer.
}                             

A toplevel Notebook is implicitly added as a container for your entries.

all commands are executed with sh -c.

In a horizontal Box, if the first element is a Label, it will expand to push the remaining elements to the right of the window. This should result in a tidier layout.

dama-rs's People

Contributors

ap29600 avatar ngirard avatar

Watchers

 avatar

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.