Skip to content

Instantly share code, notes, and snippets.

@alexander-malafeev
alexander-malafeev / ideapad_battery_conservation
Created February 19, 2020 20:51
Script to control battery conservation mode on Lenovo Yoga S940 in Linux. Should work on all ideapad laptops.
#!/bin/bash
# script is based on answers at https://askubuntu.com/questions/1038471/problem-with-lenovo-battery-threshold
# and relies on the module ideapad-laptop
# arguments are status, on and off are self-explanatory
if [ "$1" == "status" ]
then
cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode
elif [ "$1" == "on" ]
then
sudo echo 1 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode
@Therises
Therises / fix_mic_lenovo320.md
Last active September 16, 2024 19:24
Fix microphone on Lenovo IdeaPad 320 on Ubuntu 18.04

In /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf:

  • Under [Element Internal Mic Boost] set volume to zero.
  • Under [Element Int Mic Boost] set volume to zero.
  • Under [Element Mic Boost] set volume to zero

Find your source name from the following command; mine is alsa_input.pci-0000_00_1f.3.analog-stereo

  $ pacmd list-sources | grep 'name:.*input'

Edit /etc/pulse/default.pa and add the following lines, where INPUT_NAME is name of the input source from above step:

####### License: MIT
"""MIT License
Copyright (c) 2015 Aaron Hall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is