Skip to content

Commit ed4d77c

Browse files
committed
Update logic
1 parent 1e10745 commit ed4d77c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,31 @@ battery:
158158
levels = if current_battery_state {
159159
if self.enable_notifications {
160160
println!("Switching to Battery mode");
161+
let _ = std::process::Command::new("notify-send")
162+
.args([
163+
"-i",
164+
"/path/to/nonexistent/icon",
165+
"Hypraway",
166+
"-t",
167+
"2100",
168+
"Switched to Battery Power Mode"
169+
])
170+
.spawn();
161171
}
162172
&self.battery
163173
} else {
164174
if self.enable_notifications {
165175
println!("Switching to AC power mode");
176+
let _ = std::process::Command::new("notify-send")
177+
.args([
178+
"-i",
179+
"/path/to/nonexistent/icon",
180+
"Hypraway",
181+
"-t",
182+
"2100",
183+
"Switched to AC Power Mode"
184+
])
185+
.spawn();
166186
}
167187
&self.ac
168188
};

0 commit comments

Comments
 (0)