Git Product home page Git Product logo

i3wm-scripts's Introduction

Scripts for running i3 window manager on laptop

This repo includes configuration, scripts and commands needed to get i3 window manager to work better on a laptop. Tested on i3 v4.13 running on Arch Linux, but these tips should work on other Linux systems as well.

i3 config

See the dotfiles repo for example config.

When HDMI connects, fix monitor setup and HDMI audio

To configure Alsa to use HDMI sound when connected, edit the asound.hdmi-connected script in the hdmi-switch/ folder, and then run the install.sh script. The hdmi-switch.sh script is run each time the HDMI cable is connected or disconnected, and also runs xrandr.

An answer on StackExchange provides help on finding the correct Alsa device and card.

TODO: switch to Pulseaudio?

Lock on suspend (when closing laptop lid)

The following requires that you're using systemd-logind. Add the file /etc/systemd/system/i3lock.service with the following contents, replacing USERNAME with your user:

[Unit]
Description=i3lock on suspend
Before=sleep.target

[Service]
User=<USERNAME>
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -c 141414

[Install]
WantedBy=sleep.target

Dimming screen when on battery, monitor off

Add the file /etc/pm/power.d/performance with the following contents;

#!/bin/sh

if [ "$1" = "true" ]
then 
    # Battery
    # Dim screen
    echo 13 > /sys/class/backlight/acpi_video0/brightness
    # 300s before standby and suspend, 60s monitor off
    xset dpms 100 100 100
else
    # AC
    # Full brightness
    echo 15 > /sys/class/backlight/acpi_video0/brightness
    # 300s before standby suspend and monitor off
    xset dpms 300 300 300
fi

Remember to chmod u+x /etc/pm/power.d/performance afterwards.

i3wm-scripts's People

Contributors

ruudud avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.