diff --git a/README.md b/README.md index 59162f8..6bd7737 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,17 @@ Documentation can be found [here](https://elkowar.github.io/eww/main) # Contribewwting -If you want to contribute anything, like adding new widgets, features or subcommands, you should definitly do so. +If you want to contribute anything, like adding new widgets, features or subcommands (Including sample configs), you should definitly do so. ## Steps 1. Fork this repo -2. install dependencies -3. smash your head against the keyboard from frustration (coding is hard) -4. open a pull request once you're finished. +2. Install dependencies +3. Smash your head against the keyboard from frustration (coding is hard) +4. Open a pull request once you're finished. + +# Examples + +An example of an eww bar: + +![Example 1](./examples/eww-bar/eww-bar.png) + diff --git a/docs/content/main/configuration.md b/docs/content/main/configuration.md index aefced7..6f0a242 100644 --- a/docs/content/main/configuration.md +++ b/docs/content/main/configuration.md @@ -10,6 +10,8 @@ For specific built in widgets `, , , etc` see [Widget Documen ### Placing the configuration file +Note: Example configuration files can be found in the `examples` directory of the repository and are showcased in [Examples](@/main/examples.md). + The configuration file and the scss file should lay in `$XDG_CONFIG_HOME/eww` (or, if unset, `$HOME/.config/eww`). The XML file should be named `eww.xml` and the scss should be named `eww.scss` So the directory structure should look like this: ``` diff --git a/docs/content/main/examples.md b/docs/content/main/examples.md new file mode 100644 index 0000000..ba97a32 --- /dev/null +++ b/docs/content/main/examples.md @@ -0,0 +1,12 @@ ++++ +title = "Examples" +slug = "Sample configs" +weight = 5 ++++ + +## Example Configurations + +These configurations of eww are available in the `examples/` directory of the [repo](https://github.com/elkowar/eww). + +An eww bar configuration: +![Example 1](./examples/eww-bar/eww-bar.png) diff --git a/examples/eww-bar/eww-bar.png b/examples/eww-bar/eww-bar.png new file mode 100644 index 0000000..72d61f6 Binary files /dev/null and b/examples/eww-bar/eww-bar.png differ diff --git a/examples/eww-bar/eww.scss b/examples/eww-bar/eww.scss new file mode 100644 index 0000000..9a009ac --- /dev/null +++ b/examples/eww-bar/eww.scss @@ -0,0 +1,65 @@ +* { + all: unset; //Unsets everything so you can style everything from scratch +} + +//Global Styles +window { + background-color: #121212; + color: #ffd5cd; + font-family: Iosevka; +} + +button { + all: unset; + background-color: #121212; + padding: 10px; +} + +// Styles on classes (see eww.xml for more information) + +.sidestuff slider { + all: unset; + color: #ffd5cd; +} + +.slider-vol scale trough highlight { + all: unset; + background-color: #D35D6E; + color: #000000; + border-radius: 10px; +} +.slider-vol scale trough { + all: unset; + background-color: #4e4e4e; + border-radius: 50px; + min-height: 3px; + min-width: 50px; + margin-left: 10px; + margin-right: 20px; +} +.slider-ram scale trough highlight { + all: unset; + background-color: #D35D6E; + color: #000000; + border-radius: 10px; +} +.slider-ram scale trough { + all: unset; + background-color: #4e4e4e; + border-radius: 50px; + min-height: 3px; + min-width: 50px; + margin-left: 10px; + margin-right: 20px; +} +.label-ram { + font-size: large; +} +.time { + padding-right: 10px; +} +.workspaces button:hover { + color: #D35D6E; +} + + diff --git a/examples/eww-bar/eww.xml b/examples/eww-bar/eww.xml new file mode 100644 index 0000000..eb70a81 --- /dev/null +++ b/examples/eww-bar/eww.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  {{music}} + + + + + + + + + + + + + + + + + + + {{hour}}:{{min}} {{month}} {{number_day}}, {{year_full}} + + + + + + + + + playerctl metadata --format '{{ artist }} - {{ title }}' + + + + + + ~/.config/eww/scripts/getvol + + + date "+%d" + date "+%b" + date "+%M" + date "+%H" + date "+%Y" + + + ~/.config/eww/scripts/getram + + + cat /sys/class/power_supply/BAT0/capacity + + + + + + + + + + + + + diff --git a/examples/eww-bar/scripts/getram b/examples/eww-bar/scripts/getram new file mode 100755 index 0000000..791a5a5 --- /dev/null +++ b/examples/eww-bar/scripts/getram @@ -0,0 +1,2 @@ +#!/bin/sh +printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') diff --git a/examples/eww-bar/scripts/getvol b/examples/eww-bar/scripts/getvol new file mode 100755 index 0000000..3c31607 --- /dev/null +++ b/examples/eww-bar/scripts/getvol @@ -0,0 +1,2 @@ +#!/bin/sh +amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' diff --git a/src/main.rs b/src/main.rs index a0d9061..fe41197 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,10 +90,8 @@ fn main() { } else { log::info!("Initializing Eww server."); let _ = std::fs::remove_file(&*crate::IPC_SOCKET_PATH); - println!("Run `eww logs` to see any errors, warnings or information while editing your configuration."); server::initialize_server(config)?; - } } } diff --git a/src/server.rs b/src/server.rs index 8e9e2f0..db4b5cf 100644 --- a/src/server.rs +++ b/src/server.rs @@ -20,7 +20,7 @@ pub fn initialize_server(config_dir_override: Option) -> Res }); let (ui_send, mut ui_recv) = tokio::sync::mpsc::unbounded_channel(); - let config_file_path = config_dir_override.unwrap_or(crate::CONFIG_DIR.join("eww.xml")); + let config_file_path = config_dir_override.unwrap_or(crate::CONFIG_DIR.join("eww.xml")); let config_dir = config_file_path .parent()