Compare commits
No commits in common. "b4dfef1d6de0245029ad725ac6a5af7fa5fb75f3" and "bd3674accfba8bb89e8e78d923d321e04a861964" have entirely different histories.
b4dfef1d6d
...
bd3674accf
6 changed files with 26 additions and 108 deletions
|
@ -1,6 +1,3 @@
|
||||||
(include "bottomBar/workspaces.yuck")
|
|
||||||
(include "bottomBar/traveldings.yuck")
|
|
||||||
|
|
||||||
(defwindow bottomBar
|
(defwindow bottomBar
|
||||||
:monitor 0
|
:monitor 0
|
||||||
:stacking "fg"
|
:stacking "fg"
|
||||||
|
@ -22,7 +19,7 @@
|
||||||
)
|
)
|
||||||
(box
|
(box
|
||||||
:halign "center"
|
:halign "center"
|
||||||
(traveldings)
|
(label :text "mid")
|
||||||
)
|
)
|
||||||
(box
|
(box
|
||||||
:halign "end"
|
:halign "end"
|
||||||
|
@ -42,3 +39,21 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(defwidget workspaceWidget []
|
||||||
|
(box
|
||||||
|
:class "workspaces"
|
||||||
|
(for workspace in workspaces
|
||||||
|
(button
|
||||||
|
:class "${workspace.urgent ? "urgent" : ""} ${workspace.focused ? "focused" : 0}"
|
||||||
|
:onclick "swaymsg workspace ${workspace.name}"
|
||||||
|
(label :text "${workspace.name}")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflisten workspaces
|
||||||
|
:initial "[]"
|
||||||
|
"bar-ws-monitor"
|
||||||
|
)
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
(defwidget traveldings []
|
|
||||||
(revealer
|
|
||||||
:class "traveldings"
|
|
||||||
:transition "crossfade"
|
|
||||||
:reveal { traveldings_data != "null" }
|
|
||||||
(traveldingsBarWidget)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget traveldingsBarWidget []
|
|
||||||
(overlay
|
|
||||||
(box
|
|
||||||
:width 640
|
|
||||||
(label
|
|
||||||
:halign "start"
|
|
||||||
:text "${traveldings_data.line} -> ${strlength(traveldings_data.arrival_station) > 24 ? "${substring(traveldings_data.arrival_station, 0, 24)}…" : traveldings_data.arrival_station}${traveldings_data.arrival_platform_data_available ? " (Gl. ${traveldings_data.arrival_platform_real})" : ""}"
|
|
||||||
)
|
|
||||||
(label
|
|
||||||
:halign "end"
|
|
||||||
:text { traveldings_data.time_left >= 3600 ? formattime(traveldings_data.time_left, "noch %-Hh %-Mmin", "Etc/UTC") : formattime(traveldings_data.time_left, "noch %-Mmin", "Etc/UTC") }
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(box
|
|
||||||
(progress
|
|
||||||
:value {traveldings_data.progress * 100}
|
|
||||||
:orientation "horizontal"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwindow traveldingsWindow
|
|
||||||
:monitor 0
|
|
||||||
:stacking "overlay"
|
|
||||||
:exclusive "false"
|
|
||||||
:geometry (geometry
|
|
||||||
:x "0%"
|
|
||||||
:y "6.6%"
|
|
||||||
:width "30%"
|
|
||||||
:height "20%"
|
|
||||||
:anchor "bottom center")
|
|
||||||
(box
|
|
||||||
:class "traveldingsWindow"
|
|
||||||
(label :text "TODO"))
|
|
||||||
)
|
|
||||||
|
|
||||||
(deflisten traveldings_data
|
|
||||||
:initial "null"
|
|
||||||
"traveldings current"
|
|
||||||
)
|
|
|
@ -1,17 +0,0 @@
|
||||||
(defwidget workspaceWidget []
|
|
||||||
(box
|
|
||||||
:class "workspaces"
|
|
||||||
(for workspace in workspaces
|
|
||||||
(button
|
|
||||||
:class "${workspace.urgent ? "urgent" : ""} ${workspace.focused ? "focused" : 0}"
|
|
||||||
:onclick "swaymsg workspace ${workspace.name}"
|
|
||||||
(label :text "${workspace.name}")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(deflisten workspaces
|
|
||||||
:initial "[]"
|
|
||||||
"bar-ws-monitor"
|
|
||||||
)
|
|
|
@ -14,20 +14,3 @@ label {
|
||||||
.workspaces button.focused {
|
.workspaces button.focused {
|
||||||
background-color: #504935;
|
background-color: #504935;
|
||||||
}
|
}
|
||||||
|
|
||||||
.traveldings progressbar trough {
|
|
||||||
border: none;
|
|
||||||
background-color: #3c3836;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.traveldings progressbar progress {
|
|
||||||
background-color: #79740e;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.traveldingsWindow {
|
|
||||||
border-radius: 15px;
|
|
||||||
}
|
|
|
@ -68,7 +68,6 @@ struct CurrentJourneyOutput {
|
||||||
progress: Option<f32>,
|
progress: Option<f32>,
|
||||||
time_left: Option<i64>,
|
time_left: Option<i64>,
|
||||||
icon: String,
|
icon: String,
|
||||||
line: String,
|
|
||||||
|
|
||||||
// Invalid data received?
|
// Invalid data received?
|
||||||
departure_err: bool,
|
departure_err: bool,
|
||||||
|
@ -149,7 +148,6 @@ impl CurrentJourneyOutput {
|
||||||
progress,
|
progress,
|
||||||
time_left,
|
time_left,
|
||||||
icon,
|
icon,
|
||||||
line: checkin.train.line_name.clone(),
|
|
||||||
departure_err,
|
departure_err,
|
||||||
departure_planned,
|
departure_planned,
|
||||||
departure_real,
|
departure_real,
|
||||||
|
|
|
@ -36,8 +36,6 @@ pub struct StopOverResource {
|
||||||
pub platform: Option<String>,
|
pub platform: Option<String>,
|
||||||
pub departure_platform_planned: Option<String>,
|
pub departure_platform_planned: Option<String>,
|
||||||
pub departure_platform_real: Option<String>,
|
pub departure_platform_real: Option<String>,
|
||||||
pub arrival_platform_planned: Option<String>,
|
|
||||||
pub arrival_platform_real: Option<String>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// ????
|
||||||
|
@ -59,19 +57,9 @@ pub enum StopJourneyPart {
|
||||||
}
|
}
|
||||||
impl StopOverResource {
|
impl StopOverResource {
|
||||||
pub fn get_time_data(&self, journey_part: StopJourneyPart) -> JsonableData {
|
pub fn get_time_data(&self, journey_part: StopJourneyPart) -> JsonableData {
|
||||||
let (time_planned, time_real, platform_planned, platform_real) = match journey_part {
|
let (time_planned, time_real) = match journey_part {
|
||||||
StopJourneyPart::Origin => (
|
StopJourneyPart::Origin => (self.departure_planned, self.departure_real),
|
||||||
self.departure_planned,
|
StopJourneyPart::Destination => (self.arrival_planned, self.arrival_real),
|
||||||
self.departure_real,
|
|
||||||
self.departure_platform_planned.clone(),
|
|
||||||
self.departure_platform_real.clone(),
|
|
||||||
),
|
|
||||||
StopJourneyPart::Destination => (
|
|
||||||
self.arrival_planned,
|
|
||||||
self.arrival_real,
|
|
||||||
self.arrival_platform_planned.clone(),
|
|
||||||
self.arrival_platform_real.clone(),
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let time_err = time_planned == None;
|
let time_err = time_planned == None;
|
||||||
|
@ -82,9 +70,10 @@ impl StopOverResource {
|
||||||
time_real: time_real.map(|ts| ts.timestamp()),
|
time_real: time_real.map(|ts| ts.timestamp()),
|
||||||
station: self.name.clone(),
|
station: self.name.clone(),
|
||||||
ril100: self.ril_identifier.clone(),
|
ril100: self.ril_identifier.clone(),
|
||||||
platform_data_available: platform_planned.is_some() || platform_real.is_some(),
|
platform_data_available: self.departure_platform_planned.is_none()
|
||||||
platform_planned,
|
|| self.departure_platform_real.is_none(),
|
||||||
platform_real,
|
platform_planned: self.departure_platform_planned.clone(),
|
||||||
|
platform_real: self.departure_platform_real.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue