Giter Site home page Giter Site logo

b3nj5m1n / lemonblocks Goto Github PK

View Code? Open in Web Editor NEW
47.0 3.0 4.0 118 KB

A status bar generator for lemonbar, inspired by i3blocks and dwmblocks.

License: MIT License

Makefile 4.10% C 62.61% Shell 31.86% C++ 0.82% Objective-C 0.61%
bar bspwm i3blocks lemonbar

lemonblocks's Introduction

Contributors Forks Stargazers Issues MIT License


lemonblocks

A status bar generator for lemonbar, inspired by i3blocks and dwmblocks.

Report Bug Β· Request Feature

Table of Contents

About The Project

Product Name Screen Shot

A status bar generator for lemonbar, inspired by i3blocks and dwmblocks, written in plain C.

demo

demo

Lemonbar reads from stdin for the status, it supports clickable areas, the commands will be written to stout.

Lemonblocks tries to make feeding the bar easier. You can define your own modules which you can asign signals. Every time you want to update one of your modules, you can send a signal to the instance of lemonblocks to run the associated command. This means that you don't have to run a script at certain intervals, instead you update it only when necessary.

Getting Started

Prerequisites

Installation

  1. Clone the repo
git clone https://github.com/b3nj5m1n/lemonblocks.git
  1. Bulid & Install lemonblocks
sudo make install
  1. Copy default config
make config
  1. Copy scripts
sudo make scripts

Usage

Starting lemonbar & lemonblocks

The script called start.sh will start lemonbar with sensible default settings as well as lemonblocks.

The script is moved to /usr/bin when installing, you can call it like this:

start-lemonbar.sh &

Updating a module

# 3 is the signal for your module
pkill lemonblocks -3

Config

You can configure your modules in the file config.txt located at ~/.config/lemonblocks. (Run make config to create the directory and copy the default config)

# Seperate values with a , (No space afterwards)
# Interval  Signal Icon  Command Alignment   Initial Status  BgColor FgColor LeftClick   MiddleClick RightClick  ScrollUp    ScrollDown Prefix Suffix
# Interval of 0 means it will only be updated by signals. NULL means nothing or default value for icons, colors and mouse events
# Example config:
0,3,🍍,/usr/bin/lbscripts/powermenu.sh,l, ,NULL,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]
1,4,NULL,/usr/bin/lbscripts/bspwm.sh,l, ,NULL,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]
1,5,NULL,/usr/bin/lbscripts/cmus.sh,l, ,NULL,f8f8ff,cmus-remote -u; pkill lemonblocks -5,NULL,NULL,cmus-remote -v +1%,cmus-remote -v -1%,[,]
0,6,πŸ”ˆ,/usr/bin/lbscripts/volume.sh,r, ,aa1d1f21,f8f8ff,amixer set Master toggle; pkill lemonblocks -6,NULL,NULL,amixer -q sset Master 1%+; pkill lemonblocks -6,amixer -q sset Master 1%-; pkill lemonblocks -6,[,]
0,7,πŸ“,/usr/bin/lbscripts/free-space.sh,r, ,aa1d1f21,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]
0,8,πŸ’,/usr/bin/lbscripts/layout.sh,r, ,aa1d1f21,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]
300,10,NULL,/usr/bin/lbscripts/network.sh,r, ,aa1d1f21,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]
30,11,⏰,/usr/bin/lbscripts/date.sh,r, ,aa1d1f21,f8f8ff,NULL,NULL,NULL,NULL,NULL,[,]

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

lemonblocks's People

Contributors

b3nj5m1n avatar basemale avatar codacy-badger 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

Watchers

 avatar  avatar  avatar

lemonblocks's Issues

X Error of railed request: BadLength

The start-lemonbar.sh script is returning an X error, specifically "BadLength," when trying to output a Twemoji icon to lemonbar. Any guidance on how to debug this?

/usr/bin/start-lemonbar.sh: line 4: xdpyinfo: command not found
lemonbar: no process found
lemonblocks: no process found
mkfifo: cannot create fifo '/tmp/lemonblockspipe': File exists

PREFIX: %{F#f8f8ff}%{B#aa1d1f21}[
SUFFIX: %{F#f8f8ff}%{B#aa1d1f21}]%{F-}%{B-}
Intervals are required, creating child process.
Received signal 11 for block ⏰
X Error of failed request: BadLength (poly request too large or internal Xlib length error)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 20 (RenderAddGlyphs)
Serial number of failed request: 797
Current serial number in output stream: 881

Segmentation Fault

wm: dwm
term: st

~ Ξ£ lemonblocks
[1]    234088 segmentation fault (core dumped)  lemonblocks
~ Ξ£
~ Ξ£ start-lemonbar.sh
lemonblocks: no process found
mkfifo: fifo '/tmp/lemonblockspipe' γ‚’δ½œζˆγ§γγΎγ›γ‚“: γƒ•γ‚‘γ‚€γƒ«γŒε­˜εœ¨γ—γΎγ™
/usr/bin/start-lemonbar.sh: 40 葌: 234624 Segmentation fault      (コをダンプ) lemonblocks
~ Ξ£

I put the fonts that I use normally and commented out xdo.

Memory Leak

There is a small memory leak that accumulates over time. I'm fairly certain the code in updateStatus that writes to blockToUpdate->status is part of the problem. I don't see the old value being free'd anywhere. Perhaps instead of dynamically allocating memory, moving to statically allocated arrays would be a safer and more optimal pattern to adopt?

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.