summaryrefslogtreecommitdiff
path: root/fluxbox/debian/update-init.pl
blob: dcbf70cea7bb8fd2efadcda25e7a40341c585b30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use warnings;
use strict;

my ($init) = $ARGV[0];

die "init not found!" unless $init;

open my $file, '+<', $init
    or die "Can not open file `$init': $!\n";

my @data=
    map { chomp; $_ }
    grep !/\.strftimeFormat:/,
    grep !/\.toolbar\.tools:/,
    grep !/toolbar\.widthPercent:/, <$file>;


push @data,
(
    'session.screen0.toolbar.widthPercent: 100',
    'session.screen0.strftimeFormat: %d %b, %a %02k:%M:%S',
    'session.screen0.toolbar.tools: ' .
        'prevworkspace, workspacename, nextworkspace, ' .
        'clock, prevwindow, nextwindow, iconbar, systemtray',
);

truncate $file, 0;
seek $file, 0, 0;
print $file join "\n", @data;
bgstack15