diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-11 20:39:05 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-11 20:39:05 +0100 |
commit | c448b52d9f89225ed5ee096d8d152235c11b98cb (patch) | |
tree | ed82d6dd6fd46ced1e5147c51612e3c597ffece5 /.local | |
parent | commit (diff) | |
download | dotfiles-bsd-c448b52d9f89225ed5ee096d8d152235c11b98cb.tar.gz dotfiles-bsd-c448b52d9f89225ed5ee096d8d152235c11b98cb.tar.bz2 dotfiles-bsd-c448b52d9f89225ed5ee096d8d152235c11b98cb.tar.xz dotfiles-bsd-c448b52d9f89225ed5ee096d8d152235c11b98cb.tar.zst dotfiles-bsd-c448b52d9f89225ed5ee096d8d152235c11b98cb.zip |
Update
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/linkview | 10 | ||||
-rwxr-xr-x | .local/bin/setscreens.sh | 2 | ||||
-rwxr-xr-x | .local/bin/unixize | 84 |
3 files changed, 9 insertions, 87 deletions
diff --git a/.local/bin/linkview b/.local/bin/linkview index ed9427f..c5d5053 100755 --- a/.local/bin/linkview +++ b/.local/bin/linkview @@ -49,6 +49,12 @@ sub open_link } $file_name = $url; $file_name =~ s/.+\///g; + if ($file_name =~ m/^watch\?v=.+/) { + $file_name = "Your video"; + } + else { + $file_name = '<b>' . $file_name . '</b>'; + } system( NOTIFYSEND_PATH, '-u', @@ -56,7 +62,7 @@ sub open_link '-t', '10000', ' download started', - '<b>' . $file_name . '</b> started downloading' + $file_name . ' started downloading' ); $ret = -1; if ($a == 2) { @@ -73,7 +79,7 @@ sub open_link '-t', '10000', ' download complete', - '<b>' . $file_name . '</b> downloaded successfully to ' + $file_name . ' downloaded successfully to ' . '<b>' . $pwd . '</b>' ); } diff --git a/.local/bin/setscreens.sh b/.local/bin/setscreens.sh index 5b091c6..ec7c266 100755 --- a/.local/bin/setscreens.sh +++ b/.local/bin/setscreens.sh @@ -5,7 +5,7 @@ if xrandr | grep 'HDMI-1 connected'; then xrandr --output LVDS-1 --off xrandr --output HDMI-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal xrandr --output DP-1 --off - xrandr --output VGA-1 --mode 1440x900 --pos 1920x90 --rotate normal + xrandr --output VGA-1 --mode 1440x900 --right-of HDMI-1 --rotate normal xrandr --output HDMI-2 --off xrandr --output HDMI-3 --off xrandr --output DP-2 --off diff --git a/.local/bin/unixize b/.local/bin/unixize deleted file mode 100755 index 39c0cd1..0000000 --- a/.local/bin/unixize +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/local/bin/perl - -use warnings; -use strict; -use File::Copy qw/mv/; - -sub get_og_files -{ - my @og_files; - - opendir(DIR, '.') or die $!; - while (readdir(DIR)) { - next if ($_ =~ m/^\./); - push @og_files, $_; - } - closedir(DIR); - return @og_files; -} - -use constant { - C_O => '', -}; - -sub unixize_file_names -{ - my @og_files = @_; - my @new_files; - - foreach (@og_files) { - if ($_ =~ /^[0-9]+\./) { - $_ =~ s/\.//; - } - $_ =~ s/ - /_/g; - $_ =~ s/ /_/g; - $_ =~ s/c\+\+/cxx/g; - $_ =~ s/C\+\+/CXX/g; - $_ =~ s/[\x83\x84\x85\x86]/a/g; # âäàå - $_ =~ s/[]/A/g; # ÄÅ - $_ =~ s/\x91/ae/g; # æ - $_ =~ s/\x92/AE/g; # Æ - $_ =~ s/\x87/c/g; # ç - $_ =~ s/\x80/C/g; # Ç - $_ =~ s/[\x82\x88\x89\x8a]/e/g; # éêëè - # $_ =~ s/[ÉÈÊË]/E/g; - $_ =~ s/[\x8b\x8c\x8d]/i/g; # ïîì - # $_ =~ s/[ÏÎÌ]/I/g; - # $_ =~ s/[ôöò]/o/g; - $_ =~ s/[\x93\x94\x95]/o/g; # ôöò - # $_ =~ s/[ÿ]/y/g; - $_ =~ s/ü/u/g; - $_ =~ s/Ü/U/g; - $_ =~ s/[^A-Za-z0-9\._]+//g; - $_ = lc($_); - push @new_files, $_; - } - return @new_files; -} - -sub main -{ - my @og_files; - my @new_files; - my @files; - - @og_files = get_og_files(); - @new_files = unixize_file_names(@og_files); - while (@og_files || @new_files) { - $files[0] = shift @og_files; - $files[1] = shift @new_files; - if (@ARGV == 1 && $ARGV[0] eq '-R' && -d $files[0]) { - chdir($files[0]) or die $!; - main(); - chdir('../'); - } - next if (-e $files[1]); - # mv($files[0], $files[1]) or print STDERR $! . "\n"; - print "'". $files[0] . "' -> '" . $files[1] . "'\n"; - } - return; -} - -main(); - -__END__ |