From 4e57bfe8a452b376da2f48dff9996557dce3ff68 Mon Sep 17 00:00:00 2001 From: aonemd Date: Tue, 30 Jun 2020 21:41:05 +0200 Subject: [PATCH] Add `_component` suffix to all components --- ...ry_level.go => battery_level_component.go} | 0 components/{cmus.go => cmus_component.go} | 0 ...ather.go => dark_sky_weather_component.go} | 0 .../{date_time.sh => date_time_component.sh} | 0 ...layout.go => keyboard_layout_component.go} | 0 ...ume_level.go => volume_level_component.go} | 0 onpar.go | 60 +++++++++---------- 7 files changed, 30 insertions(+), 30 deletions(-) rename components/{battery_level.go => battery_level_component.go} (100%) rename components/{cmus.go => cmus_component.go} (100%) rename components/{dark_sky_weather.go => dark_sky_weather_component.go} (100%) rename components/{date_time.sh => date_time_component.sh} (100%) rename components/{keyboard_layout.go => keyboard_layout_component.go} (100%) rename components/{volume_level.go => volume_level_component.go} (100%) diff --git a/components/battery_level.go b/components/battery_level_component.go similarity index 100% rename from components/battery_level.go rename to components/battery_level_component.go diff --git a/components/cmus.go b/components/cmus_component.go similarity index 100% rename from components/cmus.go rename to components/cmus_component.go diff --git a/components/dark_sky_weather.go b/components/dark_sky_weather_component.go similarity index 100% rename from components/dark_sky_weather.go rename to components/dark_sky_weather_component.go diff --git a/components/date_time.sh b/components/date_time_component.sh similarity index 100% rename from components/date_time.sh rename to components/date_time_component.sh diff --git a/components/keyboard_layout.go b/components/keyboard_layout_component.go similarity index 100% rename from components/keyboard_layout.go rename to components/keyboard_layout_component.go diff --git a/components/volume_level.go b/components/volume_level_component.go similarity index 100% rename from components/volume_level.go rename to components/volume_level_component.go diff --git a/onpar.go b/onpar.go index 92a623f..59005c5 100644 --- a/onpar.go +++ b/onpar.go @@ -33,48 +33,48 @@ func (c *Component) Run() { } func main() { - dateTime := NewComponent("components/date_time.sh", 1) - batteryLevel := NewComponent("components/battery_level", 1) - volumeLevel := NewComponent("components/volume_level", 1) - darkSkyWeather := NewComponent("components/dark_sky_weather", 600) - keyboardLayout := NewComponent("components/keyboard_layout", 1) - cmus := NewComponent("components/cmus", 1) + dateTimeComponent := NewComponent("date_time_component.sh", 1) + batteryLevelComponent := NewComponent("battery_level_component", 1) + volumeLevelComponent := NewComponent("volume_level_component", 1) + darkSkyWeatherComponent := NewComponent("dark_sky_weather_component", 600) + keyboardLayoutComponent := NewComponent("keyboard_layout_component", 1) + musicComponent := NewComponent("music_component", 2) // Initialize new components here ... - go dateTime.Run() - go batteryLevel.Run() - go volumeLevel.Run() - go darkSkyWeather.Run() - go keyboardLayout.Run() - go cmus.Run() + go dateTimeComponent.Run() + go batteryLevelComponent.Run() + go volumeLevelComponent.Run() + go darkSkyWeatherComponent.Run() + go keyboardLayoutComponent.Run() + go musicComponent.Run() // Call new components Run() here ... for { select { - case dateTime.Output = <-dateTime.Channel: - go dateTime.Run() - case darkSkyWeather.Output = <-darkSkyWeather.Channel: - go darkSkyWeather.Run() - case keyboardLayout.Output = <-keyboardLayout.Channel: - go keyboardLayout.Run() - case batteryLevel.Output = <-batteryLevel.Channel: - go batteryLevel.Run() - case volumeLevel.Output = <-volumeLevel.Channel: - go volumeLevel.Run() - case cmus.Output = <-cmus.Channel: - go cmus.Run() + case dateTimeComponent.Output = <-dateTimeComponent.Channel: + go dateTimeComponent.Run() + case darkSkyWeatherComponent.Output = <-darkSkyWeatherComponent.Channel: + go darkSkyWeatherComponent.Run() + case keyboardLayoutComponent.Output = <-keyboardLayoutComponent.Channel: + go keyboardLayoutComponent.Run() + case batteryLevelComponent.Output = <-batteryLevelComponent.Channel: + go batteryLevelComponent.Run() + case volumeLevelComponent.Output = <-volumeLevelComponent.Channel: + go volumeLevelComponent.Run() + case musicComponent.Output = <-musicComponent.Channel: + go musicComponent.Run() // Call new components Run() here ... } status = []string{ "", // Add new components here ... - cmus.Output, - keyboardLayout.Output, - darkSkyWeather.Output, - volumeLevel.Output, - batteryLevel.Output, - dateTime.Output, + musicComponent.Output, + keyboardLayoutComponent.Output, + darkSkyWeatherComponent.Output, + volumeLevelComponent.Output, + batteryLevelComponent.Output, + dateTimeComponent.Output, } exec.Command("xsetroot", "-name", strings.Join(status, " ")).Run()