From 020a96cf66595d47eba58724d28aeb3e88c907cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 7 Apr 2017 14:43:23 +0200 Subject: Add gtk and qt theme configuration --- config/Trolltech.conf | 2 ++ gtk-2.0/gtkrc | 2 +- install | 7 +++++++ local/bin/lxc-net | 1 - 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 config/Trolltech.conf diff --git a/config/Trolltech.conf b/config/Trolltech.conf new file mode 100644 index 0000000..e148896 --- /dev/null +++ b/config/Trolltech.conf @@ -0,0 +1,2 @@ +[Qt] +style=GTK+ diff --git a/gtk-2.0/gtkrc b/gtk-2.0/gtkrc index 323650d..9e6f1e7 100644 --- a/gtk-2.0/gtkrc +++ b/gtk-2.0/gtkrc @@ -1,2 +1,2 @@ -gtk-theme-name = "Numix-Frost" +include "/usr/share/themes/Numix-Frost/gtk-2.0/gtkrc" gtk-font-name = "pango monospace 8" diff --git a/install b/install index a520b42..46a5d3c 100755 --- a/install +++ b/install @@ -91,6 +91,13 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/bin/sys-suspend ~/.local/bin/ fi +read -p "Install Gtk+ and Qt theme setup? (Y/n) " +if [[ $REPLY =~ ^[Yy]?$ ]]; then + inst gtk-2.0/gtkrc ~/.gtkrc-2.0 + inst gtk-3.0/ ~/.config/gtk-3.0/ + inst config/Trolltech.conf ~/.config/Trolltech.conf +fi + read -p "Install Conkeror configuration? (Y/n) " if [[ $REPLY =~ ^[Yy]?$ ]]; then inst conkerorrc ~/.conkerorrc diff --git a/local/bin/lxc-net b/local/bin/lxc-net index a9f1d10..0821571 100755 --- a/local/bin/lxc-net +++ b/local/bin/lxc-net @@ -1,5 +1,4 @@ #!/bin/sh -set -e if [ "$(id -u)" -ne 0 ]; then echo "Root required for execution" >&2 -- cgit v1.2.3 From 5466e3d6599181f07ea5824b0eba22d0c333dc3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 8 Apr 2017 21:45:37 +0200 Subject: Changes made while transferring to gentoo --- Xresources | 2 +- config/i3/config | 8 ++++---- config/i3blocks/config | 2 +- config/mpd/mpd.conf | 2 +- local/bin/lxc-net | 2 +- local/bin/mxrandr | 6 +++--- profile | 4 +--- vimrc | 1 + xinitrc | 4 +--- 9 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Xresources b/Xresources index f769302..bea20e6 100644 --- a/Xresources +++ b/Xresources @@ -41,7 +41,7 @@ URxvt*secondaryScreen: 1 URxvt*secondaryScroll: 0 ! Font URxvt*font: xft:mono:size=10 -URxvt*perl-ext-common: default,clipboard,vtwheel,resize-font +URxvt*perl-ext-common: default,clipboard,font-size URxvt*resize-font*smaller: C-Down URxvt*resize-font*bigger: C-Up diff --git a/config/i3/config b/config/i3/config index 7cd72c3..3900eb5 100644 --- a/config/i3/config +++ b/config/i3/config @@ -135,7 +135,7 @@ bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart -set $Locker i3lock -d -c 000000 && sleep 1 +set $Locker i3lock -c 000000 && sleep 1 && xset dpms force off set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown mode "$mode_system" { @@ -202,9 +202,9 @@ bindsym $mod+r mode "resize" bindsym Mod1+space exec --no-startup-id ~/.config/i3/scripts/keyboard_switch # Pulse audio control -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% && pkill -RTMIN+10 i3blocks -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% && pkill -RTMIN+10 i3blocks -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle && pkill -RTMIN+10 i3blocks +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% && pkill -RTMIN+10 i3blocks +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% && pkill -RTMIN+10 i3blocks +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle && pkill -RTMIN+10 i3blocks # Sreen brightness controls bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 20 # increase screen brightness diff --git a/config/i3blocks/config b/config/i3blocks/config index 116e2bd..8ae24c8 100644 --- a/config/i3blocks/config +++ b/config/i3blocks/config @@ -24,7 +24,7 @@ # # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate. -command=/usr/lib/i3blocks/$BLOCK_NAME +command=/usr/libexec/i3blocks/$BLOCK_NAME separator_block_width=15 markup=none diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf index 17a21cc..28d387c 100644 --- a/config/mpd/mpd.conf +++ b/config/mpd/mpd.conf @@ -13,7 +13,7 @@ # be disabled and audio files will only be accepted over ipc socket (using # file:// protocol) or streaming files over an accepted protocol. # -music_directory "~/hdd/music" +music_directory "~/music" # # This setting sets the MPD internal playlist directory. The purpose of this # directory is storage for playlists created by MPD. The server will use diff --git a/local/bin/lxc-net b/local/bin/lxc-net index 0821571..53ccb50 100755 --- a/local/bin/lxc-net +++ b/local/bin/lxc-net @@ -37,5 +37,5 @@ subnet 192.168.30.0 netmask 255.255.255.0 { dhcpd -4 -pf /tmp/lxc-dhcpd.pid -cf /tmp/lxc-dhcpd.conf vbr0 # Setup network forwarding (TODO add -o ethX to iptable command) -sysctl net.ipv4.ip_forward=1 +sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -j MASQUERADE diff --git a/local/bin/mxrandr b/local/bin/mxrandr index 81ae511..7c51128 100755 --- a/local/bin/mxrandr +++ b/local/bin/mxrandr @@ -8,9 +8,9 @@ disconnectedOutputs=$(xrandr | grep -E " disconnected (primary )?[1-9]+" | awk ' cmd="xrandr " cmd_def=$cmd -INTERNAL=eDP-1 -HDMI=HDMI-1 -VGA=VGA-1 +INTERNAL=eDP1 +HDMI=HDMI1 +VGA=VGA1 for device in "$disconnectedOutputs"; do if [ -n "$defice" ]; then diff --git a/profile b/profile index b175d9b..ee3522c 100644 --- a/profile +++ b/profile @@ -1,11 +1,9 @@ # Rest of the profile run only if login is from linux console [[ "$(tty)" != /dev/tty* ]] && return -# Start pulse audio -pulseaudio --start 2>/dev/null # Start music player daemon mpd ~/.config/mpd/mpd.conf # Start email synchronization ~/.local/sbin/syncemail # And if we are on first terminal also automatically start x server -[ "$(tty)" = "/dev/tty1" ] && startx +[ "$(tty)" = "/dev/tty1" ] && exec startx -- vt1 diff --git a/vimrc b/vimrc index b589483..8776cac 100644 --- a/vimrc +++ b/vimrc @@ -19,6 +19,7 @@ set hlsearch set foldmethod=syntax set wildmode=longest:full,full set wildmenu +set modeline set number set colorcolumn=82 diff --git a/xinitrc b/xinitrc index 022cf4b..877c542 100644 --- a/xinitrc +++ b/xinitrc @@ -12,6 +12,4 @@ export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 mxrandr start-pulseaudio-x11 -#exec i3 -d all -V >> ~/i3log-$(date +'%F-%k-%M-%S') 2>&1 -exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -#exec i3 --shmlog-size=26214400 +exec i3 -- cgit v1.2.3 From 8d39ed9e2804c6c9ed42aa685f6eb2f7c38fbbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 8 Apr 2017 21:53:52 +0200 Subject: Fix syncemail (option -s is gone) --- install | 1 + local/sbin/syncemail | 10 +++++++--- private | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/install b/install index 46a5d3c..5616075 100755 --- a/install +++ b/install @@ -59,6 +59,7 @@ fi read -p "Install email synchronization? (Y/n) " if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/bin/email-unread ~/.local/bin/email-unread + inst local/sbin/newmail-notify ~/.local/sbin/newmail-notify inst_email_sync # Contains: # inst local/sbin/syncemail ~/.local/sbin/ diff --git a/local/sbin/syncemail b/local/sbin/syncemail index dfd56a3..3cb56a4 100755 --- a/local/sbin/syncemail +++ b/local/sbin/syncemail @@ -5,6 +5,7 @@ import sys import subprocess import daemon import lockfile +import syslog from offlineimap import OfflineImap pidfile = '/tmp/syncemail-%d.pid' % os.getuid() @@ -33,12 +34,15 @@ for acc in accounts: sys.argv.append('-k') sys.argv.append('Repository_' + acc[0] + '-remote:remotepass=' + output) -sys.argv.append('-s') # output to syslog -sys.argv.append('-u') -sys.argv.append('syslog') +# Define out logger and redirect stdout and stderr to it +class logstd: + def write(self, data): + syslog.syslog(data) with daemon.DaemonContext(): check_running() with open(pidfile, "w") as f: f.write("%s" % os.getpid()) + syslog.openlog('syncemail') + sys.stderr = sys.stdout = logstd() OfflineImap().run() diff --git a/private b/private index 3f5aa66..3b11f0b 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 3f5aa66bb2c6b888958356385bcb23813b5ec15a +Subproject commit 3b11f0bb0bce7f594ee4ba1dddc1aea8bdeb5cc5 -- cgit v1.2.3 From 3b15d8dcd8912825281367ed959d7ad212e6a0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 8 Apr 2017 21:56:30 +0200 Subject: Add user services --- install | 6 ++++ local/sbin/user-service.sh | 90 ++++++++++++++++++++++++++++++++++++++++++++++ profile | 5 ++- service/mpd | 23 ++++++++++++ service/syncthing | 19 ++++++++++ 5 files changed, 142 insertions(+), 1 deletion(-) create mode 100755 local/sbin/user-service.sh create mode 100755 service/mpd create mode 100755 service/syncthing diff --git a/install b/install index 5616075..fd4a9f0 100755 --- a/install +++ b/install @@ -30,6 +30,12 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/git-prompt.sh ~/.local/ fi +read -p "Install user services? (Y/n) " +if [[ $REPLY =~ ^[Yy]?$ ]]; then + inst local/sbin/user-service.sh ~/.local/sbin/user-service.sh + inst service/ ~/.service/ +fi + read -p "Install VIM scripts? (Y/n) " YCM_PATH=~/.vim/bundle/YouCompleteMe if [[ $REPLY =~ ^[Yy]?$ ]]; then diff --git a/local/sbin/user-service.sh b/local/sbin/user-service.sh new file mode 100755 index 0000000..e48bb9d --- /dev/null +++ b/local/sbin/user-service.sh @@ -0,0 +1,90 @@ +#!/bin/sh +set -e + +[ -z "$1" ] && {echo "Run this script only from user-service file!" && exit 1} + +# Name of service +NAME="$(basename "$1")" +SERVICE="$1" + +# Source input file +. "$1" +shift + +OP="status" +Q=true +# Parse arguments +while [ -n "$1" ]; do + case "$1" in + -h|--help) + echo "User service: $NAME" + echo " $description" + echo "$SERVICE [OPTION]... OPERATION" + echo " Options:" + echo " -q - be quiet" + echo " Operations:" + echo " status - show status of service" + echo " start - start service" + echo " stop - stop service" + echo " restart - restart service" + ;; + -q) + Q=false + ;; + status|start|stop|restart) + OP="$1" + ;; + *) + echo "Unknown argument: $1" + exit 1 + ;; + esac + shift +done + +case "$OP" in + status) + if status; then + $Q && echo "Service $NAME is running" + exit 0 + else + $Q && echo "Service $NAME is not running" + exit 1 + fi + ;; + start) + $Q && echo -n "Starting service $NAME..." + if start; then + $Q && echo " ok" + else + $Q && echo " fail" + exit 1 + fi + ;; + stop) + $Q && echo -n "Stopping service $NAME..." + if stop; then + $Q && echo " ok" + else + $Q && echo " fail" + exit 1 + fi + ;; + restart) + $Q && echo "Restarting service $NAME..." + if ! stop; then + $Q && echo " stop failed" + exit 1 + fi + if start; then + $Q && echo " ok" + else + $Q && echo " start failed" + exit 1 + fi + ;; + *) + echo "Invalid operation!" + exit 3 + ;; +esac diff --git a/profile b/profile index ee3522c..cbee52d 100644 --- a/profile +++ b/profile @@ -2,8 +2,11 @@ [[ "$(tty)" != /dev/tty* ]] && return # Start music player daemon -mpd ~/.config/mpd/mpd.conf +~/.service/mpd -q status || ~/.service/mpd start # Start email synchronization ~/.local/sbin/syncemail +# Start syncthing +~/.service/syncthing -q status || ~/.service/syncthing start + # And if we are on first terminal also automatically start x server [ "$(tty)" = "/dev/tty1" ] && exec startx -- vt1 diff --git a/service/mpd b/service/mpd new file mode 100755 index 0000000..4f0f467 --- /dev/null +++ b/service/mpd @@ -0,0 +1,23 @@ +#!/home/cynerd/.local/sbin/user-service.sh +# vim: ft=sh + +description="Music player daemon" +pidfile=".config/mpd/pid" + +MPD_PID=~/.config/mpd/pid +if [ ! -e $MPD_PID ] || ! kill -0 $(cat $MPD_PID); then + mpd ~/.config/mpd/mpd.conf +fi + +status() { + [ -f $pidfile ] || return 1 + kill -0 "$(cat $pidfile)" || return 1 +} + +start() { + mpd ~/.config/mpd/mpd.conf +} + +stop() { + mpd --kill ~/.config/mpd/mpd.conf +} diff --git a/service/syncthing b/service/syncthing new file mode 100755 index 0000000..8d0e009 --- /dev/null +++ b/service/syncthing @@ -0,0 +1,19 @@ +#!/home/cynerd/.local/sbin/user-service.sh +# vim: ft=sh + +description="Syncthing is an open, trustworthy and decentralized cloud storage system" +pidfile="/tmp/syncthing-$USER.pid" +logfile="/var/log/syncthing-$USER.log" + +status() { + [ -f $pidfile ] || return 1 + kill -0 "$(cat $pidfile)" || return 1 +} + +start() { + start-stop-daemon -S -bmp $pidfile -1 $logfile -2 $logfile -- syncthing -no-browser +} + +stop() { + start-stop-daemon -K -p $pidfile -x syncthing +} -- cgit v1.2.3 From 33fd0875249b867dffd256d4a3eeb41475511647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 10 Apr 2017 10:30:59 +0200 Subject: Small fix of email-unread --- config/i3/config | 6 +++--- config/i3blocks/scripts/email | 5 +++-- local/bin/email-unread | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/i3/config b/config/i3/config index 3900eb5..db74e37 100644 --- a/config/i3/config +++ b/config/i3/config @@ -154,9 +154,9 @@ bindsym $mod+Shift+q mode "$mode_system" set $displays (d)efault, toggle: 1:eDP 2:HDMI 3:VGA mode "$displays" { bindsym d exec --no-startup-id mxrandr, mode "default" - bindsym 1 exec --no-startup-id mxrandr toggle eDP-1, mode "default" - bindsym 2 exec --no-startup-id mxrandr toggle HDMI-1, mode "default" - bindsym 3 exec --no-startup-id mxrandr toggle VGA-1, mode "default" + bindsym 1 exec --no-startup-id mxrandr toggle eDP1, mode "default" + bindsym 2 exec --no-startup-id mxrandr toggle HDMI1, mode "default" + bindsym 3 exec --no-startup-id mxrandr toggle VGA1, mode "default" # back to normal: Enter or Escape bindsym Return mode "default" diff --git a/config/i3blocks/scripts/email b/config/i3blocks/scripts/email index 3c1fb1f..db2dd29 100755 --- a/config/i3blocks/scripts/email +++ b/config/i3blocks/scripts/email @@ -1,4 +1,5 @@ #!/bin/bash -echo $(email-unread -s | tr "\n" " ") -echo +OUT="$(email-unread -s | tr "\n" " ")" +echo "$OUT" +echo "$OUT" echo "#ffff00" diff --git a/local/bin/email-unread b/local/bin/email-unread index 3956f3b..a17c9b4 100755 --- a/local/bin/email-unread +++ b/local/bin/email-unread @@ -1,4 +1,4 @@ -#!/bin/perl +#!/usr/bin/env perl use strict; use warnings; use File::Find; -- cgit v1.2.3 From 968eb80c3fa1d3581186e47ff8d3c7a32aa6b577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 10 Apr 2017 12:39:43 +0200 Subject: Add screenrc --- install | 5 +++++ screenrc | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 screenrc diff --git a/install b/install index fd4a9f0..15b8994 100755 --- a/install +++ b/install @@ -30,6 +30,11 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/git-prompt.sh ~/.local/ fi +read -p "Install configurations for various utility tools? (Y/n) " +if [[ $REPLY =~ ^[Yy]?$ ]]; then + inst screenrc ~/.screenrc +fi + read -p "Install user services? (Y/n) " if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/sbin/user-service.sh ~/.local/sbin/user-service.sh diff --git a/screenrc b/screenrc new file mode 100644 index 0000000..e456d12 --- /dev/null +++ b/screenrc @@ -0,0 +1,3 @@ +defscrollback 50000 +termcapinfo xterm* ti@:te@ +termcapinfo rxvt* ti@:te@ -- cgit v1.2.3 From addf0820e80286e42864f12ade3cd0215fa51bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 11 Apr 2017 13:23:06 +0200 Subject: Fix email and other scripts called from i3 --- config/i3blocks/scripts/email | 5 +++-- local/bin/email-unread | 1 - profile | 4 ++++ shellrc | 3 --- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/i3blocks/scripts/email b/config/i3blocks/scripts/email index db2dd29..2d26280 100755 --- a/config/i3blocks/scripts/email +++ b/config/i3blocks/scripts/email @@ -1,5 +1,6 @@ -#!/bin/bash -OUT="$(email-unread -s | tr "\n" " ")" +#!/bin/sh +# Note: we cut last character because output ends with new line +OUT="$(email-unread -s | tr "\n" " " | sed 's/ $//')" echo "$OUT" echo "$OUT" echo "#ffff00" diff --git a/local/bin/email-unread b/local/bin/email-unread index a17c9b4..dec7d04 100755 --- a/local/bin/email-unread +++ b/local/bin/email-unread @@ -17,7 +17,6 @@ while (readdir EDIR) { my $path = substr $File::Find::name, 1 + length EMAIL; $path =~ s/\/new$//; return if $_ ne "new" or $path =~ /$IGNORE/; - #print "ok: $path\n"; my $cnt = 0; opendir(NDIR, "$File::Find::name") or die $!; while (readdir NDIR) { diff --git a/profile b/profile index cbee52d..445f471 100644 --- a/profile +++ b/profile @@ -1,3 +1,7 @@ +# First global user configuration +export PATH=~/.local/bin:$PATH:$(ruby -e "print Gem.user_dir")/bin +export EDITOR=vim + # Rest of the profile run only if login is from linux console [[ "$(tty)" != /dev/tty* ]] && return diff --git a/shellrc b/shellrc index ccf60be..3d9c29d 100644 --- a/shellrc +++ b/shellrc @@ -1,9 +1,6 @@ # vim: ft=sh: # This is file with aliases and variables shared between bash and zsh -export PATH=~/.local/bin:$PATH:$(ruby -e "print Gem.user_dir")/bin -export EDITOR=vim - # Continue only if this is interactive shell [[ $- != *i* ]] && return -- cgit v1.2.3 From cf2286ec0a5966477b28c6e392e13c7ac6b20d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 13 Apr 2017 14:07:34 +0200 Subject: Add some screen configurations --- screenrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/screenrc b/screenrc index e456d12..8bc675c 100644 --- a/screenrc +++ b/screenrc @@ -1,3 +1,8 @@ +vbell off +autodetach on + defscrollback 50000 +obuflimit 50000 + termcapinfo xterm* ti@:te@ termcapinfo rxvt* ti@:te@ -- cgit v1.2.3 From f6047ecefcf7a05cb79bac73c259b944aac84d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 15 Apr 2017 21:51:31 +0200 Subject: Add my steam runner --- local/bin/steam | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 local/bin/steam diff --git a/local/bin/steam b/local/bin/steam new file mode 100755 index 0000000..b573daf --- /dev/null +++ b/local/bin/steam @@ -0,0 +1,10 @@ +#!/bin/bash +#export STEAM_RUNTIME=0 +export STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0 +# Workaround for dbus fatal termination related coredumps (SIGABRT) +# https://github.com/ValveSoftware/steam-for-linux/issues/4464 +export DBUS_FATAL_WARNINGS=0 +# Override some libraries as these are what games linked against. +export LD_LIBRARY_PATH="/usr/lib/steam:/usr/lib32/steam" +#export LD_PRELOAD="/usr/lib/steam:/usr/lib32/steam /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.4/libstdc++.so.6 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.4/libgcc_s.so.1 /usr/lib64/libxcb.so.1 /usr/lib64/libgpg-error.so" +exec /usr/bin/steam "$@" -- cgit v1.2.3 From 6d0a15ed36267aadb114515ba6aaa85934374e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 16 Apr 2017 13:52:01 +0200 Subject: Add syncemail service --- service/mpd | 5 ----- service/syncemail | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 service/syncemail diff --git a/service/mpd b/service/mpd index 4f0f467..f55722a 100755 --- a/service/mpd +++ b/service/mpd @@ -4,11 +4,6 @@ description="Music player daemon" pidfile=".config/mpd/pid" -MPD_PID=~/.config/mpd/pid -if [ ! -e $MPD_PID ] || ! kill -0 $(cat $MPD_PID); then - mpd ~/.config/mpd/mpd.conf -fi - status() { [ -f $pidfile ] || return 1 kill -0 "$(cat $pidfile)" || return 1 diff --git a/service/syncemail b/service/syncemail new file mode 100755 index 0000000..7465676 --- /dev/null +++ b/service/syncemail @@ -0,0 +1,19 @@ +#!/home/cynerd/.local/sbin/user-service.sh +# vim: ft=sh + +description="Mail synchronization tool" +pidfile="/tmp/syncemail-$(id -u).pid" + +status() { + [ -f $pidfile ] || return 1 + kill -0 "$(cat $pidfile)" || return 1 +} + +start() { + ~/.local/sbin/syncemail +} + +stop() { + kill "$(cat $pidfile)" + wait "$(cat $pidfile)" +} -- cgit v1.2.3 From 7889bb003e7834fe9f8cac4da05e8f78285b0491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 16 Apr 2017 17:38:33 +0200 Subject: Update vim modules --- vim/bundle/YouCompleteMe | 2 +- vim/bundle/lightline.vim | 2 +- vim/bundle/syntastic | 2 +- vim/bundle/tlib_vim | 2 +- vim/bundle/vim-snippets | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index cbb3406..5198fd9 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit cbb34063639dd54af3cf0001f282be58d517c4cc +Subproject commit 5198fd9a09960b9a1919ef2400007f9bfab33a65 diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index a63a00d..15509c6 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit a63a00d548fd20457a4f31d31fb9c8fe8a7ebc2a +Subproject commit 15509c6fa6b15c36d6bbb0068d4cfa8a2e24c003 diff --git a/vim/bundle/syntastic b/vim/bundle/syntastic index b2b125c..5d9a0bc 160000 --- a/vim/bundle/syntastic +++ b/vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit b2b125cfade75468faef6ac87742a78f2de26bfa +Subproject commit 5d9a0bc3877aea992292eeb6f318f4321fdef632 diff --git a/vim/bundle/tlib_vim b/vim/bundle/tlib_vim index 05cd677..c0a480a 160000 --- a/vim/bundle/tlib_vim +++ b/vim/bundle/tlib_vim @@ -1 +1 @@ -Subproject commit 05cd6776810bb2d51d3da578ca387b1a73c0f37e +Subproject commit c0a480a3e1208fe73c7551397d79de025b8ac60b diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 037be07..527f21a 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 037be07864c39d1e64ee0dbae6c444aecf6247d0 +Subproject commit 527f21a1903501811a515ae959dcd940d1da43f4 -- cgit v1.2.3 From a2f5a33f548aa6e9077c17dd00a692eb12d736bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 16 Apr 2017 17:42:27 +0200 Subject: Update system pm control in i3 --- config/i3/config | 10 ++++------ config/i3/scripts/shutdown | 13 +++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 config/i3/scripts/shutdown diff --git a/config/i3/config b/config/i3/config index db74e37..46451e4 100644 --- a/config/i3/config +++ b/config/i3/config @@ -135,15 +135,13 @@ bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart -set $Locker i3lock -c 000000 && sleep 1 && xset dpms force off - set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown mode "$mode_system" { - bindsym l exec --no-startup-id $Locker, mode "default" + bindsym l exec --no-startup-id i3lock -c 000000 && sleep 1 && xset dpms force off, mode "default" bindsym e exec --no-startup-id i3-msg exit, mode "default" - bindsym s exec --no-startup-id sys-suspend, mode "default" - bindsym r exec --no-startup-id sys-reboot, mode "default" - bindsym Shift+s exec --no-startup-id sys-shutdown, mode "default" + bindsym s exec --no-startup-id sudo pm-suspend, mode "default" + bindsym r exec --no-startup-id sudo reboot, mode "default" + bindsym Shift+s exec --no-startup-id ~/.config/i3/scripts/shutdown, mode "default" # back to normal: Enter or Escape bindsym Return mode "default" diff --git a/config/i3/scripts/shutdown b/config/i3/scripts/shutdown new file mode 100755 index 0000000..62f6ae1 --- /dev/null +++ b/config/i3/scripts/shutdown @@ -0,0 +1,13 @@ +#!/bin/sh + +export SUDO_ASKPASS=/tmp/shutdown-askpass.sh + + +echo '#!/bin/sh +echo "SETDESC Please enter password to shutdown system +SETPROMPT Password: +SETTITLE Sudo password for system shutdown +GETPIN" | pinentry | grep -E "^D " | sed "s/^D //"' > $SUDO_ASKPASS +chmod +x $SUDO_ASKPASS + +sudo -A shutdown -h now -- cgit v1.2.3 From efd7cc4bd9eb811bb43112e36440e2d47c7bbd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 20 Apr 2017 21:23:23 +0200 Subject: Add ultisnip and update vim plugins --- .gitmodules | 6 +++--- vim/bundle/syntastic | 2 +- vim/bundle/ultisnips | 1 + vim/bundle/vim-gitgutter | 2 +- vim/bundle/vim-snipmate | 1 - vim/bundle/vim-snippets | 2 +- vim/bundle/vim-table-mode | 2 +- vimrc | 5 +++++ 8 files changed, 13 insertions(+), 8 deletions(-) create mode 160000 vim/bundle/ultisnips delete mode 160000 vim/bundle/vim-snipmate diff --git a/.gitmodules b/.gitmodules index 3a6f663..2489650 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "vim/bundle/tlib_vim"] path = vim/bundle/tlib_vim url = https://github.com/tomtom/tlib_vim.git -[submodule "vim/bundle/vim-snipmate"] - path = vim/bundle/vim-snipmate - url = https://github.com/garbas/vim-snipmate.git [submodule "vim/bundle/tagbar"] path = vim/bundle/tagbar url = https://github.com/majutsushi/tagbar.git @@ -37,3 +34,6 @@ [submodule "vim/bundle/vim-autotag"] path = vim/bundle/vim-autotag url = https://github.com/craigemery/vim-autotag.git +[submodule "vim/bundle/ultisnips"] + path = vim/bundle/ultisnips + url = https://github.com/SirVer/ultisnips.git diff --git a/vim/bundle/syntastic b/vim/bundle/syntastic index 5d9a0bc..0bfac45 160000 --- a/vim/bundle/syntastic +++ b/vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 5d9a0bc3877aea992292eeb6f318f4321fdef632 +Subproject commit 0bfac45565efa4e94364818b3b0cb2ee46826a0f diff --git a/vim/bundle/ultisnips b/vim/bundle/ultisnips new file mode 160000 index 0000000..5352d98 --- /dev/null +++ b/vim/bundle/ultisnips @@ -0,0 +1 @@ +Subproject commit 5352d98f212e273b3e8b1d84efdbe2d6a6d557e9 diff --git a/vim/bundle/vim-gitgutter b/vim/bundle/vim-gitgutter index 9ecce5a..f16cf53 160000 --- a/vim/bundle/vim-gitgutter +++ b/vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit 9ecce5a269bdbb0c5081d00b412ec41c562b6155 +Subproject commit f16cf539a23fc980af1293bebdae61a595baa90c diff --git a/vim/bundle/vim-snipmate b/vim/bundle/vim-snipmate deleted file mode 160000 index f1432b6..0000000 --- a/vim/bundle/vim-snipmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1432b6022c9815cd89b9197b06e3efdc3596b78 diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 527f21a..7b02b74 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 527f21a1903501811a515ae959dcd940d1da43f4 +Subproject commit 7b02b74edf5de3d4864b7601fbd83ccc2671d0ba diff --git a/vim/bundle/vim-table-mode b/vim/bundle/vim-table-mode index 35b41e0..4e41af8 160000 --- a/vim/bundle/vim-table-mode +++ b/vim/bundle/vim-table-mode @@ -1 +1 @@ -Subproject commit 35b41e082212776006fb7c18b406545ed8395ad8 +Subproject commit 4e41af8e5f0bf53326d1b83c2feb1eff89fe90d4 diff --git a/vimrc b/vimrc index 8776cac..75a75ce 100644 --- a/vimrc +++ b/vimrc @@ -104,5 +104,10 @@ map :call LangToggle() " TODO bind F2 to execute gnu ident on whole file and ensure that if it fails, no change is done. " TODO check if .tags exists and alternativelly warn that it missing +" UltiSnips triggers +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" + let g:ycm_path_to_python_interpreter="/usr/bin/python3" let g:ycm_global_ycm_extra_conf = ".ycm_conf.py" -- cgit v1.2.3 From 82ad76d017ab7e098aa13f84d39c8b9df888c5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 22 Apr 2017 10:39:13 +0200 Subject: Various small changes and fixes --- config/i3/config | 2 +- conkerorrc | 2 +- service/syncemail | 5 +++-- shellrc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/i3/config b/config/i3/config index 46451e4..430993e 100644 --- a/config/i3/config +++ b/config/i3/config @@ -34,7 +34,7 @@ bindsym $mod+q kill # There also is the (new) i3-dmenu-desktop which only displays applications # shipping a .desktop file. It is a wrapper around dmenu, so you need that # installed. -bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --entry-type=filename +bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --entry-type=name # bar toggle, hide or show bindsym $mod+m bar mode toggle diff --git a/conkerorrc b/conkerorrc index c3a8c0a..58fe928 100644 --- a/conkerorrc +++ b/conkerorrc @@ -20,7 +20,7 @@ define_opensearch_webjump("?g", "google.xml"); define_opensearch_webjump("?w", "wikipedia.xml"); define_opensearch_webjump("?e", "eBay.xml"); -external_content_handlers.set("application/pdf", "okular"); +external_content_handlers.set("application/pdf", "llpp"); external_content_handlers.set("video/*", "vlc"); editor_shell_command = "urxvt -e vim"; diff --git a/service/syncemail b/service/syncemail index 7465676..a42e380 100755 --- a/service/syncemail +++ b/service/syncemail @@ -14,6 +14,7 @@ start() { } stop() { - kill "$(cat $pidfile)" - wait "$(cat $pidfile)" + PID="$(cat $pidfile)" + kill $PID 2>/dev/null + while kill -0 $PID 2>/dev/null; do sleep 1; done } diff --git a/shellrc b/shellrc index 3d9c29d..ce625aa 100644 --- a/shellrc +++ b/shellrc @@ -14,7 +14,7 @@ alias cgdb='cgdb -q' alias octave='octave-cli -q' alias ssh='TERM="xterm-256color" ssh' alias feh='feh --magick-timeout 1 -.' -alias make='make -j 8' +alias make="make -j$(nproc)" export LESS=-R export LESS_TERMCAP_mb=$'\E[1;31m' -- cgit v1.2.3 From 5d967667ad91bfff9cc663d84316699963bf4905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 26 Apr 2017 10:41:03 +0200 Subject: Offlineimap remove unsupported option --- config/offlineimap/config | 3 +-- private | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config/offlineimap/config b/config/offlineimap/config index 53ccda1..6853963 100755 --- a/config/offlineimap/config +++ b/config/offlineimap/config @@ -17,7 +17,6 @@ localfolders = ~/.mail/email [Account email] localrepository = email-local remoterepository = email-remote -status_backend = sqlite -autorefresh = 5 +autorefresh = 1 postsynchook = ~/.local/sbin/newmail-notify diff --git a/private b/private index 3b11f0b..be3e564 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 3b11f0bb0bce7f594ee4ba1dddc1aea8bdeb5cc5 +Subproject commit be3e5644fc9690a90c1cade89c0c5393b3b3b0de -- cgit v1.2.3 From 010a14c4d12af624c00d257d27d53a14abd2b7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 28 Apr 2017 14:52:18 +0200 Subject: Add xshot and clip X utility scripts --- install | 8 ++++---- local/bin/clip | 2 ++ local/bin/xshot | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100755 local/bin/clip create mode 100755 local/bin/xshot diff --git a/install b/install index 15b8994..66d4251 100755 --- a/install +++ b/install @@ -101,10 +101,10 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then inst local/bin/sys-reboot ~/.local/bin/ inst local/bin/sys-shutdown ~/.local/bin/ inst local/bin/sys-suspend ~/.local/bin/ -fi - -read -p "Install Gtk+ and Qt theme setup? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then + # Some small Xserver tools + inst local/bin/clip ~/.local/bin/ + inst local/bin/xshot ~/.local/bin/ + # Theme inst gtk-2.0/gtkrc ~/.gtkrc-2.0 inst gtk-3.0/ ~/.config/gtk-3.0/ inst config/Trolltech.conf ~/.config/Trolltech.conf diff --git a/local/bin/clip b/local/bin/clip new file mode 100755 index 0000000..1281090 --- /dev/null +++ b/local/bin/clip @@ -0,0 +1,2 @@ +#!/bin/sh +xclip -selection clipboard diff --git a/local/bin/xshot b/local/bin/xshot new file mode 100755 index 0000000..90f91af --- /dev/null +++ b/local/bin/xshot @@ -0,0 +1,2 @@ +#!/bin/sh +import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png -- cgit v1.2.3 From 7c7dfb2050d584e8de6e7fb68224e371dc0c8178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 10:48:21 +0200 Subject: Vim modules add nerdcommenter and indent-guides and updates --- .gitmodules | 6 ++++++ vim/bundle/YouCompleteMe | 2 +- vim/bundle/lightline.vim | 2 +- vim/bundle/nerdcommenter | 1 + vim/bundle/syntastic | 2 +- vim/bundle/vim-gitgutter | 2 +- vim/bundle/vim-indent-guides | 1 + vim/bundle/vim-snippets | 2 +- 8 files changed, 13 insertions(+), 5 deletions(-) create mode 160000 vim/bundle/nerdcommenter create mode 160000 vim/bundle/vim-indent-guides diff --git a/.gitmodules b/.gitmodules index 2489650..b169170 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,9 @@ [submodule "vim/bundle/ultisnips"] path = vim/bundle/ultisnips url = https://github.com/SirVer/ultisnips.git +[submodule "vim/bundle/nerdcommenter"] + path = vim/bundle/nerdcommenter + url = https://github.com/scrooloose/nerdcommenter.git +[submodule "vim/bundle/vim-indent-guides"] + path = vim/bundle/vim-indent-guides + url = git://github.com/nathanaelkane/vim-indent-guides.git diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index 5198fd9..ba779af 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 5198fd9a09960b9a1919ef2400007f9bfab33a65 +Subproject commit ba779afffba8ba67c6928be7ba60022a7794c9a0 diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index 15509c6..6034e63 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit 15509c6fa6b15c36d6bbb0068d4cfa8a2e24c003 +Subproject commit 6034e639e871cb33a436508a6c6ccbe3e236de4c diff --git a/vim/bundle/nerdcommenter b/vim/bundle/nerdcommenter new file mode 160000 index 0000000..2859027 --- /dev/null +++ b/vim/bundle/nerdcommenter @@ -0,0 +1 @@ +Subproject commit 285902752f7ab2052ac700a6d29b263dd5788afb diff --git a/vim/bundle/syntastic b/vim/bundle/syntastic index 0bfac45..6cf4f5c 160000 --- a/vim/bundle/syntastic +++ b/vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 0bfac45565efa4e94364818b3b0cb2ee46826a0f +Subproject commit 6cf4f5ca76059caf229bc32c8e613cb137e0faed diff --git a/vim/bundle/vim-gitgutter b/vim/bundle/vim-gitgutter index f16cf53..b803a28 160000 --- a/vim/bundle/vim-gitgutter +++ b/vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit f16cf539a23fc980af1293bebdae61a595baa90c +Subproject commit b803a28f47b26d16f5fe9e747850992c9985c667 diff --git a/vim/bundle/vim-indent-guides b/vim/bundle/vim-indent-guides new file mode 160000 index 0000000..018298e --- /dev/null +++ b/vim/bundle/vim-indent-guides @@ -0,0 +1 @@ +Subproject commit 018298ead9d3aa9cd3b4ae222f81022a33978b09 diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 7b02b74..620bfad 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 7b02b74edf5de3d4864b7601fbd83ccc2671d0ba +Subproject commit 620bfaddbf7807e1c7fec1a9cc8ffa2c7fb0d4b3 -- cgit v1.2.3 From a2470a03197893500545e0b33892414ace204c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 10:57:23 +0200 Subject: Add colors to printed messages --- install | 42 ++++++++++++++---------------------------- utils/inst | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/install b/install index 66d4251..8b33e60 100755 --- a/install +++ b/install @@ -10,40 +10,34 @@ git submodule update --init || (echo "Submodule update failed!"; exit 5) ################################################################################# source private/install # private files, sorry but some privacy is required. -read -p "Install Bashrc? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install Bashrc?"; then inst bashrc ~/.bashrc inst shellrc ~/.shellrc inst profile ~/.profile fi -read -p "Install zshrc? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install zshrc?"; then inst zshrc ~/.zshrc inst shellrc ~/.shellrc inst zprofile ~/.zprofile fi -read -p "Install GIT configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install GIT configuration?"; then inst gitconfig ~/.gitconfig inst local/git-prompt.sh ~/.local/ fi -read -p "Install configurations for various utility tools? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install configurations for various utility tools?"; then inst screenrc ~/.screenrc fi -read -p "Install user services? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install user services?"; then inst local/sbin/user-service.sh ~/.local/sbin/user-service.sh inst service/ ~/.service/ fi -read -p "Install VIM scripts? (Y/n) " YCM_PATH=~/.vim/bundle/YouCompleteMe -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install VIM scripts?"; then # See if we have anything different from what we have in repository YCM_REV="$(cd $YCM_PATH && git --work-tree=. diff --exit-code -s && echo y)" inst vimrc ~/.vimrc @@ -59,16 +53,14 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then fi fi -read -p "Install ranger configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install ranger configuration?"; then mkdir -p ~/.config/ranger inst config/ranger/rc.conf ~/.config/ranger/rc.conf inst config/ranger/rifle.conf ~/.config/ranger/rifle.conf inst config/ranger/scope.sh ~/.config/ranger/scope.sh fi -read -p "Install email synchronization? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install email synchronization?"; then inst local/bin/email-unread ~/.local/bin/email-unread inst local/sbin/newmail-notify ~/.local/sbin/newmail-notify inst_email_sync @@ -77,8 +69,7 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then # inst config/offlineimap/ ~/.config/offlineimap fi -read -p "Install mutt configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install mutt configuration?"; then inst urlview ~/.urlview inst mutt/mailcap ~/.mutt/ inst mutt/gpg.rc ~/.mutt/ @@ -90,8 +81,7 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then mkdir -p ~/.cache/mutt # directory for temporaly html files fi -read -p "Install i3 configuration and related tools? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install i3 configuration and related tools?"; then inst xinitrc ~/.xinitrc inst Xresources ~/.Xresources inst config/i3/ ~/.config/i3 @@ -110,23 +100,19 @@ if [[ $REPLY =~ ^[Yy]?$ ]]; then inst config/Trolltech.conf ~/.config/Trolltech.conf fi -read -p "Install Conkeror configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install Conkeror configuration?"; then inst conkerorrc ~/.conkerorrc inst conkeror/ ~/.conkeror fi -read -p "Install MPD configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install MPD configuration?"; then inst config/mpd/ ~/.config/mpd fi -read -p "Install backup script? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install backup script?"; then inst local/bin/system-backup ~/.local/bin/system-backup fi -read -p "Install lxc-net script? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install lxc-net script?"; then inst local/bin/lxc-net ~/.local/bin/lxc-net fi diff --git a/utils/inst b/utils/inst index b9da163..7fd648f 100644 --- a/utils/inst +++ b/utils/inst @@ -1,6 +1,12 @@ # Functions used for interactive installation of new changes to running system # vim: ft=sh +ask() { + echo -ne "\e[1;34m$1 (Y/n) \e[0m" + read + return [[ $REPLY =~ ^[Yy]?$ ]] +} + dodiff() { if [ -d "$2" ]; then # If we just copying some file to directory @@ -9,7 +15,7 @@ dodiff() { OUT=$2 fi if ! [ -f "$OUT" ]; then - echo "Not installed: $1 => $OUT" + echo -e "\e[1;33mNot installed:\e[0m $1 => $OUT" read -p "Install? (Y/n) " if [[ $REPLY =~ ^[Yy]?$ ]]; then doinst "$1" "$OUT" @@ -17,7 +23,7 @@ dodiff() { return fi if cmp "$1" "$OUT" >/dev/null; then - echo "No difference detected: $OUT" + echo -e "\e[1;32mNo difference detected:\e[0m $OUT" return fi vimdiff "$1" "$OUT" @@ -31,7 +37,7 @@ checkdiff() { # directory than it have to have trailing slash to ensure that no # additional directory is created. if ! echo "$1" | grep -qE '/$'; then - echo ERROR: Directory without trailing slash detected: $1 + echo -e "\e[1;31mERROR: Directory without trailing slash detected:\e[0m $1" exit 1 fi # Got trough all files ignoring git repositories @@ -43,7 +49,7 @@ checkdiff() { for d in `find "$1" -type d -print -exec test -e '{}'/.git \; -prune`; do D="${d#$1}" if [ ! -d "$2/$D" ]; then - echo "Directory not installed: $1/$D => $2/$D" + echo -e "\e[1;33mDirectory not installed:\e[0m $1/$D => $2/$D" read -p "Install? (Y/n) " if [[ $REPLY =~ ^[Yy]?$ ]]; then doinst "$1/$D/" "$2/$D" @@ -57,9 +63,9 @@ checkdiff() { cd "$2/$G" # Check if we have any change at all if git --work-tree=. diff --exit-code -s; then - echo "No difference detected in git: $2/$G" + echo -e "\e[1;32mNo difference detected in git:\e[0m $2/$G" else - echo "Checkout of git repository: $2/$G" + echo -e "\e[0;32mCheckout of git repository:\e[0m $2/$G" # Checkout all files to HEAD git --work-tree=. checkout -f HEAD # Update all submodules @@ -77,14 +83,14 @@ checkdiff() { # commands not on deployed tree but on tree in this repository, so we need specify # work tree on command line every time we want target deployed work tree. doinst() { - echo rsync -rlpt $1 $2 + echo -e "\e[1;34mrsync -rlpt $1 $2\e[0m" rsync -rlpt $1 $2 # Now edit all .git files in target directory for g in `find "$2" -name '.git' -type f`; do if ! grep -q "gitdir: " "$g"; then continue # Probably not a git repository or who knows. fi - echo "Pointing git repository $g to this repository" + echo -e "\e[1;34mPointing git repository $g to this repository\e[0m" echo gitdir: $PWD/.git`sed "s/^gitdir: [./]*git//" "$g"` > "$g" done } -- cgit v1.2.3 From 1a1dd59b890504ef29f0cc6b303c1b16c94b7753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 11:09:34 +0200 Subject: Some fixes and update gtk configuration --- gtk-2.0/gtkrc | 2 ++ gtk-3.0/settings.ini | 2 ++ utils/inst | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk-2.0/gtkrc b/gtk-2.0/gtkrc index 9e6f1e7..83482d8 100644 --- a/gtk-2.0/gtkrc +++ b/gtk-2.0/gtkrc @@ -1,2 +1,4 @@ include "/usr/share/themes/Numix-Frost/gtk-2.0/gtkrc" gtk-font-name = "pango monospace 8" +gtk-icon-theme-name = "Adwaita" +gtk-key-theme-name = "Emacs" diff --git a/gtk-3.0/settings.ini b/gtk-3.0/settings.ini index 16f3e6c..87dfad3 100644 --- a/gtk-3.0/settings.ini +++ b/gtk-3.0/settings.ini @@ -2,3 +2,5 @@ gtk-theme-name=Numix-Frost gtk-font-name=pango monospace 8 gtk-cursor-theme-size=12 +gtk-icon-theme-name=Adwaita +gtk-key-theme-name = Emacs diff --git a/utils/inst b/utils/inst index 7fd648f..2dbf474 100644 --- a/utils/inst +++ b/utils/inst @@ -4,7 +4,7 @@ ask() { echo -ne "\e[1;34m$1 (Y/n) \e[0m" read - return [[ $REPLY =~ ^[Yy]?$ ]] + [[ $REPLY =~ ^[Yy]?$ ]] } dodiff() { @@ -22,7 +22,7 @@ dodiff() { fi return fi - if cmp "$1" "$OUT" >/dev/null; then + if cmp "$1" "$OUT" >/dev/null 2>&1; then echo -e "\e[1;32mNo difference detected:\e[0m $OUT" return fi -- cgit v1.2.3 From 915f636ea838810ffffe1dbe53f045a3d339e7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 11:12:56 +0200 Subject: Also color Install? question --- utils/inst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/inst b/utils/inst index 2dbf474..4d44cdf 100644 --- a/utils/inst +++ b/utils/inst @@ -16,8 +16,7 @@ dodiff() { fi if ! [ -f "$OUT" ]; then echo -e "\e[1;33mNot installed:\e[0m $1 => $OUT" - read -p "Install? (Y/n) " - if [[ $REPLY =~ ^[Yy]?$ ]]; then + if ask "Install?"; then doinst "$1" "$OUT" fi return @@ -50,8 +49,7 @@ checkdiff() { D="${d#$1}" if [ ! -d "$2/$D" ]; then echo -e "\e[1;33mDirectory not installed:\e[0m $1/$D => $2/$D" - read -p "Install? (Y/n) " - if [[ $REPLY =~ ^[Yy]?$ ]]; then + if ask "Install?"; then doinst "$1/$D/" "$2/$D" fi fi -- cgit v1.2.3 From d0bb264a9e7b30ba22672e323cb404dfb403c342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 16:04:59 +0200 Subject: Add gentoo issue file --- system/etc/issue | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 system/etc/issue diff --git a/system/etc/issue b/system/etc/issue new file mode 100644 index 0000000..9de90ce --- /dev/null +++ b/system/etc/issue @@ -0,0 +1,13 @@ +\e{blue} + . + .vir. d$b + .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b. + $$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b. + Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$ + "$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$ + d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P + $$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P" + `Q$$P" """ +\e{reset} +\e{green}\n\e{reset} (\s \r) \e{red}\l\e{reset} + -- cgit v1.2.3 From cd4f173dbb4da9f9f6e616a13468a4d229e02af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 16:07:02 +0200 Subject: Add path.sh profile.d file to set PATH variable --- system/etc/profile.d/path.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 system/etc/profile.d/path.sh diff --git a/system/etc/profile.d/path.sh b/system/etc/profile.d/path.sh new file mode 100644 index 0000000..ae00916 --- /dev/null +++ b/system/etc/profile.d/path.sh @@ -0,0 +1 @@ +PATH="$PATH:/usr/sbin:/sbin" -- cgit v1.2.3 From 98305e117e89073e5debca2db60d4cb12b6ad7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 16:33:03 +0200 Subject: Install user-dirs.dirs --- install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install b/install index 8b33e60..873d3d0 100755 --- a/install +++ b/install @@ -81,7 +81,7 @@ if ask "Install mutt configuration?"; then mkdir -p ~/.cache/mutt # directory for temporaly html files fi -if ask "Install i3 configuration and related tools?"; then +if ask "Install desktop (i3..)?"; then inst xinitrc ~/.xinitrc inst Xresources ~/.Xresources inst config/i3/ ~/.config/i3 @@ -98,6 +98,8 @@ if ask "Install i3 configuration and related tools?"; then inst gtk-2.0/gtkrc ~/.gtkrc-2.0 inst gtk-3.0/ ~/.config/gtk-3.0/ inst config/Trolltech.conf ~/.config/Trolltech.conf + # User directories + inst config/user-dirs.dirs ~/.config/user-dirs.dirs fi if ask "Install Conkeror configuration?"; then -- cgit v1.2.3 From 9fbf8d27ddbfb136351780615d42af82ddb42337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 4 May 2017 19:42:50 +0200 Subject: Add xorg config --- system/etc/X11/xorg.conf.d/20-intel.conf | 5 ++++ system/etc/X11/xorg.conf.d/30-composite.conf | 3 ++ system/etc/X11/xorg.conf.d/50-joystick.conf | 8 ++++++ system/etc/X11/xorg.conf.d/50-synaptics.conf | 40 +++++++++++++++++++++++++++ system/etc/X11/xorg.conf.d/90-custom-kbd.conf | 6 ++++ 5 files changed, 62 insertions(+) create mode 100644 system/etc/X11/xorg.conf.d/20-intel.conf create mode 100644 system/etc/X11/xorg.conf.d/30-composite.conf create mode 100644 system/etc/X11/xorg.conf.d/50-joystick.conf create mode 100644 system/etc/X11/xorg.conf.d/50-synaptics.conf create mode 100644 system/etc/X11/xorg.conf.d/90-custom-kbd.conf diff --git a/system/etc/X11/xorg.conf.d/20-intel.conf b/system/etc/X11/xorg.conf.d/20-intel.conf new file mode 100644 index 0000000..c448076 --- /dev/null +++ b/system/etc/X11/xorg.conf.d/20-intel.conf @@ -0,0 +1,5 @@ +Section "Device" + Identifier "Intel Graphics" + Driver "intel" + Option "DRI" "3" +EndSection diff --git a/system/etc/X11/xorg.conf.d/30-composite.conf b/system/etc/X11/xorg.conf.d/30-composite.conf new file mode 100644 index 0000000..d5912cd --- /dev/null +++ b/system/etc/X11/xorg.conf.d/30-composite.conf @@ -0,0 +1,3 @@ +Section "Extensions" + Option "Composite" "Enable" +EndSection diff --git a/system/etc/X11/xorg.conf.d/50-joystick.conf b/system/etc/X11/xorg.conf.d/50-joystick.conf new file mode 100644 index 0000000..1765eb8 --- /dev/null +++ b/system/etc/X11/xorg.conf.d/50-joystick.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "joystick catchall" + MatchIsJoystick "on" + MatchDevicePath "/dev/input/event*" + Driver "joystick" + Option "StartKeysEnabled" "False" #Disable mouse + Option "StartMouseEnabled" "False" #support +EndSection diff --git a/system/etc/X11/xorg.conf.d/50-synaptics.conf b/system/etc/X11/xorg.conf.d/50-synaptics.conf new file mode 100644 index 0000000..13f4571 --- /dev/null +++ b/system/etc/X11/xorg.conf.d/50-synaptics.conf @@ -0,0 +1,40 @@ +# Example xorg.conf.d snippet that assigns the touchpad driver +# to all touchpads. See xorg.conf.d(5) for more information on +# InputClass. +# Additional options may be added in the form of +# Option "OptionName" "value" +# +Section "InputClass" + Identifier "touchpad catchall" + Driver "synaptics" + MatchIsTouchpad "on" + Option "TapButton1" "1" + Option "TapButton2" "3" + Option "TapButton3" "2" + Option "VertTwoFingerScroll" "on" + Option "HorizTwoFingerScroll" "on" + Option "synclient AccelFactor" "0.1" +# This option is recommend on all Linux systems using evdev, but cannot be +# enabled by default. See the following link for details: +# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html + MatchDevicePath "/dev/input/event*" +EndSection + +Section "InputClass" + Identifier "touchpad ignore duplicates" + MatchIsTouchpad "on" + MatchOS "Linux" + MatchDevicePath "/dev/input/mouse*" + Option "Ignore" "on" +EndSection + +# This option enables the bottom right corner to be a right button on clickpads +# and the right and middle top areas to be right / middle buttons on clickpads +# with a top button area. +# This option is only interpreted by clickpads. +Section "InputClass" + Identifier "Default clickpad buttons" + MatchDriver "synaptics" + Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0" + Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%" +EndSection diff --git a/system/etc/X11/xorg.conf.d/90-custom-kbd.conf b/system/etc/X11/xorg.conf.d/90-custom-kbd.conf new file mode 100644 index 0000000..72f1dba --- /dev/null +++ b/system/etc/X11/xorg.conf.d/90-custom-kbd.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "keyboard defaults" + MatchIsKeyboard "on" + + Option "XKbOptions" "caps:escape" +EndSection -- cgit v1.2.3