Working on README.md
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
c42bd33b8c
commit
148016793e
7 changed files with 24 additions and 268 deletions
28
README.md
28
README.md
|
@ -1,9 +1,29 @@
|
||||||
# dotfiles
|
# dotfiles
|
||||||
My Linux configuration files.
|
This repository contains all of my configuration files for my current Arch Linux installation and an install script so I can quickly replicate my setup.
|
||||||
|
|
||||||
## Features
|
While the configurations are based on my preferences and made my dotfiles public so others can see how I solved specific problems or are looking for some inspiration.
|
||||||
- i3-Configuration
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
The installation is pretty straightforward using a couple of installation scripts.
|
||||||
|
|
||||||
1. Clone the repository
|
1. Clone the repository
|
||||||
2. Run ./install.sh
|
2. Run `./install.sh`
|
||||||
|
3. Reboot the system
|
||||||
|
4. Run `./post-install.sh`
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
The list of my used arch packages are found inside the files in `packages`. The files are numbered in the order they are installed, so packages inside `packages.list` are installed first and then packages in `packages2.list` are installed.
|
||||||
|
|
||||||
|
The main content of this repository can be found in the `system` folder. It contains all configurations files, directories and script that are get symlinked by my install script.
|
||||||
|
|
||||||
|
### `config/dunst`
|
||||||
|
This folder contains my configuration for the [dunst](https://dunst-project.org) notification daemon.
|
||||||
|
|
||||||
|
- Standard dotfiles (.bashrc, .aliases, etc...)
|
||||||
|
- [i3wm](https://i3wm.org/) configuration
|
||||||
|
- [Polybar](https://polybar.github.io/) configuration
|
||||||
|
- [Termite](https://github.com/thestinger/termite) configuration
|
||||||
|
- Notifications using [dunst](https://dunst-project.org/)
|
||||||
|
- GTK configuration
|
||||||
|
- [Vim](https://www.vim.org/) configuration
|
||||||
|
- Custom scripts for different tasks
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
date '+ %d.%m.%Y %H:%M:%S'
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/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/\&/\&\;}"
|
|
||||||
|
|
||||||
echo -e " $OUTPUT"
|
|
|
@ -1,185 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,10 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# wifi.sh
|
|
||||||
|
|
||||||
SSID=$(iwgetid -r)
|
|
||||||
|
|
||||||
if [ "$SSID" != "Yggdrasil"]; then
|
|
||||||
echo " Disconnected"
|
|
||||||
else
|
|
||||||
echo " $SSID"
|
|
||||||
fi
|
|
|
@ -1,38 +0,0 @@
|
||||||
# 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
|
|
Loading…
Add table
Add a link
Reference in a new issue