Code Monkey home page Code Monkey logo

fvwm-menu.rs's Introduction

fvwm menu maker


Steps, Path, Roadmap

  • Check local applications directory. $HOME/.local/share/applicatons
    • Require desktop files to be copied here.
  • Get all the files that have a .desktop extension
  • Read each file
  • Parse each file for specific properties
  • Create a menu item based on the applications category
  • Write to menu file

Notes

Application Directory

  • get location of applications directory
    • NetBSD - /usr/pkg/share/applications
    • Almost everyone else - /usr/local/share/applications/
    • Verify with XDG specification
  • Verify path exists
    • Check all locations based on XDG env variables and XDG spec
    • Check local paths
  • List application directory
    • get all files with .desktop extension

Read desktop files

  • Cycle through file list and read each file
  • Parse out all required (needed) data
    • Type
    • Category
    • Name
    • Exec
    • Terminal (bool)

Create Menu

  • generate structs
  • organize by category
  • Print meun based on fvwm spec

Percolate

  • Read and parse each file concurrently or in parallel
  • Insert menu into .fvwmrc file

XDG ENV settings

Taken from openSUSE Gnome

XDG_CONFIG_DIRS=/etc/xdg:/usr/local/etc/xdg:/usr/etc/xdg
XDG_CONFIG_DIRS=/usr/pkg/etc/xdg/
XDG_MENU_PREFIX=gnome-
XDG_SESSION_DESKTOP=default
XDG_SESSION_TYPE=wayland
XDG_CURRENT_DESKTOP=GNOME
XDG_SESSION_CLASS=user
XDG_RUNTIME_DIR=/run/user/1000
XDG_RUNTIME_DIR=/tmp/runtime-${LOGNAME}
XDG_DATA_DIRS=/home/rgeorgia/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
XDG_DATA_DIRS=/home/rgeorgia/.local/share/applications/

Taken from ArcoLinux - fvwm3 desktop

XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=
XDG_SESSION_TYPE=x11
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_VTNR=2
XDG_SESSION_ID=2
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/home/rgeorgia/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop

fvwm-menu.rs's People

Contributors

rgeorgia 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.