This commit is contained in:
Marco Thomas
2022-04-29 19:58:47 +02:00
parent c3d0c68bae
commit d6e4d8d62f
23 changed files with 243 additions and 1307 deletions

View File

@@ -409,7 +409,6 @@ Sometimes I want to see all of my files.
:straight t)
#+end_src
*** Mini buffers
*** ivy
Ivy - a generic completion frontend for Emacs.
Swiper - isearch with an overview, and more. Oh, man!

View File

@@ -1,3 +1,5 @@
PATH=$PATH:$HOME/.dots/scripts:$HOME/.cargo/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$HOME/.cabal/bin
EDITOR=vim
VISUAL=vim
_JAVA_AWT_WM_NONREPARENTING=1
SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket

7
files/sway/.config/sway/bar.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
date=$(date +'%A, %d.%m %R')
battery=$(cat /sys/class/power_supply/BAT1/capacity)
echo $battery"% <> "$date" <>"

View File

@@ -0,0 +1,197 @@
# config for sway
# Read `man 5 sway` for a complete reference.
# Font in sway
font pango: JuliaMono 9
# Variables
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# Color
set $yellow #b58900
set $orange #cb4b16
set $red #dc322f
set $magenta #d33682
set $violet #6c71c4
set $blue #268bd2
set $cyan #2aa198
set $green #859900
set $baseA3 #fdf6e3
set $baseA2 #eee8d5
set $baseA1 #93a1a1
set $baseA0 #839496
set $baseB0 #657b83
set $baseB1 #586e75
set $baseB2 #073642
set $baseB3 #002b36
set $custom #e1cab3
# clientclass border backgr. text indicator
client.focused $green $green $baseB3 $blue
client.focused_inactive $baseA2 $baseA2 $baseB2 $violet
client.unfocused $baseA2 $baseA2 $baseB1 $baseA1
client.urgent $yellow $yellow $baseB3 $orange
# Terminal
set $term gnome-terminal
# Application Launcer
set $menu dmenu_path | bemenu -l 5 --tf "#859900" --hf "#859900" --nb "#002b36" --hb "#002b36" --tb "#002b36" --fb "#002b36" --fn "JuliaMono 13" | xargs swaymsg exec --
# Output configuration
set $laptop eDP-1
output * bg ~/images/wallpaper/wallpaper.png fill
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# Idle configuration
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
# Input configuration
input type:pointer {
accel_profile "flat"
}
input type:keyboard {
xkb_layout eu
xkb_options caps:escape
}
# Key bindings
# Basics:
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+Backspace kill
# Start your launcher
bindsym $mod+d exec $menu
# Floating
floating_modifier $mod normal
# Screenshot
bindsym $mod+Shift+s exec wayshot -s "$(slurp -f '%x %y %w %h')" --stdout | wl-copy
# Reload the configuration file
bindsym $mod+Shift+r reload
# Logout etc
bindsym $mod+Backspace exec wlogout
# Show notifications
bindsym $mod+v exec swaync-client -t -sw
# Brightness
bindsym XF86MonBrightnessUp exec light -A 10
bindsym XF86MonBrightnessDown exec light -U 10
# Audio
bindsym XF86AudioPlay exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
# Moving around:
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow 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
# Workspaces:
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
# Layout stuff:
workspace_layout stacking
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
for_window [title="shotman"] move position 30 30, floating enable
# Status Bar
# man 5 sway-bar
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while ~/.config/sway/bar.sh; do sleep 1; done
colors {
separator $blue
background $baseA3
statusline $baseB2
# workclass border backgr. text
focused_workspace $green $green $baseB3
active_workspace $baseA3 $baseA3 $baseB1
inactive_workspace $baseA3 $baseA3 $baseB1
urgent_workspace $orange $orange $baseB3
}
}
# Startup programs
exec syncthing
exec keepassxc
exec swaync
# Include some defaults
include /etc/sway/config.d/*

View File

@@ -1,10 +1,5 @@
" __ _
" / / (_)
" / /_ ___ _ __ ___ _ __ ___
" / /\ \ / / | '_ ` _ \| '__/ __|
" _ / / \ V /| | | | | | | | | (__
" (_)_/ \_/ |_|_| |_| |_|_| \___|
"
" ~/.vimrc
"
" ~ M. Thomas
let mapleader = "\<Space>"

View File

@@ -1,9 +1,4 @@
# __ _
# / / | |
# / /______| |__ _ __ ___
# / /_ / __| '_ \| '__/ __|
# _ / / / /\__ \ | | | | | (__
# (_)_/ /___|___/_| |_|_| \___|
# ~/.zshrc
#
# ~ M. Thomas
@@ -14,21 +9,17 @@ precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
LN=$'\n'
ICON="%(?.%{$fg[green]%}.%{$fg[red]%})λ"
DIR="%{$fg[blue]%}%~"
GIT="%{$fg[red]%}\$vcs_info_msg_0_"
HOSTN="%{$fg[yellow]%}%m "
# if [[ -n "$SSH_CONNECTION" ]]; then
PC="%{$fg[yellow]%}%m "
# fi
export PROMPT="${PC}${DIR}${GIT} ${ICON}%{$reset_color%} "
export PROMPT="${HOSTN}${DIR}${GIT} ${ICON}%{$reset_color%} "
zstyle ':vcs_info:git:*' formats ' %b '
# show info in bar
case $TERM in
(*xterm* | rxvt | alacritty)
# This is seen when the shell prompts for input.
function precmd {
print -Pn "\e]0;%m: %(1j,%j job%(2j|s|) - ,)%~\a"
@@ -52,7 +43,7 @@ alias cp='cp -i' # Ask before removal
alias mv='mv -i' # Ask before removal
# tools
ocr () {
ocr() {
if [ -z $1 ]; then
echo "Please input a file."
return
@@ -60,11 +51,29 @@ ocr () {
ocrmypdf -l deu+eng+jpn --output-type pdf $1 OCR_$1
}
alias conservation='cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
conservation() {
location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
if [ -z $1 ]; then
cat $location
elif [ $1 = '0' ] || [ $1 = '1' ]; then
echo $1 | sudo tee $location
fi
}
powermode() {
location='/sys/firmware/acpi/platform_profile'
if [ -z $1 ]; then
echo "Current:" $(cat $location)
echo "Can be one of:" $(cat /sys/firmware/acpi/platform_profile_choices)
elif [ $1 = 'low-power' ] || [ $1 = 'balanced' ] || [ $1 = 'performance' ]; then
echo $1 | sudo tee $location
fi
}
alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash'
alias nssh='SSH_AUTH_SOCK= ssh'
alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"'
#
alias suspend='systemctl suspend'
# troll
alias powershell='clear && PS1="windowsadm@powershell$ " bash'
alias mucdai='rm -rf'
@@ -162,22 +171,6 @@ bindkey '^G' "rga-fzf"
## fzf Bindings in zsh (C-r and C-t)
if [[ -x $(which fzf 2> /dev/null) ]]
then
# ____ ____
# / __/___ / __/
# / /_/_ / / /_
# / __/ / /_/ __/
# /_/ /___/_/ key-bindings.zsh
#
# - $FZF_TMUX_OPTS
# - $FZF_CTRL_T_COMMAND
# - $FZF_CTRL_T_OPTS
# - $FZF_CTRL_R_OPTS
# - $FZF_ALT_C_COMMAND
# - $FZF_ALT_C_OPTS
# Key bindings
# ------------
# The code at the top and the bottom of this file is the same as in completion.zsh.
# Refer to that file for explanation.
if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then
@@ -202,7 +195,7 @@ then
[[ -o interactive ]] || return 0
# CTRL-T - Paste the selected file path(s) into the command line
# CTRL-F - Paste the selected file path(s) into the command line
__fsel() {
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
-o -type f -print \
@@ -241,31 +234,6 @@ then
}
zle -N fzf-redraw-prompt
# ALT-C - cd into the selected directory
fzf-cd-widget() {
local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
-o -type d -print 2> /dev/null | cut -b3-"}"
setopt localoptions pipefail no_aliases 2> /dev/null
local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"
if [[ -z "$dir" ]]; then
zle redisplay
return 0
fi
if [ -z "$BUFFER" ]; then
BUFFER="cd ${(q)dir}"
zle accept-line
else
print -sr "cd ${(q)dir}"
cd "$dir"
fi
local ret=$?
unset dir # ensure this doesn't end up appearing in prompt expansion
zle fzf-redraw-prompt
return $ret
}
zle -N fzf-cd-widget
bindkey '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line
fzf-history-widget() {
local selected num