News

Awesome 3.4.9 available in Mageia

Added by Rémy CLOUARD 11 months ago

I’m very glad to announce that awesome is available in Mageia since last week :-)

I finally found a way to solve the cairo-xcb issue. Basically I just duplicated cairo’s package and created a cairo-xcb one. But then I had to ensure the standard cairo would be prefered over cairo-xcb, which turned out to be quite easy, by adding it to /etc/urpmi/prefer.vendor.list.

So now, I’m not sure this section of my website will be very active wrt awesome packaging, it will just hold my config in case you’re interested :-)

I keep older versions of awesome for reference, but you’re encouraged to use the packaged one !

I also took that opportunity to package shifty and vicious for Mageia, the latter one being suggested when you install awesome.

Moving to zsh (1 comment)

Added by Rémy CLOUARD almost 2 years ago

I won’t debate over the advantages of zsh over the other shells, this has always been said multiple times

What I wanted to show is my first steps with this shell.
To begin with, I wanted to customize my prompt and make it VCS aware :)

(You can see an screenshot here)

I’ve found several documentations about zsh prompts and vcs implementations

and I wanted to build my own prompt, and to understand some of what I call zshism, though the intro doc already gives a good overview.

My whole configuration is available on this repository, which turns out to be not only my awesome configs but also my public dotfiles :)

so let’s explain what I did (not that clean, but its usable):

setopt prompt_subst
autoload colors
colors

This is mandatory for the prompt to work. The first line allows variable to be interpreted and the other two allow the use of colours
# define some colour variables to avoid cluttering the command prompt
for color in red green yellow blue magenta cyan white
do
    eval C_$color="%{$fg[$color]%}" 
    eval CB_$color="%{$terminfo[bold]$fg[$color]%}" 
done
C_reset="%{$terminfo[sgr0]%}" 
# define a reset var
fSep="$CB_blue:$C_reset" 

The syntax here is a bit different from bash, but I like it better, because you can have access to the escape sequences through an associative array which is just way better than putting directly your escape sequences or using tput.
# define brackets
oBr="$CB_cyan—$C_reset$C_magenta($C_reset" 
cBr="$C_magenta)$CB_cyan—$C_reset" 


This is just decorative, but I like it
autoload -Uz vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr   "$C_red"    # red color indicates unstaged changes
zstyle ':vcs_info:*' stagedstr     "$C_green"  # green color indicates staged changes
zstyle ':vcs_info:*' formats       \
        '%u%c' '%s' '%b' '%S'

This is the interesting part: zsh has built-in support for many vcses, see the online doc for more information

The first command just loads the module

The next three allows to gather information about your tree, beware, it can be slow, disable it if you work on large repositories (the doc explains how to achieve this)

The last part takes a list of formats and returns it in ${vcs_info_msg_N_} (see below)

precmd () {

    # declare local variables
    typeset fsScm="" 

    # revrieve info from vcs
    vcs_info

    # get status
    cSt="${vcs_info_msg_0_}" 


This part starts the precmd function and you see an example of the use of the variables you can get. This part just returns the status of your tree (dirty, staged changes). You’ll see below why I need this in my prompt
    # set a prompt character according to the used scm
    fsScm="${vcs_info_msg_1_}" 
    case $fsScm in

Here I get the vcs in use in the directory where I am.
        "git")
            vBr="${vcs_info_msg_2_}" 
            pCh="$cSt±$C_reset" 
            ;;
        "hg")
            vBr="${vcs_info_msg_2_}" 
            pCh="$cSt∂$C_reset" 
            ;;
        "svn")
            vBr="${vcs_info_msg_2_}" 
            pCh="$cSt∫$C_reset" 
            ;;

as you can see, I set a different char that reminds the vcs logo.
This character is colorized differently according to its state (works great for git, not for mercurial :/)
        *)
            vBr="" 
            pCh="$C_reset%%" 
            ;;
    esac

and this is to set up the standard % if I’m not in any of the previous vcs.
    # set different colours according to user/host
    case $USER in
        "root")
            aUsr="$C_red%n" 
            ;;
        "shikamaru")
            aUsr="$C_green%n" 
            ;;
        *)
            aUser="$C_yellow%n" 
            ;;
    esac
    case $HOSTNAME in
        "nibi"*|"sanbi"*)
            aHst="$CB_yellow@$C_red%m" 
            ;;
        *)
            aHst="$CB_yellow@$C_green%m" 
            ;;
    esac

This part is a bit less interesting, I just like to have different colours for my different user/machines :)
    vcsPWD=${vcs_info_msg_3_:-.}
}

And finally I get the subdirectory part if I’m in a repo. If for example I’m in /home/shikamaru/repo/awesome/config/ it returns awesome/config, see below why.

Let’s set up the prompt !

# PROMPT
# (retval:Branch:PromptChar)
PROMPT='$oBr%(?..$C_red%?$fSep)$C_cyan$vBr$fSep$pCh$cBr '

The %(?..$C_red%?$fSep) returns the exit code of the last command if it’s not 0 ($?). I find it useful as I often used to use echo $? to know it :)
$vBr is the branch on which I’m working on, we already had that in Mandriva for bash, but it used some bash-completion functions which can make your shell painfully slow when for instance you run urpmi a-local-package.rpm because it tries first to complete it to the available rpms in the repositories :/

And finally, we display our pretty prompt character. You shouldn’t have problems displaying it if you’re using an utf-8 system, which is the case for most linuxes nowadays, and I chose symbols from the mathematical symbols, which are normally available for you.

pwdMax=$(($COLUMNS-80))
RPROMPT='$oBr$aUsr$aHst$fSep%$pwdMax<…<${PWD/$vcsPWD/$C_yellow$vcsPWD}%<<$cBr'

Now, we display the right part of the prompt. It’s nice to use it because it disappears when you type a longer command than the available place you have, using the left prompt exclusively would make it too long I guess.

We first display the user and hostname and then we’re going on more crazy stuff :)
%$pwdMax<…<${PWD/$vcsPWD/$C_yellow$vcsPWD}%<<

This command just displays the path, but truncates it to leave at least 80 columns for the left prompt+commands, which was calculated in the variable $pwdMax. On top of that we colorize the vcs part of that path.

More on this:
The construction number<replace<string<< truncates the string to number characters and adds a replace string for the truncated part (here an ellipsis). This is just insane, AFAIK that’s not something you can find in bash, but it’s very useful in that case :)
${PWD/$vcsPWD/$C_yellow$vcsPWD} is another construction that allows substitutions. basically it substitutes the 2nd part of the variable with the third part.

The actual solution is not optimal though, I should also add another substitution to replace the $HOME part of the current directory with ~/, this won’t require much work though :)

I also need to fix a little issue that occurs if my terminal is smaller than 80 columns

Tidying the repository

Added by Rémy CLOUARD almost 2 years ago

Tidy might not be the right word actually, since redmine is a bit confused now :)

For those of you who cloned it (I wonder if there were any actually), I’m sorry.

For now the repo is still as big as it was, since everything has not (yet) vanished.

Awesome RPMS and organizational changes

Added by Rémy CLOUARD about 2 years ago

I’m sorry I’m a bit late but awesome 3.4.2 RPMs are available in the files section !

At the moment only i586 RPMs are there, I’ll put x86_64 RPMs once I’m home, stay tuned :)

I’m also proud to announce that I’ve been able to get awesome on the gdium for the first time \o/
Not everything works though. For some reason I cannot get rid of lxpanel because then I get no input from the keyboard and mouse, I don’t really know what’s going on there. Also, the modkey sends you back on the tty, that behaviour is also there without awesome, but I couldn’t fix it yet. What’s more, I need to update some other package, because atm it’s only awesome 3.2.1.

You may know download awesome rpms in the files section. I’ll clean the repo in the next days, it’s not really suited for binary files, but I just discovered a nice feature of redmine that allows you to make subsections in the files section. That also means you’ll be able to clone my config without having to download unuseful things :)
On the other hand, I’ll put more dotfiles in this repo, I just need to clean it before.

I just finish this announce with a screenshot
I’ve just discovered a nice patch for mutt that allows you to set up different colours for the different parts of the index, I think the result is pretty nice :) It’s been a bit of work to adapt it because other patches applied to mutt in mandriva caused it not to be applied properly.
I’ve also made a custom theme for irssi so that its appearance is consistent with my theme, and you can also see ncmpcpp running, it’s a nice mpd client I’ve imported not so long ago in mandriva.

Cheers.

Awesome 3.4.1 rpms and some other stuff

Added by Rémy CLOUARD about 2 years ago

These rpms are now working fine on both my desktop (x86_64) and laptop (i586) but as usual, please let me know if you encounter some difficulties with these.

I've also changed some things in my config

Now there's a specific branch for my desktop config, as I don't need some of the widget I usually use on my laptop.

I'm also very pleased to say that I got my patch accepted by anrxc for the scrolling helper function in vicious. You can now use it for your mpd or mbox widget for instance :)

as you can see I also added my kde4 colorscheme, and I'll probably add some more dotfiles on this repo.

Cheers :)

Awesome 3.4 rc3 rpms available and new config available

Added by Rémy CLOUARD over 2 years ago

I repeat myself but you also need to have a recompiled cairo and xcb-util v0.3.6 to get those rpms working.

Here are the new options I added in my config :

- style switching : from the menu you can switch between my theme but I also tried to adapt the ia_ora colors to the theme. There is still some work to do on the icons particularly, but this might be a good working base.
- teardrop : I grabbed it from anrxc's config and I must admit this is something I really missed when I left ion3, the shortcut is modkey4+s, as modkey4+space is already taken to change your tag's layout. Those of you who know yakuake, guake or tilda will perhaps appreciate to be able to call a terminal wherever you are ;)

Awesome 3.4-rc2 rpms and compatible config available

Added by Rémy CLOUARD over 2 years ago

you can clone my git repo with the following command :
git clone git://shikamaru.fr/config.git

You'll get the latest rpms of awesome as well as my config file.
As I said there's still room for improvement, but still you can grab it and make yours too :)

I put the vicious widgets I'm using but I suggets you to clone anrxc's repo instead, they're just here to help you get a working config at stock. This applies to ierton's freedesktop menu as well (See The previous announce for more information about it)

Have fun !

awesome 3.4

Added by Rémy CLOUARD over 2 years ago

It didn't take much time to get them, it took a lot more to get my config working again :)

I'll push it in some days too once it's clean enough.

There are some interesting things in it, the first one is a change from wicked to vicious, which is an awesome widget library, very modular and clean (each modules just consists of a dozen of lines or so). The second one is an implementation of a freedesktop menu in awesome's menu. I need to fix a small issue on this, I don't see all my programs displayed there (kde4 programs aren't there for instance). You can get more info on vicious on awesome's wiki.

To make a long story short, here's what's included in my config file :
- xdg menu
- named tags and different layouts (3.4 is in floating mode by default, I guess too many people claimed awesome was a tiling wm, which is not correct)
- net statistics for 3G/WiFi/Ethernet
- MPD nowplaying
- battery level
- proc and mem usage

you can see a preview there : http://shikamaru.fr/attachments/download/27/awesome-3.4.png

This is still a work-in-progress screenshot, I have several ideas in mind including :
- mandriva themes for awesome
- packaging third party modules (like ierton's xdg menu and anrxc's vicious)
- make a single net widget that summarize all of them, as I rarely have more than one interface up !
- remove tasklist, I don't really need it either

Enjoy :)

Awesome 3.3.4 RPMS and some related stuff

Added by Rémy CLOUARD over 2 years ago

Ok, finally got my HSDPA (3G) key working so after 2 months of forced retirement I'm back :)

I've just made those RPMs, use it at your own risks !

actually libxcb-1.4 has been lying on Mandriva's svn for about 2 months but apparently it wasn't submitted, I guess there's a good reason for that, but still awesome works like a charm here and I didn't encounter any other trouble.

You'll need it as well as xcb-util-0.3.6

Next step will be 3.4-rc1, stay tuned, they'll be online in a couple of days or so ;)

Have fun !

Awesome 3.3 RPM

Added by Rémy CLOUARD over 2 years ago

In a previous article I explained how you could compile awesome for yourself. Well, I've done a RPM for this so things are now much easier for you :). Unfortunately I can't import it into cooker at the moment because of cairo-xcb (see this thread : http://www.nabble.com/-Cooker--Enable-cairo-xcb-td23732795.html )

So you will still have to download my modified version of cairo (seehttp://git.shikamaru.fr/news/show/1)

RPMS can be found here : http://kenobi.mandriva.com/~shikamaru/awesome

On a side-note I'm pleased to say good riddance to apache, it has caused me lots of headaches this week-end, by filling my /tmp with cores (and this is why OVH default partitionning sucks, they only create 3 partitions for / swap and /home, which is not good at all for a server), so I've now switched to nginx, I wanted to do this for a long time so this was the good occasion I think. In the meantime I've dropped drupal as well and now post everything here on redmine, I just need to apply a nice theme to it though I must say this one is good even for small screens. An RPM for nginx is on the road too (I installed nginx with it), it just needs some small adjustments for the default config, stay tuned ;)

1 2 Next »

Also available in: Atom