içinde Ubuntu ya da benzeri, krom ve google-krom
sed -i \
's,"exit_type":\s*"Crashed","exit_type":"Normal",g' \
~/.config/{google-chrome,chromium}/@(Profile\ ?|Default)/Preferences
Tarayıcıyı başlatmadan önce bunu yürütün. Bunu bir bash betiğine koydum:
$ cat ~/bin/internet
#!/usr/bin/env bash
shopt -s extglob
sed -i \
's,"exit_type":\s*"Crashed","exit_type":"Normal",g' \
~/.config/{google-chrome,chromium}/@(Profile\ ?|Default)/Preferences
exec "$@"
.desktop
Dosyaları kullanıyorsanız da değiştirebilirsiniz :
$ sudo sed -i 's,Exec=,Exec=/home/bartek/bin/internet,g' /usr/share/applications/{google-chrome,chromium-browser}.desktop
$ grep Exec /usr/share/applications/{google-chrome,chromium-browser}.desktop
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable %U
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable
/usr/share/applications/google-chrome.desktop:Exec=/home/bartek/bin/internet /usr/bin/google-chrome-stable --incognito
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser %U
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser --incognito
/usr/share/applications/chromium-browser.desktop:Exec=/home/bartek/bin/internet chromium-browser --temp-profile
Komut Detayları:
- replaces JSON file key "exit_type" from "Crashed" to "Normal"
- JSON might include white space after colons, removed
- {google-chrome,chromium} - bash brace expansion, creates multiple paths if any of those exist
- /@(Profile\ ?|Default) - bash extended pattern, similar to brace expansion, allows for wildcards ? in patterns
- I used comma instead of common / in sed pattern, for readability
Dayanarak Janot en cevabı (bu sırayla başkalarının çalışmasına dayalı.