Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

157

Edit /etc/systemd/logind.conf and make sure you have, HandleLidSwitch=ignore which will make it ignore the lid being closed. (You may need to also undo the other changes you've made). Then, you'll want to reload logind.conf to make your changes go into effect (thanks to Ehtesh Choudhury for pointing this out in the comments): systemctl restart systemd-...


101

Laptop batteries typically have onboard firmware to control safe charging & discharging of the battery, report battery charge level to the OS, and prevent thermal runaway, which is what will cause an Li-ion battery to explode (or more accurately, catch fire). Most modern ones also contain mechanical failsafes to prevent such fires & explosions. This ...


27

To disable the Lid Switch: Open the file /etc/systemd/logind.conf as root. Find this: HandleLidSwitch If it's commented, uncomment and change the value to ignore. The line after editing should be: HandleLidSwitch=ignore Restart computer and your problem should be gone. Or better restart logind service: sudo service systemd-logind restart (Source)


26

I think all batteries can explode. The question is if Linux (an operating system using the Linux kernel) will generate more heat or not. With good use of the fan (equally good use of the fan as other operating systems might employ), the cooling should be equal or better, thus resulting in a similar (or perhaps even reduced) risk of battery explosion. There ...


23

Install GNOME Tweak Tool and go to the Power section. There's an option to disable the automatic suspend on lid close. Option details I compared dconf before and after to find the option, but it turns out that's not how it's implemented. Instead, Tweak Tool creates ~/.config/autostart/ignore-lid-switch-tweak.desktop. The autostart is a script which ...


22

You can use this to temporarily disable lid-switch events: systemd-inhibit --what=handle-lid-switch sleep 1d


18

Why is it called eDP1? Because it is an embedded display port style adapter, and not a video graphics array style one.


18

If “certain times” aren’t fixed, i.e. you want to specify manually when your system enters and leaves “performance mode”, you can simply stop and start cron: sudo systemctl stop cron will prevent any cron jobs from running, and sudo systemctl start cron will re-enable them. You could also check out anacron instead of cron, it might be easier to tweak ...


16

So, it sounds like you have not installed a boot loader (e.g. grub) on the disk. This means that although you have a valid OS on it, there is no way to boot it and so you can't use it. You need to attach the HDD to a working computer (you can use a live CD), set up a chroot environment and install grub on it. Mount the partition you will be using as / (I ...


14

No, it doesn't. The issue isn't with the type of disk (spinning/non-spinning), it's with committing disk buffers from RAM to disk. If the power goes out suddenly, some of these buffers may never get committed to disk, and having barriers enabled improves your chances of recovering the filesystem. There's also an additional issue with the disk's on-board ...


14

I know this is an old question, but the following unit file worked for me to run a script upon resume from sleep: [Unit] Description=<your description> After=suspend.target [Service] User=root Type=oneshot ExecStart=<your script here> TimeoutSec=0 StandardOutput=syslog [Install] WantedBy=suspend.target I believe it is the After=suspend.target ...


14

For my specific case, I can get the status of the lid with $ cat /proc/acpi/button/lid/LID0/state state: open I can then just grep for open or closed to see if it's open or closed.


12

I would consider two approaches Leave the scheduling untouched but run all cron jobs under nice, and possibly even ionice: 0 * * * * root ionice -c3 nice /some/command and parameters Disallow any cron jobs during certain times. Remember that any user who can create (or remove) the flag file can control this approach. That might work if you want to ...


11

I'm pretty sure that an OS has no capabilities to destroy a battery (be it Linux OS, Windows, etc.). A malfunctioning program (and not Linux by itself) can overload a laptop/PC up to the point that, for example, it can enter CPU thermal protection. But a fresh Linux install will not damage any hardware (if it does, than something is terribly wrong with ...


11

This question is old but I just came across a working fix for this. As it turns out, the issue was caused due to the USB drive being unmounted during the LVM setup process. It might've been a bad USB connector or USB drive. There is a very easy fix for which you don't even have to reboot or re-do any of the setup again. Press esc to enter the menu of the ...


10

There is no point in disabling logging because of SSD characteristics. SSD firmwares are even able to distribute repeated writes to the same sector 'wear leveling' - and the specified maximal write cycle count (for each sector) is quite high. For example Hitachi specifies its SSD drives for '10 full drive writes per day for five years'. As a vendor, you ...


8

Right now I am answering this with my notebook connected to a monitor. To have my desktop extended I use xrandr and its graphical interface ARandR, both of them working pretty well. Indeed, I have a script which I execute every time I log to my notebook having the screen attached to it: #!/bin/sh xrandr --output LVDS1 --mode 1280x800 --pos 0x0 --rotate ...


8

This will vary from user to user and is subjective, but I think Ubuntu is very easy to install and use (certainly a far cry from the good old days of 20 floppy disks and slackware :-) Specifically, Ubuntu has never let me down in detecting and configuring itself to the host hardware, so that's a definite plus. Also, it comes with a live CD, so you can try ...


8

Powertop is not a permanent tool, as you know, so you will have to setup your system to run the commands through sysctl, udev, systemd units, scripts, whatever... In order to see what commands are used by powertop you will have to run powertop --html BEFORE MAKING ANY CHANGES, that is, BEFORE toggling the settings from Bad to Good. If you already tuned for ...


8

The problem I was having involved the "Disable While Typing Enabled" feature of my trackpad. These are the steps I used to solve it. Make sure xinput is installed. Type xinput to find the name of the trackpad device. mine was "ETPS/2 Elantech Touchpad" xinput --list-props "DEVICE" to list the properties of the device Go through the list until you find ...


8

Yes, often you can boot and run different computers from the same hard disk drive with linux, but if one of the computers needs a proprietary driver (that does not work in the other computer), for example for the graphics card, there might be problems. You need to boot in the boot mode, that linux was installed in (UEFI mode or BIOS mode). But you can '...


7

It's probably not bad if they're "Bad", when you run on the AC power. When running on battery, the "Good/Bad" settings may or may not help. You can toggle them and observe the effects, but should you toggle them if you want to achieve the highest power-saving? I agree with mavit's answer that the powertop is primarily a diagnostic tool. There are other ...


7

UEFI has nothing to do with power management. ACPI manages power. UEFI indicates modern firmware than BIOS and newer platform, thus improved power efficiency. This might be a correlation. The PM subsystem is different from UEFI. Linux includes a whole range of power management functionalities, though unrelated to UEFI, like cpufreq, intel_pstate, pcie_aspm, ...


7

I just got my T440s, installed Arch Linux on it and can confirm that Fn+Esc locks the Fn keys to their "proper" function. No user-intervention needed to get it working, and Arch just installs the stock kernel so no magic pathes present. The thinkpad_acpi kernel module is loaded, tp_smapi not (and refuses to be), haven't tried without them. Side effect: a ...


7

I don't know why you're looking for corroborating evidence from the system, when you have solid empirical evidence. The battery won't hold a charge. Period, end of story. I'd be happier if I saw a high charge cycle count. Lithium ion isn't good for more than about 500 charge cycles. Another datum, which won't appear in the places you've been looking, is ...


7

This page should cover some of your questions. http://wiki.yobi.be/wiki/Debian_on_laptop And of course, we need also to mention the official page from the Linux Documentation Project. http://www.tldp.org/HOWTO/html_single/Battery-Powered/ Frankly, nowadays with a laptop which battery lasts from 6 to 9 hours, I do not obsess so much over this stuff. It ...


7

I'm not sure how you missed it in the docs, because when I looked it was plainly there. Place this in logind.conf: HandleLidSwitch=ignore


6

4GB is tons of RAM. You do not have to be contemplating "lightweight" distros at all. A large project is a large project, but I am a little bit curious as to why you believe that working on one requires a correspondingly large amount of RAM, because generally it does not. I have done R on R stuff in the past and I know that is not resource light but it does ...


6

As an alternative to writing and enabling a unit file, you can also put a shell script (or a symlink to your script) into /lib/systemd/system-sleep/. It will be called before sleep/hibernate, and at resume time. From man systemd-suspend.service : Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other ...


Only top voted, non community-wiki answers of a minimum length are eligible