Reroganize repository
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
0a4424d25e
commit
cd781c174e
40 changed files with 113 additions and 22 deletions
253
system/.config/i3/config
Normal file
253
system/.config/i3/config
Normal 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
|
2
system/.config/i3/i3bar/datetime.sh
Executable file
2
system/.config/i3/i3bar/datetime.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
date '+ %d.%m.%Y %H:%M:%S'
|
18
system/.config/i3/i3bar/music.sh
Executable file
18
system/.config/i3/i3bar/music.sh
Executable 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/\&/\&\;}"
|
||||
|
||||
echo -e " $OUTPUT"
|
185
system/.config/i3/i3bar/shutdown.sh
Executable file
185
system/.config/i3/i3bar/shutdown.sh
Executable 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
|
11
system/.config/i3/i3bar/volume.sh
Executable file
11
system/.config/i3/i3bar/volume.sh
Executable 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
10
system/.config/i3/i3bar/wifi.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
# wifi.sh
|
||||
|
||||
SSID=$(iwgetid -r)
|
||||
|
||||
if [ "$SSID" != "Yggdrasil"]; then
|
||||
echo " Disconnected"
|
||||
else
|
||||
echo " $SSID"
|
||||
fi
|
38
system/.config/i3/i3blocks.conf
Normal file
38
system/.config/i3/i3blocks.conf
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue