-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
fx_vscreen_profiles
executable file
·56 lines (43 loc) · 1.11 KB
/
fx_vscreen_profiles
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/perl
# abstract: for some stupid reason I can't open multiple firefox
# instances using the same profile on different vscreens
# so this script uses a different profile for each vscreen
# to circumvent this issue
# We must create a profile for each vscreen using firefox -P first, then enable
# sync so we get all the bookmarks and settings
# Related:
# - www
# - fx_screen_profiles
# - userChrome.css
# - add_userchrome_to_all_profiles.zsh once done
use strict;
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
use IPC::Cmd qw(run);
use v5.32;
### 0-music
### 1-code
### 2+db
### 3*ftp
### 4-www
### 5-chat
### 6-slask1
### 7-slask2
### 8-mail
### 9-sound
my $firefox_profile;
my $url = shift @ARGV || 'http://192.168.1.97:3000';
my @vscreens = `sdorfehs -c vscreens`;
for my $vscreen(@vscreens) {
chomp $vscreen;
# a * means the current vscreen
# a + means the previous vscreen
next unless $vscreen =~ m/^[0-9]+[*](\S+)$/;
$firefox_profile = $1;
print "using fx profile $firefox_profile\n";
}
run(
command => "firefox --new-window -P $firefox_profile '$url'",
verbose => 3,
);