commit a6b1dc424b0c7a1bc4a10c8523f47fdf593c6a76 Author: Johannes Loher Date: Mon Sep 14 10:18:35 2020 +0200 initial commit diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..b5c9c89 --- /dev/null +++ b/.Xresources @@ -0,0 +1,12 @@ +! Dark + +#define S_base03 #002b36 +#define S_base02 #073642 +#define S_base01 #586e75 +#define S_base00 #657b83 +#define S_base0 #839496 +#define S_base1 #93a1a1 +#define S_base2 #eee8d5 +#define S_base3 #fdf6e3 + +#include ".config/Xresources.common" diff --git a/.config/Xresources.common b/.config/Xresources.common new file mode 100644 index 0000000..420f22a --- /dev/null +++ b/.config/Xresources.common @@ -0,0 +1,57 @@ +!--- URxvt ---! + +URxvt.saveLines: 4096 +URxvt.urgentOnBell: true +URxvt.visualBell: true +URxvt.fading: 0 +URxvt.scrollStyle: rxvt +URxvt.scrollBar: false +URxvt.perl-ext-common: default,matcher +URxvt.url-launcher: /usr/bin/xdg-open +URxvt.matcher.button: 1 + +!--- Font ---! +URxvt.allow_bold: false +URxvt.font: xft:Source Code Pro:size=12:antialias=true:hinting=true +URxvt.boldFont: xft:Source Code Pro:size=12:antialias=true:hinting=true +Xft.dpi: 192 +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintfull +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb +!--- Colors ---! + +#define S_yellow #b58900 +#define S_orange #cb4b16 +#define S_red #dc322f +#define S_magenta #d33682 +#define S_violet #6c71c4 +#define S_blue #268bd2 +#define S_cyan #2aa198 +#define S_green #859900 + +URxvt.background: S_base03 +URxvt.foreground: S_base0 +URxvt.fadeColor: S_base03 +URxvt.cursorColor: S_base1 +URxvt.pointerColorBackground: S_base01 +URxvt.pointerColorForeground: S_base1 + +URxvt.color0: S_base02 +URxvt.color1: S_red +URxvt.color2: S_green +URxvt.color3: S_yellow +URxvt.color4: S_blue +URxvt.color5: S_magenta +URxvt.color6: S_cyan +URxvt.color7: S_base2 +URxvt.color9: S_orange +URxvt.color8: S_base03 +URxvt.color10: S_base01 +URxvt.color11: S_base00 +URxvt.color12: S_base0 +URxvt.color13: S_violet +URxvt.color14: S_base1 +URxvt.color15: S_base3 diff --git a/.config/Xresources.dark b/.config/Xresources.dark new file mode 100644 index 0000000..b5c9c89 --- /dev/null +++ b/.config/Xresources.dark @@ -0,0 +1,12 @@ +! Dark + +#define S_base03 #002b36 +#define S_base02 #073642 +#define S_base01 #586e75 +#define S_base00 #657b83 +#define S_base0 #839496 +#define S_base1 #93a1a1 +#define S_base2 #eee8d5 +#define S_base3 #fdf6e3 + +#include ".config/Xresources.common" diff --git a/.config/Xresources.light b/.config/Xresources.light new file mode 100644 index 0000000..686bc99 --- /dev/null +++ b/.config/Xresources.light @@ -0,0 +1,12 @@ +!Light + +#define S_base03 #fdf6e3 +#define S_base02 #eee8d5 +#define S_base01 #93a1a1 +#define S_base00 #839496 +#define S_base0 #657b83 +#define S_base1 #586e75 +#define S_base2 #073642 +#define S_base3 #002b36 + +#include ".config/Xresources.common" diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..667fef2 --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,297 @@ +# ------------------------------------------------------------------------------ +# Variables +# ------------------------------------------------------------------------------ +set $mod Mod4 + +set $color_bg_focused #1f222d +set $color_bg_unfocused #252936 +set $color_fg_unfocused #7780a1 +set $color_fg_focused #ffffff +set $color_indicator #fcc09e + +set $color_red #ff5400 +set $color_yellow #ffd400 +set $color_green #a8ff00 +set $color_blue #5ac8fa + +set $font Roboto Regular 14 + +# ------------------------------------------------------------------------------ +# Font +# ------------------------------------------------------------------------------ +font pango:$font + +# ------------------------------------------------------------------------------ +# Launcher +# ------------------------------------------------------------------------------ +bindsym $mod+d exec --no-startup-id rofi -show drun +bindsym $mod+x exec --no-startup-id rofi -show run +bindsym $mod+y exec --no-startup-id rofi -show window +bindsym $mod+o exec --no-startup-id rofi-pass + +# ------------------------------------------------------------------------------ +# Window management +# ------------------------------------------------------------------------------ +# terminate the active window +bindsym $mod+Shift+q kill + +# floating modifier +floating_modifier $mod + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+odiaeresis focus right +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+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+odiaeresis move right +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+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# resize window (you can also use the mouse for that) +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 j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym odiaeresis 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 $mod+r mode "resize" + +# ------------------------------------------------------------------------------ +# Workspaces +# ------------------------------------------------------------------------------ +set $workspace1 "1" +set $workspace2 "2" +set $workspace3 "3" +set $workspace4 "4" +set $workspace5 "5" +set $workspace6 "6" +set $workspace7 "7…" + +# switch to workspace +bindsym $mod+1 workspace $workspace1 +bindsym $mod+2 workspace $workspace2 +bindsym $mod+3 workspace $workspace3 +bindsym $mod+4 workspace $workspace4 +bindsym $mod+5 workspace $workspace5 +bindsym $mod+6 workspace $workspace6 +bindsym $mod+7 workspace $workspace7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $workspace1 +bindsym $mod+Shift+2 move container to workspace $workspace2 +bindsym $mod+Shift+3 move container to workspace $workspace3 +bindsym $mod+Shift+4 move container to workspace $workspace4 +bindsym $mod+Shift+5 move container to workspace $workspace5 +bindsym $mod+Shift+6 move container to workspace $workspace6 +bindsym $mod+Shift+7 move container to workspace $workspace7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# move current workspace to output +bindsym $mod+Mod1+Right move workspace to output right +bindsym $mod+Mod1+Left move workspace to output left + +# ------------------------------------------------------------------------------ +# i3 management +# ------------------------------------------------------------------------------ +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart + +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -f 'pango:$font' -t warning -m 'i3 beenden?' -b 'Ja' 'i3-msg exit'" + +# ------------------------------------------------------------------------------ +# Program shortcuts +# ------------------------------------------------------------------------------ +bindsym $mod+Return exec --no-startup-id termite +bindsym $mod+c exec --no-startup-id firefox +bindsym $mod+t exec --no-startup-id thunderbird +bindsym $mod+p exec --no-startup-id termite -t Profanity -e profanity +bindsym $mod+g exec --no-startup-id code +bindsym XF86Explorer exec --no-startup-id thunar + +# ------------------------------------------------------------------------------ +# Audio shortcuts +# ------------------------------------------------------------------------------ +set $audio_out alsa_output.pci-0000_00_1f.3.analog-stereo +set $audio_in alsa_input.pci-0000_00_1f.3.analog-stereo + +bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $audio_out +5%; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $audio_out -5%; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $audio_out toggle; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioMicMute exec --no-startup-id "pactl set-source-mute $audio_in toggle; pkill -RTMIN+10 i3blocks" + +# ------------------------------------------------------------------------------ +# Video shortcuts +# ------------------------------------------------------------------------------ +bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight +10 +bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -10 +bindsym XF86Display exec --no-startup-id /usr/local/bin/monitor +# ------------------------------------------------------------------------------ +# Assignment of progrmans to workspaces +# ------------------------------------------------------------------------------ +assign [class="^Termite$" title="^Profanity$"] $workspace4 +assign [class="^Termite$"] $workspace1 +assign [class="^Subl3$"] $workspace2 +assign [class="^Code$"] $workspace2 +assign [class="^Chromium$"] $workspace3 +assign [class="^Nightly$"] $workspace3 +assign [class="^Firefox$"] $workspace3 +assign [class="^Thunderbird$"] $workspace4 +assign [class="^Thunar$"] $workspace5 +assign [class="^plexmediaplayer$"] $workspace6 + +# ------------------------------------------------------------------------------ +# Screenshot shortcuts +# ------------------------------------------------------------------------------ +bindsym Print exec --no-startup-id scrot +bindsym Shift+Print exec --no-startup-id scrot -u + +# ------------------------------------------------------------------------------ +# Keyboard layout shortcut +# ------------------------------------------------------------------------------ +bindsym XF86LaunchA exec --no-startup-id xkb-switch -n && pkill -SIGRTMIN+12 i3blocks + +# ------------------------------------------------------------------------------ +# WIFI shortcut +# ------------------------------------------------------------------------------ +bindsym XF86WLAN exec --no-startup-id pkill -SIGRTMIN+12 i3blocks + +# ------------------------------------------------------------------------------ +# Lockscreen +# ------------------------------------------------------------------------------ +exec --no-startup-id xss-lock -- i3lock \ +--insidevercolor=282c34ff \ +--ringvercolor=61afefff \ +\ +--insidewrongcolor=282c34ff \ +--ringwrongcolor=e06c75ff \ +\ +--insidecolor=282c34ff \ +--ringcolor=61afefff \ +--linecolor=00000000 \ +--separatorcolor=61afefff \ +\ +--verifcolor=abb2bfff \ +--wrongcolor=e06c75ff \ +--timecolor=abb2bfff \ +--datecolor=abb2bfff \ +--layoutcolor=abb2bfff \ +--keyhlcolor=98c379ff \ +--bshlcolor=e06c75ff \ +-n \ +--screen 1 \ +--blur 10 \ +--clock \ +--indicator \ +--datestr="%d.%m.%Y" \ +--wrongtext="Nope!" +bindsym control+Mod1+l exec --no-startup-id xset s activate + +# ------------------------------------------------------------------------------ +# Window theming +# ------------------------------------------------------------------------------ +# border background text indicator +client.focused $color_bg_focused $color_bg_focused $color_fg_focused $color_bg_focused +client.focused_inactive $color_bg_unfocused $color_bg_unfocused $color_fg_unfocused $color_bg_unfocused +client.unfocused $color_bg_unfocused $color_bg_unfocused $color_fg_unfocused $color_bg_unfocused +client.urgent $color_bg_unfocused $color_red $color_fg_focused $color_bg_unfocused + +# do not display edge borders +hide_edge_borders both + +# do not display a titlebar in tiled layout +default_border pixel 2 + +# gaps +gaps inner 10 +# gaps outer -5 + +# compositor +exec --no-startup-id compton + +# backgorund +exec --no-startup-id feh --bg-fill /usr/share/backgrounds/custom/mountain.jpg + +# NetworkManager Applet +exec --no-startup-id nm-applet + +# ------------------------------------------------------------------------------ +# Workspace bar +# ------------------------------------------------------------------------------ +bar { + font pango:$font + position top + strip_workspace_numbers yes + colors { + separator $color_fg_unfocused + background $color_bg_focused + # border background text + focused_workspace $color_bg_focused $color_bg_focused $color_fg_focused + active_workspace $color_bg_focused $color_bg_focused $color_fg_unfocused + inactive_workspace $color_bg_focused $color_bg_focused $color_fg_unfocused + urgent_workspace $color_bg_focused $color_bg_focused $color_red + } + status_command i3blocks -c ~/.i3blocks.conf +} diff --git a/.config/i3blocks/scripts/battery b/.config/i3blocks/scripts/battery new file mode 100755 index 0000000..69ca3d6 --- /dev/null +++ b/.config/i3blocks/scripts/battery @@ -0,0 +1,72 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# +# Licensed under the terms of the GNU GPL v3, or any later version. +# +# This script is meant to use with i3blocks. It parses the output of the "acpi" +# command (often provided by a package of the same name) to read the status of +# the battery, and eventually its remaining time (to full charge or discharge). +# +# The color will gradually change for a percentage below 85%, and the urgency +# (exit code 33) is set if there is less that 5% remaining. + +use strict; +use warnings; +use utf8; + +my $acpi; +my $status; +my $percent; +my $full_text; +my $short_text; +my $bat_number = $ENV{BLOCK_INSTANCE} || 0; + +# read the first line of the "acpi" command output +open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die; +$acpi = ; +close(ACPI); + +# fail on unexpected output +if ($acpi !~ /: (\w+), (\d+)%/) { + die "$acpi\n"; +} + +$status = $1; +$percent = $2; +$full_text = "$percent%"; + +if ($status eq 'Discharging') { + $full_text .= ' DIS'; +} elsif ($status eq 'Charging') { + $full_text .= ' CHR'; +} + +$short_text = $full_text; + +if ($acpi =~ /(\d\d:\d\d):/) { + $full_text .= " ($1)"; +} + +# print text +print "$full_text\n"; +print "$short_text\n"; + +# consider color and urgent flag only on discharge +if ($status eq 'Discharging') { + + if ($percent < 33) { + print "#ff5400\n"; + } elsif ($percent < 66) { + print "#ffd400\n"; + } else { + print "#a8ff00\n"; + } + + if ($percent < 5) { + exit(33); + } +} + +exit(0); diff --git a/.config/i3blocks/scripts/cpu_usage b/.config/i3blocks/scripts/cpu_usage new file mode 100755 index 0000000..a520458 --- /dev/null +++ b/.config/i3blocks/scripts/cpu_usage @@ -0,0 +1,55 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# +# Licensed under the terms of the GNU GPL v3, or any later version. + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +# default values +my $t_warn = 50; +my $t_crit = 80; +my $cpu_usage = -1; + +sub help { + print "Usage: cpu_usage [-w ] [-c ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit); + +# Get CPU usage +$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is +open (MPSTAT, 'mpstat 1 1 |') or die; +while () { + if (/^.*\s+(\d+\.\d+)\s+$/) { + $cpu_usage = 100 - $1; # 100% - %idle + last; + } +} +close(MPSTAT); + +$cpu_usage eq -1 and die 'Can\'t find CPU information'; + +# Print short_text, full_text +printf "%.2f%%\n", $cpu_usage; +printf "%.2f%%\n", $cpu_usage; + +# Print color, if needed +if ($cpu_usage >= $t_crit) { + print "#ff5400\n"; + #exit 33; +} elsif ($cpu_usage >= $t_warn) { + print "#ffd400\n"; +} + +exit 0; diff --git a/.config/i3blocks/scripts/disk b/.config/i3blocks/scripts/disk new file mode 100755 index 0000000..451d78d --- /dev/null +++ b/.config/i3blocks/scripts/disk @@ -0,0 +1,45 @@ + +#!/bin/sh +# Copyright (C) 2014 Julien Bonjean + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +DIR="${DIR:-$BLOCK_INSTANCE}" +DIR="${DIR:-$HOME}" +ALERT_LOW="${ALERT_LOW:-$1}" +ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%) + +LOCAL_FLAG="-l" +if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then + LOCAL_FLAG="" +fi + +df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW ' +/\/.*/ { + # full text + print label $4 + # short text + print label $4 + use=$5 + # no need to continue parsing + exit 0 +} +END { + gsub(/%$/,"",use) + if (100 - use < alert_low) { + # color + print "#FF0000" + } +} +' diff --git a/.config/i3blocks/scripts/iface b/.config/i3blocks/scripts/iface new file mode 100755 index 0000000..09f6d13 --- /dev/null +++ b/.config/i3blocks/scripts/iface @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +# Use the provided interface, otherwise the device used for the default route. +if [[ -n $BLOCK_INSTANCE ]]; then + IF=$BLOCK_INSTANCE +else + IF=$(ip route | awk '/^default/ { print $5 ; exit }') +fi + +#------------------------------------------------------------------------ + +# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless +# connection (think desktop), the corresponding block should not be displayed. +[[ ! -d /sys/class/net/${IF} ]] && exit + +#------------------------------------------------------------------------ + +if [[ "$(cat /sys/class/net/$IF/operstate)" = 'down' ]]; then + echo down # full text + echo down # short text + echo \#ff5400 # color + exit +fi + +case $1 in + -4) + AF=inet ;; + -6) + AF=inet6 ;; + *) + AF=inet6? ;; +esac + +# if no interface is found, use the first device with a global scope +IPADDR=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$1 and exit") +BSSID=$(iwgetid -r $IF) +if [[ $? -eq 0 ]]; then + OUTPUT="$BSSID ($IPADDR)" +else + OUTPUT="$IPADDR" +fi + +case $BLOCK_BUTTON in + 3) echo -n "$IPADDR" | xclip -q -se c ;; +esac + +#------------------------------------------------------------------------ + +echo "$OUTPUT" # full text +echo "$OUTPUT" # short text diff --git a/.config/i3blocks/scripts/keyboard_layout b/.config/i3blocks/scripts/keyboard_layout new file mode 100755 index 0000000..d364b93 --- /dev/null +++ b/.config/i3blocks/scripts/keyboard_layout @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (C) 2016 Johannes Loher + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +OUTPUT=`xkb-switch` + +#------------------------------------------------------------------------ + +echo "$OUTPUT" # full text +echo "$OUTPUT" # short text diff --git a/.config/i3blocks/scripts/volume b/.config/i3blocks/scripts/volume new file mode 100755 index 0000000..6e0c4fe --- /dev/null +++ b/.config/i3blocks/scripts/volume @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +# The second parameter overrides the mixer selection +# For PulseAudio users, eventually use "pulse" +# For Jack/Jack2 users, use "jackplug" +# For ALSA users, you may use "default" for your primary card +# or you may use hw:# where # is the number of the card desired +if [[ -z "$MIXER" ]] ; then + MIXER="default" + if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then + # pulseaudio is running, but not all installations use "pulse" + if amixer -D pulse info >/dev/null 2>&1 ; then + MIXER="pulse" + fi + fi + [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" + MIXER="${2:-$MIXER}" +fi + +# The instance option sets the control to report and configure +# This defaults to the first control of your selected mixer +# For a list of the available, use `amixer -D $Your_Mixer scontrols` +if [[ -z "$SCONTROL" ]] ; then + SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | + sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | + head -n1 + )}" +fi + +# The first parameter sets the step to change the volume by (and units to display) +# This may be in in % or dB (eg. 5% or 3dB) +if [[ -z "$STEP" ]] ; then + STEP="${1:-5%}" +fi + +#------------------------------------------------------------------------ + +capability() { # Return "Capture" if the device is a capture device + amixer -D $MIXER get $SCONTROL | + sed -n "s/ Capabilities:.*cvolume.*/Capture/p" +} + +volume() { + amixer -D $MIXER get $SCONTROL $(capability) +} + +format() { + + perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' + perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' + # If dB was selected, print that instead + perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') + perl_filter+='"; exit}' + output=$(perl -ne "$perl_filter") + echo "$LABEL$output" +} + +#------------------------------------------------------------------------ + +case $BLOCK_BUTTON in + 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute + 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase + 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease +esac + +volume | format diff --git a/.config/i3blocks/scripts/wifi b/.config/i3blocks/scripts/wifi new file mode 100755 index 0000000..bf36eb1 --- /dev/null +++ b/.config/i3blocks/scripts/wifi @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +INTERFACE="${BLOCK_INSTANCE:-wlan0}" + +#------------------------------------------------------------------------ + +# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless +# connection (think desktop), the corresponding block should not be displayed. +[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] || + [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit + +#------------------------------------------------------------------------ + +QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') + +#------------------------------------------------------------------------ + +echo $QUALITY% # full text +echo $QUALITY% # short text + +# color +if [[ $QUALITY -ge 70 ]]; then + echo "#a8ff00" +elif [[ $QUALITY -lt 70 ]]; then + echo "#ffd400" +elif [[ $QUALITY -lt 40 ]]; then + echo "#ff5400" +fi diff --git a/.config/picom.conf b/.config/picom.conf new file mode 100644 index 0000000..e8c0d88 --- /dev/null +++ b/.config/picom.conf @@ -0,0 +1,422 @@ +################################# +# Shadows # +################################# + + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# shadow = false +shadow = false; + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 7; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +# shadow-opacity = .75 + +# The left offset for shadows, in pixels. (defaults to -15) +# shadow-offset-x = -15 +shadow-offset-x = -7; + +# The top offset for shadows, in pixels. (defaults to -15) +# shadow-offset-y = -15 +shadow-offset-y = -7; + +# Avoid drawing shadows on dock/panel windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dock-shadow = false + +# Don't draw shadows on drag-and-drop windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dnd-shadow = false + +# Red color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-red = 0 + +# Green color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-green = 0 + +# Blue color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-blue = 0 + +# Do not paint shadows on shaped windows. Note shaped windows +# here means windows setting its shape through X Shape extension. +# Those using ARGB background is beyond our control. +# Deprecated, use +# shadow-exclude = 'bounding_shaped' +# or +# shadow-exclude = 'bounding_shaped && !rounded_corners' +# instead. +# +# shadow-ignore-shaped = '' + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] +# shadow-exclude = [ +# "name = 'Notification'", +# "class_g = 'Conky'", +# "class_g ?= 'Notify-osd'", +# "class_g = 'Cairo-clock'", +# "_GTK_FRAME_EXTENTS@:c" +# ]; +# Specify a X geometry that describes the region in which shadow should not +# be painted in, such as a dock window region. Use +# shadow-exclude-reg = "x10+0+0" +# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. +# +# shadow-exclude-reg = "" + +# Crop shadow of a window fully on a particular Xinerama screen to the screen. +# xinerama-shadow-crop = false + + +################################# +# Fading # +################################# + + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. +# fading = false +fading = false + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.03; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.03; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 + +# Specify a list of conditions of windows that should not be faded. +# fade-exclude = [] + +# Do not fade on window open/close. +# no-fading-openclose = false + +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false + + +################################# +# Transparency / Opacity # +################################# + + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +# inactive-opacity = 1 +inactive-opacity = 1; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +frame-opacity = 1; + +# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) +# menu-opacity = 1.0 + +# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = false; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +# active-opacity = 1.0 + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should always be considered focused. +# focus-exclude = [] +# focus-exclude = [ "class_g = 'Cairo-clock'" ]; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# inactive-dim-fixed = 1.0 + +# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, +# like `50:name *= "Firefox"`. picom-trans is recommended over this. +# Note we don't make any guarantee about possible conflicts with other +# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. +# example: +# opacity-rule = [ "80:class_g = 'URxvt'" ]; +# +# opacity-rule = [] + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +# blur-method = +# blur-size = 12 +# +# blur-deviation = false + +# Blur background of semi-transparent / ARGB windows. +# Bad in performance, with driver-dependent behavior. +# The name of the switch may change without prior notifications. +# +# blur-background = false + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# Bad in performance, with driver-dependent behavior. The name may change. +# +# blur-background-frame = false + + +# Use fixed blur strength rather than adjusting according to window opacity. +# blur-background-fixed = false + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# +# blur-kern = '' +blur-kern = "3x3box"; + + +# Exclude conditions for background blur. +# blur-background-exclude = [] +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +################################# +# General Settings # +################################# + +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = false + +# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. +# `xrender` is the default one. +# +# backend = 'glx' +backend = "xrender"; + +# Enable/disable VSync. +# vsync = false +vsync = true + +# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. +# dbus = false + +# Try to detect WM windows (a non-override-redirect window with no +# child that has 'WM_STATE') and mark them as active. +# +# mark-wmwin-focused = false +mark-wmwin-focused = true; + +# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. +# mark-ovredir-focused = false +mark-ovredir-focused = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# detect-rounded-corners = false +detect-rounded-corners = true; + +# Detect '_NET_WM_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false +detect-client-opacity = true; + +# Specify refresh rate of the screen. If not specified or 0, picom will +# try detecting this with X RandR extension. +# +# refresh-rate = 60 +refresh-rate = 0 + +# Limit picom to repaint at most once every 1 / 'refresh_rate' second to +# boost performance. This should not be used with +# vsync drm/opengl/opengl-oml +# as they essentially does sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +# +# sw-opti = + +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, +# provided that the WM supports it. +# +# use-ewmh-active-win = false + +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. +# +# unredir-if-possible = false + +# Delay before unredirecting the window, in milliseconds. Defaults to 0. +# unredir-if-possible-delay = 0 + +# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. +# unredir-if-possible-exclude = [] + +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# detect-transient = false +detect-transient = true + +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if +# detect-transient is enabled, too. +# +# detect-client-leader = false +detect-client-leader = true + +# Resize damaged region by a specific number of pixels. +# A positive value enlarges it while a negative one shrinks it. +# If the value is positive, those additional pixels will not be actually painted +# to screen, only used in blur calculation, and such. (Due to technical limitations, +# with use-damage, those pixels will still be incorrectly painted to screen.) +# Primarily used to fix the line corruption issues of blur, +# in which case you should use the blur radius value here +# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, +# with a 5x5 one you use `--resize-damage 2`, and so on). +# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. +# +# resize-damage = 1 + +# Specify a list of conditions of windows that should be painted with inverted color. +# Resource-hogging, and is not well tested. +# +# invert-color-include = [] + +# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. +# Might cause incorrect opacity when rendering transparent content (but never +# practically happened) and may not work with blur-background. +# My tests show a 15% performance boost. Recommended. +# +# glx-no-stencil = false + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, +# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). +# Recommended if it works. +# +# glx-no-rebind-pixmap = false + +# Disable the use of damage information. +# This cause the whole screen to be redrawn everytime, instead of the part of the screen +# has actually changed. Potentially degrades the performance, but might fix some artifacts. +# The opposing option is use-damage +# +# no-use-damage = false +use-damage = true + +# Use X Sync fence to sync clients' draw calls, to make sure all draw +# calls are finished before picom starts drawing. Needed on nvidia-drivers +# with GLX backend for some users. +# +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window contents. +# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` +# in the source tree for examples. +# +# glx-fshader-win = '' + +# Force all windows to be painted with blending. Useful if you +# have a glx-fshader-win that could turn opaque pixels transparent. +# +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) +# +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. +# +# transparent-clipping = false + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case doesn't matter. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# log-level = "debug" +log-level = "warn"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = '/path/to/your/log/file' + +# Show all X errors (for debugging) +# show-all-xerrors = false + +# Write process ID to a file. +# write-pid-path = '/path/to/your/log/file' + +# Window type settings +# +# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: +# "unknown", "desktop", "dock", "toolbar", "menu", "utility", +# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", +# "tooltip", "notification", "combo", and "dnd". +# +# Following per window-type options are available: :: +# +# fade, shadow::: +# Controls window-type-specific shadow and fade settings. +# +# opacity::: +# Controls default opacity of the window type. +# +# focus::: +# Controls whether the window of this type is to be always considered focused. +# (By default, all window types except "normal" and "dialog" has this on.) +# +# full-shadow::: +# Controls whether shadow is drawn under the parts of the window that you +# normally won't be able to see. Useful when the window has parts of it +# transparent, and you want shadows in those areas. +# +# redir-ignore::: +# Controls whether this type of windows should cause screen to become +# redirected again after been unredirected. If you have unredir-if-possible +# set, and doesn't want certain window to cause unnecessary screen redirection, +# you can set this to `true`. +# +wintypes: +{ + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; } + dnd = { shadow = false; } + # popup_menu = { opacity = 0.8; } + # dropdown_menu = { opacity = 0.8; } +}; diff --git a/.config/rofi-pass/config b/.config/rofi-pass/config new file mode 100644 index 0000000..9b75e37 --- /dev/null +++ b/.config/rofi-pass/config @@ -0,0 +1,5 @@ +fix_layout=true + +layout_cmd () { + setxkbmap de +} diff --git a/.config/rofi/config b/.config/rofi/config new file mode 100644 index 0000000..c8b3bf0 --- /dev/null +++ b/.config/rofi/config @@ -0,0 +1,22 @@ +! ------------------------------------------------------------------------------ +! Color theme +! ------------------------------------------------------------------------------ +rofi.color-normal: #252936, #7780a1, #252936, #1f222d, #ffffff +rofi.color-urgent: #252936, #ff5400, #252936, #1f222d, #ff5400 +rofi.color-active: #252936, #5ac8fa, #252936, #1f222d, #5ac8fa +rofi.color-window: #1f222d, #1f222d, #7780a1 + +! ------------------------------------------------------------------------------ +! Config +! ------------------------------------------------------------------------------ +rofi.location: 0 +rofi.lines: 7 +rofi.font: Roboto Regular 30 +rofi.bw: 0 +rofi.separator-style: none +rofi.width: 25 +rofi.padding: 5 +rofi.matching: normal +rofi.hide-scrollbar: true +rofi.modi: drun,run,window +rofi.terminal: termite diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..7b6b02d --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,302 @@ +# ------------------------------------------------------------------------------ +# Variables +# ------------------------------------------------------------------------------ +set $mod Mod4 + +set $color_bg_focused #1f222d +set $color_bg_unfocused #252936 +set $color_fg_unfocused #7780a1 +set $color_fg_focused #ffffff +set $color_indicator #fcc09e + +set $color_red #ff5400 +set $color_yellow #ffd400 +set $color_green #a8ff00 +set $color_blue #5ac8fa + +set $font Roboto Regular 14 + +input * { + xkb_layout "de" + xkb_variant "nodeadkeys" + xkb_model "pc105" +} + +output "*" bg /usr/share/backgrounds/custom/mountain.jpg fill + +# ------------------------------------------------------------------------------ +# Font +# ------------------------------------------------------------------------------ +font pango:$font + +# ------------------------------------------------------------------------------ +# Launcher +# ------------------------------------------------------------------------------ +bindsym $mod+d exec --no-startup-id rofi -show drun +bindsym $mod+x exec --no-startup-id rofi -show run +bindsym $mod+y exec --no-startup-id rofi -show window +bindsym $mod+o exec --no-startup-id rofi-pass + +# ------------------------------------------------------------------------------ +# Window management +# ------------------------------------------------------------------------------ +# terminate the active window +bindsym $mod+Shift+q kill + +# floating modifier +floating_modifier $mod + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+odiaeresis focus right +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+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+odiaeresis move right +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+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# resize window (you can also use the mouse for that) +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 j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym odiaeresis 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 $mod+r mode "resize" + +# ------------------------------------------------------------------------------ +# Workspaces +# ------------------------------------------------------------------------------ +set $workspace1 "1" +set $workspace2 "2" +set $workspace3 "3" +set $workspace4 "4" +set $workspace5 "5" +set $workspace6 "6" +set $workspace7 "7…" + +# switch to workspace +bindsym $mod+1 workspace $workspace1 +bindsym $mod+2 workspace $workspace2 +bindsym $mod+3 workspace $workspace3 +bindsym $mod+4 workspace $workspace4 +bindsym $mod+5 workspace $workspace5 +bindsym $mod+6 workspace $workspace6 +bindsym $mod+7 workspace $workspace7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $workspace1 +bindsym $mod+Shift+2 move container to workspace $workspace2 +bindsym $mod+Shift+3 move container to workspace $workspace3 +bindsym $mod+Shift+4 move container to workspace $workspace4 +bindsym $mod+Shift+5 move container to workspace $workspace5 +bindsym $mod+Shift+6 move container to workspace $workspace6 +bindsym $mod+Shift+7 move container to workspace $workspace7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# move current workspace to output +bindsym $mod+Mod1+Right move workspace to output right +bindsym $mod+Mod1+Left move workspace to output left + +# ------------------------------------------------------------------------------ +# i3 management +# ------------------------------------------------------------------------------ +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart + +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -f 'pango:$font' -t warning -m 'i3 beenden?' -b 'Ja' 'i3-msg exit'" + +# ------------------------------------------------------------------------------ +# Program shortcuts +# ------------------------------------------------------------------------------ +bindsym $mod+Return exec --no-startup-id termite +bindsym $mod+c exec --no-startup-id firefox +bindsym $mod+t exec --no-startup-id thunderbird +bindsym $mod+p exec --no-startup-id termite -t Profanity -e profanity +bindsym $mod+g exec --no-startup-id code +bindsym XF86Explorer exec --no-startup-id thunar + +# ------------------------------------------------------------------------------ +# Audio shortcuts +# ------------------------------------------------------------------------------ +set $audio_out alsa_output.pci-0000_00_1b.0.analog-stereo +set $audio_in alsa_input.pci-0000_00_1b.0.analog-stereo + +bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $audio_out +5%; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $audio_out -5%; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $audio_out toggle; pkill -RTMIN+10 i3blocks" +bindsym XF86AudioMicMute exec --no-startup-id "pactl set-source-mute $audio_in toggle; pkill -RTMIN+10 i3blocks" + +# ------------------------------------------------------------------------------ +# Video shortcuts +# ------------------------------------------------------------------------------ +bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight +10 +bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -10 +bindsym XF86Display exec --no-startup-id /usr/local/bin/monitor +# ------------------------------------------------------------------------------ +# Assignment of progrmans to workspaces +# ------------------------------------------------------------------------------ +assign [class="^Termite$" title="^Profanity$"] $workspace4 +assign [class="^Termite$"] $workspace1 +assign [class="^Subl3$"] $workspace2 +assign [class="^Code$"] $workspace2 +assign [class="^Chromium$"] $workspace3 +assign [class="^Nightly$"] $workspace3 +assign [class="^Firefox$"] $workspace3 +assign [class="^Thunderbird$"] $workspace4 +assign [class="^Thunar$"] $workspace5 +assign [class="^plexmediaplayer$"] $workspace6 + +# ------------------------------------------------------------------------------ +# Screenshot shortcuts +# ------------------------------------------------------------------------------ +bindsym Print exec --no-startup-id scrot +bindsym Shift+Print exec --no-startup-id scrot -u + +# ------------------------------------------------------------------------------ +# Keyboard layout shortcut +# ------------------------------------------------------------------------------ +bindsym XF86LaunchA exec --no-startup-id xkb-switch -n && pkill -SIGRTMIN+12 i3blocks + +# ------------------------------------------------------------------------------ +# WIFI shortcut +# ------------------------------------------------------------------------------ +bindsym XF86WLAN exec --no-startup-id pkill -SIGRTMIN+12 i3blocks + +# ------------------------------------------------------------------------------ +# Lockscreen +# ------------------------------------------------------------------------------ +exec --no-startup-id xss-lock -- i3lock \ +--insidevercolor=282c34ff \ +--ringvercolor=61afefff \ +\ +--insidewrongcolor=282c34ff \ +--ringwrongcolor=e06c75ff \ +\ +--insidecolor=282c34ff \ +--ringcolor=61afefff \ +--linecolor=00000000 \ +--separatorcolor=61afefff \ +\ +--verifcolor=abb2bfff \ +--wrongcolor=e06c75ff \ +--timecolor=abb2bfff \ +--datecolor=abb2bfff \ +--layoutcolor=abb2bfff \ +--keyhlcolor=98c379ff \ +--bshlcolor=e06c75ff \ +-n \ +--screen 1 \ +--blur 10 \ +--clock \ +--indicator \ +--datestr="%d.%m.%Y" \ +--wrongtext="Nope!" +bindsym control+Mod1+l exec --no-startup-id xset s activate + +# ------------------------------------------------------------------------------ +# Window theming +# ------------------------------------------------------------------------------ +# border background text indicator +client.focused $color_bg_focused $color_bg_focused $color_fg_focused $color_bg_focused +client.focused_inactive $color_bg_unfocused $color_bg_unfocused $color_fg_unfocused $color_bg_unfocused +client.unfocused $color_bg_unfocused $color_bg_unfocused $color_fg_unfocused $color_bg_unfocused +client.urgent $color_bg_unfocused $color_red $color_fg_focused $color_bg_unfocused + +# do not display edge borders +hide_edge_borders both + +# do not display a titlebar in tiled layout +default_border pixel 2 + +# gaps +gaps inner 10 +# gaps outer -5 + +# compositor +exec --no-startup-id compton + +# backgorund +exec --no-startup-id feh --bg-fill /usr/share/backgrounds/custom/mountain.jpg + +# ------------------------------------------------------------------------------ +# Workspace bar +# ------------------------------------------------------------------------------ +bar { + font pango:$font + position top + strip_workspace_numbers yes + colors { + separator $color_fg_unfocused + background $color_bg_focused + # border background text + focused_workspace $color_bg_focused $color_bg_focused $color_fg_focused + active_workspace $color_bg_focused $color_bg_focused $color_fg_unfocused + inactive_workspace $color_bg_focused $color_bg_focused $color_fg_unfocused + urgent_workspace $color_bg_focused $color_bg_focused $color_red + } + status_command i3blocks -c ~/.i3blocks.conf +} diff --git a/.config/termite/config b/.config/termite/config new file mode 100644 index 0000000..3b5e061 --- /dev/null +++ b/.config/termite/config @@ -0,0 +1,126 @@ +[options] +font = Source Code Pro 13 +cursor_blink = off +scrollback_lines = 4096 +urgent_on_bell = true +audible_bell = false +visible_bell = true + +[colors] + +#Solarized: +#dark: +# foreground = #839496 +# foreground_bold = #eee8d5 +# background = #002b36 +# cursor = #93a1a1 + +#light: +# foreground = #657b83 +# foregrond_bold = #073642 +# background = #fdf6e3 +# cursor = #586e75 + +# if unset, will reverse foreground and background +#highlight = #839496 + +# colors from color0 to color254 can be set +# color0 = #073642 +# color1 = #dc322f +# color2 = #859900 +# color3 = #b58900 +# color4 = #268bd2 +# color5 = #d33682 +# color6 = #2aa198 +# color7 = #eee8d5 +# color8 = #002b36 +# color9 = #cb4b16 +# color10 = #586e75 +# color11 = #657b83 +# color12 = #839496 +# color13 = #6c71c4 +# color14 = #93a1a1 +# color15 = #fdf6e3 + +#One: +#dark: + +# special +foreground = #abb2bf +foreground_bold = #abb2bf +cursor = #abb2bf +cursor_foreground = #282c34 +background = rgba(40, 44, 52, 0.975) + +# black +color0 = #282c34 +color8 = #282c34 + +# red +color1 = #e06c75 +color9 = #e06c75 + +# green +color2 = #98c379 +color10 = #98c379 + +# yellow +color3 = #e5c07b +color11 = #e5c07b + +# blue +color4 = #61afef +color12 = #61afef + +# magenta +color5 = #c678dd +color13 = #c678dd + +# cyan +color6 = #56b6c2 +color14 = #56b6c2 + +# white +color7 = #abb2bf +color15 = #abb2bf + + +# #light: + +# # special +# foreground = #4f4d3f +# foreground_bold = #4f4d3f +# cursor = #4f4d3f +# background = #f9f9f9 + +# # black +# color0 = #4f4d3f +# color8 = #4f4d3f + +# # red +# color1 = #c90017 +# color9 = #c90017 + +# # green +# color2 = #0e7a1b +# color10 = #0e7a1b + +# # yellow +# color3 = #997600 +# color11 = #997600 + +# # blue +# color4 = #1348d4 +# color12 = #1348d4 + +# # magenta +# color5 = #ae00bb +# color13 = #ae00bb + +# # cyan +# color6 = #00764e +# color14 = #00764e + +# # white +# color7 = #f9f9f9 +# color15 = #f9f9f9 diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..13fe39c --- /dev/null +++ b/.gitconfig @@ -0,0 +1,12 @@ +[user] + email = johannes.loher@fg4f.de + name = Johannes Loher +[core] + editor = vim +[alias] + co = checkout + ci = commit + st = status + br = branch + hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short + bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f" diff --git a/.i3blocks.conf b/.i3blocks.conf new file mode 100644 index 0000000..8631187 --- /dev/null +++ b/.i3blocks.conf @@ -0,0 +1,95 @@ +align=center +color=#7780a1 +separator=false +separator_block_width=7 +markup=pango + +[separator] +full_text= + +[home] +color=#d1d4e0 +command=~/.config/i3blocks/scripts/disk +label= +interval=10 + +[separator] +full_text= + +[volume] +color=#d1d4e0 +command=~/.config/i3blocks/scripts/volume +label=♪ +interval=once +signal=10 + +[separator] +full_text= + +[wireless] +label= +instance=wlp3s0 +command=~/.config/i3blocks/scripts/iface +color=#d1d4e0 +interval=1 + +[strength] +instance=wlp3s0 +command=~/.config/i3blocks/scripts/wifi +color=#d1d4e0 +interval=1 + +[separator] +full_text= + +[ethernet] +label= +instance=enp0s25 +command=~/.config/i3blocks/scripts/iface +color=#d1d4e0 +interval=1 + +[separator] +full_text= + +[battery] +label= +command=~/.config/i3blocks/scripts/battery +color=#d1d4e0 +interval=30 +instance=0 + +[battery] +label= +command=~/.config/i3blocks/scripts/battery +color=#d1d4e0 +interval=30 +instance=1 + +[separator] +full_text= + +[keyboard_layout] +label= +command=~/.config/i3blocks/scripts/keyboard_layout +color=#d1d4e0 +interval=once +signal=12 + +[separator] +full_text= + +[datetime] +label= +command=date "+%d.%m.%Y" +color=#d1d4e0 +interval=5 + +[separator] +full_text= + +[datetime] +label= +command=date "+%H:%M:%S" +color=#d1d4e0 +interval=1 diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..f1f6e43 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,43 @@ +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' + +set -g status-right '#{prefix_highlight} | %a %Y-%m-%d %H:%M' + + +# Scroll History +set -g history-limit 50000 + +# Make mouse useful, tmux > 2.1 include select, resize pane/window and console wheel scroll +set -g mouse on + +# Lower escape timing from 500ms to 100ms for quicker response to scroll-buffer access. +set -s escape-time 100 + +# Selection with mouse should copy to clipboard right away, in addition to the default action. +unbind -n -Tcopy-mode-vi MouseDragEnd1Pane +bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel primary > /dev/null" + +# Middle click to paste from the clipboard +unbind-key MouseDown2Pane +bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel primary)\"; tmux paste-buffer" + +# Splitting +bind-key h split-window -h +bind-key v split-window -v + +# Use Alt-arrow keys without prefix key to switch panes +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Resizing +bind-key M-j resize-pane -D +bind-key M-k resize-pane -U +bind-key M-h resize-pane -L +bind-key M-l resize-pane -R + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run -b '~/.tmux/plugins/tpm/tpm' diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..b8cb968 --- /dev/null +++ b/.vimrc @@ -0,0 +1,37 @@ +syntax on +set wildmenu +set wildmode=longest:list,full +set showmatch +set ruler +set autoindent +set number +set wrap +set smarttab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set noexpandtab +set showmatch +set mat=2 +set encoding=utf8 +set ffs=unix,dos,mac +set nobackup +set nowritebackup +set noswapfile +set ignorecase +set incsearch +set hlsearch +set smartindent +set noerrorbells +set novisualbell +set t_vb= +set autoread +set backspace=indent,eol,start +set listchars=tab:>-,eol:$,trail:.,extends:# +set background=dark +execute pathogen#infect() + +let g:onedark_termcolors=16 +colorscheme onedark +let g:dutyl_stdImportPaths=['/usr/include/dlang/dmd'] + diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..80254c6 --- /dev/null +++ b/.xinitrc @@ -0,0 +1 @@ +xrdb -merge ~/.Xresources \ No newline at end of file diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..e69de29 diff --git a/.zshrc.local b/.zshrc.local new file mode 100644 index 0000000..2ad6884 --- /dev/null +++ b/.zshrc.local @@ -0,0 +1,45 @@ +# Variables +export EDITOR=/usr/bin/vim +export BROWSER=/usr/bin/firefox + +# Aliases +alias ls='ls --color=auto' + +# Colors +eval `dircolors ~/.dir_colors` + +# Prompt +autoload -U colors zsh/terminfo +colors + +zstyle ':vcs_info:git:*' formats "(%{$fg[yellow]%}%b%{$reset_color%})" +zstyle ':prompt:grml:left:items:user' pre "%{$fg[blue]%}" +zstyle ':prompt:grml:left:items:user' post "%{$reset_color%}" +zstyle ':prompt:grml:left:items:host' pre "%{$fg[green]%}" +zstyle ':prompt:grml:left:items:host' post "%{$reset_color%}:" +zstyle ':prompt:grml:left:items:path' pre "%{$fg[magenta]%}" +zstyle ':prompt:grml:left:items:path' post "%{$reset_color%}" +zstyle ':prompt:grml:left:items:host' token '%m' +zstyle ':prompt:grml:left:items:path' token '%20<..<%~%<<' +zstyle ':prompt:grml:left:items:percent' token '%(!.#.>) ' +zstyle ':prompt:grml:right:items:sad-smiley' token '' + +# Scripts +export PATH="/home/loherj/.local/bin:$PATH" + + +# Completions +if [ -e "/usr/share/fzf/key-bindings.zsh" ] +then + . /usr/share/fzf/key-bindings.zsh +fi + +if [ -e "/usr/share/fzf/completion.zsh" ] +then + . /usr/share/fzf/completion.zsh +fi + + +#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! +export SDKMAN_DIR="/home/loherj/.sdkman" +[[ -s "/home/loherj/.sdkman/bin/sdkman-init.sh" ]] && source "/home/loherj/.sdkman/bin/sdkman-init.sh" diff --git a/.zshrc.pre b/.zshrc.pre new file mode 100644 index 0000000..4dbed40 --- /dev/null +++ b/.zshrc.pre @@ -0,0 +1 @@ +fpath=($fpath ~/.completion) \ No newline at end of file