dotfiles

my dotfiles
Log | Files | Refs

commit 6ae8fefb4a1a9befc18642a1c2a10e56b7988141
Author: tin <ichtinnotl@gmail.com>
Date:   Fri,  1 Jun 2018 10:02:39 +0200

initial commit

Diffstat:
.config/i3/config | 212+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.fonts/.uuid | 2++
.fonts/Inconsolata-Bold.ttf | 0
.fonts/Inconsolata-Regular.ttf | 0
.fonts/Roboto-Regular.ttf | 0
.fonts/Terminus.ttf | 0
.fonts/Ubuntu-R.ttf | 0
.fonts/UbuntuMono-B.ttf | 0
.fonts/UbuntuMono-BI.ttf | 0
.fonts/UbuntuMono-R.ttf | 0
.fonts/UbuntuMono-RI.ttf | 0
.fonts/fontawesome-webfont.ttf | 0
.scripts/BAT2.sh | 19+++++++++++++++++++
.scripts/checkupdates.sh | 14++++++++++++++
.scripts/hdd.sh | 4++++
.scripts/monitor.sh | 29+++++++++++++++++++++++++++++
.scripts/rainy-paris-cafe-jazz-stream.sh | 11+++++++++++
.scripts/volume.sh | 9+++++++++
.scripts/weather.sh | 14++++++++++++++
.sounds/ParisCafe.mp3 | 0
.sounds/RainyMood.mp3 | 0
.xinitrc | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
i3blocks.conf | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
install.sh | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
samwise.py | 169+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25 files changed, 687 insertions(+), 0 deletions(-)

diff --git a/.config/i3/config b/.config/i3/config @@ -0,0 +1,212 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# 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 10 + +# 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: Terminus 12 + +# 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. + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec --no-startup-id xfce4-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# Monitors +bindsym $mod+Shift+s exec --no-startup-id /home/tins/.dotfiles/.scripts/monitor.sh + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id rofi -show 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 + +exec --no-startup-id ~/.scripts/batt.sh + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon 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+j move left +# bindsym $mod+Shift+k move down +# bindsym $mod+Shift+l move up +# bindsym $mod+Shift+colon 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+h split h + +# i3lock +bindsym $mod+shift+l exec --no-startup-id i3lock + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# disable window titles +for_window [class="^.*"] border pixel 1 + +# 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 + +set $workspace1 "1:www" +set $workspace2 "2:term" + +# switch to workspace +bindsym $mod+1 workspace $workspace1 +bindsym $mod+2 workspace $workspace2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +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 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +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 + +# Multimedia keys + +# bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 10 +# bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer -i 10 +# bindsym XF86AudioMute exec --no-startup-id pamixer -t + +# Fn buttons +# Pulse Audio controls +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +10% #increase sound volume +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -10% #decrease sound volume +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute 1 toggle + +# Hexchat assign +assign [class="Hexchat"] workspace 8 +exec --no-startup-id hexchat + +# Open Thunar +bindsym $mod+Shift+t exec --no-startup-id Thunar + +# Open Emacs +bindsym $mod+Shift+Return exec --no-startup-id emacsclient -a "" -c + +# Open capture frame in Emacs +bindsym $mod+F11 exec --no-startup-id emacsclient -ne "(make-capture-frame)" + +# VLC assign +assign [class="Vlc"] workspace 7 + +# qBittorrent +assign [class="qBittorrent"] workspace 10 + +bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 20 # increase screen brightness +bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 20 # decrease screen brightness + +# Screenshots + +bindsym --release Print exec --no-startup-id scrot -s '%Y-%m-%d_%T_$wx$h.png' -e 'mv $f /home/tin/disk/Pictures/Screenshot/' +bindsym Shift+Print exec --no-startup-id scrot '%Y-%m-%d_%T_$wx$h.png' -e 'mv $f ~/Pictures/Screenshot/' + + +# 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 -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# 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 semicolon 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" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3blocks + position bottom +} diff --git a/.fonts/.uuid b/.fonts/.uuid @@ -0,0 +1 @@ +0b1af70c-fd12-4ac3-b9c0-c693b8ef44ad+ \ No newline at end of file diff --git a/.fonts/Inconsolata-Bold.ttf b/.fonts/Inconsolata-Bold.ttf Binary files differ. diff --git a/.fonts/Inconsolata-Regular.ttf b/.fonts/Inconsolata-Regular.ttf Binary files differ. diff --git a/.fonts/Roboto-Regular.ttf b/.fonts/Roboto-Regular.ttf Binary files differ. diff --git a/.fonts/Terminus.ttf b/.fonts/Terminus.ttf Binary files differ. diff --git a/.fonts/Ubuntu-R.ttf b/.fonts/Ubuntu-R.ttf Binary files differ. diff --git a/.fonts/UbuntuMono-B.ttf b/.fonts/UbuntuMono-B.ttf Binary files differ. diff --git a/.fonts/UbuntuMono-BI.ttf b/.fonts/UbuntuMono-BI.ttf Binary files differ. diff --git a/.fonts/UbuntuMono-R.ttf b/.fonts/UbuntuMono-R.ttf Binary files differ. diff --git a/.fonts/UbuntuMono-RI.ttf b/.fonts/UbuntuMono-RI.ttf Binary files differ. diff --git a/.fonts/fontawesome-webfont.ttf b/.fonts/fontawesome-webfont.ttf Binary files differ. diff --git a/.scripts/BAT2.sh b/.scripts/BAT2.sh @@ -0,0 +1,19 @@ +#!/bin/bash +status=`acpi -b | awk '{print $3}' | tr -d , | sed 2d` +percent=`acpi -b | acpi -b | awk '{print $4}' | cut -d % -f 1 | sed 2d` +if [ $status == "Full" ] +then + echo "Full $percent %" +elif [ $status == "Charging" ] +then + echo "charging: $percent %"; +else + if [ $percent -lt 20 ] + then + echo "critical: $percent %"; + else + echo "$percent %"; + fi + +fi + diff --git a/.scripts/checkupdates.sh b/.scripts/checkupdates.sh @@ -0,0 +1,14 @@ +#!/bin/bash +checkupdate=`checkupdates | wc -l` + +if [ $checkupdate == "0" ] +then + echo "$checkupdate" +else + echo "$checkupdate" + case $BLOCK_BUTTON in + 1) xterm -e 'sudo pacman -Syu' ;; + esac +fi + + diff --git a/.scripts/hdd.sh b/.scripts/hdd.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +df -h | sed -n 11p | awk '{print $4}' + diff --git a/.scripts/monitor.sh b/.scripts/monitor.sh @@ -0,0 +1,29 @@ +#!/bin/bash +EXTERNAL_OUTPUT="HDMI2" +INTERNAL_OUTPUT="eDP1" + +# if we don't have a file, start at zero +if [ ! -f "/tmp/monitor_mode.dat" ] ; then + monitor_mode="all" + +# otherwise read the value from the file +else + monitor_mode=`cat /tmp/monitor_mode.dat` +fi + +if [ $monitor_mode = "all" ]; then + monitor_mode="EXTERNAL" + xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto +elif [ $monitor_mode = "EXTERNAL" ]; then + monitor_mode="INTERNAL" + xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off +elif [ $monitor_mode = "INTERNAL" ]; then + monitor_mode="CLONES" + xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto +--same-as $INTERNAL_OUTPUT +else + monitor_mode="all" + xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto +--left-of $INTERNAL_OUTPUT +fi +echo "${monitor_mode}" > /tmp/monitor_mode.dat diff --git a/.scripts/rainy-paris-cafe-jazz-stream.sh b/.scripts/rainy-paris-cafe-jazz-stream.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Loop rain and coffeeshop ambiance +mplayer ~/.dotfiles/.sounds/RainyMood.mp3 -loop 0 -volume 45 & +mplayer ~/.dotfiles/.sounds/ParisCafe.mp3 -loop 0 -volume 40 & + +# Play appropriate radio station +# mplayer ~/.dotfiles/.sounds/Jazz.mp3 -volume 35 + +# Stop all mplayer streams when aborting +killall mplayer diff --git a/.scripts/volume.sh b/.scripts/volume.sh @@ -0,0 +1,9 @@ +#!/bin/bash +mute=`pamixer --get-mute` +vol=`pamixer --get-volume` +if [ $mute == "false" ] +then + echo "$vol %" +else + echo "Muted" +fi diff --git a/.scripts/weather.sh b/.scripts/weather.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#AccuWeather (r) RSS weather tool for conky +# +#USAGE: weather.sh UKXX0062 +# +#(c) Michael Seiler 2007 +METRIC=1 #Should be 0 or 1; 0 for F, 1 for C +if [ -z $1 ]; then +echo +echo "USAGE: weather.sh <locationcode>" +echo +exit 0; +fi +curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }' diff --git a/.sounds/ParisCafe.mp3 b/.sounds/ParisCafe.mp3 Binary files differ. diff --git a/.sounds/RainyMood.mp3 b/.sounds/RainyMood.mp3 Binary files differ. diff --git a/.xinitrc b/.xinitrc @@ -0,0 +1,59 @@ +#!/bin/sh + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + + + + + + + + xrdb -merge $sysresources + +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + + + + + + + + xrdb -merge "$userresources" + +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs + +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +pulseaudio --start & +pasystray & +nm-applet & +compton & +emacs --daemon & +setxkbmap -model pc105 -layout us,mk -option grp:caps_toggle & +feh --bg-scale /home/tin/.dotfiles/.config/wp.png & + +exec i3 diff --git a/i3blocks.conf b/i3blocks.conf @@ -0,0 +1,68 @@ +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +# Each block command defaults to the script name to avoid boilerplate. +command=/usr/lib/i3blocks/$BLOCK_NAME +separator_block_width=15 +markup=none + +# Check weather +[weather] +label= weather: +command=$HOME/.scripts/weather.sh "EUR|MK|MK000|SKOPJE|" +interval=300 +separator=true +color=#D0FC9A + +# Volume script +[volume] +label=vol: +command=$HOME/.scripts/volume.sh +interval=1 +separator=true + +# Battery +[battery2] +label=bat: +command=$HOME/.scripts/BAT2.sh +interval=30 +separator=true + +# Check for updates +[checkupdate] +label=pkg: +command=$HOME/.scripts/checkupdates.sh +interval=600 +separator=true +color=#D0FC9A + +# Memory usage +[memory] +label=mem: +separator=false +interval=30 + +# Disk usage (SSD) +[disk] +label=ssd: +interval=500 +separator=false + +[diskHDD] +label=hdd: +command=$HOME/.scripts/hdd.sh +interval=500 + +[iface] +label=local: +#instance=wlan0 +color=#D0FC9A +interval=10 +separator=true + +# Date Time +[time] +label=date: +command=date '+%d-%m / %a / %H:%M' +interval=1 + diff --git a/install.sh b/install.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +set -e + +# Source: https://gist.github.com/davejamesmiller/1965569 +ask() { + while true; do + if [ "${2:-}" = "Y" ]; then + prompt="Y/n" + default=Y + elif [ "${2:-}" = "N" ]; then + prompt="y/N" + default=N + else + prompt="y/n" + default= + fi + read -p "$1 [$prompt] " REPLY </dev/tty + if [ -z "$REPLY" ]; then + REPLY=$default + fi + case "$REPLY" in + Y*|y*) return 0 ;; + N*|n*) return 1 ;; + esac + done +} + +dir=`pwd` + +#Folders start here + +if ask "Install symlink for .config?" Y; then + ln -sfnv ${dir}/.config ${HOME}/.config +fi + +if ask "Install symlink for .scripts?" Y; then + ln -sfnv ${dir}/.scripts ${HOME}/.scripts +fi + +if ask "Install symlink for .fonts?" Y; then + ln -sfnv ${dir}/.fonts ${HOME}/.fonts +fi + +if ask "Install symlink for .ssh?" Y; then + ln -sfnv ${dir}/.ssh ${HOME}/.ssh +fi + +if ask "Install symlink for .emacs.d?" Y; then + ln -sfnv ${dir}/.emacs.d ${HOME}/.emacs.d +fi + +if ask "Create ~/.emacs.d/emacs-backup folder for Emacs backups?" Y; then + mkdir -v ~/.emacs.d/emacs-backup +fi + +# Files start here + +if ask "Install symlink for .i3blocks.conf?" Y; then + ln -sfv ${dir}/i3blocks.conf ${HOME}/.i3blocks.conf +fi + +if ask "Install symlink for .xinitrc?" Y; then + ln -sfv ${dir}/.xinitrc ${HOME}/.xinitrc +fi + + +if ask "Install user dirs?" Y; then + xdg-user-dirs-update +fi + +if ask "Make Screenshot folder under Pictures?" Y; then + mkdir ~/Pictures/Screenshot +fi + + + diff --git a/samwise.py b/samwise.py @@ -0,0 +1,169 @@ +# This is Samwise Archgee, he helps me everytime I need to install softwares I use on new machines! + +import os +import subprocess +import argparse + +soft = [ + # Surfing the Internet + "chromium", + + # Download and watch movies/shows + "qbittorrent", + "vlc", + + # PDF / Document viewer + "evince", + + # File Browser (GUI) + "pcmanfm", + + # Mail + "thunderbird", + + # Emacs + "emacs", + "vim", + + # Password Manager + "pass", + + # IRC + "weechat", + + # Music + "cmus", + "mplayer", + + # Terminal + "xfce4-terminal", + "tmux", + "fish", + + # Sys + "htop", + + # Python + "python-pip" + "python-virtualenv", + + # Photos + "mirage", + + # Other + "unzip", + "sl" # :) + "dnsutils", + "notify-osd", + "compton", + "scrot", + "youtube-dl", + "wget", + "openssl", + "curl", + "openvpn", + "openssh", + "dosfstools", + "feh", + "arandr", + "libreoffice", + "gvfs", + "virtualbox", + "unrar", +] + +aur = [ + "mons", + "visual-studio-code-bin", + "rofi-git", + "yaourt", + "pasystray", + "i3lock-next-git", + "franz", + "mirage", +] + +system = [ + "xorg", + "xterm", + "xorg-server", + "xorg-xinit", + "xorg-utils", + "xorg-server-utils", + "pulseaudio", + "pulseaudio-alsa", + "iw", + "wpa_supplicant", + "dialog", + "wpa_actiond", + "networkmanager", + "network-manager-applet", + "xdg-user-dirs", + "i3-wm", + "i3lock", + "i3blocks", + "acpi", + "pavucontrol", + "pamixer", + "qt4", +] + +# Install every item of the list "soft" +def softFunc(): + for s in soft: + subprocess.run(["pacman", "--noconfirm", "-S", s]) + + return None + +# Install every item of the list "aur" +def aurFunc(): + for a in aur: + subprocess.run(["yaourt", "--noconfirm", "-S", a]) + + return None + +# Install every item of the list "system" +def sysFunc(): + for s in system: + subprocess.run(["pacman", "--noconfirm", "-S", s]) + + return None + + +# List every item in the list "soft" +def listSoftFunc(): + for s in soft: + print(s) + + return None + +# List every item in the list "system" +def listSysFunc(): + for s in system: + print(s) + + return None + +def main(): + parser = argparse.ArgumentParser() + + parser.add_argument('-i', '--install', help="Install the packages from the lists") + parser.add_argument('-l', '--list', help="Print the packages list") + + parser.add_argument('arg', nargs='*') + + args = parser.parse_args() + + if args.install == 'system': + sysFunc() + if args.install == 'soft': + softFunc() + if args.install == 'aur': + aurFunc() + if args.list == 'system': + listSysFunc() + if args.list == 'soft': + listSoftFunc() + +if __name__ == "__main__": + main()