What is the point of "grep !" in line 129 in optirun?
if [ `lspci -v -s $NVIDIABUSID |grep ! |wc -l` -eq 1 ]; then
According to the title it tries to detect if bumblebee is enabled, and if not (so the result of this line should be true bumblebee is not enabled) enable bumblebee.
However, when I run
sudo lspci -v -s 01:00
both with bumblebee enabled and disabled I get the following output, which doesn't have any !:
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1) (prog-if 00 [VGA controller])
Subsystem: Micro-Star International Co., Ltd. Device 108d
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
[virtual] Expansion ROM at f7000000 [disabled] [size=512K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [b4] Vendor Specific Information: Len=14 <?>
Capabilities: [100] Virtual Channel
Capabilities: [128] Power Budgeting <?>
Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
Kernel driver in use: nvidia
Kernel modules: nvidia-current, nouveau, nvidiafb
Since the output doesn't contain any "!" bumblebee is not enabled, and I have to enable it by myself every time I want to "optirun" something.
(I changed the script to make it trigger always)
What is the point of "grep !" in line 129 in optirun?
According to the title it tries to detect if bumblebee is enabled, and if not (so the result of this line should be true bumblebee is not enabled) enable bumblebee.
However, when I run
both with bumblebee enabled and disabled I get the following output, which doesn't have any !:
Since the output doesn't contain any "!" bumblebee is not enabled, and I have to enable it by myself every time I want to "optirun" something. (I changed the script to make it trigger always)