Compare commits

...

10 Commits

Author SHA1 Message Date
hollorol
fa58550954 change gitignore 2024-07-31 23:24:48 +02:00
Roland Hollós
7d08356273 fill background with black 2024-01-15 08:25:10 +01:00
Roland Hollós
97a473c427 multiple monitors are not yet supported 2021-10-02 09:49:38 +02:00
Roland Hollós
585390485c removing unused function: drawReminder 2021-10-02 09:43:05 +02:00
Roland Hollós
84c5c89a70
fix typo 2021-10-02 09:40:22 +02:00
Roland Hollós
4af77093b8 Adding pedantic flag to compilation 2020-11-23 14:25:12 +01:00
Roland Hollós
ff4cdc0c25 Adding some extra comment to the config file 2020-11-23 14:23:46 +01:00
Roland Hollós
310dff2387 Merge branch 'master' of github.com:hollorol/fiboBG 2020-11-23 11:55:42 +01:00
Roland Hollós
b7cd218fe8 commented possibility for global install 2020-11-23 11:55:34 +01:00
Roland Hollós
3fd7145d69
Update README.md 2020-11-23 11:38:07 +01:00
5 changed files with 26 additions and 39 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
fibboBG
fiboBG
*.o

View File

@ -1,11 +1,12 @@
TARGET=fiboBG
DEST=$(HOME)/.local/bin
DEST=$(HOME)/.local/bin/ #local install
#DES=/usr/local #global install
SRC=main.c
# DEBUG=-g
DEBUG=
$(TARGET): main.c config.h
gcc -Wall -Wextra $(DEBUG) $(SRC) `pkg-config --cflags --libs cairo x11` -o $(TARGET) -lm
gcc -Wall -Wextra -pedantic $(DEBUG) $(SRC) `pkg-config --cflags --libs cairo x11` -o $(TARGET) -lm
install:
cp $(TARGET) $(DEST)/
cp $(TARGET) $(DEST)
uninstall:
rm $(DEST)/$(TARGET)

View File

@ -1,6 +1,6 @@
# FiboBG
FiboBG is a very simple program which displays the [Fibonacci clock](https://www.theguardian.com/science/alexs-adventures-in-numberland/2015/may/09/fibonacci-clock-can-you-tell-the-time-on-the-worlds-most-stylish-nerd-timepiece). It creates a dynamic background for simple window manager like i3 or dwm. FiboBG was only tested on dwm. The program works well with compositors like compton.
FiboBG is a very simple program which displays the [Fibonacci clock](https://www.theguardian.com/science/alexs-adventures-in-numberland/2015/may/09/fibonacci-clock-can-you-tell-the-time-on-the-worlds-most-stylish-nerd-timepiece). It creates a dynamic background for simple window manager like i3 or dwm. FiboBG was only tested on dwm. The program works well with compositors like compton. **Multiple monitors are not yet supported.**
## Installation
@ -10,6 +10,7 @@ cd fiboBG
make
make install
```
The installation assumes you want to install fiboBG locally to $HOME/.local . If you want to install it globally ( genarally not a good idea ), you can do this by modifying the Makefile.
## Usage
In xinitrc, run the compiled program in background before window manager! If you have a compositor (only compton tested) you can make a dynamical background more usable with setting your terminal alpha parameter.

View File

@ -1,12 +1,21 @@
#define REFRESH_TIME 30
#define STARTPOS_Y 12
#define STARTPOS_X 0
#define LEFT_OFFSET 0
#define REFRESH_TIME 30 // Refresh rate in seconds
#define STARTPOS_Y 12 // y coordinate of the top-left
// corner of the background window
#define STARTPOS_X 0 // x coordinate of the top-left
// corner of the background window
#define BOX_HEIGHT_RATE 0.9 // The box height and screen height ratio
#define GAP_SIZE 3 // The gap size between the boxes
/* The clock well be centered inside of the defined box.
The block bellow is for some slite modification.
*/
#define LEFT_OFFSET 0
#define TOP_OFFSET 12
#define RIGHT_OFFSET 0
#define BOTTOM_OFFSET 0
#define BOX_HEIGHT_RATE 0.9
#define GAP_SIZE 3
// +--------+---+-------------------
// + + + +
@ -27,7 +36,7 @@ typedef struct _color {
float blue;
} color;
// TIME COLORS
color colors[4]={
//base
{

30
main.c
View File

@ -93,36 +93,13 @@ void drawRectangle(cairo_t* cr, rectangle R){
cairo_fill(cr); /* fill rectangle */
}
void drawReminder(cairo_t* cr, int minRem){
float x_pos[4]={10, 810, 810, 10};
float y_pos[4]={10, 10, 510, 510};
int previous;
if(minRem == 0){
previous = 4;
} else {
previous = minRem - 1;
}
for(int i = 0; i < 4; ++i){
cairo_arc(cr, x_pos[i], y_pos[i],10, 0, 2 * M_PI);
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); /* set fill color */
cairo_fill(cr);
}
cairo_arc(cr, x_pos[previous], y_pos[previous], 10, 0, 2 * M_PI);
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5); /* set fill color */
cairo_fill(cr);
if(minRem != 0){
cairo_arc(cr, x_pos[minRem - 1], y_pos[minRem - 1], 7, 0, 2 * M_PI);
cairo_set_source_rgb(cr, 0, 0, 0); /* set fill color */
cairo_fill(cr);
}
}
void drawFibbTime(cairo_t* cr, int width, int height){
cairo_set_source_rgb(cr, 0, 0, 0); // setting black background color
cairo_paint(cr); // Paint the surface with the source color
int bh = ((int) ((height - TOP_OFFSET) * BOX_HEIGHT_RATE) / 5) * 5;
int unit = bh / 5;
@ -174,7 +151,6 @@ void drawFibbTime(cairo_t* cr, int width, int height){
drawRectangle(cr, Rs[3]);
drawRectangle(cr, Rs[4]);
drawRectangle(cr, Rs[0]);
/* drawReminder(cr, (t.minute % 5)); */
}
int main(int argc, char** argv) {