fix error in tutos computer open webloc files

This commit is contained in:
asus
2023-09-08 08:00:51 +02:00
parent 30cdc45310
commit 41f70ea9be
2 changed files with 20 additions and 4 deletions

View File

@@ -34,6 +34,14 @@
sed 's/^BASEURL=/URL=/' "$1" | grep -m 1 '^URL=' | sed 's/^URL=//' | sed 's/\r//' | xargs xdg-open
fi
```
- signification :
- for the command "open_url file.URL" :
- **$0** : /usr/local/bin/open_url
- **$(basename "$0")** : open_url
- **$1** : file.URL
- the sed command :
- **grep -m 1** : tells grep to stop searching after the first match
- **xargs** : reads items from standard input and executes a command with those items as arguments
- give execution permission : `chmod +x /usr/local/bin/open_url`
- tell the file manager to use this script to open .URL files :
- right click on a .URL file
@@ -42,10 +50,18 @@
- 'use as default for this kind of file' (or equivalent)
- open :)
**open .webloc files :**
- see above 'open .URL files'
- change this line in the script :
grep -m 1 -oP '(?<=<string>).*?(?=<\/string>)' repas_4_etoiles.webloc | xargs xdg-open
- in the script change the line "sed..." by this :
grep -m 1 -oP '(?<=<string>).*?(?=<\/string>)' "$1" | xargs xdg-open
- signification :
- **-m 1** : tells grep to stop searching after the first match
- **-o** : tells grep to print only the matching portion of the line
- **-P** : this option enables Perl-compatible regular expressions, which support lookaheads and lookbehinds
- **(?<=<string>)** : this is a positive lookbehind that matches the position immediately after <string>.
- **.*?** : this matches any character (except for a newline) zero or more times, but as few times as possible.
- **(?=<\/string>)** : this is a positive lookahead that matches the position immediately before </string>
**pdftotext** transforme un pdf en un fichier texte
@@ -227,7 +243,7 @@ find | sort | grep -ve "node_modules/" -e ".git/" | sed 's#[^/]*/#|__ #g;s#__ |#
**list of automatic settings :**
- install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks
- install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks, ffmpeg, yt-dlp
- install or configure to avoid screen blue light
- install nextcloud client (apt ? or appimage ? appimage need fuse : https://github.com/AppImage/AppImageKit/wiki/FUSE), and launch at startup
- install these settings (connection with bitbucket ? ssh ? https ?)

View File

@@ -137,7 +137,7 @@
**==** rétablit la bonne indentation pour la ligne
**=G** rétablit la bonne indentation pour toute la page
**''** go to last cursor position
**gx** open the file under cursor, or url
**gx** open the file under cursor, or url or links
/REMPLACER/
**:s/old/new** remplace la 1ere occurence de ancien par nouveau