From 74e973b7327bc7e7bdd8a9d8aafd88051dc5fd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 12 Oct 2017 20:04:48 +0200 Subject: Update some configurations --- local/bin/usbkey | 4 ++-- shellrc | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index bab47df..7e89dea 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -153,7 +153,7 @@ op_openvpn_get() { fi mkdir "openvpn-$NAME" cp "$MOUNT_PATH/openvpn/$NAME.key" "openvpn-$NAME/" - cp "$MOUNT_PATH/openvpn/$NAME.crl" "openvpn-$NAME/" + cp "$MOUNT_PATH/openvpn/$NAME.crt" "openvpn-$NAME/" cp "$MOUNT_PATH/openvpn/ca.crt" "openvpn-$NAME/" cp "$MOUNT_PATH/openvpn/ta.key" "openvpn-$NAME/" @@ -170,7 +170,7 @@ op_openvpn_generate() { ( cd "$MOUNT_PATH/openvpn" # Build request - openssl req -batch -days 3650 -nodes -new -config "openssl.cnf" \ + openssl req -days 3650 -nodes -new -config "openssl.cnf" \ -keyout "$NAME.key" -out "$NAME.csr" # Sign request openssl ca -days 3650 -config "openssl.cnf" \ diff --git a/shellrc b/shellrc index 10f6f2c..b26c8a8 100644 --- a/shellrc +++ b/shellrc @@ -15,6 +15,8 @@ else alias make="make -j$(nproc)" fi alias ll='ls -lh' +alias df='df -h' +alias du='du -h' alias grep='grep --color=auto' alias git='LANG=en_GB git' alias gdb='gdb -q' @@ -51,8 +53,8 @@ fi # Generate random password (optionally takes length of password as first argument) genpasswd() { local l=$1 - if [ "$l" = "" ]; then l=16; fi - tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs + [ -n "$l" ] || l=16 + tr -dc A-Za-z0-9_ < /dev/urandom | head -c "$l" | xargs } # Clip stdin to clipboard -- cgit v1.2.3 From a4dddf01c4229fe8d70aeed002899c4266b5db45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 12 Oct 2017 20:08:07 +0200 Subject: Add SSH config --- install | 4 ++++ private | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install b/install index efce93f..4f87bdf 100755 --- a/install +++ b/install @@ -47,6 +47,10 @@ if ask "Install user services"; then inst service/ ~/.service/ fi +if ask "Install SSH config"; then + inst private/ssh_config ~/.ssh/config +fi + YCM_PATH=~/.vim/bundle/YouCompleteMe if ask "Install VIM scripts"; then # See if we have anything different from what we have in repository diff --git a/private b/private index 487d3bd..ccf02f3 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit 487d3bdb532360a5259df27ccdc339b66b26e97a +Subproject commit ccf02f32e60512089032d31c4d93ff1298ac58e1 -- cgit v1.2.3 From fa94458d522bc650dfc746bb26f2691c24c706b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 13 Oct 2017 12:53:30 +0200 Subject: Update vim plugins --- vim/bundle/YouCompleteMe | 2 +- vim/bundle/ale | 2 +- vim/bundle/lightline.vim | 2 +- vim/bundle/vim-snippets | 2 +- vim/bundle/vim-table-mode | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index 32f1eae..48e3f2c 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 32f1eae9cb8b8c7793f632fd24b2289839bf768e +Subproject commit 48e3f2c9684172d42aec65b8140fd1496a34bd0d diff --git a/vim/bundle/ale b/vim/bundle/ale index e2271b7..663fe75 160000 --- a/vim/bundle/ale +++ b/vim/bundle/ale @@ -1 +1 @@ -Subproject commit e2271b769c6fbf8bc09c6ab729175edf8d77c452 +Subproject commit 663fe75d0faaf038e6f5e67a97940bf10990c0f0 diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index d465f10..0226340 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit d465f10338962799b25571604599f4913c36d266 +Subproject commit 022634035ed1fcfd2dff7974a35d7e894ca796fc diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index e9b8693..7a250bd 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit e9b869380dd96bbfae65daccc4ad46d8db7547fd +Subproject commit 7a250bd0cd250b55ad6d38ace207c41feee2495e diff --git a/vim/bundle/vim-table-mode b/vim/bundle/vim-table-mode index a646b40..9f383b9 160000 --- a/vim/bundle/vim-table-mode +++ b/vim/bundle/vim-table-mode @@ -1 +1 @@ -Subproject commit a646b4033ba86496ee0fff442ce8540551040275 +Subproject commit 9f383b92beb73b75f8920d9cdebe11cc42c90d93 -- cgit v1.2.3 From f322efcb46049a0560b5a53745f3a9928e64d5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 13 Oct 2017 12:53:58 +0200 Subject: Update ssh config --- private | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private b/private index ccf02f3..dc867e0 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit ccf02f32e60512089032d31c4d93ff1298ac58e1 +Subproject commit dc867e045b0698980ac7bf3529a1ceff6d01b441 -- cgit v1.2.3 From a24065603cf94af1910a98b97ac2bf188085e065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 13 Oct 2017 13:39:32 +0200 Subject: Drop archlinux (I am on gentoo now oh yeh) --- archlinux.pkgs | 64 ------------------------- archlinux.pkgs.d/avr | 7 --- archlinux.pkgs.d/desktop | 120 ----------------------------------------------- archlinux.pkgs.d/devel | 55 ---------------------- archlinux.pkgs.d/kicad | 5 -- archlinux.pkgs.d/koci | 42 ----------------- archlinux.pkgs.d/laptop | 30 ------------ archlinux.pkgs.d/latex | 7 --- archlinux.pkgs.d/openrc | 10 ---- archlinux.pkgs.d/ranger | 12 ----- archlinux.pkgs.d/steam | 4 -- archlinux.pkgs.d/wine | 6 --- install | 5 -- utils/arch | 23 --------- utils/install_pacaur | 35 -------------- 15 files changed, 425 deletions(-) delete mode 100644 archlinux.pkgs delete mode 100644 archlinux.pkgs.d/avr delete mode 100644 archlinux.pkgs.d/desktop delete mode 100644 archlinux.pkgs.d/devel delete mode 100644 archlinux.pkgs.d/kicad delete mode 100644 archlinux.pkgs.d/koci delete mode 100644 archlinux.pkgs.d/laptop delete mode 100644 archlinux.pkgs.d/latex delete mode 100644 archlinux.pkgs.d/openrc delete mode 100644 archlinux.pkgs.d/ranger delete mode 100644 archlinux.pkgs.d/steam delete mode 100644 archlinux.pkgs.d/wine delete mode 100644 utils/arch delete mode 100755 utils/install_pacaur diff --git a/archlinux.pkgs b/archlinux.pkgs deleted file mode 100644 index 206aadc..0000000 --- a/archlinux.pkgs +++ /dev/null @@ -1,64 +0,0 @@ -dnl vim:ft=m4 -dnl File containing names of explicitly installed packages on system -esyscmd(`echo define\(HOSTNAME,$(hostname)\)') -sinclude(HOSTNAME) - -dnl Archlinux packages management -pacaur -pkgfile -agetpkg-git -pkgstats - -dnl Various essential console programs -ifdef(`DESKTOP',gvim,vim) -vim-spell-cs -vim-spell-en -screen -htop -openssh -ncdu -rsync -wget -sshfs -zsh -zsh-completions -bash-completion -bc -pv -sysstat - -dnl System stuff -ifdef(`OPENRC',dhcpcd-openrc,dhcpcd) -ifdef(`OPENRC',fuse-openrc,fuse2) -ifdef(`OPENRC',ntp-openrc,ntp) -ufw -sudo -lsof -hdparm -smartmontools - -dnl File systems -btrfs-progs -exfat-utils -dosfstools -parted - -dnl network -bind-tools -nmap -net-tools -nethogs -tcpdump -tcping - -dnl archive -unzip -zip -rar -p7zip - -dnl Color highlight of less -source-highlight - -dnl Base group -syscmd(`pacman -Qg base | awk "{print \$2}"') diff --git a/archlinux.pkgs.d/avr b/archlinux.pkgs.d/avr deleted file mode 100644 index aa83119..0000000 --- a/archlinux.pkgs.d/avr +++ /dev/null @@ -1,7 +0,0 @@ -dnl vim:ft=m4 - -avrdude -avr-gcc -avr-gdb -avr-libc -simavr diff --git a/archlinux.pkgs.d/desktop b/archlinux.pkgs.d/desktop deleted file mode 100644 index 5521678..0000000 --- a/archlinux.pkgs.d/desktop +++ /dev/null @@ -1,120 +0,0 @@ -dnl vim:ft=m4 -define(DESKTOP) - -dnl Some system level stuff -ifdef(`OPENRC',gpm-openrc,gpm) -ifdef(`OPENRC',alsa-utils-openrc, alsa-utils) -ifdef(`OPENRC',lm_sensors-openrc,lm_sensors) -pulseaudio -pulseaudio-alsa -fuseiso - -dnl Some command line tools -lynx -abook -pass -ifdef(`OPENRC',syncthing-openrc,syncthing) -ttysterm -dnl Stardict -sdcv -stardict-cz -stardict-en-cz - -dnl Various graphic programs -gimp -inkscape -audacity -pitivi -vlc -mpv -conkeror -surf-webkit2gtk-git -feh -okular -llpp -graphviz -mesa-demos - -dnl Pidgin -purple-facebook -purple-hangouts-hg -pidgin-encryption -pidgin-gpg-git -pidgin-hotkeys -pidgin-latex -pidgin-libnotify -pidgin-window_merge - -dnl Chromium -ifdef(`NETFLIX',chromium-widevine,chromium) -pepper-flash - -dnl Music player daemon -mpc -mpd -ncmpcpp - -dnl Mail -neomutt -msmtp -offlineimap -python2-daemon -urlview - -dnl My desktop -i3-wm -i3blocks -i3lock -dmenu -dunst -xzoom -ifdef(`OPENRC',xorg-server-nosystemd,xorg-server) -xorg-server-utils -xorg-xinit -xorg-xev -rxvt-unicode-pixbuf -urxvt-perls -urxvt-resize-font-git -urxvt-vtwheel -numlockx -xdotool -inotify-tools -pulsemixer -qt5-styleplugins -numix-frost-themes -faenza-icon-theme -xorg-setxkbmap -xorg-xprop -dnl For app .desktop management -perl-file-mimeinfo - -dnl Fonts -terminus-font -font-mathematica -ttf-hack -ttf-symbola -noto-fonts-emoji -emojione-color-font -twemoji-color-font -texlive-fontsextra -ttf-ms-fonts -ttf-dejavu -ttf-droid -ttf-freefont -ttf-liberation -ttf-linux-libertine - -dnl Codecs -x264 -mpg123 -lib32-mpg123 -gst-libav -lib32-gst-plugins-base-libs - -dnl Matlab fix -ncurses5-compat-libs - -dnl Java blee -jre8-openjdk - -libva-mesa-driver diff --git a/archlinux.pkgs.d/devel b/archlinux.pkgs.d/devel deleted file mode 100644 index 86ca5cd..0000000 --- a/archlinux.pkgs.d/devel +++ /dev/null @@ -1,55 +0,0 @@ -dnl vim:ft=m4 -define(DEVEL) - -dnl devel group -syscmd(`pacman -Qg base-devel | awk "{print \$2}"') - -dnl yep ansible -ansible -dnl I sometimes use busybox for testing scripts -busybox - -dnl Stuff used durring development -tig -dash -mkdocs -asciidoc -cppcheck -ctags -valgrind -texlive-latexextra -git -cgdb -cscope -gcovr -strace -dnl Web -ruby -ruby-jekyll - -dnl Python -twine -flake8 -ipython -python-pypandoc -python-xattr -python2-xattr -python-daemon - -dnl Perl -perl-common-sense - -dnl Rust -rust -cargo - -dnl Building stuff -clang -cmake -patch -ccache -clang-tools-extra - -dnl work devel -lua51 -lcov diff --git a/archlinux.pkgs.d/kicad b/archlinux.pkgs.d/kicad deleted file mode 100644 index b500a6e..0000000 --- a/archlinux.pkgs.d/kicad +++ /dev/null @@ -1,5 +0,0 @@ -dnl vim:ft=m4 - -kicad -kicad-library -kicad-library-3d diff --git a/archlinux.pkgs.d/koci b/archlinux.pkgs.d/koci deleted file mode 100644 index 26bf94c..0000000 --- a/archlinux.pkgs.d/koci +++ /dev/null @@ -1,42 +0,0 @@ -dnl vim:ft=m4 -dnl My work pc -include(desktop) -include(devel) -include(latex) - -intel-ucode - -openvpn -easy-rsa -qemu-arch-extra -octave -ndisc6 -indent -sig2dot -strace -traceroute - -dnl TODO why the hack I need this? -xinetd - -python-numpy -python-scipy -python-pip -swig - -dnl OpenWRT build -vagrant -dnl for testing -stress - -dnl Something for lxc -lxc -arch-install-scripts -debootstrap -dhcp - -docker -gnu-netcat -doxygen -massif-visualizer -linux-headers diff --git a/archlinux.pkgs.d/laptop b/archlinux.pkgs.d/laptop deleted file mode 100644 index 55dd88c..0000000 --- a/archlinux.pkgs.d/laptop +++ /dev/null @@ -1,30 +0,0 @@ -dnl vim:ft=m4 -define(LAPTOP) -include(desktop) - -dnl System essentials -syslinux -efibootmgr -acpid-openrc -xf86-input-synaptics -xf86-video-intel - -dnl Network -wpa_supplicant-openrc -iw -wireless_tools -rfkill - -dnl Also system but not exactly essential for me -cpupower-openrc -powertop -pm-utils -acpi - -dnl bluetooth -bluez -bluez-utils -bluez-hid2hci -obexfs -obextool -pulseaudio-bluetooth diff --git a/archlinux.pkgs.d/latex b/archlinux.pkgs.d/latex deleted file mode 100644 index 376eecc..0000000 --- a/archlinux.pkgs.d/latex +++ /dev/null @@ -1,7 +0,0 @@ -dnl vim:ft=m4 -define(LATEX) - -dnl texlive-most and texlive-lang groups -syscmd(`pacman -Qg texlive-most | awk "{print \$2}"') -syscmd(`pacman -Qg texlive-lang | awk "{print \$2}"') - diff --git a/archlinux.pkgs.d/openrc b/archlinux.pkgs.d/openrc deleted file mode 100644 index bd8d991..0000000 --- a/archlinux.pkgs.d/openrc +++ /dev/null @@ -1,10 +0,0 @@ -dnl vim:ft=m4 -define(OPENRC) - -syscmd(`pacman -Qg base-openrc | awk "{print \$2}"') -syslog-ng-openrc -cronie-openrc -bluez-openrc -consolekit-openrc -libpulse-nosystemd -systemd-dummy diff --git a/archlinux.pkgs.d/ranger b/archlinux.pkgs.d/ranger deleted file mode 100644 index d4aee2e..0000000 --- a/archlinux.pkgs.d/ranger +++ /dev/null @@ -1,12 +0,0 @@ -dnl vim:ft=m4 -dnl Prety good files browser -ranger - -dnl Optional dependencies -atool -highlight -mediainfo -perl-image-exiftool -w3m -catdoc -fbida diff --git a/archlinux.pkgs.d/steam b/archlinux.pkgs.d/steam deleted file mode 100644 index db6ed40..0000000 --- a/archlinux.pkgs.d/steam +++ /dev/null @@ -1,4 +0,0 @@ -dnl vim:ft=m4 - -steam -steam-native-runtime diff --git a/archlinux.pkgs.d/wine b/archlinux.pkgs.d/wine deleted file mode 100644 index ae6c153..0000000 --- a/archlinux.pkgs.d/wine +++ /dev/null @@ -1,6 +0,0 @@ -dnl vim:ft=m4 - -wine -wine_gecko -wine-mono -winetricks diff --git a/install b/install index 4f87bdf..6123f9a 100755 --- a/install +++ b/install @@ -13,11 +13,6 @@ git submodule update --init --recursive || (echo "Submodule update failed!"; exi ################################################################################# source private/install # private files, sorry but some privacy is required. -if [ -e /etc/arch-release ] && ask "Archlinux software"; then - source utils/arch - archlinux_inst -fi - if ask "Install Bashrc"; then inst bashrc ~/.bashrc inst shellrc ~/.shellrc diff --git a/utils/arch b/utils/arch deleted file mode 100644 index ccf1133..0000000 --- a/utils/arch +++ /dev/null @@ -1,23 +0,0 @@ -# Archlinux system installation and compare -# vim: ft=sh - -archlinux_inst() { - # Check if we are on archlinux - if ! [ -e /etc/arch-release ]; then - echo Archlinux not detected! >&2 - return - fi - # Now check for pacaur and optionally install - if ! pacaur --version 2>&1 >/dev/null; then - echo Please install pacaur! >&2 - return - fi - - TFILE1=$(mktemp myconfigs-pacaur1-XXXXX) - m4 archlinux.pkgs -I archlinux.pkgs.d | grep -E '^[^ ]+$' | sort | uniq > "$TFILE1" - TFILE2=$(mktemp myconfigs-pacaur2-XXXXX) - pacaur -Qqe | sort > "$TFILE2" - echo " Required Local" - diff --suppress-common-lines -ay "$TFILE1" "$TFILE2" - rm "$TFILE1" "$TFILE2" -} diff --git a/utils/install_pacaur b/utils/install_pacaur deleted file mode 100755 index 0cabd46..0000000 --- a/utils/install_pacaur +++ /dev/null @@ -1,35 +0,0 @@ -# vim: ft=sh - -# Installs pacaur -# This expect base and base-devel to be installed -set -e - -if pacaur --version 2>&1 1>/dev/null; then - echo "Pacaur seems to be installed already" - exit 0 -fi - -# Make sure that we have wget -sudo pacman --needed -S wget -# Download pacaur tar -wget https://aur.archlinux.org/cgit/aur.git/snapshot/pacaur.tar.gz -# Download cower (pacaur dependency) -wget https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz - -# Receive cower gpg key -gpg --keyserver pgp.mit.edu --recv-keys 1EB2638FF56C0C53 - -# Install cower -tar -xzf cower.tar.gz -cd cower -makepkg -Acis -cd .. -rm -rf cower cower.tar.gz -# Install pacaur -tar -xzf pacaur.tar.gz -cd pacaur -makepkg -Acis -cd .. -rm -rf pacaur pacaur.tar.gz -# Set cower to be just an dependency -pacman -D --asdeps cower -- cgit v1.2.3 From 074c1fcb39ae5078abb00075f5cda04b9d167fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 13 Oct 2017 13:41:32 +0200 Subject: Also drop archlinux from system_install --- system_install | 8 -------- 1 file changed, 8 deletions(-) diff --git a/system_install b/system_install index 69dbac7..5f231a8 100755 --- a/system_install +++ b/system_install @@ -17,14 +17,6 @@ git submodule update --init || (echo "Submodule update failed!"; exit 5) ################################################################################# -if [ -e /etc/arch-release ]; then - . ./utils/arch - read -p "Check Archlinux packages? (Y/n) " - if [[ $REPLY =~ ^[Yy]?$ ]]; then - archlinux_inst - fi -fi - if ask "Laptop ACPI and pm"; then inst system/etc/acpi/handler.sh /etc/acpi/handler.sh inst system/etc/pm/sleep.d/10lock /etc/pm/sleep.d/10lock -- cgit v1.2.3 From ef44451e7a7a60ec2c6382f811f709fa5686c2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 18 Oct 2017 10:55:51 +0200 Subject: Automatically make parent directory in doinst --- utils/inst | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/inst b/utils/inst index 5279365..9987fff 100644 --- a/utils/inst +++ b/utils/inst @@ -102,6 +102,7 @@ checkdiff() { doinst() { echo -e "\e[1;34mrsync -rlpt $1 $2\e[0m" + mkdir -p "$(dirname "$2")" rsync -rlpt $1 $2 # Now edit all .git files in target directory for g in `find "$1" -name '.git' -type f`; do -- cgit v1.2.3 From 7ca61f073f215214bcd997408a8a4b4b0c37705e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 18 Oct 2017 10:56:40 +0200 Subject: Add surf configuration --- config/i3/config | 1 + install | 6 ++ local/bin/surf-menu | 43 +++++++++++ surf/script.js | 186 ++++++++++++++++++++++++++++++++++++++++++++++++ surf/styles/default.css | 0 5 files changed, 236 insertions(+) create mode 100755 local/bin/surf-menu create mode 100644 surf/script.js create mode 100644 surf/styles/default.css diff --git a/config/i3/config b/config/i3/config index 430993e..509d182 100644 --- a/config/i3/config +++ b/config/i3/config @@ -25,6 +25,7 @@ floating_modifier $mod # start a terminal bindsym $mod+Return exec urxvt bindsym $mod+Shift+Return exec conkeror & pidgin +bindsym $mod+Shift+d exec surf-menu # kill focused window bindsym $mod+q kill diff --git a/install b/install index 6123f9a..751760c 100755 --- a/install +++ b/install @@ -105,6 +105,12 @@ if ask "Install Conkeror configuration"; then inst conkeror/ ~/.conkeror fi +if ask "Install Surf configuration"; then + inst surf/script.js ~/.surf/script.js + inst surf/theme/default.css ~/.surf/theme/default.css + inst local/bin/surf-menu ~/.local/bin/surf-menu +fi + if ask "Install MPD configuration"; then inst config/mpd/ ~/.config/mpd fi diff --git a/local/bin/surf-menu b/local/bin/surf-menu new file mode 100755 index 0000000..bd13e6b --- /dev/null +++ b/local/bin/surf-menu @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +BOOKMARDS=~/notes/bookmarks.md + +# Note: Bookmarks starts with '* ' +sed -n 's/\* //p' "$BOOKMARDS" | dmenu -p 'surf' | while read L; do + if echo "$L" | grep -qE '^\?'; then # We do search on duckduckgo + + surf "https://duckduckgo.com/?q=${L#?}&t=surf&kk=-1&ia=web" + + else # We follow address + + LPROTOCOL="$(echo "$L" | sed -n 's#^\([^:]*\)://.*#\1#p')" + LHOST="$(echo "$L" | sed -n 's#^[^:]*://##;s#^\([^/]\+\)/\?.*#\1#p')" + LPATH="$(echo "$L" | sed 's#^[^:]*://##;s#^[^/]\+/\?##')" + + # Try to lookup if it's an real address + # Note: This is hack because of youtube, nslookup return No answer but + # exists with 0. So I am checking if it returned more than one address + # (one address is for dns server). + if [ "$(nslookup "$LHOST" | grep 'Address:' | wc -l)" -le 1 ]; then # It's a real address + if nslookup "$LHOST.cz" >/dev/null; then # we can expand it with cz + LHOST="$LHOST.cz" + elif nslookup "$LHOST.com" >/dev/null; then # we can expand it with com + LHOST="$LHOST.com" + fi + # TODO what to do when we can't expand it? + fi + # Decide on protocol (if connection to 443 is not possible then use http otherwise https) + if [ -z "$LPROTOCOL" ]; then # We already have protocol (given explicitly) + if nc -z -w1 "$LHOST" 443 2>/dev/null; then + LPROTOCOL="https" + else + LPROTOCOL="http" + fi + fi + + surf "$LPROTOCOL://$LHOST/$LPATH" & # run backgrounded + + fi + +done diff --git a/surf/script.js b/surf/script.js new file mode 100644 index 0000000..36ff8a6 --- /dev/null +++ b/surf/script.js @@ -0,0 +1,186 @@ + +// Easylinks (inspired but my own implementation) +var elink_modkey = 18; //ctrl=17, alt=18 +var elink_copykey = 67; // c +var elink_newwinkey = 84; // t +var elink_openkey = 70; // f + +var elink_ankers = {}; +var elink_labels = {}; + +// Creates visual tags on website +elink_create = function() { + // Just to be sure remove any previous one first + elink_remove(); + // Get all a and input elements + elink_ankers = document.getElementsByTagName("a"); + elink_ankers.push.apply( document.getElementsByTagName("input") ); + // For every anker create label + for (var i=0; i=10 : normal integer, + + // globals + var ankers = document.getElementsByTagName("a"); + var labels = new Object(); + var ui_visible = false; + var input = ""; + + // functions + hl=function(t) { + for(var id in labels) { + if (t && id.match("^"+t)==t) + for(var s in hl_style) + labels[id].rep.style[s]=hl_style[s]; + else + for(var s in label_style) + labels[id].rep.style[s]=label_style[s]; + } + } + open_link=function(id, new_win) { + try { + var a = labels[input].a; + if(a && !new_win) window.location.href=a.href; + if(a && new_win) window.open(a.href,a.href); + } catch (e) {} + } + set_ui=function(s) { + var pos = "static"; + ui_visible = true; + if(s == "hidden") { + ui_visible = false; + pos = "absolute"; + input=""; + } + for(var id in labels) { + labels[id].rep.style.visibility=s; + labels[id].rep.style.position=pos; + } + } + base=function(n, b) { + if(b>=10) return n.toString(); + var res = new Array(); + while(n) { + res.push( (n%b +1).toString() ) + n=parseInt(n/b); + } + return res.reverse().join(""); + } + + // main + // create labels + for (var i=0; i Date: Wed, 18 Oct 2017 11:06:17 +0200 Subject: Fix surf config install --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 751760c..ffbf348 100755 --- a/install +++ b/install @@ -107,7 +107,7 @@ fi if ask "Install Surf configuration"; then inst surf/script.js ~/.surf/script.js - inst surf/theme/default.css ~/.surf/theme/default.css + inst surf/styles/default.css ~/.surf/styles/default.css inst local/bin/surf-menu ~/.local/bin/surf-menu fi -- cgit v1.2.3 From c6cc9f526eaf1ab3f676d37c4f11dc013bdcde2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 19 Oct 2017 12:15:35 +0200 Subject: Add gitbnew function to shellrc --- shellrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shellrc b/shellrc index b26c8a8..321c10a 100644 --- a/shellrc +++ b/shellrc @@ -90,6 +90,15 @@ gitbmerge() { ) } +# Create new branch from master +gitbnew() { + git branch "$1" master + local NW="$(git rev-parse --show-toplevel)-$1" + git worktree add "$NW" $1 + cd "$NW" + git submodule update --init --recursive +} + # Make screenshot xshot() { import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png -- cgit v1.2.3 From 8b055c6e83f619f3eab61f18ae6743874a99927d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 19 Oct 2017 12:15:57 +0200 Subject: Tiny but important change in usbkey --- local/bin/usbkey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local/bin/usbkey b/local/bin/usbkey index 7e89dea..e6cc42e 100755 --- a/local/bin/usbkey +++ b/local/bin/usbkey @@ -134,7 +134,7 @@ op_ssh_import() { } # Note OpenVPN: CA generated using following command -# openssl req -nodes -new -x509 -keyout ca.key -out ca.crt -config openssl.cnf +# openssl req -nodes -new -x509 -days 3650 -keyout ca.key -out ca.crt -config openssl.cnf op_openvpn_list() { check_mount || op_mount -- cgit v1.2.3 From 00182ed5254657dd1d6fdc2c6e20cd6c3478c4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 19 Oct 2017 22:35:03 +0200 Subject: Update vim modules and more --- private | 2 +- vim/bundle/YouCompleteMe | 2 +- vim/bundle/ale | 2 +- vim/bundle/lightline.vim | 2 +- vim/bundle/tagbar | 2 +- vim/bundle/vim-gitgutter | 2 +- vim/bundle/vim-snippets | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/private b/private index dc867e0..d3e0daa 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit dc867e045b0698980ac7bf3529a1ceff6d01b441 +Subproject commit d3e0daa2a380633e612ea70e546ca3fcc6bbe76f diff --git a/vim/bundle/YouCompleteMe b/vim/bundle/YouCompleteMe index 48e3f2c..cd41727 160000 --- a/vim/bundle/YouCompleteMe +++ b/vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 48e3f2c9684172d42aec65b8140fd1496a34bd0d +Subproject commit cd4172746279fbe177e18e7731a92ede8054e598 diff --git a/vim/bundle/ale b/vim/bundle/ale index 663fe75..658ec4b 160000 --- a/vim/bundle/ale +++ b/vim/bundle/ale @@ -1 +1 @@ -Subproject commit 663fe75d0faaf038e6f5e67a97940bf10990c0f0 +Subproject commit 658ec4b10e5cb290d5c689893c01f9afa817afc6 diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index 0226340..89b32d1 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit 022634035ed1fcfd2dff7974a35d7e894ca796fc +Subproject commit 89b32d170405b9085bed9cfb6bc4bab8cd8bd81c diff --git a/vim/bundle/tagbar b/vim/bundle/tagbar index bef1fa4..dc155af 160000 --- a/vim/bundle/tagbar +++ b/vim/bundle/tagbar @@ -1 +1 @@ -Subproject commit bef1fa408026e5fb9df1b2ec5d339039098df7c2 +Subproject commit dc155af2fdd20e081680d777bde558c56f8d55c3 diff --git a/vim/bundle/vim-gitgutter b/vim/bundle/vim-gitgutter index dc73a81..54209a0 160000 --- a/vim/bundle/vim-gitgutter +++ b/vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit dc73a81bfe59a9de090b89a1312ded3c6f6a6f89 +Subproject commit 54209a0199bcb9f6b7c452deb0ffbc3aa60b857d diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 7a250bd..bd3762c 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 7a250bd0cd250b55ad6d38ace207c41feee2495e +Subproject commit bd3762c916fbd229fec28fec42024c483e4cd201 -- cgit v1.2.3 From 1254632045b0879f7149727324859d0951faa427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 20 Oct 2017 17:55:41 +0200 Subject: Update browser settings for mutt --- mutt/mailcap | 4 +--- mutt/muttrc | 2 +- private | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mutt/mailcap b/mutt/mailcap index 35d29cd..552afc5 100644 --- a/mutt/mailcap +++ b/mutt/mailcap @@ -1,9 +1,7 @@ ##this is used when (v)iewing a text/html attachment: ##allowing you to browse and "click" links ##order matters the first entry which passes the test is used -#gui browser if $DISPLAY is set -text/html; conkeror %s &; test=test -n "$DISPLAY"; nametemplate=%s.html -#text browser otherwise +#text browser text/html; w3m -v -F -T text/html %s; nametemplate=%s.html; needsterminal ##auto_view will use the entry with the copiousoutput part: diff --git a/mutt/muttrc b/mutt/muttrc index 7fd15f1..8ab4125 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -15,7 +15,7 @@ set ispell="aspell" auto_view text/html alternative_order text/enriched text/plain text/html -macro attach 'V' "cat >~/.cache/mutt/mail.html && conkeror ~/.cache/mutt/mail.html && rm ~/.cache/mutt/mail.html" +macro attach 'V' "cat >~/.cache/mutt/mail.html && ( surf ~/.cache/mutt/mail.html & )" source ~/.mutt/gpg.rc set pgp_use_gpg_agent = yes diff --git a/private b/private index d3e0daa..fb3a9dd 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit d3e0daa2a380633e612ea70e546ca3fcc6bbe76f +Subproject commit fb3a9dd8a718b055168dc1bcac4e9ac19ad06e9e -- cgit v1.2.3 From e908c03fe775787c048ead719220e64b5af8bfe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 20 Oct 2017 18:10:08 +0200 Subject: Update surf configuration --- config/i3/config | 2 +- local/bin/surf-menu | 39 +++++++++++++++++++++++++++++---------- surf/script.js | 1 + 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/config/i3/config b/config/i3/config index 509d182..cbd0b53 100644 --- a/config/i3/config +++ b/config/i3/config @@ -22,7 +22,7 @@ font pango:monospace 8 # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod -# start a terminal +# start a terminal and more bindsym $mod+Return exec urxvt bindsym $mod+Shift+Return exec conkeror & pidgin bindsym $mod+Shift+d exec surf-menu diff --git a/local/bin/surf-menu b/local/bin/surf-menu index bd13e6b..f4925f8 100755 --- a/local/bin/surf-menu +++ b/local/bin/surf-menu @@ -3,17 +3,27 @@ set -e BOOKMARDS=~/notes/bookmarks.md -# Note: Bookmarks starts with '* ' -sed -n 's/\* //p' "$BOOKMARDS" | dmenu -p 'surf' | while read L; do - if echo "$L" | grep -qE '^\?'; then # We do search on duckduckgo +run() { + echo "Run $1" + echo "$1" | grep -qE '^~?/' || true + echo $? + if echo "$1" | grep -qE '^\?'; then # We do search on duckduckgo - surf "https://duckduckgo.com/?q=${L#?}&t=surf&kk=-1&ia=web" + surf "https://duckduckgo.com/?q=${L#?}&t=surf&kk=-1&ia=web" & + + elif echo "$1" | grep -qE '^~?/'; then # This is local path + + surf "${1/#\~/$HOME}" & + + elif echo "$1" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'; then # This ipv4 address + + surf "$1" & else # We follow address - LPROTOCOL="$(echo "$L" | sed -n 's#^\([^:]*\)://.*#\1#p')" - LHOST="$(echo "$L" | sed -n 's#^[^:]*://##;s#^\([^/]\+\)/\?.*#\1#p')" - LPATH="$(echo "$L" | sed 's#^[^:]*://##;s#^[^/]\+/\?##')" + LPROTOCOL="$(echo "$1" | sed -n 's#^\([^:]*\)://.*#\1#p')" + LHOST="$(echo "$1" | sed -n 's#^[^:]*://##;s#^\([^/]\+\)/\?.*#\1#p')" + LPATH="$(echo "$1" | sed 's#^[^:]*://##;s#^[^/]\+/\?##')" # Try to lookup if it's an real address # Note: This is hack because of youtube, nslookup return No answer but @@ -36,8 +46,17 @@ sed -n 's/\* //p' "$BOOKMARDS" | dmenu -p 'surf' | while read L; do fi fi - surf "$LPROTOCOL://$LHOST/$LPATH" & # run backgrounded + surf "$LPROTOCOL://$LHOST/$LPATH" & fi - -done +} + +if [ -n "$1" ]; then + run "$1" + exit +else + # Note: Bookmarks starts with '* ' + sed -n 's/\* //p' "$BOOKMARDS" | dmenu -p 'surf' | while read L; do + run "$L" + done +fi diff --git a/surf/script.js b/surf/script.js index 36ff8a6..07bbbe6 100644 --- a/surf/script.js +++ b/surf/script.js @@ -70,6 +70,7 @@ elink_setup = function() { } // TODO + // Just to be sure that we override website settings if(document.readyState!="complete") { window.setTimeout("elink_setup()",200); } -- cgit v1.2.3 From 167166c9c1c0ab80dc1a67373241181b00b77b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 20 Oct 2017 18:10:23 +0200 Subject: Tiny cleanup --- config/i3blocks/scripts/mpd | 1 - shellrc | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd index 12f0fdd..32babe1 100755 --- a/config/i3blocks/scripts/mpd +++ b/config/i3blocks/scripts/mpd @@ -54,7 +54,6 @@ case "$BLOCK_BUTTON" in ;; esac -STATUS="$(mpc $HOST status)" if echo "$STATUS" | grep -qE "(playing|paused)"; then echo `mpc $HOST -f "♫ %artist%, %album%, %title%" status | head -1` echo diff --git a/shellrc b/shellrc index 321c10a..a01b3e5 100644 --- a/shellrc +++ b/shellrc @@ -7,13 +7,8 @@ ################################################################################# # Aliases -if [ "$(uname -s)" = "FreeBSD" ]; then - alias ls='ls -G' -else - alias ls='ls --color=auto' - eval $(dircolors -b) - alias make="make -j$(nproc)" -fi +alias ls='ls --color=auto' +eval $(dircolors -b) alias ll='ls -lh' alias df='df -h' alias du='du -h' -- cgit v1.2.3 From fc2b873546980bfad62b54575cdb0d40fae895c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 21 Oct 2017 15:03:36 +0200 Subject: Change home ip range --- config/i3blocks/scripts/mpd | 4 ++-- private | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd index 32babe1..914def6 100755 --- a/config/i3blocks/scripts/mpd +++ b/config/i3blocks/scripts/mpd @@ -1,9 +1,9 @@ #!/bin/bash -HOST_HOME="192.168.0.51" +HOST_HOME="10.8.2.51" HOST="" # Let's be sneaky and verify that we are on relevant network before we try to ping -if ip a | grep -q 'inet 192.168.0.' && \ +if ip a | grep -q 'inet 10.8.2.' && \ ping -c 1 -w 1 "$HOST_HOME" >/dev/null 2>&1; then # TODO check that mpd is running? HOST="-h $HOST_HOME" diff --git a/private b/private index fb3a9dd..8b7d38e 160000 --- a/private +++ b/private @@ -1 +1 @@ -Subproject commit fb3a9dd8a718b055168dc1bcac4e9ac19ad06e9e +Subproject commit 8b7d38ed9ff13ff2303262024f4c204cd1eb0cc8 -- cgit v1.2.3 From 7d68f4b5f7adf9b2338055baa5e0bd1073c103a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 21 Oct 2017 15:03:59 +0200 Subject: In surf-menu use getent instead of nslookup --- local/bin/surf-menu | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/local/bin/surf-menu b/local/bin/surf-menu index f4925f8..b2e0111 100755 --- a/local/bin/surf-menu +++ b/local/bin/surf-menu @@ -25,14 +25,12 @@ run() { LHOST="$(echo "$1" | sed -n 's#^[^:]*://##;s#^\([^/]\+\)/\?.*#\1#p')" LPATH="$(echo "$1" | sed 's#^[^:]*://##;s#^[^/]\+/\?##')" - # Try to lookup if it's an real address - # Note: This is hack because of youtube, nslookup return No answer but - # exists with 0. So I am checking if it returned more than one address - # (one address is for dns server). - if [ "$(nslookup "$LHOST" | grep 'Address:' | wc -l)" -le 1 ]; then # It's a real address - if nslookup "$LHOST.cz" >/dev/null; then # we can expand it with cz + if ! getent hosts "$LHOST" >/dev/null; then + if getent hosts "$LHOST.cz" >/dev/null; then LHOST="$LHOST.cz" - elif nslookup "$LHOST.com" >/dev/null; then # we can expand it with com + elif getent hosts "$LHOST.org" >/dev/null; then + LHOST="$LHOST.org" + elif getent hosts "$LHOST.com" >/dev/null; then LHOST="$LHOST.com" fi # TODO what to do when we can't expand it? -- cgit v1.2.3 From 8068d1cde76a1939bdf3b3110c5e8ac3b84714ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 22 Oct 2017 22:08:46 +0200 Subject: Add st to title switch for terminals --- bashrc | 2 +- zshrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index f36391e..0b7cf08 100644 --- a/bashrc +++ b/bashrc @@ -37,7 +37,7 @@ function settitle { echo -ne "\033]0;`whoami`@`hostname`:`pwd`\007" } case "$TERM" in - xterm*|*rxvt*) + xterm*|*rxvt*|*st*) trap 'settitle' DEBUG ;; esac diff --git a/zshrc b/zshrc index ed2058d..ec502b6 100644 --- a/zshrc +++ b/zshrc @@ -109,7 +109,7 @@ compdef _gitbmerge gitbmerge ################################################################ case "$TERM" in - xterm*|*rxvt*) + xterm*|*rxvt*|*st*) precmd() { print -Pn "\e]0;%n@%m:%~ %(1j,%j job%(2j|s|) ,)\a" } -- cgit v1.2.3 From 8cf55e56aeb59c076c26e3bd4636bbf82bb1eeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 22 Oct 2017 22:09:22 +0200 Subject: Cleanup i3 config --- config/i3/config | 134 +++++++++++++++++-------------------------------------- 1 file changed, 42 insertions(+), 92 deletions(-) diff --git a/config/i3/config b/config/i3/config index cbd0b53..7099a68 100644 --- a/config/i3/config +++ b/config/i3/config @@ -1,41 +1,23 @@ # i3 config file (v4) -# -# Please see http://i3wm.org/docs/userguide.html for a complete reference! set $mod Mod4 # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. -font pango:monospace 8 - -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -#font pango:DejaVu Sans Mono 8 - -# Before i3 v4.8, we used to recommend this one as the default: -# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 -# The font above is very space-efficient, that is, it looks good, sharp and -# clear in small sizes. However, its unicode glyph coverage is limited, the old -# X core fonts rendering does not support right-to-left and this being a bitmap -# font, it doesn’t scale on retina/hidpi displays. +font pango:DejaVu Sans Mono 8 # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod -# start a terminal and more +# start a terminal bindsym $mod+Return exec urxvt -bindsym $mod+Shift+Return exec conkeror & pidgin -bindsym $mod+Shift+d exec surf-menu - -# kill focused window -bindsym $mod+q kill # start dmenu (a program launcher) -#bindsym $mod+d exec dmenu_run -# 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=name +bindsym $mod+Shift+d exec --no-startup-id surf-menu + +# kill focused window +bindsym $mod+q kill # bar toggle, hide or show bindsym $mod+m bar mode toggle @@ -46,27 +28,14 @@ bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l focus right -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - # move focused window bindsym $mod+Shift+h move left bindsym $mod+Shift+j move down bindsym $mod+Shift+k move up bindsym $mod+Shift+l move right -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - # split in horizontal orientation bindsym $mod+g split h - # split in vertical orientation bindsym $mod+v split v @@ -128,7 +97,7 @@ bindsym $mod+Shift+0 move container to workspace 10 bindsym $mod+Shift+grave move container to workspace web bindsym $mod+Shift+underscore move container to workspace t -#assign [class="Firefox"] web +# Set Pidgin to scratchpad for_window [class="Pidgin"] move scratchpad # reload the configuration file @@ -138,66 +107,53 @@ bindsym $mod+Shift+r restart set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown mode "$mode_system" { - 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 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" - bindsym Escape 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 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" + + bindsym Return mode "default" + bindsym Escape mode "default" } 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 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" - bindsym Escape mode "default" + bindsym d exec --no-startup-id mxrandr, 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" + + bindsym Return mode "default" + bindsym Escape mode "default" } bindsym $mod+Shift+w mode "$displays" set $asus-fan fan: (f)ull, (a)uto mode "$asus-fan" { - bindsym f exec --no-startup-id sudo asus-fan full, mode "default" - bindsym a exec --no-startup-id sudo asus-fan auto, mode "default" - bindsym Return mode "default" - bindsym Escape mode "default" + bindsym f exec --no-startup-id sudo asus-fan full, mode "default" + bindsym a exec --no-startup-id sudo asus-fan auto, mode "default" + + bindsym Return mode "default" + bindsym Escape mode "default" } bindsym $mod+Shift+f mode "$asus-fan" -# resize window (you can also use the mouse for that) +# resize window mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize grow height 10 px or 10 ppt - bindsym k resize shrink height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" } bindsym $mod+r mode "resize" -# Switch keyboard +# Switch keyboard layout bindsym Mod1+space exec --no-startup-id ~/.config/i3/scripts/keyboard_switch # Pulse audio control @@ -209,7 +165,7 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle && pkill bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 20 # increase screen brightness bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 20 # decrease screen brightness -# Keyboard backlight +# Keyboard backlight (asus only) bindsym XF86KbdBrightnessUp exec --no-startup-id asus-kbd-backlight up bindsym XF86KbdBrightnessDown exec --no-startup-id asus-kbd-backlight down @@ -219,22 +175,16 @@ bindsym XF86AudioStop exec --no-startup-id mpc stop && pkill -RTMIN+12 i3blocks bindsym XF86AudioNext exec --no-startup-id mpc next && pkill -RTMIN+12 i3blocks bindsym XF86AudioPrev exec --no-startup-id mpc prev && pkill -RTMIN+12 i3blocks -# Mouse bindings -# TODO fillter windows -bindsym --whole-window button11 exec --no-startup-id xdotool key ctrl+t -bindsym --whole-window button12 exec --no-startup-id xdotool key ctrl+w -bindsym --whole-window button13 exec --no-startup-id xdotool key ctrl+Tab -bindsym --whole-window button14 exec --no-startup-id xdotool key ctrl+shift+Tab - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) +# Start i3blocks to display a workspace bar bar { position top status_command i3blocks - #status_command i3status tray_output primary } # Start daemons exec --no-startup-id dunst + +# Start Pidbargin +exec pidgin -- cgit v1.2.3