Reroganize repository

Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
Severin Kaderli 2018-12-12 21:41:12 +01:00
parent 0a4424d25e
commit cd781c174e
40 changed files with 113 additions and 22 deletions

9
system/.Xresources Normal file
View file

@ -0,0 +1,9 @@
! ------------------------------------------------------------------------------
! ROFI Color theme
! ------------------------------------------------------------------------------
rofi.color-enabled: true
rofi.color-window: #273238, #273238, #1e2529
rofi.color-normal: #273238, #c1c1c1, #273238, #394249, #ffffff
rofi.color-active: #273238, #80cbc4, #273238, #394249, #80cbc4
rofi.color-urgent: #273238, #ff1844, #273238, #394249, #ff1844
rofi.seperator-style: solid

17
system/.aliases Normal file
View file

@ -0,0 +1,17 @@
#!/bin/bash
#
# Author: Severin Kaderli <severin.kaderli@gmail.com>
# Shortcut for clear because I often type the DOS command instead
alias cls="clear"
# Use exa as ls replacement
alias ls="exa -al"
alias ll="exa -al"
# Use ripgrep as grep replacement
alias grep="rg -n"
# cd shortcut to get to my Projects folder
alias pj="cd ~/Projects"
alias gw2="optirun wine64 ~/.wine/drive_c/Program\ Files/Guild\ Wars\ 2/Gw2-64.exe -dx9single -autologin -mapLoadinfo"

7
system/.bash_logout Normal file
View file

@ -0,0 +1,7 @@
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

20
system/.bash_profile Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
#
# Author: Severin Kaderli <severin.kaderli@gmail.com>
# We just source .bashrc so we don't need to manage two files.
if [[ -f $HOME/.bashrc ]]; then
. $HOME/.bashrc
fi
# Setting keyboard colors
if [[ -f $HOME/.keyleds ]]; then
. $HOME/.keyleds
fi
# Activate correct crontab file
crontab $HOME/.crontab
# If we are on tty1 we start the x-server
if [ "$(tty)" = "/dev/tty1" ]; then
startx && exit
fi

103
system/.bashrc Normal file
View file

@ -0,0 +1,103 @@
#!/bin/bash
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm|xterm-color|*-256color) color_prompt=yes;;
esac
unset color_prompt force_color_prompt
# Enable color support of ls
if [ -f $HOME/.dircolors ]; then
dircolors -b $HOME/.dircolors > /dev/null 2>&1
fi
# Sourcing alias definitions
if [ -f $HOME/.aliases ]; then
. $HOME/.aliases
fi
if [ -f /usr/share/git/completion/git-prompt.sh ]; then
. /usr/share/git/completion/git-prompt.sh
fi
# Enable autocompletion features
if [ -f /etc/bash_completion ]; then
/etc/bash_completion
fi
complete -cf sudo
# Setting default editor and terminal
export VISUAL=vim
export EDITOR="$VISUAL"
export TERMINAL=termite
export QT_QPA_PLATFORMTHEME=qt5ct
# ibus
export GTK_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=xim
# wine
export WINEDEBUG=-all
export __GL_FSAA_MODE=0
export __GL_DEFAULT_LOG_ANISO=0
export __GL_LOG_MAX_ANISO=0
export STAGING_SHARED_MEMORY=1
export STAGING_RT_PRIORITY_SERVER=90
export WINEESYNC=1
export PBA_ENABLE=1
#export LD_PRELOAD="libpthread.so.0 libGL.so.1"
export __GL_THREADED_OPTIMIZATIONS=1
export __GL_SYNC_TO_VBLANK=0
export __GL_YIELD=NOTHING
# Path
if [ -d "$HOME/bin" ]; then
export PATH="$PATH:$HOME/bin"
fi
export PATH="$PATH:$GEM_HOME/bin"
# Color codes for bash prompt
Reset='\033[0m'
Green='\033[32m'
Red='\033[31m'
Blue='\033[34m'
Yellow='\033[33m'
# Set bash prompt
set_bash_prompt() {
PS1="${Reset}┌─"
PS1="${PS1}${Red}[\t]"
PS1="${PS1}${Blue}[\h]"
PS1="${PS1}${Yellow}[\w]"
PS1="${PS1}${Blue}$(__git_ps1 "[%s]")"
PS1="${PS1}${Reset}\n└─╼ "
export MSYS2_PS1="$PS1"
}
export PROMPT_COMMAND=set_bash_prompt

View file

@ -0,0 +1 @@
opacity-rule = [ "85:class_g = 'Termite'" ];

View file

@ -0,0 +1,265 @@
[global]
font = Roboto 12
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
markup = yes
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%s</b>\n%b"
# Sort messages by urgency.
sort = no
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 3
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = -1
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# Ignore newlines '\n' in notifications.
ignore_newline = no
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x25-10+45"
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
#transparency = 15
transparency = 8
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 0
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 50
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 16
# Horizontal padding.
horizontal_padding = 16
# Defines color of the frame around the notification window.
#frame_color = "#171717"
frame_color = "#535c5c"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 2
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
#browser = /usr/bin/qutebrowser
# Align icons left/right/off
icon_position = right
# Paths to default icons.
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#171717"
foreground = "#a4a4a4"
timeout = 5
[urgency_normal]
background = "#171717"
foreground = "#a4a4a4"
timeout = 5
[urgency_critical]
background = "#171717"
foreground = "#a4a4a4"
timeout = 0
#[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
# background = "#2e3440"
# foreground = "#ECEFF4"
# timeout = 15
#[urgency_normal]
# background = "#2e3440"
# foreground = "#ECEFF4"
# timeout = 15
#[urgency_critical]
# background = "#2e3440"
# foreground = "#ECEFF4"
# timeout = 20
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[volume]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

View file

@ -0,0 +1,4 @@
file:///home/severin/GoogleDrive GoogleDrive
file:///home/severin/Downloads Downloads
file:///home/severin/Projects Projects
file:///home/severin/dotfiles dotfiles

View file

@ -0,0 +1,14 @@
[Settings]
gtk-theme-name=Adapta-Nokto
gtk-icon-theme-name=Paper-Mono-Dark
gtk-font-name=Roboto 11
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull

253
system/.config/i3/config Normal file
View file

@ -0,0 +1,253 @@
# 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).
#
set $mod Mod4
set $alt Mod1
new_window none
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Roboto, Font Awesome 5 Free 15px
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec termite -c ~/.config/termite/config
# kill focused window
bindsym $mod+Shift+q kill
# Start rofi
bindsym $mod+r exec rofi -show run -opacity 100 -lines 5 -location 2
# change focus
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+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
# Set monitor names
set $output1 HDMI1
set $output2 eDP1
# Set workspace titles
set $workspace1 "1: "
set $workspace2 "2: "
set $workspace3 "3: "
set $workspace4 "4: "
set $workspace5 "5: "
set $workspace6 "6: "
set $workspace7 "7: "
set $workspace8 "8: "
set $workspace9 "9: "
set $workspace10 "10: "
# Assign workspaces to screens
workspace $workspace1 output $output1
workspace $workspace2 output $output2
workspace $workspace3 output $output1
workspace $workspace4 output $output2
workspace $workspace5 output $output1
workspace $workspace6 output $output2
workspace $workspace7 output $output1
workspace $workspace8 output $output1
workspace $workspace9 output $output2
workspace $workspace10 output $output2
# Workspace switching
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 $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
bindsym $mod+KP_1 workspace $workspace1
bindsym $mod+KP_2 workspace $workspace2
bindsym $mod+KP_3 workspace $workspace3
bindsym $mod+KP_4 workspace $workspace4
bindsym $mod+KP_5 workspace $workspace5
bindsym $mod+KP_6 workspace $workspace6
bindsym $mod+KP_7 workspace $workspace7
bindsym $mod+KP_8 workspace $workspace8
bindsym $mod+KP_9 workspace $workspace9
bindsym $mod+KP_0 workspace $workspace10
# Moving 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 $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
bindsym $mod+Shift+KP_1 move container to workspace $workspace1
bindsym $mod+Shift+KP_2 move container to workspace $workspace2
bindsym $mod+Shift+KP_3 move container to workspace $workspace3
bindsym $mod+Shift+KP_4 move container to workspace $workspace4
bindsym $mod+Shift+KP_5 move container to workspace $workspace5
bindsym $mod+Shift+KP_6 move container to workspace $workspace6
bindsym $mod+Shift+KP_7 move container to workspace $workspace7
bindsym $mod+Shift+KP_8 move container to workspace $workspace8
bindsym $mod+Shift+KP_9 move container to workspace $workspace9
bindsym $mod+Shift+KP_0 move container to workspace $workspace10
# Reload configuration file
#bindsym $mod+Shift+r reload
# Restart i3
bindsym $mod+Shift+r restart
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
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+x mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
# status_command i3blocks -c $HOME/.config/i3/i3blocks.conf
# position top
# colors {
# background #222D32
# focused_workspace #222D32 #268bd2 #FFFFFF
# active_workspace #222D32 #222D32 #268bd2
# inactive_workspace #222D32 #222D32 #268bd2
# urgent_workspace #222D32 #222D32 #268bd2
# }
#}
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
#######################################
# Custom keybinding
#######################################
# Screen lock controls
bindsym $mod+l exec --no-startup-id $HOME/bin/screenlock.sh
bindsym XF86Sleep exec --no-startup-id $HOME/bin/screenlock.sh
# Volume controls
bindsym XF86AudioMute exec --no-startup-id pamixer -t
bindsym $mod+m exec --no-startup-id pamixer -t
bindsym XF86AudioRaiseVolume exec --no-startup-id $HOME/bin/increase_volume.sh
bindsym $mod+KP_Add exec --no-startup-id $HOME/bin/increase_volume.sh
bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 5 --allow-boost
bindsym $mod+KP_Subtract exec --no-startup-id pamixer -d 5 --allow-boost
# Brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5
# Music controls
bindsym XF86AudioPlay exec --no-startup-id cmus-remote -u
bindsym $mod+KP_Enter exec --no-startup-id cmus-remote -u
bindsym XF86AudioNext exec --no-startup-id cmus-remote -n
bindsym $mod+Control+Right exec --no-startup-id cmus-remote -n
bindsym XF86AudioPrev exec --no-startup-id cmus-remote -r
bindsym $mod+Control+Left exec --no-startup-id cmus-remote -r
# Moving workspaces to other displays
bindsym $mod+$alt+Left move workspace to output left
bindsym $mod+$alt+Right move workspace to output right
#######################################
# Startup applications
#######################################
#
exec wicd-client --tray
# Merge .Xresources on boot
exec xrdb -merge $HOME/.Xresources
# Compton
exec --no-startup-id compton
# Background-Image
exec_always --no-startup-id feh --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/Fearsome_Awakening.png
# Monitor settings
exec_always --no-startup-id $HOME/bin/resolution.sh
# Other applications
exec google-chrome-beta
exec termite
exec discord
exec nemo
exec keepassxc
#exec termite -e cmus --name cmus
# Assign programs to specific workspaces
###
assign [class="Google-chrome-beta"] $workspace1
assign [instance="cmus"] $workspace10
assign [class="Code"] $workspace3
assign [class="Nemo"] $workspace4
assign [class="discord"] $workspace5
assign [class="Steam"] $workspace6
assign [class="keepassxc"] $workspace8
assign [class="vlc"] $workspace9
assign [class="mpv"] $workspace9
# Disable window titlebars
for_window [class="^.*"] border pixel 0
# Gaps
gaps inner 10
gaps outer -10

View file

@ -0,0 +1,2 @@
#!/bin/bash
date '+ %d.%m.%Y  %H:%M:%S'

View file

@ -0,0 +1,18 @@
#!/bin/bash
# music.sh
QUERY="$(cmus-remote -Q)"
STATUS="$(echo "$QUERY" | grep -e "status " | cut -d " " -f 2)"
ARTIST="$(echo "$QUERY" | grep -e " artist " | cut -d " " -f 3-)"
TITLE="$(echo "$QUERY" | grep -e " title " | cut -d " " -f 3-)"
OUTPUT="$ARTIST - $TITLE"
if [ "$STATUS" != "playing" ]; then
OUTPUT="Not playing"
fi
# Escaping the & character
OUTPUT="${OUTPUT/\&/\&amp\;}"
echo -e "$OUTPUT"

View file

@ -0,0 +1,185 @@
#!/bin/bash
#
# Use rofi/zenity to change system runstate thanks to systemd.
#
# Note: this currently relies on associative array support in the shell.
#
# Inspired from i3pystatus wiki:
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
#
# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr>
#
# 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 <http://www.gnu.org/licenses/>.
#######################################################################
# BEGIN CONFIG #
#######################################################################
# Use a custom lock script
#LOCKSCRIPT="i3lock-extra -m pixelize"
# Colors: FG (foreground), BG (background), HL (highlighted)
FG_COLOR="#bbbbbb"
BG_COLOR="#111111"
HLFG_COLOR="#111111"
HLBG_COLOR="#bbbbbb"
BORDER_COLOR="#222222"
# Options not related to colors
ROFI_TEXT="Menu:"
ROFI_OPTIONS="-width -11 -location 3 -hide-scrollbar -bw 2"
# Zenity options
ZENITY_TITLE="Menu"
ZENITY_TEXT="Action:"
ZENITY_OPTIONS="--column= --hide-header"
#######################################################################
# END CONFIG #
#######################################################################
# Whether to ask for user's confirmation
enable_confirmation=false
# Preferred launcher if both are available
preferred_launcher="rofi"
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
where:
-h show this help text
-c ask for user confirmation
-p preferred launcher (rofi or zenity)
This script depends on:
- systemd,
- i3,
- rofi or zenity."
# Check whether the user-defined launcher is valid
launcher_list=(rofi zenity)
function check_launcher() {
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
echo "Supported launchers: ${launcher_list[*]}"
exit 1
else
# Get array with unique elements and preferred launcher first
# Note: uniq expects a sorted list, so we cannot use it
i=1
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
fi
}
# Parse CLI arguments
while getopts "hcp:" option; do
case "${option}" in
h) echo "${usage}"
exit 0
;;
c) enable_confirmation=true
;;
p) preferred_launcher="${OPTARG}"
check_launcher "${preferred_launcher}"
;;
*) exit 1
;;
esac
done
# Check whether a command exists
function command_exists() {
command -v "$1" &> /dev/null 2>&1
}
# systemctl required
if ! command_exists systemctl ; then
exit 1
fi
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[Shutdown]="systemctl poweroff"
[Reboot]="systemctl reboot"
[Hibernate]="systemctl hibernate"
[Suspend]="systemctl suspend"
[Halt]="systemctl halt"
[Lock]="~/bin/screenlock.sh"
[Logout]="i3-msg exit"
[Cancel]=""
)
menu_nrows=${#menu[@]}
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher_exe=""
launcher_options=""
rofi_colors=""
function prepare_launcher() {
if [[ "$1" == "rofi" ]]; then
rofi_colors="-bc ${BORDER_COLOR} -bg ${BG_COLOR} -fg ${FG_COLOR} \
-hlfg ${HLFG_COLOR} -hlbg ${HLBG_COLOR}"
launcher_exe="rofi"
launcher_options="-dmenu -i -lines ${menu_nrows} -p ${ROFI_TEXT} \
${rofi_colors} ${ROFI_OPTIONS}"
elif [[ "$1" == "zenity" ]]; then
launcher_exe="zenity"
launcher_options="--list --title=${ZENITY_TITLE} --text=${ZENITY_TEXT} \
${ZENITY_OPTIONS}"
fi
}
for l in "${launcher_list[@]}"; do
if command_exists "${l}" ; then
prepare_launcher "${l}"
break
fi
done
# No launcher available
if [[ -z "${launcher_exe}" ]]; then
exit 1
fi
launcher="${launcher_exe} ${launcher_options}"
selection="$(printf '%s\n' "${!menu[@]}" | sort | ${launcher})"
function ask_confirmation() {
if [ "${launcher_exe}" == "rofi" ]; then
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
${rofi_colors} ${ROFI_OPTIONS})
[ "${confirmed}" == "Yes" ] && confirmed=0
elif [ "${launcher_exe}" == "zenity" ]; then
zenity --question --text "Are you sure you want to ${selection,,}?"
confirmed=$?
fi
if [ "${confirmed}" == 0 ]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
}
if [[ $? -eq 0 && ! -z ${selection} ]]; then
if [[ "${enable_confirmation}" = true && \
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
ask_confirmation
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi

View file

@ -0,0 +1,11 @@
#!/bin/bash
# volume.sh
volume=$(/usr/lib/i3blocks/volume 5 pulse)
if [ ${volume::-1} -ge "35" ]; then
echo "$volume"
elif [ ${volume::-1} -gt "0" ]; then
echo "$volume"
else
echo "$volume"
fi

10
system/.config/i3/i3bar/wifi.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
# wifi.sh
SSID=$(iwgetid -r)
if [ "$SSID" != "Yggdrasil"]; then
echo " Disconnected"
else
echo "$SSID"
fi

View file

@ -0,0 +1,38 @@
# i3blocks config file
command=/usr/share/i3blocks/$BLOCK_NAME
markup=none
full_text=
align=center
separator=false
separator_block_width=10
color=#268bd2
[Music]
markup=pango
command=~/.config/i3/i3bar/music.sh
interval=1
color=#FFFFFF
[seperator]
[Volume]
full_text=
command=~/.config/i3/i3bar/volume.sh
interval=1
color=#FFFFFF
[seperator]
[Wifi]
full_text=
command=~/.config/i3/i3bar/wifi.sh
interval=5
color=#FFFFFF
[seperator]
[Datetime]
command=~/.config/i3/i3bar/datetime.sh
interval=1
color=#FFFFFF

View file

@ -0,0 +1,166 @@
[colors]
background = #222D32
foreground = #A1B0B8
[bar/top]
monitor = HDMI-1
width = 100%
height = 35
offset-x = 0
offset-y = 0
background = ${colors.background}
foreground = ${colors.foreground}
padding-right = 2
module-margin = 2
font-0 = Roboto:pixelsize=12;3
font-1 = Font Awesome 5 Free:style=Solid::pixelsize=12;3
font-2 = Font Awesome 5 Brands:pixelsize=12;3
font-3 = siji:pixelsize=12;3
modules-left = i3
modules-center = xwindow
modules-right = battery volume backlight wlan date
#wm-restack = i3
scroll-up = i3wm-desknext
scroll-down = i3wm-deskprev
tray-position = right
[bar/top2]
inherit = bar/top
monitor = eDP-1
[module/i3]
type = internal/i3
# Only show workspaces on the same output as the bar
pin-workspaces = true
strip-wsnumbers = true
index-sort = true
enable-click = true
enable-scroll = true
wrapping-scroll = false
label-mode = %mode%
label-mode-padding = 1
label-focused = %name%
label-focused-foreground = ${colors.background}
label-focused-background = ${colors.foreground}
label-focused-padding = 4
label-unfocused = %name%
label-unfocused-padding = 4
label-visible = %name%
label-visible-padding = 4
label-urgent = %name%
label-urgent-foreground = ${colors.foreground}
label-urgent-background = ${colors.background}
label-urgent-padding = 4
[module/xwindow]
type = internal/xwindow
label = %title:0:50:...%
label-padding = 4
[module/date]
type = internal/date
interval = 1.0
date = %F
time = %H:%M:%S
label =  %date% %time%
format = <label>
[module/battery]
type = internal/battery
; This is useful in case the battery never reports 100% charge
full-at = 99
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5
time-format = %Hh%Mm
label-full =  %percentage%%
label-charging = %percentage%% %time%
format-charging = <animation-charging> <label-charging>
label-discharging = %percentage%% %time%
format-discharging = <ramp-capacity> <label-discharging>
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-framerate = 500
[module/wlan]
type = internal/network
interface = wlp3s0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground}
[module/volume]
type = internal/pulseaudio
use-ui-max = true
interval = 5
format-volume = <ramp-volume> <label-volume>
format-muted = <label-muted>
label-volume = %percentage%%
label-muted =  %percentage%%
label-muted-foreground = #aaa
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
[module/backlight]
type = custom/script
exec = light -G | cut -d. -f1
format =  <label>
label = %output%%
scroll-up = light -A 5
scroll-down = light -U 5
interval = 0.1

View file

@ -0,0 +1,11 @@
#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
# Launch bar1 and bar2
polybar top &
polybar top2 &

View file

@ -0,0 +1,3 @@
player=mplayer -cache 8192
player-no-close
twitch-oauth-token=30ktx6jc273cdc9gmkb7jftny3vrgn

View file

@ -0,0 +1,54 @@
[options]
resize_grip = false
scroll_on_output = false
scroll_on_keystroke = true
audible_bell = false
visible_bell = false
mouse_autohide = false
allow_bold = true
dynamic_title = true
urgent_on_bell = false
clickable_url = true
font = Hack 12
scrollback_lines = 1000
search_wrap = true
# "system", "on" or "off"
cursor_blink = system
# "block", "underline" or "ibeam"
cursor_shape = ibeam
#modify_other_keys = false
[colors]
# special
foreground = #a1b0b8
foreground_bold = #a1b0b8
cursor = #a1b0b8
background = #263238
# black
color0 = #252525
color8 = #252525
# red
color1 = #ff5252
color9 = #ff5252
# green
color2 = #c3d82c
color10 = #c3d82c
# yellow
color3 = #ffd740
color11 = #ffd740
# blue
color4 = #40c4ff
color12 = #40c4ff
# magenta
color5 = #ff4081
color13 = #ff4081

2
system/.crontab Normal file
View file

@ -0,0 +1,2 @@
# Synchronize Google Drive
*/10 * * * * grive -d -p /home/severin/GoogleDrive/ >> /home/severin/.logs/cron.log 2>&1

300
system/.dircolors Normal file
View file

@ -0,0 +1,300 @@
# Dark 256 color solarized theme for the color GNU ls utility.
# Used and tested with dircolors (GNU coreutils) 8.5
#
# @author {@link http://sebastian.tramp.name Sebastian Tramp}
# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL)
#
# More Information at
# https://github.com/seebi/dircolors-solarized
# Term Section
TERM Eterm
TERM ansi
TERM color-xterm
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM console
TERM cygwin
TERM dtterm
TERM dvtm
TERM dvtm-256color
TERM eterm-color
TERM fbterm
TERM gnome
TERM gnome-256color
TERM jfbterm
TERM konsole
TERM konsole-256color
TERM kterm
TERM linux
TERM linux-c
TERM mach-color
TERM mlterm
TERM putty
TERM putty-256color
TERM rxvt
TERM rxvt-256color
TERM rxvt-cygwin
TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM rxvt-unicode256
TERM rxvt-unicode-256color
TERM screen
TERM screen-16color
TERM screen-16color-bce
TERM screen-16color-s
TERM screen-16color-bce-s
TERM screen-256color
TERM screen-256color-bce
TERM screen-256color-s
TERM screen-256color-bce-s
TERM screen-256color-italic
TERM screen-bce
TERM screen-w
TERM screen.linux
TERM screen.xterm-256color
TERM st
TERM st-meta
TERM st-256color
TERM st-meta-256color
TERM tmux
TERM tmux-256color
TERM vt100
TERM xterm
TERM xterm-16color
TERM xterm-256color
TERM xterm-256color-italic
TERM xterm-88color
TERM xterm-color
TERM xterm-debian
TERM xterm-termite
## Documentation
#
# standard colors
#
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#
#
# 256 color support
# see here: http://www.mail-archive.com/bug-coreutils@gnu.org/msg11030.html)
#
# Text 256 color coding:
# 38;5;COLOR_NUMBER
# Background 256 color coding:
# 48;5;COLOR_NUMBER
## Special files
NORMAL 00;38;5;244 # no color code at all
#FILE 00 # regular file: use no color at all
RESET 0 # reset to "normal" color
DIR 00;38;5;33 # directory 01;34
LINK 00;38;5;37 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 48;5;230;38;5;136;01 # pipe
SOCK 48;5;230;38;5;136;01 # socket
DOOR 48;5;230;38;5;136;01 # door
BLK 48;5;230;38;5;244;01 # block device driver
CHR 48;5;230;38;5;244;01 # character device driver
ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file
SETUID 48;5;160;38;5;230 # file that is setuid (u+s)
SETGID 48;5;136;38;5;230 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky
STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 00;38;5;64
## Archives or compressed (violet + bold for compression)
.tar 00;38;5;61
.tgz 00;38;5;61
.arj 00;38;5;61
.taz 00;38;5;61
.lzh 00;38;5;61
.lzma 00;38;5;61
.tlz 00;38;5;61
.txz 00;38;5;61
.zip 00;38;5;61
.z 00;38;5;61
.Z 00;38;5;61
.dz 00;38;5;61
.gz 00;38;5;61
.lz 00;38;5;61
.xz 00;38;5;61
.bz2 00;38;5;61
.bz 00;38;5;61
.tbz 00;38;5;61
.tbz2 00;38;5;61
.tz 00;38;5;61
.deb 00;38;5;61
.rpm 00;38;5;61
.jar 00;38;5;61
.rar 00;38;5;61
.ace 00;38;5;61
.zoo 00;38;5;61
.cpio 00;38;5;61
.7z 00;38;5;61
.rz 00;38;5;61
.apk 00;38;5;61
.gem 00;38;5;61
# Image formats (yellow)
.jpg 00;38;5;136
.JPG 00;38;5;136 #stupid but needed
.jpeg 00;38;5;136
.gif 00;38;5;136
.bmp 00;38;5;136
.pbm 00;38;5;136
.pgm 00;38;5;136
.ppm 00;38;5;136
.tga 00;38;5;136
.xbm 00;38;5;136
.xpm 00;38;5;136
.tif 00;38;5;136
.tiff 00;38;5;136
.png 00;38;5;136
.PNG 00;38;5;136
.svg 00;38;5;136
.svgz 00;38;5;136
.mng 00;38;5;136
.pcx 00;38;5;136
.dl 00;38;5;136
.xcf 00;38;5;136
.xwd 00;38;5;136
.yuv 00;38;5;136
.cgm 00;38;5;136
.emf 00;38;5;136
.eps 00;38;5;136
.CR2 00;38;5;136
.ico 00;38;5;136
# Files of special interest (base1)
.tex 00;38;5;245
.rdf 00;38;5;245
.owl 00;38;5;245
.n3 00;38;5;245
.ttl 00;38;5;245
.nt 00;38;5;245
.torrent 00;38;5;245
.xml 00;38;5;245
*Makefile 00;38;5;245
*Rakefile 00;38;5;245
*Dockerfile 00;38;5;245
*build.xml 00;38;5;245
*rc 00;38;5;245
*1 00;38;5;245
.nfo 00;38;5;245
*README 00;38;5;245
*README.txt 00;38;5;245
*readme.txt 00;38;5;245
.md 00;38;5;245
*README.markdown 00;38;5;245
.ini 00;38;5;245
.yml 00;38;5;245
.cfg 00;38;5;245
.conf 00;38;5;245
.h 00;38;5;245
.hpp 00;38;5;245
.c 00;38;5;245
.cpp 00;38;5;245
.cxx 00;38;5;245
.cc 00;38;5;245
.objc 00;38;5;245
.sqlite 00;38;5;245
.go 00;38;5;245
.sql 00;38;5;245
.csv 00;38;5;245
# "unimportant" files as logs and backups (base01)
.log 00;38;5;240
.bak 00;38;5;240
.aux 00;38;5;240
.lof 00;38;5;240
.lol 00;38;5;240
.lot 00;38;5;240
.out 00;38;5;240
.toc 00;38;5;240
.bbl 00;38;5;240
.blg 00;38;5;240
*~ 00;38;5;240
*# 00;38;5;240
.part 00;38;5;240
.incomplete 00;38;5;240
.swp 00;38;5;240
.tmp 00;38;5;240
.temp 00;38;5;240
.o 00;38;5;240
.pyc 00;38;5;240
.class 00;38;5;240
.cache 00;38;5;240
# Audio formats (orange)
.aac 00;38;5;166
.au 00;38;5;166
.flac 00;38;5;166
.mid 00;38;5;166
.midi 00;38;5;166
.mka 00;38;5;166
.mp3 00;38;5;166
.mpc 00;38;5;166
.ogg 00;38;5;166
.opus 00;38;5;166
.ra 00;38;5;166
.wav 00;38;5;166
.m4a 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axa 00;38;5;166
.oga 00;38;5;166
.spx 00;38;5;166
.xspf 00;38;5;166
# Video formats (as audio + bold)
.mov 00;38;5;166
.MOV 00;38;5;166
.mpg 00;38;5;166
.mpeg 00;38;5;166
.m2v 00;38;5;166
.mkv 00;38;5;166
.ogm 00;38;5;166
.mp4 00;38;5;166
.m4v 00;38;5;166
.mp4v 00;38;5;166
.vob 00;38;5;166
.qt 00;38;5;166
.nuv 00;38;5;166
.wmv 00;38;5;166
.asf 00;38;5;166
.rm 00;38;5;166
.rmvb 00;38;5;166
.flc 00;38;5;166
.avi 00;38;5;166
.fli 00;38;5;166
.flv 00;38;5;166
.gl 00;38;5;166
.m2ts 00;38;5;166
.divx 00;38;5;166
.webm 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axv 00;38;5;166
.anx 00;38;5;166
.ogv 00;38;5;166
.ogx 00;38;5;166

47
system/.gitconfig Normal file
View file

@ -0,0 +1,47 @@
[user]
email = severin.kaderli@gmail.com
name = Severin Kaderli
[alias]
# Display the history of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# Shortcut for status
s = status
# Add all files
a = add --all
# Create a commit and sign it off
c = commit -s
# Push to the master branch of the origin remote
p = push --follow-tags
# Tag the latest commit
t = !sh -c 'git tag -a $1 -m $1' -
# Shortcut for diff
d = diff
[color]
# Activate color use in git commands
ui = auto
[core]
editor = vim
[push]
default = upstream
[url "git@gitlab.com:severinkaderli/"]
insteadOf = gl:
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = manager

18
system/.gtkrc-2.0 Normal file
View file

@ -0,0 +1,18 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/home/severin/.gtkrc-2.0.mine"
gtk-theme-name="Adapta-Nokto"
gtk-icon-theme-name="Paper-Mono-Dark"
gtk-font-name="Roboto 11"
gtk-cursor-theme-name="Paper"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"

14
system/.gtkrc-2.0.mine Normal file
View file

@ -0,0 +1,14 @@
gtk-theme-name="Adapta-Nokto"
gtk-icon-theme-name="Paper-Mono-Dark"
gtk-font-name="Roboto 11"
gtk-cursor-theme-name="Paper"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"

21
system/.keyleds Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
#
# Author: Severin Kaderli <severin.kaderli@gmail.com>
# Key groups
g810-led -g keys FF4500
g810-led -g fkeys FF00FF
g810-led -g arrows FFFF00
g810-led -g numeric 228B22
g810-led -g multimedia FF0000
g810-led -g modifiers 00BFFF
g810-led -g functions DEB887
g810-led -g logo DEB887
g810-led -g indicators DEB887
# Individual keys
g810-led -k escape 00BFFF
g810-led -k enter 00BFFF
g810-led -k tab 00BFFF
g810-led -k capslock 00BFFF
g810-led -k back 00BFFF

10
system/.vimrc Normal file
View file

@ -0,0 +1,10 @@
syntax on
set encoding=utf-8
set virtualedit=onemore
set number
filetype on
filetype indent on
filetype plugin on
:imap jk <Esc>

13
system/.xinitrc Normal file
View file

@ -0,0 +1,13 @@
# Disable screen saver
xset s off
xset -dpms
xset s noblank
# Set keyboard layout
setxkbmap -model pc105 -layout ch
# Start ibus
ibus-daemon -drx
# Start i3
exec dbus-launch i3

14
system/.xprofile Normal file
View file

@ -0,0 +1,14 @@
# Disable screen saver
xset s off
xset -dpms
xset s noblank
# Set keyboard layout
setxkbmap -model pc105 -layout ch
# Start ibus
ibus-daemon -drx
if [[ -f $HOME/.bash_profile ]]; then
. $HOME/.bash_profile
fi

4
system/bin/increase_volume.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
if [[ $(pamixer --get-volume) -lt 150 ]]; then
pamixer -i 5 --allow-boost
fi

2
system/bin/resolution.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output VIRTUAL1 --off --output DP3 --off --output eDP1 --mode 1920x1080 --pos 1400x472 --rotate normal --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --mode 1280x1024 --pos 120x528 --rotate normal --output DP2 --off

2
system/bin/screenlock.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
dm-tool lock

16
system/bin/server.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
#
# This script allows me to quickly start or stop apache2 and mysql.
#
# Usage: ./server.sh [start|stop]
if [ "$1" == "start" ]; then
sudo systemctl start httpd.service
sudo systemctl start mariadb.service
elif [ "$1" == "stop" ]; then
sudo systemctl stop httpd.service
sudo systemctl stop mariadb.service
else
echo "'$1' is an unknown option"
exit 0
fi

20
system/bin/twitch.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
#
# This script simply uses livestreamer <http://docs.livestreamer.io/> to
# stream a twitch stream. It's only a little shortcut, so I don't have to
# type so much.
#
# Usage: ./twitch.sh USERNAME [RESOLUTION]
if [[ -z $1 ]]; then
echo "Please enter a username!"
exit 1
fi
if [[ -z $2 ]]; then
resolution="best"
else
resolution="$2"
fi
streamlink -v -l debug "twitch.tv/$1" "$resolution"