You are not logged in.

#1 2016-08-07 04:11:35

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 36
Website

[SOLVED] Arch and i3 Functionality Questions

Hello everyone,

I've recently switched from Ubuntu to Arch and I love it so far. However there was some functionality that Ubuntu had built-in that I'd like to recreate in Arch, but I'm not quite sure how to go about it. Please note that I'm not necessarily asking for step-by-step instructions, please feel free to point me towards any relevant documentation.

I'm using i3-gaps as the WM, LightDM (w/ lightdm-gtk-greeter) as the DM.

I also have i3lock and i3blocks (instead of i3status) running in the i3bar

Also have xscreensaver


1. Lock Screen Functionality

Desired Behavior:
* Keybinding locks when activated (set in i3 config, this I know how to do)
* Turn off monitors and lock after 30 mins of inactivity (but never suspend)
* While locked, display transparent overlay (similar to Ubuntu) or image that is the correct resolution on both monitors (my monitors are two different sizes)
* Unlock upon entering password
* Maybe just not use i3lock at all and use LightDM as both the login greeter and the lock screen, if possible, since that’s what Ubuntu uses and I really like that transparent overlay design

What happens:
* Keybinding is set, no worries there
* Not sure how to set the automatic lock after inactivity, not sure if I should use xscreensaver or something else (still looking through documentation on that)
* When locked, it seems that LightDM and i3lock might be conflicting with each other. Sometimes i3lock works fine, other times upon locking it takes me to the LightDM login screen, then once I enter my password, i3bar disappears although I still seem to have functionality of opening apps and switching between active windows. This persists until reboot, exiting i3 and logging back in does not fix it. Do I have to pick one or the other (LightDM or i3lock)? Do I even need xscreensaver for the purpose of a lock screen?

2. i3bar

Is it possible to get a volume control slider in the i3bar? I’ve gotten the volume display, but as of now I can only change volume by using the keyboard or by opening pavucontrol (pulseaudio is installed). I know it’s kind of against the point of i3, being that the idea is to be keyboard centric, but I would just also like to have a volume slider that I can control with the mouse. If so, would this be done using the display_tray option in i3bar’s config? Can other actual functions be put into i3bar, rather than just text outputs?

Is it possible to get some of the text from i3blocks/i3status to display in the middle of the bar, rather than all the way over to the right?

Is it possible to have some text in i3bar only display on monitor 1, and other text only display on monitor 2?

3. Workspaces

I really like the ranger file manager, but you have to open a terminal to use it. Is it possible to have i3 automatically open a terminal and run ranger on a specified workspace?

Is it also possible to have i3 open several instances of the same app upon start, i.e. if I wanted to have 3 terminals open on workspace 1, a main one on the left and two smaller ones on the right?

Is it possible to have workspaces 1-5 only open on monitor 1, and workspaces 6-10 only open on monitor 2?

4. Other

How can I get Num Lock to come on automatically and stay on persistently? I never have any reason to turn it off so I’d like it to just always be on

Last edited by abdulhakeem (2016-08-10 21:29:12)


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#2 2016-08-07 07:42:13

madhias
Member
Registered: 2015-10-26
Posts: 12
Website

Re: [SOLVED] Arch and i3 Functionality Questions

Regarding point 2: I am using also i3blocks and a volume adjustment setting, which can be adjusted with the mouse. A script in a file called 'volume', which is linked in the .i3blocks.conf. I found it somewhere, since there are many i3blocks settings out there! That's the link to the script in the .i3blocks.conf:

[volume]
command=bash ~/.config/i3/volume
interval=1

The volume file (I have changed the icons in the 'echo' commands to some fancy symbols from awesome font):

#!/bin/bash

# Display the volume in i3bar and enable changing of volume with two-finger
# scrolling over the symbol and toggle mute with right click.

# Get the volume percentage:
VOLUME=$(amixer sget Master | egrep -o -m 1 "[0-9]+%")

# Check if muted:
STATE=`amixer sget Master | egrep -m 1 'Playback.*?\[o' | egrep -o '\[o.+\]'`
# Use mouse to change volume and toggle mute in i3bar:
case $BLOCK_BUTTON in
  1) pavucontrol ;; #urxvt -title "float" -e alsamixer --view all ;;
  # Right click to toggle mute
  3) amixer -q sset Master toggle & ~/.i3/vol-notify ;;
  # Scroll up to increase volume
  4) amixer -q sset Master 5%+ & ~/.i3/vol-notify ;;
  # Scroll down to decrease volume
  5) amixer -q sset Master 5%- & bash ~/.i3/vol-notify ;;
esac

# # What to display in i3bar:
if [[ $STATE == '[off]' ]]; then
        echo " 0%"
        echo ""
        echo "#F2CC66"
        exit 0
else
        VOLNUM=$(echo -e $VOLUME | egrep -o "[0-9]+")
        if [ $VOLNUM -lt "33" ]; then
                echo " "$VOLUME
                exit 0
        elif [ $VOLNUM -lt "66" ]; then
                echo " "$VOLUME
                exit 0
        else
                echo " "$VOLUME
                exit 0
        fi
fi

Offline

#3 2016-08-07 09:54:14

karlch
Member
Registered: 2015-06-14
Posts: 105

Re: [SOLVED] Arch and i3 Functionality Questions

continuing with point 3: You can do something like the following

assign [class="URxvt" instance="ranger"] $ws3
bindsym f exec --no-startup-id urxvtc -name ranger -e ranger

Obviously replace with your keybinding and terminal emulator smile
For loading specific layouts take a look at this and for assigning workspaces to monitors this.

Point 4: https://wiki.archlinux.org/index.php/Ac … _on_Bootup

Offline

#4 2016-08-07 12:16:52

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Arch and i3 Functionality Questions

abdulhakeem wrote:

Also have xscreensaver


1. Lock Screen Functionality

Desired Behavior:
* Keybinding locks when activated (set in i3 config, this I know how to do)
* Turn off monitors and lock after 30 mins of inactivity (but never suspend)
* While locked, display transparent overlay (similar to Ubuntu) or image that is the correct resolution on both monitors (my monitors are two different sizes)
* Unlock upon entering password
* Maybe just not use i3lock at all and use LightDM as both the login greeter and the lock screen, if possible, since that’s what Ubuntu uses and I really like that transparent overlay design

What happens:
* Keybinding is set, no worries there
* Not sure how to set the automatic lock after inactivity, not sure if I should use xscreensaver or something else (still looking through documentation on that)
* When locked, it seems that LightDM and i3lock might be conflicting with each other. Sometimes i3lock works fine, other times upon locking it takes me to the LightDM login screen, then once I enter my password, i3bar disappears although I still seem to have functionality of opening apps and switching between active windows. This persists until reboot, exiting i3 and logging back in does not fix it. Do I have to pick one or the other (LightDM or i3lock)? Do I even need xscreensaver for the purpose of a lock screen?

xscreensaver and i3lock are probably conflicting.

Disable the screen lock function for xscreensaver by adding this line to ~/.Xresources (or ~/.Xdefaults if you use that):

xscreensaver.lock: false

Alternatively, simply run:

xscreensaver-demo

See xscreensaver(1)

Offline

#5 2016-08-07 17:55:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: [SOLVED] Arch and i3 Functionality Questions

2. Workspaces

I do it like this (in the .i3/config file)

exec --no-startup-id feh /home/ewaller/multimedia/photos/Bodie/P1010137.jpg --bg-scale
exec --no-startup-id  compton
exec --no-startup-id i3-msg 'workspace 10; exec thunderbird ; workspace 1'
exec --no-startup-id emacsclient -c
exec --no-startup-id exec mpd

This starts an emacs client window on workspace 1 and Thunderbird on 10.  It also starts compton and mpd, but they are daemons.
If you are using urxvt, you can do this

exec --no-startup-id i3-msg 'workspace 10; exec urxvt -e ranger  ; workspace 1'

It will open an instance of urxvt on workspace 10 and tell it to run ranger as its shell.  It then flips back to workspace 1


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2016-08-08 13:44:32

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 36
Website

Re: [SOLVED] Arch and i3 Functionality Questions

madhias wrote:

Regarding point 2: I am using also i3blocks and a volume adjustment setting, which can be adjusted with the mouse. A script in a file called 'volume', which is linked in the .i3blocks.conf. I found it somewhere, since there are many i3blocks settings out there! That's the link to the script in the .i3blocks.conf:

[volume]
command=bash ~/.config/i3/volume
interval=1

The volume file (I have changed the icons in the 'echo' commands to some fancy symbols from awesome font):

#!/bin/bash

# Display the volume in i3bar and enable changing of volume with two-finger
# scrolling over the symbol and toggle mute with right click.

# Get the volume percentage:
VOLUME=$(amixer sget Master | egrep -o -m 1 "[0-9]+%")

# Check if muted:
STATE=`amixer sget Master | egrep -m 1 'Playback.*?\[o' | egrep -o '\[o.+\]'`
# Use mouse to change volume and toggle mute in i3bar:
case $BLOCK_BUTTON in
  1) pavucontrol ;; #urxvt -title "float" -e alsamixer --view all ;;
  # Right click to toggle mute
  3) amixer -q sset Master toggle & ~/.i3/vol-notify ;;
  # Scroll up to increase volume
  4) amixer -q sset Master 5%+ & ~/.i3/vol-notify ;;
  # Scroll down to decrease volume
  5) amixer -q sset Master 5%- & bash ~/.i3/vol-notify ;;
esac

# # What to display in i3bar:
if [[ $STATE == '[off]' ]]; then
        echo " 0%"
        echo ""
        echo "#F2CC66"
        exit 0
else
        VOLNUM=$(echo -e $VOLUME | egrep -o "[0-9]+")
        if [ $VOLNUM -lt "33" ]; then
                echo " "$VOLUME
                exit 0
        elif [ $VOLNUM -lt "66" ]; then
                echo " "$VOLUME
                exit 0
        else
                echo " "$VOLUME
                exit 0
        fi
fi

No worries, I too have Font Awesome installed wink I'm fine with doing this, but I guess what I'm really looking for is a bar that has actual graphical functionality built-in to it (for lack of a more accurate description). Like for example, if I were to install an entire DE like Cinnamon or MATE, they both have a bar that provides actual functionality like a volume slider, log in/out, network info, etc. I suppose technically i3bar does the same thing, but it's really just text output, whereas a DE bar is...more than just text output (sorry, I don't know what proper terminology I'm looking for). Is there maybe an alternate bar that i3 can use, or is does it HAVE to be i3bar? Like maybe I could install just the Cinnamon or MATE bar without installing the entire DE along with it?




karlch wrote:

continuing with point 3: You can do something like the following

assign [class="URxvt" instance="ranger"] $ws3
bindsym f exec --no-startup-id urxvtc -name ranger -e ranger

Obviously replace with your keybinding and terminal emulator smile
For loading specific layouts take a look at this and for assigning workspaces to monitors this.

Point 4: https://wiki.archlinux.org/index.php/Ac … _on_Bootup


Awesome, I think the layouts thing is exactly what I was looking for. Thanks for the tip!


Head_on_a_Stick wrote:

Disable the screen lock function for xscreensaver by adding this line to ~/.Xresources (or ~/.Xdefaults if you use that):

xscreensaver.lock: false

Alternatively, simply run:

xscreensaver-demo

See xscreensaver(1)


I went ahead and just uninstalled xscreensaver altogether, since it seems that I didn't really need it. But instead I installed xautolock, which seems to function as an automatic locker once inactivity has been detected for x minutes. I'm just not sure if I should add it to i3config, .xinitrc, or Xresources. I'm still not entirely clear on what Xresource's purpose is, I've read the Wiki page for it a few times but I still don't really get it. Like I get that it's a config file but I don't understand why some programs have their own config file (i3, for example) and others use Xresources (like Rofi). And does Xresources affect ALL Xapplications? Or only the ones that specifically use Xresources? How do I know what should go in i3config and what should go in Xresources? If I understand correctly, .xinitrc is just for starting X so it really has nothing to do with any configuration of apps once X has already started, right?

I'm also not entirely sure what screensaver/lock screen to use, according to the Wiki it seems that only sflock, physlock, Cinnamon Screensaver, MATE Screensaver and GNOME Screensaver are able to block tty access, and the point of a lock screen so that the computer can't be accessed by others when you're not using it, right? So I'm not even sure if I should be using i3lock. But what I'm looking to do is have both the login screen and lock screen be consistent, like in Ubuntu how the login and lock screens are basically the same. And I also like how they're both basically a transparent overlay of the desktop. Since Ubuntu uses LightDM I thought I might be able to recreate this in Arch with LightDM, but so far I haven't found/figured out how. Right now it's a default LightDM login screen with i3lock that doesn't display a lock image properly due to my monitors being two different sizes, so my machine just feels like a mashed together Frankenstein monster, rather than a consistent, cohesive system.


ewaller wrote:

2. Workspaces

I do it like this (in the .i3/config file)

exec --no-startup-id feh /home/ewaller/multimedia/photos/Bodie/P1010137.jpg --bg-scale
exec --no-startup-id  compton
exec --no-startup-id i3-msg 'workspace 10; exec thunderbird ; workspace 1'
exec --no-startup-id emacsclient -c
exec --no-startup-id exec mpd

This starts an emacs client window on workspace 1 and Thunderbird on 10.  It also starts compton and mpd, but they are daemons.
If you are using urxvt, you can do this

exec --no-startup-id i3-msg 'workspace 10; exec urxvt -e ranger  ; workspace 1'

It will open an instance of urxvt on workspace 10 and tell it to run ranger as its shell.  It then flips back to workspace 1


I use Termite but AFAIK it's very similar to urvxt right?

I don't quite understand what the --no-startup-id flag does. I've found it in the i3 docs (https://i3wm.org/docs/userguide.html#exec) but I still don't quite get it.

The --no-startup-id parameter disables startup-notification support for this particular exec command. With startup-notification, i3 can make sure that a window appears on the workspace on which you used the exec command.

What is the startup-notification? Is that like when you get an urgent-window or urgent-workspace? Aside from that I don't think I've ever noticed any sort of startup notification from anything.

Last edited by abdulhakeem (2016-08-08 13:56:35)


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#7 2016-08-08 13:56:16

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: [SOLVED] Arch and i3 Functionality Questions

abdulhakeem wrote:

...I don't quite understand what the --no-startup-id flag does. I've found it in the i3 docs (https://i3wm.org/docs/userguide.html#exec) but I still don't quite get it.

The --no-startup-id parameter disables startup-notification support for this particular exec command. With startup-notification, i3 can make sure that a window appears on the workspace on which you used the exec command.

What is the startup-notification? Is that like when you get an urgent-window or urgent-workspace? Aside from that I don't think I've ever noticed any sort of startup notification from anything.

When an application starts, the cursor is usually changed from a pointer to a "wait" cursor.  Spinning dials, hour glasses, whatever. It does that until the application initializes its GUI, or until i3 times out.  The no-startup-id flag causes i3 to just fire and forget -- it does not change the cursor.  The program will just silently start with no other visual indication.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2016-08-08 13:58:47

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 36
Website

Re: [SOLVED] Arch and i3 Functionality Questions

ewaller wrote:
abdulhakeem wrote:

...I don't quite understand what the --no-startup-id flag does. I've found it in the i3 docs (https://i3wm.org/docs/userguide.html#exec) but I still don't quite get it.

The --no-startup-id parameter disables startup-notification support for this particular exec command. With startup-notification, i3 can make sure that a window appears on the workspace on which you used the exec command.

What is the startup-notification? Is that like when you get an urgent-window or urgent-workspace? Aside from that I don't think I've ever noticed any sort of startup notification from anything.

When an application starts, the cursor is usually changed from a pointer to a "wait" cursor.  Spinning dials, hour glasses, whatever. It does that until the application initializes its GUI, or until i3 times out.  The no-startup-id flag causes i3 to just fire and forget -- it does not change the cursor.  The program will just silently start with no other visual indication.

Oooh okay, gotcha. Why doesn't the i3 documentation just say that tongue I guess they assume the reader isn't retarded


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#9 2016-08-09 01:50:40

aposteeltje
Member
From: Netherlands
Registered: 2013-01-29
Posts: 11

Re: [SOLVED] Arch and i3 Functionality Questions

3. Workspaces:

I setup myworkspaces like this:

# set the workspaces
set $workspace1 "Main "
set $workspace2 "Web "
set $workspace3 "Edit "
ETC

# Place the workspaces
workspace "Main " output HDMI1
workspace "Web " output HDMI1
workspace "Edit " output LVDS1
ETC

# switch to workspace
bindsym Mod1+1 workspace $workspace1
bindsym Mod1+2 workspace $workspace2
bindsym Mod1+3 workspace $workspace3
ETC

# move focused container to workspace
bindsym Mod1+Shift+1 move container to workspace $workspace1
bindsym Mod1+Shift+2 move container to workspace $workspace2
bindsym Mod1+Shift+3 move container to workspace $workspace3
ETC

Now,when you want a program to get started on a specific workspace,
you define that as follows:

# Workspace assignment.
assign [class="Terminator"] → Terminal 
assign [class="Kmix"] → 5
assign [class="Firefox"] → Web 
ETC

As for NUMLOCK:
install numlockx
and edit in your config:
exec --no-startup-id numlockx on

Last edited by aposteeltje (2016-08-09 01:56:43)

Offline

#10 2016-08-10 20:09:55

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Arch and i3 Functionality Questions

abdulhakeem wrote:

I'm still not entirely clear on what Xresource's purpose is

In the X Window System, the X resources are parameters of computer programs such as the name of the font used in the buttons, the background color of menus, etc. They are used in conjunction with or as an alternative to command line parameters and configuration files.

https://en.wikipedia.org/wiki/X_resources

does Xresources affect ALL Xapplications? Or only the ones that specifically use Xresources?

No and yes, respectively.

How do I know what should go in i3config and what should go in Xresources?

i3config is for configuring the i3 window manager; we have already covered Xresources, I believe smile

If I understand correctly, .xinitrc is just for starting X so it really has nothing to do with any configuration of apps once X has already started, right?

Yes.

my machine just feels like a mashed together Frankenstein monster, rather than a consistent, cohesive system.

Yes, welcome to Arch smile

Things will improve as you learn your way around and hone your system over time.

Offline

#11 2016-08-10 21:28:59

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 36
Website

Re: [SOLVED] Arch and i3 Functionality Questions

Thanks for the help everyone!


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

#12 2016-08-21 19:25:18

abdulhakeem
Member
From: Chicagoland
Registered: 2016-07-31
Posts: 36
Website

Re: [SOLVED] Arch and i3 Functionality Questions

madhias wrote:

Regarding point 2: I am using also i3blocks and a volume adjustment setting, which can be adjusted with the mouse. A script in a file called 'volume', which is linked in the .i3blocks.conf. I found it somewhere, since there are many i3blocks settings out there! That's the link to the script in the .i3blocks.conf:

[volume]
command=bash ~/.config/i3/volume
interval=1

The volume file (I have changed the icons in the 'echo' commands to some fancy symbols from awesome font):

#!/bin/bash

# Display the volume in i3bar and enable changing of volume with two-finger
# scrolling over the symbol and toggle mute with right click.

# Get the volume percentage:
VOLUME=$(amixer sget Master | egrep -o -m 1 "[0-9]+%")

# Check if muted:
STATE=`amixer sget Master | egrep -m 1 'Playback.*?\[o' | egrep -o '\[o.+\]'`
# Use mouse to change volume and toggle mute in i3bar:
case $BLOCK_BUTTON in
  1) pavucontrol ;; #urxvt -title "float" -e alsamixer --view all ;;
  # Right click to toggle mute
  3) amixer -q sset Master toggle & ~/.i3/vol-notify ;;
  # Scroll up to increase volume
  4) amixer -q sset Master 5%+ & ~/.i3/vol-notify ;;
  # Scroll down to decrease volume
  5) amixer -q sset Master 5%- & bash ~/.i3/vol-notify ;;
esac

# # What to display in i3bar:
if [[ $STATE == '[off]' ]]; then
        echo " 0%"
        echo ""
        echo "#F2CC66"
        exit 0
else
        VOLNUM=$(echo -e $VOLUME | egrep -o "[0-9]+")
        if [ $VOLNUM -lt "33" ]; then
                echo " "$VOLUME
                exit 0
        elif [ $VOLNUM -lt "66" ]; then
                echo " "$VOLUME
                exit 0
        else
                echo " "$VOLUME
                exit 0
        fi
fi

Do you know where the volume script is located by default? There isn't one in ~/.config/i3

EDIT: nvm found it

Last edited by abdulhakeem (2016-08-21 19:26:26)


And the worldly life is not but amusement and diversion; but the home of the Hereafter is best for those who fear Allah, so will you not reason? {6:32}

Offline

Board footer

Powered by FluxBB