-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchrome.sh
45 lines (37 loc) · 1.4 KB
/
chrome.sh
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
#!/usr/bin/env bash
#
# https://jasonmun.blogspot.my
# https://github.com/yomun
#
# Copyright (C) 2017 Jason Mun
#
#
##################################################################################
# x-www-browser 'chrome://gpu'
##################################################################################
# Graphics Feature Status
# CheckerImaging: Enabled
# Native GpuMemoryBuffers: Hardware accelerated
# Rasterization: Hardware accelerated
# Video Decode: Hardware accelerated
# Video Encode: Hardware accelerated
##################################################################################
if [ -f "/usr/bin/google-chrome-stable" ]
then
FILE="/usr/share/applications/google-chrome.desktop"
LINE_NUM=`grep -Fn 'Exec=/usr/bin/google-chrome-stable %U' ${FILE} | sed 's/:.*//g'`
array=("--ignore-gpu-blacklist" "--enable-gpu-rasterization" "--enable-native-gpu-memory-buffers" "--enable-features=\"CheckerImaging\"")
for ix in ${!array[*]}
do
NUM_EXIST=`grep -Fn '${array[$ix]}' ${FILE} | sed 's/:.*//g'`
if [ "${NUM_EXIST}" = "" ]
then
NEW="Exec=\/usr\/bin\/google-chrome-stable %U --ignore-gpu-blacklist --enable-gpu-rasterization --enable-native-gpu-memory-buffers --enable-features=\"CheckerImaging\""
sed -i "${LINE_NUM}s/.*/${NEW}/" ${FILE}
xdg-settings set default-web-browser google-chrome.desktop
exit
fi
done
else
xdg-open https://www.google.com/chrome/browser/desktop/
fi