Multi monitor support in DWL
This commit is contained in:
19
dwltags.pl
19
dwltags.pl
@@ -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 = {};
|
||||
}
|
||||
|
Reference in New Issue
Block a user