pull/1/head
kalle 2022-02-06 19:45:28 +01:00
parent 65f26da829
commit 5a588288bb
24 changed files with 396 additions and 48 deletions

View File

@ -380,6 +380,9 @@
# msg_urgency = critical
# fullscreen = show
[no-fullscreen]
fullscreen = pushback
#[espeak]
# summary = "*"
# script = dunst_espeak.sh

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ set $mod Mod4
font pango:DejaVu Sans Mono 8
# Launch picom on startup
exec --no-startup-id picom -bc
exec --no-startup-id picom --experimental-backends -bc
# Set a random desktop background
exec --no-startup-id feh --bg-scale --random ~/Pictures/Wallpapers/
@ -22,6 +22,27 @@ exec --no-startup-id mpd
# Launch flameshot
exec --no-startup-id flameshot
# Launch green with envy
exec --no-startup-id com.leinardi.gwe --hide-window
# Launch a polkit daemon
exec --no-startup-id /usr/lib/polkit-kde-authentication-agent-1
# Launch KDE Connect on startup
exec --no-startup-id /usr/lib/kdeconnectd
#exec --no-startup-id kdeconnect-indicator
# Apply my wacom tablet config
exec --no-startup-id ~/bin/scripts/wacom-config
# Set menu key as my compose key
exec --no-startup-id setxkbmap -option compose:menu
# Disable screen off
exec --no-startup-id xset s off
exec --no-startup-id xset -dpms
exec --no-startup-id xset s noblank
# Use pactl to adjust volume in PulseAudio.
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status
@ -32,6 +53,13 @@ bindsym XF86AudioPlay exec mpc toggle
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc previous
# Flameshot binds
bindsym Print exec --no-startup-id flameshot screen
bindsym ctrl+Print exec --no-startup-id flameshot gui
# Emoji menu
bindsym $mod+e exec --no-startup-id rofi -show emoji -modi emoji -theme appsmenu
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
@ -41,8 +69,15 @@ bindsym $mod+Return exec --no-startup-id kitty
# Kill focused window
bindsym $mod+Shift+q kill
# Window options menu
bindsym $mod+Shift+w exec --no-startup-id ~/bin/scripts/window-menu
# Utility menu
bindsym $mod+u exec --no-startup-id ~/bin/scripts/utility-menu
# Start dmenu
bindsym $mod+d exec --no-startup-id dmenu_run
bindsym $mod+d exec --no-startup-id dmenu
#bindsym $mod+d exec --no-startup-id rofi -theme appsmenu -show drun
# Change focus
bindsym $mod+h focus left
@ -59,12 +94,6 @@ bindsym $mod+Shift+l move right
# Enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# TODO: Change these hotkeys. Cause they suck.
# 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
@ -75,6 +104,13 @@ gaps outer 0
# Disable borders
for_window [class="^.*"] border pixel 1
# Make my custom timer floating by default
for_window [class="timer"] floating enable
# Make my custom timer "sticky". Meaning it will also be on the active workspace.
for_window [class="timer"] sticky enable
# Disable border for my custom timer.
for_window [class="timer"] border pixel 0
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
@ -112,6 +148,8 @@ bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
assign [class="Kodi"] $ws4
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)

View File

@ -126,7 +126,7 @@ if &compatible
endif
" Required:
set runtimepath+=/home/kalle/.cache/dein/repos/github.com/Shougo/dein.vim
set runtimepath+=/home/kalle/.local/share/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/home/kalle/.local/share/dein')

View File

@ -13,7 +13,9 @@ blur-background = true;
# 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 = "5x5box";
blur-method = "gaussian"
blur-size = 11
blur-deviation = 5
# Exclude conditions for background blur.
@ -21,6 +23,26 @@ blur-kern = "5x5box";
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"class_g = 'timer'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# Shadows #
#################################
# 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'",
"class_g = 'timer'",
"_GTK_FRAME_EXTENTS@:c"
];
@ -32,7 +54,7 @@ blur-background-exclude = [
# `xrender` is the default one.
#
# backend = 'glx'
backend = "xrender";
backend = "glx";
# Enable/disable VSync.
# vsync = false

View File

@ -3,6 +3,7 @@ transparent = #00000000
background = #282a36
background-current = #44475a
foreground = #f8f8f2
button = #2d1349
cyan = #5ba9bd
green = #209a4b
orange = #cf885c
@ -35,9 +36,10 @@ font-0 = "Roboto Mono Nerd Font:pixelsize=12;2"
tray-position = right
tray-background = ${colors.background}
tray-reparent = true
modules-left = i3
modules-center = mpd
modules-center = utility mpd calculator
modules-right = memory pulseaudio du_root date
[module/i3]
@ -73,6 +75,13 @@ label-urgent = %index%
label-urgent-background = ${colors.red}
label-urgent-padding = 2
[module/utility]
type = custom/text
content = "  "
content-background = ${colors.button}
click-left = "bash -c $HOME/.dots/scripts/utilities-menu"
[module/mpd]
type = internal/mpd
@ -91,22 +100,13 @@ label-song = " %artist% - %title% "
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
[module/calculator]
type = custom/text
content = "  "
content-background = ${colors.button}
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
click-left = "rofi -show calc -theme appsmenu -modi calc -no-persist-history -no-show-match -no-sort"
[module/memory]
@ -173,5 +173,4 @@ format-prefix-background = ${colors.yellow}
label = %date% %time%
; vim:ft=dosini

View File

@ -1,12 +1,19 @@
/**
* This theme is intended for a 8x2 items list menu with a headerbar.
*/
configuration {
show-icons: true;
}
@import "shared/settings.rasi"
* {
background-color: transparent;
text-color: @foreground-list;
font: @text-font;
}
#window {
padding: @list-8-window-padding;
}
@ -14,7 +21,7 @@ inputbar,
prompt,
textbox-prompt-colon,
entry {
background-color: @background-light;
background-color: @background;
}
#inputbar {
children: [ prompt, textbox-prompt-colon, entry ];
@ -24,9 +31,16 @@ entry {
#prompt {
padding: @prompt-padding;
background-color: @accent;
text-color: @background;
text-color: @background-focus;
width: 100%;
}
#message {
padding: @list-element-padding;
margin: @list-element-margin;
background-color: @background-focus;
border: @list-element-border;
border-color: @on;
}
#textbox-prompt-colon {
expand: false;
str: " : : ";
@ -40,12 +54,16 @@ entry {
padding: @list-element-padding;
margin: @list-element-margin;
border: @list-element-border;
background-color: @background-light;
border-color: @background-light;
background-color: @background-focus;
border-color: @background-focus;
}
#element.selected {
background-color: @background-focus;
background-color: @background;
text-color: @accent;
border-color: @accent;
}
element-icon {
size: 24px;
}

View File

@ -1,6 +1,6 @@
* {
/* General */
text-font: "Comfortaa 14";
text-font: "Comfortaa 16";
text-font-mono: "RobotoMono Nerd Font Regular 14";
icon-font: "Hurmit Nerd Font Mono 60";
icon-font-small: "Hurmit Nerd Font Mono 24";

11
scripts/click Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
sleep 3
for i in $(seq 250); do
xdotool mousedown 3
sleep 0.010
xdotool mouseup 3
sleep 0.010
done

10
scripts/confirm-menu Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
options="No\nNo\nNo\nNo\nNo\nYes"
selected=$(echo -e $options | rofi -p "$1" -mesg "Are you sure you want to run \"$2\"?" -dmenu -theme appsmenu)
case $selected in
"Yes")
$2
;;
esac

32
scripts/git-stats Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
TOTALS=`git log --shortstat --author=$author | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print files, " ", inserted, " ", deleted }'`
TOTAL_INSERTS=`echo $TOTALS | cut -d' ' -f2`
TOTAL_DELETES=`echo $TOTALS | cut -d' ' -f3`
TOTAL_TOTAL=$(( $TOTAL_INSERTS + $TOTAL_DELETES ))
IFS="
"
for author in `git log --format='%aN' | sort -u`; do
echo $author":"
USER=`git log --shortstat --author=$author | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print files, " ", inserted, " ", deleted }'`
IFS=" "
USER_INSERTS=`echo $USER | cut -d' ' -f2`
USER_DELETES=`echo $USER | cut -d' ' -f3`
USER_TOTAL=`bc <<< "$USER_INSERTS + $USER_DELETES"`
PERC_INSERTS=`bc <<< $USER_INSERTS"* 100 /"$TOTAL_INSERTS`
PERC_DELETES=`bc <<< $USER_DELETES"* 100 /"$TOTAL_DELETES`
PERC_TOTAL=`bc <<< $USER_TOTAL"* 100 /"$TOTAL_TOTAL`
echo " TOTAL: $USER_TOTAL ($PERC_TOTAL%)"
echo " INSERTS: $USER_INSERTS ($PERC_INSERTS%)"
echo " DELETES: $USER_DELETES ($PERC_DELETES%)"
IFS="
"
done

17
scripts/power-menu Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
options="Shutdown\nReboot\nLogout"
selected=$(echo -e $options | rofi -p Power -dmenu -theme appsmenu)
case $selected in
"Shutdown")
confirm-menu "Shutdown?" "poweroff"
;;
"Reboot")
confirm-menu "Reboot?" "reboot"
;;
"Logout")
confirm-menu "Logout?" "i3-msg exit"
;;
esac

11
scripts/screen-share-toggle Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.screen-share" ]; then
screen -S "Screen Share" -X quit
rm "/tmp/$USER.screen-share"
else
screen -dmS "Screen Share" ffmpeg -f x11grab -video_size 1920x1080 -i :0+0,1050 -pix_fmt yuv420p -r 30 -f v4l2 /dev/video9
touch "/tmp/$USER.screen-share"
fi

30
scripts/speedrun-finder Executable file
View File

@ -0,0 +1,30 @@
#!/bin/python
import math
parts = input("First point? ").split(" ")
x1,z1,a1 = float(parts[6]),float(parts[8]),float(parts[9])
if a1 >= 90:
a1 = 180 - a1+90
else:
a1 = -1 * (a1+90)
s1 = -1 * math.tan(math.radians(a1))
i1 = z1 - s1 * x1
parts = input("Second point? ").split(" ")
x2,z2,a2 = float(parts[6]),float(parts[8]),float(parts[9])
if a2 >= 90:
a2 = 180 - a2+90
else:
a2 = -1 * (a2+90)
s2 = -1 * math.tan(math.radians(a2))
i2 = z2 - s2 * x2
x3 = (i2 - i1) / (s1 - s2)
z3 = s1 * x3 + i1
print(f"Stronghold at: {round(x3)}, {round(z3)}")
print(f"In nether: {round(x3/8)}, {round(z3/8)}")

7
scripts/speedrun-timer Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
STARTTIME=$(date +%s.%3N)
echo "End timing with ctrl-c."
while true; do
DUR=$(printf "%.3f" $(bc <<< $(date +%s.%3N)-$STARTTIME))
printf "\r%s " $(date +%T.%3N -u -d "@${DUR}")
done

3
scripts/start-krunner Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
krunner -d

3
scripts/start-obs Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
obs --startreplaybuffer --minimize-to-tray

21
scripts/timer-launcher Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
hours=$(echo -e "0\n1\n2\n3\n4\n5\n6" | rofi -dmenu -theme appsmenu)
if [ -z $hours ]; then
exit 0
fi
minutes=$(echo -e "0\n5\n10\n15\n30\n45" | rofi -dmenu -theme appsmenu)
if [ -z $minutes ]; then
exit 0
fi
seconds=$(echo -e "0\n10\n15\n30\n45" | rofi -dmenu -theme appsmenu)
if [ -z $seconds ]; then
exit 0
fi
timer $hours $minutes $seconds &

40
scripts/utilities-menu Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/
SCREEN_SHARE_OPTION="Start screen share"
if [ -f "/tmp/$USER.screen-share" ]; then
SCREEN_SHARE_OPTION="Stop screen share"
fi
WEBCAM_OPTION="Start good webcam"
if [ -f "/tmp/$USER.webcam" ]; then
WEBCAM_OPTION="Stop good webcam"
fi
DUNST_PAUSE_OPTION="Pause dunst notifications"
if [[ $(dunstctl is-paused) == "true" ]]; then
DUNST_PAUSE_OPTION="Resume dunst notifications"
fi
options="Power menu\nTimer\n$SCREEN_SHARE_OPTION\n$WEBCAM_OPTION\n$DUNST_PAUSE_OPTION"
selected=$(echo -e $options | rofi -p Utility -dmenu -theme appsmenu)
case $selected in
"Timer")
timer-launcher
;;
"$SCREEN_SHARE_OPTION")
screen-share-toggle
;;
"$WEBCAM_OPTION")
webcam-toggle
;;
"Power menu")
power-menu
;;
"$DUNST_PAUSE_OPTION")
dunstctl set-paused toggle
;;
esac

5
scripts/wacom-config Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
xsetwacom --set "Wacom Intuos3 6x8 Pad pad" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen stylus" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen eraser" MapToOutput HEAD-0
xsetwacom --set "Wacom Intuos3 6x8 Pen cursor" MapToOutput HEAD-0

11
scripts/webcam-toggle Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.webcam" ]; then
screen -S "Webcam" -X quit
rm "/tmp/$USER.webcam"
else
screen -dmS "Webcam" ffmpeg -video_size 1920x1080 -framerate 30 -c:v mjpeg -i /dev/video0 -c:v mjpeg -vf lenscorrection=k1=-0.1:k2=-0.05 -f v4l2 /dev/video8
touch "/tmp/$USER.webcam"
fi

20
scripts/window-menu Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
options="Close\nToggle floating\nToggle sticky\nToggle fullscreen"
selected=$(echo -e $options | rofi -p Window -dmenu -theme appsmenu)
case $selected in
"Close")
i3-msg "kill"
;;
"Toggle floating")
i3-msg "floating toggle"
;;
"Toggle sticky")
i3-msg "sticky toggle"
;;
"Toggle fullscreen")
i3-msg "fullscreen toggle"
;;
esac

View File

@ -1,6 +1,4 @@
#!/bin/env bash
set -x
cd $(dirname $0)
DOTS_DIR=$(pwd)
@ -67,7 +65,7 @@ KITTY_DIR="$HOME/.config/kitty"
# Check if the kitty directory exists. If it does we skip this part of the script and inform the user.
if [ -d $KITTY_DIR ]; then
echo "[Kitty] Configuration directory exists. Skipping."
echo "[KITTY] Configuration directory exists. Skipping."
else
ln -s $DOTS_DIR/kitty $KITTY_DIR
fi
@ -97,7 +95,19 @@ ROFI_DIR="$HOME/.config/rofi"
# Check if the rofi directory exists. If it does we skip this part of the script and inform the user.
if [ -d $ROFI_DIR ]; then
echo "[RDF] Configuration file exists. Skipping."
echo "[ROFI] Configuration file exists. Skipping."
else
ln -s $DOTS_DIR/rofi $ROFI_DIR
fi
# Scripts
SCRIPT_DIR="$HOME/bin/scripts"
# Check if the scripts directory exists. If it does we skip this part of the script and inform the user.
if [ -d $SCRIPT_DIR ]; then
echo "[SCRIPTS] Configuration directory exists. Skipping."
else
mkdir "$HOME/bin"
ln -s $DOTS_DIR/scripts $SCRIPT_DIR
fi

View File

@ -1,8 +1,6 @@
autoload -Uz compinit promptinit
compinit
promptinit
autoload compinit
prompt suse
compinit
# Menu driven command completion.
zstyle ':completion:*' menu select
@ -10,22 +8,55 @@ zstyle ':completion:*' menu select
setopt COMPLETE_ALIASES
# Allow ZSH to complete in priviliged environments.
zstyle ':completion::complete:*' gain-privileges 1
## case-insensitive (uppercase from lowercase) completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
autoload -U colors && colors
# VI Mode
bindkey -v
# When typing a directory name cd to it.
setopt autocd
# Add ~/bin and ~/bin.scripts to my path
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/:$HOME/.emacs.d/bin/
# Set the prompt.
export PS1="[%F{6}%n%f@%M %F{4}%(5~|%-1~/…/%3~|%4~)%f] "
# Function to download a full youtube playlist using youtube-dl.
function playlist-dl {
echo "Looking up playlist name..."
pl_line=$(youtube-dl --flat-playlist "$1" | grep "\[youtube:playlist\] playlist")
pl_name=$(echo ${pl_line:28} | awk -F ':' '{print $1}' | tr '/' ' ')
pl_line=$(youtube-dl --flat-playlist "$1" | grep "\[download\] Downloading playlist: ")
pl_name=$(echo ${pl_line:33} | tr '/' ' ')
echo "Found playlist by name: $pl_name"
echo "Downloading it into directory: $pl_name"
mkdir "$pl_name"
cd "$pl_name"
youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
cd ../
cd ../
}
function cd-courses {
dir=$(ls ~/Uni | fzf)
cd ~/Uni/$dir
}
function cd-projects {
dir=$(find ~/Projects -maxdepth 3 -type d | fzf)
cd $dir
}
function script-edit {
scripts=$(ls ~/bin/scripts/)"$(echo -e "\nzshrc")"
selected=$(echo $scripts | fzf)
case $selected in
"zshrc")
nvim ~/.zshrc
;;
*)
nvim ~/bin/scripts/$selected
;;
esac
}
function compile {
@ -38,9 +69,15 @@ export EDITOR=nvim
# Aliases
alias ls="lsd"
alias grep="grep --color"
alias p="sudo pacman"
alias vim="nvim"
alias vi="nvim"
alias open="xdg-open"
alias gg="git-graph --model simple --color always | less -r"
alias gi="gitinspector --grading=true -f \"java,fxml,css,py,html\" -F html -x author:\"OOP Project Team\""
alias se="script-edit"
alias c="cd-courses"
alias proj="cd-projects"
# Add fish like syntax highlighting to zsh.
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh