Dump waybar config to semi-permanent destination
Since a previous change combined all displays into a single file, it is no longer necessary to create many temporary configs. The latest config can just be dumped to the standard path so that running `waybar` on it's own will load it.
This commit is contained in:
parent
a92d475e60
commit
627ee855a7
|
@ -30,8 +30,8 @@
|
||||||
# "width": __WIDTH__ (optional)
|
# "width": __WIDTH__ (optional)
|
||||||
my $waybar_template = "$ENV{'HOME'}/.config/waybar/config.template";
|
my $waybar_template = "$ENV{'HOME'}/.config/waybar/config.template";
|
||||||
|
|
||||||
# Temporary directory to save generated waybar config(s)
|
# Path to actual config file generated from template
|
||||||
my $waybar_temporary = '/tmp';
|
my $waybar_config = "$ENV{'HOME'}/.config/waybar/config";
|
||||||
|
|
||||||
# File to log and recover last used layout name
|
# File to log and recover last used layout name
|
||||||
my $last = "$ENV{'HOME'}/.config/last_display";
|
my $last = "$ENV{'HOME'}/.config/last_display";
|
||||||
|
@ -382,12 +382,8 @@ unless ($pid) {
|
||||||
open STDOUT, '>>/dev/null';
|
open STDOUT, '>>/dev/null';
|
||||||
open STDERR, '>>/dev/null';
|
open STDERR, '>>/dev/null';
|
||||||
# Write config to a temporary file
|
# Write config to a temporary file
|
||||||
my $tmp = $waybar_temporary . "/waybar-" . time() .".config";
|
open ($fh, '>', $waybar_config);
|
||||||
open ($fh, '>', $tmp);
|
|
||||||
print $fh $waybar;
|
print $fh $waybar;
|
||||||
close $fh;
|
close $fh;
|
||||||
`nohup waybar --config=$tmp >> waybar.log`;
|
`nohup waybar --config=$waybar_config >> waybar.log`;
|
||||||
|
|
||||||
# Remove config
|
|
||||||
unlink $tmp;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue