Multi monitor support in DWL

This commit is contained in:
2021-05-31 22:23:35 -07:00
parent b84e9ff6ee
commit d89f1eb34b
3 changed files with 40 additions and 21 deletions

View File

@@ -10,6 +10,8 @@ use Getopt::Long;
my $info = {};
my $tags_file = $ENV{'DWL_TAGS_FILE'};
my @mons = map { /^([\w-]+)/; $1 } grep { /^([\w-]+)/ } `wlr-randr`;
GetOptions("file=s" => \$tags_file)
or die("Command line usage error");
@@ -40,12 +42,15 @@ my $colorscheme = {
print_log("DWLTAGS: $tags_file");
print_tags({
'selmon' => '1',
'tags' => '1 1',
'title' => '',
'layout' => '[]='
}, $tags_file);
for my $mon (@mons) {
print_tags({
'selmon' => '1',
'mon' => $mon,
'tags' => '1 1',
'title' => '',
'layout' => '[]='
}, $tags_file . "." . $mon);
}
while (<>) {
my $line = $_;
@@ -59,7 +64,7 @@ while (<>) {
# Commit a status
# Assumption: layout is the last piece of information dumped by DWL
$info->{'mon'} = $mon;
print_tags($info, $tags_file);
print_tags($info, $tags_file.".".$mon);
$info = {};
}