You are not logged in.

#726 2012-08-09 16:06:48

D.
Member
Registered: 2012-05-15
Posts: 64

Re: The i3 thread

Thanks a lot teateawhy and Trilby. I was starting to think this functionality would be nice.

Edit: I'd like (to try) a (number)-pixel border, is there an easy way to do this? I haven't been able to find one...

Last edited by D. (2012-08-09 17:51:06)

Offline

#727 2012-08-15 01:25:39

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: The i3 thread

Isola wrote:

Is there a way to make unfocused windows slightly transparent in combination with a composition manager, like xcompmgr and cairo-compmgr?

Check if the compositor itself has an option; compton has -i, for instance.

Offline

#728 2012-08-15 21:34:47

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: The i3 thread

ZekeSulastin wrote:
Isola wrote:

Is there a way to make unfocused windows slightly transparent in combination with a composition manager, like xcompmgr and cairo-compmgr?

Check if the compositor itself has an option; compton has -i, for instance.

I tried compton, and while it works in all WMs I tried, it doesn't work as expected in i3. Thank you anyway


Back to my progress in i3

I also discovered I had "black bars" around some transparent URxvt windows just like another user had in this thread. I "solved" this by using my wallpaper as the background image for URxvt with the following settings in ~/.Xdefaults

URxvt*backgroundPixmap:    /home/me/picture/wallpaper.png\;style=root-tiled

Then to simulate the "focused window is 0% transparent, others are 50%" effect I also have these settings:

URxvt*fading:              50
URxvt*fadeColor:           #292929

The fadeColor is very similar to the average color of my wallpaper, so it blends in pretty well




I've also put together a ugly little bash script to pull up a dmenu with the title of all the windows. The selected window in dmenu will be focused.

#!/bin/bash
DMENU_OPTS="-fn -*-proggyoptis-*-*-*-*-*-*-*-*-*-*-*-* -nb #292929 -nf #a3a3a3 -sb #383738 -sf #bababa -b -l 18 -p $(basename $0)"

# Present a menu with all windows
TITLE="$(i3-msg -t get_tree | python -mjson.tool | sed -n -e 's/^ \{35\}[ ]\+\"name\": \"\(.*\)\", $/\1/p' | sed '/^#[a-F0-9]\{6\}$/d' | dmenu $DMENU_OPTS)"

if [ -z "$TITLE" ] ; then
   exit 1
fi

# Escape some characters to prevent i3 to interpret them as a pattern
# "(" and ")" replaced with "\(" and "\)"
TITLE="$(echo "$TITLE" | sed 's/\([()]\)/\\\1/g')"

# Focus window
i3-msg "[title=\"$TITLE\"] focus"

Someone can probably rewrite this in a language that can parse json easily. I hope someone finds it helpful anyway!

Offline

#729 2012-08-16 02:06:12

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: The i3 thread

Isola wrote:

I also discovered I had "black bars" around some transparent URxvt windows just like another user had in this thread. I "solved" this by using my wallpaper as the background image for URxvt with the following settings in ~/.Xdefaults

I wound up adding the patch from rxvt-unicode-noinc to rxvt-unicode-patched (both in the aur) - now it works great using the usual pixmap big_smile

I probably missed it in the 700-odd posts here, but is there any in-i3 method to get a transparent status bar, or should I start looking at alternatives to i3bar? I know it's stupid eye-candy, but I do want just a little bit ;-;

Last edited by ZekeSulastin (2012-08-16 03:43:08)

Offline

#730 2012-08-17 17:37:48

StR@ng3r
Member
Registered: 2011-11-12
Posts: 61

Re: The i3 thread

I was wondering if it is possible to "overlay" the i3bar with dzen2 but just for the space between workspaceindicators and tray-icons?

Offline

#731 2012-08-22 14:39:13

booglybear
Member
Registered: 2012-08-22
Posts: 1

Re: The i3 thread

hey guys if anyone is having issues with the rxvt with borders or padding issues i added a package on the AUR url is https://aur.archlinux.org/packages.php?ID=62206

this should fix the issue

Last edited by booglybear (2012-08-22 14:59:44)

Offline

#732 2012-08-30 04:13:24

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

Hello everyone,

After trying to use awesome window manager and failing to get the widgets and what I wanted up and running (probably due to my lack of interest in learning lua), I've decided to switch to i3.

So far, everything is going much better, but I am still having problems with:

1) Is it possible to have a bindsym action that starts, say ALSA in terminal, after you press it? I know you can easily do it with other applications by using exec ..., but I am unsure of how to issue "secondary commands" if you will.
2) I'm confused about how to get several virtual desktops to begin, within which respective programs automatically begin. So 1 could be internet and opens firefox on i3 startup, 2 could be programming and opens up a terminal and gvm, etc.
and
3) Less important, is it possible to make windows slightly transparent so that you can still see the background?

Thanks for reading, and I appreciate any replies to my questions.

- Peter

Offline

#733 2012-08-30 04:21:21

progandy
Member
Registered: 2012-05-17
Posts: 2,151

Re: The i3 thread

3) Less important, is it possible to make windows slightly transparent so that you can still see the background?

Maybe with a composite manager like xcompmgr, compton or Cairo Compmgr

Offline

#734 2012-08-30 04:37:06

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

progandy wrote:

3) Less important, is it possible to make windows slightly transparent so that you can still see the background?

Maybe with a composite manager like xcompmgr, compton or Cairo Compmgr

I might look more into this once I get the majority of everything set up then.

Offline

#735 2012-08-30 09:43:45

hume's doona
Member
Registered: 2009-12-11
Posts: 206

Re: The i3 thread

PPeter wrote:

Hello everyone,
h:

1) Is it possible to have a bindsym action that starts, say ALSA in terminal, after you press it? I know you can easily do it with other applications by using exec ..., but I am unsure of how to issue "secondary commands" if you will.

I just use scripts, then exec /home/scripts.script.sh [that obviosuly has your secondary commands therein]

Don't know if there is a better way

Offline

#736 2012-08-30 09:48:28

idx
Member
Registered: 2009-07-22
Posts: 34

Re: The i3 thread

hume's doona wrote:
PPeter wrote:

Hello everyone,
h:

1) Is it possible to have a bindsym action that starts, say ALSA in terminal, after you press it? I know you can easily do it with other applications by using exec ..., but I am unsure of how to issue "secondary commands" if you will.

I just use scripts, then exec /home/scripts.script.sh [that obviosuly has your secondary commands therein]

Don't know if there is a better way

If you use uxrvt, you can simply add the -e argument. E.g. to start htop in a new terminal

urxvt -e htop

Not sure whether other terminal emulators have a similar option.

Offline

#737 2012-08-30 11:02:34

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,812
Website

Re: The i3 thread

Ever terminal I've used has an option like that.  For quite of a few of them it is "-e".

Note that in some cases, to get the proper environment variables passed you may need something like:

urxvt -e "/bin/bash -i -c vim"

To launch vim in urxvtc.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#738 2012-08-30 11:48:46

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: The i3 thread

PPeter wrote:

2) I'm confused about how to get several virtual desktops to begin, within which respective programs automatically begin. So 1 could be internet and opens firefox on i3 startup, 2 could be programming and opens up a terminal and gvm, etc.

Try something like that:

# launch firefox on startup
exec firefox

# open firefox windows on workspace 1
assign [class="^Firefox"] → 1

If you want a new terminal on a specific workspace but do not want to open all terminals on this workspace, here is a way with urxvt:

# start urxvt with a specific instance name
# xprop on that instance will return WM_CLASS(STRING) = "programming", "URxvt"
exec urxvt -name programming

assign [class="^URxvt$" instance="^programming$"] → 2

Offline

#739 2012-08-30 20:37:47

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

PotatoesMaster wrote:
PPeter wrote:

2) I'm confused about how to get several virtual desktops to begin, within which respective programs automatically begin. So 1 could be internet and opens firefox on i3 startup, 2 could be programming and opens up a terminal and gvm, etc.

Try something like that:

# launch firefox on startup
exec firefox

# open firefox windows on workspace 1
assign [class="^Firefox"] → 1

If you want a new terminal on a specific workspace but do not want to open all terminals on this workspace, here is a way with urxvt:

# start urxvt with a specific instance name
# xprop on that instance will return WM_CLASS(STRING) = "programming", "URxvt"
exec urxvt -name programming

assign [class="^URxvt$" instance="^programming$"] → 2

I tried this with the following:

exec firefox -name fox1
assign [class="^Firefox$" instance="^fox1$"] → 2: I-Net

exec urxvt -name term1
exec gvim -name gvim1
assign [class="^URxvt$" instance="^term1$"] → 3: Prog
assign [class="^Gvim$" instance="^gvim1$"] → 3: Prog

exec gimp -name gimp1
assign [class="^Gimp$" instance="^gimp1$"] → 4: Gimp

Except, firefox would start on the first desktop, urxvt and gvim would properly start on 3: Prog, and gimp wouldn't even start. Regardless of what I tried, firefox and gimp would not begin how I wanted it to begin.

Offline

#740 2012-08-30 22:28:18

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: The i3 thread

@PPeter:
gimp and firefox have no -name option (I didn't know gvim has a such option wink).

exec firefox
assign [class="^Firefox$"] → 2: I-Net

exec urxvt -name term1
exec gvim -name gvim1
assign [class="^URxvt$" instance="^term1$"] → 3: Prog
assign [class="^Gvim$" instance="^gvim1$"] → 3: Prog

exec gimp
assign [class="^Gimp$"] → 4: Gimp

Offline

#741 2012-08-30 23:15:46

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 151

Re: The i3 thread

PotatoesMaster wrote:
PPeter wrote:

2) I'm confused about how to get several virtual desktops to begin, within which respective programs automatically begin. So 1 could be internet and opens firefox on i3 startup, 2 could be programming and opens up a terminal and gvm, etc.

Try something like that:

# launch firefox on startup
exec firefox

# open firefox windows on workspace 1
assign [class="^Firefox"] → 1

I don't know how i3 exactly works, but this seems to have two problems:

  • There's a race-condition: firefox is executed first and then the assing-rule is created, so it may happen that firefox is faster. The fix is to swap the exec and the assign line. (Or is there no problem because all assign-settings are applied after the configuration is read entirely?)

  • It doesn't only assign the first Firefox instance on startup to workspace 1, but *all* firefox windows that are opened. (I don't know how to fix this in i3)

Offline

#742 2012-08-30 23:20:27

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

PotatoesMaster wrote:

@PPeter:
gimp and firefox have no -name option (I didn't know gvim has a such option wink).

Guess I got lucky with this one smile

exec firefox
assign [class="^Firefox$"] → 2: I-Net

exec urxvt -name term1
exec gvim -name gvim1
assign [class="^URxvt$" instance="^term1$"] → 3: Prog
assign [class="^Gvim$" instance="^gvim1$"] → 3: Prog

exec gimp
assign [class="^Gimp$"] → 4: Gimp

Is there someway to "de-assign" a class from a workspace? After it opens the first one, I want to be able to open it at any desktop afterwards (so have the initial firefox on 2: I-Net, and then any other ones on whatever desktop I currently am on).
Is there a faster way to check whether I'd be able to change the instance name? Using gvim and urxvt as examples, when I checked the man page for urxvt, I saw the option -name, but not for the vim man page.

Last edited by PPeter (2012-08-31 00:19:09)

Offline

#743 2012-08-31 12:58:06

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: The i3 thread

thorsten wrote:
  • There's a race-condition: firefox is executed first and then the assing-rule is created, so it may happen that firefox is faster. The fix is to swap the exec and the assign line. (Or is there no problem because all assign-settings are applied after the configuration is read entirely?)

All exec statements are executed after the config file is entirely read (in cfgparse.y, there is a loop over an autostart list at the end of the config load function).

PPeter wrote:

Is there someway to "de-assign" a class from a workspace? After it opens the first one, I want to be able to open it at any desktop afterwards (so have the initial firefox on 2: I-Net, and then any other ones on whatever desktop I currently am on).

There is no "de-assign" command. The behaviour you want can be achieved with an external script.

Here is an example of autostart script: https://github.com/fhaun/config-misc/bl … art-for-i3 (found at i3 FAQ).

You could have a script like that:

#!/bin/bash
# requires xdotool

# Wait for program coming up
wait_for_program () {
    n=0
    while (( n++ < 20 )) ; do
        # PID of last background command
        xdotool search --onlyvisible --pid $! && return
        sleep 1
    done
    # timeout
    xmessage "Error on executing"
}

firefox &
wait_for_program

i3-msg '[class="^Firefox$"] focus ; move workspace 2: I-Net'

and execute at i3 start with an exec statement (there is no need for assign statement then).

PPeter wrote:

Is there a faster way to check whether I'd be able to change the instance name? Using gvim and urxvt as examples, when I checked the man page for urxvt, I saw the option -name, but not for the vim man page.

vim.org/docs.php big_smile wrote:

The most useful software is sometimes rendered useless by poor or altogether missing documentation.

The faster way is indeed checking the documentation.

EDIT: corrected example script

Last edited by PotatoesMaster (2012-09-02 00:25:29)

Offline

#744 2012-09-01 23:42:14

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

You could have a script like that:

#!/bin/bash
# requires xdotool

# Wait for program coming up
wait_for_program () {
    n=0
    while (( n++ < 20 )) ; do
        # PID of last background command
        xdotool search --onlyvisible --pid $! && return
    done
    # timeout
    xmessage "Error on executing"
}

firefox &
wait_for_program

i3-msg '[class="^Firefox$"] focus ; move workspace 2: I-Net'

and execute at i3 start with an exec statement (there is no need for assign statement then).

I tried running this script, but it wouldn't work (and yes I installed xdotool before someone asks me if I did smile )

Offline

#745 2012-09-02 00:36:53

PotatoesMaster
Member
From: France
Registered: 2010-08-26
Posts: 54

Re: The i3 thread

@PPeter:
I added the missing line in my previous post. Runs fine now.

Offline

#746 2012-09-02 01:34:17

PPeter
Member
Registered: 2012-08-21
Posts: 17

Re: The i3 thread

PotatoesMaster, you are a godsend. It's working now. And you've convinced me to learn bash script myself. Thanks for all the help.

Offline

#747 2012-09-02 15:19:49

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: The i3 thread

I have a three more questions

The title of some windows become "another container". Is it possible to change this title somehow?

In some situations when I close a window I end up with the most parent window focused. Is there a way to change this behavior to focus "last focused window" or similar?

Is there a way to make the workspaces permanent showing or at least order them in alphanum order?

Offline

#748 2012-09-02 16:02:05

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,048
Website

Re: The i3 thread

A note concerning the startup of terminal applications in urxvt:
If you run mutt on startup and want to move it to workspace mail you need two commands.

exec urxvt -e mutt
assign [title="mutt$"] 10:mail

For urxvt you do not need the -title option, because the title is set to the command name, in this case "mutt" in any way.

Offline

#749 2012-09-02 16:41:43

D.
Member
Registered: 2012-05-15
Posts: 64

Re: The i3 thread

Isola wrote:

Is there a way to make the workspaces permanent showing or at least order them in alphanum order?

To show them in order, start their names with a number. For example, I have

set $1 1: main
set $2 2: term
set $3 3: www
...

as my workspace names. Workspaces that start with a number are shown in order. Don't know about making them permanent...

Offline

#750 2012-09-02 17:30:28

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: The i3 thread

D. wrote:
Isola wrote:

Is there a way to make the workspaces permanent showing or at least order them in alphanum order?

To show them in order, start their names with a number. For example, I have

set $1 1: main
set $2 2: term
set $3 3: www
...

as my workspace names. Workspaces that start with a number are shown in order. Don't know about making them permanent...

Thank you, this works! I just saw in the documentation that if a workspace is prefixed with a number it's treated differently

Offline

Board footer

Powered by FluxBB