-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from JJoeDev/dev
README, Custom file parser, Launch args, Examples, Workflow
- Loading branch information
Showing
12 changed files
with
351 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: C/C++ CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y cmake build-essential libxcb-dev libsol2-dev | ||
- name: Run cmake | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
- name: Build | ||
run: make -j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
* Comment. Comments can only be placed before the ':' as to not interfer with some settings | ||
|
||
* Colors. Colors use the hexadecimal format and are prefixed with 0x | ||
* Hexadecimal values go from 0 to F (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) | ||
* The colors are formatted as 0xRR GG BB where RR, GG, and BB reprecent red green and blue | ||
* MiBar has support for 5 colors, all assigned a value as below | ||
* Currently not all values are in use, but they will be in the future | ||
|
||
Background: 0x111111 | ||
Foreground: 0x999999 | ||
Color1: 0x777777 | ||
Color2: 0x555555 | ||
Color3: 0x333333 | ||
|
||
* TargetMonitor is the monitor MiBar should locate and move to | ||
|
||
TargetMonitor: HDMI-0 | ||
|
||
* Currently MiBar only supports fronts built in to X. | ||
* These fonts can be listed with a utility like 'xlsfonts' in a terminal | ||
|
||
Font: lucidasans-10 | ||
FontFallback: fixed | ||
|
||
* The transform values are additive to the information recieved from TargetMonitor | ||
* This means if the monitor is 1920 wide and BarWidth is 0 then the bar is also 1920 wide | ||
* To make the bar slimmer BarWidth needs to be a negative number | ||
* BarHeight is not aditive and is 0 high by default | ||
* BarX and BarY is the monitor coordinates for where to draw the bar at | ||
|
||
BarWidth: 0 | ||
BarHeight: 32 | ||
BarX: 0 | ||
BarY: 0 | ||
|
||
* The following settings are to render a small line under every rendered component on the bar | ||
* UseUnderline will be false unless its value is directly "true" | ||
|
||
UseUnderlines: true | ||
UnderlineHeight: 3 | ||
UnderlineOffsetX: 0 | ||
UnderlineOffsetY: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
local time = os.date("%a %d // %H:%M") | ||
|
||
-- DrawString takes a string, alignment option, and additive x axis value | ||
DrawString(time, Alignment.CENTER, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <algorithm> | ||
#include <filesystem> | ||
#include <fstream> | ||
|
||
#include "configParser.h" | ||
|
||
ConfigParser::ConfigParser(){ | ||
|
||
} | ||
|
||
void ConfigParser::Parse(const std::string& file){ | ||
auto configDir = std::filesystem::path(getenv("HOME")) / ".config/MiBar"; | ||
|
||
if(file.empty()){ | ||
configDir /= "config"; | ||
} | ||
else{ | ||
configDir /= file; | ||
} | ||
|
||
configDir += ".bar"; | ||
|
||
// Parsing config file | ||
std::fstream infile(configDir); | ||
|
||
std::string line; | ||
while(std::getline(infile, line)){ | ||
std::istringstream isLine(line); | ||
std::string key; | ||
|
||
if(std::getline(isLine, key, ':')){ | ||
if(key.find('*') != std::string::npos) continue; | ||
|
||
std::string value; | ||
if(std::getline(isLine, value)){ | ||
value.erase(std::remove_if(value.begin(), value.end(), ::isspace), value.end()); | ||
m_configs[key] = value; | ||
} | ||
} | ||
} | ||
} | ||
|
||
const std::string ConfigParser::GetConfig(const int key) const { | ||
auto it = m_configs.find(m_configTable[key]); | ||
return it->second; | ||
} |
Oops, something went wrong.