From 10ab3aceeb2d4a1cdaa4fe20fa36e4b9cfb36df5 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Fri, 9 Oct 2015 13:02:30 +0200 Subject: [PATCH] completed thinkpad configuration --- bspwmrc | 8 ++++---- configuration.nix | 49 +++++++++++++++++++++++++++++++++++++++++++---- install-prezto | 2 +- lemonbar.sh | 10 +++++++--- sxhkdrc | 15 ++++++++++++++- 5 files changed, 71 insertions(+), 13 deletions(-) diff --git a/bspwmrc b/bspwmrc index 4cc2dcb..156303c 100755 --- a/bspwmrc +++ b/bspwmrc @@ -5,18 +5,18 @@ setxkbmap it # Dont show ugly X shaped cursor xsetroot -cursor_name left_ptr udiskie & - +amixer set Master 0 + # Start lemonbar sh ~/.config/bspwm/lemonbar.sh & # Set up desktops on monitors -bspc monitor DVI-I-0 -d 1 2 3 4 5 -bspc monitor HDMI-0 -d 6 7 8 9 +bspc monitor -d 1 2 3 4 5 6 # Set up bspwm theme bspc config border_width 2 bspc window_gap 24 -bspc config -m DVI-I-0 top_padding 20 +bspc config top_padding 20 bspc config focused_border_color '#858585' bspc config normal_border_color '#2e343D' bspc config split_ratio 0.52 diff --git a/configuration.nix b/configuration.nix index cf6e90e..57e0b0b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -9,6 +9,8 @@ # System boot = { + kernelPackages = pkgs.linuxPackages_4_1; + initrd.luks.devices = [ { device = "/dev/sda3"; name = "crypted"; allowDiscards = true; } ]; loader = { grub.enable = false; gummiboot.enable = true; @@ -25,6 +27,9 @@ "vm.dirty_writeback_centisecs" = 6000; # Aggregate disk IO }; }; + extraModprobeConfig = '' + options snd_hda_intel index=1,0 + ''; }; # SSD @@ -33,8 +38,12 @@ time.timeZone = "Europe/Rome"; + hardware.opengl.driSupport32Bit = true; + virtualisation.virtualbox.host.enable = true; + powerManagement.enable = true; + # Networking networking.hostName = "warren"; @@ -59,9 +68,9 @@ visualizerSupport = true; clockSupport = true; }; - chromium = pkgs.chromium.override { - enablePepperFlash = true; - }; + #chromium = pkgs.chromium.override { + # enablePepperFlash = true; + #}; }; }; @@ -84,7 +93,7 @@ # Media beets mpd mpc_cli ncmpcpp popcorntime mpv # Drivers, file systems and other compatibility-aimed packages - ntfs3g exfat utillinuxCurses gptfdisk encfs xlibs.xbacklight + ntfs3g utillinuxCurses gptfdisk encfs xlibs.xbacklight acpi powertop ]; @@ -110,6 +119,12 @@ # Desktop Environment xserver = { enable = true; + #deviceSection = '' + # Identifier "Intel Graphics" + # Driver "intel" + # Option "AccelMethod" "sna" + # Option "TearFree" "true" + #''; layout = "it"; windowManager.bspwm.enable = true; desktopManager.xterm.enable = false; @@ -122,6 +137,18 @@ displayManager.desktopManagerHandlesLidAndPower = false; synaptics = { enable = true; + buttonsMap = [1 3 2]; + tapButtons = false; + maxSpeed = "2.5"; + accelFactor = "0.03"; + palmDetect = true; + twoFingerScroll = true; + #additionalOptions = '' + # Option "LockedDrags" = "true" + # Option "AccelerationProfile" "-111" + # Option "VertScrollDelta" = "-111" + # Option "HorizScrollDelta" = "-111" + #''; }; }; @@ -164,6 +191,20 @@ user = "fazo"; dataDir = "/home/fazo/.config/syncthing"; }; + + logind.extraConfig = '' + HandlePowerKey=ignore + ''; + + upower.enable = true; + + tlp = { + enable = true; + extraConfig = '' + CPU_SCALING_GOVERNOR_ON_AC=performance + CPU_SCALING_GOVERNOR_ON_BAT=powersave + ''; + }; }; # Custom Services diff --git a/install-prezto b/install-prezto index 463ea1a..4565ff1 100755 --- a/install-prezto +++ b/install-prezto @@ -9,7 +9,7 @@ fi mkdir -p $ZDOTDIR -git clone --recursive https://maxwell.ydns.eu:44333/fazo96/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" +git -c http.sslVerify=false clone --recursive https://maxwell.ydns.eu:44333/fazo96/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" setopt EXTENDED_GLOB for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do diff --git a/lemonbar.sh b/lemonbar.sh index 73d44d4..2224764 100755 --- a/lemonbar.sh +++ b/lemonbar.sh @@ -9,7 +9,7 @@ GREEN2="#6d6137" BROWN="#776049" buildClock() { - echo -n "%{F$WHITE2}$(date "+%A, %e %B, %k:%M:%S")" + echo -n "%{F$WHITE2}$(date "+%A, %e %B, %k:%M")" } getVolume() { @@ -84,13 +84,17 @@ getMEM(){ echo -n "%{F$BLUE}$USEDMEM MB" } +getBAT(){ + BAT=$(acpi -b | head -n1 | cut -d ' ' -f4 | cut -d '%' -f1) + echo -n "%{F$GREY}$BAT $(echo $BAT 0 100 | spark | cut -b 1-3)" +} + buildBar () { while true do - echo " $(getMPD) %{c}$(buildClock) %{r} $(getLOAD) $(separator) $(getMEM) $(separator) $(getDISK) $(separator) $(getNET) $(separator) $(getVolume) " + echo " $(getMPD) %{c}$(buildClock) %{r} $(getLOAD) $(separator) $(getMEM) $(separator) $(getDISK) $(separator) $(getNET) $(separator) $(getVolume) $(separator) $(getBAT) " sleep 5 done } buildBar | lemonbar -p -g "1920x20" -B "$BLACK" -F "$GREY" -f -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1 - diff --git a/sxhkdrc b/sxhkdrc index b001f65..fe647c7 100755 --- a/sxhkdrc +++ b/sxhkdrc @@ -89,6 +89,18 @@ super + space # pkill -USR1 -x sxhkd # media +XF86MonBrightnessUp + xbacklight -inc 10 +XF86MonBrightnessDown + xbacklight -dec 10 +XF86KbdBrightnessUp + kbdlight up 10 +XF86KbdBrightnessDown + kbdlight down 10 +XF86AudioNext + mpc next +XF86AudioPrev + mpc prev XF86AudioRaiseVolume amixer set Master 3+ unmute XF86AudioLowerVolume @@ -107,7 +119,8 @@ XF86Mail # lock XF86Sleep - i3lock -u -c 1d1f21 -i ~/Pictures/background.png +XF86LaunchB + i3lock -u -c 1d1f21 -i ~/Pictures/background.* # screenshots Print