Showing posts with label Window Manager. Show all posts
Showing posts with label Window Manager. Show all posts

Wednesday, September 28, 2016

Refined brightness with i3-WM and i3blocks

I'm a picky person and it decided it was high time to clean up the display for my brightness in i3blocks.


In order to control my brightness via the keyboard, I found that I needed to create a bindsym using xbacklight to reflect this in my ~/.config/i3/config. I chose to increase and decrease xbacklight by 10%.

Initial bindsym:


#Brightness controls
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10 ; pkill -RTMIN+1 i3blocks"
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10 ; pkill -RTMIN+1 i3blocks"


The problem I found with this is that xbacklight increases and decreases based on percentage values of the total maximum brightness for the screen, which on my system is 937. This meant that if i3blocks displayed my brightness at 100% and then I decreased it by 10%, the next value displayed was 89%. This bothered me for no other reason than I am pretty neurotic.

The other problem is that at night-time, I wanted to be able to easily set my brightness to just slightly above 0% to reduce strain on my eyes while using my laptop in total darkness. I also wanted to be able to turn my screen off using the brightness controls because my partner enjoys listening to netflix shows with the screen off while she's trying to sleep. At the settings I had initially, I could turn the screen off but once I increased the brightness, it increased to a value of 9, which is too bright for an initial value in my opinion. To solve this, I wrote two bash scripts to handle the brightness and ensure the output of multiples of ten.

To increase screen brightness:


#!/bin/bash
#Created by Brian Winkler

#This script is free to use and modify as your own

#Check out my blog at https://nuxview.blogspot.com/


STATUS="$(xbacklight -get)"
CHECK="${STATUS}"

if [[ $CHECK == 0.000000 ]]

then
 xbacklight -inc 1
 pkill -RTMIN+1 i3blocks

else
 xbacklight -inc 10
 pkill -RTMIN+1 i3blocks
fi


This script checks if the brightness value is at its lowest and if it is, increases the brightness by a value of 1. Otherwise, it increases the brightness by a value of 10.


To decrease screen brightness:


#!/bin/bash
#Created by Brian Winkler
#This script is free to use and modify as your own
#Check out my blog at https://nuxview.blogspot.com/

STATUS="$(xbacklight -get)"
CHECK="${STATUS}"

if [[ $CHECK == 100.000000 ]]

then
 xbacklight -dec 9
 pkill -RTMIN+1 i3blocks

else
 xbacklight -dec 10
 pkill -RTMIN+1 i3blocks
fi

This script checks if the brightness is all the way up and if it is, decreases it by a value of 9. Otherwise, it decreases the brightness by a value of 10.


For both of these scripts, pkill -RTMIN+1 i3blocks makes it so I can set my interval to once in the brightness display command in i3blocks.conf and then whenever I change the brightness, it automatically reloads the brightness display.


So now my i3blocks brightness block is using only multiples of ten and allows for me to turn my brightness off and when I turn it on, it first sets the brightness to the lowest possible value.

I then made these scripts executable using chmod +x and copied them to /usr/local/bin/ and named them brightinc and brightdec respectively.


My new ~/.config/i3/config looks like this:


#Brightness controls
bindsym XF86MonBrightnessUp exec brightinc
bindsym XF86MonBrightnessDown exec brightdec


These scripts as also available on my i3blocks github.


If you have any questions or comments, please feel free to contact me or to comment here. I would love to hear from you!










StumbleUpon

Monday, September 5, 2016

i3Blocks for the i3WM

I've recently removed GNOME entirely and am using the i3 Window Manager as my daily driver with pleasing results. You can read my review of the i3 Window Manager here.

Through utilizing the i3blocks-git package in the AUR, I've been able to achieve a level of customization for the i3 bar that I'm finding very satisfying.

i3 bar customized with i3 blocks in the i3 Window Manager


I'm using both the default i3 blocks scripts along with Anachron's scripts and some personalized ones. Anachron's scripts provided me with the ability to increase and decrease my volume by clicking on the icon, increase and decrease my brightness by clicking on the icon, etc. Check out Anacron's scripts for some well written scripts to improve the already great i3 blocks!

Scripts can be added to /usr/lib/i3blocks/ and made executable using chmod +x. Then, these scripts can be called by adding them to the ~/.i3blocks.conf text file.

Please feel free to share your own i3 blocks set-up here!



StumbleUpon

Wednesday, August 10, 2016

The i3 Tiling Window Manager: A Short Review

When I first head someone talking about "the i3", I immediately pictured Intel processors and was confused as to why someone was expressing so much satisfaction for what I consider to be a very basic processor. Boy was I wrong.

The i3 Tiling Window Manager is the epitome of efficiency on the Linux desktop. With just a terminal running, the environment is taking up a mere 186MB of memory; GNOME clocks in at just under 800MB. Since it's a window manager and not a full desktop environment, its also taking up less of the processor. On first boot, this is noticeable. Everything runs faster. Windows load quicker, web pages load more immediately, applications open without hesitation, and steam runs without any stuttering.

i3 is available in the Arch Linux repos. I recommend also installing 'dmenu', as i3 relies heavily on it in order to function as intended.

As opposed to editing my '~/.xinitrc' configuration, I chose to launch this Window Manager utilizing:


startx /usr/bin/i3


Since i3 is focused on efficiency, most tasks can be accomplished on i3 without using a cursor at all. The manager relies on a series of keyboard shortcuts to optimize workflow efficiency and of course, there is a learning curve. For me, its taken about an hour of consistent use to feel like I can practically apply the shortcuts in an efficient manner.

i3 Window Manager




Everything centers around the 'modifier' button, which can be chosen on first boot or later can be configured in the /.config/ files. I chose the windows key as this is already the key I most heavily depend on in GNOME.  From here, you can use either the default shortcuts or you can configure your own.

Some examples of default shortcuts:

'mod' + 'enter' = New terminal window

'mod' + 'arrow key' = Moves window focus

'mod' + 'v' = Opens next window vertically in the current work-space

'mod' + 'h' = Opens next window horizontally in the current work-space

'mod' + 'd' = Opens dmenu to search for applications to launch

'mod' + 'number' = Switches to work-space 'number'

'mod' + 'shift' + 'number' = Sends the current window to work-space 'number'

'mod' + 'shift' + 'q' = Quits current application


'mod' + 'shift' + 'arrow key' = Move the current window around the work-space.

'mod' + 'shift' + 'e' = Exit i3

For more shortcuts, you can read the config files. You can also set custom shortcuts bound to applications.


Simplicity is the name of the game here. At the bottom of the screen you'll see which work-space you are currently operating in, the amount of disk space available, VPN status, WiFi status, Ethernet status, Battery percentage and time, and the time and date.

i3 window manager



Once you have mastered the basics, combining these shortcuts rapidly will create efficiency like never seen before in your desktop. Coupled with the speed from how light-weight it operates, I can see this window manager becoming my daily driver on my laptop running Arch, Though I will keep GNOME around for when I need to show off how beautiful Linux can be to those I'm trying to convert.

Please feel free to comment and share your own experience with i3 along with any questions/comments!




StumbleUpon