Skip to content

Commit

Permalink
Add polybar module example config
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobGM committed Feb 20, 2018
1 parent a9c8cd0 commit 7d69c90
Show file tree
Hide file tree
Showing 7 changed files with 697 additions and 52 deletions.
139 changes: 105 additions & 34 deletions astrality/config/astrality.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,119 @@
settings/astrality:
# If hot_reload_config is enabled, modifications to this file automatically runs:
# If hot_reload_config is enabled, modifications to this file automatically
# runs:
# 1) exit actions from the old configuration
# 2) startup actions from the new configuration
# Requires restart if enabled
hot_reload_config: true

# Modified templates can be automatically recompiled
recompile_modified_templates: false
recompile_modified_templates: true

# You can delay astrality on startup. The delay is given in seconds.
startup_delay: 0

# Astrality can wait for shell commands to complete in their specified order.
# You can set the number of seconds Astrality waits for the shell commands to exit.
# Astrality can wait for shell commands to complete in their specified
# order. You can set the number of seconds Astrality waits for the shell
# commands to exit.
run_timeout: 0

# Modules can require successfull shell commands (non-zero exit codes) in order
# to be enabled. You can specify the timeout for such checks, given in seconds.
# Modules can require successfull shell commands (non-zero exit codes) in
# order to be enabled. You can specify the timeout for such checks, given
# in seconds.
requires_timeout: 1


context/host:
# Here we define some context values which often change between host
# computers, and are therefore practical to use in our templates.
displays:
# All displays defined here are used in the polybar module. It creates
# one bar for each of the display handles, where the bar identifier is
# the same as the display handle. This way you can start a polybar for
# the primary screen by running:
# polybar --config {modules/polybar/config.template} HDMI2
primary:
handle: HDMI2
dpi: 96

secondary:
handle: eDP1
dpi: 96


interfaces:
wlan:
# You can also use command substitution in order to insert the
# standard output of a shell command into a configuration option.
#
# This is also used by the polybar template to point the
# wireless-internet polybar module to the correct interface.
handle: $( iwconfig 2>/dev/null | grep -o "^\w*" )

ethernet:
handle: eno0


context/fonts:
# Here we define some context values for fonts that we want to use in
# several different configurations, another common use case for context
# values in templates.

# You can use integer indexed variables in order to have fallback values.
# If {{ fonts:4/5/6 on so an }} is used in a template, but it is not
# defined, it will be replaced with {{ ast:fonts:3 }} instead. This is
# useful when you dont want to assume how many fonts you want to use when
# you write your templates.
1:
name: FuraCode Nerd Font
size: 8

2:
name: FuraMono Nerd Font
size: 8

3:
name: RobotoMono Nerd Font
size: 8


module/colors:
# This module is used to import a color scheme into the `color` context
# section. This makes it easy to change color schemes by changing the
# `from_section` option below. Take a look at the color_schemes.yaml file
# to see how to use color scheme context values in your templates.
on_startup:
import_context:
- from_path: modules/colors/color_schemes.yaml
from_section: gruvbox_dark
to_section: colors


module/polybar:
requires: command -v polybar

on_startup:
compile:
- template: modules/polybar/config.template

run:
- killall -q polybar
- polybar --config={modules/polybar/config.template} --reload HDMI2
- polybar --config={modules/polybar/config.template} --reload eDP1

on_modified:
modules/polybar/config.template:
compile:
- template: modules/polybar/config.template


module/solar_desktop:
# A module for changing your wallpaper based on the suns position in the
# sky, while changing the font color of two conky modules to fit the
# wallpaper's colors
# wallpaper's colors. This module demonstrates more advanced features.
#
# I reccomend you to read the docs at https://astrality.readthedocs.io
# if you want to understand something that seems unclear.
enabled: true

# A module can require shell commands to return successfully in order to
Expand All @@ -37,17 +127,17 @@ module/solar_desktop:
# sunrise, morning, afternoon, sunset, and night.
type: solar

# Since this is dependent on your exact location, you have to specify your
# GPS coordinates. They are can be easily obtained from:
# Since this is dependent on your exact location, you have to specify
# your GPS coordinates. They are can be easily obtained from:
# https://www.latlong.net/
latitude: 63.446827
longitude: 10.421906
elevation: 0

# You can force a event listener to always return the same event for debugging.
# For example, if you want to check if all your periodic color schemes
# fit your the respective periodic wallpapers, without waiting for sunset,
# etc..
# You can force a event listener to always return the same event for
# debugging. For example, if you want to check if all your periodic
# color schemes fit your the respective periodic wallpapers, without
# waiting for sunset, etc..
# force_event: sunrise

on_startup:
Expand All @@ -69,12 +159,12 @@ module/solar_desktop:

on_event:
# Import the context section named the same as the current event,
# e.g. `night`, into the global context section named `colors`,
# e.g. `night`, into the global context section named `wallpaper_colors`,
# from the file: modules/solar_desktop/solar_colors.yaml.
import_context:
from_path: modules/solar_desktop/solar_colors.yaml
from_section: '{event}'
to_section: colors
to_section: wallpaper_colors

# Compile the templates specified in the conky module, as their
# context values have changed due to the import_context action above.
Expand All @@ -91,23 +181,4 @@ module/solar_desktop:
run: pkill -f conky


context/general:
# We can define context values used when compiling templates.
# For instance, with this option set, you can use {{ general.display }} in all
# your templates, and it will be replaced with eDP1
display: eDP1

# You can also use command substitution in order to insert the standard
# output of a shell command into a configuration option.
HDMI: $(xrandr | grep "HDMI2 connected")


context/fonts:
# You can use integer indexed variables in order to have fallback values. If
# ${ast:fonts:4} is used in a template, but it is not defined, it will be
# replaced with ${ast:fonts:3} instead.
1: FuraCode Nerd Font
2: FuraMono Nerd Font
3: RobotoMono Nerd Font

# vim:filetype=yaml
149 changes: 149 additions & 0 deletions astrality/config/modules/colors/color_schemes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Here we define a set of color values for different color schemes.
# The color schemes are supposed to be usable in several different applications,
# and should be be mutually interchangable.
#
# Each color scheme should provide the following:
# * A set of integer indexed background colors
# * A set of integer indexed foreground colors
# * The primary colors which the color scheme uses besides foreground
# and background colors. Also integer indexed.
# * The exact prefered shade of each common color, such as:
# white, red, green, yellow, blue, black.

# Morhetz' gruvbox color schemes: https://github.com/morhetz/gruvbox
context/gruvbox_dark:

background:
1: 282828
2: 3c3836
3: 504945
4: 665c54
5: 7c6f64

foreground:
1: fbf1c7
2: ebdbb2
3: d5c4a1
4: bdae93
5: a89984

primary:
1: 98971a
2: 458588
3: d79921
4: d65d0e
5: cc249d

white: fbf1c7
red: cc241d
green: 98971a
yellow: d79921
blue: 458588
purple: b16286
aqua: 689d6a
gray: 928374
orange: d65d0e


context/gruvbox_light:

background:
1: fbf1c7
2: ebdbb2
3: d5c4a1
4: bdae93
5: a89984

foreground:
1: 3c3836
2: 3c3836
3: 504945
4: 665c54
5: 7c6f64

primary:
1: 98971a
2: 458588
3: d79921
4: d65d0e
5: cc249d

white: fbf1c7
red: cc241d
green: 98971a
yellow: d79921
blue: 458588
purple: b16286
aqua: 689d6a
gray: 928374
orange: d65d0e


# The Solarized dark/light color schemes made by Ethan Schoonover
# Source: http://ethanschoonover.com/solarized
context/solarized_dark:
background:
1: 002b36
2: 073642
3: 586e75
4: 657b83
5: 839496
6: 93a1a1

foreground:
1: fdf6e3
2: eee8d5
3: 93a1a1
4: 839496
5: 657b83
6: 586e75

primary:
1: 859900
2: b58900
3: cb4b16
4: 2aa198
5: 268bd2
6: dc322f

yellow: b58900
orange: cb4b16
red: dc322f
magenta: d33682
violet: 6c71c4
blue: 268bd2
cyan: 2aa198
green: 859900

context/solarized_light:
background:
1: fdf6e3
2: eee8d5
3: 93a1a1
4: 839496
5: 657b83
6: 586e75

foreground:
1: 002b36
2: 073642
3: 586e75
4: 657b83
5: 839496
6: 93a1a1

primary:
1: 859900
2: b58900
3: 2aa198
4: 268bd2
5: dc322f

yellow: b58900
orange: cb4b16
red: dc322f
magenta: d33682
violet: 6c71c4
blue: 268bd2
cyan: 2aa198
green: 859900

0 comments on commit 7d69c90

Please sign in to comment.