You are not logged in.

#1 2014-06-04 07:31:33

gauteh
Member
Registered: 2008-03-17
Posts: 19
Website

Macbook Pro Late 2013 (13 inch) display setup with LXDE / Openbox

Hi, I've got a livable setup with arch on an Macbook Pro late 2013 (11.1x I assume). I am running LXDE (Openbox) with a bunch of GNOME tools as well as some QT stuff (Mendeley / Skype..). Some of this stuff will probably repeat https://bbs.archlinux.org/viewtopic.php?id=171883&p=10 and https://wiki.archlinux.org/index.php/MacBookPro11,x.

I am frequently switching between an external monitor and the laptop retina (HiDPI) screen as well as projectors for presentations (through HDMI). All my tweaks are based on the information in the two above links.

I use:
- LXDE / openbox
- gdm
- lxpanel
- firefox
- volumeicon
- arandr and xrandr
- wmctrl
- spotify
- mendeley
- skype
- thunar
- nitrogen
- urxvt

The whole setup is based on two scripts: `dpi` and `scrm` which sets up the displays and reconfigures interface scaling. I used arandr to create the screenlayout I want to use (either external monitor or retina, very seldom both) - then I save the layouts using arandr (these are shellscripts) in ~/.screenlayout. I have: dual.sh, laptop.sh, work.sh for the different setups I use. I have the following script (`scrm`) in my path which I call either on startup or when I want to switch layout:

#! /bin/bash
#
# change screen configuration

profiles="$HOME/.screenlayout"

if [[ "$#" -lt "1" ]]; then
  echo "speicfy layout."
  exit 1
fi

l="${profiles}/$1.sh"

if [[ ! -f "${l}" ]]; then
  echo "layout does not exist."
  exit 1
fi

. $l

if [ "$1" == "work" ]; then
  dpi monitor
elif [ "$1" == "laptop" ]; then
  dpi retina
fi

the script `dpi` is responsible for changing all the scaling and dpi settings to work for either the retina/hidpi screen or a regular monitor/projector, note that the script is adapted to the programs that I use - so adapt to the programs you use. Alot of the programs (like firefox / thunar / lxpanel) are restarted to get the new dpi and scaling factors. I normally only run this seldom so it doesn't matter that much to me.

dpi:

#! /bin/bash
#
# set dpi settings for either HiDPI (retina) or regular DPI screens (96)
#
# requires:
# - wmctrl
# - xrandr

if [ "$1" == "retina" ]; then
  echo "configuring for retina.."

  # set scaling factor in gtk
  gsettings set org.gnome.desktop.interface scaling-factor 2

  # merge in XFT dpi settings
  xrdb -merge ~/.Xdefaults.hidpi

  # set scaling in firefox
  sed -i -e 's|user_pref("layout.css.devPixelsPerPx.*|user_pref("layout.css.devPixelsPerPx", "1.5");|' ~/.mozilla/firefox/*.default/user.js

  # set xrandr - just for kicks
  xrandr --dpi 196

elif [ "$1" == "monitor" ]; then
  echo "configuring for regular monitor.."

  # set scaling factor in gtk
  gsettings set org.gnome.desktop.interface scaling-factor 1

  # merge in XFT dpi settings
  xrdb -merge ~/.Xdefaults.96

  # set scaling in firefox
  sed -i -e 's|user_pref("layout.css.devPixelsPerPx.*|user_pref("layout.css.devPixelsPerPx", "1");|' ~/.mozilla/firefox/*.default/user.js

  # set xrandr - just for kicks
  xrandr --dpi 96
else

  echo "specify either retina or monitor"
  exit 1

fi


# restart firefox
pidof firefox && wmctrl -c firefox && firefox &

# restart openbox
pidof openbox && openbox --restart

# restart gnome-do
pkill gnome-do && gnome-do &

# restart lxpanel
pkill lxpanel && lxpanel &

# restart nm-applet
pkill nm-applet && nm-applet &

# restart gnote
pkill gnote && gnote &

# restart gnome-encfs-manager
pidof gnome-encfs-manager && kill $(pidof gnome-encfs-manager) && gnome-encfs-manager &

# restart thunard
ps aux | grep "thunar --daemon" | grep -v grep && killall thunar && thunar --daemon &

# make sure volumeicon is running
pidof volumeicon || volumeicon &

# restore background
nitrogen --restore

exit 0

The different Xdefault files that I have in ~ are:

.Xdefaults.96:

! -- LCD/Hinting and DPI settings
!    for a regular monitor

Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 96

and for retina:
.Xdefaults.hidpi:

! -- LCD/Hinting and DPI settings
!    for a retina screen

Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 196

Apart from the scaling factor changes above (in the dpi script) I have a permanent text-scaling-factor (set through dconf-editor/gsettings or gnome-tweak-tool at an earlier time) set to 0.80.

I use the following font for GTK (set in lxappearance): DejaVu Sans Book 8. My full (common and default) .Xdefaults file is (with alot of other stuff and inactive themes... ):

! -- LCD/Hinting

Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 96

!Xcursor*theme: Human
!Xcursor*size:  22


! -- Urxvt Font
urxvt.font: xft:DejaVuSansMono:size=8
!URxvt*font:                     xft:Monospace-8
!URxvt*boldFont:                 xft:Monospace-9
!URxvt*font:                      xft:Sans-7
!URxvt*font:                     xft:inconsolata-7
!URxvt*font:                     xft:Terminus-10
!URxvt*boldFont:                 -*-terminus-medium-r-*-*-13-120-*-*-*-*-*-*
!URxvt*font:                     -*-terminus-medium-r-*-*-13-120-*-*-*-*-*-*
!URxvt*font:                      -*-terminus-medium-*-*-*-13-*-*-*-*-*-*-*_*
!URxvt*font:                     -*-terminus-medium-*-*-*-12-*-*-*-*-*-*-*
!URxvt*font:                     -*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*
!URxvt*font:                     xft:terminus-10

!URxvt*font:                     -*-inconsolata-*-*-*-*-13-*-*-*-*-*-*-*
!URxvt*boldFont:                 -*-fixed-*-*-*-*-12-*-*-*-*-*-*-*

!URxvt*font:                     xft:Anonymous-pro-5
!URxvt*font:                     -misc-anonymous-medium-r-normal--13-120-100-100-m-0-iso8859-15
!URxvt*font:                     -*-dina-medium-r-*-*-15-*-*-*-*-*-*-*
!URxvt*boldFont:                 -*-dina-bold-r-*-*-15-*-*-*-*-*-*-*

! -- Urxvt Config
!URxvt.meta8:                      true
URxvt.iconFile:    /usr/share/pixmaps/gnome-term-linux.png
URxvt*saveLines:                  32767
URxvt*scrollBar:	              false
URxvt*scrollBar_right:	          true
URxvt*loginShell:	              true

!URxvt*background:                 rgb:2121/2121/2121
!URxvt*inheritPixmap: true
!URxvt*tintColor: white
!URxvt*shading: 40

URxvt*cutchars:                 \`\"()\'*<>[]{|}
!URxvt*termName:		             rxvt-unicode
URxvt*termName:		             rxvt-unicode-256color
!URxvt*termName:                 xterm-256colors
!URxvt*termName:		            xterm
URxvt*secondaryScroll:	        true
urxvt*perl-lib:		            /usr/lib/urxvt/perl/
urxvt*perl-ext-common:	        default,matcher
URxvt*urlLauncher:	            /usr/bin/sensible-browser
URxvt*matcher.button:	        1
URxvt*matcher.pattern.1:        \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
URxvt*visualBell:	            true
URxvt*geometry:                 82x25

!URxvt*colorUL:            #c5f779
!URxvt*underlineColor:     #c5f779

URxvt*imlocale:         nn_NO.UTF-8


!--[Colours]--!
!URxvt*cursorColor: #FFAF00

!! tangoesque scheme {{{
!! Black
!*color0:        000000
!*color8:        555753
!! Red
!*color1:        ff6565
!*color9:        ff8d8d
!! Green
!*color2:        93d44f
!*color10:       c8e7a8
!! Yellow
!*color3:        eab93d
!*color11:       ffc123
!! Blue
!*color4:        204a87
!*color12:       3465a4
!! Mangenta
!*color5:        ce5c00
!*color13:       f57900
!! Cyan
!*color6:        89b6e2
!*color14:       46a4ff
!! White
!*color7:        cccccc
!*color15:       ffffff
!!
!!}}}

! ---| fwojciec |--- {{{
!*color0:                rgb:1e/1e/1e
!*color1:                rgb:98/56/5e
!*color2:                rgb:66/82/5d
!*color3:                rgb:96/91/76
!*color4:                rgb:4d/65/85
!*color5:                rgb:96/73/95
!*color6:                rgb:5f/7f/7b
!*color7:                rgb:e0/e0/e0
!*color8:                rgb:73/73/73
!*color9:                rgb:cf/a3/a9
!*color10:               rgb:ca/f7/bb
!*color11:               rgb:ff/f8/bc
!*color12:               rgb:83/a3/be
!*color13:               rgb:bb/a9/cf
!*color14:               rgb:96/cc/cc
!*color15:               rgb:8f/8f/8f
!!}}}

! Zen -- {{{
! !*foreground: #bbbbbb
! *foreground: #ffffff
! *background: #000000
! !*background: #3a3a3a
! !!*background: #2a2a2a
! !*background: #1f1f1f
! !*background: #3f3f3f
! 
! !*background: #474747
! !-- black --
! URxvt*color0:   #3a3a3a
! !URxvt*color0:   #444444
! URxvt*color8:   #000000
! !-- red --
! URxvt*color1:   #cc5566
! URxvt*color9:   #992233
! !-- green --
! URxvt*color2:   #66aa44
! URxvt*color10:  #88aa88
! !URxvt*color2:   #aece91
! !URxvt*color10:  #c5f779
! !-- yellow --
! *color3:         rgb:aa/99/43
! *color11:        rgb:ef/ef/60
! !URxvt*color3:   #dddd55
! !URxvt*color11:  #cccc22
! !URxvt*color11:  #c5f779
! !URxvt*color11:  #f2f229
! !-- blue --
! *color4:         rgb:32/4c/80
! !*color12:        rgb:2b/4f/98
! *color12:        rgb:36/63/bf
! !URxvt*color4:   #003366
! !URxvt*color4:   #33679c
! !URxvt*color12:  #4488cc
! !URxvt*color4:   #9db7d0
! !URxvt*color12:  #3c8ec4
! !-- magenta --
! URxvt*color5:   #aacc99
! URxvt*color13:  #9977aa
! !URxvt*color5:   #963c59
! !URxvt*color13:  #cf9ebe
! !-- cyan --
! URxvt*color6:   #88aadd
! URxvt*color14:  #448877
! !URxvt*color6:   #9fc1cc
! !URxvt*color14:  #9fc1cc
! !-- gray --
! URxvt*color7:  #bbbbbb
! !URxvt*color7:  #bbbbbb
! !URxvt*color15:   #bbbbbb
! !URxvt*color7:  #e0e0e0
! !URxvt*color15:   #e0e0e0
! URxvt*color15:   #dddddd
! 
!}}}

! -- Theme 1 {{{
!black text
!urxvt*color0: #242424
!urxvt*color8: #cdb5cd
!!
!!red text
!urxvt*color1: #bf7979
!urxvt*color9: #f4a45f
!!
!!green text
!urxvt*color2: #97b26b
!urxvt*color10: #c5f779
!!
!!yellow text
!urxvt*color3: #cdcda1
!urxvt*color11: #ffffaf
!!
!!blue text
!urxvt*color4: #86a2be
!urxvt*color12: #98afd9
!!
!!magenta text
!urxvt*color5: #d9b798
!urxvt*color13: #d7d998
!!
!!cyan text
!urxvt*color6: #a1b5cd
!urxvt*color14: #a1b5cd
!!
!!white
!urxvt*color7: #ffffff
!urxvt*color15: #dedede
!- }}}
 
!# Greenish theme {{{
!urxvt*color0: #000000
!urxvt*color8: #666666
!## DarkRed + Red
!urxvt*color1: #b45151
!urxvt*color9: #fe8686
!## DarkGreen + Green
!urxvt*color2: #8ba574
!urxvt*color10: #a5dca5
!## DarkYellow + Yellow
!urxvt*color3: Khaki3
!urxvt*color11: #efe58b
!## DarkBlue + Blue
!urxvt*color4: #2797d8
!urxvt*color12: #86cdea
!## DarkMangenta + Mangenta
!urxvt*color5: #aa6eaf
!urxvt*color13: #b698b8
!##DarkCyan + Cyan
!urxvt*color6: #418179
!urxvt*color14: #71bebe
!## LightGrey + White
!urxvt*color7: #bebebe
!urxvt*color15: #ffffff
!- }}}
 
!# Light theme, for crappy CRTs {{{
!urxvt*color0: #000000
!urxvt*color8: #000054
!urxvt*color1: #A80000
!urxvt*color9: #AA0054
!urxvt*color2: #00A800
!urxvt*color10: #00AA54
!urxvt*color3: #A8A800
!urxvt*color11: #AAAA54
!urxvt*color4: #0000A8
!urxvt*color12: #0055CC
!urxvt*color5: #A800A8
!urxvt*color13: #AA00AA
!urxvt*color6: #00A8A8
!urxvt*color14: #00AAAA
!urxvt*color7: #A8A8A8
!urxvt*color15: #AAAAAA
 
!urxvt*color0: black
!urxvt*color1: #40e0d0
!urxvt*color2: #87cefa
!urxvt*color3: #ffff00
!urxvt*color4: #d1eeee
!urxvt*color5: #eed8ae
!urxvt*color6: #b4eeb4
!urxvt*color7: gray
!urxvt*color8: gray40
!urxvt*color9: #ee6363
!urxvt*color10: #c5f779
!urxvt*color11: #fff796
!urxvt*color12: #00b2ee
!urxvt*color13: #cf9ebe
!urxvt*color14: #71bebe
!urxvt*color15: white
! -- }}}

! {{{ dunno
!*background: #1a1a1a
!*foreground: #acacab

!*color0: #050505
!*color1: #e9897c
!*color2: #b6377d
!*color3: #ecebbe
!*color4: #a9cdeb
!*color5: #75507b
!*color6: #c9caec
!*color7: #f2f2f2
!*color8: #141414
!*color9: #f99286
!*color10: #c3f786
!*color11: #fcfbcc
!*color12: #b6defb
!*color13: #ad7fa8
!*color14: #d7d9fc
!*color15: #e2e2e2

! }}}

! {{{ dunno2
!*background: #242424
!*background: #1a1a1a
!*background: #000000
!*foreground: #e2e2e5
!# Black
!*color0:    rgb:00/00/00
!# Red
!*color1:    rgb:ff/5d/28
!# Green
!*color2:    rgb:b1/d6/31
!# Yellow
!*color3:    rgb:e6/ea/50
!# Blue
!*color4:    rgb:7e/8a/a2
!# Magenta
!*color5:    rgb:af/5f/5f
!# Cyan
!*color6:   #88aadd
!#*color6:    rgb:ac/f0/f2
!# White
!*color7:    rgb:e2/e2/e5
!# Black
!*color8:    rgb:24/24/24
!# Red
!*color9:    rgb:ff/5d/28
!# Green
!*color10:    rgb:b1/d6/31
!# Yellow
!*color11:    rgb:e6/ea/50
!# Blue
!*color12:    rgb:7e/8a/a2
!# Magenta
!*color13:    rgb:af/5f/5f
!# Cyan
!*color14:    rgb:ac/f0/f2
!#*color14:  #448877
!# White
!*color15:    rgb:e2/e2/e5
! }}}

!!-- Phraktured {{{
!*foreground:     rgb:dd/dd/dd
!#*background:     rgb:22/22/22
!*background: #1a1a1a
!#*background:     rgb:00/00/00
!!black
!*color0:         rgb:19/19/19
!*color8:         rgb:25/25/25
!!red
!*color1:         rgb:80/32/32
!*color9:         rgb:98/2b/2b
!!green
!*color2:         rgb:5b/76/2f
!*color10:        rgb:89/b8/3f
!!brown/yellow
!*color3:         rgb:aa/99/43
!*color11:        rgb:ef/ef/60
!!blue
!*color4:         rgb:32/4c/80
!*color12:        rgb:2b/4f/98
!!magenta
!*color5:         rgb:70/6c/9a
!*color13:        rgb:82/6a/b1
!!cyan
!*color6:         rgb:92/b1/9e
!*color14:        rgb:a1/cd/cd
!!white
!*color7:         rgb:ff/ff/ff
!*color15:        rgb:dd/dd/dd
! }}}

! http://sdkmvx.wordpress.com/2008/08/13/rxvt-unicode-terminal-colors/ {{{
!urxvt*foreground: #f2f2f2
!urxvt*background: #101010
!
!! Normal
!! color0    black
!! color1    red
!! color2    green
!! color3    yellow
!! color4    blue
!! color5    purple
!! color6    cyan
!! color7    white
!
!urxvt*color0:    #6c6c6c
!urxvt*color1:    #e9897c
!urxvt*color2:    #b6e77d
!urxvt*color3:    #ecebbe
!urxvt*color4:    #a9cdeb
!urxvt*color5:    #ea96eb
!urxvt*color6:    #c9caec
!urxvt*color7:    #f2f2f2
!
!! Light
!! color8    black
!! color9    red
!! color10    green
!! color11    yellow
!! color12    blue
!! color13    purple
!! color14    cyan
!! color15    white
!
!urxvt*color8:    #747474
!urxvt*color9:    #f99286
!urxvt*color10:    #c3f786
!urxvt*color11:    #fcfbcc
!urxvt*color12:    #b6defb
!urxvt*color13:    #fba1fb
!urxvt*color14:    #d7d9fc
!urxvt*color15:    #e2e2e2
!! }}}

!! drop in Solarized colorscheme for Xresources/Xdefaults {{{

!#define S_base03        #002b36
!#define S_base02        #073642
!#define S_base01        #586e75
!#define S_base00        #657b83
!#define S_base0         #839496
!#define S_base1         #93a1a1
!#define S_base2         #eee8d5
!#define S_base3         #fdf6e3
!#define S_yellow        #b58900
!#define S_orange        #cb4b16
!#define S_red           #dc322f
!#define S_magenta       #d33682
!#define S_violet        #6c71c4
!#define S_blue          #268bd2
!#define S_cyan          #2aa198
!#define S_green         #859900
!
!*background:            S_base03
!*foreground:            S_base00
!*fading:                10
!*fadeColor:             S_base03
!*cursorColor:           S_base1
!*pointerColorBackground:S_base01
!*pointerColorForeground:S_base1
!
!!! black dark/light
!*color0:                S_base02
!*color8:                S_base03
!
!!! red dark/light
!*color1:                S_red
!*color9:                S_orange
!
!!! green dark/light
!*color2:                S_green
!*color10:               S_base01
!
!!! yellow dark/light
!*color3:                S_yellow
!*color11:               S_base00
!
!!! blue dark/light
!*color4:                S_blue
!*color12:               S_base0
!
!!! magenta dark/light
!*color5:                S_magenta
!*color13:               S_violet
!
!!! cyan dark/light
!*color6:                S_cyan
!*color14:               S_base1
!
!!! white dark/light
!*color7:                S_base2
!*color15:               S_base3

!! }}}


! Tomorrow {{{


! Names of the original color are in parenthesis.

! With the exception of DarkYellow (which is Orange) and Yellow
! (which is Yellow), bright colors were derived by simply upping the 'value'
! of each color by 22.  This number was derived from maxing out the value on
! Red.

!*foreground:   #000000
!!*foreground:   #4d4d4c
!*background:   #ffffff
!! CursorColor (Selection)
!*cursorColor:  #d6d6d6
!
!! Black + Grey (Comment)
!*color0:       #000000
!*color8:       #8e908c
!!*color8:       #000000
!! Red + Bright Red
!*color1:       #c82829 
!*color9:       #ff3334
!! Green + Bright Green
!*color2:       #718c00
!*color10:      #9ec400
!! Yellow (Orange) + Bright Yellow (Yellow)
!*color3:       #f5871f
!*color11:      #eab700
!! Blue + Bright Blue
!*color4:       #4271ae
!*color12:      #5795e6
!! Magenta (Purple) + Bright Magenta
!*color5:       #8959a8
!*color13:      #b777e0
!! Cyan (Aqua) + Bright Cyan
!*color6:       #3e999f
!*color14:      #54ced6
!! Light Grey (Selection) + White (Current Line)
!*color7:       #d6d6d6
!!*color7:      #b0b0b0
!*color15:      #efefef
! }}}

! Tomorrow Night {{{
*foreground:   #c5c8c6
*background:   #1d1f21
*cursorColor:  #aeafad
*color0:       #000000
*color1:       #912226
*color2:       #778900
*color3:       #ae7b00
*color4:       #1d2594
*color5:       #682a9b
*color6:       #2b6651
*color7:       #929593
*color8:       #666666
*color9:       #cc6666
*color10:      #b5bd68
*color11:      #f0c674
*color12:      #81a2be
*color13:      #b294bb
*color14:      #8abeb7
*color15:      #ecebec

! }}}

!-------------------------
!       xterm

xterm*scrollBar:  false
xterm*saveLines:  4000
xterm*termName:   xterm-256color
xterm*loginShell: true
!xterm*utf8:                     3

!xterm*background:               #1c1c1c
!*foreground:                    #B4B4B4

!xterm*font: -*-terminus-medium-*-*-*-12-*-*-*-*-*-*-*
!xterm*foreground: #bbbbbb
!xterm*background: #000000
!

Other than that I use the Zukiwi theme for both GTK+ and Openbox and using qt config I set all QT applications to use the GTK theme. Screenshots below:
Monitor:
ptRC6cCl.png

Retina:
nZVYyXel.png

Other than that my main annoyance is that thunderbolt hotplugging doesn't work (have to start the laptop with thunderbolt device plugged in): https://wiki.archlinux.org/index.php/Ma … et_adapter this affects ethernet and other display outputs than the HDMI port.

Last edited by gauteh (2014-06-04 07:45:33)

Offline

Board footer

Powered by FluxBB